Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logger.info(response ? 'The resource was deleted successfully' : 'Failed to delete the resource');
return;
}
this.output(response, this.flags.properties);
}
}
TwilioApiCommand.flags = Object.assign(
{
'skip-parameter-validation': flags.boolean({
default: false,
hidden: true
})
},
TwilioClientCommand.flags
);
// A static function to help us add the other static
// fields required by oclif on our dynamically created
// command class.
TwilioApiCommand.setUpNewCommandClass = NewCommandClass => {
const resource = NewCommandClass.actionDefinition.resource;
const action = NewCommandClass.actionDefinition.action;
const commandId = NewCommandClass.actionDefinition.topicName + ':' + NewCommandClass.actionDefinition.commandName;
// Parameters
let cmdFlags = {};
(action.parameters || []).forEach(param => {
const flagConfig = getFlagConfig(param, NewCommandClass.actionDefinition);
const flagType = typeMap[param.schema.type];
ProfilesCreate.description = 'create a new profile to store Twilio Project credentials and configuration';
ProfilesCreate.flags = Object.assign(
{
'auth-token': flags.string({
description: 'Your Twilio Auth Token for your Twilio Project.'
}),
force: flags.boolean({
char: 'f',
description: 'Force overwriting existing profile credentials.'
}),
region: flags.string({
hidden: true
})
},
TwilioClientCommand.flags // Yes! We _do_ want the same flags as TwilioClientCommand
);
ProfilesCreate.args = [
{
name: 'account-sid',
description: 'The Account SID for your Twilio Project.'
}
];
module.exports = ProfilesCreate;
'voice-fallback-url': flags.string({
description:
'A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by VoiceUrl.'
}),
'voice-fallback-method': flags.enum({
options: ['GET', 'POST'],
description: 'The HTTP method Twilio will use when requesting the VoiceFallbackUrl.'
})
};
NumberUpdate.UrlFlags = ['smsUrl', 'smsFallbackUrl', 'voiceUrl', 'voiceFallbackUrl'];
NumberUpdate.flags = Object.assign(
{},
NumberUpdate.PropertyFlags,
TwilioClientCommand.flags,
TwilioClientCommand.accountSidFlag
);
NumberUpdate.args = [
{
name: 'phone-number',
required: true,
description: 'The SID or E.164 formatted phone number you wish to update.'
}
];
module.exports = NumberUpdate;
let { flags, args } = this.parse(FunctionsDeploy);
flags = normalizeFlags(flags);
const externalOptions = createExternalCliOptions(flags, this.twilioClient);
const opts = Object.assign({}, flags, args);
return handler(opts, externalOptions);
}
}
FunctionsDeploy.description = describe;
FunctionsDeploy.flags = Object.assign(
convertYargsOptionsToOclifFlags(cliInfo.options),
{ profile: TwilioClientCommand.flags.profile }
);
module.exports = FunctionsDeploy;
}
FunctionsInit.description = describe;
FunctionsInit.args = [
{
name: 'name',
required: true,
description: 'Name of Serverless project and directory that will be created',
},
];
FunctionsInit.flags = Object.assign(
{},
convertYargsOptionsToOclifFlags(cliInfo.options),
{ profile: TwilioClientCommand.flags.profile }
);
module.exports = FunctionsInit;
FunctionsList.description = describe;
FunctionsList.args = [
{
name: 'types',
required: false,
default: cliInfo.argsDefaults.types,
description:
'Comma separated list of things to list (services,environments,functions,assets,variables)',
},
];
FunctionsList.flags = Object.assign(
convertYargsOptionsToOclifFlags(cliInfo.options),
{ profile: TwilioClientCommand.flags.profile }
);
module.exports = FunctionsList;
message: 'Would you like to attempt to delete the API Key?',
default: false
}]);
return confirm.affirmative;
}
}
ProfilesRemove.description = 'select which profile to remove';
ProfilesRemove.args = [
{
name: 'profile',
description: 'Shorthand identifier for your profile',
required: true
}
];
ProfilesRemove.flags = TwilioClientCommand.flags;
module.exports = ProfilesRemove;
let { flags, args } = this.parse(FunctionsActivate);
flags = normalizeFlags(flags);
const externalOptions = createExternalCliOptions(flags, this.twilioClient);
const opts = Object.assign({}, flags, args);
return handler(opts, externalOptions);
}
}
FunctionsActivate.description = describe;
FunctionsActivate.flags = Object.assign(
{},
convertYargsOptionsToOclifFlags(cliInfo.options),
{ profile: TwilioClientCommand.flags.profile }
);
module.exports = FunctionsActivate;
const fullData = await this.twilioClient.incomingPhoneNumbers.list();
this.output(fullData, this.flags.properties);
}
}
NumberList.description = 'show what Twilio phone numbers you have configured';
NumberList.flags = Object.assign(
{
properties: flags.string({
default: 'sid, phoneNumber, friendlyName',
description:
'The incomingPhoneNumber object properties you would like to display (JSON output always shows all properties).'
})
},
TwilioClientCommand.flags,
TwilioClientCommand.accountSidFlag
);
module.exports = NumberList;