@saltcorn/cli 0.7.3-beta.3 → 0.7.3-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -160
- package/npm-shrinkwrap.json +6396 -1169
- package/oclif.manifest.json +1 -1
- package/package.json +7 -6
- package/src/commands/build-app.js +102 -0
- package/src/commands/configuration-check-backups.js +104 -0
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.7.3-beta.3","commands":{"add-schema":{"id":"add-schema","description":"Add Saltcorn schema to existing database","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false}},"args":[]},"backup":{"id":"backup","description":"Backup the PostgreSQL database to a file with pg_dump or zip","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"output":{"name":"output","type":"option","char":"o","description":"output filename"},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"zip":{"name":"zip","type":"boolean","char":"z","description":"zip format","allowNo":false}},"args":[]},"configuration-check":{"id":"configuration-check","description":"Check configuration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"create-tenant":{"id":"create-tenant","description":"Create a tenant","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"email":{"name":"email","type":"option","char":"e","description":"Email of owner of tenant"},"description":{"name":"description","type":"option","char":"d","description":"Description of tenant"}},"args":[{"name":"tenant","description":"Tenant subdomain to create","required":true}]},"create-user":{"id":"create-user","description":"Create a new user","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"admin":{"name":"admin","type":"boolean","char":"a","description":"Admin user","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"email":{"name":"email","type":"option","char":"e","description":"email"},"role":{"name":"role","type":"option","char":"r","description":"role"},"password":{"name":"password","type":"option","char":"p","description":"password"}},"args":[]},"delete-tenants":{"id":"delete-tenants","description":"Delete inactive tenants","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"delete-user":{"id":"delete-user","description":"Delete user.\n\nCommand deletes the user specified by USER_EMAIL.\n\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"user_email","description":"User to delete","required":true}]},"fixtures":{"id":"fixtures","description":"Load fixtures for testing\n...\nThis manual step it is never required for users and rarely required for developers\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"reset":{"name":"reset","type":"boolean","char":"r","description":"Also reset schema","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"get-cfg":{"id":"get-cfg","description":"Get a configuration value. The value is printed to stdout as a JSON value","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"plugin":{"name":"plugin","type":"option","char":"p","description":"plugin"}},"args":[{"name":"key","description":"Configuration key","required":true}]},"info":{"id":"info","description":"Show paths\n...\nShow configuration and file store paths\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":["paths"],"flags":{"json":{"name":"json","type":"boolean","char":"j","description":"json format","allowNo":false}},"args":[]},"inspect":{"id":"inspect","description":"Inspect an entity's JSON representation, or list entities","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"type","description":"Entity type","required":true,"options":["view","page","trigger","table"]},{"name":"name","description":"Entity name. If not supplied, list all names"}]},"install-pack":{"id":"install-pack","description":"Install a pack","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"name":{"name":"name","type":"option","char":"n","description":"Pack name in store"},"file":{"name":"file","type":"option","char":"f","description":"File with pack JSON"}},"args":[]},"install-plugin":{"id":"install-plugin","description":"Install a plugin","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"name":{"name":"name","type":"option","char":"n","description":"Plugin name in store"},"directory":{"name":"directory","type":"option","char":"d","description":"Directory with local plugin"}},"args":[]},"list-tenants":{"id":"list-tenants","description":"List tenants in CSV format","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"localize-plugin":{"id":"localize-plugin","description":"Convert plugin to local plugin","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"plugin","description":"Current plugin name","required":true},{"name":"path","description":"Absolute path to local plugin","required":true}]},"make-migration":{"id":"make-migration","description":"Create a new blank Database structure migration file.\nThese migrations update database structure.\nYou should not normally need to run this\nunless you are a developer.\n","usage":"make-migration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"migrate":{"id":"migrate","description":"Run Database structure migrations\n...\nNOTE!\n- Please stop Saltcorn before run DB migrations.\n- Please make db backup before migration.\n- There are no way to rollback migration if you doesn't make backup.\n\nThis is not normally required as migrations will be run when the server starts.\nHowever, this command may be useful if you are running multiple application\nservers and need to control when the migrations are run.\n","usage":"saltcorn migrate","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"modify-user":{"id":"modify-user","description":"Modify (update) user.\n\nCommand changes the user specified by USER_EMAIL.\n\nYou can change the user group, password and email.\n\nNOTE that -a and -r role (--role=role) can give conflict.\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"admin":{"name":"admin","type":"boolean","char":"a","description":"make user be Admin","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"email":{"name":"email","type":"option","char":"e","description":"new email"},"role":{"name":"role","type":"option","char":"r","description":"new role (can conflict with -a option)"},"password":{"name":"password","type":"option","char":"p","description":"new password"},"imode":{"name":"imode","type":"boolean","char":"i","description":"interactive mode","allowNo":false}},"args":[{"name":"user_email","description":"User to modify","required":true}]},"plugins":{"id":"plugins","description":"List and upgrade plugins for tenants\n...\nExtra documentation goes here\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"examples":["plugins -v - verbose output of commands","plugins -u -d - dry-run for plugin update","plugins -u -f - force plugin update"],"flags":{"upgrade":{"name":"upgrade","type":"boolean","char":"u","description":"Upgrade","allowNo":false},"dryRun":{"name":"dryRun","type":"boolean","char":"d","description":"Upgrade dry-run","allowNo":false},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Force update","allowNo":false},"name":{"name":"name","type":"option","char":"n","description":"Plugin name"}},"args":[]},"release":{"id":"release","description":"Release a new saltcorn version","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"version","description":"New version number","required":true}]},"reset-schema":{"id":"reset-schema","description":"Reset the database\n...\nThis will delete all existing information\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"restore":{"id":"restore","description":"Restore a previously backed up database (zip or sqlc format)","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"file","description":"backup file to restore","required":true}]},"rm-tenant":{"id":"rm-tenant","description":"Remove a tenant.\nAttention! All tenant data will be lost!\nIt recommended to make backup of tenant before perform this command.\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant","required":true}},"args":[]},"run-benchmark":{"id":"run-benchmark","description":"Run benchmark","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"API Token for reporting results"},"benchmark":{"name":"benchmark","type":"option","char":"b","description":"Which benchmark to run"},"delay":{"name":"delay","type":"option","char":"d","description":"delay between runs (s)","default":30}},"args":[{"name":"baseurl","description":"Base URL","required":false}]},"run-tests":{"id":"run-tests","description":"Run test suites","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"coverage":{"name":"coverage","type":"boolean","char":"c","description":"Coverage","allowNo":false},"testFilter":{"name":"testFilter","type":"option","char":"t","description":"Filter tests by suite or test name"},"watch":{"name":"watch","type":"boolean","description":"Watch files for changes and rerun tests related to changed files.","allowNo":false},"watchAll":{"name":"watchAll","type":"boolean","description":"Watch files for changes and rerun all tests.","allowNo":false}},"args":[{"name":"package","description":"which package to run tests for"}]},"scheduler":{"id":"scheduler","description":"Run the Saltcorn scheduler","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false}},"args":[]},"serve":{"id":"serve","description":"Start the Saltcorn server","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"port","default":3000},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false},"watchReaper":{"name":"watchReaper","type":"boolean","char":"r","description":"Watch reaper","allowNo":false},"dev":{"name":"dev","type":"boolean","char":"d","description":"Run in dev mode and re-start on file changes","allowNo":false},"addschema":{"name":"addschema","type":"boolean","char":"a","description":"Add schema if missing","allowNo":false},"nomigrate":{"name":"nomigrate","type":"boolean","char":"n","description":"No migrations","allowNo":false},"noscheduler":{"name":"noscheduler","type":"boolean","char":"s","description":"No scheduler","allowNo":false}},"args":[]},"set-cfg":{"id":"set-cfg","description":"Set a configuration value. The supplied value (argument, or file stdin) will be parsed as JSON. If this fails, it is stored as a string.","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"plugin":{"name":"plugin","type":"option","char":"p","description":"plugin"},"file":{"name":"file","type":"option","char":"f","description":"file"},"stdin":{"name":"stdin","type":"boolean","char":"i","description":"read value from stdin","allowNo":false}},"args":[{"name":"key","description":"Configuration key","required":true},{"name":"value","description":"Configuration value (JSON or string)"}]},"setup-benchmark":{"id":"setup-benchmark","description":"Setup an instance for benchmarking","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"setup":{"id":"setup","description":"Set up a new system\n...\nThis will attempt to install or connect a database, and set up a\nconfiguration file\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"coverage":{"name":"coverage","type":"boolean","char":"c","description":"Coverage","allowNo":false}},"args":[]},"test-plugin":{"id":"test-plugin","description":"Test a plugin\n...\nExtra documentation goes here\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"path to plugin package","required":true}]},"transform-field":{"id":"transform-field","description":"transform an existing field by applying a calculated expression","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"expression","description":"expression to calculate field","required":true},{"name":"field","description":"field name","required":true},{"name":"table","description":"table name","required":true},{"name":"tenant","description":"tenant name","required":false}]}}}
|
|
1
|
+
{"version":"0.7.3-beta.6","commands":{"add-schema":{"id":"add-schema","description":"Add Saltcorn schema to existing database","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false}},"args":[]},"backup":{"id":"backup","description":"Backup the PostgreSQL database to a file with pg_dump or zip","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"output":{"name":"output","type":"option","char":"o","description":"output filename"},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"zip":{"name":"zip","type":"boolean","char":"z","description":"zip format","allowNo":false}},"args":[]},"build-app":{"id":"build-app","description":"build mobile app","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"platforms":{"name":"platforms","type":"option","char":"p","description":"Platforms to build for space separated list"},"entryPoint":{"name":"entryPoint","type":"option","char":"v","description":"Entry Point"},"localUserTables":{"name":"localUserTables","type":"option","char":"l","description":"user defined tables that should be replicated into the app"},"useDocker":{"name":"useDocker","type":"boolean","char":"d","description":"Use a docker container to build the app.","allowNo":false},"buildDirectory":{"name":"buildDirectory","type":"option","char":"b","description":"A directory where the app should be build"},"copyAppDirectory":{"name":"copyAppDirectory","type":"option","char":"c","description":"If set, the app file will be copied here"},"appFileName":{"name":"appFileName","type":"option","char":"a","description":"If set, the copied app will get this name"},"serverURL":{"name":"serverURL","type":"option","char":"s","description":"URL to a saltcorn server"}},"args":[]},"configuration-check-backups":{"id":"configuration-check-backups","description":"Check configuration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"files","description":"backup file to check. can be repeated, e.g. with *","required":true}]},"configuration-check":{"id":"configuration-check","description":"Check configuration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"create-tenant":{"id":"create-tenant","description":"Create a tenant","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"email":{"name":"email","type":"option","char":"e","description":"Email of owner of tenant"},"description":{"name":"description","type":"option","char":"d","description":"Description of tenant"}},"args":[{"name":"tenant","description":"Tenant subdomain to create","required":true}]},"create-user":{"id":"create-user","description":"Create a new user","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"admin":{"name":"admin","type":"boolean","char":"a","description":"Admin user","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"email":{"name":"email","type":"option","char":"e","description":"email"},"role":{"name":"role","type":"option","char":"r","description":"role"},"password":{"name":"password","type":"option","char":"p","description":"password"}},"args":[]},"delete-tenants":{"id":"delete-tenants","description":"Delete inactive tenants","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"delete-user":{"id":"delete-user","description":"Delete user.\n\nCommand deletes the user specified by USER_EMAIL.\n\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"user_email","description":"User to delete","required":true}]},"fixtures":{"id":"fixtures","description":"Load fixtures for testing\n...\nThis manual step it is never required for users and rarely required for developers\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"reset":{"name":"reset","type":"boolean","char":"r","description":"Also reset schema","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"get-cfg":{"id":"get-cfg","description":"Get a configuration value. The value is printed to stdout as a JSON value","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"plugin":{"name":"plugin","type":"option","char":"p","description":"plugin"}},"args":[{"name":"key","description":"Configuration key","required":true}]},"info":{"id":"info","description":"Show paths\n...\nShow configuration and file store paths\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":["paths"],"flags":{"json":{"name":"json","type":"boolean","char":"j","description":"json format","allowNo":false}},"args":[]},"inspect":{"id":"inspect","description":"Inspect an entity's JSON representation, or list entities","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"type","description":"Entity type","required":true,"options":["view","page","trigger","table"]},{"name":"name","description":"Entity name. If not supplied, list all names"}]},"install-pack":{"id":"install-pack","description":"Install a pack","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"name":{"name":"name","type":"option","char":"n","description":"Pack name in store"},"file":{"name":"file","type":"option","char":"f","description":"File with pack JSON"}},"args":[]},"install-plugin":{"id":"install-plugin","description":"Install a plugin","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"name":{"name":"name","type":"option","char":"n","description":"Plugin name in store"},"directory":{"name":"directory","type":"option","char":"d","description":"Directory with local plugin"}},"args":[]},"list-tenants":{"id":"list-tenants","description":"List tenants in CSV format","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"localize-plugin":{"id":"localize-plugin","description":"Convert plugin to local plugin","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"plugin","description":"Current plugin name","required":true},{"name":"path","description":"Absolute path to local plugin","required":true}]},"make-migration":{"id":"make-migration","description":"Create a new blank Database structure migration file.\nThese migrations update database structure.\nYou should not normally need to run this\nunless you are a developer.\n","usage":"make-migration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"migrate":{"id":"migrate","description":"Run Database structure migrations\n...\nNOTE!\n- Please stop Saltcorn before run DB migrations.\n- Please make db backup before migration.\n- There are no way to rollback migration if you doesn't make backup.\n\nThis is not normally required as migrations will be run when the server starts.\nHowever, this command may be useful if you are running multiple application\nservers and need to control when the migrations are run.\n","usage":"saltcorn migrate","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"modify-user":{"id":"modify-user","description":"Modify (update) user.\n\nCommand changes the user specified by USER_EMAIL.\n\nYou can change the user group, password and email.\n\nNOTE that -a and -r role (--role=role) can give conflict.\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"admin":{"name":"admin","type":"boolean","char":"a","description":"make user be Admin","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"email":{"name":"email","type":"option","char":"e","description":"new email"},"role":{"name":"role","type":"option","char":"r","description":"new role (can conflict with -a option)"},"password":{"name":"password","type":"option","char":"p","description":"new password"},"imode":{"name":"imode","type":"boolean","char":"i","description":"interactive mode","allowNo":false}},"args":[{"name":"user_email","description":"User to modify","required":true}]},"plugins":{"id":"plugins","description":"List and upgrade plugins for tenants\n...\nExtra documentation goes here\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"examples":["plugins -v - verbose output of commands","plugins -u -d - dry-run for plugin update","plugins -u -f - force plugin update"],"flags":{"upgrade":{"name":"upgrade","type":"boolean","char":"u","description":"Upgrade","allowNo":false},"dryRun":{"name":"dryRun","type":"boolean","char":"d","description":"Upgrade dry-run","allowNo":false},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Force update","allowNo":false},"name":{"name":"name","type":"option","char":"n","description":"Plugin name"}},"args":[]},"release":{"id":"release","description":"Release a new saltcorn version","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"version","description":"New version number","required":true}]},"reset-schema":{"id":"reset-schema","description":"Reset the database\n...\nThis will delete all existing information\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"restore":{"id":"restore","description":"Restore a previously backed up database (zip or sqlc format)","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"file","description":"backup file to restore","required":true}]},"rm-tenant":{"id":"rm-tenant","description":"Remove a tenant.\nAttention! All tenant data will be lost!\nIt recommended to make backup of tenant before perform this command.\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant","required":true}},"args":[]},"run-benchmark":{"id":"run-benchmark","description":"Run benchmark","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"API Token for reporting results"},"benchmark":{"name":"benchmark","type":"option","char":"b","description":"Which benchmark to run"},"delay":{"name":"delay","type":"option","char":"d","description":"delay between runs (s)","default":30}},"args":[{"name":"baseurl","description":"Base URL","required":false}]},"run-tests":{"id":"run-tests","description":"Run test suites","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"coverage":{"name":"coverage","type":"boolean","char":"c","description":"Coverage","allowNo":false},"testFilter":{"name":"testFilter","type":"option","char":"t","description":"Filter tests by suite or test name"},"watch":{"name":"watch","type":"boolean","description":"Watch files for changes and rerun tests related to changed files.","allowNo":false},"watchAll":{"name":"watchAll","type":"boolean","description":"Watch files for changes and rerun all tests.","allowNo":false}},"args":[{"name":"package","description":"which package to run tests for"}]},"scheduler":{"id":"scheduler","description":"Run the Saltcorn scheduler","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false}},"args":[]},"serve":{"id":"serve","description":"Start the Saltcorn server","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"port","default":3000},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false},"watchReaper":{"name":"watchReaper","type":"boolean","char":"r","description":"Watch reaper","allowNo":false},"dev":{"name":"dev","type":"boolean","char":"d","description":"Run in dev mode and re-start on file changes","allowNo":false},"addschema":{"name":"addschema","type":"boolean","char":"a","description":"Add schema if missing","allowNo":false},"nomigrate":{"name":"nomigrate","type":"boolean","char":"n","description":"No migrations","allowNo":false},"noscheduler":{"name":"noscheduler","type":"boolean","char":"s","description":"No scheduler","allowNo":false}},"args":[]},"set-cfg":{"id":"set-cfg","description":"Set a configuration value. The supplied value (argument, or file stdin) will be parsed as JSON. If this fails, it is stored as a string.","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"plugin":{"name":"plugin","type":"option","char":"p","description":"plugin"},"file":{"name":"file","type":"option","char":"f","description":"file"},"stdin":{"name":"stdin","type":"boolean","char":"i","description":"read value from stdin","allowNo":false}},"args":[{"name":"key","description":"Configuration key","required":true},{"name":"value","description":"Configuration value (JSON or string)"}]},"setup-benchmark":{"id":"setup-benchmark","description":"Setup an instance for benchmarking","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"setup":{"id":"setup","description":"Set up a new system\n...\nThis will attempt to install or connect a database, and set up a\nconfiguration file\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"coverage":{"name":"coverage","type":"boolean","char":"c","description":"Coverage","allowNo":false}},"args":[]},"test-plugin":{"id":"test-plugin","description":"Test a plugin\n...\nExtra documentation goes here\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"path to plugin package","required":true}]},"transform-field":{"id":"transform-field","description":"transform an existing field by applying a calculated expression","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"expression","description":"expression to calculate field","required":true},{"name":"field","description":"field name","required":true},{"name":"table","description":"table name","required":true},{"name":"tenant","description":"tenant name","required":false}]}}}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@saltcorn/cli",
|
|
3
3
|
"description": "Command-line interface for Saltcorn, open-source no-code platform",
|
|
4
4
|
"homepage": "https://saltcorn.com",
|
|
5
|
-
"version": "0.7.3-beta.
|
|
5
|
+
"version": "0.7.3-beta.6",
|
|
6
6
|
"author": "Tom Nielsen @glutamate",
|
|
7
7
|
"bin": {
|
|
8
8
|
"saltcorn": "./bin/saltcorn"
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
"@oclif/config": "^1.18.3",
|
|
14
14
|
"@oclif/plugin-plugins": "^2.1.0",
|
|
15
15
|
"@oclif/plugin-help": "^3.3.1",
|
|
16
|
-
"@saltcorn/admin-models": "0.7.3-beta.
|
|
17
|
-
"@saltcorn/data": "0.7.3-beta.
|
|
18
|
-
"@saltcorn/
|
|
16
|
+
"@saltcorn/admin-models": "0.7.3-beta.6",
|
|
17
|
+
"@saltcorn/data": "0.7.3-beta.6",
|
|
18
|
+
"@saltcorn/mobile-app": "0.7.3-beta.6",
|
|
19
|
+
"@saltcorn/mobile-builder": "0.7.3-beta.6",
|
|
20
|
+
"@saltcorn/server": "0.7.3-beta.6",
|
|
19
21
|
"cli-ux": "^5.6.7",
|
|
20
22
|
"contractis": "^0.1.0",
|
|
21
23
|
"dateformat": "^3.0.3",
|
|
@@ -52,8 +54,7 @@
|
|
|
52
54
|
"commands": "./src/commands",
|
|
53
55
|
"bin": "saltcorn",
|
|
54
56
|
"plugins": [
|
|
55
|
-
"@oclif/plugin-help"
|
|
56
|
-
"@oclif/plugin-plugins"
|
|
57
|
+
"@oclif/plugin-help"
|
|
57
58
|
]
|
|
58
59
|
},
|
|
59
60
|
"repository": "github:saltcorn/saltcorn",
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const { Command, flags } = require("@oclif/command");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const Plugin = require("@saltcorn/data/models/plugin");
|
|
4
|
+
const { MobileBuilder } = require("@saltcorn/mobile-builder/mobile-builder");
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
class BuildAppCommand extends Command {
|
|
10
|
+
supportedPlatforms = ["android", "ios"];
|
|
11
|
+
staticPlugins = ["base", "sbadmin2"];
|
|
12
|
+
|
|
13
|
+
validateParameters(flags) {
|
|
14
|
+
if (!flags.buildDirectory) {
|
|
15
|
+
throw new Error("Please specify a build directory");
|
|
16
|
+
}
|
|
17
|
+
if (!flags.entryPoint) {
|
|
18
|
+
throw new Error("Please specify an entry point for the first view");
|
|
19
|
+
}
|
|
20
|
+
if (!flags.platforms) {
|
|
21
|
+
throw new Error("Please specify cordova platforms (android or iOS)");
|
|
22
|
+
}
|
|
23
|
+
for (const platform of flags.platforms)
|
|
24
|
+
if (!this.supportedPlatforms.includes(platform))
|
|
25
|
+
throw new Error(`The platform '${platform}' is not supported`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async run() {
|
|
29
|
+
const { flags } = await this.parse(BuildAppCommand);
|
|
30
|
+
this.validateParameters(flags);
|
|
31
|
+
const mobileAppDir = path.join(
|
|
32
|
+
require.resolve("@saltcorn/mobile-app"),
|
|
33
|
+
".."
|
|
34
|
+
);
|
|
35
|
+
const dynamicPlugins = (await Plugin.find()).filter(
|
|
36
|
+
(plugin) => !this.staticPlugins.includes(plugin.name)
|
|
37
|
+
);
|
|
38
|
+
const builder = new MobileBuilder({
|
|
39
|
+
templateDir: mobileAppDir,
|
|
40
|
+
buildDir: flags.buildDirectory,
|
|
41
|
+
cliDir: path.join(__dirname, "../.."),
|
|
42
|
+
useDocker: flags.useDocker,
|
|
43
|
+
platforms: flags.platforms,
|
|
44
|
+
localUserTables: flags.localUserTables,
|
|
45
|
+
entryPoint: flags.entryPoint,
|
|
46
|
+
serverURL: flags.serverURL,
|
|
47
|
+
plugins: dynamicPlugins,
|
|
48
|
+
copyTargetDir: flags.copyAppDirectory,
|
|
49
|
+
copyFileName: flags.appFileName,
|
|
50
|
+
});
|
|
51
|
+
process.exit(await builder.build());
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
BuildAppCommand.description = "build mobile app";
|
|
56
|
+
|
|
57
|
+
BuildAppCommand.flags = {
|
|
58
|
+
platforms: flags.string({
|
|
59
|
+
name: "platforms",
|
|
60
|
+
char: "p",
|
|
61
|
+
description: "Platforms to build for space separated list",
|
|
62
|
+
multiple: true,
|
|
63
|
+
}),
|
|
64
|
+
entryPoint: flags.string({
|
|
65
|
+
name: "entry point",
|
|
66
|
+
char: "v",
|
|
67
|
+
description: "Entry Point",
|
|
68
|
+
}),
|
|
69
|
+
localUserTables: flags.string({
|
|
70
|
+
name: "local user tables",
|
|
71
|
+
char: "l",
|
|
72
|
+
description: "user defined tables that should be replicated into the app",
|
|
73
|
+
multiple: true,
|
|
74
|
+
}),
|
|
75
|
+
useDocker: flags.boolean({
|
|
76
|
+
name: "use docker build container",
|
|
77
|
+
char: "d",
|
|
78
|
+
description: "Use a docker container to build the app.",
|
|
79
|
+
}),
|
|
80
|
+
buildDirectory: flags.string({
|
|
81
|
+
name: "build directory",
|
|
82
|
+
char: "b",
|
|
83
|
+
description: "A directory where the app should be build",
|
|
84
|
+
}),
|
|
85
|
+
copyAppDirectory: flags.string({
|
|
86
|
+
name: "app target-directory",
|
|
87
|
+
char: "c",
|
|
88
|
+
description: "If set, the app file will be copied here",
|
|
89
|
+
}),
|
|
90
|
+
appFileName: flags.string({
|
|
91
|
+
name: "app file name",
|
|
92
|
+
char: "a",
|
|
93
|
+
description: "If set, the copied app will get this name",
|
|
94
|
+
}),
|
|
95
|
+
serverURL: flags.string({
|
|
96
|
+
name: "server URL",
|
|
97
|
+
char: "s",
|
|
98
|
+
description: "URL to a saltcorn server",
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
module.exports = BuildAppCommand;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category saltcorn-cli
|
|
3
|
+
* @module commands/configuration-check-backups
|
|
4
|
+
*/
|
|
5
|
+
const { Command, flags } = require("@oclif/command");
|
|
6
|
+
const { cli } = require("cli-ux");
|
|
7
|
+
const { maybe_as_tenant, init_some_tenants } = require("../common");
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* ConfigurationCheckBackupsCommand Class
|
|
11
|
+
* @extends oclif.Command
|
|
12
|
+
* @category saltcorn-cli
|
|
13
|
+
*/
|
|
14
|
+
class ConfigurationCheckBackupsCommand extends Command {
|
|
15
|
+
static strict = false;
|
|
16
|
+
/**
|
|
17
|
+
* @returns {Promise<void>}
|
|
18
|
+
*/
|
|
19
|
+
async run() {
|
|
20
|
+
const { argv } = this.parse(ConfigurationCheckBackupsCommand);
|
|
21
|
+
//await init_some_tenants(flags.tenant);
|
|
22
|
+
const {
|
|
23
|
+
runConfigurationCheck,
|
|
24
|
+
} = require("@saltcorn/admin-models/models/config-check");
|
|
25
|
+
const { mockReqRes } = require("@saltcorn/data/tests/mocks");
|
|
26
|
+
const db = require("@saltcorn/data/db");
|
|
27
|
+
const {
|
|
28
|
+
insertTenant,
|
|
29
|
+
switchToTenant,
|
|
30
|
+
deleteTenant,
|
|
31
|
+
} = require("@saltcorn/admin-models/models/tenant");
|
|
32
|
+
|
|
33
|
+
if (!db.is_it_multi_tenant()) {
|
|
34
|
+
console.error("Multitenancy not enabled");
|
|
35
|
+
this.exit(0);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
//db.set_sql_logging(true);
|
|
39
|
+
|
|
40
|
+
const ten = "cfgcheckbackuptenannt";
|
|
41
|
+
await deleteTenant(ten);
|
|
42
|
+
const { loadAllPlugins } = require("@saltcorn/server/load_plugins");
|
|
43
|
+
const { init_multi_tenant } = require("@saltcorn/data/db/state");
|
|
44
|
+
await loadAllPlugins();
|
|
45
|
+
for (const file of argv) {
|
|
46
|
+
let hasError = false;
|
|
47
|
+
if (file.endsWith(".zip")) {
|
|
48
|
+
console.log(file);
|
|
49
|
+
//create tenant, reset schema
|
|
50
|
+
await switchToTenant(await insertTenant(ten, "", ""), "");
|
|
51
|
+
await init_multi_tenant(loadAllPlugins, undefined, [ten]);
|
|
52
|
+
|
|
53
|
+
await db.runWithTenant(ten, async () => {
|
|
54
|
+
//restore
|
|
55
|
+
const { restore } = require("@saltcorn/admin-models/models/backup");
|
|
56
|
+
await loadAllPlugins();
|
|
57
|
+
|
|
58
|
+
const load_plugins = require("@saltcorn/server/load_plugins");
|
|
59
|
+
const savePlugin = (p) => load_plugins.loadAndSaveNewPlugin(p);
|
|
60
|
+
const err = await restore(file, savePlugin, true);
|
|
61
|
+
if (err) {
|
|
62
|
+
console.error("Error on restoring backup: " + file);
|
|
63
|
+
console.error(err);
|
|
64
|
+
hasError = true;
|
|
65
|
+
} else {
|
|
66
|
+
const { passes, errors, pass } = await runConfigurationCheck(
|
|
67
|
+
mockReqRes.req
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
if (!pass) {
|
|
71
|
+
console.error("Configuration error in backup file: " + file);
|
|
72
|
+
|
|
73
|
+
errors.forEach((s) => console.error(s + "\n"));
|
|
74
|
+
console.error(`FAIL - ${errors.length} checks failed`);
|
|
75
|
+
hasError = true;
|
|
76
|
+
} else console.log("Pass");
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
await deleteTenant(ten);
|
|
80
|
+
if (hasError) this.exit(1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this.exit(0);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @type {string}
|
|
90
|
+
*/
|
|
91
|
+
ConfigurationCheckBackupsCommand.description = `Check configuration`;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @type {object}
|
|
95
|
+
*/
|
|
96
|
+
ConfigurationCheckBackupsCommand.args = [
|
|
97
|
+
{
|
|
98
|
+
name: "files",
|
|
99
|
+
required: true,
|
|
100
|
+
description: "backup file to check. can be repeated, e.g. with *",
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
module.exports = ConfigurationCheckBackupsCommand;
|