Skip to content

Commit 8ff5a73

Browse files
authored
Merge pull request #34 from brand-dot-dev/release-please--branches--main--changes--next
release: 0.1.0-alpha.32
2 parents d4c3d99 + 0360d63 commit 8ff5a73

File tree

11 files changed

+122
-50
lines changed

11 files changed

+122
-50
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.31"
2+
".": "0.1.0-alpha.32"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 20
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-2cdd67823c6ac9d1ab68032a695c31a098ad285ffb0c073b9dfc00afe5de9b88.yml
3-
openapi_spec_hash: ac8a965beb9b667b6204a5c573507219
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-3614380ba4315687bbaf6561e9872fd72dd876f9230ce690c35d7efc1250e808.yml
3+
openapi_spec_hash: f1aa17e08d0379766a61de68714c7c21
44
config_hash: 4cd3173ea1cce7183640aae49cfbb374

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.1.0-alpha.32 (2026-02-24)
4+
5+
Full Changelog: [v0.1.0-alpha.31...v0.1.0-alpha.32](https://github.com/brand-dot-dev/java-sdk/compare/v0.1.0-alpha.31...v0.1.0-alpha.32)
6+
7+
### Features
8+
9+
* **api:** api update ([c79807b](https://github.com/brand-dot-dev/java-sdk/commit/c79807b3193b735f868d6ca667eb149a054a5ad6))
10+
311
## 0.1.0-alpha.31 (2026-02-23)
412

513
Full Changelog: [v0.1.0-alpha.30...v0.1.0-alpha.31](https://github.com/brand-dot-dev/java-sdk/compare/v0.1.0-alpha.30...v0.1.0-alpha.31)

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<!-- x-release-please-start-version -->
44

5-
[![Maven Central](https://img.shields.io/maven-central/v/com.branddev.api/brand-dev-java)](https://central.sonatype.com/artifact/com.branddev.api/brand-dev-java/0.1.0-alpha.31)
6-
[![javadoc](https://javadoc.io/badge2/com.branddev.api/brand-dev-java/0.1.0-alpha.31/javadoc.svg)](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.31)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.branddev.api/brand-dev-java)](https://central.sonatype.com/artifact/com.branddev.api/brand-dev-java/0.1.0-alpha.32)
6+
[![javadoc](https://javadoc.io/badge2/com.branddev.api/brand-dev-java/0.1.0-alpha.32/javadoc.svg)](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.32)
77

88
<!-- x-release-please-end -->
99

@@ -22,7 +22,7 @@ Use the Brand Dev MCP Server to enable AI assistants to interact with this API,
2222
2323
<!-- x-release-please-start-version -->
2424

25-
The REST API documentation can be found on [docs.brand.dev](https://docs.brand.dev/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.31).
25+
The REST API documentation can be found on [docs.brand.dev](https://docs.brand.dev/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.32).
2626

2727
<!-- x-release-please-end -->
2828

@@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.brand.dev](https://docs.brand.d
3333
### Gradle
3434

3535
```kotlin
36-
implementation("com.branddev.api:brand-dev-java:0.1.0-alpha.31")
36+
implementation("com.branddev.api:brand-dev-java:0.1.0-alpha.32")
3737
```
3838

3939
### Maven
@@ -42,7 +42,7 @@ implementation("com.branddev.api:brand-dev-java:0.1.0-alpha.31")
4242
<dependency>
4343
<groupId>com.branddev.api</groupId>
4444
<artifactId>brand-dev-java</artifactId>
45-
<version>0.1.0-alpha.31</version>
45+
<version>0.1.0-alpha.32</version>
4646
</dependency>
4747
```
4848

brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandStyleguideParams.kt

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package com.branddev.api.models.brand
55
import com.branddev.api.core.Enum
66
import com.branddev.api.core.JsonField
77
import com.branddev.api.core.Params
8-
import com.branddev.api.core.checkRequired
98
import com.branddev.api.core.http.Headers
109
import com.branddev.api.core.http.QueryParams
1110
import com.branddev.api.errors.BrandDevInvalidDataException
@@ -16,22 +15,30 @@ import kotlin.jvm.optionals.getOrNull
1615

1716
/**
1817
* Automatically extract comprehensive design system information from a brand's website including
19-
* colors, typography, spacing, shadows, and UI components.
18+
* colors, typography, spacing, shadows, and UI components. Either 'domain' or 'directUrl' must be
19+
* provided as a query parameter, but not both.
2020
*/
2121
class BrandStyleguideParams
2222
private constructor(
23-
private val domain: String,
23+
private val directUrl: String?,
24+
private val domain: String?,
2425
private val prioritize: Prioritize?,
2526
private val timeoutMs: Long?,
2627
private val additionalHeaders: Headers,
2728
private val additionalQueryParams: QueryParams,
2829
) : Params {
2930

31+
/**
32+
* A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g.,
33+
* 'https://example.com/design-system').
34+
*/
35+
fun directUrl(): Optional<String> = Optional.ofNullable(directUrl)
36+
3037
/**
3138
* Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will
3239
* be automatically normalized and validated.
3340
*/
34-
fun domain(): String = domain
41+
fun domain(): Optional<String> = Optional.ofNullable(domain)
3542

3643
/**
3744
* Optional parameter to prioritize screenshot capture for styleguide extraction. If 'speed',
@@ -57,20 +64,16 @@ private constructor(
5764

5865
companion object {
5966

60-
/**
61-
* Returns a mutable builder for constructing an instance of [BrandStyleguideParams].
62-
*
63-
* The following fields are required:
64-
* ```java
65-
* .domain()
66-
* ```
67-
*/
67+
@JvmStatic fun none(): BrandStyleguideParams = builder().build()
68+
69+
/** Returns a mutable builder for constructing an instance of [BrandStyleguideParams]. */
6870
@JvmStatic fun builder() = Builder()
6971
}
7072

7173
/** A builder for [BrandStyleguideParams]. */
7274
class Builder internal constructor() {
7375

76+
private var directUrl: String? = null
7477
private var domain: String? = null
7578
private var prioritize: Prioritize? = null
7679
private var timeoutMs: Long? = null
@@ -79,18 +82,31 @@ private constructor(
7982

8083
@JvmSynthetic
8184
internal fun from(brandStyleguideParams: BrandStyleguideParams) = apply {
85+
directUrl = brandStyleguideParams.directUrl
8286
domain = brandStyleguideParams.domain
8387
prioritize = brandStyleguideParams.prioritize
8488
timeoutMs = brandStyleguideParams.timeoutMs
8589
additionalHeaders = brandStyleguideParams.additionalHeaders.toBuilder()
8690
additionalQueryParams = brandStyleguideParams.additionalQueryParams.toBuilder()
8791
}
8892

93+
/**
94+
* A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g.,
95+
* 'https://example.com/design-system').
96+
*/
97+
fun directUrl(directUrl: String?) = apply { this.directUrl = directUrl }
98+
99+
/** Alias for calling [Builder.directUrl] with `directUrl.orElse(null)`. */
100+
fun directUrl(directUrl: Optional<String>) = directUrl(directUrl.getOrNull())
101+
89102
/**
90103
* Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain
91104
* will be automatically normalized and validated.
92105
*/
93-
fun domain(domain: String) = apply { this.domain = domain }
106+
fun domain(domain: String?) = apply { this.domain = domain }
107+
108+
/** Alias for calling [Builder.domain] with `domain.orElse(null)`. */
109+
fun domain(domain: Optional<String>) = domain(domain.getOrNull())
94110

95111
/**
96112
* Optional parameter to prioritize screenshot capture for styleguide extraction. If
@@ -221,17 +237,11 @@ private constructor(
221237
* Returns an immutable instance of [BrandStyleguideParams].
222238
*
223239
* Further updates to this [Builder] will not mutate the returned instance.
224-
*
225-
* The following fields are required:
226-
* ```java
227-
* .domain()
228-
* ```
229-
*
230-
* @throws IllegalStateException if any required field is unset.
231240
*/
232241
fun build(): BrandStyleguideParams =
233242
BrandStyleguideParams(
234-
checkRequired("domain", domain),
243+
directUrl,
244+
domain,
235245
prioritize,
236246
timeoutMs,
237247
additionalHeaders.build(),
@@ -244,7 +254,8 @@ private constructor(
244254
override fun _queryParams(): QueryParams =
245255
QueryParams.builder()
246256
.apply {
247-
put("domain", domain)
257+
directUrl?.let { put("directUrl", it) }
258+
domain?.let { put("domain", it) }
248259
prioritize?.let { put("prioritize", it.toString()) }
249260
timeoutMs?.let { put("timeoutMS", it.toString()) }
250261
putAll(additionalQueryParams)
@@ -391,6 +402,7 @@ private constructor(
391402
}
392403

393404
return other is BrandStyleguideParams &&
405+
directUrl == other.directUrl &&
394406
domain == other.domain &&
395407
prioritize == other.prioritize &&
396408
timeoutMs == other.timeoutMs &&
@@ -399,8 +411,15 @@ private constructor(
399411
}
400412

401413
override fun hashCode(): Int =
402-
Objects.hash(domain, prioritize, timeoutMs, additionalHeaders, additionalQueryParams)
414+
Objects.hash(
415+
directUrl,
416+
domain,
417+
prioritize,
418+
timeoutMs,
419+
additionalHeaders,
420+
additionalQueryParams,
421+
)
403422

404423
override fun toString() =
405-
"BrandStyleguideParams{domain=$domain, prioritize=$prioritize, timeoutMs=$timeoutMs, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
424+
"BrandStyleguideParams{directUrl=$directUrl, domain=$domain, prioritize=$prioritize, timeoutMs=$timeoutMs, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
406425
}

brand-dev-java-core/src/main/kotlin/com/branddev/api/services/async/BrandServiceAsync.kt

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,17 +314,27 @@ interface BrandServiceAsync {
314314

315315
/**
316316
* Automatically extract comprehensive design system information from a brand's website
317-
* including colors, typography, spacing, shadows, and UI components.
317+
* including colors, typography, spacing, shadows, and UI components. Either 'domain' or
318+
* 'directUrl' must be provided as a query parameter, but not both.
318319
*/
319-
fun styleguide(params: BrandStyleguideParams): CompletableFuture<BrandStyleguideResponse> =
320-
styleguide(params, RequestOptions.none())
320+
fun styleguide(): CompletableFuture<BrandStyleguideResponse> =
321+
styleguide(BrandStyleguideParams.none())
321322

322323
/** @see styleguide */
323324
fun styleguide(
324-
params: BrandStyleguideParams,
325+
params: BrandStyleguideParams = BrandStyleguideParams.none(),
325326
requestOptions: RequestOptions = RequestOptions.none(),
326327
): CompletableFuture<BrandStyleguideResponse>
327328

329+
/** @see styleguide */
330+
fun styleguide(
331+
params: BrandStyleguideParams = BrandStyleguideParams.none()
332+
): CompletableFuture<BrandStyleguideResponse> = styleguide(params, RequestOptions.none())
333+
334+
/** @see styleguide */
335+
fun styleguide(requestOptions: RequestOptions): CompletableFuture<BrandStyleguideResponse> =
336+
styleguide(BrandStyleguideParams.none(), requestOptions)
337+
328338
/**
329339
* Scrapes the given URL and returns the raw HTML content of the page. Uses automatic proxy
330340
* escalation to handle blocked sites.
@@ -663,16 +673,26 @@ interface BrandServiceAsync {
663673
* Returns a raw HTTP response for `get /brand/styleguide`, but is otherwise the same as
664674
* [BrandServiceAsync.styleguide].
665675
*/
676+
fun styleguide(): CompletableFuture<HttpResponseFor<BrandStyleguideResponse>> =
677+
styleguide(BrandStyleguideParams.none())
678+
679+
/** @see styleguide */
666680
fun styleguide(
667-
params: BrandStyleguideParams
681+
params: BrandStyleguideParams = BrandStyleguideParams.none(),
682+
requestOptions: RequestOptions = RequestOptions.none(),
683+
): CompletableFuture<HttpResponseFor<BrandStyleguideResponse>>
684+
685+
/** @see styleguide */
686+
fun styleguide(
687+
params: BrandStyleguideParams = BrandStyleguideParams.none()
668688
): CompletableFuture<HttpResponseFor<BrandStyleguideResponse>> =
669689
styleguide(params, RequestOptions.none())
670690

671691
/** @see styleguide */
672692
fun styleguide(
673-
params: BrandStyleguideParams,
674-
requestOptions: RequestOptions = RequestOptions.none(),
675-
): CompletableFuture<HttpResponseFor<BrandStyleguideResponse>>
693+
requestOptions: RequestOptions
694+
): CompletableFuture<HttpResponseFor<BrandStyleguideResponse>> =
695+
styleguide(BrandStyleguideParams.none(), requestOptions)
676696

677697
/**
678698
* Returns a raw HTTP response for `get /web/scrape/html`, but is otherwise the same as

brand-dev-java-core/src/main/kotlin/com/branddev/api/services/blocking/BrandService.kt

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,26 @@ interface BrandService {
297297

298298
/**
299299
* Automatically extract comprehensive design system information from a brand's website
300-
* including colors, typography, spacing, shadows, and UI components.
300+
* including colors, typography, spacing, shadows, and UI components. Either 'domain' or
301+
* 'directUrl' must be provided as a query parameter, but not both.
301302
*/
302-
fun styleguide(params: BrandStyleguideParams): BrandStyleguideResponse =
303-
styleguide(params, RequestOptions.none())
303+
fun styleguide(): BrandStyleguideResponse = styleguide(BrandStyleguideParams.none())
304304

305305
/** @see styleguide */
306306
fun styleguide(
307-
params: BrandStyleguideParams,
307+
params: BrandStyleguideParams = BrandStyleguideParams.none(),
308308
requestOptions: RequestOptions = RequestOptions.none(),
309309
): BrandStyleguideResponse
310310

311+
/** @see styleguide */
312+
fun styleguide(
313+
params: BrandStyleguideParams = BrandStyleguideParams.none()
314+
): BrandStyleguideResponse = styleguide(params, RequestOptions.none())
315+
316+
/** @see styleguide */
317+
fun styleguide(requestOptions: RequestOptions): BrandStyleguideResponse =
318+
styleguide(BrandStyleguideParams.none(), requestOptions)
319+
311320
/**
312321
* Scrapes the given URL and returns the raw HTML content of the page. Uses automatic proxy
313322
* escalation to handle blocked sites.
@@ -658,16 +667,27 @@ interface BrandService {
658667
* [BrandService.styleguide].
659668
*/
660669
@MustBeClosed
661-
fun styleguide(params: BrandStyleguideParams): HttpResponseFor<BrandStyleguideResponse> =
662-
styleguide(params, RequestOptions.none())
670+
fun styleguide(): HttpResponseFor<BrandStyleguideResponse> =
671+
styleguide(BrandStyleguideParams.none())
663672

664673
/** @see styleguide */
665674
@MustBeClosed
666675
fun styleguide(
667-
params: BrandStyleguideParams,
676+
params: BrandStyleguideParams = BrandStyleguideParams.none(),
668677
requestOptions: RequestOptions = RequestOptions.none(),
669678
): HttpResponseFor<BrandStyleguideResponse>
670679

680+
/** @see styleguide */
681+
@MustBeClosed
682+
fun styleguide(
683+
params: BrandStyleguideParams = BrandStyleguideParams.none()
684+
): HttpResponseFor<BrandStyleguideResponse> = styleguide(params, RequestOptions.none())
685+
686+
/** @see styleguide */
687+
@MustBeClosed
688+
fun styleguide(requestOptions: RequestOptions): HttpResponseFor<BrandStyleguideResponse> =
689+
styleguide(BrandStyleguideParams.none(), requestOptions)
690+
671691
/**
672692
* Returns a raw HTTP response for `get /web/scrape/html`, but is otherwise the same as
673693
* [BrandService.webScrapeHtml].

brand-dev-java-core/src/test/kotlin/com/branddev/api/models/brand/BrandStyleguideParamsTest.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ internal class BrandStyleguideParamsTest {
1111
@Test
1212
fun create() {
1313
BrandStyleguideParams.builder()
14+
.directUrl("https://example.com")
1415
.domain("domain")
1516
.prioritize(BrandStyleguideParams.Prioritize.SPEED)
1617
.timeoutMs(1000L)
@@ -21,6 +22,7 @@ internal class BrandStyleguideParamsTest {
2122
fun queryParams() {
2223
val params =
2324
BrandStyleguideParams.builder()
25+
.directUrl("https://example.com")
2426
.domain("domain")
2527
.prioritize(BrandStyleguideParams.Prioritize.SPEED)
2628
.timeoutMs(1000L)
@@ -31,6 +33,7 @@ internal class BrandStyleguideParamsTest {
3133
assertThat(queryParams)
3234
.isEqualTo(
3335
QueryParams.builder()
36+
.put("directUrl", "https://example.com")
3437
.put("domain", "domain")
3538
.put("prioritize", "speed")
3639
.put("timeoutMS", "1000")
@@ -40,10 +43,10 @@ internal class BrandStyleguideParamsTest {
4043

4144
@Test
4245
fun queryParamsWithoutOptionalFields() {
43-
val params = BrandStyleguideParams.builder().domain("domain").build()
46+
val params = BrandStyleguideParams.builder().build()
4447

4548
val queryParams = params._queryParams()
4649

47-
assertThat(queryParams).isEqualTo(QueryParams.builder().put("domain", "domain").build())
50+
assertThat(queryParams).isEqualTo(QueryParams.builder().build())
4851
}
4952
}

brand-dev-java-core/src/test/kotlin/com/branddev/api/services/async/BrandServiceAsyncTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ internal class BrandServiceAsyncTest {
354354
val responseFuture =
355355
brandServiceAsync.styleguide(
356356
BrandStyleguideParams.builder()
357+
.directUrl("https://example.com")
357358
.domain("domain")
358359
.prioritize(BrandStyleguideParams.Prioritize.SPEED)
359360
.timeoutMs(1000L)

brand-dev-java-core/src/test/kotlin/com/branddev/api/services/blocking/BrandServiceTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ internal class BrandServiceTest {
337337
val response =
338338
brandService.styleguide(
339339
BrandStyleguideParams.builder()
340+
.directUrl("https://example.com")
340341
.domain("domain")
341342
.prioritize(BrandStyleguideParams.Prioritize.SPEED)
342343
.timeoutMs(1000L)

0 commit comments

Comments
 (0)