faxage 1.2.1 → 1.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a03e5a557de75e3e23b481552f7dac9d652496ca6a013978c51580f3b88c50d
4
- data.tar.gz: ce9c8db7811d2c0f587aef771d6a425d4b465f5822f2da339059197524819a52
3
+ metadata.gz: f9b7534be52991e73089c5258d35d4cd791c2fbd7370c1a005946bb292f3b940
4
+ data.tar.gz: 076cb60e728a22f1bd7c7b98c761abfcb3c8ec572fb4b041f642260970ff3014
5
5
  SHA512:
6
- metadata.gz: 051ae752d2f1e6a3a8d17df6e3b7c8cefda75c242a846e7619f704cc46ce7637e0483d3ba5c6ed83c5c483b6b5cc73f2d4b7873c420b827ec310b7d23882f7a7
7
- data.tar.gz: 14eaa675be8861717f7bf9596703adba1a2b8549e1c0e731f9db6980e26bcf661e7cbc8d7dc914f8c1e10b0c201f9255745d535cb868575fb873c11e6f85bb9e
6
+ metadata.gz: 82aa232fd6cdc0ae82adae99df8b661b365c2d27bc66475f0cea96cca5ac89af3a191298618ddd356ac029b1f994ca0328e787e7d720bca735a98dff90c48ebb
7
+ data.tar.gz: 9b683d9d4de97e2eda7d36953aa9fa96ac1274342f033f5deccbdb1f2927249f60994864affa1855f45936d9e44978e94db348561e0290f9a9ce43fa265d4918
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- faxage (1.2.1)
4
+ faxage (1.2.2)
5
5
  httparty
6
6
 
7
7
  GEM
@@ -40,4 +40,4 @@ DEPENDENCIES
40
40
  rspec (>= 3.4)
41
41
 
42
42
  BUNDLED WITH
43
- 1.17.1
43
+ 2.1.4
@@ -293,5 +293,40 @@ module Faxage
293
293
  return response.parsed_response
294
294
  end
295
295
  end
296
+
297
+ def dlstatus(jobid:, viewtype: 'pdf')
298
+ # This operation is used to download a sent fax image.
299
+
300
+ subdirectory = "/httpsfax.php"
301
+
302
+ body = {
303
+ operation: "dlstatus",
304
+ username: username,
305
+ company: company,
306
+ password: password,
307
+ jobid: jobid,
308
+ viewtype: viewtype
309
+ }
310
+
311
+ response = self.class.post(subdirectory, body: body)
312
+
313
+ if response.parsed_response.nil?
314
+ raise NoResponseError.new("An empty response was returned from Faxage.")
315
+ elsif response.parsed_response.include?("ERR01: Database connection failed")
316
+ raise FaxageInternalError.new("Internal FAXAGE error.")
317
+ elsif response.parsed_response.include?("ERR02: Login incorrect")
318
+ raise LoginError.new("One or more of username, company, password is incorrect or your account is disabled for some reason.")
319
+ elsif response.parsed_response.include?("ERR06: No jobs to display or job id specified not found")
320
+ raise InvalidJobIdError.new("The jobid you passed was not found")
321
+ elsif response.parsed_response.include?("ERR08: Unknown operation")
322
+ raise UnknownOperationError.new("Either operation is not correctly hard coded or the POST was bad, the POST contents are returned for debugging purposes. #{response.parsed_response}")
323
+ elsif response.parsed_response.include?("ERR24: File is not yet converted")
324
+ raise NoFilesError.new("Images can only be retrieved after the file(s) have actually been imaged (I.e.: The fax must either be In Queue or completed to be able to retrieve an image)")
325
+ elsif response.parsed_response.include?("ERR25: File does not exist")
326
+ raise NoFilesError.new("This can be either an internal error, or if the status is a ‘Failed Conversion’, then there is no image to retrieve")
327
+ else
328
+ return response.parsed_response
329
+ end
330
+ end
296
331
  end
297
- end
332
+ end
@@ -1,3 +1,3 @@
1
1
  module Faxage
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faxage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Dias
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-05 00:00:00.000000000 Z
11
+ date: 2022-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -98,7 +98,7 @@ homepage: https://github.com/diasks2/faxage
98
98
  licenses:
99
99
  - MIT
100
100
  metadata: {}
101
- post_install_message:
101
+ post_install_message:
102
102
  rdoc_options: []
103
103
  require_paths:
104
104
  - lib
@@ -113,9 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  requirements: []
116
- rubyforge_project:
117
- rubygems_version: 2.7.6
118
- signing_key:
116
+ rubygems_version: 3.1.6
117
+ signing_key:
119
118
  specification_version: 4
120
119
  summary: Faxage is a Ruby wrapper for the faxage.com API
121
120
  test_files: []