Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Making deploymentMode no longer hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
gja committed Oct 21, 2020
1 parent e7eea03 commit 0b4af8b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/commands/deploy-backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class DeployBackend extends BaseCommand {
...BaseCommand.commonFlags,
region: flags.string({char: 'r', description: 'Region', default: 'us-west-2'}),
subdomain: flags.string({char: 's', description: 'Subdomain'}),
'deployment-mode': flags.string({char: 'm', description: 'Deployment Mode', default: 'graphql'})
'deployment-mode': flags.string({char: 'm', description: 'Deployment Mode', default: 'graphql', options: ['readonly', 'graphql', 'flexible']}),
}

static args = [{name: 'name', description: 'Backend Name', required: true}]
Expand All @@ -42,7 +42,7 @@ export default class DeployBackend extends BaseCommand {
name: opts.args.name,
zone: opts.flags.region,
subdomain: opts.flags.subdomain,
deploymentMode: opts.flags['deployment-mode']
deploymentMode: opts.flags['deployment-mode'],
}),
})
if (response.status !== 200) {
Expand Down
4 changes: 4 additions & 0 deletions src/commands/list-backends.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export default class ListBackends extends BaseCommand {
get: ({zone}) => zone,
extended: true,
},
mode: {
get: ({deploymentMode}) => deploymentMode,
extended: true,
},
endpoint: {
get: ({url}) => `https://${url}/graphql`,
},
Expand Down
16 changes: 8 additions & 8 deletions src/commands/update-backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class UpdateBackend extends BaseCommand {
...BaseCommand.commonFlags,
name: flags.string({char: 'n', description: 'Name'}),
confirm: flags.boolean({char: 'y', description: 'Skip Confirmation', default: false}),
deploymentMode: flags.string({char: 'm', description: 'Deployment Mode', options: ['readonly', 'graphql', 'flexible'], hidden: true}),
'deployment-mode': flags.string({char: 'm', description: 'Deployment Mode', options: ['readonly', 'graphql', 'flexible']}),
}

static args = [{name: 'id', description: 'Backend UID', required: true}]
Expand All @@ -34,13 +34,13 @@ export default class UpdateBackend extends BaseCommand {
this.error('Please login with `slash-graphql` login')
}

const updates: Record<string, string> = {};
['name', 'deploymentMode'].forEach(key => {
const flags = opts.flags as any
if (flags[key]) {
updates[key] = flags[key]
}
})
const updates: Record<string, string> = {}
if (opts.flags.name) {
updates.name = opts.flags.name
}
if (opts.flags['deployment-mode']) {
updates.deploymentMode = opts.flags['deployment-mode']
}

if (Object.keys(updates).length === 0) {
this.error('Please pass in a property to update')
Expand Down
1 change: 1 addition & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ interface APIBackend {
zone: string;
uid: string;
owner: string;
deploymentMode: string;
}

interface AuthConfig {
Expand Down

0 comments on commit 0b4af8b

Please sign in to comment.