berrycrawl 0.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.
- checksums.yaml +7 -0
- data/.fern/metadata.json +12 -0
- data/.rubocop.yml +103 -0
- data/CONTRIBUTING.md +120 -0
- data/LICENSE +17 -0
- data/README.md +183 -0
- data/Rakefile +20 -0
- data/custom.gemspec.rb +16 -0
- data/lib/Berrycrawl/account/client.rb +44 -0
- data/lib/Berrycrawl/brand/client.rb +48 -0
- data/lib/Berrycrawl/brand/types/brand_dto.rb +15 -0
- data/lib/Berrycrawl/client.rb +268 -0
- data/lib/Berrycrawl/environment.rb +7 -0
- data/lib/Berrycrawl/errors/api_error.rb +8 -0
- data/lib/Berrycrawl/errors/client_error.rb +17 -0
- data/lib/Berrycrawl/errors/redirect_error.rb +8 -0
- data/lib/Berrycrawl/errors/response_error.rb +42 -0
- data/lib/Berrycrawl/errors/server_error.rb +11 -0
- data/lib/Berrycrawl/errors/timeout_error.rb +8 -0
- data/lib/Berrycrawl/internal/errors/constraint_error.rb +10 -0
- data/lib/Berrycrawl/internal/errors/type_error.rb +10 -0
- data/lib/Berrycrawl/internal/http/base_request.rb +51 -0
- data/lib/Berrycrawl/internal/http/raw_client.rb +252 -0
- data/lib/Berrycrawl/internal/iterators/cursor_item_iterator.rb +28 -0
- data/lib/Berrycrawl/internal/iterators/cursor_page_iterator.rb +63 -0
- data/lib/Berrycrawl/internal/iterators/item_iterator.rb +65 -0
- data/lib/Berrycrawl/internal/iterators/offset_item_iterator.rb +30 -0
- data/lib/Berrycrawl/internal/iterators/offset_page_iterator.rb +103 -0
- data/lib/Berrycrawl/internal/json/request.rb +41 -0
- data/lib/Berrycrawl/internal/json/serializable.rb +25 -0
- data/lib/Berrycrawl/internal/multipart/multipart_encoder.rb +141 -0
- data/lib/Berrycrawl/internal/multipart/multipart_form_data.rb +78 -0
- data/lib/Berrycrawl/internal/multipart/multipart_form_data_part.rb +51 -0
- data/lib/Berrycrawl/internal/multipart/multipart_request.rb +40 -0
- data/lib/Berrycrawl/internal/types/array.rb +47 -0
- data/lib/Berrycrawl/internal/types/boolean.rb +34 -0
- data/lib/Berrycrawl/internal/types/enum.rb +56 -0
- data/lib/Berrycrawl/internal/types/hash.rb +36 -0
- data/lib/Berrycrawl/internal/types/model/field.rb +38 -0
- data/lib/Berrycrawl/internal/types/model.rb +208 -0
- data/lib/Berrycrawl/internal/types/type.rb +35 -0
- data/lib/Berrycrawl/internal/types/union.rb +161 -0
- data/lib/Berrycrawl/internal/types/unknown.rb +15 -0
- data/lib/Berrycrawl/internal/types/utils.rb +116 -0
- data/lib/Berrycrawl/jobs/client.rb +127 -0
- data/lib/Berrycrawl/jobs/types/cancel_jobs_request.rb +11 -0
- data/lib/Berrycrawl/jobs/types/get_jobs_request.rb +15 -0
- data/lib/Berrycrawl/jobs/types/list_jobs_request.rb +17 -0
- data/lib/Berrycrawl/jobs/types/list_jobs_request_status.rb +17 -0
- data/lib/Berrycrawl/jobs/types/list_jobs_request_type.rb +14 -0
- data/lib/Berrycrawl/types/account_response.rb +11 -0
- data/lib/Berrycrawl/types/account_response_data.rb +21 -0
- data/lib/Berrycrawl/types/account_response_data_plan.rb +17 -0
- data/lib/Berrycrawl/types/account_response_data_queue.rb +11 -0
- data/lib/Berrycrawl/types/action_dto.rb +21 -0
- data/lib/Berrycrawl/types/action_dto_direction.rb +12 -0
- data/lib/Berrycrawl/types/action_dto_type.rb +18 -0
- data/lib/Berrycrawl/types/agent_config_dto.rb +11 -0
- data/lib/Berrycrawl/types/agent_config_dto_mode.rb +12 -0
- data/lib/Berrycrawl/types/brand_asset.rb +17 -0
- data/lib/Berrycrawl/types/brand_profile.rb +27 -0
- data/lib/Berrycrawl/types/brand_profile_colors_item.rb +11 -0
- data/lib/Berrycrawl/types/brand_profile_fonts_item.rb +11 -0
- data/lib/Berrycrawl/types/brand_profile_socials_item.rb +11 -0
- data/lib/Berrycrawl/types/brand_response.rb +11 -0
- data/lib/Berrycrawl/types/brand_response_data.rb +11 -0
- data/lib/Berrycrawl/types/brand_response_data_meta.rb +15 -0
- data/lib/Berrycrawl/types/cancel_job_response.rb +11 -0
- data/lib/Berrycrawl/types/cancel_job_response_data.rb +11 -0
- data/lib/Berrycrawl/types/change_tracking_format_dto.rb +15 -0
- data/lib/Berrycrawl/types/change_tracking_format_dto_type.rb +11 -0
- data/lib/Berrycrawl/types/crawl_dto.rb +41 -0
- data/lib/Berrycrawl/types/crawl_dto_sitemap.rb +13 -0
- data/lib/Berrycrawl/types/extract_dto.rb +29 -0
- data/lib/Berrycrawl/types/extract_webhook_config_dto.rb +15 -0
- data/lib/Berrycrawl/types/job_created_response.rb +15 -0
- data/lib/Berrycrawl/types/job_response.rb +11 -0
- data/lib/Berrycrawl/types/job_response_data.rb +37 -0
- data/lib/Berrycrawl/types/job_response_data_errors_item.rb +11 -0
- data/lib/Berrycrawl/types/job_summary.rb +29 -0
- data/lib/Berrycrawl/types/job_summary_type.rb +12 -0
- data/lib/Berrycrawl/types/json_format_dto.rb +13 -0
- data/lib/Berrycrawl/types/json_format_dto_type.rb +11 -0
- data/lib/Berrycrawl/types/list_jobs_response.rb +11 -0
- data/lib/Berrycrawl/types/list_jobs_response_data.rb +11 -0
- data/lib/Berrycrawl/types/list_webhooks_response.rb +11 -0
- data/lib/Berrycrawl/types/location_dto.rb +11 -0
- data/lib/Berrycrawl/types/map_dto.rb +23 -0
- data/lib/Berrycrawl/types/map_dto_sitemap.rb +13 -0
- data/lib/Berrycrawl/types/map_link.rb +13 -0
- data/lib/Berrycrawl/types/map_response.rb +15 -0
- data/lib/Berrycrawl/types/message_response.rb +11 -0
- data/lib/Berrycrawl/types/pagination.rb +15 -0
- data/lib/Berrycrawl/types/parse_dto.rb +11 -0
- data/lib/Berrycrawl/types/scrape_dto.rb +49 -0
- data/lib/Berrycrawl/types/scrape_dto_formats_item.rb +17 -0
- data/lib/Berrycrawl/types/scrape_dto_formats_item_zero.rb +18 -0
- data/lib/Berrycrawl/types/scrape_dto_proxy.rb +16 -0
- data/lib/Berrycrawl/types/scrape_metadata.rb +17 -0
- data/lib/Berrycrawl/types/scrape_response.rb +17 -0
- data/lib/Berrycrawl/types/scrape_response_credits.rb +9 -0
- data/lib/Berrycrawl/types/screenshot_clip_dto.rb +15 -0
- data/lib/Berrycrawl/types/screenshot_cookie_dto.rb +21 -0
- data/lib/Berrycrawl/types/screenshot_cookie_dto_same_site.rb +13 -0
- data/lib/Berrycrawl/types/screenshot_dto.rb +79 -0
- data/lib/Berrycrawl/types/screenshot_dto_color_scheme.rb +12 -0
- data/lib/Berrycrawl/types/screenshot_dto_device.rb +15 -0
- data/lib/Berrycrawl/types/screenshot_dto_format.rb +13 -0
- data/lib/Berrycrawl/types/screenshot_dto_full_page_algorithm.rb +13 -0
- data/lib/Berrycrawl/types/screenshot_dto_proxy.rb +16 -0
- data/lib/Berrycrawl/types/screenshot_dto_response_format.rb +12 -0
- data/lib/Berrycrawl/types/screenshot_dto_scale.rb +12 -0
- data/lib/Berrycrawl/types/screenshot_dto_wait_until.rb +13 -0
- data/lib/Berrycrawl/types/screenshot_location_dto.rb +11 -0
- data/lib/Berrycrawl/types/screenshot_viewport_dto.rb +11 -0
- data/lib/Berrycrawl/types/search_dto.rb +23 -0
- data/lib/Berrycrawl/types/search_response.rb +19 -0
- data/lib/Berrycrawl/types/search_response_provider.rb +11 -0
- data/lib/Berrycrawl/types/search_result.rb +19 -0
- data/lib/Berrycrawl/types/search_result_provider.rb +11 -0
- data/lib/Berrycrawl/types/summary_format_dto.rb +11 -0
- data/lib/Berrycrawl/types/summary_format_dto_type.rb +11 -0
- data/lib/Berrycrawl/types/test_webhook_response.rb +15 -0
- data/lib/Berrycrawl/types/webhook.rb +23 -0
- data/lib/Berrycrawl/types/webhook_config_dto.rb +15 -0
- data/lib/Berrycrawl/types/webhook_response.rb +11 -0
- data/lib/Berrycrawl/version.rb +5 -0
- data/lib/Berrycrawl/webhooks/client.rb +214 -0
- data/lib/Berrycrawl/webhooks/types/create_webhook_dto.rb +13 -0
- data/lib/Berrycrawl/webhooks/types/delete_webhooks_request.rb +11 -0
- data/lib/Berrycrawl/webhooks/types/get_webhooks_request.rb +11 -0
- data/lib/Berrycrawl/webhooks/types/test_webhook_dto.rb +15 -0
- data/lib/Berrycrawl/webhooks/types/update_webhook_dto.rb +17 -0
- data/lib/Berrycrawl.rb +130 -0
- data/reference.md +1759 -0
- metadata +179 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class ListWebhooksResponse < Internal::Types::Model
|
|
6
|
+
field :data, -> { Internal::Types::Array[Berrycrawl::Types::Webhook] }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :success, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class LocationDto < Internal::Types::Model
|
|
6
|
+
field :country, -> { String }, optional: true, nullable: false
|
|
7
|
+
|
|
8
|
+
field :languages, -> { Internal::Types::Array[String] }, optional: true, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class MapDto < Internal::Types::Model
|
|
6
|
+
field :ignore_query_parameters, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "ignoreQueryParameters"
|
|
7
|
+
|
|
8
|
+
field :include_subdomains, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "includeSubdomains"
|
|
9
|
+
|
|
10
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :location, -> { Berrycrawl::Types::LocationDto }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :search, -> { String }, optional: true, nullable: false
|
|
15
|
+
|
|
16
|
+
field :sitemap, -> { Berrycrawl::Types::MapDtoSitemap }, optional: true, nullable: false
|
|
17
|
+
|
|
18
|
+
field :timeout, -> { Integer }, optional: true, nullable: false
|
|
19
|
+
|
|
20
|
+
field :url, -> { String }, optional: false, nullable: false
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class MapLink < Internal::Types::Model
|
|
6
|
+
field :description, -> { String }, optional: true, nullable: false
|
|
7
|
+
|
|
8
|
+
field :title, -> { String }, optional: true, nullable: false
|
|
9
|
+
|
|
10
|
+
field :url, -> { String }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class MapResponse < Internal::Types::Model
|
|
6
|
+
field :credits_used, -> { Integer }, optional: false, nullable: false, api_name: "creditsUsed"
|
|
7
|
+
|
|
8
|
+
field :links, -> { Internal::Types::Array[Berrycrawl::Types::MapLink] }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :success, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :total, -> { Integer }, optional: false, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class MessageResponse < Internal::Types::Model
|
|
6
|
+
field :message, -> { String }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :success, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class Pagination < Internal::Types::Model
|
|
6
|
+
field :limit, -> { Integer }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :page, -> { Integer }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :total, -> { Integer }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :total_pages, -> { Integer }, optional: true, nullable: false, api_name: "totalPages"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class ScrapeDto < Internal::Types::Model
|
|
6
|
+
field :actions, -> { Internal::Types::Array[Berrycrawl::Types::ActionDto] }, optional: true, nullable: false
|
|
7
|
+
|
|
8
|
+
field :block_ads, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "blockAds"
|
|
9
|
+
|
|
10
|
+
field :domain, -> { String }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :exclude_tags, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "excludeTags"
|
|
13
|
+
|
|
14
|
+
field :extraction_schema, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false, api_name: "extractionSchema"
|
|
15
|
+
|
|
16
|
+
field :formats, -> { Internal::Types::Array[Berrycrawl::Types::ScrapeDtoFormatsItem] }, optional: true, nullable: false
|
|
17
|
+
|
|
18
|
+
field :headers, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
|
|
19
|
+
|
|
20
|
+
field :include_tags, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "includeTags"
|
|
21
|
+
|
|
22
|
+
field :location, -> { Berrycrawl::Types::LocationDto }, optional: true, nullable: false
|
|
23
|
+
|
|
24
|
+
field :max_age, -> { Integer }, optional: true, nullable: false, api_name: "maxAge"
|
|
25
|
+
|
|
26
|
+
field :mobile, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
27
|
+
|
|
28
|
+
field :only_main_content, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "onlyMainContent"
|
|
29
|
+
|
|
30
|
+
field :proxy, -> { Berrycrawl::Types::ScrapeDtoProxy }, optional: true, nullable: false
|
|
31
|
+
|
|
32
|
+
field :remove_base64_images, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "removeBase64Images"
|
|
33
|
+
|
|
34
|
+
field :screenshot_as_base64, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "screenshotAsBase64"
|
|
35
|
+
|
|
36
|
+
field :skip_tls_verification, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "skipTlsVerification"
|
|
37
|
+
|
|
38
|
+
field :store_in_cache, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "storeInCache"
|
|
39
|
+
|
|
40
|
+
field :timeout, -> { Integer }, optional: true, nullable: false
|
|
41
|
+
|
|
42
|
+
field :url, -> { String }, optional: true, nullable: false
|
|
43
|
+
|
|
44
|
+
field :wait_for, -> { Integer }, optional: true, nullable: false, api_name: "waitFor"
|
|
45
|
+
|
|
46
|
+
field :zero_data_retention, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "zeroDataRetention"
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class ScrapeDtoFormatsItem < Internal::Types::Model
|
|
6
|
+
extend Berrycrawl::Internal::Types::Union
|
|
7
|
+
|
|
8
|
+
member -> { Berrycrawl::Types::ScrapeDtoFormatsItemZero }
|
|
9
|
+
|
|
10
|
+
member -> { Berrycrawl::Types::JSONFormatDto }
|
|
11
|
+
|
|
12
|
+
member -> { Berrycrawl::Types::SummaryFormatDto }
|
|
13
|
+
|
|
14
|
+
member -> { Berrycrawl::Types::ChangeTrackingFormatDto }
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
module ScrapeDtoFormatsItemZero
|
|
6
|
+
extend Berrycrawl::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
MARKDOWN = "markdown"
|
|
9
|
+
HTML = "html"
|
|
10
|
+
RAWHTML = "rawhtml"
|
|
11
|
+
LINKS = "links"
|
|
12
|
+
IMAGES = "images"
|
|
13
|
+
SUMMARY = "summary"
|
|
14
|
+
JSON_ = "json"
|
|
15
|
+
CHANGE_TRACKING = "changeTracking"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
module ScrapeDtoProxy
|
|
6
|
+
extend Berrycrawl::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
NONE = "none"
|
|
9
|
+
BASIC = "basic"
|
|
10
|
+
DATACENTER = "datacenter"
|
|
11
|
+
RESIDENTIAL = "residential"
|
|
12
|
+
STEALTH = "stealth"
|
|
13
|
+
AUTO = "auto"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class ScrapeMetadata < Internal::Types::Model
|
|
6
|
+
field :content_type, -> { String }, optional: true, nullable: false, api_name: "contentType"
|
|
7
|
+
|
|
8
|
+
field :status_code, -> { Integer }, optional: true, nullable: false, api_name: "statusCode"
|
|
9
|
+
|
|
10
|
+
field :timestamp, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :title, -> { String }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :url, -> { String }, optional: false, nullable: false
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class ScrapeResponse < Internal::Types::Model
|
|
6
|
+
field :credits, -> { Berrycrawl::Types::ScrapeResponseCredits }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :data, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
|
|
9
|
+
|
|
10
|
+
field :error, -> { String }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :metadata, -> { Berrycrawl::Types::ScrapeMetadata }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :success, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class ScreenshotClipDto < Internal::Types::Model
|
|
6
|
+
field :height, -> { Integer }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :width, -> { Integer }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :x, -> { Integer }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :y, -> { Integer }, optional: false, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class ScreenshotCookieDto < Internal::Types::Model
|
|
6
|
+
field :domain, -> { String }, optional: true, nullable: false
|
|
7
|
+
|
|
8
|
+
field :http_only, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "httpOnly"
|
|
9
|
+
|
|
10
|
+
field :name, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :path, -> { String }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :same_site, -> { Berrycrawl::Types::ScreenshotCookieDtoSameSite }, optional: true, nullable: false, api_name: "sameSite"
|
|
15
|
+
|
|
16
|
+
field :secure, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
17
|
+
|
|
18
|
+
field :value, -> { String }, optional: false, nullable: false
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class ScreenshotDto < Internal::Types::Model
|
|
6
|
+
field :block_ads, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "blockAds"
|
|
7
|
+
|
|
8
|
+
field :click_selector, -> { String }, optional: true, nullable: false, api_name: "clickSelector"
|
|
9
|
+
|
|
10
|
+
field :clip, -> { Berrycrawl::Types::ScreenshotClipDto }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :color_scheme, -> { Berrycrawl::Types::ScreenshotDtoColorScheme }, optional: true, nullable: false, api_name: "colorScheme"
|
|
13
|
+
|
|
14
|
+
field :cookies, -> { Internal::Types::Array[Berrycrawl::Types::ScreenshotCookieDto] }, optional: true, nullable: false
|
|
15
|
+
|
|
16
|
+
field :delay, -> { Integer }, optional: true, nullable: false
|
|
17
|
+
|
|
18
|
+
field :device, -> { Berrycrawl::Types::ScreenshotDtoDevice }, optional: true, nullable: false
|
|
19
|
+
|
|
20
|
+
field :disable_animations, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "disableAnimations"
|
|
21
|
+
|
|
22
|
+
field :format, -> { Berrycrawl::Types::ScreenshotDtoFormat }, optional: true, nullable: false
|
|
23
|
+
|
|
24
|
+
field :full_page, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "fullPage"
|
|
25
|
+
|
|
26
|
+
field :full_page_algorithm, -> { Berrycrawl::Types::ScreenshotDtoFullPageAlgorithm }, optional: true, nullable: false, api_name: "fullPageAlgorithm"
|
|
27
|
+
|
|
28
|
+
field :headers, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
|
|
29
|
+
|
|
30
|
+
field :hide_fixed_elements, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "hideFixedElements"
|
|
31
|
+
|
|
32
|
+
field :hide_selectors, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "hideSelectors"
|
|
33
|
+
|
|
34
|
+
field :location, -> { Berrycrawl::Types::ScreenshotLocationDto }, optional: true, nullable: false
|
|
35
|
+
|
|
36
|
+
field :mask_color, -> { String }, optional: true, nullable: false, api_name: "maskColor"
|
|
37
|
+
|
|
38
|
+
field :mask_selectors, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "maskSelectors"
|
|
39
|
+
|
|
40
|
+
field :max_height, -> { Integer }, optional: true, nullable: false, api_name: "maxHeight"
|
|
41
|
+
|
|
42
|
+
field :omit_background, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "omitBackground"
|
|
43
|
+
|
|
44
|
+
field :proxy, -> { Berrycrawl::Types::ScreenshotDtoProxy }, optional: true, nullable: false
|
|
45
|
+
|
|
46
|
+
field :quality, -> { Integer }, optional: true, nullable: false
|
|
47
|
+
|
|
48
|
+
field :reduced_motion, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "reducedMotion"
|
|
49
|
+
|
|
50
|
+
field :remove_chat_widgets, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "removeChatWidgets"
|
|
51
|
+
|
|
52
|
+
field :remove_cookie_banners, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "removeCookieBanners"
|
|
53
|
+
|
|
54
|
+
field :remove_overlays, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "removeOverlays"
|
|
55
|
+
|
|
56
|
+
field :response_format, -> { Berrycrawl::Types::ScreenshotDtoResponseFormat }, optional: true, nullable: false, api_name: "responseFormat"
|
|
57
|
+
|
|
58
|
+
field :scale, -> { Berrycrawl::Types::ScreenshotDtoScale }, optional: true, nullable: false
|
|
59
|
+
|
|
60
|
+
field :scroll_delay, -> { Integer }, optional: true, nullable: false, api_name: "scrollDelay"
|
|
61
|
+
|
|
62
|
+
field :scroll_page, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "scrollPage"
|
|
63
|
+
|
|
64
|
+
field :selector, -> { String }, optional: true, nullable: false
|
|
65
|
+
|
|
66
|
+
field :styles, -> { Internal::Types::Array[String] }, optional: true, nullable: false
|
|
67
|
+
|
|
68
|
+
field :timeout, -> { Integer }, optional: true, nullable: false
|
|
69
|
+
|
|
70
|
+
field :url, -> { String }, optional: false, nullable: false
|
|
71
|
+
|
|
72
|
+
field :viewport, -> { Berrycrawl::Types::ScreenshotViewportDto }, optional: true, nullable: false
|
|
73
|
+
|
|
74
|
+
field :wait_for_selector, -> { String }, optional: true, nullable: false, api_name: "waitForSelector"
|
|
75
|
+
|
|
76
|
+
field :wait_until, -> { Berrycrawl::Types::ScreenshotDtoWaitUntil }, optional: true, nullable: false, api_name: "waitUntil"
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
module ScreenshotDtoDevice
|
|
6
|
+
extend Berrycrawl::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
DESKTOP = "desktop"
|
|
9
|
+
DESKTOP_HD = "desktop-hd"
|
|
10
|
+
TABLET = "tablet"
|
|
11
|
+
IPHONE15 = "iphone-15"
|
|
12
|
+
PIXEL8 = "pixel-8"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
module ScreenshotDtoProxy
|
|
6
|
+
extend Berrycrawl::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
NONE = "none"
|
|
9
|
+
BASIC = "basic"
|
|
10
|
+
DATACENTER = "datacenter"
|
|
11
|
+
RESIDENTIAL = "residential"
|
|
12
|
+
STEALTH = "stealth"
|
|
13
|
+
AUTO = "auto"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class ScreenshotLocationDto < Internal::Types::Model
|
|
6
|
+
field :country, -> { String }, optional: true, nullable: false
|
|
7
|
+
|
|
8
|
+
field :languages, -> { Internal::Types::Array[String] }, optional: true, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class ScreenshotViewportDto < Internal::Types::Model
|
|
6
|
+
field :height, -> { Integer }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :width, -> { Integer }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class SearchDto < Internal::Types::Model
|
|
6
|
+
field :categories, -> { Internal::Types::Array[String] }, optional: true, nullable: false
|
|
7
|
+
|
|
8
|
+
field :country, -> { String }, optional: true, nullable: false
|
|
9
|
+
|
|
10
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :location, -> { String }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :query, -> { String }, optional: false, nullable: false
|
|
15
|
+
|
|
16
|
+
field :sources, -> { Internal::Types::Array[String] }, optional: true, nullable: false
|
|
17
|
+
|
|
18
|
+
field :tbs, -> { String }, optional: true, nullable: false
|
|
19
|
+
|
|
20
|
+
field :timeout, -> { Integer }, optional: true, nullable: false
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class SearchResponse < Internal::Types::Model
|
|
6
|
+
field :credits_used, -> { Integer }, optional: false, nullable: false, api_name: "creditsUsed"
|
|
7
|
+
|
|
8
|
+
field :data, -> { Internal::Types::Array[Berrycrawl::Types::SearchResult] }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :provider, -> { Berrycrawl::Types::SearchResponseProvider }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :query, -> { String }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :success, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
15
|
+
|
|
16
|
+
field :total, -> { Integer }, optional: false, nullable: false
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Berrycrawl
|
|
4
|
+
module Types
|
|
5
|
+
class SearchResult < Internal::Types::Model
|
|
6
|
+
field :provider, -> { Berrycrawl::Types::SearchResultProvider }, optional: true, nullable: false
|
|
7
|
+
|
|
8
|
+
field :published_date, -> { String }, optional: true, nullable: false, api_name: "publishedDate"
|
|
9
|
+
|
|
10
|
+
field :snippet, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :source, -> { String }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :title, -> { String }, optional: false, nullable: false
|
|
15
|
+
|
|
16
|
+
field :url, -> { String }, optional: false, nullable: false
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|