Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
else{
cli.action.stop()
}
})
}
else {
console.error('please confirm the verification email and try again')
}
})
}
else cli.action.stop()
}
})
}
else if(flags.validate){
cli.action.start('Validating your SES email')
SEF.ValidateSesEmail(args.name, args.email, function(err, data){
if(err) {
console.error(err)
cli.action.stop('Error')
}
else if(data){
cli.action.stop()
}
else {
console.error('Your email hasnt been confirmed yet.')
cli.action.stop('Error')
}
})
}
else {
console.error('you must either create or validate the template')
async run() {
const {flags} = this.parse(AuthorizationsCreate)
cli.action.start('Creating OAuth Authorization')
const {body: auth} = await this.heroku.post('/oauth/authorizations', {
body: {
description: flags.description,
scope: flags.scope ? flags.scope.split(',') : undefined,
expires_in: flags['expires-in'],
},
})
cli.action.stop()
if (flags.short) {
cli.log(auth.access_token && auth.access_token.token)
} else if (flags.json) {
cli.styledJSON(auth)
} else {
display(auth)
}
}
}
const client = this.gqlClient(flags)
const key = args.key
cli.action.start("unsetting secret")
const resp = await client.mutate({
query: MUTATION,
variables: {
input: {
appId: appName,
keys: [key]
}
}
})
cli.action.stop()
}
}
const resp = await client.mutate({
query: MUTATION,
variables: {
input: {
appId: appName,
secrets: [
{
key,
value
}
]
}
}
})
cli.action.stop()
}
}
if (!url) {
throw new CLIError('endpoint is required: \'json2graphql -d ./db.js\'');
}
const safeUrl = this.getSafeUrl(url);
if (!db) {
throw new CLIError('path to sample database is required: \'json2graphql -d ./db.js\'');
}
const dbJson = await this.getDbJson(db);
const headers = {
[secret ? 'x-hasura-admin-secret' : 'x-hasura-access-key']: secret || key,
};
const urlVerification = await this.verifyUrl(safeUrl, headers);
if (urlVerification.error) {
throw new CLIError(urlVerification.message);
} else {
cli.action.stop('Done!');
await importData(dbJson, safeUrl, headers, overwrite);
}
}
const queryErrorCb = (ctx, queryError, queryType) => {
cli.action.stop('error');
if (!queryType) {
handleGraphQLError(queryError);
} else if (queryType === 'subscription') {
if (queryError.originalError) {
const {code, path, error} = queryError.originalError;
handleServerError(`[${code}] at [${path}]: ${error}`);
}
} else {
handleServerError(queryError);
}
};
async run() {
const {args} = this.parse(ClientsDestroy)
cli.action.start(`Destroying ${color.cyan(args.id)}`)
await this.heroku.delete(
`/oauth/clients/${args.id}`,
)
cli.action.stop()
}
}
const org: any = await inquirer.prompt([
{
name: "slug",
message: "select an organization",
type: "list",
choices
}
])
const orgSlug = (org && org.slug) || ""
if (!orgSlug) {
throw new Error("no organization selected")
}
cli.action.start(`Moving app '${appName}' to organization '${orgSlug}'`)
const resUpdate = await API.patch(`/api/v1/apps/${appName}`, {
data: {
attributes: {
org_slug: orgSlug
}
}
})
processResponse(this, resUpdate, () => {
cli.action.stop()
})
})
}
protected readMetadata = () => {
const { args } = this.parse(this.self)
const filePath = args.file
try {
cli.action.start(`Read Metadata from ${filePath}`)
const data = IdentityMetadataWrapper.fromFile(filePath)
cli.action.stop()
return data
} catch (error) {
cli.action.stop(`Error: ${error}`)
throw error
}
}