UNPKG

@strapi/strapi

Version:

An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite

33 lines (29 loc) 935 B
'use strict'; var commander = require('commander'); var CLITable = require('cli-table3'); var chalk = require('chalk'); var core = require('@strapi/core'); var helpers = require('../../utils/helpers.js'); const action = async ()=>{ const appContext = await core.compileStrapi(); const app = await core.createStrapi(appContext).register(); const list = app.get('policies').keys(); const infoTable = new CLITable({ head: [ chalk.blue('Name') ] }); list.forEach((name)=>infoTable.push([ name ])); console.log(infoTable.toString()); await app.destroy(); }; /** * `$ strapi policies:list` */ const command = ()=>{ return commander.createCommand('policies:list').description('List all the application policies').action(helpers.runAction('policies:list', action)); }; exports.action = action; exports.command = command; //# sourceMappingURL=list.js.map