diff --git a/.circleci/config.yml b/.circleci/config.yml index 22f1e427..6d207e54 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,53 +13,53 @@ jobs: # Download and cache dependencies - restore_cache: keys: - - cache-{{ .Environment.cache }}-dependencies-{{ checksum "package.json" }} - - cache-{{ .Environment.cache }}-dependencies + - cache-v1-{{ .Environment.cache }}-dependencies-{{ checksum "package.json" }} + - cache-v1-{{ .Environment.cache }}-dependencies - restore_cache: keys: - - cache-{{ .Environment.cache }}-dependencies-cli-{{ checksum "packages/cli/package.json" }} - - cache-{{ .Environment.cache }}-dependencies-cli + - cache-v1-{{ .Environment.cache }}-dependencies-cli-{{ checksum "packages/cli/package.json" }} + - cache-v1-{{ .Environment.cache }}-dependencies-cli - restore_cache: keys: - - cache-{{ .Environment.cache }}-dependencies-core-{{ checksum "packages/lib-js-core/package.json" }} - - cache-{{ .Environment.cache }}-dependencies-core + - cache-v1-{{ .Environment.cache }}-dependencies-core-{{ checksum "packages/lib-js-core/package.json" }} + - cache-v1-{{ .Environment.cache }}-dependencies-core - restore_cache: keys: - - cache-{{ .Environment.cache }}-dependencies-client-{{ checksum "packages/lib-js-client/package.json" }} - - cache-{{ .Environment.cache }}-dependencies-client + - cache-v1-{{ .Environment.cache }}-dependencies-client-{{ checksum "packages/lib-js-client/package.json" }} + - cache-v1-{{ .Environment.cache }}-dependencies-client - restore_cache: keys: - - cache-{{ .Environment.cache }}-dependencies-validate-{{ checksum "packages/lib-js-validate/package.json" }} - - cache-{{ .Environment.cache }}-dependencies-validate + - cache-v1-{{ .Environment.cache }}-dependencies-validate-{{ checksum "packages/lib-js-validate/package.json" }} + - cache-v1-{{ .Environment.cache }}-dependencies-validate - restore_cache: keys: - - cache-{{ .Environment.cache }}-dependencies-test-{{ checksum "packages/lib-js-test/package.json" }} - - cache-{{ .Environment.cache }}-dependencies-test + - cache-v1-{{ .Environment.cache }}-dependencies-test-{{ checksum "packages/lib-js-test/package.json" }} + - cache-v1-{{ .Environment.cache }}-dependencies-test - restore_cache: keys: - - cache-{{ .Environment.cache }}-dependencies-template-project-empty-{{ checksum "packages/template-project-empty/package.json" }} - - cache-{{ .Environment.cache }}-dependencies-template-project-empty + - cache-v1-{{ .Environment.cache }}-dependencies-template-project-empty-{{ checksum "packages/template-project-empty/package.json" }} + - cache-v1-{{ .Environment.cache }}-dependencies-template-project-empty - restore_cache: keys: - - cache-{{ .Environment.cache }}-dependencies-template-project-hello-{{ checksum "packages/template-project-hello/package.json" }} - - cache-{{ .Environment.cache }}-dependencies-template-project-hello + - cache-v1-{{ .Environment.cache }}-dependencies-template-project-hello-{{ checksum "packages/template-project-hello/package.json" }} + - cache-v1-{{ .Environment.cache }}-dependencies-template-project-hello - restore_cache: keys: - - cache-{{ .Environment.cache }}-dependencies-template-socket-es6-{{ checksum "packages/template-socket-es6/package.json" }} - - cache-{{ .Environment.cache }}-dependencies-template-socket-es6 + - cache-v1-{{ .Environment.cache }}-dependencies-template-socket-es6-{{ checksum "packages/template-socket-es6/package.json" }} + - cache-v1-{{ .Environment.cache }}-dependencies-template-socket-es6 - restore_cache: keys: - - cache-{{ .Environment.cache }}-dependencies-test-tools-{{ checksum "packages/test-tools/package.json" }} - - cache-{{ .Environment.cache }}-dependencies-test-tools + - cache-v1-{{ .Environment.cache }}-dependencies-test-tools-{{ checksum "packages/test-tools/package.json" }} + - cache-v1-{{ .Environment.cache }}-dependencies-test-tools - run: npm install - run: npm run bootstrap @@ -73,55 +73,55 @@ jobs: - save_cache: paths: - node_modules - key: cache-{{ .Environment.cache }}-dependencies-{{ checksum "package.json" }} + key: cache-v1-{{ .Environment.cache }}-dependencies-{{ checksum "package.json" }} - save_cache: paths: - packages/cli/node_modules - key: cache-{{ .Environment.cache }}-dependencies-cli-{{ checksum "packages/cli/package.json" }} + key: cache-v1-{{ .Environment.cache }}-dependencies-cli-{{ checksum "packages/cli/package.json" }} - save_cache: paths: - packages/lib-js-core/node_modules - key: cache-{{ .Environment.cache }}-dependencies-core-{{ checksum "packages/lib-js-core/package.json" }} + key: cache-v1-{{ .Environment.cache }}-dependencies-core-{{ checksum "packages/lib-js-core/package.json" }} - save_cache: paths: - packages/lib-js-client/node_modules - key: cache-{{ .Environment.cache }}-dependencies-client-{{ checksum "packages/lib-js-client/package.json" }} + key: cache-v1-{{ .Environment.cache }}-dependencies-client-{{ checksum "packages/lib-js-client/package.json" }} - save_cache: paths: - packages/lib-js-validate/node_modules - key: cache-{{ .Environment.cache }}-dependencies-validate-{{ checksum "packages/lib-js-validate/package.json" }} + key: cache-v1-{{ .Environment.cache }}-dependencies-validate-{{ checksum "packages/lib-js-validate/package.json" }} - save_cache: paths: - packages/lib-js-test/node_modules - key: cache-{{ .Environment.cache }}-dependencies-test-{{ checksum "packages/lib-js-test/package.json" }} + key: cache-v1-{{ .Environment.cache }}-dependencies-test-{{ checksum "packages/lib-js-test/package.json" }} - save_cache: paths: - packages/template-project-empty/node_modules - key: cache-{{ .Environment.cache }}-dependencies-template-project-empty-{{ checksum "packages/template-project-empty/package.json" }} + key: cache-v1-{{ .Environment.cache }}-dependencies-template-project-empty-{{ checksum "packages/template-project-empty/package.json" }} - save_cache: paths: - packages/template-project-hello/node_modules - key: cache-{{ .Environment.cache }}-dependencies-template-project-hello-{{ checksum "packages/template-project-hello/package.json" }} + key: cache-v1-{{ .Environment.cache }}-dependencies-template-project-hello-{{ checksum "packages/template-project-hello/package.json" }} - save_cache: paths: - packages/template-socket-es6/node_modules - key: cache-{{ .Environment.cache }}-dependencies-template-socket-es6-{{ checksum "packages/template-socket-es6/package.json" }} + key: cache-v1-{{ .Environment.cache }}-dependencies-template-socket-es6-{{ checksum "packages/template-socket-es6/package.json" }} - save_cache: paths: - packages/test-tools/node_modules - key: cache-{{ .Environment.cache }}-dependencies-test-tools-{{ checksum "packages/test-tools/package.json" }} + key: cache-v1-{{ .Environment.cache }}-dependencies-test-tools-{{ checksum "packages/test-tools/package.json" }} - save_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} paths: - ~/repo @@ -134,7 +134,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:unit - run: npm run report:coverage @@ -147,7 +147,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:e2e:validate test_e2e_core: @@ -159,7 +159,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:e2e:core test_e2e_client: @@ -171,7 +171,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:e2e:client test_e2e_hosting: @@ -183,7 +183,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:e2e:cli:hosting # test_e2e_init: @@ -195,7 +195,7 @@ jobs: # # steps: # - restore_cache: - # key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + # key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} # - run: npm run test:e2e:cli:init test_e2e_socket: @@ -207,7 +207,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:e2e:cli:socket test_e2e_anonymous: @@ -219,7 +219,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:e2e:cli:anonymous test_e2e_instance: @@ -231,7 +231,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:e2e:cli:instance test_e2e_deploy: @@ -243,7 +243,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:e2e:cli:deploy test_e2e_config: @@ -255,7 +255,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:e2e:cli:config test_e2e_schema: @@ -267,7 +267,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run test:e2e:schema test_e2e_commands: @@ -279,8 +279,9 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - - run: npm run test:commands + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + - deploy: + command: npm run test:commands test_lint: name: Linter @@ -291,7 +292,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npm run lint deploy_docs: @@ -303,7 +304,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: echo 'export SYNCANO_HOST=${PRODUCTION_SYNCANO_HOST}' >> $BASH_ENV - run: echo 'export SYNCANO_AUTH_KEY=${PRODUCTION_SYNCANO_AUTH_KEY}' >> $BASH_ENV - run: echo 'export SYNCANO_PROJECT_INSTANCE=syncano-docs-${CIRCLE_BRANCH}' >> $BASH_ENV @@ -324,7 +325,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-{{ .Environment.CIRCLE_SHA1 }} - run: npx npm-cli-login -u $NPM_USER -p $NPM_PASS -e $NPM_EMAIL -s syncano - run: npm run changelog - run: npx lerna publish --canary --yes @@ -338,7 +339,7 @@ jobs: steps: - restore_cache: - key: cache-{{ .Environment.cache }}-repo-units-{{ .Environment.CIRCLE_SHA1 }} + key: cache-v1-{{ .Environment.cache }}-repo-units-{{ .Environment.CIRCLE_SHA1 }} - run: npm run report:coverage workflows: diff --git a/packages/cli/oclif.manifest.json b/packages/cli/oclif.manifest.json index cc33c54e..898b21f5 100644 --- a/packages/cli/oclif.manifest.json +++ b/packages/cli/oclif.manifest.json @@ -1 +1 @@ -{"version":"0.15.0","commands":{"attach":{"id":"attach","description":"Info about current project/instance/user etc.","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"create-instance":{"name":"create-instance","type":"option","char":"c","description":"create instance"},"instance":{"name":"instance","type":"option","char":"n","description":"attach to instance"}},"args":[]},"backup:create":{"id":"backup:create","description":"Create backup","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"backup:delete":{"id":"backup:delete","description":"Delete backup","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"all":{"name":"all","type":"boolean","allowNo":false}},"args":[{"name":"id","description":"Backup ID."}]},"backup:last":{"id":"backup:last","description":"List last backup","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"backup:list":{"id":"backup:list","description":"List backups","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"hosting:add":{"id":"hosting:add","description":"Add hosting","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"name":{"name":"name","type":"option"},"browser-router-on":{"name":"browser-router-on","type":"boolean","allowNo":false},"browser-router-off":{"name":"browser-router-off","type":"boolean","allowNo":false},"dont-sync":{"name":"dont-sync","type":"boolean","allowNo":false},"sync":{"name":"sync","type":"boolean","allowNo":false},"without-cname":{"name":"without-cname","type":"boolean","allowNo":false},"cname":{"name":"cname","type":"option"}},"args":[{"name":"folder","description":"path to hosting folder","required":true}]},"hosting:config":{"id":"hosting:config","description":"Configure hosting","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"cname":{"name":"cname","type":"option","char":"c"},"browser-router":{"name":"browser-router","type":"boolean","char":"b","allowNo":true},"dont-sync":{"name":"dont-sync","type":"boolean","allowNo":false},"sync":{"name":"sync","type":"boolean","allowNo":false},"remove-cname":{"name":"remove-cname","type":"option","char":"d"}},"args":[{"name":"hostingName","description":"name of the hosting to list files from","required":true}]},"hosting:delete":{"id":"hosting:delete","description":"Delete hosting","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"confirms deletion of a hosting","allowNo":false}},"args":[{"name":"hostingName","description":"name of the hosting to delete","required":true}]},"hosting:files":{"id":"hosting:files","description":"List hostings files","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"hostingName","description":"name of the hosting to list files from","required":true}]},"hosting:list":{"id":"hosting:list","description":"List hostings","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"hosting:sync":{"id":"hosting:sync","description":"List hostings","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"delete":{"name":"delete","type":"boolean","char":"d","allowNo":false}},"args":[{"name":"hostingName","description":"name of the hosting to sync (all if not provided)","required":false}]},"info":{"id":"info","description":"Info about current project/instance/user etc.","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"init":{"id":"init","description":"Init Syncano instance","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"instance","description":"Instance Name"}]},"instance:create":{"id":"instance:create","description":"Create new instance","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"instanceName","description":"name of the instance","required":true},{"name":"location","description":"name of the location (possible options: us1, eu1)","default":"eu1"}]},"instance:delete":{"id":"instance:delete","description":"Delete an instance","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"instanceName","description":"name of the instance","required":true}]},"instance:list":{"id":"instance:list","description":"Delete an instance","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"login":{"id":"login","description":"Login to your account","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"email":{"name":"email","type":"option","char":"e","description":"account email"},"password":{"name":"password","type":"option","char":"p","description":"account password"}},"args":[]},"logout":{"id":"logout","description":"Login to your account","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"socket:call":{"id":"socket:call","description":"Trace Socket calls","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"body-only":{"name":"body-only","type":"boolean","allowNo":false}},"args":[{"name":"fullEndpointName","description":"full endpoint name in format: /","required":true}]},"socket:compile":{"id":"socket:compile","description":"Trace Socket calls","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"socketName","description":"name of the Socket","required":true}]},"socket:config:config":{"id":"socket:config:config","description":"Configure Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":["socket:config"],"flags":{},"args":[{"name":"socketName","description":"name of the Socket","required":true}]},"socket:config:set":{"id":"socket:config:set","description":"Configure Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"socketName","description":"name of the Socket","required":true},{"name":"configOptionName","description":"config option name","required":true},{"name":"configOptionValue","description":"config option value","required":true}]},"socket:config:show":{"id":"socket:config:show","description":"Show Socket Config","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"socketName","description":"name of the Socket","required":true}]},"socket:create":{"id":"socket:create","description":"Create Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"template":{"name":"template","type":"option"}},"args":[{"name":"socketName","description":"Socket name","required":true}]},"socket:deploy":{"id":"socket:deploy","description":"Deploy Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":["deploy"],"flags":{"create-instance":{"name":"create-instance","type":"option"},"force":{"name":"force","type":"boolean","allowNo":false},"is-hot":{"name":"is-hot","type":"boolean","allowNo":false},"parallel":{"name":"parallel","type":"boolean","allowNo":false},"bail":{"name":"bail","type":"boolean","allowNo":false}},"args":[{"name":"socketName","description":"Socket name"}]},"socket:hot":{"id":"socket:hot","description":"Hot Deploy Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":["hot"],"flags":{"trace":{"name":"trace","type":"boolean","allowNo":false}},"args":[{"name":"socketName","description":"Socket name"}]},"socket:list":{"id":"socket:list","description":"List the installed Sockets","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"full":{"name":"full","type":"boolean","char":"f","allowNo":false}},"args":[{"name":"socketName","description":"name of the Socket (all if not provided)"}]},"socket:trace":{"id":"socket:trace","description":"Trace Socket calls","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"socket:uninstall":{"id":"socket:uninstall","description":"Uninstall Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"socketName","description":"name of the Socket","required":true}]},"sysinfo":{"id":"sysinfo","description":"System info for debug purpose","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]}}} \ No newline at end of file +{"version":"0.15.0","commands":{"attach":{"id":"attach","description":"Attach Syncano Instance to current directory","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"examples":["\u001b[90mSelect existing Instance from list\u001b[39m\n $ syncano-cli attach","\u001b[90mAttach to given Instance\u001b[39m\n $ syncano-cli attach INSTANCE","\u001b[90mCreate given Instance if it does not exists\u001b[39m\n $ syncano-cli attach INSTANCE --create","\u001b[90mCreate given Instance if it does not exists and use given location\u001b[39m\n $ syncano-cli attach INSTANCE --create --location=eu1"],"flags":{"create":{"name":"create","type":"boolean","char":"c","description":"Create instance if it does not exists","allowNo":false},"location":{"name":"location","type":"option","char":"l","description":"Location in which instance will be created","helpValue":"(eu1|us1)","options":["eu1","us1"]}},"args":[{"name":"instance","description":"Instance name"}]},"backup:create":{"id":"backup:create","description":"Create backup","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"examples":["\u001b[90mCreate a backup\u001b[39m\n $ syncano-cli backup:create","\u001b[90mRemove oldest backup if limit was hit and create a backup\u001b[39m\n $ syncano-cli backup:create --rotate"],"flags":{"rotate":{"name":"rotate","type":"boolean","description":"Remove oldest backup if limit was hit","allowNo":false}},"args":[]},"backup:delete":{"id":"backup:delete","description":"Delete backup","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"all":{"name":"all","type":"boolean","description":"Remove all backup","allowNo":false}},"args":[{"name":"id","description":"Backup ID."}]},"backup":{"id":"backup","description":"Manage account backups","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"examples":["\u001b[90mCreate a backup\u001b[39m\n $ syncano-cli backup:create","\u001b[90mRemove oldest backup if limit was hit and create a backup\u001b[39m\n $ syncano-cli backup:create --rotate","\u001b[90mRemove backup by id\u001b[39m\n $ syncano-cli backup:delete [ID]","\u001b[90mRemove all backups\u001b[39m\n $ syncano-cli backup:delete --all"],"flags":{},"args":[]},"backup:last":{"id":"backup:last","description":"List last backup","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"backup:list":{"id":"backup:list","description":"List backups","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"hosting:add":{"id":"hosting:add","description":"Add hosting","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"examples":["\u001b[90mCreate a hosting\u001b[39m\n $ syncano-cli hosting:add ./path/to/public","\u001b[90mCreate a hosting with CNAME\u001b[39m\n $ syncano-cli hosting:add ./path/to/public --cname my-domain.com","\u001b[90mCreate a hosting with given name\u001b[39m\n $ syncano-cli hosting:add ./path/to/public --name staging"],"flags":{"name":{"name":"name","type":"option"},"browser-router-on":{"name":"browser-router-on","type":"boolean","allowNo":false},"browser-router-off":{"name":"browser-router-off","type":"boolean","allowNo":false},"dont-sync":{"name":"dont-sync","type":"boolean","allowNo":false},"sync":{"name":"sync","type":"boolean","allowNo":false},"without-cname":{"name":"without-cname","type":"boolean","allowNo":false},"cname":{"name":"cname","type":"option"}},"args":[{"name":"folder","description":"path to hosting folder","required":true}]},"hosting:config":{"id":"hosting:config","description":"Configure hosting","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"cname":{"name":"cname","type":"option","char":"c"},"browser-router":{"name":"browser-router","type":"boolean","char":"b","allowNo":true},"dont-sync":{"name":"dont-sync","type":"boolean","allowNo":false},"sync":{"name":"sync","type":"boolean","allowNo":false},"remove-cname":{"name":"remove-cname","type":"option","char":"d"}},"args":[{"name":"hostingName","description":"name of the hosting to list files from","required":true}]},"hosting:delete":{"id":"hosting:delete","description":"Delete hosting","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"confirms deletion of a hosting","allowNo":false}},"args":[{"name":"hostingName","description":"name of the hosting to delete","required":true}]},"hosting:files":{"id":"hosting:files","description":"List hostings files","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"hostingName","description":"name of the hosting to list files from","required":true}]},"hosting":{"id":"hosting","description":"Manage static Syncano hostings","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"examples":["\u001b[90mCreate a hosting\u001b[39m\n $ syncano-cli hosting:add ./path/to/public","\u001b[90mCreate a hosting with CNAME\u001b[39m\n $ syncano-cli hosting:add ./path/to/public --cname my-domain.com","\u001b[90mCreate a hosting with given name\u001b[39m\n $ syncano-cli hosting:add ./path/to/public --name staging","\u001b[90mChange hosting CNAME\u001b[39m\n $ syncano-cli hosting:config staging --cname staging.my-domain.com"],"flags":{},"args":[]},"hosting:list":{"id":"hosting:list","description":"List hostings","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"hosting:sync":{"id":"hosting:sync","description":"List hostings","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"delete":{"name":"delete","type":"boolean","char":"d","allowNo":false}},"args":[{"name":"hostingName","description":"name of the hosting to sync (all if not provided)","required":false}]},"info":{"id":"info","description":"Info about current project/instance/user etc.","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"init":{"id":"init","description":"Initialize Syncano project in current directory\nCreate Syncano Instance and attach it to current directory.\nSyncano config and sockets directory will also be created.","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"examples":["\u001b[90mRun initialization wizard\u001b[39m\n $ syncano-cli init","\u001b[90mStart project with given instance name\u001b[39m\n $ syncano-cli init my-instance","\u001b[90mCreate project in given location\u001b[39m\n $ syncano-cli init my-instance -l eu1","\u001b[90mCreate project with given template\u001b[39m\n $ syncano-cli init my-instance -t @syncano/template-project-hello"],"flags":{"location":{"name":"location","type":"option","char":"l","description":"Location in which instance will be created","helpValue":"(eu1|us1)","options":["eu1","us1"]},"template":{"name":"template","type":"option","char":"t","description":"Template of files structure used to init project"}},"args":[{"name":"instance","description":"Instance Name"}]},"instance:create":{"id":"instance:create","description":"Create new instance","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"instanceName","description":"name of the instance","required":true},{"name":"location","description":"name of the location (possible options: us1, eu1)","default":"eu1"}]},"instance:delete":{"id":"instance:delete","description":"Delete an instance","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"instanceName","description":"name of the instance","required":true}]},"instance:list":{"id":"instance:list","description":"List your instances","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"login":{"id":"login","description":"Login to your account","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"email":{"name":"email","type":"option","char":"e","description":"account email"},"password":{"name":"password","type":"option","char":"p","description":"account password"}},"args":[]},"logout":{"id":"logout","description":"Log out","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"socket:call":{"id":"socket:call","description":"Execute endpoint","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"body-only":{"name":"body-only","type":"boolean","allowNo":false}},"args":[{"name":"fullEndpointName","description":"full endpoint name in format: /","required":true}]},"socket:compile":{"id":"socket:compile","description":"Compile Socket sources","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"socketName","description":"name of the Socket","required":true}]},"socket:config:config":{"id":"socket:config:config","description":"Configure Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":["socket:config"],"flags":{},"args":[{"name":"socketName","description":"name of the Socket","required":true}]},"socket:config:set":{"id":"socket:config:set","description":"Configure Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"socketName","description":"name of the Socket","required":true},{"name":"configOptionName","description":"config option name","required":true},{"name":"configOptionValue","description":"config option value","required":true}]},"socket:config:show":{"id":"socket:config:show","description":"Show Socket Config","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"socketName","description":"name of the Socket","required":true}]},"socket:create":{"id":"socket:create","description":"Create Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"template":{"name":"template","type":"option"}},"args":[{"name":"socketName","description":"Socket name","required":true}]},"socket:deploy":{"id":"socket:deploy","description":"Deploy Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":["deploy"],"examples":["\u001b[90mDeploy all Sockets\u001b[39m\n $ syncano-cli deploy","\u001b[90mDeploy multiple Sockets in parallel\u001b[39m\n $ syncano-cli deploy --parallel","\u001b[90mDeploy single Socket\u001b[39m\n $ syncano-cli deploy SOCKET_NAME","\u001b[90mRemove .dist and .zip from Socket before deployment\u001b[39m\n $ syncano-cli deploy SOCKET_NAME --force","\u001b[90mStop deployment on error\u001b[39m\n $ syncano-cli deploy --bail"],"flags":{"create-instance":{"name":"create-instance","type":"option"},"force":{"name":"force","type":"boolean","char":"f","description":"Remove socket .dist and .zip directories before deployment.","allowNo":false},"is-hot":{"name":"is-hot","type":"boolean","hidden":true,"allowNo":false},"parallel":{"name":"parallel","type":"boolean","char":"p","description":"Run deployments in parallel.","allowNo":false},"bail":{"name":"bail","type":"boolean","char":"b","description":"Stop deployment when one of sockets fails to compile or deploy.","allowNo":false}},"args":[{"name":"socketName","description":"Socket name"}]},"socket:hot":{"id":"socket:hot","description":"Deploy Sockets and watch for changes","pluginName":"@syncano/cli","pluginType":"core","aliases":["hot"],"examples":["\u001b[90mDeploy Sockets and watch for changes\u001b[39m\n $ syncano-cli hot","\u001b[90mDeploy single Sockets and watch for changes\u001b[39m\n $ syncano-cli hot my-socket","\u001b[90mMonitor Socket calls. Does not work with async Sockets.\u001b[39m\n $ syncano-cli hot --trace"],"flags":{"trace":{"name":"trace","type":"boolean","allowNo":false},"mocked":{"name":"mocked","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"socketName","description":"Socket name"}]},"socket:list":{"id":"socket:list","description":"List the installed Sockets","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{"full":{"name":"full","type":"boolean","char":"f","allowNo":false}},"args":[{"name":"socketName","description":"name of the Socket (all if not provided)"}]},"socket:trace":{"id":"socket:trace","description":"Trace Socket calls","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"socket:uninstall":{"id":"socket:uninstall","description":"Uninstall Socket","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"socketName","description":"name of the Socket","required":true}]},"sysinfo":{"id":"sysinfo","description":"System info for debug purpose","pluginName":"@syncano/cli","pluginType":"core","aliases":[],"flags":{},"args":[]}}} \ No newline at end of file diff --git a/packages/cli/package-lock.json b/packages/cli/package-lock.json index 3e3966b5..a3159560 100644 --- a/packages/cli/package-lock.json +++ b/packages/cli/package-lock.json @@ -1854,15 +1854,6 @@ "tweetnacl": "^0.14.3" } }, - "binary": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", - "integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=", - "requires": { - "buffers": "~0.1.1", - "chainsaw": "~0.1.0" - } - }, "binary-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", @@ -2022,11 +2013,6 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "buffers": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz", - "integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s=" - }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -2130,8 +2116,7 @@ "camelcase": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", - "dev": true + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" }, "camelcase-keys": { "version": "2.1.0", @@ -2201,14 +2186,6 @@ "check-error": "^1.0.2" } }, - "chainsaw": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", - "integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=", - "requires": { - "traverse": ">=0.3.0 <0.4" - } - }, "chalk": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", @@ -4608,27 +4585,6 @@ "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", "optional": true }, - "fstream": { - "version": "0.1.31", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz", - "integrity": "sha1-czfwWPu7vvqMn1YaKMqwhJICyYg=", - "requires": { - "graceful-fs": "~3.0.2", - "inherits": "~2.0.0", - "mkdirp": "0.5", - "rimraf": "2" - }, - "dependencies": { - "graceful-fs": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", - "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", - "requires": { - "natives": "^1.1.0" - } - } - } - }, "ftp": { "version": "0.3.10", "resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz", @@ -6250,7 +6206,7 @@ }, "lodash.isempty": { "version": "4.4.0", - "resolved": "http://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", + "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=" }, "lodash.isplainobject": { @@ -6460,38 +6416,6 @@ "object-visit": "^1.0.0" } }, - "match-stream": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/match-stream/-/match-stream-0.0.2.tgz", - "integrity": "sha1-mesFAJOzTf+t5CG5rAtBCpz6F88=", - "requires": { - "buffers": "~0.1.1", - "readable-stream": "~1.0.0" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } - } - }, "md5": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", @@ -6994,11 +6918,6 @@ "to-regex": "^3.0.1" } }, - "natives": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.6.tgz", - "integrity": "sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA==" - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -7887,11 +7806,6 @@ "os-tmpdir": "^1.0.0" } }, - "over": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/over/-/over-0.0.5.tgz", - "integrity": "sha1-8phS5w/X4l82DgE6jsRMgq7bVwg=" - }, "p-cancelable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", @@ -8415,40 +8329,6 @@ "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==", "dev": true }, - "pullstream": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/pullstream/-/pullstream-0.4.1.tgz", - "integrity": "sha1-1vs79a7Wl+gxFQ6xACwlo/iuExQ=", - "requires": { - "over": ">= 0.0.5 < 1", - "readable-stream": "~1.0.31", - "setimmediate": ">= 1.0.2 < 2", - "slice-stream": ">= 1.0.0 < 2" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } - } - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -9317,11 +9197,6 @@ } } }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" - }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", @@ -9433,37 +9308,6 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=" }, - "slice-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-stream/-/slice-stream-1.0.0.tgz", - "integrity": "sha1-WzO9ZvATsaf4ZGCwPUY97DmtPqA=", - "requires": { - "readable-stream": "~1.0.31" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } - } - }, "slide": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", @@ -11104,11 +10948,6 @@ } } }, - "traverse": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", - "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=" - }, "tree-kill": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.1.tgz", @@ -11440,42 +11279,6 @@ "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", "dev": true }, - "unzip2": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/unzip2/-/unzip2-0.2.5.tgz", - "integrity": "sha1-TveleaeMFcUfVQ9qBT2xlBSciZI=", - "requires": { - "binary": "~0.3.0", - "fstream": "~0.1.21", - "match-stream": "~0.0.2", - "pullstream": "~0.4.0", - "readable-stream": "~1.0.0", - "setimmediate": "~1.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } - } - }, "update-notifier": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", @@ -11935,14 +11738,23 @@ } } } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-17.0.0.tgz", + "integrity": "sha512-Fl4RBJThsWeJl3cRZeGuolcuH78/foVUAYIUpKn8rkCnjn23ilZvJyEZJjnlzoG/+EJKPb1RggD4xS/Jie2nxg==", "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" diff --git a/packages/cli/package.json b/packages/cli/package.json index d0380a69..e838f961 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -36,7 +36,12 @@ "bin": "syncano-cli", "plugins": [ "@oclif/plugin-help" - ] + ], + "topics": { + "socket": { + "description": "Manage sockets" + } + } }, "bugs": { "url": "https://github.com/Syncano/syncano-node/issues" @@ -86,10 +91,10 @@ "stack-trace": "0.0.10", "strip-ansi": "^5.2.0", "tslib": "^1.9.3", - "unzip2": "^0.2.5", "validator": "^11.0.0", "walkdir": "^0.4.0", "ws": "^7.0.0", + "yargs-parser": "^17.0.0", "yauzl": "^2.10.0" }, "devDependencies": { @@ -159,7 +164,8 @@ "test:e2e:socket": "npm run test:e2e-single tests/e2e/socket.test-e2e.js", "test:e2e:instance": "npm run test:e2e-single tests/e2e/instance.test-e2e.js", "test:e2e-single": "mocha --require babel-register --timeout 100000 --slow 8000", - "test:commands": "nyc --extension .ts mocha --forbid-only \"test/commands/**/*.test.ts\"", + "test:commands": "nyc --extension .ts mocha --forbid-only \"test/commands/**/*.test.ts\" --slow 1000", + "test-selective:commands": "nyc --extension .ts mocha \"test/commands/**/*.test.ts\" --slow 1000", "test:unit": "npm run unit", "lint": "standard --fix --env mocha", "format": "prettier --write --single-quote --no-semi --no-bracket-spacing *.js {src,test}/**/*.js" diff --git a/packages/cli/src/commands/attach.ts b/packages/cli/src/commands/attach.ts index 4f98eade..911cd05f 100644 --- a/packages/cli/src/commands/attach.ts +++ b/packages/cli/src/commands/attach.ts @@ -10,25 +10,42 @@ import genUniqueInstanceName from '../utils/unique-instance' const {debug} = logger('cmd-attach') export default class Attach extends Command { - static description = 'Info about current project/instance/user etc.' + static description = 'Attach Syncano Instance to current directory' static flags = { - 'create-instance': flags.string({ + create: flags.boolean({ char: 'c', - description: 'create instance', + description: 'Create instance if it does not exists', + }), + location: flags.enum({ + options: ['eu1', 'us1'], + char: 'l', + description: 'Location in which instance will be created', }), - instance: flags.string({ - char: 'n', - description: 'attach to instance', - }) } + static args = [ + { + name: 'instance', + description: 'Instance name' + } + ] + static examples = [ + `${format.gray('Select existing Instance from list')} + $ syncano-cli attach`, + `${format.gray('Attach to given Instance')} + $ syncano-cli attach INSTANCE`, + `${format.gray('Create given Instance if it does not exists')} + $ syncano-cli attach INSTANCE --create`, + `${format.gray('Create given Instance if it does not exists and use given location')} + $ syncano-cli attach INSTANCE --create --location=eu1`, + ] async run() { - await this.session.isAuthenticated() || this.exit(1) + this.session.isAuthenticated() || this.exit(1) const init = new Init() - const {flags} = this.parse(Attach) + const {flags, args} = this.parse(Attach) - if (this.session.project && !(flags['create-instance'] || flags.instance)) { + if (this.session.project && !(flags.create || args.instance)) { const confirmQuestion = [{ type: 'confirm', name: 'confirm', @@ -40,11 +57,11 @@ export default class Attach extends Command { if (confirm === false) return this.exit(1) } - let instanceName = flags.instance || null + let instanceName = args.instance || null let instance - if (flags['create-instance']) { - instance = await createInstance(flags['create-instance']) + if (flags.create && args.instance) { + instance = await createInstance(args.instance) instanceName = instance.name } else if (!instanceName) { const questions = await this.getQuestions() @@ -64,22 +81,29 @@ export default class Attach extends Command { this.echo(4)(`Your project is attached to ${format.green(instanceName)} instance now!`) this.echo() this.exit(0) - - return this.session.load() } async createNewInstance() { const randomName = genUniqueInstanceName() - const {instanceName} = await inquirer.prompt([ + const {flags} = this.parse(Attach) + const {instanceName, location} = await inquirer.prompt([ { name: 'instanceName', type: 'input', default: randomName, message: this.p(2)('Choose instance name for your project:') + }, + { + name: 'location', + type: 'list', + message: this.p(2)('Choose location for your instance:'), + choices: Init.getLocationChoices().map(choice => this.p(4)(choice)), + default: 0, + when: !flags.location } ]) - return createInstance(instanceName) + return createInstance(instanceName, location || flags.location) } async getQuestions() { @@ -96,7 +120,7 @@ export default class Attach extends Command { pageSize: 16, message: this.p(2)('Choose instance for your project:'), choices: instancesNames, - default: 0 + default: 0, }) return questions diff --git a/packages/cli/src/commands/backup/create.ts b/packages/cli/src/commands/backup/create.ts index 8bd2e652..ffec7052 100644 --- a/packages/cli/src/commands/backup/create.ts +++ b/packages/cli/src/commands/backup/create.ts @@ -1,36 +1,70 @@ +import {flags} from '@oclif/command' import {BackupClass} from '@syncano/core' +import format from 'chalk' import Command from '../../base_command' import {SimpleSpinner} from '../../commands_helpers/spinner' export default class BackupsCreate extends Command { static description = 'Create backup' - static flags = {} + static flags = { + rotate: flags.boolean({ + description: 'Remove oldest backup if limit was hit' + }) + } + static examples = [ + `${format.gray('Create a backup')} + $ syncano-cli backup:create`, + `${format.gray('Remove oldest backup if limit was hit and create a backup')} + $ syncano-cli backup:create --rotate`, + ] Backup: BackupClass + rotateRetries = 1 + private readonly MAX_BACKUPS_MESSAGE = /Maximum number of backups per account reached/ + spinner: SimpleSpinner async run() { - await this.session.isAuthenticated() || this.exit(1) - await this.session.hasProject() || this.exit(1) + const {flags} = this.parse(BackupsCreate) + this.session.isAuthenticated() || this.exit(1) + this.session.hasProject() || this.exit(1) this.Backup = this.session.connection.backup - const spinner = new SimpleSpinner(this.p(2)('Creating backup...')) + this.spinner = new SimpleSpinner(this.p(2)('Creating backup...')) try { - spinner.start() + this.spinner.start() const backup = await this.Backup.create() const status = await this._createBackup(backup.id) - spinner.stop() - spinner.succeed(this.p(2)(`Backup was created (${status.id}).`)) + this.spinner.stop() + this.spinner.succeed(this.p(2)(`Backup was created (${status.id}).`)) } catch (err) { - this.error(err.message, {exit: 1}) + this.spinner.stop() + if (flags.rotate && this.MAX_BACKUPS_MESSAGE.test(err.message)) { + return this.rotateBackups() + } else { + this.error(err.message, {exit: 1}) + } } this.exit(0) } + async rotateBackups() { + const backups = await this.Backup.list() + + if (backups.length && this.rotateRetries > 0) { + this.rotateRetries-- + await this.Backup.delete(backups[0].id) + } else { + this.error('Maximum number of backups per account reached.', {exit: 1}) + } + + return this.run() + } + async _createBackup(id) { await this.timeout(3000) - const backup = await this.Backup.get(id) + const backup = await this.Backup.find(id) if (backup.status !== 'success') { return this._createBackup(id) @@ -38,7 +72,7 @@ export default class BackupsCreate extends Command { return backup } - timeout(ms) { + timeout(ms: number) { return new Promise(resolve => setTimeout(resolve, ms)) } } diff --git a/packages/cli/src/commands/backup/delete.ts b/packages/cli/src/commands/backup/delete.ts index 843c2f49..ba30d819 100644 --- a/packages/cli/src/commands/backup/delete.ts +++ b/packages/cli/src/commands/backup/delete.ts @@ -1,4 +1,5 @@ import {flags} from '@oclif/command' +import {BackupClass} from '@syncano/core' import Command from '../../base_command' import {SimpleSpinner} from '../../commands_helpers/spinner' @@ -6,20 +7,22 @@ import {SimpleSpinner} from '../../commands_helpers/spinner' export default class BackupDelete extends Command { static description = 'Delete backup' static flags = { - all: flags.boolean() + all: flags.boolean({ + description: 'Remove all backup' + }) } static args = [{ name: 'id', description: 'Backup ID.' }] - Backups: any + Backups: BackupClass async run() { - await this.session.isAuthenticated() || this.exit(1) - await this.session.hasProject() || this.exit(1) + this.session.isAuthenticated() || this.exit(1) + this.session.hasProject() || this.exit(1) - this.Backups = this.session.connection.backups + this.Backups = this.session.connection.backup const {args} = this.parse(BackupDelete) const {flags} = this.parse(BackupDelete) diff --git a/packages/cli/src/commands/backup/index.ts b/packages/cli/src/commands/backup/index.ts new file mode 100644 index 00000000..dfe4af42 --- /dev/null +++ b/packages/cli/src/commands/backup/index.ts @@ -0,0 +1,21 @@ +import format from 'chalk' + +import Command from '../../base_command' + +export default class BackupsCreate extends Command { + static description = 'Manage account backups' + static examples = [ + `${format.gray('Create a backup')} + $ syncano-cli backup:create`, + `${format.gray('Remove oldest backup if limit was hit and create a backup')} + $ syncano-cli backup:create --rotate`, + `${format.gray('Remove backup by id')} + $ syncano-cli backup:delete [ID]`, + `${format.gray('Remove all backups')} + $ syncano-cli backup:delete --all`, + ] + + async run() { + // This file is used to provide a proper description and examples + } +} diff --git a/packages/cli/src/commands/backup/list.ts b/packages/cli/src/commands/backup/list.ts index 5e810a56..0a2ccec4 100644 --- a/packages/cli/src/commands/backup/list.ts +++ b/packages/cli/src/commands/backup/list.ts @@ -1,3 +1,4 @@ +import {BackupClass} from '@syncano/core' import format from 'chalk' import Command from '../../base_command' @@ -7,19 +8,19 @@ export default class BackupsList extends Command { static description = 'List backups' static flags = {} - Backups: any + Backups: BackupClass async run() { - await this.session.isAuthenticated() || this.exit(1) - await this.session.hasProject() || this.exit(1) + this.session.isAuthenticated() || this.exit(1) + this.session.hasProject() || this.exit(1) - this.Backups = this.session.connection.backups + this.Backups = this.session.connection.backup this.echo() try { - const backup = await this.Backups.list() - if (backup.length) { - backup.forEach(elem => this.printBackups(elem)) + const backups = await this.Backups.list() + if (backups.length) { + backups.forEach(elem => this.printBackups(elem)) } else { printNoBackupsInfo() this.echo() @@ -36,9 +37,9 @@ export default class BackupsList extends Command { this.echo(4)(`${format.dim('created at')}: ${this.dateParser(createAt)}`) this.echo(4)(`${format.dim('updated at')}: ${this.dateParser(updatedAt)}`) this.echo(4)(` ${format.dim('details')}:`) - this.echo(8)(` ${format.dim('class')}: ${details.class.count}`) - this.echo(8)(` ${format.dim('socket')}: ${details.socket.count}`) - this.echo(8)(`${format.dim('hosting')}: ${details.hosting.count}`) + details.class && this.echo(5)(` ${format.dim('classes')}: ${details.class.count}`) + details.socket && this.echo(6)(` ${format.dim('sockets')}: ${details.socket.count}`) + details.hosting && this.echo(7)(`${format.dim('hosting')}: ${details.hosting.count}`) this.echo() } diff --git a/packages/cli/src/commands/hosting/add.ts b/packages/cli/src/commands/hosting/add.ts index e9cc7861..17fdbd39 100644 --- a/packages/cli/src/commands/hosting/add.ts +++ b/packages/cli/src/commands/hosting/add.ts @@ -29,6 +29,14 @@ export default class HostingConfig extends Command { description: 'path to hosting folder', required: true }] + static examples = [ + `${format.gray('Create a hosting')} + $ syncano-cli hosting:add ./path/to/public`, + `${format.gray('Create a hosting with CNAME')} + $ syncano-cli hosting:add ./path/to/public --cname my-domain.com`, + `${format.gray('Create a hosting with given name')} + $ syncano-cli hosting:add ./path/to/public --name staging`, + ] socket: any hostingName: any diff --git a/packages/cli/src/commands/hosting/index.ts b/packages/cli/src/commands/hosting/index.ts new file mode 100644 index 00000000..ac98479e --- /dev/null +++ b/packages/cli/src/commands/hosting/index.ts @@ -0,0 +1,21 @@ +import format from 'chalk' + +import Command from '../../base_command' + +export default class Hosting extends Command { + static description = 'Manage static Syncano hostings' + static examples = [ + `${format.gray('Create a hosting')} + $ syncano-cli hosting:add ./path/to/public`, + `${format.gray('Create a hosting with CNAME')} + $ syncano-cli hosting:add ./path/to/public --cname my-domain.com`, + `${format.gray('Create a hosting with given name')} + $ syncano-cli hosting:add ./path/to/public --name staging`, + `${format.gray('Change hosting CNAME')} + $ syncano-cli hosting:config staging --cname staging.my-domain.com`, + ] + + async run() { + // This file is used to provide a proper description and examples + } +} diff --git a/packages/cli/src/commands/info.ts b/packages/cli/src/commands/info.ts index 31bdd589..b35fb892 100644 --- a/packages/cli/src/commands/info.ts +++ b/packages/cli/src/commands/info.ts @@ -7,7 +7,7 @@ export default class Info extends Command { static flags = {} async run() { - if (!await this.session.isAuthenticated()) { + if (!this.session.isAuthenticated()) { this.exit(1) } diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 9eb4006a..a31b0d26 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -1,54 +1,80 @@ +import {flags} from '@oclif/command' import format from 'chalk' -import { prompt, Question } from 'inquirer' +import {prompt, Question} from 'inquirer' import Command, {Init} from '../base_command' import {createInstance} from '../commands_helpers/create-instance' -import {track} from '../utils/analytics' - +import {printInstanceInfo} from '../commands_helpers/instance' import {Location} from '../types' -import Login from './login' +import {track} from '../utils/analytics' +import genUniqueInstanceName from '../utils/unique-instance' export default class InitCmd extends Command { - static description = 'Init Syncano instance' - static flags = {} + static description = 'Initialize Syncano project in current directory\nCreate Syncano Instance and attach it to current directory.\nSyncano config and sockets directory will also be created.' + static flags = { + location: flags.enum({ + options: ['eu1', 'us1'], + char: 'l', + description: 'Location in which instance will be created' + }), + template: flags.string({ + char: 't', + description: 'Template of files structure used to init project' + }) + } + static examples = [ + `${format.gray('Run initialization wizard')} + $ syncano-cli init`, + `${format.gray('Start project with given instance name')} + $ syncano-cli init my-instance`, + `${format.gray('Create project in given location')} + $ syncano-cli init my-instance -l eu1`, + `${format.gray('Create project with given template')} + $ syncano-cli init my-instance -t @syncano/template-project-hello`, + ] static args = [{ name: 'instance', description: 'Instance Name' }] async run() { - await this.session.isAuthenticated() - const {args} = this.parse(InitCmd) - + this.session.isAuthenticated() + const {args, flags} = this.parse(InitCmd) const {project, settings} = this.session - const instance = args.instance + const {instance} = args if (process.env.INIT_CWD) { track('CLI: install') } if (!settings.account.authenticated()) { - this.echo() this.echo(4)(format.red('You have to be logged in to initialize a new project!')) - await Login.run() + this.exit(1) } - const init = new Init() - const questions: Question[] = [ { - name: 'Location', + name: 'instance', + type: 'input', + message: this.p(2)('Choose name for your instance'), + default: genUniqueInstanceName(), + when: !project && !instance + }, + { + name: 'location', type: 'list', message: this.p(2)('Choose location for your instance'), choices: Init.getLocationChoices().map(choice => this.p(4)(choice)), - default: 0 + default: 0, + when: !project && !flags.location }, { - name: 'Template', + name: 'template', type: 'list', message: this.p(2)('Choose template for your project'), choices: Init.getTemplatesChoices().map(choice => this.p(4)(choice)), - default: 1 + default: 1, + when: !init.hasConfig() && !flags.template } ] @@ -56,44 +82,55 @@ export default class InitCmd extends Command { this.echo() this.echo(4)(format.cyan('New project? Exciting! 🎉')) this.echo() - } else { + } else if (!init.hasConfig()) { this.echo() - this.echo(4)('I found the Syncano instance for the project in this folder,') + this.echo(4)(`Syncano instance ${format.cyan(project.instance)} ${project.location ? format.grey(`[${project.location}]`) : ''} is attached to this folder`) this.echo(4)("but you don't have any config files - I'll create them for you!") this.echo() + } else { + this.echo() + this.echo(4)('Project in this folder is already initiated:') + this.echo() + printInstanceInfo(this.session) + // TODO: Should it exit with 0 or 1? + this.exit(0) } - const promptResponses = await prompt(questions) as any - init.templateName = promptResponses.Template.match(/\((.*)\)/)[1] - init.locationName = promptResponses.Location.match(/[a-z0-9]+/)[0] - - await this.session.setLocation(init.locationName as Location) - - if (!project && instance) { - await this.session.checkConnection(instance) || this.exit(1) - await init.addConfigFiles({instance, location: init.locationName}) - this.echo(4)(`Your project is attached to ${format.green(instance.name)} instance now!`) + const answers = await prompt(questions) as any + const instanceName = answers.instance || instance - return init.createFilesAndFolders() + if (answers.template) { + init.templateName = answers.template.match(/\((.*)\)/)[1] + } + if (flags.template) { + init.templateName = flags.template + } + if (answers.location) { + init.locationName = answers.location.match(/[a-z0-9]+/)[0] + await this.session.setLocation(init.locationName as Location) + } + if (flags.location) { + init.locationName = flags.location + await this.session.setLocation(init.locationName as Location) } - if (!project && !instance) { - // debug('no project, no instance') + if (!project && instanceName) { try { - const newInstance = await createInstance() - - await init.addConfigFiles({instance: newInstance.name, location: init.locationName}) - this.echo(4)(`Your project is attached to ${format.green(newInstance.name)} instance now!`) - + const newInstance = await createInstance(instanceName) + await init.addConfigFiles({ + instance: newInstance.name, + location: init.locationName as Location + }) await init.createFilesAndFolders() - return this.session.load() - } catch (err) { + this.echo(4)(`Your project is now attached to ${format.green(newInstance.name)} instance!`) + } catch(err) { + console.log(err) this.exit(1) } } - if (init.checkConfigFiles()) { - return init.noConfigFiles() + if (!init.hasConfig() && answers.template) { + await init.noConfigFiles() } } } diff --git a/packages/cli/src/commands/instance/delete.ts b/packages/cli/src/commands/instance/delete.ts index 1f837ada..82883128 100644 --- a/packages/cli/src/commands/instance/delete.ts +++ b/packages/cli/src/commands/instance/delete.ts @@ -19,7 +19,7 @@ export default class InstanceCreateCmd extends Command { try { await this.session.deleteInstance(args.instanceName) this.echo() - this.echo(4)(`Syncano Instance ${args.instanceName} has been deleted successfuly.`) + this.echo(4)(`Syncano Instance ${args.instanceName} has been deleted successfully.`) this.echo() } catch (err) { this.error('Deleting instance failed!', {exit: 1}) diff --git a/packages/cli/src/commands/instance/list.ts b/packages/cli/src/commands/instance/list.ts index dc99b9c5..bd6a240c 100644 --- a/packages/cli/src/commands/instance/list.ts +++ b/packages/cli/src/commands/instance/list.ts @@ -2,7 +2,7 @@ import Command from '../../base_command' export default class InstanceCreateCmd extends Command { - static description = 'Delete an instance' + static description = 'List your instances' static flags = {} static args = [] @@ -10,19 +10,16 @@ export default class InstanceCreateCmd extends Command { await this.session.isAuthenticated() || this.exit(1) const instances = await this.session.getInstances() + this.echo() if (instances.length < 1) { - this.echo() this.echo(4)('You don\'t have any instances!') - this.echo() - this.exit(1) } else { - this.echo() this.echo(4)('Instances:') instances.forEach(instance => { this.echo(6)(`- ${instance.name}`) }) - this.echo() - this.exit() } + this.echo() + this.exit() } } diff --git a/packages/cli/src/commands/login.ts b/packages/cli/src/commands/login.ts index 18e74336..dc2b7953 100644 --- a/packages/cli/src/commands/login.ts +++ b/packages/cli/src/commands/login.ts @@ -1,9 +1,8 @@ import {flags} from '@oclif/command' +import {AccountOwner, LoginData} from '@syncano/core' import format from 'chalk' import {prompt, Question} from 'inquirer' import validator from 'validator' -import { AccountOwner } from '@syncano/core'; -import { LoginData } from '@syncano/core'; import Command from '../base_command' import {track} from '../utils/analytics' @@ -84,7 +83,7 @@ export default class Login extends Command { try { const user = await this.session.checkAuth() await this.displayWelcomeMessage(user) - } catch (err) { + } catch { if (flags && flags.email && flags.password) { await this.loginOrRegister(flags as EmailAndPassword) } else { diff --git a/packages/cli/src/commands/logout.ts b/packages/cli/src/commands/logout.ts index 50a5088a..9c7b9870 100644 --- a/packages/cli/src/commands/logout.ts +++ b/packages/cli/src/commands/logout.ts @@ -3,7 +3,7 @@ import format from 'chalk' import Command from '../base_command' export default class Logout extends Command { - static description = 'Login to your account' + static description = 'Log out' static flags = {} run() { diff --git a/packages/cli/src/commands/socket/call.ts b/packages/cli/src/commands/socket/call.ts index a8913100..0d35b29a 100644 --- a/packages/cli/src/commands/socket/call.ts +++ b/packages/cli/src/commands/socket/call.ts @@ -1,22 +1,23 @@ import {flags} from '@oclif/command' import format from 'chalk' import inquirer from 'inquirer' +import yargs from 'yargs-parser' import Command, {Socket} from '../../base_command' import {echon, printCode, printSourceCode} from '../../utils/print-tools' export default class SocketEndpointCall extends Command { - static description = 'Trace Socket calls' + static description = 'Execute endpoint' static flags = { 'body-only': flags.boolean() } + static strict = false static args = [{ name: 'fullEndpointName', required: true, description: 'full endpoint name in format: /' }] - - static validateValue(value) { + static validateValue(value: any) { if (!value) { return 'We need this!' } @@ -24,15 +25,8 @@ export default class SocketEndpointCall extends Command { return true } - context: any - session: any - Socket: any - socketList: any - mainSpinner: any - cmd: any - localSockets: any - promptParamQuestion(params, param) { + const flags = yargs(this.argv) const description = params[param].description || '' const paramType = params[param].type this.echo(4)(`- ${param} ${format.dim(`(${paramType})`)} ${description}`) @@ -40,7 +34,8 @@ export default class SocketEndpointCall extends Command { name: param, message: this.p(2)(`Type in value for "${format.green(param)}" parameter`), default: params[param].example, - validate: value => SocketEndpointCall.validateValue(value) + validate: value => SocketEndpointCall.validateValue(value), + when: flags[param] === undefined } return question } @@ -62,12 +57,14 @@ export default class SocketEndpointCall extends Command { } listParams(endpointObj) { + const flags = yargs(this.argv) const inputs = endpointObj.metadata.inputs const params = inputs ? inputs.properties || {} : {} + const flagValues = {} const paramsCount = Object.keys(params).length const questions = [] - if (!paramsCount) return questions + if (!paramsCount) return {questions, flagValues} this.echo() echon(4)(`You can pass ${format.cyan(paramsCount.toString())} `) @@ -76,18 +73,18 @@ export default class SocketEndpointCall extends Command { Object.keys(params).forEach(param => { questions.push(this.promptParamQuestion(params, param)) + flagValues[param] = flags[param] }) this.echo() - return questions + return {questions, flagValues} } async run() { - await this.session.isAuthenticated() - await this.session.hasProject() + this.session.isAuthenticated() + this.session.hasProject() - const {args} = this.parse(SocketEndpointCall) - const {flags} = this.parse(SocketEndpointCall) + const {args, flags} = this.parse(SocketEndpointCall) try { const bodyOnly = flags['body-only'] @@ -96,11 +93,12 @@ export default class SocketEndpointCall extends Command { const endpointObj = await socket.getEndpoint(endpointName) if (endpointObj && endpointObj.existRemotely) { - const askQuestions = this.listParams(endpointObj) + const {questions, flagValues} = this.listParams(endpointObj) let config = {} - if (askQuestions.length > 0) { - config = await inquirer.prompt(askQuestions) || {} + if (questions.length > 0) { + config = await inquirer.prompt(questions) || {} } + config = {...flagValues, ...config} try { const res = await endpointObj.call(config) this.formatResponse(res, bodyOnly) diff --git a/packages/cli/src/commands/socket/compile.ts b/packages/cli/src/commands/socket/compile.ts index db773f34..bf9743b8 100644 --- a/packages/cli/src/commands/socket/compile.ts +++ b/packages/cli/src/commands/socket/compile.ts @@ -10,7 +10,7 @@ const {debug} = logger('cmd-socket-compile') const pendingUpdates = {} export default class SocketCompile extends Command { - static description = 'Trace Socket calls' + static description = 'Compile Socket sources' static flags = {} static args = [{ name: 'socketName', @@ -54,14 +54,14 @@ export default class SocketCompile extends Command { spinner.stop() } - const configs = {} try { let index for (index in this.socketList) { const socket = this.socketList[index] + if (!socket.isDependency()) { - await this.compileSocket(socket, configs[socket.name]) + await this.compileSocket(socket) } } @@ -77,7 +77,7 @@ export default class SocketCompile extends Command { this.exit(0) } - async compileSocket(socket, config) { + async compileSocket(socket: Socket) { debug(`compileSocket: ${socket.name}`) const deployTimer = new Timer() const msg = this.p(4)(`${format.magenta('socket compile:')} ${currentTime()} ${format.cyan(socket.name)}`) diff --git a/packages/cli/src/commands/socket/config/config.ts b/packages/cli/src/commands/socket/config/config.ts index 668897ce..6569e281 100644 --- a/packages/cli/src/commands/socket/config/config.ts +++ b/packages/cli/src/commands/socket/config/config.ts @@ -24,8 +24,6 @@ export default class SocketConfig extends Command { if (!socket.existRemotely) { this.echo() this.error(this.p(4)('That Socket was not synced!')) - this.echo() - this.exit(1) } if (!socket.spec.config) { @@ -46,6 +44,6 @@ export default class SocketConfig extends Command { } catch (err) { this.error(err.message, {exit: 1}) } - this.exit(0) + this.exit(0) } } diff --git a/packages/cli/src/commands/socket/deploy.ts b/packages/cli/src/commands/socket/deploy.ts index 4b1fbec3..19add255 100644 --- a/packages/cli/src/commands/socket/deploy.ts +++ b/packages/cli/src/commands/socket/deploy.ts @@ -38,15 +38,36 @@ export default class SocketDeploy extends Command { static aliases = ['deploy'] static flags = { 'create-instance': flags.string(), - force: flags.boolean(), - 'is-hot': flags.boolean(), - parallel: flags.boolean(), - bail: flags.boolean(), + force: flags.boolean({ + char: 'f', + description: 'Remove socket .dist and .zip directories before deployment.' + }), + 'is-hot': flags.boolean({hidden: true}), + parallel: flags.boolean({ + char: 'p', + description: 'Run deployments in parallel.', + }), + bail: flags.boolean({ + char: 'b', + description: 'Stop deployment when one of sockets fails to compile or deploy.' + }), } static args = [{ name: 'socketName', - description: 'Socket name' + description: 'Socket name', }] + static examples = [ + `${format.gray('Deploy all Sockets')} + $ syncano-cli deploy`, + `${format.gray('Deploy multiple Sockets in parallel')} + $ syncano-cli deploy --parallel`, + `${format.gray('Deploy single Socket')} + $ syncano-cli deploy SOCKET_NAME`, + `${format.gray('Remove .dist and .zip from Socket before deployment')} + $ syncano-cli deploy SOCKET_NAME --force`, + `${format.gray('Stop deployment on error')} + $ syncano-cli deploy --bail`, + ] static printSummary(socketName: string, updateStatus: UpdateStatus) { debug('printSummary()', socketName, updateStatus) diff --git a/packages/cli/src/commands/socket/hot.ts b/packages/cli/src/commands/socket/hot.ts index a5d7cf7f..0f252c75 100644 --- a/packages/cli/src/commands/socket/hot.ts +++ b/packages/cli/src/commands/socket/hot.ts @@ -20,15 +20,26 @@ const pendingUpdates = {} const timer = new Timer() export default class SocketHotDeploy extends Command { - static description = 'Hot Deploy Socket' + static description = 'Deploy Sockets and watch for changes' static aliases = ['hot'] static flags = { trace: flags.boolean(), + mocked: flags.boolean({ + hidden: true, + }), } static args = [{ name: 'socketName', description: 'Socket name' }] + static examples = [ + `${format.gray('Deploy Sockets and watch for changes')} + $ syncano-cli hot`, + `${format.gray('Deploy single Sockets and watch for changes')} + $ syncano-cli hot my-socket`, + `${format.gray('Monitor Socket calls. Does not work with async Sockets.')} + $ syncano-cli hot --trace`, + ] socketList: Socket[] localSockets: Socket[] @@ -66,8 +77,8 @@ export default class SocketHotDeploy extends Command { } async run() { - await this.session.isAuthenticated() - await this.session.hasProject() + this.session.isAuthenticated() + this.session.hasProject() this.firstRun = {} const {args} = this.parse(SocketHotDeploy) @@ -78,12 +89,16 @@ export default class SocketHotDeploy extends Command { this.echo() this.echo(1)(`🚀 ${format.grey(' Initial sync started...')}`) - const deployCmd = await SocketDeploy.run([args.socketName || '', '--is-hot']) + const deployCmd = await SocketDeploy.run([args.socketName || '', flags.mocked ? undefined : '--is-hot'].filter(Boolean)) this.socketList = deployCmd.socketList this.echo(1)(`🔥 ${format.grey(' Hot deploy started')} ${format.dim('(Hit Ctrl-C to stop)')}`) this.echo() + if (flags.mocked) { + this.exit(0) + } + info('Starting stalker') this.mainSpinner.queueSize += 1 this.mainSpinner.start() diff --git a/packages/cli/src/commands_helpers/create-instance.ts b/packages/cli/src/commands_helpers/create-instance.ts index 7fa5648a..b1330892 100644 --- a/packages/cli/src/commands_helpers/create-instance.ts +++ b/packages/cli/src/commands_helpers/create-instance.ts @@ -6,13 +6,13 @@ import session from '../utils/session' const {debug} = logger('cmd-helpers-create-instance') -export const createInstance = async (instanceName?: string) => { +export const createInstance = async (instanceName?: string, location?: 'eu1' | 'us1') => { let newInstance = null try { debug('Creating Instance') echo() echon(4)('Creating Syncano Instance... ') - newInstance = await session.createInstance(instanceName) + newInstance = await session.createInstance(instanceName, location) echo(`${format.green('Done')}`) echo(4)(`Syncano Instance ${format.cyan(newInstance.name)} has been created!`) echo() @@ -26,11 +26,11 @@ export const createInstance = async (instanceName?: string) => { echo(4)(`Try ${format.cyan('npx s logout')} and ${format.cyan('npx s login')} again.`) } else if (err.message === 'name: This field must be unique.') { error(4)('Instance already exist!') - echo(4)('Try another instace name.') + echo(4)('Try another instance name.') } else { error(4)(err.message || 'Error while creating instance. Try again!') } echo() throw new Error('Error while creating instance.') - } + } } diff --git a/packages/cli/src/settings/accountSettings.ts b/packages/cli/src/settings/accountSettings.ts index 4537fcba..581a32ce 100644 --- a/packages/cli/src/settings/accountSettings.ts +++ b/packages/cli/src/settings/accountSettings.ts @@ -1,6 +1,6 @@ import os from 'os' -import {AccountSettingsAttributes} from '../types' +import {AccountSettingsAttributes, ProjectSettings, Location} from '../types' import logger from '../utils/debug' import Settings from './settings' @@ -31,29 +31,32 @@ export default class AccountSettings extends Settings { } getAuthKey () { + if (process.env.SYNCANO_AUTH_KEY) debug('getAuthKey from process.env') + else if (this.attributes.auth_key) debug('getAuthKey from syncano.yml') + else debug('getAuthKey returned null') return process.env.SYNCANO_AUTH_KEY || this.attributes.auth_key || null } - addProject (projectName: string, params = {}) { - debug('addProject()', projectName) + addProject (projectPath: string, params: ProjectSettings) { + debug('addProject()', projectPath) if (!this.attributes.projects) { this.attributes.projects = {} } - this.attributes.projects[projectName] = params + this.attributes.projects[projectPath] = params this.save() } - getProject (projectName: string) { - debug('getProject()', projectName) + getProject (projectPath: string) { + debug('getProject()', projectPath) const envInstance = process.env.SYNCANO_PROJECT_INSTANCE if (envInstance) { return { instance: envInstance, - location: process.env.SYNCANO_PROJECT_INSTANCE_LOCATION + location: process.env.SYNCANO_PROJECT_INSTANCE_LOCATION as unknown as Location } } if (this.attributes.projects) { - return this.attributes.projects[projectName] + return this.attributes.projects[projectPath] } } } diff --git a/packages/cli/src/settings/projectSettings.ts b/packages/cli/src/settings/projectSettings.ts index 4a37145b..e6d5e45f 100644 --- a/packages/cli/src/settings/projectSettings.ts +++ b/packages/cli/src/settings/projectSettings.ts @@ -5,15 +5,11 @@ import readdirp from 'readdirp' import {HostingRecord, ProjectSettingsAttributes} from '../types' import logger from '../utils/debug' + import Settings from './settings' const {debug} = logger('settings-project') -type LocalHosting = { - name: string - src: string -} - export default class ProjectSettings extends Settings { static getAttributesFromYaml(path: string) { const socketAttributes = YAML.load(fs.readFileSync(path, 'utf8')) @@ -58,7 +54,7 @@ export default class ProjectSettings extends Settings { getSocketTemplates() { try { return this.attributes.templates.sockets - } catch (err) { + } catch { return [] } } diff --git a/packages/cli/src/settings/settings.ts b/packages/cli/src/settings/settings.ts index be99177b..57f26c1d 100644 --- a/packages/cli/src/settings/settings.ts +++ b/packages/cli/src/settings/settings.ts @@ -52,9 +52,11 @@ export default class Settings { try { this.attributes = YAML.load(fs.readFileSync(this.configPath, 'utf8')) || {} + info(`load() config from "${this.configPath}"`) } catch (err) { error(err, p(10)(`at file: ${this.configPath}`)) // this.exit(1) + // return false } return true @@ -74,7 +76,7 @@ export default class Settings { return this.attributes[key] || null } - set(key: any, value: any, save: boolean) { + set(key: any, value: any, save?: boolean) { this.attributes[key] = value if (save !== false) this.save() return this diff --git a/packages/cli/src/types.ts b/packages/cli/src/types.ts index 3969edee..3839a7ad 100644 --- a/packages/cli/src/types.ts +++ b/packages/cli/src/types.ts @@ -7,7 +7,7 @@ export type Location = 'eu1' | 'us1' export interface SyncanoProject { instance: string - location: Location + location?: Location } export interface SyncanoConnection { @@ -43,7 +43,8 @@ export interface CLISession { // } export interface ProjectSettings { - instance?: string + instance: string + location?: Location } export interface AccountSettingsAttributes { @@ -66,16 +67,16 @@ export interface SocketSettingsAttributes { endpoints: Record } -export interface ProjectSettings { - instance?: string -} - export interface HostingRecordConfig { browser_router: boolean } export interface HostingRecord { name: string + // FIXME: Should this be here? + cname?: string + // FIXME: Should this be here? + auth?: string src: string config: HostingRecordConfig } diff --git a/packages/cli/src/utils/hosting/hosting.ts b/packages/cli/src/utils/hosting/hosting.ts index fe06afd2..28c86757 100644 --- a/packages/cli/src/utils/hosting/hosting.ts +++ b/packages/cli/src/utils/hosting/hosting.ts @@ -1,3 +1,4 @@ +import {Hosting as CoreHosting} from '@syncano/core' import axios from 'axios' import format from 'chalk' import FormData from 'form-data' @@ -6,15 +7,13 @@ import _ from 'lodash' import md5 from 'md5' import path from 'path' import prettyBytes from 'pretty-bytes' -import {Hosting as CoreHosting} from '@syncano/core' import {HostingParams, HostingRecord} from '../../types' import logger from '../debug' -import { echo, error } from '../print-tools' +import {echo, error} from '../print-tools' import session from '../session' -import {getFiles } from './utils' - +import {getFiles} from './utils' const {debug} = logger('utils-hosting') @@ -52,6 +51,7 @@ class Hosting { static async add(params: HostingParams): Promise { debug('Adding hosting') const configParams = { + name: params.name, src: params.src, config: { browser_router: params.browser_router || false @@ -139,7 +139,7 @@ class Hosting { remote: any src: string | null = null cname: string | null = null - browser_router: string | null = null + browser_router: boolean | null = null auth: any url: string | null = null error: string | null = null @@ -173,6 +173,7 @@ class Hosting { updateHosting() { const params = { + name: this.name, src: this.src, config: { browser_router: this.browser_router || false diff --git a/packages/cli/src/utils/index.ts b/packages/cli/src/utils/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/cli/src/utils/init/init.ts b/packages/cli/src/utils/init/init.ts index 28d64f64..a7638573 100644 --- a/packages/cli/src/utils/init/init.ts +++ b/packages/cli/src/utils/init/init.ts @@ -1,10 +1,11 @@ import format from 'chalk' import fs from 'fs-extra' -import path from 'path' +import path, {join} from 'path' import logger from '../debug' import {echo} from '../print-tools' import session from '../session' +import {ProjectSettings} from '../../types' import { builtInProjectTemplates, getTemplate, @@ -47,17 +48,24 @@ class Init { if (this.templateName) { try { debug('Template name:', this.templateName) - debug('Loction name:', this.locationName) + debug('Location name:', this.locationName) debug('Path to copy to:', pathToCopyTo) await fs.copy(getTemplate(this.templateName), pathToCopyTo) echo(4)(format.dim(`Project has been created from ${format.green(this.templateName)} template.`)) echo() + return } catch (err) { + console.log(err) echo(err) throw err } } - throw Error('No tamplate name!') + + throw Error('No template name!') + } + + hasConfig() { + return fs.existsSync(join(session.getProjectPath(), 'syncano.yml')) } checkConfigFiles() { @@ -68,7 +76,7 @@ class Init { return fs.existsSync(session.getProjectPath()) && session.project } - async addConfigFiles(projectParams = {}, projectPath?: string) { + async addConfigFiles(projectParams: ProjectSettings, projectPath?: string) { if (projectPath) { session.settings.account.addProject(projectPath, projectParams) } else { @@ -77,9 +85,9 @@ class Init { await session.load() } - noConfigFiles() { + async noConfigFiles() { debug('noConfigFiles()') - this.createFilesAndFolders() + return this.createFilesAndFolders() } } diff --git a/packages/cli/src/utils/plugins/plugins.ts b/packages/cli/src/utils/plugins/plugins.ts index c5c680a5..1c4a9ffc 100644 --- a/packages/cli/src/utils/plugins/plugins.ts +++ b/packages/cli/src/utils/plugins/plugins.ts @@ -1,24 +1,24 @@ import path from 'path' + +import {CLIPlugin} from '../../types' import logger from '../debug' -import { warning } from '../print-tools' +import {warning} from '../print-tools' import session from '../session' -import { - CLIPlugin, -} from '../../types' -const { debug } = logger('utils-plugins') +const {debug} = logger('utils-plugins') export default class Plugins { - plugins: CLIPlugin[] - constructor () { - this.plugins = session.settings.project.getPlugins() || [] + plugins: Record + + constructor() { + this.plugins = session.settings.project.getPlugins() || {} } - load (program, context) { + load(program, context) { debug('load()') - Object.keys(this.plugins).forEach((pluginName) => { - /* eslint-disable import/no-dynamic-require */ - /* eslint-disable global-require */ + Object.keys(this.plugins).forEach(pluginName => { + // eslint-disable import/no-dynamic-require + // eslint-disable global-require debug('loading plugin:', pluginName) // Add directory where CLI command is executed @@ -32,6 +32,7 @@ export default class Plugins { new PluginImport(context).run(options) }) } catch (err) { + // tslint:disable-next-line: no-console console.log(err) warning('Error while loading plugin:', this.plugins[pluginName]) } diff --git a/packages/cli/src/utils/session.ts b/packages/cli/src/utils/session.ts index 156ae026..038eef2a 100644 --- a/packages/cli/src/utils/session.ts +++ b/packages/cli/src/utils/session.ts @@ -26,7 +26,7 @@ export class Session { return process.cwd() } CLIVersion: string - settings: any + settings = getSettings() projectPath: string | null = null project: SyncanoProject | null = null userId: number | null = null @@ -45,9 +45,7 @@ export class Session { } this.CLIVersion = pjson.version this.majorVersion = pjson.version.split('.')[0] - this.location = process.env.SYNCANO_PROJECT_INSTANCE_LOCATION as Location || this.location - this.settings = getSettings() } getHost() { @@ -135,7 +133,7 @@ export class Session { if (this.project && this.project.instance) { return this.project.instance } - throw Error('Unknown projewct instance!') + throw Error('Unknown project instance!') } async createConnection() { @@ -169,7 +167,7 @@ export class Session { this.userEmail = details.email this.userFirstName = details.first_name this.userLastName = details.last_name - } catch (err) { + } catch { debug('Error while getting user details!') } } @@ -178,8 +176,8 @@ export class Session { return this.getConnection().instance.delete(name) } - async createInstance(name = genUniqueName()) { - return this.getConnection().instance.create({name}) + async createInstance(name = genUniqueName(), location?: 'eu1' | 'us1') { + return this.getConnection().instance.create({name, location}) } async getInstance(instanceName: string) { diff --git a/packages/cli/src/utils/sockets/sockets.ts b/packages/cli/src/utils/sockets/sockets.ts index 0757b5f9..70ec4798 100644 --- a/packages/cli/src/utils/sockets/sockets.ts +++ b/packages/cli/src/utils/sockets/sockets.ts @@ -76,7 +76,7 @@ class Endpoint extends MetadataObject { return axios.request({ url: this.getURL(), method: 'POST', - timeout: 3000, + timeout: 6000, params, // Do not transform data automatically transformResponse: data => data diff --git a/packages/cli/test/commands/attach.test.ts b/packages/cli/test/commands/attach.test.ts index c47d60cd..70b5861b 100644 --- a/packages/cli/test/commands/attach.test.ts +++ b/packages/cli/test/commands/attach.test.ts @@ -1,11 +1,14 @@ import {expect, test} from '@oclif/test' -import {deleteInstance, uniqueInstance, deleteConfigFile} from '@syncano/test-tools' +import {deleteConfigFile, deleteInstance, uniqueInstance} from '@syncano/test-tools' describe('attach', () => { const testInstanceName = uniqueInstance() + beforeEach(() => { try { deleteConfigFile() } catch {} }) + test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['attach']) .exit(1) .it('runs when not logged in', ctx => { @@ -30,8 +33,8 @@ describe('attach', () => { .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) .command([ 'attach', - '-c', - testInstanceName + testInstanceName, + '--create' ]) .exit(0) .it('create new instance', ctx => { @@ -42,12 +45,10 @@ describe('attach', () => { .stdout() .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) .finally(async () => { - deleteConfigFile() await deleteInstance(testInstanceName) }) .command([ 'attach', - '-n', testInstanceName ]) .exit(0) diff --git a/packages/cli/test/commands/auth/logout.test.ts b/packages/cli/test/commands/auth/logout.test.ts index a1459e47..3b98fe33 100644 --- a/packages/cli/test/commands/auth/logout.test.ts +++ b/packages/cli/test/commands/auth/logout.test.ts @@ -1,6 +1,9 @@ import {expect, test} from '@oclif/test' +import {deleteConfigFile} from '@syncano/test-tools' describe('logout', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) + test .stdout() .env({SYNCANO_AUTH_KEY: ''}) diff --git a/packages/cli/test/commands/backup/create.test.ts b/packages/cli/test/commands/backup/create.test.ts index 0ca01880..9e8cb284 100644 --- a/packages/cli/test/commands/backup/create.test.ts +++ b/packages/cli/test/commands/backup/create.test.ts @@ -1,10 +1,12 @@ import {expect, test} from '@oclif/test' -import {createInstance, deleteInstance, uniqueInstance} from '@syncano/test-tools' +import {createInstance, deleteConfigFile, deleteInstance, uniqueInstance} from '@syncano/test-tools' describe('backup:create', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['backup:create']) .exit(1) .it('when not logged in', ctx => { diff --git a/packages/cli/test/commands/backup/delete.test.ts b/packages/cli/test/commands/backup/delete.test.ts index 62df4894..06a5e595 100644 --- a/packages/cli/test/commands/backup/delete.test.ts +++ b/packages/cli/test/commands/backup/delete.test.ts @@ -3,6 +3,7 @@ import {expect, test} from '@oclif/test' describe('backup:delete', () => { test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['backup:delete']) .exit(1) .it('when not logged in', ctx => { diff --git a/packages/cli/test/commands/backup/last.test.ts b/packages/cli/test/commands/backup/last.test.ts index fedb2619..a6365c29 100644 --- a/packages/cli/test/commands/backup/last.test.ts +++ b/packages/cli/test/commands/backup/last.test.ts @@ -1,7 +1,8 @@ import {expect, test} from '@oclif/test' -import {createBackup, createInstance, deleteBackup, deleteInstance, uniqueInstance} from '@syncano/test-tools' +import {createBackup, createInstance, deleteBackup, deleteConfigFile, deleteInstance, uniqueInstance} from '@syncano/test-tools' describe('backup:last', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() let backupId @@ -9,7 +10,7 @@ describe('backup:last', () => { test .stdout() - .env({SYNCANO_AUTH_KEY: ''}) + .env({SYNCANO_AUTH_KEY: undefined}) .command(['backup:last']) .exit(1) .it('when not logged in', ctx => { diff --git a/packages/cli/test/commands/backup/list.test.ts b/packages/cli/test/commands/backup/list.test.ts index 3729d4a1..3cad2eac 100644 --- a/packages/cli/test/commands/backup/list.test.ts +++ b/packages/cli/test/commands/backup/list.test.ts @@ -1,10 +1,12 @@ import {expect, test} from '@oclif/test' -import {createInstance, deleteInstance, uniqueInstance} from '@syncano/test-tools' +import {createInstance, deleteConfigFile, deleteInstance, uniqueInstance} from '@syncano/test-tools' describe('backup:list', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['backup:list']) .exit(1) .it('when not logged in', ctx => { @@ -16,7 +18,7 @@ describe('backup:list', () => { .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) .do(() => createInstance(testInstanceName)) - .finally(() => deleteInstance(testInstanceName)) + .finally(async () => deleteInstance(testInstanceName)) .command(['backup:list']) // .exit(1) .it('when no backups', ctx => { diff --git a/packages/cli/test/commands/hosting/add.test.ts b/packages/cli/test/commands/hosting/add.test.ts index 0cf97b85..4ee78bf7 100644 --- a/packages/cli/test/commands/hosting/add.test.ts +++ b/packages/cli/test/commands/hosting/add.test.ts @@ -1,6 +1,7 @@ import {expect, test} from '@oclif/test' import { createProject, + deleteConfigFile, deleteInstance, testsLocation, uniqueInstance @@ -10,6 +11,7 @@ import path from 'path' import {projectTestTemplate} from '../../utils' describe('hosting:add', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() test .stdout() diff --git a/packages/cli/test/commands/hosting/config.test.ts b/packages/cli/test/commands/hosting/config.test.ts index ae766c2d..647ec797 100644 --- a/packages/cli/test/commands/hosting/config.test.ts +++ b/packages/cli/test/commands/hosting/config.test.ts @@ -1,10 +1,11 @@ import {expect, test} from '@oclif/test' -import {uniqueInstance} from '@syncano/test-tools' +import {deleteConfigFile, uniqueInstance} from '@syncano/test-tools' import sinon from 'sinon' import Hosting from '../../../src/utils/hosting' describe('hosting:config', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() const hosting = { name: 'hosting', @@ -22,6 +23,7 @@ describe('hosting:config', () => { } test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['hosting:config']) .exit(1) .it('when not logged in', ctx => { diff --git a/packages/cli/test/commands/hosting/delete.test.ts b/packages/cli/test/commands/hosting/delete.test.ts index 6375f14b..f50487f3 100644 --- a/packages/cli/test/commands/hosting/delete.test.ts +++ b/packages/cli/test/commands/hosting/delete.test.ts @@ -1,13 +1,15 @@ import {expect, test} from '@oclif/test' -import {createInstance, deleteInstance, uniqueInstance} from '@syncano/test-tools' +import {deleteConfigFile, uniqueInstance} from '@syncano/test-tools' import sinon from 'sinon' import Hosting from '../../../src/utils/hosting' describe('hosting:delete', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['hosting:delete']) .exit(1) .it('when not logged in', ctx => { diff --git a/packages/cli/test/commands/hosting/deploy.test.ts b/packages/cli/test/commands/hosting/deploy.test.ts index 33f39fa5..83975255 100644 --- a/packages/cli/test/commands/hosting/deploy.test.ts +++ b/packages/cli/test/commands/hosting/deploy.test.ts @@ -1,6 +1,7 @@ import {expect, test} from '@oclif/test' import { createProject, + deleteConfigFile, deleteInstance, testsLocation, uniqueInstance @@ -10,6 +11,7 @@ import path from 'path' import {projectTestTemplate} from '../../utils' describe('hosting:project:deploy', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() test diff --git a/packages/cli/test/commands/hosting/files.test.ts b/packages/cli/test/commands/hosting/files.test.ts index ef16c4b8..104190a7 100644 --- a/packages/cli/test/commands/hosting/files.test.ts +++ b/packages/cli/test/commands/hosting/files.test.ts @@ -1,13 +1,15 @@ import {expect, test} from '@oclif/test' -import {createInstance, deleteInstance, uniqueInstance} from '@syncano/test-tools' +import {deleteConfigFile, uniqueInstance} from '@syncano/test-tools' import sinon from 'sinon' import Hosting from '../../../src/utils/hosting' describe('hosting:files', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['hosting:files']) .exit(1) .it('when not logged in', ctx => { diff --git a/packages/cli/test/commands/hosting/list.test.ts b/packages/cli/test/commands/hosting/list.test.ts index 75d99c1e..d5f2a85a 100644 --- a/packages/cli/test/commands/hosting/list.test.ts +++ b/packages/cli/test/commands/hosting/list.test.ts @@ -1,13 +1,15 @@ import {expect, test} from '@oclif/test' -import {createInstance, deleteInstance, uniqueInstance} from '@syncano/test-tools' +import {deleteConfigFile, uniqueInstance} from '@syncano/test-tools' import sinon from 'sinon' import Hosting from '../../../src/utils/hosting' describe('hosting:list', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['hosting:list']) .exit(1) .it('when not logged in', ctx => { diff --git a/packages/cli/test/commands/hosting/sync.test.ts b/packages/cli/test/commands/hosting/sync.test.ts index 717a68d6..81976a8b 100644 --- a/packages/cli/test/commands/hosting/sync.test.ts +++ b/packages/cli/test/commands/hosting/sync.test.ts @@ -1,5 +1,6 @@ import {expect, test} from '@oclif/test' import { + deleteConfigFile, createProject, deleteInstance, testsLocation, @@ -10,6 +11,7 @@ import path from 'path' import {projectTestTemplate} from '../../utils' describe('hosting:sync', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() test .stdout() diff --git a/packages/cli/test/commands/info.test.ts b/packages/cli/test/commands/info.test.ts index 91ab2325..0388ff43 100644 --- a/packages/cli/test/commands/info.test.ts +++ b/packages/cli/test/commands/info.test.ts @@ -1,11 +1,14 @@ import {expect, test} from '@oclif/test' import sinon from 'sinon' +import {deleteConfigFile} from '@syncano/test-tools' import session from '../../src/utils/session' describe('info', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['info']) .exit(1) .it('runs info when not logged in', ctx => { diff --git a/packages/cli/test/commands/init.test.ts b/packages/cli/test/commands/init.test.ts new file mode 100644 index 00000000..f5b0da5d --- /dev/null +++ b/packages/cli/test/commands/init.test.ts @@ -0,0 +1,40 @@ +import {expect, test} from '@oclif/test' +import {deleteConfigFile, deleteInstance, testsLocation, uniqueInstance} from '@syncano/test-tools' +import fs from 'fs' +import path from 'path' + +describe('init', () => { + const testInstanceName = uniqueInstance() + beforeEach(() => { try { deleteConfigFile() } catch {} }) + after(async () => { + await deleteInstance(testInstanceName) + }) + + test + .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) + .command(['init']) + .exit(1) + .it('runs when not logged in', ctx => { + expect(ctx.stdout).to.contain('You are not logged in!') + }) + + test + .stdout() + .do(() => { + const testDir = path.join(testsLocation, testInstanceName) + try { + fs.mkdirSync(testDir) + } catch (err) { + // tslint:disable-next-line: no-console + console.error(err) + } + process.chdir(testDir) + }) + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .command(['init', testInstanceName, '-t', '@syncano/template-project-empty', '-l', 'eu1']) + .it('creates instance and file structure', ctx => { + expect(ctx.stdout).to.contain('Project has been created from @syncano/template-project-empty template.') + expect(ctx.stdout).to.contain(`Your project is now attached to ${testInstanceName} instance!`) + }) +}) diff --git a/packages/cli/test/commands/instance/create.test.ts b/packages/cli/test/commands/instance/create.test.ts index 4c60bdb3..8b64e27c 100644 --- a/packages/cli/test/commands/instance/create.test.ts +++ b/packages/cli/test/commands/instance/create.test.ts @@ -1,10 +1,12 @@ import {expect, test} from '@oclif/test' -import {deleteInstance, uniqueInstance} from '@syncano/test-tools' +import {deleteConfigFile, deleteInstance, uniqueInstance} from '@syncano/test-tools' describe('instance:create', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['instance:create', 'instanceName']) .exit(1) .it('when not logged in', ctx => { diff --git a/packages/cli/test/commands/instance/delete.test.ts b/packages/cli/test/commands/instance/delete.test.ts index 6babca00..c4d32e72 100644 --- a/packages/cli/test/commands/instance/delete.test.ts +++ b/packages/cli/test/commands/instance/delete.test.ts @@ -1,10 +1,12 @@ import {expect, test} from '@oclif/test' -import {createInstance, uniqueInstance} from '@syncano/test-tools' +import {createInstance, deleteConfigFile, uniqueInstance} from '@syncano/test-tools' describe('instance:delete', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) let testInstanceName = uniqueInstance() test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['instance:delete', 'instanceName']) .exit(1) .it('when not logged in', ctx => { @@ -18,6 +20,6 @@ describe('instance:delete', () => { .command(['instance:delete', testInstanceName]) .exit(0) .it('when instance name was provided', ctx => { - expect(ctx.stdout).to.contain(`Syncano Instance ${testInstanceName} has been deleted successfuly.`) + expect(ctx.stdout).to.contain(`Syncano Instance ${testInstanceName} has been deleted successfully.`) }) }) diff --git a/packages/cli/test/commands/instance/list.test.ts b/packages/cli/test/commands/instance/list.test.ts index 331bd5ae..7a422c61 100644 --- a/packages/cli/test/commands/instance/list.test.ts +++ b/packages/cli/test/commands/instance/list.test.ts @@ -1,13 +1,16 @@ import {expect, test} from '@oclif/test' -import {createInstance, deleteInstance, uniqueInstance} from '@syncano/test-tools' +import {createInstance, deleteConfigFile, deleteInstance, uniqueInstance} from '@syncano/test-tools' import sinon from 'sinon' import session from '../../../src/utils/session' describe('instance:list', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) + let testInstanceName = uniqueInstance() test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['instance:list']) .exit(1) .it('when not logged in', ctx => { @@ -19,7 +22,7 @@ describe('instance:list', () => { .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) .stub(session, 'getInstances', sinon.stub().resolves([])) .command(['instance:list']) - .exit(1) + .exit(0) .it('when no instances', ctx => { expect(ctx.stdout).to.contain('You don\'t have any instances!') }) diff --git a/packages/cli/test/commands/login.test.ts b/packages/cli/test/commands/login.test.ts index e134143b..dbd3efa3 100644 --- a/packages/cli/test/commands/login.test.ts +++ b/packages/cli/test/commands/login.test.ts @@ -1,32 +1,42 @@ import {expect, test} from '@oclif/test' +import {deleteConfigFile} from '@syncano/test-tools' describe('login', () => { test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command([ 'login', '-e badEmail', '-p TestPasswrod' ]) .exit(1) + .finally(() => { + try { deleteConfigFile() } catch {} + }) .it('runs login with bad email', ctx => { expect(ctx.stdout).to.contain('Enter a valid email address.') }) test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command([ 'login', `-e ${process.env.E2E_CLI_EMAIL}`, '-p TestPasswrod' ]) .exit(1) + .finally(() => { + try { deleteConfigFile() } catch {} + }) .it('runs login with invalid password', ctx => { expect(ctx.stdout).to.contain('Invalid password.') }) test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command([ 'login', `-e ${process.env.E2E_CLI_EMAIL}`, @@ -39,8 +49,12 @@ describe('login', () => { test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['logout']) .exit(0) + .finally(() => { + try { deleteConfigFile() } catch {} + }) .it('logout', ctx => { expect(ctx.stdout).to.contain(' ') }) diff --git a/packages/cli/test/commands/socket.test.ts b/packages/cli/test/commands/socket.test.ts new file mode 100644 index 00000000..65a4ca7a --- /dev/null +++ b/packages/cli/test/commands/socket.test.ts @@ -0,0 +1,182 @@ +import {expect, test} from '@oclif/test' +import { + createProject, + deleteConfigFile, + deleteInstance, + testsLocation, + uniqueInstance +} from '@syncano/test-tools' +import path from 'path' + +import {projectTestTemplate} from '../utils' + +describe('socket:list', () => { + beforeEach(() => { try { deleteConfigFile() } catch {} }) + test + .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) + .command(['socket:list']) + .exit(1) + .it('when not logged in', ctx => { + expect(ctx.stdout).to.contain('You are not logged in!') + }) + + test + .stdout() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .command(['socket:list']) + .exit(1) + .it('when no project', ctx => { + expect(ctx.stdout).to.contain('You have to attach this project to one of your instances') + }) +}) + +describe('socket', () => { + let testInstanceName = uniqueInstance() + let testInstanceNameNonExist = testInstanceName + 'non-exist' + + before(async () => { + await createProject(testInstanceName, projectTestTemplate) + process.chdir(path.join(testsLocation, testInstanceName)) + }) + + after(async () => { + await deleteInstance(testInstanceName) + }) + + test + .stdin('\n', 4000) + .stdout() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) + .command(['socket:create', 'test_socket']) + .exit(0) + .it('can be created', ctx => { + expect(ctx.stdout).to.contain('Your Socket configuration is stored at') + }) + + describe('socket:hot', () => { + test + .stdout() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) + .command(['socket:hot', '--mocked']) + .exit(0) + .it('runs in hot mode', ctx => { + expect(ctx.stdout).to.contain('socket synced') + }) + }) + + describe('socket:compile', () => { + test + .stdout() + .env({ + SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY, + SYNCANO_PROJECT_INSTANCE: testInstanceName + }) + .command(['socket:compile', 'test_socket']) + .exit(0) + .timeout(70000) + .it('compiles successfully', function (ctx) { + this.timeout(70000) + expect(ctx.stdout).to.contain('socket compiled:') + }) + }) + + describe('socket:deploy', () => { + test + .stdout() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) + .command(['socket:deploy', 'test_socket']) + .exit(0) + .it('deploys successfully', ctx => { + expect(ctx.stdout).to.contain('socket synced:') + expect(ctx.stdout).to.contain('total time:') + }) + + test + .stdout() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .env({SYNCANO_PROJECT_INSTANCE: testInstanceNameNonExist}) + .command(['socket:deploy']) + .exit(1) + .it('deploy fails when instance does not exists', ctx => { + expect(ctx.stdout).to.contain(`Instance ${testInstanceNameNonExist} was not found on your account!`) + }) + + test + .stdout() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) + .command(['socket:deploy', '--force']) + .exit(0) + .it('can be deployed with --force flag', ctx => { + expect(ctx.stdout).to.contain('total time:') + }) + }) + + describe('socket:config', () => { + test + .stdout() + .env({SYNCANO_AUTH_KEY: ''}) + .command(['socket:config']) + .exit(1) + .it('can not be configured as unauthenticated user', ctx => { + expect(ctx.stdout).to.contain('You are not logged in!') + }) + + test + .stdout() + .stderr() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) + .command(['socket:config:set', 'test_socket', 'TEST_VAR', 'test_value']) + .exit(1) + .it('can not set variable which doesn\'t exist in socket.yml file', ctx => { + expect(ctx.stderr).to.contain('No such config option!') + }) + + test + .stdout() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) + .command(['socket:config:show', 'test_socket']) + .exit(0) + .it('can not configure socket without options', ctx => { + expect(ctx.stdout).to.contain('This Socket doesn\'t have any config options') + }) + }) + + describe('socket:call', () => { + test + .stdout() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) + .command(['socket:call', 'test_socket/hello', '--firstname', 'john', '--lastname', 'doe']) + .do(ctx => expect(ctx.stdout).to.contain('Hello john doe!')) + .it('can call test_socket/hello endpoint') + }) + + describe('socket:list', () => { + test + .stdout() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) + .command(['socket:list', 'not_existing_socket']) + .exit(1) + .it('runs info when project is from env', ctx => { + expect(ctx.stdout).to.contain('No Socket was found on server nor in config!') + }) + + test + .stdout() + .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) + .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) + .command(['socket:list']) + .exit(0) + .it('shows test_socket', ctx => { + expect(ctx.stdout).to.contain('socket: test_socket') + }) + }) +}) diff --git a/packages/cli/test/commands/sockets/compile.test.ts b/packages/cli/test/commands/sockets/compile.test.ts deleted file mode 100644 index 6aa29caf..00000000 --- a/packages/cli/test/commands/sockets/compile.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import {expect, test} from '@oclif/test' -import { - createProject, - deleteInstance, - testsLocation, - uniqueInstance -} from '@syncano/test-tools' -import path from 'path' - -import {projectTestTemplate} from '../../utils' - -describe('socket:compile', () => { - let testInstanceName = uniqueInstance() - - test - .stdin('\n', 10000) - .stdout() - .env({ - SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY, - SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => createProject(testInstanceName, projectTestTemplate)) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .command(['socket:create', 'test_socket']) - .exit(0) - .it('create socket', function (ctx) { - this.timeout(70000) - process.stdin.once('data', data => { - if (data.toString() === '\n') { - expect(ctx.stdout).to.contain('Your Socket configuration is stored at') - } - }) - }) - - test - .stdout() - .env({ - SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY, - SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .finally(async () => deleteInstance(testInstanceName)) - .command(['socket:compile', 'test_socket']) - .exit(0) - .it('compile successful', ctx => { - expect(ctx.stdout).to.contain('socket compiled:') - }) -}) diff --git a/packages/cli/test/commands/sockets/config.test.ts b/packages/cli/test/commands/sockets/config.test.ts deleted file mode 100644 index 6ec72e41..00000000 --- a/packages/cli/test/commands/sockets/config.test.ts +++ /dev/null @@ -1,76 +0,0 @@ -import {expect, test} from '@oclif/test' -import { - createProject, - deleteInstance, - testsLocation, - uniqueInstance -} from '@syncano/test-tools' -import path from 'path' - -import {projectTestTemplate} from '../../utils' - -describe('socket:config', () => { - let testInstanceName = uniqueInstance() - - after(() => { - deleteInstance(testInstanceName) - }) - - test - .stdout() - .env({SYNCANO_AUTH_KEY: ''}) - .command(['socket:config']) - .exit(1) - .it('when not logged in', ctx => { - expect(ctx.stdout).to.contain('You are not logged in!') - }) - - test - .stdin('\n', 10000) - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => createProject(testInstanceName, projectTestTemplate)) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .command(['socket:create', 'test_socket']) - .exit(0) - .it('create socket', ctx => { - process.stdin.once('data', data => { - if (data.toString() === '\n') { - expect(ctx.stdout).to.contain('Your Socket configuration is stored at') - } - }) - }) - - test - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .command(['socket:deploy', 'test_socket']) - .exit(0) - .it('deploy socket') - - test - .stdout() - .stderr() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .command(['socket:config:set', 'test_socket', 'TEST_VAR', 'test_value']) - .exit(1) - .it('set variable which doesn\'t exist in config file', ctx => { - expect(ctx.stderr).to.contain('No such config option!') - }) - - test - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .command(['socket:config:show', 'test_socket']) - .exit(0) - .it('show when there is no options', ctx => { - expect(ctx.stdout).to.contain('This Socket doesn\'t have any config options') - }) -}) diff --git a/packages/cli/test/commands/sockets/create.test.ts b/packages/cli/test/commands/sockets/create.test.ts deleted file mode 100644 index 062f37f9..00000000 --- a/packages/cli/test/commands/sockets/create.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {expect, test} from '@oclif/test' -import { - createProject, - deleteInstance, - testsLocation, - uniqueInstance -} from '@syncano/test-tools' -import path from 'path' - -import {projectTestTemplate} from '../../utils' - -describe('socket:create', () => { - let testInstanceName = uniqueInstance() - - test - .stdin('\n', 10000) - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => createProject(testInstanceName, projectTestTemplate)) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .command(['socket:create', 'test_socket']) - .exit(0) - .it('create socket', ctx => { - process.stdin.once('data', data => { - if (data.toString() === '\n') { - expect(ctx.stdout).to.contain('Your Socket configuration is stored at') - } - }) - }) - - test - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .finally(async () => deleteInstance(testInstanceName)) - .command(['socket:list']) - .exit(0) - .it('is it exist', ctx => { - expect(ctx.stdout).to.contain('socket: test_socket') - }) -}) diff --git a/packages/cli/test/commands/sockets/deploy.force.test.ts b/packages/cli/test/commands/sockets/deploy.force.test.ts deleted file mode 100644 index 0ce78a12..00000000 --- a/packages/cli/test/commands/sockets/deploy.force.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {expect, test} from '@oclif/test' -import { - createProject, - deleteInstance, - testsLocation, - uniqueInstance -} from '@syncano/test-tools' -import path from 'path' - -import {projectTestTemplate} from '../../utils' - -describe('socket:deploy:with force', () => { - let testInstanceName = uniqueInstance() - - test - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => createProject(testInstanceName, projectTestTemplate)) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .finally(async () => deleteInstance(testInstanceName)) - .command(['socket:deploy', '--force']) - .exit(0) - .it('deploy with force', ctx => { - expect(ctx.stdout).to.contain('total time:') - }) -}) diff --git a/packages/cli/test/commands/sockets/deploy.noinstance.test.ts b/packages/cli/test/commands/sockets/deploy.noinstance.test.ts deleted file mode 100644 index 939c2911..00000000 --- a/packages/cli/test/commands/sockets/deploy.noinstance.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {expect, test} from '@oclif/test' -import { - createProject, - deleteInstance, - testsLocation, - uniqueInstance -} from '@syncano/test-tools' -import path from 'path' - -import {projectTestTemplate} from '../../utils' - -describe('socket:deploy:instance not found', () => { - let testInstanceName = uniqueInstance() - let testInstanceNameNonExist = testInstanceName + 'non-exist' - - test - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceNameNonExist}) - .do(async () => createProject(testInstanceName, projectTestTemplate)) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .finally(async () => deleteInstance(testInstanceName)) - .command(['socket:deploy']) - .exit(1) - .it('instance not found', ctx => { - expect(ctx.stdout).to.contain(`Instance ${testInstanceNameNonExist} was not found on your account!`) - }) -}) diff --git a/packages/cli/test/commands/sockets/deploy.test.ts b/packages/cli/test/commands/sockets/deploy.test.ts deleted file mode 100644 index b496ca23..00000000 --- a/packages/cli/test/commands/sockets/deploy.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import {expect, test} from '@oclif/test' -import { - createProject, - deleteInstance, - testsLocation, - uniqueInstance -} from '@syncano/test-tools' -import path from 'path' - -import {projectTestTemplate} from '../../utils' - -describe('socket:deploy', () => { - let testInstanceName = uniqueInstance() - - test - .stdin('\n', 10000) - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => createProject(testInstanceName, projectTestTemplate)) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .command(['socket:create', 'test_socket']) - .exit(0) - .it('create socket', ctx => { - process.stdin.once('data', data => { - if (data.toString() === '\n') { - expect(ctx.stdout).to.contain('Your Socket configuration is stored at') - } - }) - }) - - test - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .do(async () => process.chdir(path.join(testsLocation, testInstanceName))) - .finally(async () => deleteInstance(testInstanceName)) - .command(['socket:deploy']) - .exit(0) - .it('deploy successful', ctx => { - expect(ctx.stdout).to.contain('socket synced:') - expect(ctx.stdout).to.contain('total time:') - }) -}) diff --git a/packages/cli/test/commands/sockets/list.test.ts b/packages/cli/test/commands/sockets/list.test.ts deleted file mode 100644 index 4ad8d2d1..00000000 --- a/packages/cli/test/commands/sockets/list.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {expect, test} from '@oclif/test' -import {createInstance, deleteInstance, uniqueInstance} from '@syncano/test-tools' -// import sinon from 'sinon' - -// import session from '../../../lib/utils/session' - -describe('socket:list', () => { - let testInstanceName = uniqueInstance() - test - .stdout() - .command(['socket:list']) - .exit(1) - .it('when not logged in', ctx => { - expect(ctx.stdout).to.contain('You are not logged in!') - }) - - test - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .command(['socket:list']) - .exit(1) - .it('when no project', ctx => { - expect(ctx.stdout).to.contain('You have to attach this project to one of your instances') - }) - - test - .stdout() - .env({SYNCANO_AUTH_KEY: process.env.E2E_CLI_ACCOUNT_KEY}) - .env({SYNCANO_PROJECT_INSTANCE: testInstanceName}) - .command(['socket:list', 'not_existing_socket']) - .exit(1) - .it('runs info when project is from env', ctx => { - expect(ctx.stdout).to.contain('No Socket was found on server nor in config!') - }) -}) diff --git a/packages/cli/test/commands/sysinfo.test.ts b/packages/cli/test/commands/sysinfo.test.ts index ef29f021..67f17109 100644 --- a/packages/cli/test/commands/sysinfo.test.ts +++ b/packages/cli/test/commands/sysinfo.test.ts @@ -3,6 +3,7 @@ import {expect, test} from '@oclif/test' describe('info', () => { test .stdout() + .env({SYNCANO_AUTH_KEY: undefined}) .command(['sysinfo']) .exit(0) .it('runs info when not logged in', ctx => { diff --git a/packages/cli/tsconfig.tsbuildinfo b/packages/cli/tsconfig.tsbuildinfo index 5aada71d..97709653 100644 --- a/packages/cli/tsconfig.tsbuildinfo +++ b/packages/cli/tsconfig.tsbuildinfo @@ -465,44 +465,40 @@ "version": "e91ad231af87f864b3f07cd0e39b1cf6c133988156f087c1c3ccb0a5491c9115", "signature": "e91ad231af87f864b3f07cd0e39b1cf6c133988156f087c1c3ccb0a5491c9115" }, - "../lib-js-core/node_modules/@types/node-fetch/externals.d.ts": { - "version": "972f1e91dab93b182624a17eeed02f683b8cb3fefbda7b689cc84570029d5f73", - "signature": "972f1e91dab93b182624a17eeed02f683b8cb3fefbda7b689cc84570029d5f73" - }, "../lib-js-core/node_modules/@types/node-fetch/index.d.ts": { - "version": "27401d471614076257eb419b8cb402dfb856c5160308bd94f60ff5356a53edcf", - "signature": "27401d471614076257eb419b8cb402dfb856c5160308bd94f60ff5356a53edcf" + "version": "ffff2ac872614b40f5606d17e094129ccf6417699ec1d60b91933c2f4de1fcb2", + "signature": "ffff2ac872614b40f5606d17e094129ccf6417699ec1d60b91933c2f4de1fcb2" }, "../lib-js-core/lib/syncano-core.d.ts": { - "version": "c4457fa2ec3a8f8dc09eabdf7f56b4c10b1c0fdd2535c57dcf77ba38722058f2", - "signature": "c4457fa2ec3a8f8dc09eabdf7f56b4c10b1c0fdd2535c57dcf77ba38722058f2" + "version": "bdc9355796e2a8f21603b9a016bbdfb502323eb8ebbb0eb10bcae1db2756bd90", + "signature": "bdc9355796e2a8f21603b9a016bbdfb502323eb8ebbb0eb10bcae1db2756bd90" }, "./node_modules/@types/mkdirp/index.d.ts": { "version": "6396a7a06f3ef0fc31a7c89330e015146b78a2256b030c698b6d404594c37b8f", "signature": "6396a7a06f3ef0fc31a7c89330e015146b78a2256b030c698b6d404594c37b8f" }, "./src/types.ts": { - "version": "2cf7b13dfbf659d0d904817db209c355075fb8dcda2467860ddd09df9bf9d193", - "signature": "04657ddc56e652ea5c20c5bef57b9d71a2758c302afb83a39cac05b22fbc4539" + "version": "3a058e53d321aaf9f0020d547637c77d0c6eb582d3fbe69c5d4127d43ec52833", + "signature": "fb1345356be10cd55b43df8c941045c5efe6ee4fa613b3efb7919ac2fef42279" }, "./node_modules/@types/js-yaml/index.d.ts": { "version": "a2abc05a7158003fd510ce36b86d9a1f1a00861baa9d4f7e0e7537a74870cd30", "signature": "a2abc05a7158003fd510ce36b86d9a1f1a00861baa9d4f7e0e7537a74870cd30" }, "./src/settings/settings.ts": { - "version": "c628706dca5a3b97f74f103faf8a147bfb3c7e3931e5c45178497bd98aac2dc7", - "signature": "b6d7c1dccc1ceb16a3243f4dc4868c19a54c6d59dfef5d30b4585bbcee89e2bc" + "version": "d38854950bee9f7c719a94c84817e25df8d11d4dff9ab978a3b426ec941f65e5", + "signature": "6afe1db1228311539cf48855282f3ec002bd0bffc1c08121363de577fd87cc5a" }, "./src/settings/accountSettings.ts": { - "version": "1882b182448f06a569e7347fff74f64037a9d9b4a37f7290053f4cebd8237d64", - "signature": "e652cf993c85a12d54a6e5b4c6b39c3ce622da455d65d9cc10538663cc8b31b6" + "version": "5b4780c1f710ba1d384cf12b4c335e4c8c85b82802d8976df1c19c66fa080bd7", + "signature": "91e5ab580b435ca0f73e82a899131dfb084f8b63be58e68edf6cfeb447f6e2ee" }, "./node_modules/readdirp/index.d.ts": { "version": "c23c02656d8e3d4ed9f59afd6ee1c13617d963e8d419b432fb535cab66c13bc9", "signature": "c23c02656d8e3d4ed9f59afd6ee1c13617d963e8d419b432fb535cab66c13bc9" }, "./src/settings/projectSettings.ts": { - "version": "d35614a4c146dd09d0d4dbf4e4388a747cef88c0ec2ef8e1814a7ac5a7e2517b", + "version": "ee0a6f144f41a99ce54dc58cd15ad71314f2a0fda32fa3a85a8e821ee7be2dd3", "signature": "327eeb72dc6353a9037ef3a4f6a54aff9e96b6d44c45e47e4b05a453d2d3cb4c" }, "./node_modules/@types/semver/index.d.ts": { @@ -542,16 +538,16 @@ "signature": "2c1a0dbd6ba6097fd73e731711eafb059fda4f1acd2bf7c3db3bed6677149aa2" }, "./src/utils/hosting/hosting.ts": { - "version": "aebd5262cf5f18fc391e3f0802ebd282b9e6fbda98f1b4fde4acd0faadb4433c", - "signature": "09b4cfb9c962f88c3ac005129629251704f27a1b79a73b9997cef57374fc2526" + "version": "d2c5372fc9aa73efa9640c05a05c91d24ae0dcf3fdabd4becf7642bde057b125", + "signature": "b35f090c6af73d4465a9592c094714f60b62f1755ffae76c276fd87d99c927d5" }, "./src/utils/hosting/index.ts": { "version": "c76878c78a1243854c4d72c7f956605611a096ae78ef0147fe4824b49895761b", "signature": "9b2824543436ee5a668917f51f474a908163c873ddd345b8c7da1c3d74441ed8" }, "./src/utils/plugins/plugins.ts": { - "version": "b5f99dc89ecc5434816230ba30ce5907a9138969d3ac52464e885eae9cae7c40", - "signature": "f18963ff935bdbc2ade1d66b8cd927c3796280f93097c11c03eea1dbc56b258a" + "version": "859ec271bb3e5e22c29857896af7edb11816eab3ec8aed7d1d3456cec9c3b396", + "signature": "1e4d8cd2dee38357c353463e23c0e99e77489b143b391b6b639f3707bd0ca5bb" }, "./src/utils/plugins/index.ts": { "version": "52f6bf581de7af504ac19b3e76b40fff2ba5c776e26ce0e4a8e236ca23a8def4", @@ -598,8 +594,8 @@ "signature": "af39a570223e02cabc3530428ed48623acf1a3c72ffebf6e2182b8365b96a7fa" }, "./src/utils/sockets/sockets.ts": { - "version": "c4091e5421d1c2064d5b2c85a6035539ea615655e52e5b91f7fd3789e2535d8e", - "signature": "bc553140f6ba4239d10d0fbab30b25ed17f262ce627a218cc2a56d58637a7518" + "version": "4c7244d3c90473ef0976a05a19fe92a34920f2806def042ebce31ed348caead5", + "signature": "5919bfa3002d9b3461683b66aa2272ba1cd7e91ddfa94591f7a1a27d87f498e9" }, "./src/utils/sockets/index.ts": { "version": "1d6104e45540bea83b6d66906a94b40a52de0e6cf19ce2c145027389a79904b0", @@ -610,12 +606,12 @@ "signature": "60bdf0269bf2aa62763db6b41c473370b7a926b789a76f0879a7d1ed40da6250" }, "./src/utils/session.ts": { - "version": "e556462606ac69f19526f5ed5ba5adff882918301e069f28e9cbca9f4062b00c", - "signature": "ff1b11d011bd8a2b534207d54e0d67fa1ee5803eb2063c887414d6e810322fd1" + "version": "bf548ba2fbc5f295ac1b8b8774f95eaadfc9198041334f71f31622a7e841983d", + "signature": "a61cbd3511a9b70edc3366783bed829794d2723887181c517e4b5d41c9fdc942" }, "./src/utils/init/init.ts": { - "version": "77c8ad0471411c2931a967ed6b5fbab125543f6d65dce20e29e04fd035466148", - "signature": "a4025800f57c1506f7c6a0ab27d83b7fc6b52dd9b4d16f6c8f320360934fb244" + "version": "7d431bf72d044adcd7de328ab3c72237fb4488d29a1d0f5e03d9d6443b56e25b", + "signature": "a7063f6db4bb166e285acc80c83158008a6746ca17d0052e0f93bdc5e4155229" }, "./src/utils/init/index.ts": { "version": "618e436b36eff5f48df895528bf1ab168751f1152e3e609e618c3f4965093f38", @@ -898,17 +894,21 @@ "signature": "91b5ce1eeb20e404fde97d265f70e57170100090ac20f4967511bfe0f7c02091" }, "./src/commands_helpers/create-instance.ts": { - "version": "562300b9b99a9ccbb47727177870bce2e38ec5a94c4bbd5235d125a1722b5ceb", - "signature": "df60d3dfcdff56f4c738892a441f41833625bfdf03158566138d92e992eb29e6" + "version": "be11dec349f1bdc66790b65674bc8cfc909cd5fc5a0163a1103a6b5d4453274c", + "signature": "1899ee98350acdd846f0474b800a66678507189ba5e58882874d4f4dfce5547c" }, "./src/commands/attach.ts": { - "version": "ca85394e54ef4dbdf0fde37eb440ce1f4a32bdcbdc832d0d6bda018ddfa549b2", - "signature": "996ca29108eed6b90b0649df4e2bde6f0e3c18a41c06e51b30f5f76c2a048ab9" + "version": "0f220b8b971a1268adbf2f67c7a4b105719c037158a4519bf681545c5e8f7f17", + "signature": "9dd386ecc830033d84fdc59d0bb9e4b0e56e87f58a08d427b77d264169767d5b" }, "./src/commands/info.ts": { - "version": "e8c289be53baf860c0637694d5fffd8f57f04195a4b05331c7f514f3ea0ce20e", + "version": "a6362b4d345497e463e5137ed6557e82d8879211bcb557c99fd9dcc863a98ee0", "signature": "85572d0e39924d82dd1757fdeb06f0f5ae80c96f505ccd4ef4cbbf05fe9a3c45" }, + "./src/commands_helpers/instance.ts": { + "version": "bf8248c0dfb1284b043453d839441abe781b7803d5675907c2495fa5d82287ba", + "signature": "dbd6df1d62e54a05cc19d922be630171253b966dbc4cd6221f73c8f1bf5c6d25" + }, "./node_modules/commander/typings/index.d.ts": { "version": "df723c5337a86e061d0f8bacd9e0b8d56fdd9a5d333249d1358fdff10571ef55", "signature": "df723c5337a86e061d0f8bacd9e0b8d56fdd9a5d333249d1358fdff10571ef55" @@ -917,20 +917,20 @@ "version": "ab745bb6f63d4b128d17a7be0e22c787d614f162b6d83e07e8829556b129b756", "signature": "dc36fe10a53fea21d39daf50b551d7825b5b5c278959f5ae1945ac2aac9e8a10" }, + "./src/commands/init.ts": { + "version": "2b1104cd06be2e19e0792d01dd2684ce571b0f76ddc5c7f9e99fe350b7afa1e1", + "signature": "db046f037b977d6f7618ab21a0b5dfaed8a84aee098b70cebad0e51a783c90f2" + }, "./node_modules/@types/validator/index.d.ts": { "version": "4dab36ee5a6752cea8aeda3ec5976eeb6b660f8090de0db241b67f6f3a35b137", "signature": "4dab36ee5a6752cea8aeda3ec5976eeb6b660f8090de0db241b67f6f3a35b137" }, "./src/commands/login.ts": { - "version": "c8a75ead8b2882907577879720b600f5f347e4c19329709bd8f1899c9e5f1449", - "signature": "a4f4bdb5d51b8359c274420b391c95c325f83d0d5da9efb3d2948fe0ea335db8" - }, - "./src/commands/init.ts": { - "version": "65b088ad981bb252bf6ab3f0f890b0781b30553ab592ab6074466bcce8ad43b1", - "signature": "eb89817c619bd925779952e5ec13fde25dc50d3636162f7dc2307e2600269ca8" + "version": "dab3102c40daf620721224f49000e951911744160b477872eaf3092eb1d8381d", + "signature": "f2b7c03f1e5b1ab88f80dace3b466abad2d4246ec4de266d2eafc3200f493cdd" }, "./src/commands/logout.ts": { - "version": "7955efbf76815cf35b2b9d4260fa51152681bf47392bdebea5bedc0d32653633", + "version": "10e7c2418a3b9aba59a77d9558129985ae2acff4a36048814ec7aba43875913a", "signature": "c9009599f2134ac944beb4e154d33e24a3f18c41e061077b2f1de77967ffaa19" }, "./src/commands/sysinfo.ts": { @@ -950,12 +950,16 @@ "signature": "19af4cf1c18a6bd6de9e5941bd37f32298d0fc258d000c7159a00d680b87c060" }, "./src/commands/backup/create.ts": { - "version": "02a8b9a5336795c0deebbccb7ce2df1981993f0d5d6217a002fe42591b42b23a", - "signature": "38225a7b81f00e5d2845986c89e95e0f1db1afe47bc14996361b2551a07b4692" + "version": "a158b48c88423c830c0c630c2160ba1d96d10bf95aaf6ba2b0db6d2c0a438a78", + "signature": "03066758742817d51144da9c37259b1d0ce7e364c43edb23c6e7a6dbc372ad2c" }, "./src/commands/backup/delete.ts": { - "version": "c0091b27b59dd40a7d72de19191f12328c152f0cbd779eb4f8807ca36baf3585", - "signature": "36acc491e99bcb46926e29c17f2c7bf12ca84d2755c075395729ab66ebee55e2" + "version": "66728fa8c7c4edda52752c96bd65b0567518f1a84bfe64f3593b498a059fb0d0", + "signature": "c897c36f5d836edd5a6b05c5fd5056e5e0356c93c6e7485c25658ff81073dfae" + }, + "./src/commands/backup/index.ts": { + "version": "865cdfb59c738861600139cacacb9b583eedb295c06160a743b3bbca58e934e3", + "signature": "1f1d91264b625353dad9704c4d709641ef99a34185d32e6c6fe4601b30a65d7f" }, "./src/commands_helpers/backups.ts": { "version": "2cd8d4629c79e62777bff573fe0d78672a92f38e232386fb8160c63a79b5b762", @@ -966,8 +970,8 @@ "signature": "028d0326d75ea5ab7ba079816f937f8a6848008022951f3de408c1ade8994740" }, "./src/commands/backup/list.ts": { - "version": "66308745c49a47ad102bfb65d7e60554ac1434971903a04c2f9bd8703e985586", - "signature": "0f954c9f4a856ea1146b1f68d0791315ce860d18bd057c966f20c5fcee36a252" + "version": "66e28c7171b05877f64788cca296858cf63731b1230a4fb88a374a4bea9942b4", + "signature": "0f3801a462e1b54d5ddeab699e067c4dd934d3485a1939d1c347da21cbc7547f" }, "./node_modules/@types/bluebird/index.d.ts": { "version": "4e4434124ea1d664a6fec58e241c292b9fce7f9254318aa1466f8c9b19acc6e2", @@ -978,8 +982,8 @@ "signature": "576d84f1dd584b3d5a9d52f938cc17b5e37e2fab60aff899ec23ed1772628148" }, "./src/commands/hosting/add.ts": { - "version": "ca79acd5e3184b391d06206f4348c6a8b3dd8079d7603ab9b63a356ddc090cbf", - "signature": "662ea56ac4b146ecac3fa3acc287b69a971a02ea59b32b2f0c7a26389535ef25" + "version": "710f28761107784146aae77f16fcff8c536a1e8d7895a4ed1175c212fe016fda", + "signature": "96e25d3169ccb4f403eaa9610bee30d6fcf5eb2e8b914858be7ca710e86345a4" }, "./src/commands/hosting/list.ts": { "version": "b75da5876e98fccd6c074f935032656fabebd6af96179c112296091384a3c177", @@ -1001,29 +1005,33 @@ "version": "8e37429c7a6109b8e90c634fe41ed3d52aaec4ab7ff2b572c01959ae6c7f406e", "signature": "898e7d6e62f1e4d1570f3e572e007ad25db04a3291c71eb868373d15ecdcb2c8" }, + "./src/commands/hosting/index.ts": { + "version": "7ed33b97d031ab3fd5e5f7f9fc00c6537f04b4dbe9725534be289f1c059ffb9e", + "signature": "261f4442cba0b7ffe32d2dbc63e2272a8ccf31de5aa9f7b8bafc667cc0ca427c" + }, "./src/commands/instance/create.ts": { "version": "786b801d9907237c59bf298f825a490343ee47775a138de30440dcb192123214", "signature": "b3cf615e7c78da8adaa1d9dd415f57e84a355dcabab5457d66b2888b55280ddf" }, "./src/commands/instance/delete.ts": { - "version": "e97dca79ca36fb1feb50464f1f94833c7fd52566498c6ec5c152aa45d7e7a789", + "version": "0f98c7123d3082b5894912033e7d85a90184b435477aaaebac3c9460b9a0f0e8", "signature": "b08aa1962ed511de219776310ae352c8126f2dbef134672219a0f4c23ccc3f21" }, "./src/commands/instance/list.ts": { - "version": "7d2394a9ff057f295bb8b21c7ee4b3a99f47b774350bebb2b0afefb1eaa34e54", + "version": "783b96ecadf5245eb61b9662fa5b734aafb6ffc1373ee79971c2b07565b8c5be", "signature": "44a4149ae3eb7640a835bf9aa358ce611e0b8a3615853d22d7a60b10350e3a7e" }, "./src/commands/socket/call.ts": { - "version": "0c48e7e92c7a625519680c4fc5dbb936e8a6cbe6625b9818b9225f34b26b300d", - "signature": "dcab720f08f1f34325e597a286384b2405d17a02aa197c9a77113ae2b795b23e" + "version": "2dcf395a39adb88a014932f53574f2c44148b8a590fcbf581fa7bb4d633121e7", + "signature": "64b4281d7ce7ce48ed479433a87de19faadb13408b062a6cad02f8f7081cc83d" }, "./src/utils/date-utils.ts": { "version": "e746917f0e4bd4cbae7f843e06f9ed62cdd66f1a090d7114065a17008bb44c5b", "signature": "76cf349f4343e4a1a5e40b1116277f8b75e0749b97f976c0853b717416713e68" }, "./src/commands/socket/compile.ts": { - "version": "16781c00fb56b57758dd3829239f979f984e22a7f31cb66201e4178ba9a89b4b", - "signature": "1fda26ec5baeebef0c80652f5cbd0a4993a52b6807ff506e35fb4fd07c5098bc" + "version": "38f5412b99870b8a68d0838016b523f995306899b46738b3956bfc909d02d600", + "signature": "42026b8fe7c98b3d87dbb2d072d00f2003dc401f7a94c83f01d1fd77668248d2" }, "./src/commands/socket/create.ts": { "version": "71a28b925fb3f58f027ec0be970c883b06bc4fa7aa1ea93326b3f5eac569d36f", @@ -1037,17 +1045,13 @@ "version": "8940b429e5fe2341862f7a8c4a74b3cbc593d2b5938fa8bd2f1ec077413079fb", "signature": "8940b429e5fe2341862f7a8c4a74b3cbc593d2b5938fa8bd2f1ec077413079fb" }, - "./src/commands_helpers/instance.ts": { - "version": "bf8248c0dfb1284b043453d839441abe781b7803d5675907c2495fa5d82287ba", - "signature": "dbd6df1d62e54a05cc19d922be630171253b966dbc4cd6221f73c8f1bf5c6d25" - }, "./src/commands_helpers/socket.ts": { "version": "87a79aa9fccc01953d91fadfdf49a75cbdd6c4e86809dd9d476a8e1a20f2b0aa", "signature": "8bb8603a7be77c3bc64e7f2894423334f2753cd7807a6df78520879b3dabfd7c" }, "./src/commands/socket/deploy.ts": { - "version": "565f7985a56cd5e8a94dbb659c6b4031a6cbd718ac6ab5c9f140156a034c640f", - "signature": "f3ac18a19adee5f86e70e424255a07c5c42baf4be4ef3ce83077887696c48bf6" + "version": "26152cba28d6ab4028f774d4e52610d1d3b87a608c5816ff05bc6ab06dd408ab", + "signature": "906b40bbee0875af12dbd85f5b339e2dd00ed58559ae856f96f6906ba26d0185" }, "./node_modules/chokidar/types/index.d.ts": { "version": "ca7f76d3ea132bde53dca1a0f33cda95397d20c248e452c050773f01504d9802", @@ -1058,8 +1062,8 @@ "signature": "3029d4ba707efd3acd2f75a3087e58ef1008904a46bea0d1733b002e963284fb" }, "./src/commands/socket/hot.ts": { - "version": "123fc012367d84b747f999b41a3961348c7bb6d521e669760674e653a941dd57", - "signature": "df09deeab8c575269e3f9bf3b2105c60c507eead155e6bdc0efa48fa5b140cc7" + "version": "e4d6772faec76622a10afe70e0f9220a2403bbd47fa599bbb857ba269c689ed0", + "signature": "74e14286fdb4adf446c83ea6a6d7ecefa2936e32713c96a5a80d96aab0c7eed9" }, "./src/commands_helpers/socket-list-responses.ts": { "version": "43f76ec34947a81b2eb9a5de126353a1685e0931c212e6d0cb147a877fe843eb", @@ -1074,7 +1078,7 @@ "signature": "704d0e29a125794208433e69db25b31fad52ce8afc32d3cffbdbf9c687442aad" }, "./src/commands/socket/config/config.ts": { - "version": "724dd1b076df1d8943a76aa26f4b94057e588f775379f96fafedbc511d5a6bfe", + "version": "6a03086d48e0e9c2a166df3bdb41312dc3308ed31b99fc57ea7f28855249f1f7", "signature": "55902282676dd6f20c82cc8d70c8a356ebe930b633775b74be6145fb7004316c" }, "./src/commands/socket/config/set.ts": { @@ -1091,11 +1095,7 @@ }, "./src/utils/error-response.ts": { "version": "6a71ac1e3b65b899acc8614b8b637208c920ce1dc062b1a3d59432127e95b65f", - "signature": "884528e5dd1c20db826cfc6ad1f2203c0487b03a50158fba238df44dabcfc0fb" - }, - "./src/utils/index.ts": { - "version": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "signature": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + "signature": "e7f73d46ef248b0a8690c732ffff186428385edb3ec747320d5321d70a337e93" }, "./src/utils/raven.ts": { "version": "7abfc1da7f8ac1ba396df655b59d5370a266fca9698abe49b2201929a8f23986", @@ -1152,10 +1152,6 @@ "./node_modules/@types/xml2js/index.d.ts": { "version": "b39516514dddbd0abac5263dd2a906fcfa4df44c15742f490dfe222a252b5af3", "signature": "b39516514dddbd0abac5263dd2a906fcfa4df44c15742f490dfe222a252b5af3" - }, - "../../node_modules/@types/npm/index.d.ts": { - "version": "a72ebe29f5251b488b65109779695e978a5b2052496e50e1ac2e94526eaf9768", - "signature": "a72ebe29f5251b488b65109779695e978a5b2052496e50e1ac2e94526eaf9768" } }, "options": { @@ -2158,16 +2154,9 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], - "../lib-js-core/node_modules/@types/node-fetch/externals.d.ts": [ - "./node_modules/@types/node/fs.d.ts", - "./node_modules/@types/node/ts3.2/fs.d.ts", - "./node_modules/@types/node/util.d.ts", - "./node_modules/@types/node/ts3.2/util.d.ts" - ], "../lib-js-core/node_modules/@types/node-fetch/index.d.ts": [ "./node_modules/@types/node/http.d.ts", "./node_modules/@types/node/url.d.ts", - "../lib-js-core/node_modules/@types/node-fetch/externals.d.ts", "./node_modules/@types/node/ts3.2/index.d.ts", "./node_modules/@types/node/fs.d.ts", "./node_modules/@types/node/ts3.2/fs.d.ts", @@ -2312,6 +2301,7 @@ "./node_modules/@types/node/ts3.2/util.d.ts" ], "./src/utils/hosting/hosting.ts": [ + "../lib-js-core/lib/syncano-core.d.ts", "./node_modules/axios/index.d.ts", "./node_modules/chalk/types/index.d.ts", "./node_modules/@types/node/fs.d.ts", @@ -2319,7 +2309,6 @@ "./node_modules/@types/md5/index.d.ts", "./node_modules/@types/node/path.d.ts", "./node_modules/pretty-bytes/index.d.ts", - "../lib-js-core/lib/syncano-core.d.ts", "./src/types.ts", "./src/utils/debug.ts", "./src/utils/print-tools.ts", @@ -2338,10 +2327,10 @@ ], "./src/utils/plugins/plugins.ts": [ "./node_modules/@types/node/path.d.ts", + "./src/types.ts", "./src/utils/debug.ts", "./src/utils/print-tools.ts", "./src/utils/session.ts", - "./src/types.ts", "./node_modules/@types/node/fs.d.ts", "./node_modules/@types/node/ts3.2/fs.d.ts", "./node_modules/@types/node/util.d.ts", @@ -2506,6 +2495,7 @@ "./src/utils/debug.ts", "./src/utils/print-tools.ts", "./src/utils/session.ts", + "./src/types.ts", "./src/utils/templates.ts", "./node_modules/@types/node/fs.d.ts", "./node_modules/@types/node/ts3.2/fs.d.ts", @@ -3166,6 +3156,14 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], + "./src/commands_helpers/instance.ts": [ + "./node_modules/chalk/types/index.d.ts", + "./src/utils/print-tools.ts", + "./node_modules/@types/node/fs.d.ts", + "./node_modules/@types/node/ts3.2/fs.d.ts", + "./node_modules/@types/node/util.d.ts", + "./node_modules/@types/node/ts3.2/util.d.ts" + ], "./node_modules/commander/typings/index.d.ts": [ "./node_modules/@types/node/fs.d.ts", "./node_modules/@types/node/ts3.2/fs.d.ts", @@ -3182,34 +3180,36 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], - "./node_modules/@types/validator/index.d.ts": [ - "./node_modules/@types/node/fs.d.ts", - "./node_modules/@types/node/ts3.2/fs.d.ts", - "./node_modules/@types/node/util.d.ts", - "./node_modules/@types/node/ts3.2/util.d.ts" - ], - "./src/commands/login.ts": [ + "./src/commands/init.ts": [ "./node_modules/@oclif/command/lib/index.d.ts", "./node_modules/chalk/types/index.d.ts", "./node_modules/@types/inquirer/index.d.ts", - "./node_modules/@types/validator/index.d.ts", - "../lib-js-core/lib/syncano-core.d.ts", "./src/base_command.ts", + "./src/commands_helpers/create-instance.ts", + "./src/commands_helpers/instance.ts", + "./src/types.ts", "./src/utils/analytics.ts", - "./src/utils/debug.ts", + "./src/utils/unique-instance.ts", "./node_modules/@types/node/fs.d.ts", "./node_modules/@types/node/ts3.2/fs.d.ts", "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], - "./src/commands/init.ts": [ + "./node_modules/@types/validator/index.d.ts": [ + "./node_modules/@types/node/fs.d.ts", + "./node_modules/@types/node/ts3.2/fs.d.ts", + "./node_modules/@types/node/util.d.ts", + "./node_modules/@types/node/ts3.2/util.d.ts" + ], + "./src/commands/login.ts": [ + "./node_modules/@oclif/command/lib/index.d.ts", + "../lib-js-core/lib/syncano-core.d.ts", "./node_modules/chalk/types/index.d.ts", "./node_modules/@types/inquirer/index.d.ts", + "./node_modules/@types/validator/index.d.ts", "./src/base_command.ts", - "./src/commands_helpers/create-instance.ts", "./src/utils/analytics.ts", - "./src/types.ts", - "./src/commands/login.ts", + "./src/utils/debug.ts", "./node_modules/@types/node/fs.d.ts", "./node_modules/@types/node/ts3.2/fs.d.ts", "./node_modules/@types/node/util.d.ts", @@ -3255,7 +3255,9 @@ "./node_modules/@types/node/ts3.2/util.d.ts" ], "./src/commands/backup/create.ts": [ + "./node_modules/@oclif/command/lib/index.d.ts", "../lib-js-core/lib/syncano-core.d.ts", + "./node_modules/chalk/types/index.d.ts", "./src/base_command.ts", "./src/commands_helpers/spinner.ts", "./node_modules/@types/node/fs.d.ts", @@ -3265,6 +3267,7 @@ ], "./src/commands/backup/delete.ts": [ "./node_modules/@oclif/command/lib/index.d.ts", + "../lib-js-core/lib/syncano-core.d.ts", "./src/base_command.ts", "./src/commands_helpers/spinner.ts", "./node_modules/@types/node/fs.d.ts", @@ -3272,6 +3275,14 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], + "./src/commands/backup/index.ts": [ + "./node_modules/chalk/types/index.d.ts", + "./src/base_command.ts", + "./node_modules/@types/node/fs.d.ts", + "./node_modules/@types/node/ts3.2/fs.d.ts", + "./node_modules/@types/node/util.d.ts", + "./node_modules/@types/node/ts3.2/util.d.ts" + ], "./src/commands_helpers/backups.ts": [ "./node_modules/chalk/types/index.d.ts", "./src/utils/print-tools.ts", @@ -3291,6 +3302,7 @@ "./node_modules/@types/node/ts3.2/util.d.ts" ], "./src/commands/backup/list.ts": [ + "../lib-js-core/lib/syncano-core.d.ts", "./node_modules/chalk/types/index.d.ts", "./src/base_command.ts", "./src/commands_helpers/backups.ts", @@ -3382,6 +3394,14 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], + "./src/commands/hosting/index.ts": [ + "./node_modules/chalk/types/index.d.ts", + "./src/base_command.ts", + "./node_modules/@types/node/fs.d.ts", + "./node_modules/@types/node/ts3.2/fs.d.ts", + "./node_modules/@types/node/util.d.ts", + "./node_modules/@types/node/ts3.2/util.d.ts" + ], "./src/commands/instance/create.ts": [ "./src/base_command.ts", "./src/commands_helpers/create-instance.ts", @@ -3515,14 +3535,6 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], - "./src/commands_helpers/instance.ts": [ - "./node_modules/chalk/types/index.d.ts", - "./src/utils/print-tools.ts", - "./node_modules/@types/node/fs.d.ts", - "./node_modules/@types/node/ts3.2/fs.d.ts", - "./node_modules/@types/node/util.d.ts", - "./node_modules/@types/node/ts3.2/util.d.ts" - ], "./src/commands_helpers/socket.ts": [ "./node_modules/chalk/types/index.d.ts", "./node_modules/@types/inquirer/index.d.ts", @@ -3665,12 +3677,6 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], - "./src/utils/index.ts": [ - "./node_modules/@types/node/fs.d.ts", - "./node_modules/@types/node/ts3.2/fs.d.ts", - "./node_modules/@types/node/util.d.ts", - "./node_modules/@types/node/ts3.2/util.d.ts" - ], "./src/utils/raven.ts": [ "./node_modules/@types/raven/index.d.ts", "./src/utils/session.ts", @@ -3772,13 +3778,6 @@ "./node_modules/@types/node/ts3.2/fs.d.ts", "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" - ], - "../../node_modules/@types/npm/index.d.ts": [ - "./node_modules/@types/node/ts3.2/index.d.ts", - "./node_modules/@types/node/fs.d.ts", - "./node_modules/@types/node/ts3.2/fs.d.ts", - "./node_modules/@types/node/util.d.ts", - "./node_modules/@types/node/ts3.2/util.d.ts" ] }, "exportedModulesMap": { @@ -4758,16 +4757,9 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], - "../lib-js-core/node_modules/@types/node-fetch/externals.d.ts": [ - "./node_modules/@types/node/fs.d.ts", - "./node_modules/@types/node/ts3.2/fs.d.ts", - "./node_modules/@types/node/util.d.ts", - "./node_modules/@types/node/ts3.2/util.d.ts" - ], "../lib-js-core/node_modules/@types/node-fetch/index.d.ts": [ "./node_modules/@types/node/http.d.ts", "./node_modules/@types/node/url.d.ts", - "../lib-js-core/node_modules/@types/node-fetch/externals.d.ts", "./node_modules/@types/node/ts3.2/index.d.ts", "./node_modules/@types/node/fs.d.ts", "./node_modules/@types/node/ts3.2/fs.d.ts", @@ -4790,9 +4782,6 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], - "./src/types.ts": [ - "../lib-js-core/lib/syncano-core.d.ts" - ], "./node_modules/@types/js-yaml/index.d.ts": [ "./node_modules/@types/node/fs.d.ts", "./node_modules/@types/node/ts3.2/fs.d.ts", @@ -4871,9 +4860,6 @@ "./src/utils/hosting/index.ts": [ "./src/utils/hosting/hosting.ts" ], - "./src/utils/plugins/plugins.ts": [ - "./src/types.ts" - ], "./src/utils/plugins/index.ts": [ "./src/utils/plugins/plugins.ts" ], @@ -4948,6 +4934,7 @@ "./src/utils/sockets/sockets.ts" ], "./src/utils/session.ts": [ + "./src/settings/index.ts", "../lib-js-core/lib/syncano-core.d.ts", "./src/types.ts", "./src/utils/init/index.ts", @@ -5559,8 +5546,11 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], + "./src/commands_helpers/create-instance.ts": [ + "./src/types.ts" + ], "./src/commands/attach.ts": [ - "./src/utils/session.ts", + "./node_modules/@oclif/parser/lib/flags.d.ts", "./node_modules/@oclif/command/lib/index.d.ts", "./src/base_command.ts" ], @@ -5573,6 +5563,10 @@ "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" ], + "./src/commands/init.ts": [ + "./node_modules/@oclif/command/lib/index.d.ts", + "./src/base_command.ts" + ], "./node_modules/@types/validator/index.d.ts": [ "./node_modules/@types/node/fs.d.ts", "./node_modules/@types/node/ts3.2/fs.d.ts", @@ -5582,11 +5576,6 @@ "./src/commands/login.ts": [ "./node_modules/@oclif/command/lib/index.d.ts", "./node_modules/@types/inquirer/index.d.ts", - "../lib-js-core/lib/syncano-core.d.ts", - "./src/base_command.ts" - ], - "./src/commands/init.ts": [ - "./src/utils/session.ts", "./src/base_command.ts" ], "./src/commands/logout.ts": [ @@ -5613,13 +5602,17 @@ "./node_modules/ora/index.d.ts" ], "./src/commands/backup/create.ts": [ - "../lib-js-core/lib/syncano-core.d.ts", + "./node_modules/@oclif/parser/lib/flags.d.ts", + "./src/commands_helpers/spinner.ts", "./src/base_command.ts" ], "./src/commands/backup/delete.ts": [ "./node_modules/@oclif/parser/lib/flags.d.ts", "./src/base_command.ts" ], + "./src/commands/backup/index.ts": [ + "./src/base_command.ts" + ], "./src/commands/backup/last.ts": [ "../lib-js-core/lib/syncano-core.d.ts", "./src/base_command.ts" @@ -5667,6 +5660,9 @@ "./src/commands/hosting/files.ts": [ "./src/base_command.ts" ], + "./src/commands/hosting/index.ts": [ + "./src/base_command.ts" + ], "./src/commands/instance/create.ts": [ "./src/base_command.ts" ], @@ -5904,13 +5900,6 @@ "./node_modules/@types/node/ts3.2/fs.d.ts", "./node_modules/@types/node/util.d.ts", "./node_modules/@types/node/ts3.2/util.d.ts" - ], - "../../node_modules/@types/npm/index.d.ts": [ - "./node_modules/@types/node/ts3.2/index.d.ts", - "./node_modules/@types/node/fs.d.ts", - "./node_modules/@types/node/ts3.2/fs.d.ts", - "./node_modules/@types/node/util.d.ts", - "./node_modules/@types/node/ts3.2/util.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -6030,29 +6019,17 @@ "./node_modules/@types/lodash/index.d.ts", "./src/utils/print-tools.ts", "../lib-js-core/node_modules/form-data/index.d.ts", - "../lib-js-core/node_modules/@types/node-fetch/externals.d.ts", - "../lib-js-core/node_modules/@types/node-fetch/index.d.ts", - "../lib-js-core/lib/syncano-core.d.ts", "./node_modules/@types/mkdirp/index.d.ts", - "./src/types.ts", "./node_modules/@types/js-yaml/index.d.ts", "./src/settings/settings.ts", - "./src/settings/accountSettings.ts", "./node_modules/readdirp/index.d.ts", - "./src/settings/projectSettings.ts", "./node_modules/@types/semver/index.d.ts", - "./src/settings/socketSettings.ts", - "./src/settings/index.ts", "./node_modules/axios/index.d.ts", "./node_modules/@types/md5/index.d.ts", "./node_modules/pretty-bytes/index.d.ts", "./node_modules/@types/minimatch/index.d.ts", "./node_modules/@types/glob/index.d.ts", "./src/utils/hosting/utils.ts", - "./src/utils/hosting/hosting.ts", - "./src/utils/hosting/index.ts", - "./src/utils/plugins/plugins.ts", - "./src/utils/plugins/index.ts", "./node_modules/@types/archiver/index.d.ts", "./node_modules/@types/klaw-sync/index.d.ts", "./node_modules/@types/md5-file/promise.d.ts", @@ -6062,13 +6039,7 @@ "./src/utils/errors.ts", "./src/utils/templates.ts", "./node_modules/walkdir/walkdir.d.ts", - "./src/utils/sockets/utils.ts", - "./src/utils/sockets/index.ts", "./src/utils/unique-instance.ts", - "./src/utils/session.ts", - "./src/utils/init/init.ts", - "./src/utils/init/index.ts", - "./src/base_command.ts", "./src/cli.ts", "./src/welcome.ts", "./node_modules/@types/through/index.d.ts", @@ -6137,55 +6108,22 @@ "./node_modules/@types/inquirer/node_modules/rxjs/internal/config.d.ts", "./node_modules/@types/inquirer/node_modules/rxjs/index.d.ts", "./node_modules/@types/inquirer/index.d.ts", - "./src/commands_helpers/create-instance.ts", - "./src/commands/attach.ts", - "./src/commands/info.ts", + "./src/commands_helpers/instance.ts", "./node_modules/commander/typings/index.d.ts", - "./src/utils/analytics.ts", "./node_modules/@types/validator/index.d.ts", - "./src/commands/login.ts", - "./src/commands/init.ts", - "./src/commands/logout.ts", - "./src/commands/sysinfo.ts", "./node_modules/cli-spinners/index.d.ts", "./node_modules/ora/index.d.ts", "./src/commands_helpers/spinner.ts", - "./src/commands/backup/create.ts", - "./src/commands/backup/delete.ts", "./src/commands_helpers/backups.ts", - "./src/commands/backup/last.ts", - "./src/commands/backup/list.ts", "./node_modules/@types/bluebird/index.d.ts", - "./src/commands/hosting/sync.ts", - "./src/commands/hosting/add.ts", - "./src/commands/hosting/list.ts", - "./src/commands/hosting/config.ts", - "./src/commands/hosting/delete.ts", "./node_modules/cli-table3/index.d.ts", - "./src/commands/hosting/files.ts", - "./src/commands/instance/create.ts", - "./src/commands/instance/delete.ts", - "./src/commands/instance/list.ts", - "./src/commands/socket/call.ts", "./src/utils/date-utils.ts", - "./src/commands/socket/compile.ts", - "./src/commands/socket/create.ts", "./node_modules/@types/listr/node_modules/rxjs/index.d.ts", "./node_modules/@types/listr/index.d.ts", - "./src/commands_helpers/instance.ts", "./src/commands_helpers/socket.ts", "./node_modules/chokidar/types/index.d.ts", - "./src/commands/socket/trace.ts", "./src/commands_helpers/socket-list-responses.ts", - "./src/commands/socket/list.ts", - "./src/commands/socket/uninstall.ts", - "./src/commands/socket/config/config.ts", - "./src/commands/socket/config/set.ts", - "./src/commands/socket/config/show.ts", "./node_modules/@types/raven/index.d.ts", - "./src/utils/error-response.ts", - "./src/utils/index.ts", - "./src/utils/raven.ts", "./node_modules/@types/agent-base/index.d.ts", "./node_modules/@types/bunyan/index.d.ts", "./node_modules/@types/chai/index.d.ts", @@ -6199,10 +6137,60 @@ "./node_modules/@types/source-map-support/index.d.ts", "./node_modules/@types/xml2js/lib/processors.d.ts", "./node_modules/@types/xml2js/index.d.ts", - "../../node_modules/@types/npm/index.d.ts", + "../lib-js-core/node_modules/@types/node-fetch/index.d.ts", + "../lib-js-core/lib/syncano-core.d.ts", + "./src/commands/backup/list.ts", + "./src/commands/backup/last.ts", + "./src/commands/backup/delete.ts", + "./src/commands/backup/create.ts", + "./src/commands/login.ts", + "./src/utils/session.ts", "./src/utils/sockets/sockets.ts", + "./src/utils/hosting/hosting.ts", + "./src/types.ts", + "./src/settings/accountSettings.ts", + "./src/settings/projectSettings.ts", + "./src/settings/socketSettings.ts", + "./src/settings/index.ts", + "./src/utils/hosting/index.ts", + "./src/utils/plugins/plugins.ts", + "./src/utils/plugins/index.ts", + "./src/utils/sockets/utils.ts", + "./src/utils/sockets/index.ts", + "./src/utils/init/init.ts", + "./src/utils/init/index.ts", + "./src/base_command.ts", + "./src/commands_helpers/create-instance.ts", + "./src/commands/attach.ts", + "./src/commands/info.ts", + "./src/utils/analytics.ts", + "./src/commands/init.ts", + "./src/commands/logout.ts", + "./src/commands/sysinfo.ts", + "./src/commands/backup/index.ts", + "./src/commands/hosting/sync.ts", + "./src/commands/hosting/add.ts", + "./src/commands/hosting/list.ts", + "./src/commands/hosting/config.ts", + "./src/commands/hosting/delete.ts", + "./src/commands/hosting/files.ts", + "./src/commands/hosting/index.ts", + "./src/commands/instance/create.ts", + "./src/commands/instance/delete.ts", + "./src/commands/instance/list.ts", + "./src/commands/socket/call.ts", + "./src/commands/socket/compile.ts", + "./src/commands/socket/create.ts", "./src/commands/socket/deploy.ts", - "./src/commands/socket/hot.ts" + "./src/commands/socket/trace.ts", + "./src/commands/socket/hot.ts", + "./src/commands/socket/list.ts", + "./src/commands/socket/uninstall.ts", + "./src/commands/socket/config/config.ts", + "./src/commands/socket/config/set.ts", + "./src/commands/socket/config/show.ts", + "./src/utils/error-response.ts", + "./src/utils/raven.ts" ] }, "version": "3.7.4" diff --git a/packages/lib-js-core/src/instance.ts b/packages/lib-js-core/src/instance.ts index 7b43f86c..e356cfe8 100644 --- a/packages/lib-js-core/src/instance.ts +++ b/packages/lib-js-core/src/instance.ts @@ -13,6 +13,7 @@ export class InstanceClass extends QueryBuilder { public create (params: { name: string, description?: string + location?: 'eu1' | 'us1' metadata?: InstanceMetadata }): Promise { const fetch = this.nonInstanceFetch.bind(this)