Skip to content

Commit 8802004

Browse files
committed
Add postinstall and postupdate scripts for regions.json retrieval; include region property in ContentstackConfig interface
1 parent 3adea24 commit 8802004

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
"pre-commit": "npm run lint && husky install && husky && chmod +x .husky/pre-commit && ./.husky/pre-commit",
4545
"prepush": "npm run test:unit",
4646
"generate:docs": "node_modules/.bin/jsdoc --configure .jsdoc.json --readme README.md --verbose",
47-
"husky-check": "npx husky && chmod +x .husky/pre-commit"
47+
"husky-check": "npx husky && chmod +x .husky/pre-commit",
48+
"postinstall": "curl -s --max-time 30 --fail https://artifacts.contentstack.com/regions.json -o lib/assets/regions.json || echo 'Warning: Failed to download regions.json, using existing file if available'",
49+
"postupdate": "curl -s --max-time 30 --fail https://artifacts.contentstack.com/regions.json -o lib/assets/regions.json || echo 'Warning: Failed to download regions.json, using existing file if available'"
4850
},
4951
"engines": {
5052
"node": ">=8.0.0"

types/contentstackClient.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export interface ContentstackToken {
3131
export interface ContentstackConfig extends AxiosRequestConfig, ContentstackToken {
3232
proxy?: ProxyConfig | false
3333
endpoint?: string
34+
region?: string
3435
host?: string
3536
timeout?: number
3637
maxRequests?: number

0 commit comments

Comments
 (0)