context.dev 1.9.0 → 1.10.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 +1 -1
- data/lib/context_dev/client.rb +15 -1
- data/lib/context_dev/models/ai_extract_product_params.rb +11 -1
- data/lib/context_dev/models/ai_extract_products_params.rb +22 -2
- data/lib/context_dev/resources/ai.rb +8 -7
- data/lib/context_dev/resources/industry.rb +2 -2
- data/lib/context_dev/resources/utility.rb +2 -6
- data/lib/context_dev/version.rb +1 -1
- data/rbi/context_dev/models/ai_extract_product_params.rbi +15 -0
- data/rbi/context_dev/models/ai_extract_products_params.rbi +40 -2
- data/rbi/context_dev/resources/ai.rbi +10 -6
- data/rbi/context_dev/resources/industry.rbi +2 -2
- data/rbi/context_dev/resources/utility.rbi +2 -6
- data/sig/context_dev/models/ai_extract_product_params.rbs +7 -1
- data/sig/context_dev/models/ai_extract_products_params.rbs +24 -2
- data/sig/context_dev/resources/ai.rbs +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dd5277f504c21625472d556d7a4151a793e14e4721d603c2304b93fad9668631
|
|
4
|
+
data.tar.gz: 0c4141a438cd3acee423b2edf10563e58f95bf48ed107c0d4db14871e6f1dd52
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 17e11b02edc7b645b530ac42a76635525745050130a62b8cce21e07b11b583638df5063e242f14fd89467b198a79c0df344a3667eecedcaa5cce185cd5d9a28a
|
|
7
|
+
data.tar.gz: 6839a627ea33e8e1d2f95c260167ed208f327d90d362f771ed609d3986434b3d89b8ddf30d05a5f90b7b6e7fbecff282ba1a0d550dd9ad5bfa8738f7e86383ae
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.10.0 (2026-05-01)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.9.0...v1.10.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.9.0...v1.10.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([c74cbf3](https://github.com/context-dot-dev/context-ruby-sdk/commit/c74cbf354e15c2b56680b4248ed69462a1a84d23))
|
|
10
|
+
* **api:** api update ([cc57672](https://github.com/context-dot-dev/context-ruby-sdk/commit/cc576729ce6c522ee578e7dc5f99122463014515))
|
|
11
|
+
* support setting headers via env ([e625fee](https://github.com/context-dot-dev/context-ruby-sdk/commit/e625fee97a6d4f6ab25f69447b33521cac6a896c))
|
|
12
|
+
|
|
3
13
|
## 1.9.0 (2026-04-25)
|
|
4
14
|
|
|
5
15
|
Full Changelog: [v1.8.0...v1.9.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.8.0...v1.9.0)
|
data/README.md
CHANGED
data/lib/context_dev/client.rb
CHANGED
|
@@ -70,6 +70,19 @@ module ContextDev
|
|
|
70
70
|
raise ArgumentError.new("api_key is required, and can be set via environ: \"CONTEXT_DEV_API_KEY\"")
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
+
headers = {}
|
|
74
|
+
custom_headers_env = ENV["CONTEXT_DEV_CUSTOM_HEADERS"]
|
|
75
|
+
unless custom_headers_env.nil?
|
|
76
|
+
parsed = {}
|
|
77
|
+
custom_headers_env.split("\n").each do |line|
|
|
78
|
+
colon = line.index(":")
|
|
79
|
+
unless colon.nil?
|
|
80
|
+
parsed[line[0...colon].strip] = line[(colon + 1)..].strip
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
headers = parsed.merge(headers)
|
|
84
|
+
end
|
|
85
|
+
|
|
73
86
|
@api_key = api_key.to_s
|
|
74
87
|
|
|
75
88
|
super(
|
|
@@ -77,7 +90,8 @@ module ContextDev
|
|
|
77
90
|
timeout: timeout,
|
|
78
91
|
max_retries: max_retries,
|
|
79
92
|
initial_retry_delay: initial_retry_delay,
|
|
80
|
-
max_retry_delay: max_retry_delay
|
|
93
|
+
max_retry_delay: max_retry_delay,
|
|
94
|
+
headers: headers
|
|
81
95
|
)
|
|
82
96
|
|
|
83
97
|
@web = ContextDev::Resources::Web.new(client: self)
|
|
@@ -13,6 +13,14 @@ module ContextDev
|
|
|
13
13
|
# @return [String]
|
|
14
14
|
required :url, String
|
|
15
15
|
|
|
16
|
+
# @!attribute max_age_ms
|
|
17
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
18
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
19
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
20
|
+
#
|
|
21
|
+
# @return [Integer, nil]
|
|
22
|
+
optional :max_age_ms, Integer, api_name: :maxAgeMs
|
|
23
|
+
|
|
16
24
|
# @!attribute timeout_ms
|
|
17
25
|
# Optional timeout in milliseconds for the request. Maximum allowed value is
|
|
18
26
|
# 300000ms (5 minutes).
|
|
@@ -20,12 +28,14 @@ module ContextDev
|
|
|
20
28
|
# @return [Integer, nil]
|
|
21
29
|
optional :timeout_ms, Integer, api_name: :timeoutMS
|
|
22
30
|
|
|
23
|
-
# @!method initialize(url:, timeout_ms: nil, request_options: {})
|
|
31
|
+
# @!method initialize(url:, max_age_ms: nil, timeout_ms: nil, request_options: {})
|
|
24
32
|
# Some parameter documentations has been truncated, see
|
|
25
33
|
# {ContextDev::Models::AIExtractProductParams} for more details.
|
|
26
34
|
#
|
|
27
35
|
# @param url [String] The product page URL to extract product data from.
|
|
28
36
|
#
|
|
37
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
38
|
+
#
|
|
29
39
|
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
|
|
30
40
|
#
|
|
31
41
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
@@ -30,6 +30,14 @@ module ContextDev
|
|
|
30
30
|
# @return [String]
|
|
31
31
|
required :domain, String
|
|
32
32
|
|
|
33
|
+
# @!attribute max_age_ms
|
|
34
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
35
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
36
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
37
|
+
#
|
|
38
|
+
# @return [Integer, nil]
|
|
39
|
+
optional :max_age_ms, Integer, api_name: :maxAgeMs
|
|
40
|
+
|
|
33
41
|
# @!attribute max_products
|
|
34
42
|
# Maximum number of products to extract.
|
|
35
43
|
#
|
|
@@ -43,12 +51,14 @@ module ContextDev
|
|
|
43
51
|
# @return [Integer, nil]
|
|
44
52
|
optional :timeout_ms, Integer, api_name: :timeoutMS
|
|
45
53
|
|
|
46
|
-
# @!method initialize(domain:, max_products: nil, timeout_ms: nil)
|
|
54
|
+
# @!method initialize(domain:, max_age_ms: nil, max_products: nil, timeout_ms: nil)
|
|
47
55
|
# Some parameter documentations has been truncated, see
|
|
48
56
|
# {ContextDev::Models::AIExtractProductsParams::Body::ByDomain} for more details.
|
|
49
57
|
#
|
|
50
58
|
# @param domain [String] The domain name to analyze.
|
|
51
59
|
#
|
|
60
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
61
|
+
#
|
|
52
62
|
# @param max_products [Integer] Maximum number of products to extract.
|
|
53
63
|
#
|
|
54
64
|
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
|
|
@@ -62,6 +72,14 @@ module ContextDev
|
|
|
62
72
|
# @return [String]
|
|
63
73
|
required :direct_url, String, api_name: :directUrl
|
|
64
74
|
|
|
75
|
+
# @!attribute max_age_ms
|
|
76
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
77
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
78
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
79
|
+
#
|
|
80
|
+
# @return [Integer, nil]
|
|
81
|
+
optional :max_age_ms, Integer, api_name: :maxAgeMs
|
|
82
|
+
|
|
65
83
|
# @!attribute max_products
|
|
66
84
|
# Maximum number of products to extract.
|
|
67
85
|
#
|
|
@@ -75,13 +93,15 @@ module ContextDev
|
|
|
75
93
|
# @return [Integer, nil]
|
|
76
94
|
optional :timeout_ms, Integer, api_name: :timeoutMS
|
|
77
95
|
|
|
78
|
-
# @!method initialize(direct_url:, max_products: nil, timeout_ms: nil)
|
|
96
|
+
# @!method initialize(direct_url:, max_age_ms: nil, max_products: nil, timeout_ms: nil)
|
|
79
97
|
# Some parameter documentations has been truncated, see
|
|
80
98
|
# {ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL} for more
|
|
81
99
|
# details.
|
|
82
100
|
#
|
|
83
101
|
# @param direct_url [String] A specific URL to use directly as the starting point for extraction without doma
|
|
84
102
|
#
|
|
103
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
104
|
+
#
|
|
85
105
|
# @param max_products [Integer] Maximum number of products to extract.
|
|
86
106
|
#
|
|
87
107
|
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
|
|
@@ -39,14 +39,15 @@ module ContextDev
|
|
|
39
39
|
# Some parameter documentations has been truncated, see
|
|
40
40
|
# {ContextDev::Models::AIExtractProductParams} for more details.
|
|
41
41
|
#
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
# Supports Amazon, TikTok Shop, Etsy, and generic ecommerce sites.
|
|
42
|
+
# Given a single URL, determines if it is a product page and extracts the product
|
|
43
|
+
# information.
|
|
45
44
|
#
|
|
46
|
-
# @overload extract_product(url:, timeout_ms: nil, request_options: {})
|
|
45
|
+
# @overload extract_product(url:, max_age_ms: nil, timeout_ms: nil, request_options: {})
|
|
47
46
|
#
|
|
48
47
|
# @param url [String] The product page URL to extract product data from.
|
|
49
48
|
#
|
|
49
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
50
|
+
#
|
|
50
51
|
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000
|
|
51
52
|
#
|
|
52
53
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
@@ -65,9 +66,9 @@ module ContextDev
|
|
|
65
66
|
)
|
|
66
67
|
end
|
|
67
68
|
|
|
68
|
-
#
|
|
69
|
-
#
|
|
70
|
-
#
|
|
69
|
+
# Extract product information from a brand's website. We will analyze the website
|
|
70
|
+
# and return a list of products with details such as name, description, image,
|
|
71
|
+
# pricing, features, and more.
|
|
71
72
|
#
|
|
72
73
|
# @overload extract_products(body:, request_options: {})
|
|
73
74
|
#
|
|
@@ -43,8 +43,8 @@ module ContextDev
|
|
|
43
43
|
# {ContextDev::Models::IndustryRetrieveSicParams} for more details.
|
|
44
44
|
#
|
|
45
45
|
# Classify any brand into Standard Industrial Classification (SIC) codes from its
|
|
46
|
-
# domain or name. Choose between the original
|
|
47
|
-
#
|
|
46
|
+
# domain or name. Choose between the original SIC system (`original_sic`) or the
|
|
47
|
+
# latest SIC list maintained by the SEC (`latest_sec`).
|
|
48
48
|
#
|
|
49
49
|
# @overload retrieve_sic(input:, max_results: nil, min_results: nil, timeout_ms: nil, type: nil, request_options: {})
|
|
50
50
|
#
|
|
@@ -7,9 +7,7 @@ module ContextDev
|
|
|
7
7
|
# {ContextDev::Models::UtilityPrefetchParams} for more details.
|
|
8
8
|
#
|
|
9
9
|
# Signal that you may fetch brand data for a particular domain soon to improve
|
|
10
|
-
# latency.
|
|
11
|
-
# customers to optimize future requests. [You must be on a paid plan to use this
|
|
12
|
-
# endpoint]
|
|
10
|
+
# latency.
|
|
13
11
|
#
|
|
14
12
|
# @overload prefetch(domain:, timeout_ms: nil, request_options: {})
|
|
15
13
|
#
|
|
@@ -39,9 +37,7 @@ module ContextDev
|
|
|
39
37
|
# Signal that you may fetch brand data for a particular domain soon to improve
|
|
40
38
|
# latency. This endpoint accepts an email address, extracts the domain from it,
|
|
41
39
|
# validates that it's not a disposable or free email provider, and queues the
|
|
42
|
-
# domain for prefetching.
|
|
43
|
-
# for paid customers to optimize future requests. [You must be on a paid plan to
|
|
44
|
-
# use this endpoint]
|
|
40
|
+
# domain for prefetching.
|
|
45
41
|
#
|
|
46
42
|
# @overload prefetch_by_email(email:, timeout_ms: nil, request_options: {})
|
|
47
43
|
#
|
data/lib/context_dev/version.rb
CHANGED
|
@@ -18,6 +18,15 @@ module ContextDev
|
|
|
18
18
|
sig { returns(String) }
|
|
19
19
|
attr_accessor :url
|
|
20
20
|
|
|
21
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
22
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
23
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
24
|
+
sig { returns(T.nilable(Integer)) }
|
|
25
|
+
attr_reader :max_age_ms
|
|
26
|
+
|
|
27
|
+
sig { params(max_age_ms: Integer).void }
|
|
28
|
+
attr_writer :max_age_ms
|
|
29
|
+
|
|
21
30
|
# Optional timeout in milliseconds for the request. Maximum allowed value is
|
|
22
31
|
# 300000ms (5 minutes).
|
|
23
32
|
sig { returns(T.nilable(Integer)) }
|
|
@@ -29,6 +38,7 @@ module ContextDev
|
|
|
29
38
|
sig do
|
|
30
39
|
params(
|
|
31
40
|
url: String,
|
|
41
|
+
max_age_ms: Integer,
|
|
32
42
|
timeout_ms: Integer,
|
|
33
43
|
request_options: ContextDev::RequestOptions::OrHash
|
|
34
44
|
).returns(T.attached_class)
|
|
@@ -36,6 +46,10 @@ module ContextDev
|
|
|
36
46
|
def self.new(
|
|
37
47
|
# The product page URL to extract product data from.
|
|
38
48
|
url:,
|
|
49
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
50
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
51
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
52
|
+
max_age_ms: nil,
|
|
39
53
|
# Optional timeout in milliseconds for the request. Maximum allowed value is
|
|
40
54
|
# 300000ms (5 minutes).
|
|
41
55
|
timeout_ms: nil,
|
|
@@ -47,6 +61,7 @@ module ContextDev
|
|
|
47
61
|
override.returns(
|
|
48
62
|
{
|
|
49
63
|
url: String,
|
|
64
|
+
max_age_ms: Integer,
|
|
50
65
|
timeout_ms: Integer,
|
|
51
66
|
request_options: ContextDev::RequestOptions
|
|
52
67
|
}
|
|
@@ -76,6 +76,15 @@ module ContextDev
|
|
|
76
76
|
sig { returns(String) }
|
|
77
77
|
attr_accessor :domain
|
|
78
78
|
|
|
79
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
80
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
81
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
82
|
+
sig { returns(T.nilable(Integer)) }
|
|
83
|
+
attr_reader :max_age_ms
|
|
84
|
+
|
|
85
|
+
sig { params(max_age_ms: Integer).void }
|
|
86
|
+
attr_writer :max_age_ms
|
|
87
|
+
|
|
79
88
|
# Maximum number of products to extract.
|
|
80
89
|
sig { returns(T.nilable(Integer)) }
|
|
81
90
|
attr_reader :max_products
|
|
@@ -94,6 +103,7 @@ module ContextDev
|
|
|
94
103
|
sig do
|
|
95
104
|
params(
|
|
96
105
|
domain: String,
|
|
106
|
+
max_age_ms: Integer,
|
|
97
107
|
max_products: Integer,
|
|
98
108
|
timeout_ms: Integer
|
|
99
109
|
).returns(T.attached_class)
|
|
@@ -101,6 +111,10 @@ module ContextDev
|
|
|
101
111
|
def self.new(
|
|
102
112
|
# The domain name to analyze.
|
|
103
113
|
domain:,
|
|
114
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
115
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
116
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
117
|
+
max_age_ms: nil,
|
|
104
118
|
# Maximum number of products to extract.
|
|
105
119
|
max_products: nil,
|
|
106
120
|
# Optional timeout in milliseconds for the request. Maximum allowed value is
|
|
@@ -111,7 +125,12 @@ module ContextDev
|
|
|
111
125
|
|
|
112
126
|
sig do
|
|
113
127
|
override.returns(
|
|
114
|
-
{
|
|
128
|
+
{
|
|
129
|
+
domain: String,
|
|
130
|
+
max_age_ms: Integer,
|
|
131
|
+
max_products: Integer,
|
|
132
|
+
timeout_ms: Integer
|
|
133
|
+
}
|
|
115
134
|
)
|
|
116
135
|
end
|
|
117
136
|
def to_hash
|
|
@@ -132,6 +151,15 @@ module ContextDev
|
|
|
132
151
|
sig { returns(String) }
|
|
133
152
|
attr_accessor :direct_url
|
|
134
153
|
|
|
154
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
155
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
156
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
157
|
+
sig { returns(T.nilable(Integer)) }
|
|
158
|
+
attr_reader :max_age_ms
|
|
159
|
+
|
|
160
|
+
sig { params(max_age_ms: Integer).void }
|
|
161
|
+
attr_writer :max_age_ms
|
|
162
|
+
|
|
135
163
|
# Maximum number of products to extract.
|
|
136
164
|
sig { returns(T.nilable(Integer)) }
|
|
137
165
|
attr_reader :max_products
|
|
@@ -150,6 +178,7 @@ module ContextDev
|
|
|
150
178
|
sig do
|
|
151
179
|
params(
|
|
152
180
|
direct_url: String,
|
|
181
|
+
max_age_ms: Integer,
|
|
153
182
|
max_products: Integer,
|
|
154
183
|
timeout_ms: Integer
|
|
155
184
|
).returns(T.attached_class)
|
|
@@ -158,6 +187,10 @@ module ContextDev
|
|
|
158
187
|
# A specific URL to use directly as the starting point for extraction without
|
|
159
188
|
# domain resolution.
|
|
160
189
|
direct_url:,
|
|
190
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
191
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
192
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
193
|
+
max_age_ms: nil,
|
|
161
194
|
# Maximum number of products to extract.
|
|
162
195
|
max_products: nil,
|
|
163
196
|
# Optional timeout in milliseconds for the request. Maximum allowed value is
|
|
@@ -168,7 +201,12 @@ module ContextDev
|
|
|
168
201
|
|
|
169
202
|
sig do
|
|
170
203
|
override.returns(
|
|
171
|
-
{
|
|
204
|
+
{
|
|
205
|
+
direct_url: String,
|
|
206
|
+
max_age_ms: Integer,
|
|
207
|
+
max_products: Integer,
|
|
208
|
+
timeout_ms: Integer
|
|
209
|
+
}
|
|
172
210
|
)
|
|
173
211
|
end
|
|
174
212
|
def to_hash
|
|
@@ -31,12 +31,12 @@ module ContextDev
|
|
|
31
31
|
)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
# Supports Amazon, TikTok Shop, Etsy, and generic ecommerce sites.
|
|
34
|
+
# Given a single URL, determines if it is a product page and extracts the product
|
|
35
|
+
# information.
|
|
37
36
|
sig do
|
|
38
37
|
params(
|
|
39
38
|
url: String,
|
|
39
|
+
max_age_ms: Integer,
|
|
40
40
|
timeout_ms: Integer,
|
|
41
41
|
request_options: ContextDev::RequestOptions::OrHash
|
|
42
42
|
).returns(ContextDev::Models::AIExtractProductResponse)
|
|
@@ -44,6 +44,10 @@ module ContextDev
|
|
|
44
44
|
def extract_product(
|
|
45
45
|
# The product page URL to extract product data from.
|
|
46
46
|
url:,
|
|
47
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
48
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
|
|
49
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
50
|
+
max_age_ms: nil,
|
|
47
51
|
# Optional timeout in milliseconds for the request. Maximum allowed value is
|
|
48
52
|
# 300000ms (5 minutes).
|
|
49
53
|
timeout_ms: nil,
|
|
@@ -51,9 +55,9 @@ module ContextDev
|
|
|
51
55
|
)
|
|
52
56
|
end
|
|
53
57
|
|
|
54
|
-
#
|
|
55
|
-
#
|
|
56
|
-
#
|
|
58
|
+
# Extract product information from a brand's website. We will analyze the website
|
|
59
|
+
# and return a list of products with details such as name, description, image,
|
|
60
|
+
# pricing, features, and more.
|
|
57
61
|
sig do
|
|
58
62
|
params(
|
|
59
63
|
body:
|
|
@@ -32,8 +32,8 @@ module ContextDev
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Classify any brand into Standard Industrial Classification (SIC) codes from its
|
|
35
|
-
# domain or name. Choose between the original
|
|
36
|
-
#
|
|
35
|
+
# domain or name. Choose between the original SIC system (`original_sic`) or the
|
|
36
|
+
# latest SIC list maintained by the SEC (`latest_sec`).
|
|
37
37
|
sig do
|
|
38
38
|
params(
|
|
39
39
|
input: String,
|
|
@@ -4,9 +4,7 @@ module ContextDev
|
|
|
4
4
|
module Resources
|
|
5
5
|
class Utility
|
|
6
6
|
# Signal that you may fetch brand data for a particular domain soon to improve
|
|
7
|
-
# latency.
|
|
8
|
-
# customers to optimize future requests. [You must be on a paid plan to use this
|
|
9
|
-
# endpoint]
|
|
7
|
+
# latency.
|
|
10
8
|
sig do
|
|
11
9
|
params(
|
|
12
10
|
domain: String,
|
|
@@ -28,9 +26,7 @@ module ContextDev
|
|
|
28
26
|
# Signal that you may fetch brand data for a particular domain soon to improve
|
|
29
27
|
# latency. This endpoint accepts an email address, extracts the domain from it,
|
|
30
28
|
# validates that it's not a disposable or free email provider, and queues the
|
|
31
|
-
# domain for prefetching.
|
|
32
|
-
# for paid customers to optimize future requests. [You must be on a paid plan to
|
|
33
|
-
# use this endpoint]
|
|
29
|
+
# domain for prefetching.
|
|
34
30
|
sig do
|
|
35
31
|
params(
|
|
36
32
|
email: String,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module ContextDev
|
|
2
2
|
module Models
|
|
3
3
|
type ai_extract_product_params =
|
|
4
|
-
{ url: String, timeout_ms: Integer }
|
|
4
|
+
{ url: String, max_age_ms: Integer, timeout_ms: Integer }
|
|
5
5
|
& ContextDev::Internal::Type::request_parameters
|
|
6
6
|
|
|
7
7
|
class AIExtractProductParams < ContextDev::Internal::Type::BaseModel
|
|
@@ -10,18 +10,24 @@ module ContextDev
|
|
|
10
10
|
|
|
11
11
|
attr_accessor url: String
|
|
12
12
|
|
|
13
|
+
attr_reader max_age_ms: Integer?
|
|
14
|
+
|
|
15
|
+
def max_age_ms=: (Integer) -> Integer
|
|
16
|
+
|
|
13
17
|
attr_reader timeout_ms: Integer?
|
|
14
18
|
|
|
15
19
|
def timeout_ms=: (Integer) -> Integer
|
|
16
20
|
|
|
17
21
|
def initialize: (
|
|
18
22
|
url: String,
|
|
23
|
+
?max_age_ms: Integer,
|
|
19
24
|
?timeout_ms: Integer,
|
|
20
25
|
?request_options: ContextDev::request_opts
|
|
21
26
|
) -> void
|
|
22
27
|
|
|
23
28
|
def to_hash: -> {
|
|
24
29
|
url: String,
|
|
30
|
+
max_age_ms: Integer,
|
|
25
31
|
timeout_ms: Integer,
|
|
26
32
|
request_options: ContextDev::RequestOptions
|
|
27
33
|
}
|
|
@@ -28,11 +28,20 @@ module ContextDev
|
|
|
28
28
|
extend ContextDev::Internal::Type::Union
|
|
29
29
|
|
|
30
30
|
type by_domain =
|
|
31
|
-
{
|
|
31
|
+
{
|
|
32
|
+
domain: String,
|
|
33
|
+
max_age_ms: Integer,
|
|
34
|
+
max_products: Integer,
|
|
35
|
+
timeout_ms: Integer
|
|
36
|
+
}
|
|
32
37
|
|
|
33
38
|
class ByDomain < ContextDev::Internal::Type::BaseModel
|
|
34
39
|
attr_accessor domain: String
|
|
35
40
|
|
|
41
|
+
attr_reader max_age_ms: Integer?
|
|
42
|
+
|
|
43
|
+
def max_age_ms=: (Integer) -> Integer
|
|
44
|
+
|
|
36
45
|
attr_reader max_products: Integer?
|
|
37
46
|
|
|
38
47
|
def max_products=: (Integer) -> Integer
|
|
@@ -43,23 +52,34 @@ module ContextDev
|
|
|
43
52
|
|
|
44
53
|
def initialize: (
|
|
45
54
|
domain: String,
|
|
55
|
+
?max_age_ms: Integer,
|
|
46
56
|
?max_products: Integer,
|
|
47
57
|
?timeout_ms: Integer
|
|
48
58
|
) -> void
|
|
49
59
|
|
|
50
60
|
def to_hash: -> {
|
|
51
61
|
domain: String,
|
|
62
|
+
max_age_ms: Integer,
|
|
52
63
|
max_products: Integer,
|
|
53
64
|
timeout_ms: Integer
|
|
54
65
|
}
|
|
55
66
|
end
|
|
56
67
|
|
|
57
68
|
type by_direct_url =
|
|
58
|
-
{
|
|
69
|
+
{
|
|
70
|
+
direct_url: String,
|
|
71
|
+
max_age_ms: Integer,
|
|
72
|
+
max_products: Integer,
|
|
73
|
+
timeout_ms: Integer
|
|
74
|
+
}
|
|
59
75
|
|
|
60
76
|
class ByDirectURL < ContextDev::Internal::Type::BaseModel
|
|
61
77
|
attr_accessor direct_url: String
|
|
62
78
|
|
|
79
|
+
attr_reader max_age_ms: Integer?
|
|
80
|
+
|
|
81
|
+
def max_age_ms=: (Integer) -> Integer
|
|
82
|
+
|
|
63
83
|
attr_reader max_products: Integer?
|
|
64
84
|
|
|
65
85
|
def max_products=: (Integer) -> Integer
|
|
@@ -70,12 +90,14 @@ module ContextDev
|
|
|
70
90
|
|
|
71
91
|
def initialize: (
|
|
72
92
|
direct_url: String,
|
|
93
|
+
?max_age_ms: Integer,
|
|
73
94
|
?max_products: Integer,
|
|
74
95
|
?timeout_ms: Integer
|
|
75
96
|
) -> void
|
|
76
97
|
|
|
77
98
|
def to_hash: -> {
|
|
78
99
|
direct_url: String,
|
|
100
|
+
max_age_ms: Integer,
|
|
79
101
|
max_products: Integer,
|
|
80
102
|
timeout_ms: Integer
|
|
81
103
|
}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: context.dev
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Context Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|