Skip to content

Commit 0277335

Browse files
committed
Merge branch 'development' into feat/DX-7266-variant-branch-support
2 parents 0f793e6 + 5f6b898 commit 0277335

20 files changed

Lines changed: 1934 additions & 138 deletions

.github/workflows/issues-jira.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

changelog.md

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

3+
## v1.12.2
4+
5+
### Jul 06, 2026
6+
7+
- Snyk fix
8+
9+
## v1.12.1
10+
11+
### Jun 29, 2026
12+
13+
- Snyk fix
14+
15+
## v1.12.0
16+
17+
### Jun 15, 2026
18+
19+
- Feature: Dynamic endpoint resolution via `Endpoint.getContentstackEndpoint()` and `Builder.setRegion()` backed by the Contentstack Regions Registry.
20+
21+
## v1.11.2
22+
23+
### Jun 01, 2026
24+
25+
- Fix: `SocketTimeoutException` now correctly triggers the retry mechanism in `AuthInterceptor` and `OAuthInterceptor`. Previously, network-level timeouts bypassed retry logic entirely, causing `.setRetry(true)` to have no effect on timeout errors.
26+
- Enhancement: Added `setProtocols(List<Protocol>)` to the Builder, allowing callers to restrict the HTTP protocol (e.g. force HTTP/1.1 via `Collections.singletonList(Protocol.HTTP_1_1)`) for environments where proxies or intermediaries have issues with HTTP/2.
27+
328
## v1.11.1
429

530
### Apr 06, 2026

pom.xml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<artifactId>cms</artifactId>
88
<packaging>jar</packaging>
99
<name>contentstack-management-java</name>
10-
<version>1.11.1</version>
10+
<version>1.12.2</version>
1111
<description>Contentstack Java Management SDK for Content Management API, Contentstack is a headless CMS with an
1212
API-first approach
1313
</description>
@@ -278,6 +278,26 @@
278278
</execution>
279279
</executions>
280280
</plugin>
281+
<plugin>
282+
<groupId>org.codehaus.mojo</groupId>
283+
<artifactId>exec-maven-plugin</artifactId>
284+
<version>3.1.0</version>
285+
<executions>
286+
<execution>
287+
<id>download-regions</id>
288+
<phase>generate-resources</phase>
289+
<goals>
290+
<goal>exec</goal>
291+
</goals>
292+
<configuration>
293+
<executable>bash</executable>
294+
<arguments>
295+
<argument>${project.basedir}/scripts/download-regions.sh</argument>
296+
</arguments>
297+
</configuration>
298+
</execution>
299+
</executions>
300+
</plugin>
281301
<plugin>
282302
<groupId>org.apache.maven.plugins</groupId>
283303
<artifactId>maven-source-plugin</artifactId>

scripts/download-regions.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Downloads the Contentstack regions registry from the official source and
4+
# saves it to src/main/resources/regions.json.
5+
#
6+
# Invoked automatically by Maven on the generate-resources phase, and
7+
# manually via: bash scripts/download-regions.sh
8+
#
9+
# Requires: curl (preferred) or wget as fallback
10+
11+
set -euo pipefail
12+
13+
URL="https://artifacts.contentstack.com/regions.json"
14+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15+
DEST="${SCRIPT_DIR}/../src/main/resources/regions.json"
16+
DIR="$(dirname "$DEST")"
17+
18+
mkdir -p "$DIR"
19+
20+
data=""
21+
22+
# --- Attempt 1: curl (preferred) --------------------------------------------
23+
if command -v curl &>/dev/null; then
24+
data=$(curl --silent --fail --location --max-time 30 "$URL") || data=""
25+
fi
26+
27+
# --- Attempt 2: wget fallback -----------------------------------------------
28+
if [[ -z "$data" ]] && command -v wget &>/dev/null; then
29+
data=$(wget --quiet --timeout=30 -O - "$URL") || data=""
30+
fi
31+
32+
# --- Validate and write ------------------------------------------------------
33+
if [[ -z "$data" ]]; then
34+
echo "contentstack/cms: Warning — could not download regions.json." >&2
35+
echo " The SDK will attempt to download it at runtime on first use." >&2
36+
exit 0 # non-fatal: runtime fallback in Endpoint.java handles it
37+
fi
38+
39+
# Basic validation: must contain a "regions" key
40+
if ! echo "$data" | grep -q '"regions"'; then
41+
echo "contentstack/cms: Warning — downloaded data is not valid regions.json." >&2
42+
exit 0
43+
fi
44+
45+
echo "$data" > "$DEST"
46+
47+
region_count=$(echo "$data" | grep -o '"id"' | wc -l | tr -d ' ')
48+
echo "contentstack/cms: regions.json downloaded (${region_count} regions)."

0 commit comments

Comments
 (0)