brand.dev 0.18.0 → 0.20.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 +24 -0
- data/README.md +1 -1
- data/lib/brand_dev/internal/transport/pooled_net_requester.rb +12 -10
- data/lib/brand_dev/internal/util.rb +7 -2
- data/lib/brand_dev/models/brand_ai_products_params.rb +43 -0
- data/lib/brand_dev/models/brand_ai_products_response.rb +152 -0
- data/lib/brand_dev/models/brand_prefetch_by_email_params.rb +37 -0
- data/lib/brand_dev/models/brand_prefetch_by_email_response.rb +33 -0
- data/lib/brand_dev/models.rb +4 -0
- data/lib/brand_dev/resources/brand.rb +74 -12
- data/lib/brand_dev/version.rb +1 -1
- data/lib/brand_dev.rb +4 -0
- data/rbi/brand_dev/models/brand_ai_products_params.rbi +69 -0
- data/rbi/brand_dev/models/brand_ai_products_response.rbi +298 -0
- data/rbi/brand_dev/models/brand_prefetch_by_email_params.rbi +65 -0
- data/rbi/brand_dev/models/brand_prefetch_by_email_response.rbi +57 -0
- data/rbi/brand_dev/models.rbi +4 -0
- data/rbi/brand_dev/resources/brand.rbi +61 -12
- data/sig/brand_dev/models/brand_ai_products_params.rbs +36 -0
- data/sig/brand_dev/models/brand_ai_products_response.rbs +121 -0
- data/sig/brand_dev/models/brand_prefetch_by_email_params.rbs +30 -0
- data/sig/brand_dev/models/brand_prefetch_by_email_response.rbs +28 -0
- data/sig/brand_dev/models.rbs +4 -0
- data/sig/brand_dev/resources/brand.rbs +13 -0
- metadata +14 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: be4fa887e23eb9143aaf2472d22397b99b414cb4ff93540d2ea3da5fbae0cfa3
|
|
4
|
+
data.tar.gz: 1c923c23ca8386e90fefe684df20b6ece1cc9455bcc9fec14d1f7cdb221cb100
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac2de9483c9ed519557f9fcff0e2ea5041c938d8fd313a934332321d79133d25081c648bad90e320ed22a09a53faada008b3dae7cf023713350382cf8289ec28
|
|
7
|
+
data.tar.gz: f82183b8ff1d77f93834c0b4cbcb100ffd3ec1fcfa2ae08f5a3d6f2fc37b8f86933c423e2b5130a1f9319313404a336ac3cc7c4855b3f788e91d971fd3fb669f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.20.0 (2026-01-05)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.19.0...v0.20.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.19.0...v0.20.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([0e16540](https://github.com/brand-dot-dev/ruby-sdk/commit/0e1654086ce29b4db61d42d680f5c837723200c8))
|
|
10
|
+
* **api:** api update ([25e7a5a](https://github.com/brand-dot-dev/ruby-sdk/commit/25e7a5a8d67e1a1f6d12ea45c9e5f8c3d0172419))
|
|
11
|
+
* **api:** manual updates ([58d3d58](https://github.com/brand-dot-dev/ruby-sdk/commit/58d3d58d2f482c0b7e173dd3c1805c09af80a2c8))
|
|
12
|
+
|
|
13
|
+
## 0.19.0 (2025-12-22)
|
|
14
|
+
|
|
15
|
+
Full Changelog: [v0.18.0...v0.19.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.18.0...v0.19.0)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **api:** manual updates ([eb518d4](https://github.com/brand-dot-dev/ruby-sdk/commit/eb518d4ef48fa91039cf54e2ccdc0b9261770268))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* calling `break` out of streams should be instantaneous ([df6f134](https://github.com/brand-dot-dev/ruby-sdk/commit/df6f1348f710b76e3fe4d0b604bb1e98472143d6))
|
|
25
|
+
* issue where json.parse errors when receiving HTTP 204 with nobody ([f041e46](https://github.com/brand-dot-dev/ruby-sdk/commit/f041e461d2fd1b711b63cd11a909a1b44e50247c))
|
|
26
|
+
|
|
3
27
|
## 0.18.0 (2025-12-14)
|
|
4
28
|
|
|
5
29
|
Full Changelog: [v0.17.0...v0.18.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.17.0...v0.18.0)
|
data/README.md
CHANGED
|
@@ -153,17 +153,19 @@ module BrandDev
|
|
|
153
153
|
end
|
|
154
154
|
|
|
155
155
|
self.class.calibrate_socket_timeout(conn, deadline)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
156
|
+
::Kernel.catch(:jump) do
|
|
157
|
+
conn.request(req) do |rsp|
|
|
158
|
+
y << [req, rsp]
|
|
159
|
+
::Kernel.throw(:jump) if finished
|
|
160
|
+
|
|
161
|
+
rsp.read_body do |bytes|
|
|
162
|
+
y << bytes.force_encoding(Encoding::BINARY)
|
|
163
|
+
::Kernel.throw(:jump) if finished
|
|
164
|
+
|
|
165
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
166
|
+
end
|
|
167
|
+
eof = true
|
|
165
168
|
end
|
|
166
|
-
eof = true
|
|
167
169
|
end
|
|
168
170
|
end
|
|
169
171
|
ensure
|
|
@@ -657,7 +657,8 @@ module BrandDev
|
|
|
657
657
|
def decode_content(headers, stream:, suppress_error: false)
|
|
658
658
|
case (content_type = headers["content-type"])
|
|
659
659
|
in BrandDev::Internal::Util::JSON_CONTENT
|
|
660
|
-
json = stream.to_a.join
|
|
660
|
+
return nil if (json = stream.to_a.join).empty?
|
|
661
|
+
|
|
661
662
|
begin
|
|
662
663
|
JSON.parse(json, symbolize_names: true)
|
|
663
664
|
rescue JSON::ParserError => e
|
|
@@ -667,7 +668,11 @@ module BrandDev
|
|
|
667
668
|
in BrandDev::Internal::Util::JSONL_CONTENT
|
|
668
669
|
lines = decode_lines(stream)
|
|
669
670
|
chain_fused(lines) do |y|
|
|
670
|
-
lines.each
|
|
671
|
+
lines.each do
|
|
672
|
+
next if _1.empty?
|
|
673
|
+
|
|
674
|
+
y << JSON.parse(_1, symbolize_names: true)
|
|
675
|
+
end
|
|
671
676
|
end
|
|
672
677
|
in %r{^text/event-stream}
|
|
673
678
|
lines = decode_lines(stream)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BrandDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see BrandDev::Resources::Brand#ai_products
|
|
6
|
+
class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
|
|
7
|
+
extend BrandDev::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include BrandDev::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute domain
|
|
11
|
+
# The domain name to analyze
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :domain, String
|
|
15
|
+
|
|
16
|
+
# @!attribute max_products
|
|
17
|
+
# Maximum number of products to extract.
|
|
18
|
+
#
|
|
19
|
+
# @return [Integer, nil]
|
|
20
|
+
optional :max_products, Integer, api_name: :maxProducts
|
|
21
|
+
|
|
22
|
+
# @!attribute timeout_ms
|
|
23
|
+
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
24
|
+
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
25
|
+
# value is 300000ms (5 minutes).
|
|
26
|
+
#
|
|
27
|
+
# @return [Integer, nil]
|
|
28
|
+
optional :timeout_ms, Integer, api_name: :timeoutMS
|
|
29
|
+
|
|
30
|
+
# @!method initialize(domain:, max_products: nil, timeout_ms: nil, request_options: {})
|
|
31
|
+
# Some parameter documentations has been truncated, see
|
|
32
|
+
# {BrandDev::Models::BrandAIProductsParams} for more details.
|
|
33
|
+
#
|
|
34
|
+
# @param domain [String] The domain name to analyze
|
|
35
|
+
#
|
|
36
|
+
# @param max_products [Integer] Maximum number of products to extract.
|
|
37
|
+
#
|
|
38
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
39
|
+
#
|
|
40
|
+
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BrandDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see BrandDev::Resources::Brand#ai_products
|
|
6
|
+
class BrandAIProductsResponse < BrandDev::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute products
|
|
8
|
+
# Array of products extracted from the website
|
|
9
|
+
#
|
|
10
|
+
# @return [Array<BrandDev::Models::BrandAIProductsResponse::Product>, nil]
|
|
11
|
+
optional :products,
|
|
12
|
+
-> { BrandDev::Internal::Type::ArrayOf[BrandDev::Models::BrandAIProductsResponse::Product] }
|
|
13
|
+
|
|
14
|
+
# @!method initialize(products: nil)
|
|
15
|
+
# @param products [Array<BrandDev::Models::BrandAIProductsResponse::Product>] Array of products extracted from the website
|
|
16
|
+
|
|
17
|
+
class Product < BrandDev::Internal::Type::BaseModel
|
|
18
|
+
# @!attribute description
|
|
19
|
+
# Description of the product
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
required :description, String
|
|
23
|
+
|
|
24
|
+
# @!attribute features
|
|
25
|
+
# List of product features
|
|
26
|
+
#
|
|
27
|
+
# @return [Array<String>]
|
|
28
|
+
required :features, BrandDev::Internal::Type::ArrayOf[String]
|
|
29
|
+
|
|
30
|
+
# @!attribute name
|
|
31
|
+
# Name of the product
|
|
32
|
+
#
|
|
33
|
+
# @return [String]
|
|
34
|
+
required :name, String
|
|
35
|
+
|
|
36
|
+
# @!attribute tags
|
|
37
|
+
# Tags associated with the product
|
|
38
|
+
#
|
|
39
|
+
# @return [Array<String>]
|
|
40
|
+
required :tags, BrandDev::Internal::Type::ArrayOf[String]
|
|
41
|
+
|
|
42
|
+
# @!attribute target_audience
|
|
43
|
+
# Target audience for the product (array of strings)
|
|
44
|
+
#
|
|
45
|
+
# @return [Array<String>]
|
|
46
|
+
required :target_audience, BrandDev::Internal::Type::ArrayOf[String]
|
|
47
|
+
|
|
48
|
+
# @!attribute billing_frequency
|
|
49
|
+
# Billing frequency for the product
|
|
50
|
+
#
|
|
51
|
+
# @return [Symbol, BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency, nil]
|
|
52
|
+
optional :billing_frequency,
|
|
53
|
+
enum: -> { BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency },
|
|
54
|
+
nil?: true
|
|
55
|
+
|
|
56
|
+
# @!attribute category
|
|
57
|
+
# Category of the product
|
|
58
|
+
#
|
|
59
|
+
# @return [String, nil]
|
|
60
|
+
optional :category, String, nil?: true
|
|
61
|
+
|
|
62
|
+
# @!attribute currency
|
|
63
|
+
# Currency code for the price (e.g., USD, EUR)
|
|
64
|
+
#
|
|
65
|
+
# @return [String, nil]
|
|
66
|
+
optional :currency, String, nil?: true
|
|
67
|
+
|
|
68
|
+
# @!attribute image_url
|
|
69
|
+
# URL to the product image
|
|
70
|
+
#
|
|
71
|
+
# @return [String, nil]
|
|
72
|
+
optional :image_url, String, nil?: true
|
|
73
|
+
|
|
74
|
+
# @!attribute price
|
|
75
|
+
# Price of the product
|
|
76
|
+
#
|
|
77
|
+
# @return [Float, nil]
|
|
78
|
+
optional :price, Float, nil?: true
|
|
79
|
+
|
|
80
|
+
# @!attribute pricing_model
|
|
81
|
+
# Pricing model for the product
|
|
82
|
+
#
|
|
83
|
+
# @return [Symbol, BrandDev::Models::BrandAIProductsResponse::Product::PricingModel, nil]
|
|
84
|
+
optional :pricing_model,
|
|
85
|
+
enum: -> { BrandDev::Models::BrandAIProductsResponse::Product::PricingModel },
|
|
86
|
+
nil?: true
|
|
87
|
+
|
|
88
|
+
# @!attribute url
|
|
89
|
+
# URL to the product page
|
|
90
|
+
#
|
|
91
|
+
# @return [String, nil]
|
|
92
|
+
optional :url, String, nil?: true
|
|
93
|
+
|
|
94
|
+
# @!method initialize(description:, features:, name:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil)
|
|
95
|
+
# @param description [String] Description of the product
|
|
96
|
+
#
|
|
97
|
+
# @param features [Array<String>] List of product features
|
|
98
|
+
#
|
|
99
|
+
# @param name [String] Name of the product
|
|
100
|
+
#
|
|
101
|
+
# @param tags [Array<String>] Tags associated with the product
|
|
102
|
+
#
|
|
103
|
+
# @param target_audience [Array<String>] Target audience for the product (array of strings)
|
|
104
|
+
#
|
|
105
|
+
# @param billing_frequency [Symbol, BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency, nil] Billing frequency for the product
|
|
106
|
+
#
|
|
107
|
+
# @param category [String, nil] Category of the product
|
|
108
|
+
#
|
|
109
|
+
# @param currency [String, nil] Currency code for the price (e.g., USD, EUR)
|
|
110
|
+
#
|
|
111
|
+
# @param image_url [String, nil] URL to the product image
|
|
112
|
+
#
|
|
113
|
+
# @param price [Float, nil] Price of the product
|
|
114
|
+
#
|
|
115
|
+
# @param pricing_model [Symbol, BrandDev::Models::BrandAIProductsResponse::Product::PricingModel, nil] Pricing model for the product
|
|
116
|
+
#
|
|
117
|
+
# @param url [String, nil] URL to the product page
|
|
118
|
+
|
|
119
|
+
# Billing frequency for the product
|
|
120
|
+
#
|
|
121
|
+
# @see BrandDev::Models::BrandAIProductsResponse::Product#billing_frequency
|
|
122
|
+
module BillingFrequency
|
|
123
|
+
extend BrandDev::Internal::Type::Enum
|
|
124
|
+
|
|
125
|
+
MONTHLY = :monthly
|
|
126
|
+
YEARLY = :yearly
|
|
127
|
+
ONE_TIME = :one_time
|
|
128
|
+
USAGE_BASED = :usage_based
|
|
129
|
+
|
|
130
|
+
# @!method self.values
|
|
131
|
+
# @return [Array<Symbol>]
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Pricing model for the product
|
|
135
|
+
#
|
|
136
|
+
# @see BrandDev::Models::BrandAIProductsResponse::Product#pricing_model
|
|
137
|
+
module PricingModel
|
|
138
|
+
extend BrandDev::Internal::Type::Enum
|
|
139
|
+
|
|
140
|
+
PER_SEAT = :per_seat
|
|
141
|
+
FLAT = :flat
|
|
142
|
+
TIERED = :tiered
|
|
143
|
+
FREEMIUM = :freemium
|
|
144
|
+
CUSTOM = :custom
|
|
145
|
+
|
|
146
|
+
# @!method self.values
|
|
147
|
+
# @return [Array<Symbol>]
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BrandDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see BrandDev::Resources::Brand#prefetch_by_email
|
|
6
|
+
class BrandPrefetchByEmailParams < BrandDev::Internal::Type::BaseModel
|
|
7
|
+
extend BrandDev::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include BrandDev::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute email
|
|
11
|
+
# Email address to prefetch brand data for. The domain will be extracted from the
|
|
12
|
+
# email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
|
|
13
|
+
# addresses are not allowed.
|
|
14
|
+
#
|
|
15
|
+
# @return [String]
|
|
16
|
+
required :email, String
|
|
17
|
+
|
|
18
|
+
# @!attribute timeout_ms
|
|
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
|
+
#
|
|
23
|
+
# @return [Integer, nil]
|
|
24
|
+
optional :timeout_ms, Integer, api_name: :timeoutMS
|
|
25
|
+
|
|
26
|
+
# @!method initialize(email:, timeout_ms: nil, request_options: {})
|
|
27
|
+
# Some parameter documentations has been truncated, see
|
|
28
|
+
# {BrandDev::Models::BrandPrefetchByEmailParams} for more details.
|
|
29
|
+
#
|
|
30
|
+
# @param email [String] Email address to prefetch brand data for. The domain will be extracted from the
|
|
31
|
+
#
|
|
32
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
33
|
+
#
|
|
34
|
+
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BrandDev
|
|
4
|
+
module Models
|
|
5
|
+
# @see BrandDev::Resources::Brand#prefetch_by_email
|
|
6
|
+
class BrandPrefetchByEmailResponse < BrandDev::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute domain
|
|
8
|
+
# The domain that was queued for prefetching
|
|
9
|
+
#
|
|
10
|
+
# @return [String, nil]
|
|
11
|
+
optional :domain, String
|
|
12
|
+
|
|
13
|
+
# @!attribute message
|
|
14
|
+
# Success message
|
|
15
|
+
#
|
|
16
|
+
# @return [String, nil]
|
|
17
|
+
optional :message, String
|
|
18
|
+
|
|
19
|
+
# @!attribute status
|
|
20
|
+
# Status of the response, e.g., 'ok'
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
optional :status, String
|
|
24
|
+
|
|
25
|
+
# @!method initialize(domain: nil, message: nil, status: nil)
|
|
26
|
+
# @param domain [String] The domain that was queued for prefetching
|
|
27
|
+
#
|
|
28
|
+
# @param message [String] Success message
|
|
29
|
+
#
|
|
30
|
+
# @param status [String] Status of the response, e.g., 'ok'
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
data/lib/brand_dev/models.rb
CHANGED
|
@@ -39,12 +39,16 @@ module BrandDev
|
|
|
39
39
|
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
BrandAIProductsParams = BrandDev::Models::BrandAIProductsParams
|
|
43
|
+
|
|
42
44
|
BrandAIQueryParams = BrandDev::Models::BrandAIQueryParams
|
|
43
45
|
|
|
44
46
|
BrandFontsParams = BrandDev::Models::BrandFontsParams
|
|
45
47
|
|
|
46
48
|
BrandIdentifyFromTransactionParams = BrandDev::Models::BrandIdentifyFromTransactionParams
|
|
47
49
|
|
|
50
|
+
BrandPrefetchByEmailParams = BrandDev::Models::BrandPrefetchByEmailParams
|
|
51
|
+
|
|
48
52
|
BrandPrefetchParams = BrandDev::Models::BrandPrefetchParams
|
|
49
53
|
|
|
50
54
|
BrandRetrieveByEmailParams = BrandDev::Models::BrandRetrieveByEmailParams
|
|
@@ -35,12 +35,43 @@ module BrandDev
|
|
|
35
35
|
)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
# Some parameter documentations has been truncated, see
|
|
39
|
+
# {BrandDev::Models::BrandAIProductsParams} for more details.
|
|
40
|
+
#
|
|
41
|
+
# Beta feature: Extract product information from a brand's website. Brand.dev will
|
|
42
|
+
# analyze the website and return a list of products with details such as name,
|
|
43
|
+
# description, image, pricing, features, and more.
|
|
44
|
+
#
|
|
45
|
+
# @overload ai_products(domain:, max_products: nil, timeout_ms: nil, request_options: {})
|
|
46
|
+
#
|
|
47
|
+
# @param domain [String] The domain name to analyze
|
|
48
|
+
#
|
|
49
|
+
# @param max_products [Integer] Maximum number of products to extract.
|
|
50
|
+
#
|
|
51
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
52
|
+
#
|
|
53
|
+
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
54
|
+
#
|
|
55
|
+
# @return [BrandDev::Models::BrandAIProductsResponse]
|
|
56
|
+
#
|
|
57
|
+
# @see BrandDev::Models::BrandAIProductsParams
|
|
58
|
+
def ai_products(params)
|
|
59
|
+
parsed, options = BrandDev::BrandAIProductsParams.dump_request(params)
|
|
60
|
+
@client.request(
|
|
61
|
+
method: :post,
|
|
62
|
+
path: "brand/ai/products",
|
|
63
|
+
body: parsed,
|
|
64
|
+
model: BrandDev::Models::BrandAIProductsResponse,
|
|
65
|
+
options: options
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
38
69
|
# Some parameter documentations has been truncated, see
|
|
39
70
|
# {BrandDev::Models::BrandAIQueryParams} for more details.
|
|
40
71
|
#
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
#
|
|
72
|
+
# Use AI to extract specific data points from a brand's website. The AI will crawl
|
|
73
|
+
# the website and extract the requested information based on the provided data
|
|
74
|
+
# points.
|
|
44
75
|
#
|
|
45
76
|
# @overload ai_query(data_to_extract:, domain:, specific_pages: nil, timeout_ms: nil, request_options: {})
|
|
46
77
|
#
|
|
@@ -71,8 +102,8 @@ module BrandDev
|
|
|
71
102
|
# Some parameter documentations has been truncated, see
|
|
72
103
|
# {BrandDev::Models::BrandFontsParams} for more details.
|
|
73
104
|
#
|
|
74
|
-
#
|
|
75
|
-
#
|
|
105
|
+
# Extract font information from a brand's website including font families, usage
|
|
106
|
+
# statistics, fallbacks, and element/word counts.
|
|
76
107
|
#
|
|
77
108
|
# @overload fonts(domain:, timeout_ms: nil, request_options: {})
|
|
78
109
|
#
|
|
@@ -166,6 +197,38 @@ module BrandDev
|
|
|
166
197
|
)
|
|
167
198
|
end
|
|
168
199
|
|
|
200
|
+
# Some parameter documentations has been truncated, see
|
|
201
|
+
# {BrandDev::Models::BrandPrefetchByEmailParams} for more details.
|
|
202
|
+
#
|
|
203
|
+
# Signal that you may fetch brand data for a particular domain soon to improve
|
|
204
|
+
# latency. This endpoint accepts an email address, extracts the domain from it,
|
|
205
|
+
# validates that it's not a disposable or free email provider, and queues the
|
|
206
|
+
# domain for prefetching. This endpoint does not charge credits and is available
|
|
207
|
+
# for paid customers to optimize future requests. [You must be on a paid plan to
|
|
208
|
+
# use this endpoint]
|
|
209
|
+
#
|
|
210
|
+
# @overload prefetch_by_email(email:, timeout_ms: nil, request_options: {})
|
|
211
|
+
#
|
|
212
|
+
# @param email [String] Email address to prefetch brand data for. The domain will be extracted from the
|
|
213
|
+
#
|
|
214
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
215
|
+
#
|
|
216
|
+
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
217
|
+
#
|
|
218
|
+
# @return [BrandDev::Models::BrandPrefetchByEmailResponse]
|
|
219
|
+
#
|
|
220
|
+
# @see BrandDev::Models::BrandPrefetchByEmailParams
|
|
221
|
+
def prefetch_by_email(params)
|
|
222
|
+
parsed, options = BrandDev::BrandPrefetchByEmailParams.dump_request(params)
|
|
223
|
+
@client.request(
|
|
224
|
+
method: :post,
|
|
225
|
+
path: "brand/prefetch-by-email",
|
|
226
|
+
body: parsed,
|
|
227
|
+
model: BrandDev::Models::BrandPrefetchByEmailResponse,
|
|
228
|
+
options: options
|
|
229
|
+
)
|
|
230
|
+
end
|
|
231
|
+
|
|
169
232
|
# Some parameter documentations has been truncated, see
|
|
170
233
|
# {BrandDev::Models::BrandRetrieveByEmailParams} for more details.
|
|
171
234
|
#
|
|
@@ -366,10 +429,10 @@ module BrandDev
|
|
|
366
429
|
# Some parameter documentations has been truncated, see
|
|
367
430
|
# {BrandDev::Models::BrandScreenshotParams} for more details.
|
|
368
431
|
#
|
|
369
|
-
#
|
|
370
|
-
#
|
|
371
|
-
#
|
|
372
|
-
#
|
|
432
|
+
# Capture a screenshot of a website. Supports both viewport (standard browser
|
|
433
|
+
# view) and full-page screenshots. Can also screenshot specific page types (login,
|
|
434
|
+
# pricing, etc.) by using heuristics to find the appropriate URL. Returns a URL to
|
|
435
|
+
# the uploaded screenshot image hosted on our CDN.
|
|
373
436
|
#
|
|
374
437
|
# @overload screenshot(domain:, full_screenshot: nil, page: nil, prioritize: nil, request_options: {})
|
|
375
438
|
#
|
|
@@ -400,9 +463,8 @@ module BrandDev
|
|
|
400
463
|
# Some parameter documentations has been truncated, see
|
|
401
464
|
# {BrandDev::Models::BrandStyleguideParams} for more details.
|
|
402
465
|
#
|
|
403
|
-
#
|
|
404
|
-
#
|
|
405
|
-
# components.
|
|
466
|
+
# Automatically extract comprehensive design system information from a brand's
|
|
467
|
+
# website including colors, typography, spacing, shadows, and UI components.
|
|
406
468
|
#
|
|
407
469
|
# @overload styleguide(domain:, prioritize: nil, timeout_ms: nil, request_options: {})
|
|
408
470
|
#
|
data/lib/brand_dev/version.rb
CHANGED
data/lib/brand_dev.rb
CHANGED
|
@@ -52,12 +52,16 @@ require_relative "brand_dev/errors"
|
|
|
52
52
|
require_relative "brand_dev/internal/transport/base_client"
|
|
53
53
|
require_relative "brand_dev/internal/transport/pooled_net_requester"
|
|
54
54
|
require_relative "brand_dev/client"
|
|
55
|
+
require_relative "brand_dev/models/brand_ai_products_params"
|
|
56
|
+
require_relative "brand_dev/models/brand_ai_products_response"
|
|
55
57
|
require_relative "brand_dev/models/brand_ai_query_params"
|
|
56
58
|
require_relative "brand_dev/models/brand_ai_query_response"
|
|
57
59
|
require_relative "brand_dev/models/brand_fonts_params"
|
|
58
60
|
require_relative "brand_dev/models/brand_fonts_response"
|
|
59
61
|
require_relative "brand_dev/models/brand_identify_from_transaction_params"
|
|
60
62
|
require_relative "brand_dev/models/brand_identify_from_transaction_response"
|
|
63
|
+
require_relative "brand_dev/models/brand_prefetch_by_email_params"
|
|
64
|
+
require_relative "brand_dev/models/brand_prefetch_by_email_response"
|
|
61
65
|
require_relative "brand_dev/models/brand_prefetch_params"
|
|
62
66
|
require_relative "brand_dev/models/brand_prefetch_response"
|
|
63
67
|
require_relative "brand_dev/models/brand_retrieve_by_email_params"
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module BrandDev
|
|
4
|
+
module Models
|
|
5
|
+
class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
|
|
6
|
+
extend BrandDev::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include BrandDev::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(BrandDev::BrandAIProductsParams, BrandDev::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The domain name to analyze
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :domain
|
|
17
|
+
|
|
18
|
+
# Maximum number of products to extract.
|
|
19
|
+
sig { returns(T.nilable(Integer)) }
|
|
20
|
+
attr_reader :max_products
|
|
21
|
+
|
|
22
|
+
sig { params(max_products: Integer).void }
|
|
23
|
+
attr_writer :max_products
|
|
24
|
+
|
|
25
|
+
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
26
|
+
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
27
|
+
# value is 300000ms (5 minutes).
|
|
28
|
+
sig { returns(T.nilable(Integer)) }
|
|
29
|
+
attr_reader :timeout_ms
|
|
30
|
+
|
|
31
|
+
sig { params(timeout_ms: Integer).void }
|
|
32
|
+
attr_writer :timeout_ms
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
domain: String,
|
|
37
|
+
max_products: Integer,
|
|
38
|
+
timeout_ms: Integer,
|
|
39
|
+
request_options: BrandDev::RequestOptions::OrHash
|
|
40
|
+
).returns(T.attached_class)
|
|
41
|
+
end
|
|
42
|
+
def self.new(
|
|
43
|
+
# The domain name to analyze
|
|
44
|
+
domain:,
|
|
45
|
+
# Maximum number of products to extract.
|
|
46
|
+
max_products: nil,
|
|
47
|
+
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
48
|
+
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
49
|
+
# value is 300000ms (5 minutes).
|
|
50
|
+
timeout_ms: nil,
|
|
51
|
+
request_options: {}
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
sig do
|
|
56
|
+
override.returns(
|
|
57
|
+
{
|
|
58
|
+
domain: String,
|
|
59
|
+
max_products: Integer,
|
|
60
|
+
timeout_ms: Integer,
|
|
61
|
+
request_options: BrandDev::RequestOptions
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
def to_hash
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|