docraptor 2.0.0 → 3.1.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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.docker_env.list +5 -0
  3. data/.docker_mounts.list +4 -0
  4. data/.generator-language-identifier +1 -0
  5. data/.generator-revision +1 -0
  6. data/.github/pull_request_template.txt +17 -0
  7. data/.gitignore +20 -14
  8. data/.gitlab-ci.yml +26 -0
  9. data/.openapi-generator/FILES +32 -0
  10. data/.openapi-generator/VERSION +1 -0
  11. data/{.swagger-codegen-ignore → .openapi-generator-ignore} +13 -7
  12. data/.review/README.md +16 -0
  13. data/.review/generated_files/.gitignore +39 -0
  14. data/.review/generated_files/README.md +108 -0
  15. data/.review/generated_files/docs/AsyncDoc.md +18 -0
  16. data/.review/generated_files/docs/Doc.md +50 -0
  17. data/.review/generated_files/docs/DocApi.md +503 -0
  18. data/.review/generated_files/docs/DocStatus.md +28 -0
  19. data/.review/generated_files/docs/PrinceOptions.md +82 -0
  20. data/.review/generated_files/spec/api/doc_api_spec.rb +112 -0
  21. data/{spec → .review/generated_files/spec}/api_client_spec.rb +6 -21
  22. data/{spec → .review/generated_files/spec}/configuration_spec.rb +6 -6
  23. data/.review/generated_files/spec/models/async_doc_spec.rb +34 -0
  24. data/.review/generated_files/spec/models/doc_spec.rb +138 -0
  25. data/.review/generated_files/spec/models/doc_status_spec.rb +64 -0
  26. data/.review/generated_files/spec/models/prince_options_spec.rb +234 -0
  27. data/{spec → .review/generated_files/spec}/spec_helper.rb +3 -3
  28. data/.rubocop.yml +148 -0
  29. data/.runtime-environments +13 -0
  30. data/.travis.yml +9 -7
  31. data/CHANGELOG.md +8 -0
  32. data/Gemfile +3 -1
  33. data/README.md +8 -8
  34. data/Rakefile +1 -2
  35. data/docraptor.gemspec +5 -19
  36. data/docraptor.yaml +283 -284
  37. data/examples/async.rb +24 -30
  38. data/examples/hosted_async.rb +21 -33
  39. data/examples/hosted_sync.rb +19 -32
  40. data/examples/sync.rb +20 -26
  41. data/gemfiles/Gemfile.2.5.lock +70 -0
  42. data/gemfiles/Gemfile.2.6.lock +70 -0
  43. data/gemfiles/Gemfile.2.7.lock +70 -0
  44. data/gemfiles/Gemfile.3.0.lock +70 -0
  45. data/gemfiles/Gemfile.3.1.lock +72 -0
  46. data/gemfiles/Gemfile.3.2.lock +72 -0
  47. data/gemfiles/Gemfile.3.3.lock +72 -0
  48. data/{swagger-config.json → generator-config.json} +3 -2
  49. data/lib/docraptor/api/doc_api.rb +180 -85
  50. data/lib/docraptor/api_client.rb +91 -90
  51. data/lib/docraptor/api_error.rb +23 -3
  52. data/lib/docraptor/configuration.rb +101 -15
  53. data/lib/docraptor/models/async_doc.rb +53 -18
  54. data/lib/docraptor/models/doc.rb +80 -50
  55. data/lib/docraptor/models/doc_status.rb +58 -23
  56. data/lib/docraptor/models/prince_options.rb +149 -75
  57. data/lib/docraptor/version.rb +4 -4
  58. data/lib/docraptor.rb +3 -3
  59. data/script/clean +2 -2
  60. data/script/console +5 -0
  61. data/script/docker +56 -0
  62. data/script/fix_gemspec.rb +3 -18
  63. data/script/generate_language +43 -4
  64. data/script/inside_container/README.md +6 -0
  65. data/script/inside_container/test +87 -0
  66. data/script/post_generate_language +8 -2
  67. data/script/release +13 -0
  68. data/script/setup +25 -14
  69. data/script/swagger +6 -33
  70. data/script/test +30 -27
  71. data/test/async.rb +2 -2
  72. data/test/expire_hosted.rb +2 -2
  73. data/test/hosted_async.rb +7 -1
  74. data/test/hosted_sync.rb +2 -2
  75. data/test/iframes_default.rb +40 -0
  76. data/test/iframes_false.rb +40 -0
  77. data/test/iframes_true.rb +40 -0
  78. data/test/prince_options.rb +45 -0
  79. data/test/sync.rb +2 -2
  80. data/test/xlsx.rb +10 -3
  81. metadata +52 -214
  82. data/.swagger-codegen/VERSION +0 -1
  83. data/.swagger-revision +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfd3d5b8d3364bd02c04b712136686d4a714f6cd3ab3fced0c7efae7e9709ee0
4
- data.tar.gz: 89d4fb74883b56c49a71eef45487534474a8f9fa0ae8fc065a592e6a1ae7340c
3
+ metadata.gz: ae5113eeec4fbe7b113fe5f92c8fb7175e672beadb72ab3e96fd458484e8e5d2
4
+ data.tar.gz: 8923f22767e21a57af7afbf6082b9da27a23e2781ecd35947f2229ecf9ba889a
5
5
  SHA512:
6
- metadata.gz: 964a77fd28bb343dd5410b01e5b6981f631fd5c0ed047225b2dc048b8070249d9d704bb7a4bd289d154b406e8b794a2ac71e7d031af047bb8c47a0500c86b29d
7
- data.tar.gz: 90787b9656e2455038833d260caf62b7aa48ce833d3de5e1483c1a9893feed6e0deb5d4cb995ee565510c0c3bfabe7e851decdf5cae00fd0389dc07d8319ff90
6
+ metadata.gz: 72383235430a25aa8faa722dcdc353376ef8d9bffd2e663698b09b3149895c5bb63b3c699897ffaa7627e5275f4477017322583d6e8ebcff77d3b8136694d7ac
7
+ data.tar.gz: cb9a0f14cc1da9022ffd07cce3ad670e4eb742285bb6a13074af4b7edf5418da97b3d106c8cb59ec1777f21850a7d01ce3f35ee18043229de8680518d1432502
data/.docker_env.list ADDED
@@ -0,0 +1,5 @@
1
+ TRACE
2
+ TEST_OUTPUT_DIR=/app/tmp/test_output
3
+ BUNDLE_PATH=/app/tmp/cache/bundle
4
+ INSIDE_DOCKER=true
5
+ SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
@@ -0,0 +1,4 @@
1
+ # Specify mounts in `docker run --volume` format (source:target). Bash
2
+ # expressions will be evaluated.
3
+ $(pwd)/tmp/cache_${image//:/_}:/app/tmp/cache
4
+ /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock
@@ -0,0 +1 @@
1
+ ruby
@@ -0,0 +1 @@
1
+ v6.6.0
@@ -0,0 +1,17 @@
1
+ Why is this change needed?
2
+ --------------------------
3
+
4
+ How does it address the issue?
5
+ ------------------------------
6
+
7
+ Any links to any relevant tickets, articles, or other resources?
8
+ ---------------------------------------------------------------
9
+
10
+ Any screenshots?
11
+ ----------------
12
+
13
+ Did you complete all of the following?
14
+ --------------------------------------
15
+ - Run test suite?
16
+ - Add new tests?
17
+ - Consider security implications and practices?
data/.gitignore CHANGED
@@ -1,3 +1,6 @@
1
+ # Generated by: https://openapi-generator.tech
2
+ #
3
+
1
4
  *.gem
2
5
  *.rbc
3
6
  /.config
@@ -25,21 +28,24 @@ build/
25
28
  /.bundle/
26
29
  /vendor/bundle
27
30
  /lib/bundler/man/
28
- Gemfile.lock
29
- .ruby-version
30
- .ruby-gemset
31
- .rvmrc
32
- .rubocop.yml
33
31
 
34
- ## Ignore dumb OSX files
35
- .DS_Store
36
- Thumbs.db
32
+ # for a library or gem, you might want to ignore these files since the code is
33
+ # intended to run in multiple environments; otherwise, check them in:
34
+ # Gemfile.lock
35
+ # .ruby-version
36
+ # .ruby-gemset
37
+
38
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
39
+ .rvmrc
37
40
 
38
- ## Ignore baked in swagger generator
39
- swagger-codegen
40
41
 
41
- ## Ignore dumb emacs files
42
- *~
42
+ # EB Customizations
43
43
 
44
- ## Ignore files that contain special keys
45
- .docraptor_key
44
+ # Ignore this so we don't see a git modified status on each test run. Currently
45
+ # the tests copy a different file into place for each ruby version, because the
46
+ # same lock file won't work with every ruby version. We want those lock files
47
+ # committed because it helps ensure the tests pass on this repo by ensuring a
48
+ # static set of dependencies is used for each ruby version. A future improvement
49
+ # could be to use docker to mount the correct lock file over top of the top
50
+ # level lock file on each docker run, but that's a future exercise.
51
+ Gemfile.lock
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,26 @@
1
+ .ruby: &ruby
2
+ variables:
3
+ LANG: "C.UTF-8"
4
+ before_script:
5
+ - ruby -v
6
+ - bundle config set --local deployment true
7
+ - bundle install -j $(nproc)
8
+ parallel:
9
+ matrix:
10
+ - RUBY_VERSION: ['2.7', '3.0', '3.1']
11
+ image: "ruby:$RUBY_VERSION"
12
+ cache:
13
+ paths:
14
+ - vendor/ruby
15
+ key: 'ruby-$RUBY_VERSION'
16
+
17
+ gem:
18
+ extends: .ruby
19
+ script:
20
+ - bundle exec rspec
21
+ - bundle exec rake build
22
+ - bundle exec rake install
23
+ artifacts:
24
+ paths:
25
+ - pkg/*.gem
26
+
@@ -0,0 +1,32 @@
1
+ .gitignore
2
+ .gitlab-ci.yml
3
+ .rspec
4
+ .rubocop.yml
5
+ .travis.yml
6
+ Gemfile
7
+ README.md
8
+ Rakefile
9
+ docraptor.gemspec
10
+ docs/AsyncDoc.md
11
+ docs/Doc.md
12
+ docs/DocApi.md
13
+ docs/DocStatus.md
14
+ docs/PrinceOptions.md
15
+ lib/docraptor.rb
16
+ lib/docraptor/api/doc_api.rb
17
+ lib/docraptor/api_client.rb
18
+ lib/docraptor/api_error.rb
19
+ lib/docraptor/configuration.rb
20
+ lib/docraptor/models/async_doc.rb
21
+ lib/docraptor/models/doc.rb
22
+ lib/docraptor/models/doc_status.rb
23
+ lib/docraptor/models/prince_options.rb
24
+ lib/docraptor/version.rb
25
+ spec/api/doc_api_spec.rb
26
+ spec/api_client_spec.rb
27
+ spec/configuration_spec.rb
28
+ spec/models/async_doc_spec.rb
29
+ spec/models/doc_spec.rb
30
+ spec/models/doc_status_spec.rb
31
+ spec/models/prince_options_spec.rb
32
+ spec/spec_helper.rb
@@ -0,0 +1 @@
1
+ 6.6.0
@@ -22,11 +22,17 @@
22
22
  # Then explicitly reverse the ignore rule for a single file:
23
23
  #!docs/README.md
24
24
 
25
- # Can't Touch This. Dun-dun-dun-dun. Dun dun. Dun dun.
26
- README.md
27
- CHANGELOG.md
25
+
26
+ # This seems to be a script related to developing openapi-generator and making
27
+ # new test APIs.
28
28
  git_push.sh
29
- docs/
30
- .gitignore
31
- LICENSE
32
- Rakefile
29
+
30
+ # Don't ignore this because we want to review the generated content to see if we
31
+ # should update our own readme similarly. The most common example is an update
32
+ # to the supported runtime versions, but it could also be an update to the
33
+ # recommended usage that we would want to use.
34
+ !README.md
35
+
36
+ # Don't ignore this because we want to know about new files that the generator
37
+ # ignores.
38
+ !.gitignore
data/.review/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # Review newly generated files
2
+
3
+ This directory helps with review of generated files where we lagely want
4
+ the content to be custom.
5
+
6
+ The project `README.md` is a good example. We heavily custimize
7
+ `README.md` based on our particular use case. There are also important
8
+ changes to the generated `README.md` that should be reviewed when it is
9
+ updated. These include things like new minimum language versions, or
10
+ client API changes.
11
+
12
+ If you add the `README.md` to the `.openapi-generator-ignore` list then
13
+ you never see the updates, making it easy to miss things. If you don't
14
+ add it to the `.openapi-generator-ignore` list then any uncommitted
15
+ updates to the `README.md` are lost when running
16
+ `script/generate_language`.
@@ -0,0 +1,39 @@
1
+ # Generated by: https://openapi-generator.tech
2
+ #
3
+
4
+ *.gem
5
+ *.rbc
6
+ /.config
7
+ /coverage/
8
+ /InstalledFiles
9
+ /pkg/
10
+ /spec/reports/
11
+ /spec/examples.txt
12
+ /test/tmp/
13
+ /test/version_tmp/
14
+ /tmp/
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+
21
+ ## Documentation cache and generated files:
22
+ /.yardoc/
23
+ /_yardoc/
24
+ /doc/
25
+ /rdoc/
26
+
27
+ ## Environment normalization:
28
+ /.bundle/
29
+ /vendor/bundle
30
+ /lib/bundler/man/
31
+
32
+ # for a library or gem, you might want to ignore these files since the code is
33
+ # intended to run in multiple environments; otherwise, check them in:
34
+ # Gemfile.lock
35
+ # .ruby-version
36
+ # .ruby-gemset
37
+
38
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
39
+ .rvmrc
@@ -0,0 +1,108 @@
1
+ # docraptor
2
+
3
+ DocRaptor - the Ruby gem for the DocRaptor
4
+
5
+ A native client library for the DocRaptor HTML to PDF/XLS service.
6
+
7
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
+
9
+ - API version: 2.0.0
10
+ - Package version: 3.1.0
11
+ - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
+
13
+ ## Installation
14
+
15
+ ### Build a gem
16
+
17
+ To build the Ruby code into a gem:
18
+
19
+ ```shell
20
+ gem build docraptor.gemspec
21
+ ```
22
+
23
+ Then either install the gem locally:
24
+
25
+ ```shell
26
+ gem install ./docraptor-3.1.0.gem
27
+ ```
28
+
29
+ (for development, run `gem install --dev ./docraptor-3.1.0.gem` to install the development dependencies)
30
+
31
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
+
33
+ Finally add this to the Gemfile:
34
+
35
+ gem 'docraptor', '~> 3.1.0'
36
+
37
+ ### Install from Git
38
+
39
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
40
+
41
+ gem 'docraptor', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
42
+
43
+ ### Include the Ruby code directly
44
+
45
+ Include the Ruby code directly using `-I` as follows:
46
+
47
+ ```shell
48
+ ruby -Ilib script.rb
49
+ ```
50
+
51
+ ## Getting Started
52
+
53
+ Please follow the [installation](#installation) procedure and then run the following code:
54
+
55
+ ```ruby
56
+ # Load the gem
57
+ require 'docraptor'
58
+
59
+ # Setup authorization
60
+ DocRaptor.configure do |config|
61
+ # Configure HTTP basic authorization: basicAuth
62
+ config.username = 'YOUR_USERNAME'
63
+ config.password = 'YOUR_PASSWORD'
64
+ end
65
+
66
+ api_instance = DocRaptor::DocApi.new
67
+ doc = DocRaptor::Doc.new({name: 'name_example', document_type: 'pdf'}) # Doc |
68
+
69
+ begin
70
+ result = api_instance.create_async_doc(doc)
71
+ p result
72
+ rescue DocRaptor::ApiError => e
73
+ puts "Exception when calling DocApi->create_async_doc: #{e}"
74
+ end
75
+
76
+ ```
77
+
78
+ ## Documentation for API Endpoints
79
+
80
+ All URIs are relative to *https://api.docraptor.com*
81
+
82
+ Class | Method | HTTP request | Description
83
+ ------------ | ------------- | ------------- | -------------
84
+ *DocRaptor::DocApi* | [**create_async_doc**](docs/DocApi.md#create_async_doc) | **POST** /async_docs |
85
+ *DocRaptor::DocApi* | [**create_doc**](docs/DocApi.md#create_doc) | **POST** /docs |
86
+ *DocRaptor::DocApi* | [**create_hosted_async_doc**](docs/DocApi.md#create_hosted_async_doc) | **POST** /hosted_async_docs |
87
+ *DocRaptor::DocApi* | [**create_hosted_doc**](docs/DocApi.md#create_hosted_doc) | **POST** /hosted_docs |
88
+ *DocRaptor::DocApi* | [**expire**](docs/DocApi.md#expire) | **PATCH** /expire/{id} |
89
+ *DocRaptor::DocApi* | [**get_async_doc**](docs/DocApi.md#get_async_doc) | **GET** /download/{id} |
90
+ *DocRaptor::DocApi* | [**get_async_doc_status**](docs/DocApi.md#get_async_doc_status) | **GET** /status/{id} |
91
+
92
+
93
+ ## Documentation for Models
94
+
95
+ - [DocRaptor::AsyncDoc](docs/AsyncDoc.md)
96
+ - [DocRaptor::Doc](docs/Doc.md)
97
+ - [DocRaptor::DocStatus](docs/DocStatus.md)
98
+ - [DocRaptor::PrinceOptions](docs/PrinceOptions.md)
99
+
100
+
101
+ ## Documentation for Authorization
102
+
103
+
104
+ Authentication schemes defined for the API:
105
+ ### basicAuth
106
+
107
+ - **Type**: HTTP basic authentication
108
+
@@ -0,0 +1,18 @@
1
+ # DocRaptor::AsyncDoc
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **status_id** | **String** | The identifier used to get the status of the document using the status API. | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'docraptor'
13
+
14
+ instance = DocRaptor::AsyncDoc.new(
15
+ status_id: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,50 @@
1
+ # DocRaptor::Doc
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | A name for identifying your document. | |
8
+ | **document_type** | **String** | The type of document being created. | |
9
+ | **document_content** | **String** | The HTML data to be transformed into a document. You must supply content using document_content or document_url. | [optional] |
10
+ | **document_url** | **String** | The URL to fetch the HTML data to be transformed into a document. You must supply content using document_content or document_url. | [optional] |
11
+ | **test** | **Boolean** | Enable test mode for this document. Test documents are not charged for but include a watermark. | [optional][default to true] |
12
+ | **pipeline** | **String** | Specify a specific verison of the DocRaptor Pipeline to use. | [optional] |
13
+ | **strict** | **String** | Force strict HTML validation. | [optional] |
14
+ | **ignore_resource_errors** | **Boolean** | Failed loading of images/javascripts/stylesheets/etc. will not cause the rendering to stop. | [optional][default to true] |
15
+ | **ignore_console_messages** | **Boolean** | Prevent console.log from stopping document rendering during JavaScript execution. | [optional][default to false] |
16
+ | **tag** | **String** | A field for storing a small amount of metadata with this document. | [optional] |
17
+ | **help** | **Boolean** | Request support help with this request if it succeeds. | [optional][default to false] |
18
+ | **javascript** | **Boolean** | Enable DocRaptor JavaScript parsing. PrinceXML JavaScript parsing is also available elsewhere. | [optional][default to false] |
19
+ | **referrer** | **String** | Set HTTP referrer when generating this document. | [optional] |
20
+ | **callback_url** | **String** | A URL that will receive a POST request after successfully completing an asynchronous document. The POST data will include download_url and download_id similar to status API responses. WARNING: this only works on asynchronous documents. | [optional] |
21
+ | **hosted_download_limit** | **Integer** | The number of times a hosted document can be downloaded. If no limit is specified, the document will be available for an unlimited number of downloads. | [optional] |
22
+ | **hosted_expires_at** | **String** | The date and time at which a hosted document will be removed and no longer available. Must be a properly formatted ISO 8601 datetime, like 1981-01-23T08:02:30-05:00. | [optional] |
23
+ | **prince_options** | [**PrinceOptions**](PrinceOptions.md) | | [optional] |
24
+
25
+ ## Example
26
+
27
+ ```ruby
28
+ require 'docraptor'
29
+
30
+ instance = DocRaptor::Doc.new(
31
+ name: null,
32
+ document_type: null,
33
+ document_content: null,
34
+ document_url: null,
35
+ test: null,
36
+ pipeline: null,
37
+ strict: null,
38
+ ignore_resource_errors: null,
39
+ ignore_console_messages: null,
40
+ tag: null,
41
+ help: null,
42
+ javascript: null,
43
+ referrer: null,
44
+ callback_url: null,
45
+ hosted_download_limit: null,
46
+ hosted_expires_at: null,
47
+ prince_options: null
48
+ )
49
+ ```
50
+