context.dev 0.1.0 → 0.2.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 +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +9 -9
- data/lib/context_dev/client.rb +20 -0
- data/lib/context_dev/internal/type/base_model.rb +4 -4
- data/lib/context_dev/models/{brand_ai_query_params.rb → ai_ai_query_params.rb} +21 -22
- data/lib/context_dev/models/{brand_ai_query_response.rb → ai_ai_query_response.rb} +11 -11
- data/lib/context_dev/models/{brand_ai_product_params.rb → ai_extract_product_params.rb} +3 -3
- data/lib/context_dev/models/{brand_ai_product_response.rb → ai_extract_product_response.rb} +18 -18
- data/lib/context_dev/models/{brand_ai_products_params.rb → ai_extract_products_params.rb} +11 -10
- data/lib/context_dev/models/{brand_ai_products_response.rb → ai_extract_products_response.rb} +13 -13
- data/lib/context_dev/models/brand_identify_from_transaction_params.rb +3 -0
- data/lib/context_dev/models/brand_retrieve_by_email_params.rb +3 -0
- data/lib/context_dev/models/brand_retrieve_by_isin_params.rb +3 -0
- data/lib/context_dev/models/brand_retrieve_by_name_params.rb +3 -0
- data/lib/context_dev/models/brand_retrieve_by_ticker_params.rb +3 -0
- data/lib/context_dev/models/brand_retrieve_params.rb +3 -0
- data/lib/context_dev/models/{brand_retrieve_naics_params.rb → industry_retrieve_naics_params.rb} +3 -3
- data/lib/context_dev/models/{brand_retrieve_naics_response.rb → industry_retrieve_naics_response.rb} +9 -9
- data/lib/context_dev/models/{brand_fonts_params.rb → style_extract_fonts_params.rb} +3 -3
- data/lib/context_dev/models/{brand_fonts_response.rb → style_extract_fonts_response.rb} +6 -5
- data/lib/context_dev/models/{brand_styleguide_params.rb → style_extract_styleguide_params.rb} +6 -6
- data/lib/context_dev/models/{brand_styleguide_response.rb → style_extract_styleguide_response.rb} +83 -74
- data/lib/context_dev/models/{brand_prefetch_by_email_params.rb → utility_prefetch_by_email_params.rb} +3 -3
- data/lib/context_dev/models/{brand_prefetch_by_email_response.rb → utility_prefetch_by_email_response.rb} +2 -2
- data/lib/context_dev/models/{brand_prefetch_params.rb → utility_prefetch_params.rb} +3 -3
- data/lib/context_dev/models/{brand_prefetch_response.rb → utility_prefetch_response.rb} +2 -2
- data/lib/context_dev/models/{brand_screenshot_params.rb → web_screenshot_params.rb} +12 -12
- data/lib/context_dev/models/{brand_screenshot_response.rb → web_screenshot_response.rb} +6 -6
- data/lib/context_dev/models/{brand_web_scrape_html_params.rb → web_web_scrape_html_params.rb} +2 -2
- data/lib/context_dev/models/{brand_web_scrape_html_response.rb → web_web_scrape_html_response.rb} +6 -6
- data/lib/context_dev/models/{brand_web_scrape_images_params.rb → web_web_scrape_images_params.rb} +2 -2
- data/lib/context_dev/models/{brand_web_scrape_images_response.rb → web_web_scrape_images_response.rb} +17 -17
- data/lib/context_dev/models/{brand_web_scrape_md_params.rb → web_web_scrape_md_params.rb} +3 -3
- data/lib/context_dev/models/{brand_web_scrape_md_response.rb → web_web_scrape_md_response.rb} +6 -6
- data/lib/context_dev/models/{brand_web_scrape_sitemap_params.rb → web_web_scrape_sitemap_params.rb} +3 -3
- data/lib/context_dev/models/{brand_web_scrape_sitemap_response.rb → web_web_scrape_sitemap_response.rb} +10 -10
- data/lib/context_dev/models.rb +17 -17
- data/lib/context_dev/resources/ai.rb +99 -0
- data/lib/context_dev/resources/brand.rb +0 -397
- data/lib/context_dev/resources/industry.rb +50 -0
- data/lib/context_dev/resources/style.rb +78 -0
- data/lib/context_dev/resources/utility.rb +76 -0
- data/lib/context_dev/resources/web.rb +164 -0
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +31 -26
- data/rbi/context_dev/client.rbi +15 -0
- data/rbi/context_dev/models/{brand_ai_query_params.rbi → ai_ai_query_params.rbi} +46 -46
- data/rbi/context_dev/models/{brand_ai_query_response.rbi → ai_ai_query_response.rbi} +12 -12
- data/rbi/context_dev/models/{brand_ai_product_params.rbi → ai_extract_product_params.rbi} +5 -2
- data/rbi/context_dev/models/{brand_ai_product_response.rbi → ai_extract_product_response.rbi} +40 -35
- data/rbi/context_dev/models/{brand_ai_products_params.rbi → ai_extract_products_params.rbi} +13 -13
- data/rbi/context_dev/models/{brand_ai_products_response.rbi → ai_extract_products_response.rbi} +26 -26
- data/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +15 -0
- data/rbi/context_dev/models/brand_retrieve_by_email_params.rbi +15 -0
- data/rbi/context_dev/models/brand_retrieve_by_isin_params.rbi +15 -0
- data/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +15 -0
- data/rbi/context_dev/models/brand_retrieve_by_ticker_params.rbi +15 -0
- data/rbi/context_dev/models/brand_retrieve_params.rbi +15 -0
- data/rbi/context_dev/models/{brand_retrieve_naics_params.rbi → industry_retrieve_naics_params.rbi} +2 -2
- data/rbi/context_dev/models/{brand_retrieve_naics_response.rbi → industry_retrieve_naics_response.rbi} +15 -15
- data/rbi/context_dev/models/{brand_fonts_params.rbi → style_extract_fonts_params.rbi} +5 -2
- data/rbi/context_dev/models/{brand_fonts_response.rbi → style_extract_fonts_response.rbi} +12 -6
- data/rbi/context_dev/models/{brand_styleguide_params.rbi → style_extract_styleguide_params.rbi} +15 -10
- data/rbi/context_dev/models/{brand_styleguide_response.rbi → style_extract_styleguide_response.rbi} +98 -95
- data/rbi/context_dev/models/{brand_prefetch_by_email_params.rbi → utility_prefetch_by_email_params.rbi} +2 -2
- data/rbi/context_dev/models/{brand_prefetch_by_email_response.rbi → utility_prefetch_by_email_response.rbi} +2 -2
- data/rbi/context_dev/models/{brand_prefetch_params.rbi → utility_prefetch_params.rbi} +5 -2
- data/rbi/context_dev/models/{brand_prefetch_response.rbi → utility_prefetch_response.rbi} +2 -2
- data/rbi/context_dev/models/{brand_screenshot_params.rbi → web_screenshot_params.rbi} +32 -42
- data/rbi/context_dev/models/{brand_screenshot_response.rbi → web_screenshot_response.rbi} +10 -10
- data/rbi/context_dev/models/{brand_web_scrape_html_params.rbi → web_web_scrape_html_params.rbi} +2 -2
- data/rbi/context_dev/models/{brand_web_scrape_html_response.rbi → web_web_scrape_html_response.rbi} +8 -8
- data/rbi/context_dev/models/{brand_web_scrape_images_params.rbi → web_web_scrape_images_params.rbi} +2 -2
- data/rbi/context_dev/models/{brand_web_scrape_images_response.rbi → web_web_scrape_images_response.rbi} +30 -32
- data/rbi/context_dev/models/{brand_web_scrape_md_params.rbi → web_web_scrape_md_params.rbi} +2 -5
- data/rbi/context_dev/models/{brand_web_scrape_md_response.rbi → web_web_scrape_md_response.rbi} +8 -8
- data/rbi/context_dev/models/{brand_web_scrape_sitemap_params.rbi → web_web_scrape_sitemap_params.rbi} +2 -2
- data/rbi/context_dev/models/{brand_web_scrape_sitemap_response.rbi → web_web_scrape_sitemap_response.rbi} +13 -13
- data/rbi/context_dev/models.rbi +19 -17
- data/rbi/context_dev/resources/ai.rbi +76 -0
- data/rbi/context_dev/resources/brand.rbi +0 -303
- data/rbi/context_dev/resources/industry.rbi +40 -0
- data/rbi/context_dev/resources/style.rbi +67 -0
- data/rbi/context_dev/resources/utility.rbi +60 -0
- data/rbi/context_dev/resources/web.rbi +121 -0
- data/sig/context_dev/client.rbs +10 -0
- data/sig/context_dev/models/{brand_ai_query_params.rbs → ai_ai_query_params.rbs} +31 -31
- data/sig/context_dev/models/{brand_ai_query_response.rbs → ai_ai_query_response.rbs} +15 -15
- data/sig/context_dev/models/{brand_ai_product_params.rbs → ai_extract_product_params.rbs} +2 -2
- data/sig/context_dev/models/{brand_ai_product_response.rbs → ai_extract_product_response.rbs} +21 -21
- data/sig/context_dev/models/{brand_ai_products_params.rbs → ai_extract_products_params.rbs} +9 -9
- data/sig/context_dev/models/{brand_ai_products_response.rbs → ai_extract_products_response.rbs} +18 -18
- data/sig/context_dev/models/brand_identify_from_transaction_params.rbs +6 -0
- data/sig/context_dev/models/brand_retrieve_by_email_params.rbs +6 -0
- data/sig/context_dev/models/brand_retrieve_by_isin_params.rbs +6 -0
- data/sig/context_dev/models/brand_retrieve_by_name_params.rbs +6 -0
- data/sig/context_dev/models/brand_retrieve_by_ticker_params.rbs +6 -0
- data/sig/context_dev/models/brand_retrieve_params.rbs +6 -0
- data/sig/context_dev/models/{brand_retrieve_naics_params.rbs → industry_retrieve_naics_params.rbs} +2 -2
- data/sig/context_dev/models/{brand_retrieve_naics_response.rbs → industry_retrieve_naics_response.rbs} +13 -13
- data/sig/context_dev/models/{brand_fonts_params.rbs → style_extract_fonts_params.rbs} +2 -2
- data/sig/context_dev/models/{brand_fonts_response.rbs → style_extract_fonts_response.rbs} +6 -6
- data/sig/context_dev/models/{brand_styleguide_params.rbs → style_extract_styleguide_params.rbs} +9 -9
- data/sig/context_dev/models/{brand_styleguide_response.rbs → style_extract_styleguide_response.rbs} +111 -111
- data/sig/context_dev/models/{brand_prefetch_by_email_params.rbs → utility_prefetch_by_email_params.rbs} +2 -2
- data/sig/context_dev/models/{brand_prefetch_by_email_response.rbs → utility_prefetch_by_email_response.rbs} +2 -2
- data/sig/context_dev/models/{brand_prefetch_params.rbs → utility_prefetch_params.rbs} +2 -2
- data/sig/context_dev/models/{brand_prefetch_response.rbs → utility_prefetch_response.rbs} +2 -2
- data/sig/context_dev/models/web_screenshot_params.rbs +100 -0
- data/sig/context_dev/models/{brand_screenshot_response.rbs → web_screenshot_response.rbs} +9 -9
- data/sig/context_dev/models/{brand_web_scrape_images_params.rbs → web_web_scrape_html_params.rbs} +2 -2
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +40 -0
- data/sig/context_dev/models/{brand_web_scrape_html_params.rbs → web_web_scrape_images_params.rbs} +2 -2
- data/sig/context_dev/models/web_web_scrape_images_response.rbs +98 -0
- data/sig/context_dev/models/{brand_web_scrape_md_params.rbs → web_web_scrape_md_params.rbs} +2 -2
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +40 -0
- data/sig/context_dev/models/{brand_web_scrape_sitemap_params.rbs → web_web_scrape_sitemap_params.rbs} +2 -2
- data/sig/context_dev/models/{brand_web_scrape_sitemap_response.rbs → web_web_scrape_sitemap_response.rbs} +11 -11
- data/sig/context_dev/models.rbs +17 -17
- data/sig/context_dev/resources/ai.rbs +26 -0
- data/sig/context_dev/resources/brand.rbs +0 -84
- data/sig/context_dev/resources/industry.rbs +15 -0
- data/sig/context_dev/resources/style.rbs +21 -0
- data/sig/context_dev/resources/utility.rbs +19 -0
- data/sig/context_dev/resources/web.rbs +38 -0
- metadata +94 -79
- data/sig/context_dev/models/brand_screenshot_params.rbs +0 -100
- data/sig/context_dev/models/brand_web_scrape_html_response.rbs +0 -40
- data/sig/context_dev/models/brand_web_scrape_images_response.rbs +0 -98
- data/sig/context_dev/models/brand_web_scrape_md_response.rbs +0 -40
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Utility#prefetch
|
|
6
|
+
class UtilityPrefetchParams < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include ContextDev::Internal::Type::RequestParameters
|
|
9
9
|
|
|
@@ -23,7 +23,7 @@ module ContextDev
|
|
|
23
23
|
|
|
24
24
|
# @!method initialize(domain:, timeout_ms: nil, request_options: {})
|
|
25
25
|
# Some parameter documentations has been truncated, see
|
|
26
|
-
# {ContextDev::Models::
|
|
26
|
+
# {ContextDev::Models::UtilityPrefetchParams} for more details.
|
|
27
27
|
#
|
|
28
28
|
# @param domain [String] Domain name to prefetch brand data for
|
|
29
29
|
#
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Utility#prefetch
|
|
6
|
+
class UtilityPrefetchResponse < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute domain
|
|
8
8
|
# The domain that was queued for prefetching
|
|
9
9
|
#
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Web#screenshot
|
|
6
|
+
class WebScreenshotParams < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include ContextDev::Internal::Type::RequestParameters
|
|
9
9
|
|
|
@@ -19,8 +19,8 @@ module ContextDev
|
|
|
19
19
|
# screenshot capturing all content. If 'false' or not provided, takes a viewport
|
|
20
20
|
# screenshot (standard browser view).
|
|
21
21
|
#
|
|
22
|
-
# @return [Symbol, ContextDev::Models::
|
|
23
|
-
optional :full_screenshot, enum: -> { ContextDev::
|
|
22
|
+
# @return [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot, nil]
|
|
23
|
+
optional :full_screenshot, enum: -> { ContextDev::WebScreenshotParams::FullScreenshot }
|
|
24
24
|
|
|
25
25
|
# @!attribute page
|
|
26
26
|
# Optional parameter to specify which page type to screenshot. If provided, the
|
|
@@ -28,28 +28,28 @@ module ContextDev
|
|
|
28
28
|
# appropriate URL for the specified page type (30 supported languages). If not
|
|
29
29
|
# provided, screenshots the main domain landing page.
|
|
30
30
|
#
|
|
31
|
-
# @return [Symbol, ContextDev::Models::
|
|
32
|
-
optional :page, enum: -> { ContextDev::
|
|
31
|
+
# @return [Symbol, ContextDev::Models::WebScreenshotParams::Page, nil]
|
|
32
|
+
optional :page, enum: -> { ContextDev::WebScreenshotParams::Page }
|
|
33
33
|
|
|
34
34
|
# @!attribute prioritize
|
|
35
35
|
# Optional parameter to prioritize screenshot capture. If 'speed', optimizes for
|
|
36
36
|
# faster capture with basic quality. If 'quality', optimizes for higher quality
|
|
37
37
|
# with longer wait times. Defaults to 'quality' if not provided.
|
|
38
38
|
#
|
|
39
|
-
# @return [Symbol, ContextDev::Models::
|
|
40
|
-
optional :prioritize, enum: -> { ContextDev::
|
|
39
|
+
# @return [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize, nil]
|
|
40
|
+
optional :prioritize, enum: -> { ContextDev::WebScreenshotParams::Prioritize }
|
|
41
41
|
|
|
42
42
|
# @!method initialize(domain:, full_screenshot: nil, page: nil, prioritize: nil, request_options: {})
|
|
43
43
|
# Some parameter documentations has been truncated, see
|
|
44
|
-
# {ContextDev::Models::
|
|
44
|
+
# {ContextDev::Models::WebScreenshotParams} for more details.
|
|
45
45
|
#
|
|
46
46
|
# @param domain [String] Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domai
|
|
47
47
|
#
|
|
48
|
-
# @param full_screenshot [Symbol, ContextDev::Models::
|
|
48
|
+
# @param full_screenshot [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc
|
|
49
49
|
#
|
|
50
|
-
# @param page [Symbol, ContextDev::Models::
|
|
50
|
+
# @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy
|
|
51
51
|
#
|
|
52
|
-
# @param prioritize [Symbol, ContextDev::Models::
|
|
52
|
+
# @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f
|
|
53
53
|
#
|
|
54
54
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
55
55
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Web#screenshot
|
|
6
|
+
class WebScreenshotResponse < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute code
|
|
8
8
|
# HTTP status code
|
|
9
9
|
#
|
|
@@ -25,9 +25,9 @@ module ContextDev
|
|
|
25
25
|
# @!attribute screenshot_type
|
|
26
26
|
# Type of screenshot that was captured
|
|
27
27
|
#
|
|
28
|
-
# @return [Symbol, ContextDev::Models::
|
|
28
|
+
# @return [Symbol, ContextDev::Models::WebScreenshotResponse::ScreenshotType, nil]
|
|
29
29
|
optional :screenshot_type,
|
|
30
|
-
enum: -> { ContextDev::Models::
|
|
30
|
+
enum: -> { ContextDev::Models::WebScreenshotResponse::ScreenshotType },
|
|
31
31
|
api_name: :screenshotType
|
|
32
32
|
|
|
33
33
|
# @!attribute status
|
|
@@ -43,13 +43,13 @@ module ContextDev
|
|
|
43
43
|
#
|
|
44
44
|
# @param screenshot [String] Public URL of the uploaded screenshot image
|
|
45
45
|
#
|
|
46
|
-
# @param screenshot_type [Symbol, ContextDev::Models::
|
|
46
|
+
# @param screenshot_type [Symbol, ContextDev::Models::WebScreenshotResponse::ScreenshotType] Type of screenshot that was captured
|
|
47
47
|
#
|
|
48
48
|
# @param status [String] Status of the response, e.g., 'ok'
|
|
49
49
|
|
|
50
50
|
# Type of screenshot that was captured
|
|
51
51
|
#
|
|
52
|
-
# @see ContextDev::Models::
|
|
52
|
+
# @see ContextDev::Models::WebScreenshotResponse#screenshot_type
|
|
53
53
|
module ScreenshotType
|
|
54
54
|
extend ContextDev::Internal::Type::Enum
|
|
55
55
|
|
data/lib/context_dev/models/{brand_web_scrape_html_params.rb → web_web_scrape_html_params.rb}
RENAMED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Web#web_scrape_html
|
|
6
|
+
class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include ContextDev::Internal::Type::RequestParameters
|
|
9
9
|
|
data/lib/context_dev/models/{brand_web_scrape_html_response.rb → web_web_scrape_html_response.rb}
RENAMED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Web#web_scrape_html
|
|
6
|
+
class WebWebScrapeHTMLResponse < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute html
|
|
8
8
|
# Raw HTML content of the page
|
|
9
9
|
#
|
|
@@ -13,8 +13,8 @@ module ContextDev
|
|
|
13
13
|
# @!attribute success
|
|
14
14
|
# Indicates success
|
|
15
15
|
#
|
|
16
|
-
# @return [Boolean, ContextDev::Models::
|
|
17
|
-
required :success, enum: -> { ContextDev::Models::
|
|
16
|
+
# @return [Boolean, ContextDev::Models::WebWebScrapeHTMLResponse::Success]
|
|
17
|
+
required :success, enum: -> { ContextDev::Models::WebWebScrapeHTMLResponse::Success }
|
|
18
18
|
|
|
19
19
|
# @!attribute url
|
|
20
20
|
# The URL that was scraped
|
|
@@ -25,13 +25,13 @@ module ContextDev
|
|
|
25
25
|
# @!method initialize(html:, success:, url:)
|
|
26
26
|
# @param html [String] Raw HTML content of the page
|
|
27
27
|
#
|
|
28
|
-
# @param success [Boolean, ContextDev::Models::
|
|
28
|
+
# @param success [Boolean, ContextDev::Models::WebWebScrapeHTMLResponse::Success] Indicates success
|
|
29
29
|
#
|
|
30
30
|
# @param url [String] The URL that was scraped
|
|
31
31
|
|
|
32
32
|
# Indicates success
|
|
33
33
|
#
|
|
34
|
-
# @see ContextDev::Models::
|
|
34
|
+
# @see ContextDev::Models::WebWebScrapeHTMLResponse#success
|
|
35
35
|
module Success
|
|
36
36
|
extend ContextDev::Internal::Type::Enum
|
|
37
37
|
|
data/lib/context_dev/models/{brand_web_scrape_images_params.rb → web_web_scrape_images_params.rb}
RENAMED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Web#web_scrape_images
|
|
6
|
+
class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include ContextDev::Internal::Type::RequestParameters
|
|
9
9
|
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Web#web_scrape_images
|
|
6
|
+
class WebWebScrapeImagesResponse < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute images
|
|
8
8
|
# Array of scraped images
|
|
9
9
|
#
|
|
10
|
-
# @return [Array<ContextDev::Models::
|
|
10
|
+
# @return [Array<ContextDev::Models::WebWebScrapeImagesResponse::Image>]
|
|
11
11
|
required :images,
|
|
12
|
-
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::
|
|
12
|
+
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebWebScrapeImagesResponse::Image] }
|
|
13
13
|
|
|
14
14
|
# @!attribute success
|
|
15
15
|
# Indicates success
|
|
16
16
|
#
|
|
17
|
-
# @return [Boolean, ContextDev::Models::
|
|
18
|
-
required :success, enum: -> { ContextDev::Models::
|
|
17
|
+
# @return [Boolean, ContextDev::Models::WebWebScrapeImagesResponse::Success]
|
|
18
|
+
required :success, enum: -> { ContextDev::Models::WebWebScrapeImagesResponse::Success }
|
|
19
19
|
|
|
20
20
|
# @!attribute url
|
|
21
21
|
# The URL that was scraped
|
|
@@ -24,9 +24,9 @@ module ContextDev
|
|
|
24
24
|
required :url, String
|
|
25
25
|
|
|
26
26
|
# @!method initialize(images:, success:, url:)
|
|
27
|
-
# @param images [Array<ContextDev::Models::
|
|
27
|
+
# @param images [Array<ContextDev::Models::WebWebScrapeImagesResponse::Image>] Array of scraped images
|
|
28
28
|
#
|
|
29
|
-
# @param success [Boolean, ContextDev::Models::
|
|
29
|
+
# @param success [Boolean, ContextDev::Models::WebWebScrapeImagesResponse::Success] Indicates success
|
|
30
30
|
#
|
|
31
31
|
# @param url [String] The URL that was scraped
|
|
32
32
|
|
|
@@ -40,8 +40,8 @@ module ContextDev
|
|
|
40
40
|
# @!attribute element
|
|
41
41
|
# The HTML element the image was found in
|
|
42
42
|
#
|
|
43
|
-
# @return [Symbol, ContextDev::Models::
|
|
44
|
-
required :element, enum: -> { ContextDev::Models::
|
|
43
|
+
# @return [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Element]
|
|
44
|
+
required :element, enum: -> { ContextDev::Models::WebWebScrapeImagesResponse::Image::Element }
|
|
45
45
|
|
|
46
46
|
# @!attribute src
|
|
47
47
|
# The image source - can be a URL, inline HTML (for SVGs), or a base64 data URI
|
|
@@ -52,21 +52,21 @@ module ContextDev
|
|
|
52
52
|
# @!attribute type
|
|
53
53
|
# The type/format of the src value
|
|
54
54
|
#
|
|
55
|
-
# @return [Symbol, ContextDev::Models::
|
|
56
|
-
required :type, enum: -> { ContextDev::Models::
|
|
55
|
+
# @return [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Type]
|
|
56
|
+
required :type, enum: -> { ContextDev::Models::WebWebScrapeImagesResponse::Image::Type }
|
|
57
57
|
|
|
58
58
|
# @!method initialize(alt:, element:, src:, type:)
|
|
59
59
|
# @param alt [String, nil] Alt text of the image, or null if not present
|
|
60
60
|
#
|
|
61
|
-
# @param element [Symbol, ContextDev::Models::
|
|
61
|
+
# @param element [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Element] The HTML element the image was found in
|
|
62
62
|
#
|
|
63
63
|
# @param src [String] The image source - can be a URL, inline HTML (for SVGs), or a base64 data URI
|
|
64
64
|
#
|
|
65
|
-
# @param type [Symbol, ContextDev::Models::
|
|
65
|
+
# @param type [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Type] The type/format of the src value
|
|
66
66
|
|
|
67
67
|
# The HTML element the image was found in
|
|
68
68
|
#
|
|
69
|
-
# @see ContextDev::Models::
|
|
69
|
+
# @see ContextDev::Models::WebWebScrapeImagesResponse::Image#element
|
|
70
70
|
module Element
|
|
71
71
|
extend ContextDev::Internal::Type::Enum
|
|
72
72
|
|
|
@@ -82,7 +82,7 @@ module ContextDev
|
|
|
82
82
|
|
|
83
83
|
# The type/format of the src value
|
|
84
84
|
#
|
|
85
|
-
# @see ContextDev::Models::
|
|
85
|
+
# @see ContextDev::Models::WebWebScrapeImagesResponse::Image#type
|
|
86
86
|
module Type
|
|
87
87
|
extend ContextDev::Internal::Type::Enum
|
|
88
88
|
|
|
@@ -97,7 +97,7 @@ module ContextDev
|
|
|
97
97
|
|
|
98
98
|
# Indicates success
|
|
99
99
|
#
|
|
100
|
-
# @see ContextDev::Models::
|
|
100
|
+
# @see ContextDev::Models::WebWebScrapeImagesResponse#success
|
|
101
101
|
module Success
|
|
102
102
|
extend ContextDev::Internal::Type::Enum
|
|
103
103
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Web#web_scrape_md
|
|
6
|
+
class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include ContextDev::Internal::Type::RequestParameters
|
|
9
9
|
|
|
@@ -34,7 +34,7 @@ module ContextDev
|
|
|
34
34
|
|
|
35
35
|
# @!method initialize(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, request_options: {})
|
|
36
36
|
# Some parameter documentations has been truncated, see
|
|
37
|
-
# {ContextDev::Models::
|
|
37
|
+
# {ContextDev::Models::WebWebScrapeMdParams} for more details.
|
|
38
38
|
#
|
|
39
39
|
# @param url [String] Full URL to scrape and convert to markdown (must include http:// or https:// pro
|
|
40
40
|
#
|
data/lib/context_dev/models/{brand_web_scrape_md_response.rb → web_web_scrape_md_response.rb}
RENAMED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Web#web_scrape_md
|
|
6
|
+
class WebWebScrapeMdResponse < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute markdown
|
|
8
8
|
# Page content converted to GitHub Flavored Markdown
|
|
9
9
|
#
|
|
@@ -13,8 +13,8 @@ module ContextDev
|
|
|
13
13
|
# @!attribute success
|
|
14
14
|
# Indicates success
|
|
15
15
|
#
|
|
16
|
-
# @return [Boolean, ContextDev::Models::
|
|
17
|
-
required :success, enum: -> { ContextDev::Models::
|
|
16
|
+
# @return [Boolean, ContextDev::Models::WebWebScrapeMdResponse::Success]
|
|
17
|
+
required :success, enum: -> { ContextDev::Models::WebWebScrapeMdResponse::Success }
|
|
18
18
|
|
|
19
19
|
# @!attribute url
|
|
20
20
|
# The URL that was scraped
|
|
@@ -25,13 +25,13 @@ module ContextDev
|
|
|
25
25
|
# @!method initialize(markdown:, success:, url:)
|
|
26
26
|
# @param markdown [String] Page content converted to GitHub Flavored Markdown
|
|
27
27
|
#
|
|
28
|
-
# @param success [Boolean, ContextDev::Models::
|
|
28
|
+
# @param success [Boolean, ContextDev::Models::WebWebScrapeMdResponse::Success] Indicates success
|
|
29
29
|
#
|
|
30
30
|
# @param url [String] The URL that was scraped
|
|
31
31
|
|
|
32
32
|
# Indicates success
|
|
33
33
|
#
|
|
34
|
-
# @see ContextDev::Models::
|
|
34
|
+
# @see ContextDev::Models::WebWebScrapeMdResponse#success
|
|
35
35
|
module Success
|
|
36
36
|
extend ContextDev::Internal::Type::Enum
|
|
37
37
|
|
data/lib/context_dev/models/{brand_web_scrape_sitemap_params.rb → web_web_scrape_sitemap_params.rb}
RENAMED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Web#web_scrape_sitemap
|
|
6
|
+
class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include ContextDev::Internal::Type::RequestParameters
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@ module ContextDev
|
|
|
16
16
|
|
|
17
17
|
# @!method initialize(domain:, request_options: {})
|
|
18
18
|
# Some parameter documentations has been truncated, see
|
|
19
|
-
# {ContextDev::Models::
|
|
19
|
+
# {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
|
|
20
20
|
#
|
|
21
21
|
# @param domain [String] Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be auto
|
|
22
22
|
#
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Models
|
|
5
|
-
# @see ContextDev::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see ContextDev::Resources::Web#web_scrape_sitemap
|
|
6
|
+
class WebWebScrapeSitemapResponse < ContextDev::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute domain
|
|
8
8
|
# The normalized domain that was crawled
|
|
9
9
|
#
|
|
@@ -13,14 +13,14 @@ module ContextDev
|
|
|
13
13
|
# @!attribute meta
|
|
14
14
|
# Metadata about the sitemap crawl operation
|
|
15
15
|
#
|
|
16
|
-
# @return [ContextDev::Models::
|
|
17
|
-
required :meta, -> { ContextDev::Models::
|
|
16
|
+
# @return [ContextDev::Models::WebWebScrapeSitemapResponse::Meta]
|
|
17
|
+
required :meta, -> { ContextDev::Models::WebWebScrapeSitemapResponse::Meta }
|
|
18
18
|
|
|
19
19
|
# @!attribute success
|
|
20
20
|
# Indicates success
|
|
21
21
|
#
|
|
22
|
-
# @return [Boolean, ContextDev::Models::
|
|
23
|
-
required :success, enum: -> { ContextDev::Models::
|
|
22
|
+
# @return [Boolean, ContextDev::Models::WebWebScrapeSitemapResponse::Success]
|
|
23
|
+
required :success, enum: -> { ContextDev::Models::WebWebScrapeSitemapResponse::Success }
|
|
24
24
|
|
|
25
25
|
# @!attribute urls
|
|
26
26
|
# Array of discovered page URLs from the sitemap (max 500)
|
|
@@ -31,13 +31,13 @@ module ContextDev
|
|
|
31
31
|
# @!method initialize(domain:, meta:, success:, urls:)
|
|
32
32
|
# @param domain [String] The normalized domain that was crawled
|
|
33
33
|
#
|
|
34
|
-
# @param meta [ContextDev::Models::
|
|
34
|
+
# @param meta [ContextDev::Models::WebWebScrapeSitemapResponse::Meta] Metadata about the sitemap crawl operation
|
|
35
35
|
#
|
|
36
|
-
# @param success [Boolean, ContextDev::Models::
|
|
36
|
+
# @param success [Boolean, ContextDev::Models::WebWebScrapeSitemapResponse::Success] Indicates success
|
|
37
37
|
#
|
|
38
38
|
# @param urls [Array<String>] Array of discovered page URLs from the sitemap (max 500)
|
|
39
39
|
|
|
40
|
-
# @see ContextDev::Models::
|
|
40
|
+
# @see ContextDev::Models::WebWebScrapeSitemapResponse#meta
|
|
41
41
|
class Meta < ContextDev::Internal::Type::BaseModel
|
|
42
42
|
# @!attribute errors
|
|
43
43
|
# Number of errors encountered during crawling
|
|
@@ -77,7 +77,7 @@ module ContextDev
|
|
|
77
77
|
|
|
78
78
|
# Indicates success
|
|
79
79
|
#
|
|
80
|
-
# @see ContextDev::Models::
|
|
80
|
+
# @see ContextDev::Models::WebWebScrapeSitemapResponse#success
|
|
81
81
|
module Success
|
|
82
82
|
extend ContextDev::Internal::Type::Enum
|
|
83
83
|
|
data/lib/context_dev/models.rb
CHANGED
|
@@ -39,20 +39,14 @@ module ContextDev
|
|
|
39
39
|
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
AIAIQueryParams = ContextDev::Models::AIAIQueryParams
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
AIExtractProductParams = ContextDev::Models::AIExtractProductParams
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
BrandFontsParams = ContextDev::Models::BrandFontsParams
|
|
46
|
+
AIExtractProductsParams = ContextDev::Models::AIExtractProductsParams
|
|
49
47
|
|
|
50
48
|
BrandIdentifyFromTransactionParams = ContextDev::Models::BrandIdentifyFromTransactionParams
|
|
51
49
|
|
|
52
|
-
BrandPrefetchByEmailParams = ContextDev::Models::BrandPrefetchByEmailParams
|
|
53
|
-
|
|
54
|
-
BrandPrefetchParams = ContextDev::Models::BrandPrefetchParams
|
|
55
|
-
|
|
56
50
|
BrandRetrieveByEmailParams = ContextDev::Models::BrandRetrieveByEmailParams
|
|
57
51
|
|
|
58
52
|
BrandRetrieveByIsinParams = ContextDev::Models::BrandRetrieveByIsinParams
|
|
@@ -61,21 +55,27 @@ module ContextDev
|
|
|
61
55
|
|
|
62
56
|
BrandRetrieveByTickerParams = ContextDev::Models::BrandRetrieveByTickerParams
|
|
63
57
|
|
|
64
|
-
BrandRetrieveNaicsParams = ContextDev::Models::BrandRetrieveNaicsParams
|
|
65
|
-
|
|
66
58
|
BrandRetrieveParams = ContextDev::Models::BrandRetrieveParams
|
|
67
59
|
|
|
68
60
|
BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams
|
|
69
61
|
|
|
70
|
-
|
|
62
|
+
IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams
|
|
63
|
+
|
|
64
|
+
StyleExtractFontsParams = ContextDev::Models::StyleExtractFontsParams
|
|
65
|
+
|
|
66
|
+
StyleExtractStyleguideParams = ContextDev::Models::StyleExtractStyleguideParams
|
|
67
|
+
|
|
68
|
+
UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams
|
|
69
|
+
|
|
70
|
+
UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
WebScreenshotParams = ContextDev::Models::WebScreenshotParams
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
WebWebScrapeHTMLParams = ContextDev::Models::WebWebScrapeHTMLParams
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
WebWebScrapeImagesParams = ContextDev::Models::WebWebScrapeImagesParams
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
WebWebScrapeMdParams = ContextDev::Models::WebWebScrapeMdParams
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
WebWebScrapeSitemapParams = ContextDev::Models::WebWebScrapeSitemapParams
|
|
81
81
|
end
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Resources
|
|
5
|
+
class AI
|
|
6
|
+
# Some parameter documentations has been truncated, see
|
|
7
|
+
# {ContextDev::Models::AIAIQueryParams} for more details.
|
|
8
|
+
#
|
|
9
|
+
# Use AI to extract specific data points from a brand's website. The AI will crawl
|
|
10
|
+
# the website and extract the requested information based on the provided data
|
|
11
|
+
# points.
|
|
12
|
+
#
|
|
13
|
+
# @overload ai_query(data_to_extract:, domain:, specific_pages: nil, timeout_ms: nil, request_options: {})
|
|
14
|
+
#
|
|
15
|
+
# @param data_to_extract [Array<ContextDev::Models::AIAIQueryParams::DataToExtract>] Array of data points to extract from the website
|
|
16
|
+
#
|
|
17
|
+
# @param domain [String] The domain name to analyze
|
|
18
|
+
#
|
|
19
|
+
# @param specific_pages [ContextDev::Models::AIAIQueryParams::SpecificPages] Optional object specifying which pages to analyze
|
|
20
|
+
#
|
|
21
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
22
|
+
#
|
|
23
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
24
|
+
#
|
|
25
|
+
# @return [ContextDev::Models::AIAIQueryResponse]
|
|
26
|
+
#
|
|
27
|
+
# @see ContextDev::Models::AIAIQueryParams
|
|
28
|
+
def ai_query(params)
|
|
29
|
+
parsed, options = ContextDev::AIAIQueryParams.dump_request(params)
|
|
30
|
+
@client.request(
|
|
31
|
+
method: :post,
|
|
32
|
+
path: "brand/ai/query",
|
|
33
|
+
body: parsed,
|
|
34
|
+
model: ContextDev::Models::AIAIQueryResponse,
|
|
35
|
+
options: options
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Some parameter documentations has been truncated, see
|
|
40
|
+
# {ContextDev::Models::AIExtractProductParams} for more details.
|
|
41
|
+
#
|
|
42
|
+
# Beta feature: Given a single URL, determines if it is a product detail page,
|
|
43
|
+
# classifies the platform/product type, and extracts the product information.
|
|
44
|
+
# Supports Amazon, TikTok Shop, Etsy, and generic ecommerce sites.
|
|
45
|
+
#
|
|
46
|
+
# @overload extract_product(url:, timeout_ms: nil, request_options: {})
|
|
47
|
+
#
|
|
48
|
+
# @param url [String] The product page URL to extract product data from.
|
|
49
|
+
#
|
|
50
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
|
|
51
|
+
#
|
|
52
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
53
|
+
#
|
|
54
|
+
# @return [ContextDev::Models::AIExtractProductResponse]
|
|
55
|
+
#
|
|
56
|
+
# @see ContextDev::Models::AIExtractProductParams
|
|
57
|
+
def extract_product(params)
|
|
58
|
+
parsed, options = ContextDev::AIExtractProductParams.dump_request(params)
|
|
59
|
+
@client.request(
|
|
60
|
+
method: :post,
|
|
61
|
+
path: "brand/ai/product",
|
|
62
|
+
body: parsed,
|
|
63
|
+
model: ContextDev::Models::AIExtractProductResponse,
|
|
64
|
+
options: options
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Beta feature: Extract product information from a brand's website. Brand.dev will
|
|
69
|
+
# analyze the website and return a list of products with details such as name,
|
|
70
|
+
# description, image, pricing, features, and more.
|
|
71
|
+
#
|
|
72
|
+
# @overload extract_products(body:, request_options: {})
|
|
73
|
+
#
|
|
74
|
+
# @param body [ContextDev::Models::AIExtractProductsParams::Body::ByDomain, ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL]
|
|
75
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
76
|
+
#
|
|
77
|
+
# @return [ContextDev::Models::AIExtractProductsResponse]
|
|
78
|
+
#
|
|
79
|
+
# @see ContextDev::Models::AIExtractProductsParams
|
|
80
|
+
def extract_products(params)
|
|
81
|
+
parsed, options = ContextDev::AIExtractProductsParams.dump_request(params)
|
|
82
|
+
@client.request(
|
|
83
|
+
method: :post,
|
|
84
|
+
path: "brand/ai/products",
|
|
85
|
+
body: parsed[:body],
|
|
86
|
+
model: ContextDev::Models::AIExtractProductsResponse,
|
|
87
|
+
options: options
|
|
88
|
+
)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# @api private
|
|
92
|
+
#
|
|
93
|
+
# @param client [ContextDev::Client]
|
|
94
|
+
def initialize(client:)
|
|
95
|
+
@client = client
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|