brand.dev 0.0.1.pre.alpha.0 → 0.1.0.pre.alpha.2

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,304 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ module Models
5
+ class BrandAIQueryParams < 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::BrandAIQueryParams, BrandDev::Internal::AnyHash)
12
+ end
13
+
14
+ # Array of data points to extract from the website
15
+ sig { returns(T::Array[BrandDev::BrandAIQueryParams::DataToExtract]) }
16
+ attr_accessor :data_to_extract
17
+
18
+ # The domain name to analyze
19
+ sig { returns(String) }
20
+ attr_accessor :domain
21
+
22
+ # Optional object specifying which pages to analyze
23
+ sig { returns(T.nilable(BrandDev::BrandAIQueryParams::SpecificPages)) }
24
+ attr_reader :specific_pages
25
+
26
+ sig do
27
+ params(
28
+ specific_pages: BrandDev::BrandAIQueryParams::SpecificPages::OrHash
29
+ ).void
30
+ end
31
+ attr_writer :specific_pages
32
+
33
+ sig do
34
+ params(
35
+ data_to_extract:
36
+ T::Array[BrandDev::BrandAIQueryParams::DataToExtract::OrHash],
37
+ domain: String,
38
+ specific_pages: BrandDev::BrandAIQueryParams::SpecificPages::OrHash,
39
+ request_options: BrandDev::RequestOptions::OrHash
40
+ ).returns(T.attached_class)
41
+ end
42
+ def self.new(
43
+ # Array of data points to extract from the website
44
+ data_to_extract:,
45
+ # The domain name to analyze
46
+ domain:,
47
+ # Optional object specifying which pages to analyze
48
+ specific_pages: nil,
49
+ request_options: {}
50
+ )
51
+ end
52
+
53
+ sig do
54
+ override.returns(
55
+ {
56
+ data_to_extract:
57
+ T::Array[BrandDev::BrandAIQueryParams::DataToExtract],
58
+ domain: String,
59
+ specific_pages: BrandDev::BrandAIQueryParams::SpecificPages,
60
+ request_options: BrandDev::RequestOptions
61
+ }
62
+ )
63
+ end
64
+ def to_hash
65
+ end
66
+
67
+ class DataToExtract < BrandDev::Internal::Type::BaseModel
68
+ OrHash =
69
+ T.type_alias do
70
+ T.any(
71
+ BrandDev::BrandAIQueryParams::DataToExtract,
72
+ BrandDev::Internal::AnyHash
73
+ )
74
+ end
75
+
76
+ # Description of what to extract
77
+ sig { returns(String) }
78
+ attr_accessor :datapoint_description
79
+
80
+ # Example of the expected value
81
+ sig { returns(String) }
82
+ attr_accessor :datapoint_example
83
+
84
+ # Name of the data point to extract
85
+ sig { returns(String) }
86
+ attr_accessor :datapoint_name
87
+
88
+ # Type of the data point
89
+ sig do
90
+ returns(
91
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::OrSymbol
92
+ )
93
+ end
94
+ attr_accessor :datapoint_type
95
+
96
+ sig do
97
+ params(
98
+ datapoint_description: String,
99
+ datapoint_example: String,
100
+ datapoint_name: String,
101
+ datapoint_type:
102
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::OrSymbol
103
+ ).returns(T.attached_class)
104
+ end
105
+ def self.new(
106
+ # Description of what to extract
107
+ datapoint_description:,
108
+ # Example of the expected value
109
+ datapoint_example:,
110
+ # Name of the data point to extract
111
+ datapoint_name:,
112
+ # Type of the data point
113
+ datapoint_type:
114
+ )
115
+ end
116
+
117
+ sig do
118
+ override.returns(
119
+ {
120
+ datapoint_description: String,
121
+ datapoint_example: String,
122
+ datapoint_name: String,
123
+ datapoint_type:
124
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::OrSymbol
125
+ }
126
+ )
127
+ end
128
+ def to_hash
129
+ end
130
+
131
+ # Type of the data point
132
+ module DatapointType
133
+ extend BrandDev::Internal::Type::Enum
134
+
135
+ TaggedSymbol =
136
+ T.type_alias do
137
+ T.all(
138
+ Symbol,
139
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType
140
+ )
141
+ end
142
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
143
+
144
+ TEXT =
145
+ T.let(
146
+ :text,
147
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
148
+ )
149
+ NUMBER =
150
+ T.let(
151
+ :number,
152
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
153
+ )
154
+ DATE =
155
+ T.let(
156
+ :date,
157
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
158
+ )
159
+ BOOLEAN =
160
+ T.let(
161
+ :boolean,
162
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
163
+ )
164
+ LIST =
165
+ T.let(
166
+ :list,
167
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
168
+ )
169
+ URL =
170
+ T.let(
171
+ :url,
172
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
173
+ )
174
+
175
+ sig do
176
+ override.returns(
177
+ T::Array[
178
+ BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
179
+ ]
180
+ )
181
+ end
182
+ def self.values
183
+ end
184
+ end
185
+ end
186
+
187
+ class SpecificPages < BrandDev::Internal::Type::BaseModel
188
+ OrHash =
189
+ T.type_alias do
190
+ T.any(
191
+ BrandDev::BrandAIQueryParams::SpecificPages,
192
+ BrandDev::Internal::AnyHash
193
+ )
194
+ end
195
+
196
+ # Whether to analyze the about us page
197
+ sig { returns(T.nilable(T::Boolean)) }
198
+ attr_reader :about_us
199
+
200
+ sig { params(about_us: T::Boolean).void }
201
+ attr_writer :about_us
202
+
203
+ # Whether to analyze the blog
204
+ sig { returns(T.nilable(T::Boolean)) }
205
+ attr_reader :blog
206
+
207
+ sig { params(blog: T::Boolean).void }
208
+ attr_writer :blog
209
+
210
+ # Whether to analyze the careers page
211
+ sig { returns(T.nilable(T::Boolean)) }
212
+ attr_reader :careers
213
+
214
+ sig { params(careers: T::Boolean).void }
215
+ attr_writer :careers
216
+
217
+ # Whether to analyze the contact us page
218
+ sig { returns(T.nilable(T::Boolean)) }
219
+ attr_reader :contact_us
220
+
221
+ sig { params(contact_us: T::Boolean).void }
222
+ attr_writer :contact_us
223
+
224
+ # Whether to analyze the FAQ page
225
+ sig { returns(T.nilable(T::Boolean)) }
226
+ attr_reader :faq
227
+
228
+ sig { params(faq: T::Boolean).void }
229
+ attr_writer :faq
230
+
231
+ # Whether to analyze the home page
232
+ sig { returns(T.nilable(T::Boolean)) }
233
+ attr_reader :home_page
234
+
235
+ sig { params(home_page: T::Boolean).void }
236
+ attr_writer :home_page
237
+
238
+ # Whether to analyze the privacy policy page
239
+ sig { returns(T.nilable(T::Boolean)) }
240
+ attr_reader :privacy_policy
241
+
242
+ sig { params(privacy_policy: T::Boolean).void }
243
+ attr_writer :privacy_policy
244
+
245
+ # Whether to analyze the terms and conditions page
246
+ sig { returns(T.nilable(T::Boolean)) }
247
+ attr_reader :terms_and_conditions
248
+
249
+ sig { params(terms_and_conditions: T::Boolean).void }
250
+ attr_writer :terms_and_conditions
251
+
252
+ # Optional object specifying which pages to analyze
253
+ sig do
254
+ params(
255
+ about_us: T::Boolean,
256
+ blog: T::Boolean,
257
+ careers: T::Boolean,
258
+ contact_us: T::Boolean,
259
+ faq: T::Boolean,
260
+ home_page: T::Boolean,
261
+ privacy_policy: T::Boolean,
262
+ terms_and_conditions: T::Boolean
263
+ ).returns(T.attached_class)
264
+ end
265
+ def self.new(
266
+ # Whether to analyze the about us page
267
+ about_us: nil,
268
+ # Whether to analyze the blog
269
+ blog: nil,
270
+ # Whether to analyze the careers page
271
+ careers: nil,
272
+ # Whether to analyze the contact us page
273
+ contact_us: nil,
274
+ # Whether to analyze the FAQ page
275
+ faq: nil,
276
+ # Whether to analyze the home page
277
+ home_page: nil,
278
+ # Whether to analyze the privacy policy page
279
+ privacy_policy: nil,
280
+ # Whether to analyze the terms and conditions page
281
+ terms_and_conditions: nil
282
+ )
283
+ end
284
+
285
+ sig do
286
+ override.returns(
287
+ {
288
+ about_us: T::Boolean,
289
+ blog: T::Boolean,
290
+ careers: T::Boolean,
291
+ contact_us: T::Boolean,
292
+ faq: T::Boolean,
293
+ home_page: T::Boolean,
294
+ privacy_policy: T::Boolean,
295
+ terms_and_conditions: T::Boolean
296
+ }
297
+ )
298
+ end
299
+ def to_hash
300
+ end
301
+ end
302
+ end
303
+ end
304
+ end
@@ -0,0 +1,182 @@
1
+ # typed: strong
2
+
3
+ module BrandDev
4
+ module Models
5
+ class BrandAIQueryResponse < BrandDev::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ BrandDev::Models::BrandAIQueryResponse,
10
+ BrandDev::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Array of extracted data points
15
+ sig do
16
+ returns(
17
+ T.nilable(
18
+ T::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted]
19
+ )
20
+ )
21
+ end
22
+ attr_reader :data_extracted
23
+
24
+ sig do
25
+ params(
26
+ data_extracted:
27
+ T::Array[
28
+ BrandDev::Models::BrandAIQueryResponse::DataExtracted::OrHash
29
+ ]
30
+ ).void
31
+ end
32
+ attr_writer :data_extracted
33
+
34
+ # The domain that was analyzed
35
+ sig { returns(T.nilable(String)) }
36
+ attr_reader :domain
37
+
38
+ sig { params(domain: String).void }
39
+ attr_writer :domain
40
+
41
+ # List of URLs that were analyzed
42
+ sig { returns(T.nilable(T::Array[String])) }
43
+ attr_reader :urls_analyzed
44
+
45
+ sig { params(urls_analyzed: T::Array[String]).void }
46
+ attr_writer :urls_analyzed
47
+
48
+ sig do
49
+ params(
50
+ data_extracted:
51
+ T::Array[
52
+ BrandDev::Models::BrandAIQueryResponse::DataExtracted::OrHash
53
+ ],
54
+ domain: String,
55
+ urls_analyzed: T::Array[String]
56
+ ).returns(T.attached_class)
57
+ end
58
+ def self.new(
59
+ # Array of extracted data points
60
+ data_extracted: nil,
61
+ # The domain that was analyzed
62
+ domain: nil,
63
+ # List of URLs that were analyzed
64
+ urls_analyzed: nil
65
+ )
66
+ end
67
+
68
+ sig do
69
+ override.returns(
70
+ {
71
+ data_extracted:
72
+ T::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted],
73
+ domain: String,
74
+ urls_analyzed: T::Array[String]
75
+ }
76
+ )
77
+ end
78
+ def to_hash
79
+ end
80
+
81
+ class DataExtracted < BrandDev::Internal::Type::BaseModel
82
+ OrHash =
83
+ T.type_alias do
84
+ T.any(
85
+ BrandDev::Models::BrandAIQueryResponse::DataExtracted,
86
+ BrandDev::Internal::AnyHash
87
+ )
88
+ end
89
+
90
+ # Name of the extracted data point
91
+ sig { returns(T.nilable(String)) }
92
+ attr_reader :datapoint_name
93
+
94
+ sig { params(datapoint_name: String).void }
95
+ attr_writer :datapoint_name
96
+
97
+ # Value of the extracted data point
98
+ sig do
99
+ returns(
100
+ T.nilable(
101
+ BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::Variants
102
+ )
103
+ )
104
+ end
105
+ attr_reader :datapoint_value
106
+
107
+ sig do
108
+ params(
109
+ datapoint_value:
110
+ BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::Variants
111
+ ).void
112
+ end
113
+ attr_writer :datapoint_value
114
+
115
+ sig do
116
+ params(
117
+ datapoint_name: String,
118
+ datapoint_value:
119
+ BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::Variants
120
+ ).returns(T.attached_class)
121
+ end
122
+ def self.new(
123
+ # Name of the extracted data point
124
+ datapoint_name: nil,
125
+ # Value of the extracted data point
126
+ datapoint_value: nil
127
+ )
128
+ end
129
+
130
+ sig do
131
+ override.returns(
132
+ {
133
+ datapoint_name: String,
134
+ datapoint_value:
135
+ BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::Variants
136
+ }
137
+ )
138
+ end
139
+ def to_hash
140
+ end
141
+
142
+ # Value of the extracted data point
143
+ module DatapointValue
144
+ extend BrandDev::Internal::Type::Union
145
+
146
+ Variants =
147
+ T.type_alias do
148
+ T.any(
149
+ String,
150
+ Float,
151
+ T::Boolean,
152
+ T::Array[String],
153
+ T::Array[Float]
154
+ )
155
+ end
156
+
157
+ sig do
158
+ override.returns(
159
+ T::Array[
160
+ BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::Variants
161
+ ]
162
+ )
163
+ end
164
+ def self.variants
165
+ end
166
+
167
+ StringArray =
168
+ T.let(
169
+ BrandDev::Internal::Type::ArrayOf[String],
170
+ BrandDev::Internal::Type::Converter
171
+ )
172
+
173
+ FloatArray =
174
+ T.let(
175
+ BrandDev::Internal::Type::ArrayOf[Float],
176
+ BrandDev::Internal::Type::Converter
177
+ )
178
+ end
179
+ end
180
+ end
181
+ end
182
+ end
@@ -1,6 +1,8 @@
1
1
  # typed: strong
2
2
 
3
3
  module BrandDev
4
+ BrandAIQueryParams = BrandDev::Models::BrandAIQueryParams
5
+
4
6
  BrandIdentifyFromTransactionParams =
5
7
  BrandDev::Models::BrandIdentifyFromTransactionParams
6
8
 
@@ -21,6 +21,29 @@ module BrandDev
21
21
  )
22
22
  end
23
23
 
24
+ # Beta feature: Use AI to extract specific data points from a brand's website. The
25
+ # AI will crawl the website and extract the requested information based on the
26
+ # provided data points.
27
+ sig do
28
+ params(
29
+ data_to_extract:
30
+ T::Array[BrandDev::BrandAIQueryParams::DataToExtract::OrHash],
31
+ domain: String,
32
+ specific_pages: BrandDev::BrandAIQueryParams::SpecificPages::OrHash,
33
+ request_options: BrandDev::RequestOptions::OrHash
34
+ ).returns(BrandDev::Models::BrandAIQueryResponse)
35
+ end
36
+ def ai_query(
37
+ # Array of data points to extract from the website
38
+ data_to_extract:,
39
+ # The domain name to analyze
40
+ domain:,
41
+ # Optional object specifying which pages to analyze
42
+ specific_pages: nil,
43
+ request_options: {}
44
+ )
45
+ end
46
+
24
47
  # Endpoint specially designed for platforms that want to identify transaction data
25
48
  # by the transaction title.
26
49
  sig do
@@ -0,0 +1,155 @@
1
+ module BrandDev
2
+ module Models
3
+ type brand_ai_query_params =
4
+ {
5
+ data_to_extract: ::Array[BrandDev::BrandAIQueryParams::DataToExtract],
6
+ domain: String,
7
+ specific_pages: BrandDev::BrandAIQueryParams::SpecificPages
8
+ }
9
+ & BrandDev::Internal::Type::request_parameters
10
+
11
+ class BrandAIQueryParams < BrandDev::Internal::Type::BaseModel
12
+ extend BrandDev::Internal::Type::RequestParameters::Converter
13
+ include BrandDev::Internal::Type::RequestParameters
14
+
15
+ attr_accessor data_to_extract: ::Array[BrandDev::BrandAIQueryParams::DataToExtract]
16
+
17
+ attr_accessor domain: String
18
+
19
+ attr_reader specific_pages: BrandDev::BrandAIQueryParams::SpecificPages?
20
+
21
+ def specific_pages=: (
22
+ BrandDev::BrandAIQueryParams::SpecificPages
23
+ ) -> BrandDev::BrandAIQueryParams::SpecificPages
24
+
25
+ def initialize: (
26
+ data_to_extract: ::Array[BrandDev::BrandAIQueryParams::DataToExtract],
27
+ domain: String,
28
+ ?specific_pages: BrandDev::BrandAIQueryParams::SpecificPages,
29
+ ?request_options: BrandDev::request_opts
30
+ ) -> void
31
+
32
+ def to_hash: -> {
33
+ data_to_extract: ::Array[BrandDev::BrandAIQueryParams::DataToExtract],
34
+ domain: String,
35
+ specific_pages: BrandDev::BrandAIQueryParams::SpecificPages,
36
+ request_options: BrandDev::RequestOptions
37
+ }
38
+
39
+ type data_to_extract =
40
+ {
41
+ datapoint_description: String,
42
+ datapoint_example: String,
43
+ datapoint_name: String,
44
+ datapoint_type: BrandDev::Models::BrandAIQueryParams::DataToExtract::datapoint_type
45
+ }
46
+
47
+ class DataToExtract < BrandDev::Internal::Type::BaseModel
48
+ attr_accessor datapoint_description: String
49
+
50
+ attr_accessor datapoint_example: String
51
+
52
+ attr_accessor datapoint_name: String
53
+
54
+ attr_accessor datapoint_type: BrandDev::Models::BrandAIQueryParams::DataToExtract::datapoint_type
55
+
56
+ def initialize: (
57
+ datapoint_description: String,
58
+ datapoint_example: String,
59
+ datapoint_name: String,
60
+ datapoint_type: BrandDev::Models::BrandAIQueryParams::DataToExtract::datapoint_type
61
+ ) -> void
62
+
63
+ def to_hash: -> {
64
+ datapoint_description: String,
65
+ datapoint_example: String,
66
+ datapoint_name: String,
67
+ datapoint_type: BrandDev::Models::BrandAIQueryParams::DataToExtract::datapoint_type
68
+ }
69
+
70
+ type datapoint_type = :text | :number | :date | :boolean | :list | :url
71
+
72
+ module DatapointType
73
+ extend BrandDev::Internal::Type::Enum
74
+
75
+ TEXT: :text
76
+ NUMBER: :number
77
+ DATE: :date
78
+ BOOLEAN: :boolean
79
+ LIST: :list
80
+ URL: :url
81
+
82
+ def self?.values: -> ::Array[BrandDev::Models::BrandAIQueryParams::DataToExtract::datapoint_type]
83
+ end
84
+ end
85
+
86
+ type specific_pages =
87
+ {
88
+ about_us: bool,
89
+ blog: bool,
90
+ careers: bool,
91
+ contact_us: bool,
92
+ faq: bool,
93
+ home_page: bool,
94
+ privacy_policy: bool,
95
+ terms_and_conditions: bool
96
+ }
97
+
98
+ class SpecificPages < BrandDev::Internal::Type::BaseModel
99
+ attr_reader about_us: bool?
100
+
101
+ def about_us=: (bool) -> bool
102
+
103
+ attr_reader blog: bool?
104
+
105
+ def blog=: (bool) -> bool
106
+
107
+ attr_reader careers: bool?
108
+
109
+ def careers=: (bool) -> bool
110
+
111
+ attr_reader contact_us: bool?
112
+
113
+ def contact_us=: (bool) -> bool
114
+
115
+ attr_reader faq: bool?
116
+
117
+ def faq=: (bool) -> bool
118
+
119
+ attr_reader home_page: bool?
120
+
121
+ def home_page=: (bool) -> bool
122
+
123
+ attr_reader privacy_policy: bool?
124
+
125
+ def privacy_policy=: (bool) -> bool
126
+
127
+ attr_reader terms_and_conditions: bool?
128
+
129
+ def terms_and_conditions=: (bool) -> bool
130
+
131
+ def initialize: (
132
+ ?about_us: bool,
133
+ ?blog: bool,
134
+ ?careers: bool,
135
+ ?contact_us: bool,
136
+ ?faq: bool,
137
+ ?home_page: bool,
138
+ ?privacy_policy: bool,
139
+ ?terms_and_conditions: bool
140
+ ) -> void
141
+
142
+ def to_hash: -> {
143
+ about_us: bool,
144
+ blog: bool,
145
+ careers: bool,
146
+ contact_us: bool,
147
+ faq: bool,
148
+ home_page: bool,
149
+ privacy_policy: bool,
150
+ terms_and_conditions: bool
151
+ }
152
+ end
153
+ end
154
+ end
155
+ end