Skip to content

Commit f7965f7

Browse files
committed
rename region into residency
1 parent dada08b commit f7965f7

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

docs/commands/login.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ Note that logging in with **Reunite** API does not allow you to use the `push` c
3232

3333
## Options
3434

35-
| Option | Type | Description |
36-
| ------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
37-
| --config | string | Specify path to the [configuration file](../configuration/index.md). |
38-
| --help | boolean | Show help. |
39-
| --region, --residency -r | string | Specify the residency of the application. Supported values: `us`, `eu`. The `eu` region is limited to enterprise customers. Default value is `us`. |
40-
| --verbose | boolean | Display additional output. |
41-
| --version | boolean | Show version number. |
42-
| --next | boolean | Authenticate through Reunite API. |
35+
| Option | Type | Description |
36+
| ------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
37+
| --config | string | Specify path to the [configuration file](../configuration/index.md). |
38+
| --help | boolean | Show help. |
39+
| --residency, --region, -r | string | Specify the application's residency. Supported values: `us`, `eu`, or a full URL. The `eu` region is limited to enterprise customers. Default value is `us`. |
40+
| --verbose | boolean | Display additional output. |
41+
| --version | boolean | Show version number. |
42+
| --next | boolean | Authenticate through Reunite API. |
4343

4444
## Examples
4545

packages/cli/src/commands/auth.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@ export function promptClientToken(domain: string) {
1818

1919
export type LoginOptions = {
2020
verbose?: boolean;
21-
region?: string;
21+
residency?: string;
2222
config?: string;
2323
next?: boolean;
2424
};
2525

2626
export async function handleLogin({ argv, config, version }: CommandArgs<LoginOptions>) {
2727
if (argv.next) {
2828
try {
29-
const reuniteUrl = getReuniteUrl(argv.region);
29+
const reuniteUrl = getReuniteUrl(argv.residency);
3030
const oauthClient = new RedoclyOAuthClient('redocly-cli', version);
3131
await oauthClient.login(reuniteUrl);
3232
} catch {
33-
if (argv.region) {
34-
const reuniteUrl = getReuniteUrl(argv.region);
33+
if (argv.residency) {
34+
const reuniteUrl = getReuniteUrl(argv.residency);
3535
exitWithError(`❌ Connection to ${reuniteUrl} failed.`);
3636
} else {
3737
exitWithError(`❌ Login failed. Please check your credentials and try again.`);
3838
}
3939
}
4040
} else {
4141
try {
42-
const region = argv.region || config.region;
43-
const client = new RedoclyClient(region as Region);
42+
const region = (argv.residency as Region) || config.region;
43+
const client = new RedoclyClient(region);
4444
const clientToken = await promptClientToken(client.domain);
4545
process.stdout.write(gray('\n Logging in...\n'));
4646
await client.login(clientToken, argv.verbose);

packages/cli/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,9 +611,9 @@ yargs
611611
description: 'Include additional output.',
612612
type: 'boolean',
613613
},
614-
region: {
615-
description: 'Residency of the application. Defaults to US.',
616-
alias: ['r', 'residency'],
614+
residency: {
615+
description: 'Residency of the application. Defaults to `us`.',
616+
alias: ['r', 'region'],
617617
type: 'string',
618618
},
619619
config: {

0 commit comments

Comments
 (0)