@saltcorn/cli 0.8.0-beta.3 → 0.8.0
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 +37 -35
- package/npm-shrinkwrap.json +256 -269
- package/oclif.manifest.json +1 -1
- package/package.json +6 -6
- package/src/commands/configuration-check.js +7 -3
- package/src/commands/create-tenant.js +10 -4
- package/src/commands/delete-user.js +29 -33
- package/src/commands/modify-user.js +28 -23
- package/src/commands/plugins.js +7 -5
- package/src/commands/release.js +6 -1
- package/src/commands/run-tests.js +4 -0
- package/src/commands/setup.js +2 -2
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.8.0-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":[]},"build-app":{"id":"build-app","description":"build mobile app","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenantAppName":{"name":"tenantAppName","type":"option","description":"Optional name of a tenant application, if set, the app will be build for this tenant"},"platforms":{"name":"platforms","type":"option","char":"p","description":"Platforms to build for, space separated list"},"entryPoint":{"name":"entryPoint","type":"option","char":"e","description":"This is the first view or page (see -t) after the login."},"entryPointType":{"name":"entryPointType","type":"option","char":"t","description":"Type of the entry point ('view' or 'page'). The default is 'view'."},"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"},"buildForEmulator":{"name":"buildForEmulator","type":"boolean","description":"build without '--device', generates no .ipa file so that iOS apps can be build without developer accounts","allowNo":false}},"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},"listTests":{"name":"listTests","type":"boolean","char":"l","description":"List tests","allowNo":false},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","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},"subdomain_offset":{"name":"subdomain_offset","type":"option","description":"Number of parts to remove to access subdomain in 'multi_tenant' mode"}},"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.8.0","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":{"tenantAppName":{"name":"tenantAppName","type":"option","description":"Optional name of a tenant application, if set, the app will be build for this tenant"},"platforms":{"name":"platforms","type":"option","char":"p","description":"Platforms to build for, space separated list"},"entryPoint":{"name":"entryPoint","type":"option","char":"e","description":"This is the first view or page (see -t) after the login."},"entryPointType":{"name":"entryPointType","type":"option","char":"t","description":"Type of the entry point ('view' or 'page'). The default is 'view'."},"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"},"buildForEmulator":{"name":"buildForEmulator","type":"boolean","description":"build without '--device', generates no .ipa file so that iOS apps can be build without developer accounts","allowNo":false}},"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":{"url":{"name":"url","type":"option","description":"Url of tenant"},"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},"listTests":{"name":"listTests","type":"boolean","char":"l","description":"List tests","allowNo":false},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false},"detectOpenHandles":{"name":"detectOpenHandles","type":"boolean","char":"d","description":"Detect Open Handles","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},"subdomain_offset":{"name":"subdomain_offset","type":"option","description":"Number of parts to remove to access subdomain in 'multi_tenant' mode"}},"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.8.0
|
|
5
|
+
"version": "0.8.0",
|
|
6
6
|
"author": "Tom Nielsen @glutamate",
|
|
7
7
|
"bin": {
|
|
8
8
|
"saltcorn": "./bin/saltcorn"
|
|
@@ -13,11 +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.8.0
|
|
17
|
-
"@saltcorn/data": "0.8.0
|
|
18
|
-
"@saltcorn/mobile-app": "0.8.0
|
|
19
|
-
"@saltcorn/mobile-builder": "0.8.0
|
|
20
|
-
"@saltcorn/server": "0.8.0
|
|
16
|
+
"@saltcorn/admin-models": "0.8.0",
|
|
17
|
+
"@saltcorn/data": "0.8.0",
|
|
18
|
+
"@saltcorn/mobile-app": "0.8.0",
|
|
19
|
+
"@saltcorn/mobile-builder": "0.8.0",
|
|
20
|
+
"@saltcorn/server": "0.8.0",
|
|
21
21
|
"cli-ux": "^5.6.7",
|
|
22
22
|
"contractis": "^0.1.0",
|
|
23
23
|
"dateformat": "^3.0.3",
|
|
@@ -25,17 +25,21 @@ class ConfigurationCheckCommand extends Command {
|
|
|
25
25
|
|
|
26
26
|
const that = this;
|
|
27
27
|
await maybe_as_tenant(flags.tenant, async () => {
|
|
28
|
-
const { passes, errors, pass } = await runConfigurationCheck(
|
|
28
|
+
const { passes, errors, pass, warnings } = await runConfigurationCheck(
|
|
29
29
|
mockReqRes.req
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
if (!pass) {
|
|
33
33
|
errors.forEach((s) => console.log(s + "\n"));
|
|
34
|
-
console.log(
|
|
34
|
+
warnings.forEach((s) => console.log("Warning: " + s + "\n"));
|
|
35
|
+
console.log(
|
|
36
|
+
`FAIL - ${errors.length} checks failed (${warnings.length} warnings)`
|
|
37
|
+
);
|
|
35
38
|
that.exit(1);
|
|
36
39
|
} else {
|
|
40
|
+
warnings.forEach((s) => console.log("Warning: " + s + "\n"));
|
|
37
41
|
passes.forEach((s) => console.log(s));
|
|
38
|
-
console.log(
|
|
42
|
+
console.log(`Success - all checks pass (${warnings.length} warnings)`);
|
|
39
43
|
}
|
|
40
44
|
});
|
|
41
45
|
this.exit(0);
|
|
@@ -13,7 +13,7 @@ const { Command, flags } = require("@oclif/command");
|
|
|
13
13
|
* @extends oclif.Command
|
|
14
14
|
* @category saltcorn-cli
|
|
15
15
|
*/
|
|
16
|
-
class CreateTenantCommand extends Command {
|
|
16
|
+
class CreateTenantCommand extends Command {
|
|
17
17
|
/**
|
|
18
18
|
* @returns {Promise<void>}
|
|
19
19
|
*/
|
|
@@ -26,13 +26,19 @@ class CreateTenantCommand extends Command {
|
|
|
26
26
|
this.exit(0);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
const {
|
|
29
|
+
const {
|
|
30
|
+
insertTenant,
|
|
31
|
+
switchToTenant,
|
|
32
|
+
} = require("@saltcorn/admin-models/models/tenant");
|
|
30
33
|
//const url = typeof flags.url !== `undefined`? flags.url : "";
|
|
31
34
|
//const email = typeof flags.email !== `undefined`? flags.email : "";
|
|
32
35
|
//const description = flags.description !== `undefined` ? flags.description : "";
|
|
33
36
|
// TODO Do we need to set default value for base url or not? And what is correct way to get domain of base_url here?
|
|
34
37
|
// const base = await db.getgetConfig("base_url");
|
|
35
|
-
await switchToTenant(
|
|
38
|
+
await switchToTenant(
|
|
39
|
+
await insertTenant(args.tenant, flags.email, flags.description),
|
|
40
|
+
flags.url
|
|
41
|
+
);
|
|
36
42
|
console.log();
|
|
37
43
|
this.exit(0);
|
|
38
44
|
}
|
|
@@ -54,7 +60,7 @@ CreateTenantCommand.description = `Create a tenant`;
|
|
|
54
60
|
* @type {object}
|
|
55
61
|
*/
|
|
56
62
|
CreateTenantCommand.flags = {
|
|
57
|
-
|
|
63
|
+
url: flags.string({
|
|
58
64
|
name: "url",
|
|
59
65
|
//char: "",
|
|
60
66
|
description: "Url of tenant",
|
|
@@ -8,7 +8,6 @@ const { Command, flags } = require("@oclif/command");
|
|
|
8
8
|
const { cli } = require("cli-ux");
|
|
9
9
|
const { maybe_as_tenant } = require("../common");
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
/**
|
|
13
12
|
* DeleteUserCommand Class
|
|
14
13
|
* @extends oclif.Command
|
|
@@ -19,49 +18,46 @@ class DeleteUserCommand extends Command {
|
|
|
19
18
|
* @returns {Promise<void>}
|
|
20
19
|
*/
|
|
21
20
|
async run() {
|
|
22
|
-
|
|
23
21
|
const User = require("@saltcorn/data/models/user");
|
|
24
22
|
|
|
25
23
|
const { args } = this.parse(DeleteUserCommand);
|
|
26
24
|
const { flags } = this.parse(DeleteUserCommand);
|
|
27
25
|
|
|
28
|
-
|
|
29
26
|
// run function as specified tenant
|
|
30
27
|
await maybe_as_tenant(flags.tenant, async () => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// make changes
|
|
43
|
-
// todo handle errors
|
|
44
|
-
if (!flags.force) {
|
|
45
|
-
const ans = await cli.confirm(
|
|
46
|
-
`This will delete user ${args.user_email} ${
|
|
47
|
-
typeof flags.tenant !== "undefined" ? "from " + flags.tenant : ""
|
|
48
|
-
}.\nContinue (y/n)?`);
|
|
49
|
-
if (!ans) {
|
|
50
|
-
console.log(`Success: Command execution canceled`);
|
|
51
|
-
this.exit(1);
|
|
52
|
-
}
|
|
28
|
+
// try to find user
|
|
29
|
+
const u = await User.findOne({ email: args.user_email });
|
|
30
|
+
if (u === null) {
|
|
31
|
+
console.error(`Error: User ${args.user_email} is not found`);
|
|
32
|
+
this.exit(1);
|
|
33
|
+
}
|
|
34
|
+
if (!(u instanceof User)) {
|
|
35
|
+
console.error(`Error: ${u.error}`);
|
|
36
|
+
this.exit(1);
|
|
37
|
+
}
|
|
53
38
|
|
|
39
|
+
// make changes
|
|
40
|
+
// todo handle errors
|
|
41
|
+
if (!flags.force) {
|
|
42
|
+
const ans = await cli.confirm(
|
|
43
|
+
`This will delete user ${args.user_email} ${
|
|
44
|
+
typeof flags.tenant !== "undefined" ? "from " + flags.tenant : ""
|
|
45
|
+
}.\nContinue (y/n)?`
|
|
46
|
+
);
|
|
47
|
+
if (!ans) {
|
|
48
|
+
console.log(`Success: Command execution canceled`);
|
|
49
|
+
this.exit(1);
|
|
54
50
|
}
|
|
55
|
-
|
|
56
|
-
// delete user
|
|
57
|
-
await u.delete();
|
|
58
|
-
console.log(`Success: User ${args.user_email} deleted ${
|
|
59
|
-
typeof flags.tenant !== "undefined" ? "from " + flags.tenant : ""
|
|
60
|
-
}`);
|
|
61
|
-
|
|
62
51
|
}
|
|
63
52
|
|
|
64
|
-
|
|
53
|
+
// delete user
|
|
54
|
+
await u.delete();
|
|
55
|
+
console.log(
|
|
56
|
+
`Success: User ${args.user_email} deleted ${
|
|
57
|
+
typeof flags.tenant !== "undefined" ? "from " + flags.tenant : ""
|
|
58
|
+
}`
|
|
59
|
+
);
|
|
60
|
+
});
|
|
65
61
|
this.exit(0);
|
|
66
62
|
}
|
|
67
63
|
}
|
|
@@ -8,7 +8,6 @@ const { Command, flags } = require("@oclif/command");
|
|
|
8
8
|
const { cli } = require("cli-ux");
|
|
9
9
|
const { maybe_as_tenant, init_some_tenants } = require("../common");
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
/**
|
|
13
12
|
* ModifyUserCommand Class
|
|
14
13
|
* @extends oclif.Command
|
|
@@ -19,7 +18,6 @@ class ModifyUserCommand extends Command {
|
|
|
19
18
|
* @returns {Promise<void>}
|
|
20
19
|
*/
|
|
21
20
|
async run() {
|
|
22
|
-
|
|
23
21
|
const User = require("@saltcorn/data/models/user");
|
|
24
22
|
|
|
25
23
|
const { args } = this.parse(ModifyUserCommand);
|
|
@@ -50,10 +48,13 @@ class ModifyUserCommand extends Command {
|
|
|
50
48
|
// email
|
|
51
49
|
let email;
|
|
52
50
|
if (flags.email) email = flags.email;
|
|
53
|
-
else if (flags.imode)
|
|
54
|
-
|
|
51
|
+
else if (flags.imode)
|
|
52
|
+
email = await cli.prompt("New Email address", {
|
|
53
|
+
default: args.user_email,
|
|
54
|
+
});
|
|
55
|
+
if (email === args.user_email) email = undefined; // little trick - we won't update email if it already same
|
|
55
56
|
if (email)
|
|
56
|
-
if (!User.valid_email(email)){
|
|
57
|
+
if (!User.valid_email(email)) {
|
|
57
58
|
console.error(`Error: Email is invalid`);
|
|
58
59
|
this.exit(1);
|
|
59
60
|
}
|
|
@@ -62,44 +63,48 @@ class ModifyUserCommand extends Command {
|
|
|
62
63
|
// todo check for repeated passwords
|
|
63
64
|
let password;
|
|
64
65
|
if (flags.password) password = flags.password;
|
|
65
|
-
else if (flags.imode)
|
|
66
|
+
else if (flags.imode)
|
|
67
|
+
password = await cli.prompt("New Password", { type: "hide" });
|
|
66
68
|
if (password)
|
|
67
|
-
if (User.unacceptable_password_reason(password)){
|
|
68
|
-
console.error(
|
|
69
|
+
if (User.unacceptable_password_reason(password)) {
|
|
70
|
+
console.error(
|
|
71
|
+
`Error: ${User.unacceptable_password_reason(password)}`
|
|
72
|
+
);
|
|
69
73
|
this.exit(1);
|
|
70
74
|
}
|
|
71
75
|
// check that user with new email does not exists
|
|
72
76
|
const u_new_email = await User.findOne({ email });
|
|
73
|
-
if(u_new_email !== null&&args.user_email!==email){
|
|
74
|
-
console.error(
|
|
77
|
+
if (u_new_email !== null && args.user_email !== email) {
|
|
78
|
+
console.error(
|
|
79
|
+
`Error: Cannot change email from ${args.user_email} to ${email}. User with email ${email} exists`
|
|
80
|
+
);
|
|
75
81
|
this.exit(1);
|
|
76
82
|
}
|
|
77
83
|
// try to find user
|
|
78
84
|
const u = await User.findOne({ email: args.user_email });
|
|
79
|
-
if(u === null){
|
|
85
|
+
if (u === null) {
|
|
80
86
|
console.error(`Error: User ${args.user_email} is not found`);
|
|
81
87
|
this.exit(1);
|
|
82
88
|
}
|
|
83
|
-
if(!u instanceof User){
|
|
89
|
+
if (!(u instanceof User)) {
|
|
84
90
|
console.error(`Error: ${u.error}`);
|
|
85
91
|
this.exit(1);
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
// make changes
|
|
89
|
-
if (email && role_id)
|
|
90
|
-
|
|
91
|
-
else if(
|
|
92
|
-
await u.update({ email });
|
|
93
|
-
else if(role_id)
|
|
94
|
-
await u.update({ role_id });
|
|
95
|
+
if (email && role_id) await u.update({ email, role_id });
|
|
96
|
+
else if (email) await u.update({ email });
|
|
97
|
+
else if (role_id) await u.update({ role_id });
|
|
95
98
|
|
|
96
|
-
if (password)
|
|
97
|
-
await u.changePasswordTo(password, false);
|
|
99
|
+
if (password) await u.changePasswordTo(password, false);
|
|
98
100
|
|
|
99
|
-
console.log(
|
|
101
|
+
console.log(
|
|
102
|
+
`Success: User ${
|
|
103
|
+
email ? email : args.user_email
|
|
104
|
+
} updated successfully ${
|
|
100
105
|
typeof flags.tenant !== "undefined" ? "in tenant " + flags.tenant : ""
|
|
101
|
-
}`
|
|
102
|
-
|
|
106
|
+
}`
|
|
107
|
+
);
|
|
103
108
|
});
|
|
104
109
|
this.exit(0);
|
|
105
110
|
}
|
package/src/commands/plugins.js
CHANGED
|
@@ -50,7 +50,7 @@ class PluginsCommand extends Command {
|
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
} catch (e) {
|
|
53
|
-
console.error("error: ", domain, e)
|
|
53
|
+
console.error("error: ", domain, e);
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
}
|
|
@@ -66,7 +66,6 @@ class PluginsCommand extends Command {
|
|
|
66
66
|
for (const domain of tenantList) {
|
|
67
67
|
await db.runWithTenant(domain, async () => {
|
|
68
68
|
try {
|
|
69
|
-
|
|
70
69
|
const myplugins = await Plugin.find({});
|
|
71
70
|
for (let plugin of myplugins) {
|
|
72
71
|
if (plugin.source === "npm" && new_versions[plugin.location]) {
|
|
@@ -75,10 +74,13 @@ class PluginsCommand extends Command {
|
|
|
75
74
|
!flags.force &&
|
|
76
75
|
plugin.version === new_versions[plugin.location]
|
|
77
76
|
) {
|
|
77
|
+
//do nothing
|
|
78
78
|
} else if (flags.dryRun) {
|
|
79
79
|
console.log(
|
|
80
|
-
`Would upgrade ${domain}'s plugin ${
|
|
81
|
-
|
|
80
|
+
`Would upgrade ${domain}'s plugin ${
|
|
81
|
+
plugin.location
|
|
82
|
+
} version from ${plugin.version} to ${
|
|
83
|
+
new_versions[plugin.location]
|
|
82
84
|
}`
|
|
83
85
|
);
|
|
84
86
|
} else {
|
|
@@ -92,7 +94,7 @@ class PluginsCommand extends Command {
|
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
} catch (e) {
|
|
95
|
-
console.error("error: ", domain, e)
|
|
97
|
+
console.error("error: ", domain, e);
|
|
96
98
|
}
|
|
97
99
|
});
|
|
98
100
|
}
|
package/src/commands/release.js
CHANGED
|
@@ -125,7 +125,12 @@ class ReleaseCommand extends Command {
|
|
|
125
125
|
const dockerfile = fs.readFileSync(`Dockerfile.release`, "utf8");
|
|
126
126
|
fs.writeFileSync(
|
|
127
127
|
`Dockerfile.release`,
|
|
128
|
-
dockerfile.replace(/cli
|
|
128
|
+
dockerfile.replace(/cli@.* --unsafe/, `cli@${version} --unsafe`)
|
|
129
|
+
);
|
|
130
|
+
const dockerfileWithMobile = fs.readFileSync(`Dockerfile.mobile.release`, "utf8");
|
|
131
|
+
fs.writeFileSync(
|
|
132
|
+
`Dockerfile.mobile.release`,
|
|
133
|
+
dockerfileWithMobile.replace(/cli@.* --unsafe/, `cli@${version} --unsafe`)
|
|
129
134
|
);
|
|
130
135
|
//git commit tag and push
|
|
131
136
|
spawnSync("git", ["commit", "-am", "v" + version], {
|
|
@@ -155,6 +155,9 @@ class RunTestsCommand extends Command {
|
|
|
155
155
|
if (flags.verbose) {
|
|
156
156
|
jestParams.push("--verbose");
|
|
157
157
|
}
|
|
158
|
+
if (flags.detectOpenHandles){
|
|
159
|
+
jestParams.push("--detectOpenHandles");
|
|
160
|
+
}
|
|
158
161
|
if (flags.testFilter) {
|
|
159
162
|
jestParams.push("-t", flags.testFilter);
|
|
160
163
|
}
|
|
@@ -206,6 +209,7 @@ RunTestsCommand.flags = {
|
|
|
206
209
|
coverage: flags.boolean({ char: "c", description: "Coverage" }),
|
|
207
210
|
listTests: flags.boolean({ char: "l", description: "List tests" }),
|
|
208
211
|
verbose: flags.boolean({ char: "v", description: "Verbose" }),
|
|
212
|
+
detectOpenHandles: flags.boolean({ char: "d", description: "Detect Open Handles"}),
|
|
209
213
|
testFilter: flags.string({
|
|
210
214
|
char: "t",
|
|
211
215
|
description: "Filter tests by suite or test name",
|
package/src/commands/setup.js
CHANGED
|
@@ -83,7 +83,7 @@ const unloadModule = (mod) => {
|
|
|
83
83
|
*/
|
|
84
84
|
const setupDevMode = async () => {
|
|
85
85
|
const dbPath = path.join(defaultDataPath, "scdb.sqlite");
|
|
86
|
-
fs.promises.mkdir(defaultDataPath, { recursive: true });
|
|
86
|
+
await fs.promises.mkdir(defaultDataPath, { recursive: true });
|
|
87
87
|
const session_secret = gen_password();
|
|
88
88
|
const jwt_secret = genJwtSecret();
|
|
89
89
|
await write_connection_config({
|
|
@@ -286,7 +286,7 @@ const setup_connection_config = async () => {
|
|
|
286
286
|
* @returns {Promise<void>}
|
|
287
287
|
*/
|
|
288
288
|
const write_connection_config = async (connobj) => {
|
|
289
|
-
fs.promises.mkdir(configFileDir, { recursive: true });
|
|
289
|
+
await fs.promises.mkdir(configFileDir, { recursive: true });
|
|
290
290
|
fs.writeFileSync(configFilePath, JSON.stringify(connobj), { mode: 0o600 });
|
|
291
291
|
};
|
|
292
292
|
|