brand.dev 1.1.0 → 1.2.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 +14 -0
- data/README.md +1 -1
- data/lib/brand_dev/internal/util.rb +18 -4
- data/lib/brand_dev/models/brand_styleguide_params.rb +1 -26
- data/lib/brand_dev/models/brand_styleguide_response.rb +495 -246
- data/lib/brand_dev/resources/brand.rb +1 -3
- data/lib/brand_dev/version.rb +1 -1
- data/rbi/brand_dev/internal/util.rbi +8 -0
- data/rbi/brand_dev/models/brand_styleguide_params.rbi +0 -58
- data/rbi/brand_dev/models/brand_styleguide_response.rbi +471 -531
- data/rbi/brand_dev/resources/brand.rbi +0 -6
- data/sig/brand_dev/internal/util.rbs +4 -0
- data/sig/brand_dev/models/brand_styleguide_params.rbs +1 -25
- data/sig/brand_dev/models/brand_styleguide_response.rbs +285 -337
- data/sig/brand_dev/resources/brand.rbs +0 -1
- metadata +2 -2
|
@@ -503,14 +503,12 @@ module BrandDev
|
|
|
503
503
|
# Either 'domain' or 'directUrl' must be provided as a query parameter, but not
|
|
504
504
|
# both.
|
|
505
505
|
#
|
|
506
|
-
# @overload styleguide(direct_url: nil, domain: nil,
|
|
506
|
+
# @overload styleguide(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {})
|
|
507
507
|
#
|
|
508
508
|
# @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio
|
|
509
509
|
#
|
|
510
510
|
# @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
|
|
511
511
|
#
|
|
512
|
-
# @param prioritize [Symbol, BrandDev::Models::BrandStyleguideParams::Prioritize] Optional parameter to prioritize screenshot capture for styleguide extraction. I
|
|
513
|
-
#
|
|
514
512
|
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
515
513
|
#
|
|
516
514
|
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
data/lib/brand_dev/version.rb
CHANGED
|
@@ -148,12 +148,20 @@ module BrandDev
|
|
|
148
148
|
end
|
|
149
149
|
end
|
|
150
150
|
|
|
151
|
+
# https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
|
|
152
|
+
RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp)
|
|
153
|
+
|
|
151
154
|
class << self
|
|
152
155
|
# @api private
|
|
153
156
|
sig { params(uri: URI::Generic).returns(String) }
|
|
154
157
|
def uri_origin(uri)
|
|
155
158
|
end
|
|
156
159
|
|
|
160
|
+
# @api private
|
|
161
|
+
sig { params(path: T.any(String, Integer)).returns(String) }
|
|
162
|
+
def encode_path(path)
|
|
163
|
+
end
|
|
164
|
+
|
|
157
165
|
# @api private
|
|
158
166
|
sig { params(path: T.any(String, T::Array[String])).returns(String) }
|
|
159
167
|
def interpolate_path(path)
|
|
@@ -27,24 +27,6 @@ module BrandDev
|
|
|
27
27
|
sig { params(domain: String).void }
|
|
28
28
|
attr_writer :domain
|
|
29
29
|
|
|
30
|
-
# Optional parameter to prioritize screenshot capture for styleguide extraction.
|
|
31
|
-
# If 'speed', optimizes for faster capture with basic quality. If 'quality',
|
|
32
|
-
# optimizes for higher quality with longer wait times. Defaults to 'quality' if
|
|
33
|
-
# not provided.
|
|
34
|
-
sig do
|
|
35
|
-
returns(
|
|
36
|
-
T.nilable(BrandDev::BrandStyleguideParams::Prioritize::OrSymbol)
|
|
37
|
-
)
|
|
38
|
-
end
|
|
39
|
-
attr_reader :prioritize
|
|
40
|
-
|
|
41
|
-
sig do
|
|
42
|
-
params(
|
|
43
|
-
prioritize: BrandDev::BrandStyleguideParams::Prioritize::OrSymbol
|
|
44
|
-
).void
|
|
45
|
-
end
|
|
46
|
-
attr_writer :prioritize
|
|
47
|
-
|
|
48
30
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
49
31
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
50
32
|
# value is 300000ms (5 minutes).
|
|
@@ -58,7 +40,6 @@ module BrandDev
|
|
|
58
40
|
params(
|
|
59
41
|
direct_url: String,
|
|
60
42
|
domain: String,
|
|
61
|
-
prioritize: BrandDev::BrandStyleguideParams::Prioritize::OrSymbol,
|
|
62
43
|
timeout_ms: Integer,
|
|
63
44
|
request_options: BrandDev::RequestOptions::OrHash
|
|
64
45
|
).returns(T.attached_class)
|
|
@@ -70,11 +51,6 @@ module BrandDev
|
|
|
70
51
|
# Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
|
|
71
52
|
# domain will be automatically normalized and validated.
|
|
72
53
|
domain: nil,
|
|
73
|
-
# Optional parameter to prioritize screenshot capture for styleguide extraction.
|
|
74
|
-
# If 'speed', optimizes for faster capture with basic quality. If 'quality',
|
|
75
|
-
# optimizes for higher quality with longer wait times. Defaults to 'quality' if
|
|
76
|
-
# not provided.
|
|
77
|
-
prioritize: nil,
|
|
78
54
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
79
55
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
80
56
|
# value is 300000ms (5 minutes).
|
|
@@ -88,7 +64,6 @@ module BrandDev
|
|
|
88
64
|
{
|
|
89
65
|
direct_url: String,
|
|
90
66
|
domain: String,
|
|
91
|
-
prioritize: BrandDev::BrandStyleguideParams::Prioritize::OrSymbol,
|
|
92
67
|
timeout_ms: Integer,
|
|
93
68
|
request_options: BrandDev::RequestOptions
|
|
94
69
|
}
|
|
@@ -96,39 +71,6 @@ module BrandDev
|
|
|
96
71
|
end
|
|
97
72
|
def to_hash
|
|
98
73
|
end
|
|
99
|
-
|
|
100
|
-
# Optional parameter to prioritize screenshot capture for styleguide extraction.
|
|
101
|
-
# If 'speed', optimizes for faster capture with basic quality. If 'quality',
|
|
102
|
-
# optimizes for higher quality with longer wait times. Defaults to 'quality' if
|
|
103
|
-
# not provided.
|
|
104
|
-
module Prioritize
|
|
105
|
-
extend BrandDev::Internal::Type::Enum
|
|
106
|
-
|
|
107
|
-
TaggedSymbol =
|
|
108
|
-
T.type_alias do
|
|
109
|
-
T.all(Symbol, BrandDev::BrandStyleguideParams::Prioritize)
|
|
110
|
-
end
|
|
111
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
112
|
-
|
|
113
|
-
SPEED =
|
|
114
|
-
T.let(
|
|
115
|
-
:speed,
|
|
116
|
-
BrandDev::BrandStyleguideParams::Prioritize::TaggedSymbol
|
|
117
|
-
)
|
|
118
|
-
QUALITY =
|
|
119
|
-
T.let(
|
|
120
|
-
:quality,
|
|
121
|
-
BrandDev::BrandStyleguideParams::Prioritize::TaggedSymbol
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
sig do
|
|
125
|
-
override.returns(
|
|
126
|
-
T::Array[BrandDev::BrandStyleguideParams::Prioritize::TaggedSymbol]
|
|
127
|
-
)
|
|
128
|
-
end
|
|
129
|
-
def self.values
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
74
|
end
|
|
133
75
|
end
|
|
134
76
|
end
|