Skip to content

Commit 7c47258

Browse files
Merge pull request #101 from contentstack/feat/dx-3228
AWS-AU support added
2 parents 50b4dba + cf2b3c4 commit 7c47258

6 files changed

Lines changed: 31 additions & 21 deletions

File tree

README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ This library helps to generate TypeScript type definition for the content types
66

77
`$ npm install @contentstack/types-generator`
88

9-
109
## Migration
11-
Refer to the [Migration Guide](https://github.com/contentstack/types-generator/blob/main/MIGRATION.md) version 3 if you are migrating from version 2 or older.
1210

11+
Refer to the [Migration Guide](https://github.com/contentstack/types-generator/blob/main/MIGRATION.md) version 3 if you are migrating from version 2 or older.
1312

1413
## Usage
1514

@@ -33,17 +32,17 @@ This is an asynchronous method which generates Typescript type definition of the
3332

3433
**Input:**
3534

36-
| Property Name | Description | Data type | Accepted values | Mandatory | Default value |
37-
| -------------------- | ---------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------ | --------- | ------------- |
38-
| token | Unique identifier used for authorization | String | | Yes | |
39-
| tokenType | Type of token being provided (Currently we are supporting only delivery token) | String | delivery | Yes | |
40-
| apiKey | Stack API key | String | | Yes | |
41-
| environment | Name of the environment (example: development, staging, production) | String | | Yes | |
42-
| region | Contentstack API region | String | US (for AWS NA), EU (for AWS EU), AZURE_NA, AZURE_EU, GCP_NA | Yes | |
43-
| branch | Stack branch name | String | | No | |
44-
| prefix | Optional prefix to add for each interface | String | | No | |
45-
| includeDocumentation | To add content type documentation in the generated file | boolean | true, false | No | true |
46-
| systemFields | Boolean flag indicating whether to include system-generated fields in the response | boolean | true, false | No | false |
35+
| Property Name | Description | Data type | Accepted values | Mandatory | Default value |
36+
| -------------------- | ---------------------------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------- | --------- | ------------- |
37+
| token | Unique identifier used for authorization | String | | Yes | |
38+
| tokenType | Type of token being provided (Currently we are supporting only delivery token) | String | delivery | Yes | |
39+
| apiKey | Stack API key | String | | Yes | |
40+
| environment | Name of the environment (example: development, staging, production) | String | | Yes | |
41+
| region | Contentstack API region | String | US (for AWS NA), EU (for AWS EU), AU (for AWS AU), AZURE_NA, AZURE_EU, GCP_NA | Yes | |
42+
| branch | Stack branch name | String | | No | |
43+
| prefix | Optional prefix to add for each interface | String | | No | |
44+
| includeDocumentation | To add content type documentation in the generated file | boolean | true, false | No | true |
45+
| systemFields | Boolean flag indicating whether to include system-generated fields in the response | boolean | true, false | No | false |
4746

4847
**Output:**
4948

@@ -169,14 +168,14 @@ This is an asynchronous method which generates Typescript type definition of the
169168

170169
**Input:**
171170

172-
| Property Name | Description | Data type | Accepted values | Mandatory |
173-
| ------------- | ----------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------ | --------- |
174-
| token | Unique identifier used for authorization. This should be the delivery token of the stack. | String | | Yes |
175-
| apiKey | Stack API key | String | | Yes |
176-
| environment | Name of the environment (example: development, staging, production) | String | | Yes |
177-
| region | Contentstack API region | String | US (for AWS NA), EU (for AWS EU), AZURE_NA, AZURE_EU, GCP_NA | Yes |
178-
| branch | Stack branch name | String | | No |
179-
| namespace | Identifies the specific namespace within schema | String | | No |
171+
| Property Name | Description | Data type | Accepted values | Mandatory |
172+
| ------------- | ----------------------------------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------- | --------- |
173+
| token | Unique identifier used for authorization. This should be the delivery token of the stack. | String | | Yes |
174+
| apiKey | Stack API key | String | | Yes |
175+
| environment | Name of the environment (example: development, staging, production) | String | | Yes |
176+
| region | Contentstack API region | String | US (for AWS NA), EU (for AWS EU), AU (for AWS AU), AZURE_NA, AZURE_EU, GCP_NA | Yes |
177+
| branch | Stack branch name | String | | No |
178+
| namespace | Identifies the specific namespace within schema | String | | No |
180179

181180
**Output:**
182181

src/constants/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ export const TOKEN_TYPE = {
55
export const REGIONS = {
66
US: "US",
77
EU: "EU",
8+
AU: "AU",
89
AWS_NA: "AWS-NA",
910
AWS_EU: "AWS-EU",
11+
AWS_AU: "AWS-AU",
1012
AZURE_NA: "AZURE_NA",
1113
AZURE_EU: "AZURE_EU",
1214
GCP_NA: "GCP_NA",

src/graphqlTS/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ type RegionUrlMap = {
1010
const GRAPHQL_REGION_URL_MAPPING: RegionUrlMap = {
1111
US: "https://graphql.contentstack.com/stacks",
1212
EU: "https://eu-graphql.contentstack.com/stacks",
13+
AU: "https://au-graphql.contentstack.com/stacks",
1314
AZURE_NA: "https://azure-na-graphql.contentstack.com/stacks",
1415
AZURE_EU: "https://azure-eu-graphql.contentstack.com/stacks",
1516
GCP_NA: "https://gcp-na-graphql.contentstack.com/stacks",
17+
GCP_EU: "https://gcp-eu-graphql.contentstack.com/stacks",
1618
};
1719

1820
export async function graphqlTS({

src/sdk/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ export const initializeContentstackSdk = ({
1818
return Region.US;
1919
case REGIONS.EU:
2020
return Region.EU;
21+
case REGIONS.AU:
22+
return Region.AU;
2123
case REGIONS.AWS_NA:
2224
return Region.US;
2325
case REGIONS.AWS_EU:
2426
return Region.EU;
27+
case REGIONS.AWS_AU:
28+
return Region.AU;
2529
case REGIONS.AZURE_NA:
2630
return Region.AZURE_NA;
2731
case REGIONS.AZURE_EU:

src/types/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ export interface StackConnectionConfig {
44
region:
55
| "US"
66
| "EU"
7+
| "AU"
78
| "AWS-NA"
89
| "AWS-EU"
10+
| "AWS-AU"
911
| "AZURE_NA"
1012
| "AZURE_EU"
1113
| "GCP_NA"

tests/unit/graphqlTS/graphqlTS.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type RegionUrlMap = {
99
const GRAPHQL_REGION_URL_MAPPING: RegionUrlMap = {
1010
US: "https://graphql.contentstack.com/stacks",
1111
EU: "https://eu-graphql.contentstack.com/stacks",
12+
AU: "https://au-graphql.contentstack.com/stacks",
1213
AZURE_NA: "https://azure-na-graphql.contentstack.com/stacks",
1314
AZURE_EU: "https://azure-eu-graphql.contentstack.com/stacks",
1415
GCP_NA: "https://gcp-na-graphql.contentstack.com/stacks",

0 commit comments

Comments
 (0)