pdf-rendering-srv-ruby 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6af5b6c2e0e9daed1cebfa281ed412652430a55f22dcc007d11fc365f226d53d
4
- data.tar.gz: 5440782e47621f80294de9c32b5c8325fe55986fdee4f123f06b7d1d9f07f0a6
3
+ metadata.gz: dff035b56c29a941c0adba86bcb6ad3c0ea6719fc841c1a5803e6db247552fd9
4
+ data.tar.gz: ccea6573976c3b56a600ea058a7d59ee0e6d98fc102b333fc93478dbb7af2ae5
5
5
  SHA512:
6
- metadata.gz: d7e03416c9d1623cdf1462bc47d0e28b4e2e4dafb83983cd0cb2e42f9e09777130a4d28bb0f0e3830014d22eb1ae97918e4fba9534c5538b7188937fd7028d57
7
- data.tar.gz: 960b65ab84e41e67739c8bf79f18f52075bb936ed1583386b83a014fe6c0b3fff397191ba730f31c4793ef68e05751e1734a676587c48c6358b24c6e8ba2e86d
6
+ metadata.gz: e809ee3f3c8f75318b5b8a718f37d2eed8e49dd382f053a56b7135af49e109322638770b44e9d078337efcfa01c23891f9f70ad2ed7f28c564e975415e8b3986
7
+ data.tar.gz: f051799b47b318aa1d63e65c8ae16d3386b294a6fc71067559b35e531eb50851be62c8a02713ea2d22d6089654257fcaefeb20495a5fcbe9632a974edb5dd3ca
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.1.2
4
+
5
+ * fix nesting on `pdf.margin` and `screenshot.clip`
6
+ * add `cookies`
7
+
3
8
  ## 0.1.1
4
9
 
5
10
  * fix Zeitwerk loading `version.rb`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pdf-rendering-srv-ruby (0.1.1)
4
+ pdf-rendering-srv-ruby (0.1.2)
5
5
  dry-struct (~> 1.3)
6
6
  dry-types (~> 1.4)
7
7
  http (~> 4.4)
@@ -6,53 +6,71 @@ module PdfRenderingSrv
6
6
  include Dry.Types()
7
7
  end
8
8
 
9
+ transform_keys(&:to_sym)
10
+
9
11
  attribute :pdf_rendering_srv_url, Types::String.optional.default(PdfRenderingSrv.configuration.pdf_rendering_srv_url.freeze)
10
12
 
11
13
  attribute :format, Types::Coercible::Symbol.enum(*%i[html pdf png jpg jpeg]).optional.default(:pdf)
12
- attribute :jpeg_quality, Types::Coercible::Integer.optional.default(90)
14
+ attribute? :jpeg_quality, Types::Coercible::Integer.optional.default(90)
13
15
 
14
16
  # @see https://github.com/alvarcarto/url-to-pdf-api#get-apirender
15
17
 
16
- attribute :emulate_screen_media, Types::Bool.optional.default(nil)
17
- attribute :scroll_page, Types::Bool.optional.default(nil)
18
- attribute :wait_for, Types::Coercible::String.optional.default(nil)
18
+ attribute? :emulate_screen_media, Types::Bool.optional
19
+ attribute? :scroll_page, Types::Bool.optional
20
+ attribute? :wait_for, Types::Coercible::String.optional
19
21
 
20
22
  attribute? :viewport do
21
- attribute :width, Types::Coercible::Integer.optional.default(nil)
22
- attribute :height, Types::Coercible::Integer.optional.default(nil)
23
- attribute :device_scale_factor, Types::Coercible::Integer.optional.default(2)
24
- attribute :is_mobile, Types::Bool.optional.default(nil)
25
- attribute :has_touch, Types::Bool.optional.default(nil)
26
- attribute :is_landscape, Types::Bool.optional.default(nil)
23
+ attribute? :width, Types::Coercible::Integer.optional
24
+ attribute? :height, Types::Coercible::Integer.optional
25
+ attribute? :device_scale_factor, Types::Coercible::Integer.optional.default(2)
26
+ attribute? :is_mobile, Types::Bool.optional
27
+ attribute? :has_touch, Types::Bool.optional
28
+ attribute? :is_landscape, Types::Bool.optional
29
+ end
30
+
31
+ attribute? :cookies, Types::Array do
32
+ attribute :name, Types::String
33
+ attribute :value, Types::String
34
+ attribute? :url, Types::String.optional
35
+ attribute? :domain, Types::String.optional
36
+ attribute? :path, Types::String.optional
37
+ attribute? :expires, Types::Coercible::Integer.optional
38
+ attribute? :http_only, Types::Bool.optional
39
+ attribute? :secure, Types::Bool.optional
40
+ attribute? :same_site, Types::String.optional
27
41
  end
28
42
 
29
43
  attribute? :goto do
30
- attribute :wait_until, Types::Coercible::String.enum(*%w[load networkidle0 networkidle2]).optional.default(nil)
31
- attribute :network_idle_timeout, Types::Integer.optional.default(nil)
44
+ attribute? :wait_until, Types::Coercible::String.enum(*%w[load networkidle0 networkidle2]).optional
45
+ attribute? :network_idle_timeout, Types::Integer.optional
32
46
  end
33
47
 
34
48
  attribute? :pdf do
35
- attribute :scale, Types::Coercible::Float.optional.default(nil)
36
- attribute :print_background, Types::Bool.optional.default(nil)
37
- attribute :landscape, Types::Bool.optional.default(nil)
38
- attribute :page_ranges, Types::Coercible::String.optional.default(nil)
39
- attribute :format, Types::Coercible::String.optional.default(nil)
40
- attribute :width, Types::Coercible::String.optional.default(nil)
41
- attribute :height, Types::Coercible::String.optional.default(nil)
42
- attribute :margin_top, Types::Coercible::String.optional.default(nil)
43
- attribute :margin_right, Types::Coercible::String.optional.default(nil)
44
- attribute :margin_bottom, Types::Coercible::String.optional.default(nil)
45
- attribute :margin_left, Types::Coercible::String.optional.default(nil)
49
+ attribute? :scale, Types::Coercible::Float.optional
50
+ attribute? :print_background, Types::Bool.optional
51
+ attribute? :landscape, Types::Bool.optional
52
+ attribute? :page_ranges, Types::Coercible::String.optional
53
+ attribute? :format, Types::Coercible::String.optional
54
+ attribute? :width, Types::Coercible::String.optional
55
+ attribute? :height, Types::Coercible::String.optional
56
+ attribute? :margin do
57
+ attribute? :top, Types::Coercible::String.optional
58
+ attribute? :right, Types::Coercible::String.optional
59
+ attribute? :bottom, Types::Coercible::String.optional
60
+ attribute? :left, Types::Coercible::String.optional
61
+ end
46
62
  end
47
63
 
48
64
  attribute? :screenshot do
49
- attribute :full_page, Types::Bool.optional.default(nil)
50
- attribute :omit_background, Types::Bool.optional.default(nil)
51
- attribute :clip_x, Types::Coercible::Integer.optional.default(nil)
52
- attribute :clip_y, Types::Coercible::Integer.optional.default(nil)
53
- attribute :clip_width, Types::Coercible::Integer.optional.default(nil)
54
- attribute :clip_height, Types::Coercible::Integer.optional.default(nil)
55
- attribute :selector, Types::Coercible::String.optional.default(nil)
65
+ attribute? :full_page, Types::Bool.optional
66
+ attribute? :omit_background, Types::Bool.optional
67
+ attribute? :clip do
68
+ attribute? :x, Types::Coercible::Integer.optional
69
+ attribute? :y, Types::Coercible::Integer.optional
70
+ attribute? :width, Types::Coercible::Integer.optional
71
+ attribute? :height, Types::Coercible::Integer.optional
72
+ end
73
+ attribute? :selector, Types::Coercible::String.optional
56
74
  end
57
75
 
58
76
  def self.call(*args)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PdfRenderingSrv
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdf-rendering-srv-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-03 00:00:00.000000000 Z
11
+ date: 2021-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct