context.dev 1.3.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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +0 -4
  5. data/lib/context_dev/internal/type/base_model.rb +3 -3
  6. data/lib/context_dev/internal/util.rb +3 -1
  7. data/lib/context_dev/models/brand_identify_from_transaction_params.rb +65 -1
  8. data/lib/context_dev/models/brand_identify_from_transaction_response.rb +190 -5
  9. data/lib/context_dev/models/brand_retrieve_by_email_params.rb +65 -0
  10. data/lib/context_dev/models/brand_retrieve_by_email_response.rb +190 -5
  11. data/lib/context_dev/models/brand_retrieve_by_isin_params.rb +65 -0
  12. data/lib/context_dev/models/brand_retrieve_by_isin_response.rb +190 -5
  13. data/lib/context_dev/models/brand_retrieve_by_name_params.rb +70 -5
  14. data/lib/context_dev/models/brand_retrieve_by_name_response.rb +190 -5
  15. data/lib/context_dev/models/brand_retrieve_by_ticker_params.rb +65 -0
  16. data/lib/context_dev/models/brand_retrieve_by_ticker_response.rb +190 -5
  17. data/lib/context_dev/models/brand_retrieve_params.rb +68 -5
  18. data/lib/context_dev/models/brand_retrieve_response.rb +190 -5
  19. data/lib/context_dev/models/industry_retrieve_naics_params.rb +4 -4
  20. data/lib/context_dev/models/{style_extract_fonts_params.rb → web_extract_fonts_params.rb} +18 -7
  21. data/lib/context_dev/models/{style_extract_fonts_response.rb → web_extract_fonts_response.rb} +5 -5
  22. data/lib/context_dev/models/{style_extract_styleguide_params.rb → web_extract_styleguide_params.rb} +8 -5
  23. data/lib/context_dev/models/{style_extract_styleguide_response.rb → web_extract_styleguide_response.rb} +147 -80
  24. data/lib/context_dev/models/web_screenshot_params.rb +19 -6
  25. data/lib/context_dev/models/web_web_scrape_html_params.rb +14 -1
  26. data/lib/context_dev/models/web_web_scrape_md_params.rb +13 -3
  27. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +2 -3
  28. data/lib/context_dev/models.rb +4 -4
  29. data/lib/context_dev/resources/brand.rb +9 -13
  30. data/lib/context_dev/resources/industry.rb +3 -3
  31. data/lib/context_dev/resources/web.rb +85 -20
  32. data/lib/context_dev/version.rb +1 -1
  33. data/lib/context_dev.rb +4 -5
  34. data/rbi/context_dev/client.rbi +0 -3
  35. data/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +325 -2
  36. data/rbi/context_dev/models/brand_identify_from_transaction_response.rbi +859 -6
  37. data/rbi/context_dev/models/brand_retrieve_by_email_params.rbi +325 -0
  38. data/rbi/context_dev/models/brand_retrieve_by_email_response.rbi +859 -6
  39. data/rbi/context_dev/models/brand_retrieve_by_isin_params.rbi +325 -0
  40. data/rbi/context_dev/models/brand_retrieve_by_isin_response.rbi +859 -6
  41. data/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +331 -6
  42. data/rbi/context_dev/models/brand_retrieve_by_name_response.rbi +859 -6
  43. data/rbi/context_dev/models/brand_retrieve_by_ticker_params.rbi +325 -0
  44. data/rbi/context_dev/models/brand_retrieve_by_ticker_response.rbi +859 -6
  45. data/rbi/context_dev/models/brand_retrieve_params.rbi +328 -6
  46. data/rbi/context_dev/models/brand_retrieve_response.rbi +859 -6
  47. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +6 -6
  48. data/rbi/context_dev/models/{style_extract_fonts_params.rbi → web_extract_fonts_params.rbi} +27 -7
  49. data/rbi/context_dev/models/{style_extract_fonts_response.rbi → web_extract_fonts_response.rbi} +6 -9
  50. data/rbi/context_dev/models/{style_extract_styleguide_params.rbi → web_extract_styleguide_params.rbi} +12 -6
  51. data/rbi/context_dev/models/{style_extract_styleguide_response.rbi → web_extract_styleguide_response.rbi} +232 -94
  52. data/rbi/context_dev/models/web_screenshot_params.rbi +31 -8
  53. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +19 -1
  54. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +17 -2
  55. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +2 -4
  56. data/rbi/context_dev/models.rbi +4 -5
  57. data/rbi/context_dev/resources/brand.rbi +10 -16
  58. data/rbi/context_dev/resources/industry.rbi +4 -4
  59. data/rbi/context_dev/resources/web.rbi +81 -17
  60. data/sig/context_dev/client.rbs +0 -2
  61. data/sig/context_dev/models/brand_identify_from_transaction_params.rbs +131 -1
  62. data/sig/context_dev/models/brand_identify_from_transaction_response.rbs +342 -5
  63. data/sig/context_dev/models/brand_retrieve_by_email_params.rbs +131 -1
  64. data/sig/context_dev/models/brand_retrieve_by_email_response.rbs +342 -5
  65. data/sig/context_dev/models/brand_retrieve_by_isin_params.rbs +131 -1
  66. data/sig/context_dev/models/brand_retrieve_by_isin_response.rbs +342 -5
  67. data/sig/context_dev/models/brand_retrieve_by_name_params.rbs +131 -1
  68. data/sig/context_dev/models/brand_retrieve_by_name_response.rbs +342 -5
  69. data/sig/context_dev/models/brand_retrieve_by_ticker_params.rbs +131 -1
  70. data/sig/context_dev/models/brand_retrieve_by_ticker_response.rbs +342 -5
  71. data/sig/context_dev/models/brand_retrieve_params.rbs +131 -1
  72. data/sig/context_dev/models/brand_retrieve_response.rbs +342 -5
  73. data/sig/context_dev/models/{style_extract_styleguide_params.rbs → web_extract_fonts_params.rbs} +2 -2
  74. data/sig/context_dev/models/{style_extract_fonts_response.rbs → web_extract_fonts_response.rbs} +6 -6
  75. data/sig/context_dev/models/{style_extract_fonts_params.rbs → web_extract_styleguide_params.rbs} +13 -5
  76. data/sig/context_dev/models/{style_extract_styleguide_response.rbs → web_extract_styleguide_response.rbs} +147 -95
  77. data/sig/context_dev/models/web_screenshot_params.rbs +11 -2
  78. data/sig/context_dev/models/web_web_scrape_html_params.rbs +8 -1
  79. data/sig/context_dev/models/web_web_scrape_md_params.rbs +7 -0
  80. data/sig/context_dev/models.rbs +4 -4
  81. data/sig/context_dev/resources/web.rbs +18 -1
  82. metadata +14 -17
  83. data/lib/context_dev/resources/style.rb +0 -76
  84. data/rbi/context_dev/resources/style.rbi +0 -60
  85. data/sig/context_dev/resources/style.rbs +0 -20
@@ -14,9 +14,9 @@ module ContextDev
14
14
  )
15
15
  end
16
16
 
17
- # Brand domain or title to retrieve NAICS code for. If a valid domain is provided
18
- # in `input`, it will be used for classification, otherwise, we will search for
19
- # the brand using the provided title.
17
+ # Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
18
+ # it will be used for classification, otherwise, we will search for the brand
19
+ # using the provided title.
20
20
  sig { returns(String) }
21
21
  attr_accessor :input
22
22
 
@@ -54,9 +54,9 @@ module ContextDev
54
54
  ).returns(T.attached_class)
55
55
  end
56
56
  def self.new(
57
- # Brand domain or title to retrieve NAICS code for. If a valid domain is provided
58
- # in `input`, it will be used for classification, otherwise, we will search for
59
- # the brand using the provided title.
57
+ # Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
58
+ # it will be used for classification, otherwise, we will search for the brand
59
+ # using the provided title.
60
60
  input:,
61
61
  # Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
62
62
  # to 5.
@@ -2,22 +2,35 @@
2
2
 
3
3
  module ContextDev
4
4
  module Models
5
- class StyleExtractFontsParams < ContextDev::Internal::Type::BaseModel
5
+ class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel
6
6
  extend ContextDev::Internal::Type::RequestParameters::Converter
7
7
  include ContextDev::Internal::Type::RequestParameters
8
8
 
9
9
  OrHash =
10
10
  T.type_alias do
11
11
  T.any(
12
- ContextDev::StyleExtractFontsParams,
12
+ ContextDev::WebExtractFontsParams,
13
13
  ContextDev::Internal::AnyHash
14
14
  )
15
15
  end
16
16
 
17
+ # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g.,
18
+ # 'https://example.com/design-system'). When provided, fonts are extracted from
19
+ # this exact URL. You must provide either 'domain' or 'directUrl', but not both.
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :direct_url
22
+
23
+ sig { params(direct_url: String).void }
24
+ attr_writer :direct_url
25
+
17
26
  # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The
18
- # domain will be automatically normalized and validated.
19
- sig { returns(String) }
20
- attr_accessor :domain
27
+ # domain will be automatically normalized and validated. You must provide either
28
+ # 'domain' or 'directUrl', but not both.
29
+ sig { returns(T.nilable(String)) }
30
+ attr_reader :domain
31
+
32
+ sig { params(domain: String).void }
33
+ attr_writer :domain
21
34
 
22
35
  # Optional timeout in milliseconds for the request. If the request takes longer
23
36
  # than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -30,15 +43,21 @@ module ContextDev
30
43
 
31
44
  sig do
32
45
  params(
46
+ direct_url: String,
33
47
  domain: String,
34
48
  timeout_ms: Integer,
35
49
  request_options: ContextDev::RequestOptions::OrHash
36
50
  ).returns(T.attached_class)
37
51
  end
38
52
  def self.new(
53
+ # A specific URL to fetch fonts from directly, bypassing domain resolution (e.g.,
54
+ # 'https://example.com/design-system'). When provided, fonts are extracted from
55
+ # this exact URL. You must provide either 'domain' or 'directUrl', but not both.
56
+ direct_url: nil,
39
57
  # Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The
40
- # domain will be automatically normalized and validated.
41
- domain:,
58
+ # domain will be automatically normalized and validated. You must provide either
59
+ # 'domain' or 'directUrl', but not both.
60
+ domain: nil,
42
61
  # Optional timeout in milliseconds for the request. If the request takes longer
43
62
  # than this value, it will be aborted with a 408 status code. Maximum allowed
44
63
  # value is 300000ms (5 minutes).
@@ -50,6 +69,7 @@ module ContextDev
50
69
  sig do
51
70
  override.returns(
52
71
  {
72
+ direct_url: String,
53
73
  domain: String,
54
74
  timeout_ms: Integer,
55
75
  request_options: ContextDev::RequestOptions
@@ -2,11 +2,11 @@
2
2
 
3
3
  module ContextDev
4
4
  module Models
5
- class StyleExtractFontsResponse < ContextDev::Internal::Type::BaseModel
5
+ class WebExtractFontsResponse < ContextDev::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
8
  T.any(
9
- ContextDev::Models::StyleExtractFontsResponse,
9
+ ContextDev::Models::WebExtractFontsResponse,
10
10
  ContextDev::Internal::AnyHash
11
11
  )
12
12
  end
@@ -21,7 +21,7 @@ module ContextDev
21
21
 
22
22
  # Array of font usage information
23
23
  sig do
24
- returns(T::Array[ContextDev::Models::StyleExtractFontsResponse::Font])
24
+ returns(T::Array[ContextDev::Models::WebExtractFontsResponse::Font])
25
25
  end
26
26
  attr_accessor :fonts
27
27
 
@@ -34,9 +34,7 @@ module ContextDev
34
34
  code: Integer,
35
35
  domain: String,
36
36
  fonts:
37
- T::Array[
38
- ContextDev::Models::StyleExtractFontsResponse::Font::OrHash
39
- ],
37
+ T::Array[ContextDev::Models::WebExtractFontsResponse::Font::OrHash],
40
38
  status: String
41
39
  ).returns(T.attached_class)
42
40
  end
@@ -57,8 +55,7 @@ module ContextDev
57
55
  {
58
56
  code: Integer,
59
57
  domain: String,
60
- fonts:
61
- T::Array[ContextDev::Models::StyleExtractFontsResponse::Font],
58
+ fonts: T::Array[ContextDev::Models::WebExtractFontsResponse::Font],
62
59
  status: String
63
60
  }
64
61
  )
@@ -70,7 +67,7 @@ module ContextDev
70
67
  OrHash =
71
68
  T.type_alias do
72
69
  T.any(
73
- ContextDev::Models::StyleExtractFontsResponse::Font,
70
+ ContextDev::Models::WebExtractFontsResponse::Font,
74
71
  ContextDev::Internal::AnyHash
75
72
  )
76
73
  end
@@ -2,20 +2,22 @@
2
2
 
3
3
  module ContextDev
4
4
  module Models
5
- class StyleExtractStyleguideParams < ContextDev::Internal::Type::BaseModel
5
+ class WebExtractStyleguideParams < ContextDev::Internal::Type::BaseModel
6
6
  extend ContextDev::Internal::Type::RequestParameters::Converter
7
7
  include ContextDev::Internal::Type::RequestParameters
8
8
 
9
9
  OrHash =
10
10
  T.type_alias do
11
11
  T.any(
12
- ContextDev::StyleExtractStyleguideParams,
12
+ ContextDev::WebExtractStyleguideParams,
13
13
  ContextDev::Internal::AnyHash
14
14
  )
15
15
  end
16
16
 
17
17
  # A specific URL to fetch the styleguide from directly, bypassing domain
18
- # resolution (e.g., 'https://example.com/design-system').
18
+ # resolution (e.g., 'https://example.com/design-system'). When provided, the
19
+ # styleguide is extracted from this exact URL. You must provide either 'domain' or
20
+ # 'directUrl', but not both.
19
21
  sig { returns(T.nilable(String)) }
20
22
  attr_reader :direct_url
21
23
 
@@ -23,7 +25,8 @@ module ContextDev
23
25
  attr_writer :direct_url
24
26
 
25
27
  # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
26
- # domain will be automatically normalized and validated.
28
+ # domain will be automatically normalized and validated. You must provide either
29
+ # 'domain' or 'directUrl', but not both.
27
30
  sig { returns(T.nilable(String)) }
28
31
  attr_reader :domain
29
32
 
@@ -49,10 +52,13 @@ module ContextDev
49
52
  end
50
53
  def self.new(
51
54
  # A specific URL to fetch the styleguide from directly, bypassing domain
52
- # resolution (e.g., 'https://example.com/design-system').
55
+ # resolution (e.g., 'https://example.com/design-system'). When provided, the
56
+ # styleguide is extracted from this exact URL. You must provide either 'domain' or
57
+ # 'directUrl', but not both.
53
58
  direct_url: nil,
54
59
  # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
55
- # domain will be automatically normalized and validated.
60
+ # domain will be automatically normalized and validated. You must provide either
61
+ # 'domain' or 'directUrl', but not both.
56
62
  domain: nil,
57
63
  # Optional timeout in milliseconds for the request. If the request takes longer
58
64
  # than this value, it will be aborted with a 408 status code. Maximum allowed