docraptor 2.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.docker_env.list +5 -0
- data/.docker_mounts.list +4 -0
- data/.generator-language-identifier +1 -0
- data/.generator-revision +1 -0
- data/.github/pull_request_template.txt +17 -0
- data/.gitignore +20 -14
- data/.gitlab-ci.yml +26 -0
- data/.openapi-generator/FILES +32 -0
- data/.openapi-generator/VERSION +1 -0
- data/{.swagger-codegen-ignore → .openapi-generator-ignore} +13 -7
- data/.review/README.md +16 -0
- data/.review/generated_files/.gitignore +39 -0
- data/.review/generated_files/README.md +108 -0
- data/.review/generated_files/docs/AsyncDoc.md +18 -0
- data/.review/generated_files/docs/Doc.md +50 -0
- data/.review/generated_files/docs/DocApi.md +503 -0
- data/.review/generated_files/docs/DocStatus.md +28 -0
- data/.review/generated_files/docs/PrinceOptions.md +82 -0
- data/.review/generated_files/spec/api/doc_api_spec.rb +112 -0
- data/{spec → .review/generated_files/spec}/api_client_spec.rb +6 -21
- data/{spec → .review/generated_files/spec}/configuration_spec.rb +6 -6
- data/.review/generated_files/spec/models/async_doc_spec.rb +34 -0
- data/.review/generated_files/spec/models/doc_spec.rb +138 -0
- data/.review/generated_files/spec/models/doc_status_spec.rb +64 -0
- data/.review/generated_files/spec/models/prince_options_spec.rb +234 -0
- data/{spec → .review/generated_files/spec}/spec_helper.rb +3 -3
- data/.rubocop.yml +148 -0
- data/.runtime-environments +13 -0
- data/.travis.yml +9 -7
- data/CHANGELOG.md +8 -0
- data/Gemfile +3 -1
- data/README.md +8 -8
- data/Rakefile +1 -2
- data/docraptor.gemspec +5 -19
- data/docraptor.yaml +283 -284
- data/examples/async.rb +24 -30
- data/examples/hosted_async.rb +21 -33
- data/examples/hosted_sync.rb +19 -32
- data/examples/sync.rb +20 -26
- data/gemfiles/Gemfile.2.5.lock +70 -0
- data/gemfiles/Gemfile.2.6.lock +70 -0
- data/gemfiles/Gemfile.2.7.lock +70 -0
- data/gemfiles/Gemfile.3.0.lock +70 -0
- data/gemfiles/Gemfile.3.1.lock +72 -0
- data/gemfiles/Gemfile.3.2.lock +72 -0
- data/gemfiles/Gemfile.3.3.lock +72 -0
- data/{swagger-config.json → generator-config.json} +3 -2
- data/lib/docraptor/api/doc_api.rb +180 -85
- data/lib/docraptor/api_client.rb +91 -90
- data/lib/docraptor/api_error.rb +23 -3
- data/lib/docraptor/configuration.rb +101 -15
- data/lib/docraptor/models/async_doc.rb +53 -18
- data/lib/docraptor/models/doc.rb +80 -50
- data/lib/docraptor/models/doc_status.rb +58 -23
- data/lib/docraptor/models/prince_options.rb +149 -75
- data/lib/docraptor/version.rb +4 -4
- data/lib/docraptor.rb +3 -3
- data/script/clean +2 -2
- data/script/console +5 -0
- data/script/docker +56 -0
- data/script/fix_gemspec.rb +3 -18
- data/script/generate_language +43 -4
- data/script/inside_container/README.md +6 -0
- data/script/inside_container/test +87 -0
- data/script/post_generate_language +8 -2
- data/script/release +13 -0
- data/script/setup +25 -14
- data/script/swagger +6 -33
- data/script/test +30 -27
- data/test/async.rb +2 -2
- data/test/expire_hosted.rb +2 -2
- data/test/hosted_async.rb +7 -1
- data/test/hosted_sync.rb +2 -2
- data/test/iframes_default.rb +40 -0
- data/test/iframes_false.rb +40 -0
- data/test/iframes_true.rb +40 -0
- data/test/prince_options.rb +45 -0
- data/test/sync.rb +2 -2
- data/test/xlsx.rb +10 -3
- metadata +52 -214
- data/.swagger-codegen/VERSION +0 -1
- data/.swagger-revision +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae5113eeec4fbe7b113fe5f92c8fb7175e672beadb72ab3e96fd458484e8e5d2
|
4
|
+
data.tar.gz: 8923f22767e21a57af7afbf6082b9da27a23e2781ecd35947f2229ecf9ba889a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72383235430a25aa8faa722dcdc353376ef8d9bffd2e663698b09b3149895c5bb63b3c699897ffaa7627e5275f4477017322583d6e8ebcff77d3b8136694d7ac
|
7
|
+
data.tar.gz: cb9a0f14cc1da9022ffd07cce3ad670e4eb742285bb6a13074af4b7edf5418da97b3d106c8cb59ec1777f21850a7d01ce3f35ee18043229de8680518d1432502
|
data/.docker_env.list
ADDED
data/.docker_mounts.list
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby
|
data/.generator-revision
ADDED
@@ -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
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
42
|
-
*~
|
42
|
+
# EB Customizations
|
43
43
|
|
44
|
-
|
45
|
-
|
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
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
+
|