context.dev 1.4.0 → 1.5.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 +22 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +0 -4
- data/lib/context_dev/internal/type/base_model.rb +3 -3
- data/lib/context_dev/models/brand_identify_from_transaction_params.rb +0 -1
- data/lib/context_dev/models/brand_retrieve_by_name_params.rb +5 -5
- data/lib/context_dev/models/industry_retrieve_naics_params.rb +4 -4
- data/lib/context_dev/models/{style_extract_fonts_params.rb → web_extract_fonts_params.rb} +18 -7
- data/lib/context_dev/models/{style_extract_fonts_response.rb → web_extract_fonts_response.rb} +5 -5
- data/lib/context_dev/models/{style_extract_styleguide_params.rb → web_extract_styleguide_params.rb} +8 -5
- data/lib/context_dev/models/{style_extract_styleguide_response.rb → web_extract_styleguide_response.rb} +147 -80
- data/lib/context_dev/models/web_screenshot_params.rb +3 -2
- data/lib/context_dev/models/web_web_scrape_html_params.rb +14 -1
- data/lib/context_dev/models/web_web_scrape_md_params.rb +13 -3
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +2 -3
- data/lib/context_dev/models.rb +4 -4
- data/lib/context_dev/resources/brand.rb +8 -12
- data/lib/context_dev/resources/industry.rb +3 -3
- data/lib/context_dev/resources/web.rb +80 -18
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +4 -5
- data/rbi/context_dev/client.rbi +0 -3
- data/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +0 -2
- data/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +6 -6
- data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +6 -6
- data/rbi/context_dev/models/{style_extract_fonts_params.rbi → web_extract_fonts_params.rbi} +27 -7
- data/rbi/context_dev/models/{style_extract_fonts_response.rbi → web_extract_fonts_response.rbi} +6 -9
- data/rbi/context_dev/models/{style_extract_styleguide_params.rbi → web_extract_styleguide_params.rbi} +12 -6
- data/rbi/context_dev/models/{style_extract_styleguide_response.rbi → web_extract_styleguide_response.rbi} +232 -94
- data/rbi/context_dev/models/web_screenshot_params.rbi +6 -4
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +19 -1
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +17 -2
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +2 -4
- data/rbi/context_dev/models.rbi +4 -5
- data/rbi/context_dev/resources/brand.rbi +9 -14
- data/rbi/context_dev/resources/industry.rbi +4 -4
- data/rbi/context_dev/resources/web.rbi +74 -17
- data/sig/context_dev/client.rbs +0 -2
- data/sig/context_dev/models/{style_extract_styleguide_params.rbs → web_extract_fonts_params.rbs} +2 -2
- data/sig/context_dev/models/{style_extract_fonts_response.rbs → web_extract_fonts_response.rbs} +6 -6
- data/sig/context_dev/models/{style_extract_fonts_params.rbs → web_extract_styleguide_params.rbs} +13 -5
- data/sig/context_dev/models/{style_extract_styleguide_response.rbs → web_extract_styleguide_response.rbs} +147 -95
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +8 -1
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +7 -0
- data/sig/context_dev/models.rbs +4 -4
- data/sig/context_dev/resources/web.rbs +16 -0
- metadata +14 -17
- data/lib/context_dev/resources/style.rb +0 -76
- data/rbi/context_dev/resources/style.rbi +0 -60
- data/sig/context_dev/resources/style.rbs +0 -20
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module ContextDev
|
|
4
|
-
module Resources
|
|
5
|
-
class Style
|
|
6
|
-
# Some parameter documentations has been truncated, see
|
|
7
|
-
# {ContextDev::Models::StyleExtractFontsParams} for more details.
|
|
8
|
-
#
|
|
9
|
-
# Extract font information from a brand's website including font families, usage
|
|
10
|
-
# statistics, fallbacks, and element/word counts.
|
|
11
|
-
#
|
|
12
|
-
# @overload extract_fonts(domain:, timeout_ms: nil, request_options: {})
|
|
13
|
-
#
|
|
14
|
-
# @param domain [String] Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domai
|
|
15
|
-
#
|
|
16
|
-
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
17
|
-
#
|
|
18
|
-
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
19
|
-
#
|
|
20
|
-
# @return [ContextDev::Models::StyleExtractFontsResponse]
|
|
21
|
-
#
|
|
22
|
-
# @see ContextDev::Models::StyleExtractFontsParams
|
|
23
|
-
def extract_fonts(params)
|
|
24
|
-
parsed, options = ContextDev::StyleExtractFontsParams.dump_request(params)
|
|
25
|
-
query = ContextDev::Internal::Util.encode_query_params(parsed)
|
|
26
|
-
@client.request(
|
|
27
|
-
method: :get,
|
|
28
|
-
path: "brand/fonts",
|
|
29
|
-
query: query.transform_keys(timeout_ms: "timeoutMS"),
|
|
30
|
-
model: ContextDev::Models::StyleExtractFontsResponse,
|
|
31
|
-
options: options
|
|
32
|
-
)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# Some parameter documentations has been truncated, see
|
|
36
|
-
# {ContextDev::Models::StyleExtractStyleguideParams} for more details.
|
|
37
|
-
#
|
|
38
|
-
# Automatically extract comprehensive design system information from a brand's
|
|
39
|
-
# website including colors, typography, spacing, shadows, and UI components.
|
|
40
|
-
# Either 'domain' or 'directUrl' must be provided as a query parameter, but not
|
|
41
|
-
# both.
|
|
42
|
-
#
|
|
43
|
-
# @overload extract_styleguide(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {})
|
|
44
|
-
#
|
|
45
|
-
# @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio
|
|
46
|
-
#
|
|
47
|
-
# @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
|
|
48
|
-
#
|
|
49
|
-
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
50
|
-
#
|
|
51
|
-
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
52
|
-
#
|
|
53
|
-
# @return [ContextDev::Models::StyleExtractStyleguideResponse]
|
|
54
|
-
#
|
|
55
|
-
# @see ContextDev::Models::StyleExtractStyleguideParams
|
|
56
|
-
def extract_styleguide(params = {})
|
|
57
|
-
parsed, options = ContextDev::StyleExtractStyleguideParams.dump_request(params)
|
|
58
|
-
query = ContextDev::Internal::Util.encode_query_params(parsed)
|
|
59
|
-
@client.request(
|
|
60
|
-
method: :get,
|
|
61
|
-
path: "brand/styleguide",
|
|
62
|
-
query: query.transform_keys(direct_url: "directUrl", timeout_ms: "timeoutMS"),
|
|
63
|
-
model: ContextDev::Models::StyleExtractStyleguideResponse,
|
|
64
|
-
options: options
|
|
65
|
-
)
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
# @api private
|
|
69
|
-
#
|
|
70
|
-
# @param client [ContextDev::Client]
|
|
71
|
-
def initialize(client:)
|
|
72
|
-
@client = client
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module ContextDev
|
|
4
|
-
module Resources
|
|
5
|
-
class Style
|
|
6
|
-
# Extract font information from a brand's website including font families, usage
|
|
7
|
-
# statistics, fallbacks, and element/word counts.
|
|
8
|
-
sig do
|
|
9
|
-
params(
|
|
10
|
-
domain: String,
|
|
11
|
-
timeout_ms: Integer,
|
|
12
|
-
request_options: ContextDev::RequestOptions::OrHash
|
|
13
|
-
).returns(ContextDev::Models::StyleExtractFontsResponse)
|
|
14
|
-
end
|
|
15
|
-
def extract_fonts(
|
|
16
|
-
# Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The
|
|
17
|
-
# domain will be automatically normalized and validated.
|
|
18
|
-
domain:,
|
|
19
|
-
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
20
|
-
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
21
|
-
# value is 300000ms (5 minutes).
|
|
22
|
-
timeout_ms: nil,
|
|
23
|
-
request_options: {}
|
|
24
|
-
)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# Automatically extract comprehensive design system information from a brand's
|
|
28
|
-
# website including colors, typography, spacing, shadows, and UI components.
|
|
29
|
-
# Either 'domain' or 'directUrl' must be provided as a query parameter, but not
|
|
30
|
-
# both.
|
|
31
|
-
sig do
|
|
32
|
-
params(
|
|
33
|
-
direct_url: String,
|
|
34
|
-
domain: String,
|
|
35
|
-
timeout_ms: Integer,
|
|
36
|
-
request_options: ContextDev::RequestOptions::OrHash
|
|
37
|
-
).returns(ContextDev::Models::StyleExtractStyleguideResponse)
|
|
38
|
-
end
|
|
39
|
-
def extract_styleguide(
|
|
40
|
-
# A specific URL to fetch the styleguide from directly, bypassing domain
|
|
41
|
-
# resolution (e.g., 'https://example.com/design-system').
|
|
42
|
-
direct_url: nil,
|
|
43
|
-
# Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
|
|
44
|
-
# domain will be automatically normalized and validated.
|
|
45
|
-
domain: nil,
|
|
46
|
-
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
47
|
-
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
48
|
-
# value is 300000ms (5 minutes).
|
|
49
|
-
timeout_ms: nil,
|
|
50
|
-
request_options: {}
|
|
51
|
-
)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# @api private
|
|
55
|
-
sig { params(client: ContextDev::Client).returns(T.attached_class) }
|
|
56
|
-
def self.new(client:)
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module ContextDev
|
|
2
|
-
module Resources
|
|
3
|
-
class Style
|
|
4
|
-
def extract_fonts: (
|
|
5
|
-
domain: String,
|
|
6
|
-
?timeout_ms: Integer,
|
|
7
|
-
?request_options: ContextDev::request_opts
|
|
8
|
-
) -> ContextDev::Models::StyleExtractFontsResponse
|
|
9
|
-
|
|
10
|
-
def extract_styleguide: (
|
|
11
|
-
?direct_url: String,
|
|
12
|
-
?domain: String,
|
|
13
|
-
?timeout_ms: Integer,
|
|
14
|
-
?request_options: ContextDev::request_opts
|
|
15
|
-
) -> ContextDev::Models::StyleExtractStyleguideResponse
|
|
16
|
-
|
|
17
|
-
def initialize: (client: ContextDev::Client) -> void
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|