Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{'max request size (mb)': result.maxRequestSize / 1000000},
{'total request size (mb)': result.totalRequestSize / 1000000},
{'total objects (not counting nested)': result.totalObjects}
);
console.info(` >> Backup complete: ${backup.path}`);
console.info(tableComplete.toString() + '\n\n');
// Update aggregate sizes
maxRequestSize = Math.max(maxRequestSize, result.maxRequestSize);
totalRequestSize += result.totalRequestSize;
totalObjects += result.totalObjects;
totalDuration += (t2 - t1) / 1000;
}
const table = new Table();
table.push(
{'total duration (sec)': totalDuration },
{'max request size (mb)': maxRequestSize / 1000000 },
{'total request size (mb)': totalRequestSize / 1000000 },
{ 'total objects (not counting nested)': totalObjects }
);
console.info(' >> Backup complete: all collections');
console.info(table.toString());
}
printModules() {
const modulesTable = new Table({
head: ['Modules'],
});
this.manager.on('module:loaded', module => {
modulesTable.push([module.name]);
});
this.manager.once('after:setup', () => {
console.log(modulesTable.toString());
});
}
title('Stack Resources');
console.log(table.toString());
}
if (!shell) {
log('');
}
const outputValues = Object.values(outputs);
const sortedOutputs = sortBy(outputValues, ['OutputKey']);
if (shell) {
sortedOutputs.forEach(({ OutputKey, OutputValue }) => {
process.stdout.write(`${OutputKey}=${OutputValue}\n`);
});
} else {
const table = new Table({ head: ['OutputKey', 'OutputValue'] });
table.push(
...sortedOutputs.map(({ OutputKey, OutputValue }) => [
OutputKey,
OutputValue
])
);
title('Stack Outputs');
log(
'Please do not copy-paste any OutputValue into your functions. These values are available from the params.stageVariables. in every lambda function.'.yellow.dim
);
console.log(table.toString());
}
})
.catch(err => error('Command error', err));
.then(describeResult => {
const failedEvents = describeResult.StackEvents
.filter(e => e.Timestamp >= startTimestamp)
.filter(e => e.ResourceStatus.includes('FAILED'))
.map(e => [
moment(e.Timestamp).fromNow(),
e.ResourceStatus || '',
e.ResourceStatusReason || '',
e.LogicalResourceId || ''
]);
const table = new Table({
head: ['Timestamp', 'Status', 'Reason', 'Logical Id']
});
table.push(...failedEvents);
if (describeResult.StackEvents[0]) {
error();
}
done(createError({
kind: 'Stack update failed',
reason: 'The stack update has failed because of an error',
detailedReason: (
table.toString() +
'\n' +
chalk.gray(
oneLineTrim`
You may further inspect stack events from the console at this link:
https://${AWS_REGION}.console.aws.amazon.com/cloudformation/home
function displayPackages(packages) {
const table = new Table({
head: ['App', 'Latest Version'],
})
packages.forEach(aPackage => {
const row = [aPackage.name, aPackage.version]
table.push(row)
})
console.log('\n', table.toString())
}
const printPermissionlessApps = apps => {
if (apps && apps.length) {
const tableForPermissionlessApps = new Table({
head: ['Permissionless app', 'Proxy address'].map(x => white(x)),
})
apps.forEach(app =>
tableForPermissionlessApps.push([
printAppNameFromAppId(app.appId).replace('.aragonpm.eth', ''),
app.proxyAddress,
])
)
console.log(tableForPermissionlessApps.toString())
}
}
export async function logCompatibilityReportTable (report: Object) {
var table = new Table({
head: [
chalk.cyan('Name'),
chalk.cyan('Needed Version'),
chalk.cyan('Local Version')
],
colWidths: [40, 16, 15]
})
for (const compatibleEntry of report.compatible) {
table.push([
compatibleEntry.dependencyName,
chalk.green(compatibleEntry.remoteVersion ? compatibleEntry.remoteVersion : ''),
chalk.green(compatibleEntry.localVersion ? compatibleEntry.localVersion : '')
])
}
export function getRoutesTable(magnet) {
const table = new Table({
head: ['method', 'path', 'type', 'file'],
style: {
border: ['gray'],
compact: true,
head: ['gray'],
},
});
table.push(...getRoutesDefinition_(magnet));
if (table.length) {
return table.toString();
}
return '';
}
public addHorizontalTable (head: string[], data: Array[], options: any = {}): this {
const table = new Table({ head, ...options });
table.push(...data);
this.addData(table);
return this;
}
var formattedItems = _.reduce(items, (result, item) => {
var header = '\n ' + chalk.bold(item.get('numero')) + '\n ' + item.countryName() + ' via ' + item.service()
var table = new Table({
head: ['Data', 'Local', 'Situação']
})
item.events().forEach((event) => {
var data = moment(event.date()).format('lll')
var local = `${event.get('local')} - ${event.get('cidade')}/${event.get('uf')}`
var descricao = event.get('descricao')
var destino = event.get('destino')
if (destino) {
local += `\nEm trânsito para ${destino.local} - ${destino.cidade}/${destino.uf}`
}
table.push([data, local, descricao])
})