bidi2pdf 0.1.3 → 0.1.5
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 +4 -4
- data/.rubocop.yml +19 -1
- data/CHANGELOG.md +40 -3
- data/README.md +145 -55
- data/docker/Dockerfile.chromedriver +5 -0
- data/docker/entrypoint.sh +11 -1
- data/lib/bidi2pdf/bidi/add_headers_interceptor.rb +18 -21
- data/lib/bidi2pdf/bidi/auth_interceptor.rb +31 -38
- data/lib/bidi2pdf/bidi/browser_tab.rb +47 -53
- data/lib/bidi2pdf/bidi/client.rb +24 -52
- data/lib/bidi2pdf/bidi/command_manager.rb +50 -28
- data/lib/bidi2pdf/bidi/commands/add_intercept.rb +41 -0
- data/lib/bidi2pdf/bidi/commands/base.rb +73 -0
- data/lib/bidi2pdf/bidi/commands/browser_close.rb +15 -0
- data/lib/bidi2pdf/bidi/commands/browser_create_user_context.rb +15 -0
- data/lib/bidi2pdf/bidi/commands/browsing_context_close.rb +25 -0
- data/lib/bidi2pdf/bidi/commands/browsing_context_navigate.rb +31 -0
- data/lib/bidi2pdf/bidi/commands/browsing_context_print.rb +28 -0
- data/lib/bidi2pdf/bidi/commands/cancel_auth.rb +26 -0
- data/lib/bidi2pdf/bidi/commands/create_tab.rb +11 -0
- data/lib/bidi2pdf/bidi/commands/create_window.rb +32 -0
- data/lib/bidi2pdf/bidi/commands/get_user_contexts.rb +15 -0
- data/lib/bidi2pdf/bidi/commands/network_continue.rb +29 -0
- data/lib/bidi2pdf/bidi/commands/print_parameters_validator.rb +116 -0
- data/lib/bidi2pdf/bidi/commands/provide_credentials.rb +33 -0
- data/lib/bidi2pdf/bidi/commands/script_evaluate.rb +33 -0
- data/lib/bidi2pdf/bidi/commands/session_end.rb +15 -0
- data/lib/bidi2pdf/bidi/commands/session_status.rb +15 -0
- data/lib/bidi2pdf/bidi/commands/session_subscribe.rb +25 -0
- data/lib/bidi2pdf/bidi/commands/set_tab_cookie.rb +71 -0
- data/lib/bidi2pdf/bidi/commands/set_usercontext_cookie.rb +67 -0
- data/lib/bidi2pdf/bidi/commands.rb +27 -0
- data/lib/bidi2pdf/bidi/connection_manager.rb +16 -13
- data/lib/bidi2pdf/bidi/event_manager.rb +2 -0
- data/lib/bidi2pdf/bidi/interceptor.rb +75 -0
- data/lib/bidi2pdf/bidi/network_events.rb +0 -1
- data/lib/bidi2pdf/bidi/session.rb +139 -65
- data/lib/bidi2pdf/bidi/user_context.rb +25 -31
- data/lib/bidi2pdf/bidi/web_socket_dispatcher.rb +2 -0
- data/lib/bidi2pdf/chromedriver_manager.rb +2 -1
- data/lib/bidi2pdf/cli.rb +12 -7
- data/lib/bidi2pdf/dsl.rb +45 -0
- data/lib/bidi2pdf/launcher.rb +6 -2
- data/lib/bidi2pdf/session_runner.rb +9 -2
- data/lib/bidi2pdf/version.rb +1 -1
- data/lib/bidi2pdf.rb +16 -1
- data/sig/bidi2pdf/bidi/command_manager.rbs +41 -0
- data/sig/bidi2pdf/bidi/commands/add_intercept.rbs +21 -0
- data/sig/bidi2pdf/bidi/commands/base.rbs +27 -0
- data/sig/bidi2pdf/bidi/commands/browser_close.rbs +9 -0
- data/sig/bidi2pdf/bidi/commands/browser_create_user_context.rbs +9 -0
- data/sig/bidi2pdf/bidi/commands/browsing_context_close.rbs +11 -0
- data/sig/bidi2pdf/bidi/commands/browsing_context_navigate.rbs +15 -0
- data/sig/bidi2pdf/bidi/commands/browsing_context_print.rbs +14 -0
- data/sig/bidi2pdf/bidi/commands/cancel_auth.rbs +11 -0
- data/sig/bidi2pdf/bidi/commands/create_tab.rbs +9 -0
- data/sig/bidi2pdf/bidi/commands/create_window.rbs +19 -0
- data/sig/bidi2pdf/bidi/commands/get_user_contexts.rbs +9 -0
- data/sig/bidi2pdf/bidi/commands/network_continue.rbs +19 -0
- data/sig/bidi2pdf/bidi/commands/print_parameters_validator.rbs +53 -0
- data/sig/bidi2pdf/bidi/commands/provide_credentials.rbs +15 -0
- data/sig/bidi2pdf/bidi/commands/script_evaluate.rbs +17 -0
- data/sig/bidi2pdf/bidi/commands/session_end.rbs +9 -0
- data/sig/bidi2pdf/bidi/commands/session_status.rbs +9 -0
- data/sig/bidi2pdf/bidi/commands/session_subscribe.rbs +15 -0
- data/sig/bidi2pdf/bidi/commands/set_tab_cookie.rbs +31 -0
- data/sig/bidi2pdf/bidi/commands/set_usercontext_cookie.rbs +27 -0
- data/sig/bidi2pdf/bidi/commands.rbs +6 -0
- data/sig/bidi2pdf/bidi/connection_manager.rbs +17 -0
- data/sig/bidi2pdf/bidi/interceptor.rbs +31 -0
- data/tasks/coverage.rake +16 -0
- metadata +66 -11
- data/lib/bidi2pdf/bidi/print_parameters_validator.rb +0 -114
- data/sig/bidi2pdf/bidi/print_parameters_validator.rbs +0 -44
- data/sig/bidi2pdf/chrome/chromedriver_downloader.rbs +0 -11
- data/sig/bidi2pdf/chrome/downloader_helper.rbs +0 -9
- data/sig/bidi2pdf/chrome/finder.rbs +0 -27
- data/sig/bidi2pdf/chrome/platform.rbs +0 -13
- data/sig/bidi2pdf/chrome/version_resolver.rbs +0 -19
@@ -1,44 +0,0 @@
|
|
1
|
-
module Bidi2pdf
|
2
|
-
module Bidi
|
3
|
-
class PrintParametersValidator
|
4
|
-
# Valid print parameter configurations
|
5
|
-
DEFAULT_PARAMETERS: Hash[Symbol, untyped]
|
6
|
-
ALLOWED_PAGE_RANGES_FORMATS: Array[String]
|
7
|
-
ALLOWED_MARGIN_UNITS: Array[String]
|
8
|
-
ALLOWED_PAPER_FORMATS: Array[String]
|
9
|
-
ALLOWED_ORIENTATIONS: Array[String]
|
10
|
-
|
11
|
-
@parameters: Hash[Symbol, untyped]
|
12
|
-
@errors: Array[String]
|
13
|
-
|
14
|
-
attr_reader errors: Array[String]
|
15
|
-
attr_reader parameters: Hash[Symbol, untyped]
|
16
|
-
|
17
|
-
def initialize: (Hash[Symbol, untyped] parameters) -> void
|
18
|
-
|
19
|
-
def validate: () -> bool
|
20
|
-
|
21
|
-
def valid?: () -> bool
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def validate_boolean: (Symbol key) -> void
|
26
|
-
|
27
|
-
def validate_number: (Symbol key, ?min: Numeric?, ?max: Numeric?) -> void
|
28
|
-
|
29
|
-
def validate_string: (Symbol key) -> void
|
30
|
-
|
31
|
-
def validate_enum: (Symbol key, Array[String] allowed_values) -> void
|
32
|
-
|
33
|
-
def validate_margins: () -> void
|
34
|
-
|
35
|
-
def validate_page_ranges: () -> void
|
36
|
-
|
37
|
-
def validate_paper_size: () -> void
|
38
|
-
|
39
|
-
def normalize_parameters: () -> void
|
40
|
-
|
41
|
-
def add_error: (String message) -> void
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Bidi2pdf
|
2
|
-
module Chrome
|
3
|
-
class Finder
|
4
|
-
def self.location: -> String
|
5
|
-
|
6
|
-
def self.version: -> String
|
7
|
-
|
8
|
-
def self.win_location: -> String
|
9
|
-
|
10
|
-
def self.mac_location: -> String
|
11
|
-
|
12
|
-
def self.linux_location: -> String
|
13
|
-
|
14
|
-
def self.win_version: (String location) -> String
|
15
|
-
|
16
|
-
def self.linux_version: (String location) -> String
|
17
|
-
|
18
|
-
def self.mac_version: (String location) -> String
|
19
|
-
|
20
|
-
def self.call: (String process, Array[String] arg) -> String
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def self.find_in_paths: -> String
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Bidi2pdf
|
2
|
-
module Chrome
|
3
|
-
module VersionResolver
|
4
|
-
def browser_build_version: -> Gem::Version
|
5
|
-
|
6
|
-
def browser_version: -> Gem::Version
|
7
|
-
|
8
|
-
def direct_url_from_api: (_ToS driver_version, String driver_filename) -> String
|
9
|
-
|
10
|
-
def latest_patch_version_for_build: -> String
|
11
|
-
|
12
|
-
def normalize_version: (_ToS version) -> Gem::Version
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def fetch_data: (String json_file) -> String
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|