Skip to content

Commit cf7da5c

Browse files
Merge pull request #384 from contentstack/feat/dx-3127
Added AWS-AU support
2 parents 4123bef + 74125a6 commit cf7da5c

File tree

8 files changed

+41
-38
lines changed

8 files changed

+41
-38
lines changed

.husky/pre-commit

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
#!/usr/bin/env sh
2-
# Pre-commit hook to run Snyk and Talisman scans, completing both before deciding to commit
2+
# Pre-commit hook to run lint, Snyk and Talisman scans, completing all before deciding to commit
33

44
# Function to check if a command exists
55
command_exists() {
66
command -v "$1" >/dev/null 2>&1
77
}
88

9+
# Allow bypassing the hook with an environment variable
10+
if [ "$SKIP_HOOK" = "1" ]; then
11+
echo "Skipping lint, Snyk and Talisman scans (SKIP_HOOK=1)."
12+
exit 0
13+
fi
14+
15+
# Run ESLint check first
16+
echo "Running ESLint check..."
17+
npm run lint
18+
lint_exit_code=$?
19+
20+
if [ $lint_exit_code -ne 0 ]; then
21+
echo "ESLint check failed. Please fix the linting issues and try again."
22+
echo "You can run 'npm run format' to auto-fix most issues."
23+
exit 1
24+
fi
25+
26+
echo "ESLint check passed."
27+
928
# Check if Snyk is installed
1029
if ! command_exists snyk; then
1130
echo "Error: Snyk is not installed. Please install it and try again."
@@ -18,12 +37,6 @@ if ! command_exists talisman; then
1837
exit 1
1938
fi
2039

21-
# Allow bypassing the hook with an environment variable
22-
if [ "$SKIP_HOOK" = "1" ]; then
23-
echo "Skipping Snyk and Talisman scans (SKIP_HOOK=1)."
24-
exit 0
25-
fi
26-
2740
# Initialize variables to track scan results
2841
snyk_failed=false
2942
talisman_failed=false
@@ -63,7 +76,7 @@ if [ "$snyk_failed" = true ] || [ "$talisman_failed" = true ]; then
6376
exit 1
6477
fi
6578

66-
# If both scans pass, allow the commit
67-
echo "All scans passed. Proceeding with commit.cd ."
79+
# If all checks pass, allow the commit
80+
echo "All checks passed (ESLint, Snyk, Talisman). Proceeding with commit."
6881
rm -f snyk_output.log talisman_output.log
6982
exit 0

.talismanrc

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,6 @@
11
fileignoreconfig:
2-
- filename: .github/workflows/secrets-scan.yml
3-
ignore_detectors:
4-
- filecontent
5-
- filename: package-lock.json
6-
checksum: 9d0340f9359927d477fe8ab4650642c068c592be63fb817651d866849e0dbbc2
7-
- filename: .husky/pre-commit
8-
checksum: 5baabd7d2c391648163f9371f0e5e9484f8fb90fa2284cfc378732ec3192c193
2+
- filename: .husky/pre-commit
3+
checksum: 52a664f536cf5d1be0bea19cb6031ca6e8107b45b6314fe7d47b7fad7d800632
4+
- filename: test/sanity-check/api/user-test.js
5+
checksum: 6bb8251aad584e09f4d963a913bd0007e5f6e089357a44c3fb1529e3fda5509d
96
version: ""
10-
fileignoreconfig:
11-
- filename: test/unit/globalField-test.js
12-
checksum: 25185e3400a12e10a043dc47502d8f30b7e1c4f2b6b4d3b8b55cdc19850c48bf
13-
version: "1.0"
14-
fileignoreconfig:
15-
- filename: lib/stack/index.js
16-
checksum: 6aab5edf85efb17951418b4dc4402889cd24c8d786c671185074aeb4d50f0242
17-
- filename: test/sanity-check/api/stack-test.js
18-
checksum: 198d5cf7ead33b079249dc3ecdee61a9c57453e93f1073ed0341400983e5aa53
19-
version: "1.0"
20-
fileignoreconfig:
21-
- filename: test/sanity-check/api/previewToken-test.js
22-
checksum: 9a42e079b7c71f76932896a0d2390d86ac626678ab20d36821dcf962820a886c
23-
- filename: lib/stack/deliveryToken/index.js
24-
checksum: 51ae00f07f4cc75c1cd832b311c2e2482f04a8467a0139da6013ceb88fbdda2f
25-
- filename: lib/stack/deliveryToken/previewToken/index.js
26-
checksum: b506f33bffdd20dfc701f964370707f5d7b28a2c05c70665f0edb7b3c53c165b
27-
version: "1.0"

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
2-
## [v1.21.8](https://github.com/contentstack/contentstack-management-javascript/tree/v1.21.8) (2025-07-07)
2+
## [v1.22.0](https://github.com/contentstack/contentstack-management-javascript/tree/v1.22.0) (2025-07-07)
3+
- Enhancement
4+
- AWS-AU Region support added
35
- Fix
46
- Fixed branch header conflits
57
## [v1.21.7](https://github.com/contentstack/contentstack-management-javascript/tree/v1.21.7) (2025-06-30)

lib/contentstack.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import httpClient from './core/contentstackHTTPClient.js'
1010
const regionHostMap = {
1111
NA: 'api.contentstack.io',
1212
EU: 'eu-api.contentstack.com',
13+
AU: 'au-api.contentstack.com',
1314
AZURE_NA: 'azure-na-api.contentstack.com',
1415
AZURE_EU: 'azure-eu-api.contentstack.com',
1516
GCP_NA: 'gcp-na-api.contentstack.com',

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/management",
3-
"version": "1.21.8",
3+
"version": "1.22.0",
44
"description": "The Content Management API is used to manage the content of your Contentstack account",
55
"main": "./dist/node/contentstack-management.js",
66
"browser": "./dist/web/contentstack-management.js",

test/sanity-check/api/user-test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ describe('Contentstack User Session api Test', () => {
111111
done()
112112
})
113113

114+
it('should get host for AU region', done => {
115+
const client = contentstack.client({ region: 'AU' })
116+
const baseUrl = client.axiosInstance.defaults.baseURL
117+
expect(baseUrl).to.include('au-api.contentstack.com', 'region AU set correctly')
118+
done()
119+
})
120+
114121
it('should get host for AZURE_NA region', done => {
115122
const client = contentstack.client({ region: 'AZURE_NA' })
116123
const baseUrl = client.axiosInstance.defaults.baseURL

test/unit/Util-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ describe('Get User Agent', () => {
123123
expect(isHost('contentstack.io:2Sdrd')).to.be.equal(true, 'contentstack.io:2Sdrd should be host')
124124
expect(isHost('contentstack.io:wedsfa2')).to.be.equal(true, 'contentstack.io:wedsfa2 should be host')
125125
expect(isHost('eu-api.contentstack.com')).to.be.equal(true, 'eu-api.contentstack.com should be host')
126+
expect(isHost('au-api.contentstack.com')).to.be.equal(true, 'au-api.contentstack.com should be host')
126127
expect(isHost('contentstack.io/path')).to.be.equal(false, 'contentstack.io/path should not host')
127128
done()
128129
})

0 commit comments

Comments
 (0)