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.
@@ -0,0 +1,298 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ module Models
5
+ class BrandAIProductsResponse < BrandDev::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ BrandDev::Models::BrandAIProductsResponse,
10
+ BrandDev::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Array of products extracted from the website
15
+ sig do
16
+ returns(
17
+ T.nilable(
18
+ T::Array[BrandDev::Models::BrandAIProductsResponse::Product]
19
+ )
20
+ )
21
+ end
22
+ attr_reader :products
23
+
24
+ sig do
25
+ params(
26
+ products:
27
+ T::Array[BrandDev::Models::BrandAIProductsResponse::Product::OrHash]
28
+ ).void
29
+ end
30
+ attr_writer :products
31
+
32
+ sig do
33
+ params(
34
+ products:
35
+ T::Array[BrandDev::Models::BrandAIProductsResponse::Product::OrHash]
36
+ ).returns(T.attached_class)
37
+ end
38
+ def self.new(
39
+ # Array of products extracted from the website
40
+ products: nil
41
+ )
42
+ end
43
+
44
+ sig do
45
+ override.returns(
46
+ {
47
+ products:
48
+ T::Array[BrandDev::Models::BrandAIProductsResponse::Product]
49
+ }
50
+ )
51
+ end
52
+ def to_hash
53
+ end
54
+
55
+ class Product < BrandDev::Internal::Type::BaseModel
56
+ OrHash =
57
+ T.type_alias do
58
+ T.any(
59
+ BrandDev::Models::BrandAIProductsResponse::Product,
60
+ BrandDev::Internal::AnyHash
61
+ )
62
+ end
63
+
64
+ # Description of the product
65
+ sig { returns(String) }
66
+ attr_accessor :description
67
+
68
+ # List of product features
69
+ sig { returns(T::Array[String]) }
70
+ attr_accessor :features
71
+
72
+ # Name of the product
73
+ sig { returns(String) }
74
+ attr_accessor :name
75
+
76
+ # Tags associated with the product
77
+ sig { returns(T::Array[String]) }
78
+ attr_accessor :tags
79
+
80
+ # Target audience for the product (array of strings)
81
+ sig { returns(T::Array[String]) }
82
+ attr_accessor :target_audience
83
+
84
+ # Billing frequency for the product
85
+ sig do
86
+ returns(
87
+ T.nilable(
88
+ BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency::TaggedSymbol
89
+ )
90
+ )
91
+ end
92
+ attr_accessor :billing_frequency
93
+
94
+ # Category of the product
95
+ sig { returns(T.nilable(String)) }
96
+ attr_accessor :category
97
+
98
+ # Currency code for the price (e.g., USD, EUR)
99
+ sig { returns(T.nilable(String)) }
100
+ attr_accessor :currency
101
+
102
+ # URL to the product image
103
+ sig { returns(T.nilable(String)) }
104
+ attr_accessor :image_url
105
+
106
+ # Price of the product
107
+ sig { returns(T.nilable(Float)) }
108
+ attr_accessor :price
109
+
110
+ # Pricing model for the product
111
+ sig do
112
+ returns(
113
+ T.nilable(
114
+ BrandDev::Models::BrandAIProductsResponse::Product::PricingModel::TaggedSymbol
115
+ )
116
+ )
117
+ end
118
+ attr_accessor :pricing_model
119
+
120
+ # URL to the product page
121
+ sig { returns(T.nilable(String)) }
122
+ attr_accessor :url
123
+
124
+ sig do
125
+ params(
126
+ description: String,
127
+ features: T::Array[String],
128
+ name: String,
129
+ tags: T::Array[String],
130
+ target_audience: T::Array[String],
131
+ billing_frequency:
132
+ T.nilable(
133
+ BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency::OrSymbol
134
+ ),
135
+ category: T.nilable(String),
136
+ currency: T.nilable(String),
137
+ image_url: T.nilable(String),
138
+ price: T.nilable(Float),
139
+ pricing_model:
140
+ T.nilable(
141
+ BrandDev::Models::BrandAIProductsResponse::Product::PricingModel::OrSymbol
142
+ ),
143
+ url: T.nilable(String)
144
+ ).returns(T.attached_class)
145
+ end
146
+ def self.new(
147
+ # Description of the product
148
+ description:,
149
+ # List of product features
150
+ features:,
151
+ # Name of the product
152
+ name:,
153
+ # Tags associated with the product
154
+ tags:,
155
+ # Target audience for the product (array of strings)
156
+ target_audience:,
157
+ # Billing frequency for the product
158
+ billing_frequency: nil,
159
+ # Category of the product
160
+ category: nil,
161
+ # Currency code for the price (e.g., USD, EUR)
162
+ currency: nil,
163
+ # URL to the product image
164
+ image_url: nil,
165
+ # Price of the product
166
+ price: nil,
167
+ # Pricing model for the product
168
+ pricing_model: nil,
169
+ # URL to the product page
170
+ url: nil
171
+ )
172
+ end
173
+
174
+ sig do
175
+ override.returns(
176
+ {
177
+ description: String,
178
+ features: T::Array[String],
179
+ name: String,
180
+ tags: T::Array[String],
181
+ target_audience: T::Array[String],
182
+ billing_frequency:
183
+ T.nilable(
184
+ BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency::TaggedSymbol
185
+ ),
186
+ category: T.nilable(String),
187
+ currency: T.nilable(String),
188
+ image_url: T.nilable(String),
189
+ price: T.nilable(Float),
190
+ pricing_model:
191
+ T.nilable(
192
+ BrandDev::Models::BrandAIProductsResponse::Product::PricingModel::TaggedSymbol
193
+ ),
194
+ url: T.nilable(String)
195
+ }
196
+ )
197
+ end
198
+ def to_hash
199
+ end
200
+
201
+ # Billing frequency for the product
202
+ module BillingFrequency
203
+ extend BrandDev::Internal::Type::Enum
204
+
205
+ TaggedSymbol =
206
+ T.type_alias do
207
+ T.all(
208
+ Symbol,
209
+ BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency
210
+ )
211
+ end
212
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
213
+
214
+ MONTHLY =
215
+ T.let(
216
+ :monthly,
217
+ BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency::TaggedSymbol
218
+ )
219
+ YEARLY =
220
+ T.let(
221
+ :yearly,
222
+ BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency::TaggedSymbol
223
+ )
224
+ ONE_TIME =
225
+ T.let(
226
+ :one_time,
227
+ BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency::TaggedSymbol
228
+ )
229
+ USAGE_BASED =
230
+ T.let(
231
+ :usage_based,
232
+ BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency::TaggedSymbol
233
+ )
234
+
235
+ sig do
236
+ override.returns(
237
+ T::Array[
238
+ BrandDev::Models::BrandAIProductsResponse::Product::BillingFrequency::TaggedSymbol
239
+ ]
240
+ )
241
+ end
242
+ def self.values
243
+ end
244
+ end
245
+
246
+ # Pricing model for the product
247
+ module PricingModel
248
+ extend BrandDev::Internal::Type::Enum
249
+
250
+ TaggedSymbol =
251
+ T.type_alias do
252
+ T.all(
253
+ Symbol,
254
+ BrandDev::Models::BrandAIProductsResponse::Product::PricingModel
255
+ )
256
+ end
257
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
258
+
259
+ PER_SEAT =
260
+ T.let(
261
+ :per_seat,
262
+ BrandDev::Models::BrandAIProductsResponse::Product::PricingModel::TaggedSymbol
263
+ )
264
+ FLAT =
265
+ T.let(
266
+ :flat,
267
+ BrandDev::Models::BrandAIProductsResponse::Product::PricingModel::TaggedSymbol
268
+ )
269
+ TIERED =
270
+ T.let(
271
+ :tiered,
272
+ BrandDev::Models::BrandAIProductsResponse::Product::PricingModel::TaggedSymbol
273
+ )
274
+ FREEMIUM =
275
+ T.let(
276
+ :freemium,
277
+ BrandDev::Models::BrandAIProductsResponse::Product::PricingModel::TaggedSymbol
278
+ )
279
+ CUSTOM =
280
+ T.let(
281
+ :custom,
282
+ BrandDev::Models::BrandAIProductsResponse::Product::PricingModel::TaggedSymbol
283
+ )
284
+
285
+ sig do
286
+ override.returns(
287
+ T::Array[
288
+ BrandDev::Models::BrandAIProductsResponse::Product::PricingModel::TaggedSymbol
289
+ ]
290
+ )
291
+ end
292
+ def self.values
293
+ end
294
+ end
295
+ end
296
+ end
297
+ end
298
+ end
@@ -0,0 +1,65 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ module Models
5
+ class BrandPrefetchByEmailParams < 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(
12
+ BrandDev::BrandPrefetchByEmailParams,
13
+ BrandDev::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Email address to prefetch brand data for. The domain will be extracted from the
18
+ # email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
19
+ # addresses are not allowed.
20
+ sig { returns(String) }
21
+ attr_accessor :email
22
+
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
+ sig { returns(T.nilable(Integer)) }
27
+ attr_reader :timeout_ms
28
+
29
+ sig { params(timeout_ms: Integer).void }
30
+ attr_writer :timeout_ms
31
+
32
+ sig do
33
+ params(
34
+ email: String,
35
+ timeout_ms: Integer,
36
+ request_options: BrandDev::RequestOptions::OrHash
37
+ ).returns(T.attached_class)
38
+ end
39
+ def self.new(
40
+ # Email address to prefetch brand data for. The domain will be extracted from the
41
+ # email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
42
+ # addresses are not allowed.
43
+ email:,
44
+ # Optional timeout in milliseconds for the request. If the request takes longer
45
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
46
+ # value is 300000ms (5 minutes).
47
+ timeout_ms: nil,
48
+ request_options: {}
49
+ )
50
+ end
51
+
52
+ sig do
53
+ override.returns(
54
+ {
55
+ email: String,
56
+ timeout_ms: Integer,
57
+ request_options: BrandDev::RequestOptions
58
+ }
59
+ )
60
+ end
61
+ def to_hash
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,57 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ module Models
5
+ class BrandPrefetchByEmailResponse < BrandDev::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ BrandDev::Models::BrandPrefetchByEmailResponse,
10
+ BrandDev::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The domain that was queued for prefetching
15
+ sig { returns(T.nilable(String)) }
16
+ attr_reader :domain
17
+
18
+ sig { params(domain: String).void }
19
+ attr_writer :domain
20
+
21
+ # Success message
22
+ sig { returns(T.nilable(String)) }
23
+ attr_reader :message
24
+
25
+ sig { params(message: String).void }
26
+ attr_writer :message
27
+
28
+ # Status of the response, e.g., 'ok'
29
+ sig { returns(T.nilable(String)) }
30
+ attr_reader :status
31
+
32
+ sig { params(status: String).void }
33
+ attr_writer :status
34
+
35
+ sig do
36
+ params(domain: String, message: String, status: String).returns(
37
+ T.attached_class
38
+ )
39
+ end
40
+ def self.new(
41
+ # The domain that was queued for prefetching
42
+ domain: nil,
43
+ # Success message
44
+ message: nil,
45
+ # Status of the response, e.g., 'ok'
46
+ status: nil
47
+ )
48
+ end
49
+
50
+ sig do
51
+ override.returns({ domain: String, message: String, status: String })
52
+ end
53
+ def to_hash
54
+ end
55
+ end
56
+ end
57
+ end
@@ -1,6 +1,8 @@
1
1
  # typed: strong
2
2
 
3
3
  module BrandDev
4
+ BrandAIProductsParams = BrandDev::Models::BrandAIProductsParams
5
+
4
6
  BrandAIQueryParams = BrandDev::Models::BrandAIQueryParams
5
7
 
6
8
  BrandFontsParams = BrandDev::Models::BrandFontsParams
@@ -8,6 +10,8 @@ module BrandDev
8
10
  BrandIdentifyFromTransactionParams =
9
11
  BrandDev::Models::BrandIdentifyFromTransactionParams
10
12
 
13
+ BrandPrefetchByEmailParams = BrandDev::Models::BrandPrefetchByEmailParams
14
+
11
15
  BrandPrefetchParams = BrandDev::Models::BrandPrefetchParams
12
16
 
13
17
  BrandRetrieveByEmailParams = BrandDev::Models::BrandRetrieveByEmailParams
@@ -34,9 +34,33 @@ module BrandDev
34
34
  )
35
35
  end
36
36
 
37
- # Beta feature: Use AI to extract specific data points from a brand's website. The
38
- # AI will crawl the website and extract the requested information based on the
39
- # provided data points.
37
+ # Beta feature: Extract product information from a brand's website. Brand.dev will
38
+ # analyze the website and return a list of products with details such as name,
39
+ # description, image, pricing, features, and more.
40
+ sig do
41
+ params(
42
+ domain: String,
43
+ max_products: Integer,
44
+ timeout_ms: Integer,
45
+ request_options: BrandDev::RequestOptions::OrHash
46
+ ).returns(BrandDev::Models::BrandAIProductsResponse)
47
+ end
48
+ def ai_products(
49
+ # The domain name to analyze
50
+ domain:,
51
+ # Maximum number of products to extract.
52
+ max_products: nil,
53
+ # Optional timeout in milliseconds for the request. If the request takes longer
54
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
55
+ # value is 300000ms (5 minutes).
56
+ timeout_ms: nil,
57
+ request_options: {}
58
+ )
59
+ end
60
+
61
+ # Use AI to extract specific data points from a brand's website. The AI will crawl
62
+ # the website and extract the requested information based on the provided data
63
+ # points.
40
64
  sig do
41
65
  params(
42
66
  data_to_extract:
@@ -62,8 +86,8 @@ module BrandDev
62
86
  )
63
87
  end
64
88
 
65
- # Beta feature: Extract font information from a brand's website including font
66
- # families, usage statistics, fallbacks, and element/word counts.
89
+ # Extract font information from a brand's website including font families, usage
90
+ # statistics, fallbacks, and element/word counts.
67
91
  sig do
68
92
  params(
69
93
  domain: String,
@@ -149,6 +173,32 @@ module BrandDev
149
173
  )
150
174
  end
151
175
 
176
+ # Signal that you may fetch brand data for a particular domain soon to improve
177
+ # latency. This endpoint accepts an email address, extracts the domain from it,
178
+ # validates that it's not a disposable or free email provider, and queues the
179
+ # domain for prefetching. This endpoint does not charge credits and is available
180
+ # for paid customers to optimize future requests. [You must be on a paid plan to
181
+ # use this endpoint]
182
+ sig do
183
+ params(
184
+ email: String,
185
+ timeout_ms: Integer,
186
+ request_options: BrandDev::RequestOptions::OrHash
187
+ ).returns(BrandDev::Models::BrandPrefetchByEmailResponse)
188
+ end
189
+ def prefetch_by_email(
190
+ # Email address to prefetch brand data for. The domain will be extracted from the
191
+ # email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
192
+ # addresses are not allowed.
193
+ email:,
194
+ # Optional timeout in milliseconds for the request. If the request takes longer
195
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
196
+ # value is 300000ms (5 minutes).
197
+ timeout_ms: nil,
198
+ request_options: {}
199
+ )
200
+ end
201
+
152
202
  # Retrieve brand information using an email address while detecting disposable and
153
203
  # free email addresses. This endpoint extracts the domain from the email address
154
204
  # and returns brand data for that domain. Disposable and free email addresses
@@ -327,10 +377,10 @@ module BrandDev
327
377
  )
328
378
  end
329
379
 
330
- # Beta feature: Capture a screenshot of a website. Supports both viewport
331
- # (standard browser view) and full-page screenshots. Can also screenshot specific
332
- # page types (login, pricing, etc.) by using heuristics to find the appropriate
333
- # URL. Returns a URL to the uploaded screenshot image hosted on our CDN.
380
+ # Capture a screenshot of a website. Supports both viewport (standard browser
381
+ # view) and full-page screenshots. Can also screenshot specific page types (login,
382
+ # pricing, etc.) by using heuristics to find the appropriate URL. Returns a URL to
383
+ # the uploaded screenshot image hosted on our CDN.
334
384
  sig do
335
385
  params(
336
386
  domain: String,
@@ -362,9 +412,8 @@ module BrandDev
362
412
  )
363
413
  end
364
414
 
365
- # Beta feature: Automatically extract comprehensive design system information from
366
- # a brand's website including colors, typography, spacing, shadows, and UI
367
- # components.
415
+ # Automatically extract comprehensive design system information from a brand's
416
+ # website including colors, typography, spacing, shadows, and UI components.
368
417
  sig do
369
418
  params(
370
419
  domain: String,
@@ -0,0 +1,36 @@
1
+ module BrandDev
2
+ module Models
3
+ type brand_ai_products_params =
4
+ { domain: String, max_products: Integer, timeout_ms: Integer }
5
+ & BrandDev::Internal::Type::request_parameters
6
+
7
+ class BrandAIProductsParams < BrandDev::Internal::Type::BaseModel
8
+ extend BrandDev::Internal::Type::RequestParameters::Converter
9
+ include BrandDev::Internal::Type::RequestParameters
10
+
11
+ attr_accessor domain: String
12
+
13
+ attr_reader max_products: Integer?
14
+
15
+ def max_products=: (Integer) -> Integer
16
+
17
+ attr_reader timeout_ms: Integer?
18
+
19
+ def timeout_ms=: (Integer) -> Integer
20
+
21
+ def initialize: (
22
+ domain: String,
23
+ ?max_products: Integer,
24
+ ?timeout_ms: Integer,
25
+ ?request_options: BrandDev::request_opts
26
+ ) -> void
27
+
28
+ def to_hash: -> {
29
+ domain: String,
30
+ max_products: Integer,
31
+ timeout_ms: Integer,
32
+ request_options: BrandDev::RequestOptions
33
+ }
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,121 @@
1
+ module BrandDev
2
+ module Models
3
+ type brand_ai_products_response =
4
+ { products: ::Array[BrandDev::Models::BrandAIProductsResponse::Product] }
5
+
6
+ class BrandAIProductsResponse < BrandDev::Internal::Type::BaseModel
7
+ attr_reader products: ::Array[BrandDev::Models::BrandAIProductsResponse::Product]?
8
+
9
+ def products=: (
10
+ ::Array[BrandDev::Models::BrandAIProductsResponse::Product]
11
+ ) -> ::Array[BrandDev::Models::BrandAIProductsResponse::Product]
12
+
13
+ def initialize: (
14
+ ?products: ::Array[BrandDev::Models::BrandAIProductsResponse::Product]
15
+ ) -> void
16
+
17
+ def to_hash: -> {
18
+ products: ::Array[BrandDev::Models::BrandAIProductsResponse::Product]
19
+ }
20
+
21
+ type product =
22
+ {
23
+ description: String,
24
+ features: ::Array[String],
25
+ name: String,
26
+ tags: ::Array[String],
27
+ target_audience: ::Array[String],
28
+ billing_frequency: BrandDev::Models::BrandAIProductsResponse::Product::billing_frequency?,
29
+ category: String?,
30
+ currency: String?,
31
+ image_url: String?,
32
+ price: Float?,
33
+ pricing_model: BrandDev::Models::BrandAIProductsResponse::Product::pricing_model?,
34
+ url: String?
35
+ }
36
+
37
+ class Product < BrandDev::Internal::Type::BaseModel
38
+ attr_accessor description: String
39
+
40
+ attr_accessor features: ::Array[String]
41
+
42
+ attr_accessor name: String
43
+
44
+ attr_accessor tags: ::Array[String]
45
+
46
+ attr_accessor target_audience: ::Array[String]
47
+
48
+ attr_accessor billing_frequency: BrandDev::Models::BrandAIProductsResponse::Product::billing_frequency?
49
+
50
+ attr_accessor category: String?
51
+
52
+ attr_accessor currency: String?
53
+
54
+ attr_accessor image_url: String?
55
+
56
+ attr_accessor price: Float?
57
+
58
+ attr_accessor pricing_model: BrandDev::Models::BrandAIProductsResponse::Product::pricing_model?
59
+
60
+ attr_accessor url: String?
61
+
62
+ def initialize: (
63
+ description: String,
64
+ features: ::Array[String],
65
+ name: String,
66
+ tags: ::Array[String],
67
+ target_audience: ::Array[String],
68
+ ?billing_frequency: BrandDev::Models::BrandAIProductsResponse::Product::billing_frequency?,
69
+ ?category: String?,
70
+ ?currency: String?,
71
+ ?image_url: String?,
72
+ ?price: Float?,
73
+ ?pricing_model: BrandDev::Models::BrandAIProductsResponse::Product::pricing_model?,
74
+ ?url: String?
75
+ ) -> void
76
+
77
+ def to_hash: -> {
78
+ description: String,
79
+ features: ::Array[String],
80
+ name: String,
81
+ tags: ::Array[String],
82
+ target_audience: ::Array[String],
83
+ billing_frequency: BrandDev::Models::BrandAIProductsResponse::Product::billing_frequency?,
84
+ category: String?,
85
+ currency: String?,
86
+ image_url: String?,
87
+ price: Float?,
88
+ pricing_model: BrandDev::Models::BrandAIProductsResponse::Product::pricing_model?,
89
+ url: String?
90
+ }
91
+
92
+ type billing_frequency = :monthly | :yearly | :one_time | :usage_based
93
+
94
+ module BillingFrequency
95
+ extend BrandDev::Internal::Type::Enum
96
+
97
+ MONTHLY: :monthly
98
+ YEARLY: :yearly
99
+ ONE_TIME: :one_time
100
+ USAGE_BASED: :usage_based
101
+
102
+ def self?.values: -> ::Array[BrandDev::Models::BrandAIProductsResponse::Product::billing_frequency]
103
+ end
104
+
105
+ type pricing_model = :per_seat | :flat | :tiered | :freemium | :custom
106
+
107
+ module PricingModel
108
+ extend BrandDev::Internal::Type::Enum
109
+
110
+ PER_SEAT: :per_seat
111
+ FLAT: :flat
112
+ TIERED: :tiered
113
+ FREEMIUM: :freemium
114
+ CUSTOM: :custom
115
+
116
+ def self?.values: -> ::Array[BrandDev::Models::BrandAIProductsResponse::Product::pricing_model]
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end