From d1bb9d39c429a1cfeb5c886275af981ed6ca77a1 Mon Sep 17 00:00:00 2001 From: Marcel Kloubert Date: Mon, 26 Mar 2018 09:13:20 +0200 Subject: [PATCH] custom API endpoints --- CHANGELOG.md | 20 ++ package-lock.json | 471 ++++++++++--------------------- package.json | 81 ++++-- src/api.ts | 200 ++++++++++++- src/clients.ts | 54 ++++ src/clients/ftp.ts | 36 +-- src/clients/sftp.ts | 36 --- src/commands.ts | 3 +- src/contracts.ts | 14 + src/extension.ts | 9 +- src/helpers.ts | 27 -- src/list.ts | 3 +- src/plugins.ts | 3 +- src/plugins/app.ts | 5 +- src/plugins/ftp.ts | 41 ++- src/plugins/script.ts | 3 +- src/plugins/sftp.ts | 33 ++- src/pull.ts | 3 +- src/session.ts | 24 -- src/targets/operations/http.ts | 3 +- src/targets/operations/script.ts | 3 +- 21 files changed, 562 insertions(+), 510 deletions(-) delete mode 100644 src/session.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 49af2c3..40d3f3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ [![Share via Facebook](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Facebook.png)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded"e=vscode-deploy-reloaded) [![Share via Twitter](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Twitter.png)](https://twitter.com/intent/tweet?source=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&text=vscode-deploy-reloaded:%20https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&via=mjkloubert) [![Share via Google+](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Google+.png)](https://plus.google.com/share?url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded) [![Share via Pinterest](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Pinterest.png)](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&media=https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/demo1.gif&description=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20%27vs-deploy%27%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.) [![Share via Reddit](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Reddit.png)](https://www.reddit.com/submit?url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&title=vscode-deploy-reloaded) [![Share via LinkedIn](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/LinkedIn.png)](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&title=vscode-deploy-reloaded&summary=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20%27vs-deploy%27%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.&source=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded) [![Share via Wordpress](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Wordpress.png)](https://wordpress.com/press-this.php?u=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded"e=vscode-deploy-reloaded&s=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20%27vs-deploy%27%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.&i=https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/demo1.gif) [![Share via Email](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Email.png)](mailto:?subject=vscode-deploy-reloaded&body=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20'vs-deploy'%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.:%20https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded) +## 0.67.0 (March 26th, 2018; APIs) + +* can define [custom API endpoints](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/apis#custom-endpoints) now +* added `useBuildIn` setting for [APIs](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/apis), which can define, if [build-in endpoints](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/apis#endpoints) should be used or not +* updated the following [npm](https://www.npmjs.com/) modules: + * [aws-sdk](https://www.npmjs.com/package/aws-sdk) `2.213.1` + * [coffeescript](https://www.npmjs.com/package/coffeescript) `2.2.3` + * [filesize](https://www.npmjs.com/package/filesize) `3.6.1` + * [html-minifier](https://www.npmjs.com/package/html-minifier) `3.5.12` + * [i18next](https://www.npmjs.com/package/i18next) `10.6.0` + * [marked](https://www.npmjs.com/package/marked) `0.3.19` + * [nodemailer](https://www.npmjs.com/package/nodemailer) `4.6.3` + * [pug](https://www.npmjs.com/package/pug) `2.0.3` + * [ssh2-sftp-client](https://www.npmjs.com/package/ssh2-sftp-client) `2.1.0` + * [uglify-js](https://www.npmjs.com/package/uglify-js) `3.3.16` + * [vscode-helpers"](https://www.npmjs.com/package/vscode-helpers") `0.23.0` +* "outsourced" `loadModule()` function and `SESSION_STATE` constant to [vscode-helpers](https://www.npmjs.com/package/vscode-helpers) npm module +* bugfixes +* code cleanup and improvements + ## 0.66.1 (March 23rd, 2018; SFTP and FTP commands) * added `commands` setting for [SFTP](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/target_sftp) targets, which can define [commands](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/target_sftp#commands-) and should be executed on the server diff --git a/package-lock.json b/package-lock.json index b2124d0..50e5f2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vscode-deploy-reloaded", - "version": "0.66.1", + "version": "0.67.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -48,7 +48,7 @@ "dev": true, "requires": { "@types/express": "4.11.1", - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "@types/clean-css": { @@ -86,7 +86,7 @@ "dev": true, "requires": { "@types/events": "1.1.0", - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "@types/filesize": { @@ -101,7 +101,7 @@ "integrity": "sha512-Z5nu9Pbxj9yNeXIK3UwGlRdJth4cZ5sCq05nI7FaI6B0oz28nxkOtp6Lsz0ZnmLHJGvOJfB/VHxSTbVq/i6ujA==", "dev": true, "requires": { - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "@types/ftp": { @@ -110,7 +110,7 @@ "integrity": "sha1-ZhI4WHuexlPHEla9IThUW+e6c5M=", "dev": true, "requires": { - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "@types/glob": { @@ -120,7 +120,7 @@ "requires": { "@types/events": "1.1.0", "@types/minimatch": "3.0.3", - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "@types/html-entities": { @@ -130,14 +130,14 @@ "dev": true }, "@types/html-minifier": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/@types/html-minifier/-/html-minifier-1.1.31.tgz", - "integrity": "sha512-L/935PXha1hm+J0A+T7b5+5O/a/tUbLuTWvK379a2G2b9wHy/TJZtIm61GwxWphsiqzODseZHaMvvykQZEFzhg==", + "version": "1.1.32", + "resolved": "https://registry.npmjs.org/@types/html-minifier/-/html-minifier-1.1.32.tgz", + "integrity": "sha512-XSoGWiIBDngmxQ3sJCzLYBGFwr8n+xXEys2EuDySP8tZ2oGRJcuDxDObYLGXwk5uoMgDLKtPHkkQ3w0/YwEjeQ==", "dev": true, "requires": { "@types/clean-css": "3.4.30", "@types/relateurl": "0.2.28", - "@types/uglify-js": "2.6.30" + "@types/uglify-js": "2.6.31" } }, "@types/i18next": { @@ -157,7 +157,7 @@ "resolved": "https://registry.npmjs.org/@types/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha512-jkZatu4QVbR60mpIzjINmtS1ZF4a/FqdTUTBeQDVOQ2PYyidtwFKr0B5G6ERukKwliq+7mIXvxyppwzG5EgRYg==", "requires": { - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "@types/less": { @@ -167,9 +167,9 @@ "dev": true }, "@types/lodash": { - "version": "4.14.104", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.104.tgz", - "integrity": "sha512-ufQcVg4daO8xQ5kopxRHanqFdL4AI7ondQkV+2f+7mz3gvp0LkBx2zBRC6hfs3T87mzQFmf5Fck7Fi145Ul6NQ==" + "version": "4.14.106", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.106.tgz", + "integrity": "sha512-tOSvCVrvSqFZ4A/qrqqm6p37GZoawsZtoR0SJhlF7EonNZUgrn8FfT+RNQ11h+NUpMt6QVe36033f3qEKBwfWA==" }, "@types/marked": { "version": "0.3.0", @@ -215,22 +215,22 @@ "dev": true, "requires": { "@types/events": "1.1.0", - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "@types/mysql": { - "version": "2.15.2", - "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.2.tgz", - "integrity": "sha512-5U5pYZd+UMGfDJfmNLYJ6+PBEfjZbHqd0kzDDItFPB2COPmFmlmMsV6t6om/loorx1XMWY3rYTQn7wLipmt4JA==", + "version": "2.15.4", + "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.4.tgz", + "integrity": "sha512-qjiJUk8vPIuTtvIPx5sAtwVwProXAQm6t6+fvJOIfL0bO8Pj0ap8PEFJ3df5MVyjYzTKRxLudidhoCk642RoZQ==", "dev": true, "requires": { - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "@types/node": { - "version": "7.0.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.55.tgz", - "integrity": "sha512-diCxfWNT4g2UM9Y+BPgy4s3egcZ2qOXc0mXLauvbsBUq9SBKQfh0SmuEUEhJVFZt/p6UDsjg1s2EgfM6OSlp4g==" + "version": "7.0.57", + "resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.57.tgz", + "integrity": "sha512-Iikf0IAus1OX++3Jrc1R2bsZggO+m22G5ee56JccYKejx5GNT3nHhY8v6J4OXId1hXXlb0n45hcaVwZwQcZZ6w==" }, "@types/node-emoji": { "version": "1.8.0", @@ -239,13 +239,13 @@ "dev": true }, "@types/nodemailer": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-4.3.4.tgz", - "integrity": "sha512-Laog/xcxjiyp+fqMMOx+0Pg1pvpsTYI58bIH3RG6yx6c71bPACBfYZNC9wqqZrfXEYUGfvwKOEjMqOpiJfieSw==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-4.6.0.tgz", + "integrity": "sha512-DWG172izmWXfShUm2Lm6nVght5TxDI1cx2cKiGPeu2f66yTnn0QY7WhC9OSybdPoxGu7UbRXNuIkIzB+NE648A==", "dev": true, "requires": { "@types/events": "1.1.0", - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "@types/public-ip": { @@ -288,7 +288,7 @@ "integrity": "sha1-1uYNWbf8ItsQq/RzCqdEi6vefjs=", "dev": true, "requires": { - "@types/node": "7.0.55", + "@types/node": "7.0.57", "@types/ssh2-streams": "0.1.2" } }, @@ -307,7 +307,7 @@ "integrity": "sha1-eqGLjCRQ8XaZ6eoYp278g4GI1Y0=", "dev": true, "requires": { - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "@types/tmp": { @@ -317,9 +317,9 @@ "dev": true }, "@types/uglify-js": { - "version": "2.6.30", - "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-2.6.30.tgz", - "integrity": "sha512-NjiBNGFl58vHJeijl63w1fWRIjLnrfOvimsXF5b3lTzEzkTV1BnVsbqQeLejg54upsHPWIF63aiub5TEwH619A==", + "version": "2.6.31", + "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-2.6.31.tgz", + "integrity": "sha512-LjcyGt6CHsgZ0AoofnMwhyxo9hUqz2mgl6IcF+S8B1zdSTxHAvTO/1RPvBAHG3C1ZeAc+AoWA5mb3lDJKtM9Zg==", "dev": true, "requires": { "source-map": "0.6.1" @@ -331,7 +331,7 @@ "integrity": "sha512-5fRLCYhLtDb3hMWqQyH10qtF+Ud2JnNCXTCZ+9ktNdCcgslcuXkDTkFcJNk++MT29yDntDnlF1+jD+uVGumsbw==", "dev": true, "requires": { - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "accepts": { @@ -400,11 +400,6 @@ "repeat-string": "1.6.1" } }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" - }, "ansi-cyan": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", @@ -553,12 +548,13 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "aws-sdk": { - "version": "2.205.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.205.0.tgz", - "integrity": "sha1-GpNzAlPivgJ6S9OvkkjL2gVz3oA=", + "version": "2.213.1", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.213.1.tgz", + "integrity": "sha1-vL/fH9dDmpSL9TxGvZDJe0pkkls=", "requires": { "buffer": "4.9.1", "events": "1.1.1", + "ieee754": "1.1.8", "jmespath": "0.15.0", "querystring": "0.2.0", "sax": "1.2.1", @@ -1123,9 +1119,9 @@ "dev": true }, "cloneable-readable": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.1.tgz", - "integrity": "sha512-DNNEq6JdqBFPzS29TaoqZFPNLn5Xn3XyPFqLIhyBT8Xou4lHQEWzD6FinXoJUfhIfWX3aE1JkRa3cbWCHFbt1g==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", + "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", "dev": true, "requires": { "inherits": "2.0.3", @@ -1162,9 +1158,9 @@ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" }, "coffeescript": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.2.2.tgz", - "integrity": "sha512-VJnQbuT/lUXFPeh9ZPwuqZjG216ngxE89vfj1a1hlAaCCVOb694kKXMVSMm9kLKTbkMQKc/dPs9ABjO2ghMMJQ==" + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.2.3.tgz", + "integrity": "sha512-J+qHBN+ltCtOsWcA4X7jDRgUf+e3HHIicGhMG7pCVe3/gv/rt/OhjAaTVvfg+Mkj8wf4oADZmw97RnyhzOk0cA==" }, "color-convert": { "version": "1.9.1", @@ -1583,7 +1579,7 @@ }, "event-stream": { "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", "dev": true, "requires": { @@ -1782,9 +1778,9 @@ "dev": true }, "filesize": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.0.tgz", - "integrity": "sha512-g5OWtoZWcPI56js1DFhIEqyG9tnu/7sG3foHwgS9KGYFMfsYguI3E+PRVCmtmE96VajQIEMRU2OhN+ME589Gdw==" + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", + "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==" }, "fill-range": { "version": "2.2.3", @@ -2205,11 +2201,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" - }, "growl": { "version": "1.10.3", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", @@ -2298,9 +2289,9 @@ }, "dependencies": { "clone": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", - "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true }, "clone-stats": { @@ -2343,10 +2334,10 @@ "integrity": "sha1-CjcT2NTpIhxY8QyhbAEWyeJe2nw=", "dev": true, "requires": { - "clone": "1.0.3", + "clone": "1.0.4", "clone-buffer": "1.0.0", "clone-stats": "1.0.0", - "cloneable-readable": "1.1.1", + "cloneable-readable": "1.1.2", "is-stream": "1.1.0", "remove-trailing-separator": "1.1.0", "replace-ext": "1.0.0" @@ -2368,9 +2359,9 @@ }, "dependencies": { "clone": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", - "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true }, "replace-ext": { @@ -2385,7 +2376,7 @@ "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", "dev": true, "requires": { - "clone": "1.0.3", + "clone": "1.0.4", "clone-stats": "0.0.1", "replace-ext": "0.0.1" } @@ -2444,9 +2435,9 @@ }, "dependencies": { "clone": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", - "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true }, "object-assign": { @@ -2467,7 +2458,7 @@ "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", "dev": true, "requires": { - "clone": "1.0.3", + "clone": "1.0.4", "clone-stats": "0.0.1", "replace-ext": "0.0.1" } @@ -2490,9 +2481,9 @@ }, "dependencies": { "clone": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", - "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", "dev": true }, "clone-stats": { @@ -2516,10 +2507,10 @@ "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", "dev": true, "requires": { - "clone": "2.1.1", + "clone": "2.1.2", "clone-buffer": "1.0.0", "clone-stats": "1.0.0", - "cloneable-readable": "1.1.1", + "cloneable-readable": "1.1.2", "remove-trailing-separator": "1.1.0", "replace-ext": "1.0.0" } @@ -2636,24 +2627,24 @@ "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=" }, "html-minifier": { - "version": "3.5.10", - "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.10.tgz", - "integrity": "sha512-5c8iAyeIGAiuFhVjJ0qy1lgvyQxxuZgjeOuMnoK/wjEyy8DF3xKUnE9pO+6H7VMir976K6SGlZV8ZEmIOea/Zg==", + "version": "3.5.12", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.12.tgz", + "integrity": "sha512-+N778qLf0RWBscD0TPGoYdeGNDZ0s76/0pQhY1/409EOudcENkm9IbSkk37RDyPdg/09GVHTKotU4ya93RF1Gg==", "requires": { "camel-case": "3.0.0", "clean-css": "4.1.11", - "commander": "2.14.1", + "commander": "2.15.1", "he": "1.1.1", "ncname": "1.0.0", "param-case": "2.1.1", "relateurl": "0.2.7", - "uglify-js": "3.3.13" + "uglify-js": "3.3.16" }, "dependencies": { "commander": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz", - "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==" + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" } } }, @@ -2724,9 +2715,9 @@ } }, "i18next": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-10.5.0.tgz", - "integrity": "sha512-soHpHN/J8fpkt6z3mEsvO5Uf4huBLk1gYpwK7GwRJOBCJz6Zq4LgMjJ5pr8Lz0+lVwyzKW3zun7+C4pS4LZJ6Q==" + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-10.6.0.tgz", + "integrity": "sha1-kP/Z+bxhfzS5oS4DcmD1JERfdoQ=" }, "iconv-lite": { "version": "0.4.19", @@ -3464,9 +3455,9 @@ "dev": true }, "marked": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.17.tgz", - "integrity": "sha512-+AKbNsjZl6jFfLPwHhWmGTqE009wTKn3RTmn9K8oUKHrX/abPJjtcRtXpYB/FFrwPJRUA86LX/de3T0knkPCmQ==" + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", + "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==" }, "md5.js": { "version": "1.3.4", @@ -3805,160 +3796,9 @@ } }, "nodemailer": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.6.2.tgz", - "integrity": "sha512-T4A1m3YS2d+4RFPhbZ3pVWCpU6atMrxrV6Ql7n3NosDYmIdmxknSc715u752RzzLnVHSk/6zwtVD8IJVAGCACA==", - "requires": { - "request": "2.83.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "requires": { - "hoek": "4.2.1" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "requires": { - "boom": "5.2.0" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "requires": { - "hoek": "4.2.1" - } - } - } - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.6", - "mime-types": "2.1.18" - }, - "dependencies": { - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "requires": { - "delayed-stream": "1.0.0" - } - } - } - }, - "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", - "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" - } - }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.1", - "sntp": "2.1.0" - } - }, - "hoek": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", - "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" - } - }, - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" - }, - "request": { - "version": "2.83.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", - "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" - } - }, - "sntp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", - "requires": { - "hoek": "4.2.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "5.1.1" - } - } - } + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.6.3.tgz", + "integrity": "sha512-1AmOpDZJtyPAO+gfUBfT+MWHbYwQ+DZvb1gvYaTxBZV/lUeysZIt4kDq8Dlwt6ViUZGp3cMGR+D1MNQYyYiVUg==" }, "normalize-path": { "version": "2.1.1", @@ -4345,16 +4185,16 @@ } }, "pug": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pug/-/pug-2.0.0.tgz", - "integrity": "sha1-hS0TID1rQE71dLx/JSijXyWGyrY=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pug/-/pug-2.0.3.tgz", + "integrity": "sha1-ccuoJTfJWl6rftBGluQiH1Oqh44=", "requires": { "pug-code-gen": "2.0.1", - "pug-filters": "3.0.0", + "pug-filters": "3.1.0", "pug-lexer": "4.0.0", - "pug-linker": "3.0.4", - "pug-load": "2.0.10", - "pug-parser": "4.0.1", + "pug-linker": "3.0.5", + "pug-load": "2.0.11", + "pug-parser": "5.0.0", "pug-runtime": "2.0.4", "pug-strip-comments": "1.0.3" } @@ -4390,43 +4230,23 @@ "integrity": "sha1-U659nSm7A89WRJOgJhCfVMR/XyY=" }, "pug-filters": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pug-filters/-/pug-filters-3.0.0.tgz", - "integrity": "sha1-SSTwIDwd6iDH4UiuwgGJiGa3ydI=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pug-filters/-/pug-filters-3.1.0.tgz", + "integrity": "sha1-JxZVVbwEwjbkqisDZiRt+gIbYm4=", "requires": { - "clean-css": "3.4.28", + "clean-css": "4.1.11", "constantinople": "3.1.2", "jstransformer": "1.0.0", "pug-error": "1.3.2", - "pug-walk": "1.1.6", + "pug-walk": "1.1.7", "resolve": "1.5.0", "uglify-js": "2.8.29" }, "dependencies": { - "clean-css": { - "version": "3.4.28", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-3.4.28.tgz", - "integrity": "sha1-vxlF6C/ICPVWlebd6uwBQA79A/8=", - "requires": { - "commander": "2.8.1", - "source-map": "0.4.4" - } - }, - "commander": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", - "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", - "requires": { - "graceful-readlink": "1.0.1" - } - }, "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "requires": { - "amdefine": "1.0.1" - } + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" }, "uglify-js": { "version": "2.8.29", @@ -4436,13 +4256,6 @@ "source-map": "0.5.7", "uglify-to-browserify": "1.0.2", "yargs": "3.10.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - } } } } @@ -4458,27 +4271,27 @@ } }, "pug-linker": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/pug-linker/-/pug-linker-3.0.4.tgz", - "integrity": "sha1-3SVzKO7yUAFFKgub8wNJ5xSX6NI=", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/pug-linker/-/pug-linker-3.0.5.tgz", + "integrity": "sha1-npp65ABWgtAn3uuWsAD4juuDoC8=", "requires": { "pug-error": "1.3.2", - "pug-walk": "1.1.6" + "pug-walk": "1.1.7" } }, "pug-load": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/pug-load/-/pug-load-2.0.10.tgz", - "integrity": "sha1-y5kNZC+k9+18o1QzaKhhUsZQkgg=", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/pug-load/-/pug-load-2.0.11.tgz", + "integrity": "sha1-5kjlftET/iwfRdV4WOorrWvAFSc=", "requires": { "object-assign": "4.1.1", - "pug-walk": "1.1.6" + "pug-walk": "1.1.7" } }, "pug-parser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pug-parser/-/pug-parser-4.0.1.tgz", - "integrity": "sha1-vSq99clYcet5En5GWWlduncPW4c=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pug-parser/-/pug-parser-5.0.0.tgz", + "integrity": "sha1-45Stmz/KkxI5QK/4hcBuRKt+aOQ=", "requires": { "pug-error": "1.3.2", "token-stream": "0.0.1" @@ -4498,9 +4311,9 @@ } }, "pug-walk": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/pug-walk/-/pug-walk-1.1.6.tgz", - "integrity": "sha1-fKvNc3zb+uz7DzKvcSfrrPQjlHo=" + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/pug-walk/-/pug-walk-1.1.7.tgz", + "integrity": "sha1-wA1cUSi6xYBr7BXSt+fNq+QlMfM=" }, "punycode": { "version": "1.4.1", @@ -4896,9 +4709,9 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-support": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.3.tgz", - "integrity": "sha512-eKkTgWYeBOQqFGXRfKabMFdnWepo51vWqEdoeikaEPFiJC7MCU5j2h4+6Q8npkZTeLGbSyecZvRxiSoWl3rh+w==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.4.tgz", + "integrity": "sha512-PETSPG6BjY1AHs2t64vS2aqAgu6dMIMXJULWFBGbh2Gr8nVLbCFDo6i/RMMvviIQ2h1Z8+5gQhVKSn2je9nmdg==", "dev": true, "requires": { "source-map": "0.6.1" @@ -4944,9 +4757,9 @@ } }, "ssh2-sftp-client": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ssh2-sftp-client/-/ssh2-sftp-client-2.0.1.tgz", - "integrity": "sha512-LiEroUA4vntGzpsnDJ1xdKT8+xfdBwWlfDo8z22gy9K+JRSojKBuoT7c01dhmrHqfZOnYPL9TCWiuAlmJoc1Dg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ssh2-sftp-client/-/ssh2-sftp-client-2.1.0.tgz", + "integrity": "sha1-F7o+MB5HKJgKJPgmo6yOS7ZTxSI=", "requires": { "ssh2": "0.5.5" } @@ -5374,18 +5187,18 @@ "dev": true }, "uglify-js": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.13.tgz", - "integrity": "sha512-7rdn/bDOG1ElSTPdh7AI5TCjLv63ZD4k8BBadN3ssIkhlaQL2c0yRxmXCyOYhZK0wZTgGgUSnYQ4CGu+Jos5cA==", + "version": "3.3.16", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.16.tgz", + "integrity": "sha512-FMh5SRqJRGhv9BbaTffENIpDDQIoPDR8DBraunGORGhySArsXlw9++CN+BWzPBLpoI4RcSnpfGPnilTxWL3Vvg==", "requires": { - "commander": "2.14.1", + "commander": "2.15.1", "source-map": "0.6.1" }, "dependencies": { "commander": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz", - "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==" + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" } } }, @@ -5568,9 +5381,9 @@ }, "dependencies": { "clone": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", - "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true }, "replace-ext": { @@ -5585,7 +5398,7 @@ "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", "dev": true, "requires": { - "clone": "1.0.3", + "clone": "1.0.4", "clone-stats": "0.0.1", "replace-ext": "0.0.1" } @@ -5608,9 +5421,9 @@ "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=" }, "vscode": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.11.tgz", - "integrity": "sha512-JSngwwfDSZ+MMtNPXiPI5jM0tHiqaL5oXIP9+nuIJ7AcJjsIIPAU118IswukvGWRllOLRA1ORfDNYTEMh8rtng==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.14.tgz", + "integrity": "sha512-acfn3fzGtTm7UjChAN7/YjsC0qIyJeuSrJwvm6qb7tLN6Geq1FmCz1JnBOc3kaY+HCLjQBAfwG/CsgnasOdXMw==", "dev": true, "requires": { "glob": "7.1.2", @@ -5622,9 +5435,9 @@ "gulp-untar": "0.0.6", "gulp-vinyl-zip": "2.1.0", "mocha": "4.1.0", - "request": "2.83.0", + "request": "2.85.0", "semver": "5.4.1", - "source-map-support": "0.5.3", + "source-map-support": "0.5.4", "url-parse": "1.2.0", "vinyl-source-stream": "1.1.2" }, @@ -5744,9 +5557,9 @@ "dev": true }, "request": { - "version": "2.83.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "version": "2.85.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", + "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", "dev": true, "requires": { "aws-sign2": "0.7.0", @@ -5794,23 +5607,23 @@ } }, "vscode-helpers": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/vscode-helpers/-/vscode-helpers-0.21.0.tgz", - "integrity": "sha512-KnQ8SKAdz2/ushVprVP6rZqnMFb2Uh3M7HFhliz1OY0Gxe9sNK46J7D0I9hvrbNqKuyCkaG9kPp+CA+lc+P/PA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/vscode-helpers/-/vscode-helpers-0.25.0.tgz", + "integrity": "sha512-bbqjHEFccMzOMQt0KEF6jub5M61XMYAesQ18FgNQp5gkNCf+b0EfzoItyo626hmzbi8NZkeeV2x8Rcjvwq8HNQ==", "requires": { "@types/fs-extra": "5.0.1", "@types/glob": "5.0.35", "@types/is-stream": "1.1.0", - "@types/lodash": "4.14.104", + "@types/lodash": "4.14.106", "@types/marked": "0.3.0", "@types/minimatch": "3.0.3", - "@types/node": "7.0.55", + "@types/node": "7.0.57", "fs-extra": "5.0.0", "glob": "7.1.2", "is-stream": "1.1.0", "isbinaryfile": "3.0.2", "lodash": "4.17.5", - "marked": "0.3.17", + "marked": "0.3.19", "merge-deep": "3.0.1", "minimatch": "3.0.4", "moment": "2.21.0", @@ -5822,7 +5635,7 @@ "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.1.tgz", "integrity": "sha512-h3wnflb+jMTipvbbZnClgA2BexrT4w0GcfoCz5qyxd0IRsbqhLSyesM6mqZTAnhbVmhyTm5tuxfRu9R+8l+lGw==", "requires": { - "@types/node": "7.0.55" + "@types/node": "7.0.57" } }, "fs-extra": { diff --git a/package.json b/package.json index 5358164..98fbe90 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-deploy-reloaded", "displayName": "Deploy (Reloaded)", "description": "Deploys files of a workspace to a destination.", - "version": "0.66.1", + "version": "0.67.0", "publisher": "mkloubert", "engines": { "vscode": "^1.21.0" @@ -206,6 +206,46 @@ "description": "A description for that host.", "type": "string" }, + "endpoints": { + "description": "One or more custom endpoint (routes).", + "type": "object", + "properties": { + "patternProperties": { + "\\S+": { + "oneOf": [ + { + "description": "The path to the script, that should be executed.", + "type": "string" + }, + { + "description": "Settings for the endpoint.", + "type": "object", + "properties": { + "methods": { + "description": "A list of one or more HTTP methods, which are allowed.", + "type": "array", + "items": { + "description": "A HTTP method.", + "type": "string" + } + }, + "options": { + "description": "Options for the scrript." + }, + "script": { + "description": "The path to the script, that should be executed.", + "type": "string" + } + }, + "require": [ + "script" + ] + } + ] + } + } + } + }, "name": { "description": "A (display) name for that host.", "type": "string" @@ -242,6 +282,11 @@ } } }, + "useBuildIn": { + "description": "Use build-in endpoints or not.", + "type": "boolean", + "default": true + }, "users": { "description": "One or more users to define.", "type": "object", @@ -71495,22 +71540,22 @@ "@types/ftp": "^0.3.29", "@types/glob": "^5.0.35", "@types/html-entities": "^1.2.16", - "@types/html-minifier": "^1.1.31", + "@types/html-minifier": "^1.1.32", "@types/i18next": "^8.4.3", "@types/ip": "0.0.30", "@types/is-stream": "^1.1.0", "@types/less": "0.0.32", - "@types/lodash": "^4.14.104", + "@types/lodash": "^4.14.106", "@types/marked": "^0.3.0", "@types/mime-types": "^2.1.0", "@types/minimatch": "^3.0.3", "@types/mocha": "^2.2.48", "@types/moment-timezone": "^0.5.4", "@types/mssql": "^4.0.7", - "@types/mysql": "^2.15.2", - "@types/node": "^7.0.55", + "@types/mysql": "^2.15.4", + "@types/node": "^7.0.57", "@types/node-emoji": "^1.8.0", - "@types/nodemailer": "^4.3.4", + "@types/nodemailer": "^4.6.0", "@types/public-ip": "^2.3.0", "@types/pug": "^2.0.4", "@types/sanitize-filename": "^1.1.28", @@ -71519,7 +71564,7 @@ "@types/uuid": "^3.4.3", "tslint": "^5.9.1", "typescript": "^2.7.2", - "vscode": "^1.1.11" + "vscode": "^1.1.14" }, "icon": "icon.png", "badges": [ @@ -71542,27 +71587,27 @@ "readmeFilename": "README.md", "dependencies": { "@slack/client": "^3.16.0", - "aws-sdk": "^2.205.0", + "aws-sdk": "^2.213.1", "azure-storage": "^2.8.1", - "coffeescript": "^2.2.2", + "coffeescript": "^2.2.3", "compare-versions": "^3.1.0", "copy-paste": "^1.3.0", "dropbox": "^2.5.13", "express": "^4.16.3", - "filesize": "^3.6.0", + "filesize": "^3.6.1", "fs-extra": "^4.0.3", "ftp": "^0.3.10", "glob": "^7.1.2", "hexy": "^0.2.10", "html-entities": "^1.2.1", - "html-minifier": "^3.5.10", - "i18next": "^10.5.0", + "html-minifier": "^3.5.12", + "i18next": "^10.6.0", "ip": "^1.1.5", "is-stream": "^1.1.0", "jsftp": "^2.1.3", "less": "^2.7.3", "lodash": "^4.17.5", - "marked": "^0.3.17", + "marked": "^0.3.19", "merge-deep": "^3.0.1", "mime-types": "^2.1.18", "minimatch": "^3.0.4", @@ -71574,16 +71619,16 @@ "node-enumerable": "^3.9.0", "node-simple-socket": "^2.8.1", "node-zip": "^1.1.1", - "nodemailer": "^4.6.2", + "nodemailer": "^4.6.3", "parse-listing": "^1.1.3", "public-ip": "^2.4.0", - "pug": "^2.0.0", + "pug": "^2.0.3", "random-float": "^1.0.0", "sanitize-filename": "^1.6.1", - "ssh2-sftp-client": "^2.0.1", + "ssh2-sftp-client": "^2.1.0", "tmp": "0.0.33", - "uglify-js": "^3.3.13", + "uglify-js": "^3.3.16", "uuid": "^3.2.1", - "vscode-helpers": "^0.21.0" + "vscode-helpers": "^0.25.0" } } diff --git a/src/api.ts b/src/api.ts index 2500d1c..7ae453f 100644 --- a/src/api.ts +++ b/src/api.ts @@ -22,6 +22,7 @@ import * as deploy_html from './html'; import * as deploy_values from './values'; import * as deploy_workspaces from './workspaces'; import * as Enumerable from 'node-enumerable'; +import * as Events from 'events'; import * as Express from 'express'; import * as HTTP from 'http'; import * as HTTPs from 'https'; @@ -33,6 +34,45 @@ import * as Path from 'path'; import * as vscode from 'vscode'; +/** + * A value for an API endpoint. + */ +export type ApiEndpoint = ApiEndpointSettings | string; + +/** + * Settings for an API endpoint. + */ +export interface ApiEndpointSettings { + /** + * A list of one or more HTTP methods, which are allowed. + */ + readonly methods?: string | string[]; + /** + * Options for the script. + */ + readonly options?: any; + /** + * The script to execute. + */ + readonly script: string; +} + +/** + * Arguments for an API endpoint script. + */ +export interface ApiEndpointArguments extends deploy_contracts.ScriptArguments { + /** + * The underlying workspace. + */ + readonly workspace: deploy_workspaces.Workspace; +} + +/** + * An API endpoint module. + */ +export interface ApiEndpointModule { +} + /** * Stores the name and description of an API host. */ @@ -68,6 +108,10 @@ export interface ApiSettings extends deploy_contracts.WithOptionalName { * A description for the host. */ readonly description?: string; + /** + * One or more custom endpoints. + */ + readonly endpoints?: deploy_contracts.KeyValuePairs; /** * The custom name of the real for basic authentification. */ @@ -97,6 +141,10 @@ export interface ApiSettings extends deploy_contracts.WithOptionalName { */ readonly rejectUnauthorized?: boolean; }; + /** + * Use build-in endpoints or not. + */ + readonly useBuildIn?: boolean; /** * One or more users to define. */ @@ -191,6 +239,9 @@ export const X_HEADER_EDITOR_LANG = 'X-Vscode-Deploy-Reloaded-Lang'; * An API host. */ export class ApiHost extends deploy_helpers.DisposableBase { + private readonly _EVENTS: NodeJS.EventEmitter = new Events.EventEmitter(); + private readonly _GLOBAL_STATE: deploy_contracts.KeyValuePairs = {}; + private readonly _SCRIPT_STATES: deploy_contracts.KeyValuePairs = {}; private _server: HTTP.Server | HTTPs.Server; /** @@ -291,6 +342,7 @@ export class ApiHost extends deploy_helpers.DisposableBase { } } + // IP check APP.use(function (req: Express.Request, resp: Express.Response, next: Function) { let canConnect = ALLOWED_IPS.length < 1; if (!canConnect) { @@ -359,7 +411,11 @@ export class ApiHost extends deploy_helpers.DisposableBase { .send(); }); - await this.setupEndPoints(APP); + if (deploy_helpers.toBooleanSafe(this.settings.useBuildIn, true)) { + await this.setupEndPoints(APP); + } + + await this.setupCustomEndpoints(APP); // error handler APP.use(function(err: any, req: Express.Request, resp: Express.Response, next: Function) { @@ -369,7 +425,7 @@ export class ApiHost extends deploy_helpers.DisposableBase { resp.setHeader('Content-type', 'application/json; charset=utf-8'); - resp.status(500).send( + return resp.status(500).send( new Buffer( JSON.stringify({ success: false, @@ -464,6 +520,8 @@ export class ApiHost extends deploy_helpers.DisposableBase { this._server = null; } + + this._EVENTS.removeAllListeners(); } /** @@ -486,6 +544,144 @@ export class ApiHost extends deploy_helpers.DisposableBase { .replaceWithValues(val, ADDITIONAL_VALUES); } + private async setupCustomEndpoints(app: Express.Express) { + const ME = this; + + const ENDPOINTS = ME.settings.endpoints; + if (!ENDPOINTS) { + return; + } + + const NORMALIZER = (str: string) => str.toUpperCase().trim(); + + _.forIn(ENDPOINTS, (ep, route) => { + if (_.isNil(ep)) { + return; + } + + let endpoint: ApiEndpointSettings; + if (deploy_helpers.isObject(ep)) { + endpoint = ep; + } + else { + endpoint = { + script: deploy_helpers.toStringSafe(ep), + }; + } + + route = deploy_helpers.toStringSafe(route).trim(); + if (!route.startsWith('/')) { + route = '/' + route; + } + route = '/api' + route; + + app.all(route, async function(req, resp) { + const METHOD = deploy_helpers.normalizeString(req.method, NORMALIZER); + const ALLOWED_METHODS = deploy_helpers.asArray(endpoint.methods).map(m => { + return deploy_helpers.normalizeString(m, NORMALIZER); + }).filter(m => '' !== m); + + if (ALLOWED_METHODS.length > 0) { + if (ALLOWED_METHODS.indexOf(METHOD) < 0) { + return resp.status(405) + .send(); + } + } + + const SCRIPT_FILE = await ME.workspace.getExistingSettingPath( endpoint.script ); + if (false !== SCRIPT_FILE) { + const SCRIPT_MODULE = deploy_helpers.loadModule(SCRIPT_FILE); + if (SCRIPT_MODULE) { + let requestFunc: Function = SCRIPT_MODULE[ METHOD ]; + if (!_.isFunction(requestFunc)) { + requestFunc = SCRIPT_MODULE['request']; + } + + if (_.isFunction(requestFunc)) { + const SCRIPT_STATE_KEY = SCRIPT_FILE; + const WORKSPACE = ME.workspace; + + const ARGS: ApiEndpointArguments = { + _: require('lodash'), + events: ME._EVENTS, + extension: WORKSPACE.context.extension, + folder: WORKSPACE.folder, + globalEvents: deploy_helpers.EVENTS, + globals: WORKSPACE.globals, + globalState: ME._GLOBAL_STATE, //TODO + homeDir: deploy_helpers.getExtensionDirInHome(), + logger: WORKSPACE.createLogger(), + options: deploy_helpers.cloneObject(endpoint.options), + output: undefined, + replaceWithValues: function (val) { + return this.workspace + .replaceWithValues(val); + }, + require: (id) => { + return deploy_helpers.requireFromExtension(id); + }, + sessionState: deploy_helpers.SESSION, + settingFolder: undefined, + state: undefined, + workspace: WORKSPACE, + workspaceRoot: undefined, + }; + + // ARGS.output + Object.defineProperty(ARGS, 'output', { + enumerable: true, + + get: function () { + return this.workspace.output; + } + }); + + // ARGS.settingFolder + Object.defineProperty(ARGS, 'settingFolder', { + enumerable: true, + + get: function () { + return this.workspace.settingFolder; + } + }); + + // ARGS.state + Object.defineProperty(ARGS, 'state', { + enumerable: true, + + get: () => { + return ME._SCRIPT_STATES[ SCRIPT_STATE_KEY ]; + }, + + set: (newValue) => { + ME._SCRIPT_STATES[ SCRIPT_STATE_KEY ] = newValue; + } + }); + + // ARGS.workspaceRoot + Object.defineProperty(ARGS, 'workspaceRoot', { + enumerable: true, + + get: function () { + return this.workspace.rootPath; + } + }); + + const FUNC_ARGS = [ ARGS ].concat( deploy_helpers.toArray(arguments) ); + + return Promise.resolve( + requestFunc.apply(SCRIPT_MODULE, FUNC_ARGS) + ); + } + } + } + + return resp.status(501) + .send(); + }); + }); + } + private async setupEndPoints(app: Express.Express) { const ME = this; diff --git a/src/clients.ts b/src/clients.ts index 9e302ae..76be7c2 100644 --- a/src/clients.ts +++ b/src/clients.ts @@ -15,8 +15,11 @@ * along with this program. If not, see . */ +import * as _ from 'lodash'; +import * as deploy_contracts from './contracts'; import * as deploy_helpers from './helpers'; import * as deploy_files from './files'; +import * as deploy_values from './values'; import * as vscode from 'vscode'; @@ -63,6 +66,11 @@ export interface IAsyncFileClient extends NodeJS.EventEmitter, vscode.Disposable * @param {Buffer} data The data for the remote file. */ readonly uploadFile: (path: string, data: Buffer) => PromiseLike; + + /** + * Stores the list of connection values. + */ + readonly values: deploy_values.Value[]; } @@ -70,6 +78,8 @@ export interface IAsyncFileClient extends NodeJS.EventEmitter, vscode.Disposable * A basic async file client. */ export abstract class AsyncFileListBase extends deploy_helpers.DisposableBase implements IAsyncFileClient { + private readonly _CONNECTION_VALUES: deploy_contracts.KeyValuePairs = {}; + /** @inheritdoc */ public abstract async deleteFile(path: string): Promise; @@ -79,9 +89,53 @@ export abstract class AsyncFileListBase extends deploy_helpers.DisposableBase im /** @inheritdoc */ public abstract async listDirectory(path: string): Promise; + /** + * Normalizes a name for a value. + * + * @param {any} name The input value. + * + * @return {string} The output value. + */ + protected normalizeValueName(name: any): string { + return deploy_helpers.normalizeString( name ); + } + + /** + * Sets a connection value. + * + * @param {string} name The name of the value. + * @param {any} val The value to set. + * + * @return this + * + * @chainable + */ + public setValue(name: string, val: any): this { + name = this.normalizeValueName( name ); + + let existingValue = deploy_helpers.from( + this.values + ).singleOrDefault(v => v.name === name); + if (_.isSymbol(existingValue)) { + existingValue = new deploy_values.FunctionValue(() => { + return this._CONNECTION_VALUES[ name ]; + }, name); + + this.values + .push( existingValue ); + } + + this._CONNECTION_VALUES[ name ] = val; + + return this; + } + /** @inheritdoc */ public abstract get type(): string; /** @inheritdoc */ public abstract async uploadFile(path: string, data: Buffer): Promise; + + /** @inheritdoc */ + public readonly values: deploy_values.Value[] = []; } diff --git a/src/clients/ftp.ts b/src/clients/ftp.ts index a0c3520..740b284 100644 --- a/src/clients/ftp.ts +++ b/src/clients/ftp.ts @@ -222,7 +222,6 @@ export abstract class FTPClientBase extends deploy_clients.AsyncFileListBase { */ protected _connection: any; private _existingRemoteDirs: { [ path: string ]: boolean } = {}; - private readonly _CONNECTION_VALUES: deploy_contracts.KeyValuePairs = {}; /** * Initializes a new instance of that class. @@ -580,36 +579,6 @@ export abstract class FTPClientBase extends deploy_clients.AsyncFileListBase { */ public abstract put(file: string, data: Buffer): Promise; - /** - * Sets a connection value. - * - * @param {string} name The name of the value. - * @param {any} val The value to set. - * - * @return this - * - * @chainable - */ - public setValue(name: string, val: any): this { - name = deploy_helpers.normalizeString( name ); - - let existingValue = deploy_helpers.from( - this.values - ).singleOrDefault(v => v.name === name); - if (_.isSymbol(existingValue)) { - existingValue = new deploy_values.FunctionValue(() => { - return this._CONNECTION_VALUES[ name ]; - }, name); - - this.values - .push( existingValue ); - } - - this._CONNECTION_VALUES[ name ] = val; - - return this; - } - /** @inheritdoc */ public get type() { return 'ftp'; @@ -663,10 +632,7 @@ export abstract class FTPClientBase extends deploy_clients.AsyncFileListBase { } } - /** - * Stores the list of connection values. - */ - public readonly values: deploy_values.Value[] = []; + } class FtpClient extends FTPClientBase { diff --git a/src/clients/sftp.ts b/src/clients/sftp.ts index 5e1560c..25ef3f7 100644 --- a/src/clients/sftp.ts +++ b/src/clients/sftp.ts @@ -281,7 +281,6 @@ export const DEFAULT_HOST = '127.0.0.1'; */ export class SFTPClient extends deploy_clients.AsyncFileListBase { private _checkedRemoteDirs: { [ path: string ]: boolean } = {}; - private readonly _CONNECTION_VALUES: deploy_contracts.KeyValuePairs = {}; /** * Initializes a new instance of that class. @@ -687,36 +686,6 @@ export class SFTPClient extends deploy_clients.AsyncFileListBase { }); } - /** - * Sets a connection value. - * - * @param {string} name The name of the value. - * @param {any} val The value to set. - * - * @return this - * - * @chainable - */ - public setValue(name: string, val: any): this { - name = deploy_helpers.normalizeString( name ); - - let existingValue = deploy_helpers.from( - this.values - ).singleOrDefault(v => v.name === name); - if (_.isSymbol(existingValue)) { - existingValue = new deploy_values.FunctionValue(() => { - return this._CONNECTION_VALUES[ name ]; - }, name); - - this.values - .push( existingValue ); - } - - this._CONNECTION_VALUES[ name ] = val; - - return this; - } - /** @inheritdoc */ public get type(): string { return 'sftp'; @@ -899,11 +868,6 @@ export class SFTPClient extends deploy_clients.AsyncFileListBase { } }); } - - /** - * Stores the list of connection values. - */ - public readonly values: deploy_values.Value[] = []; } diff --git a/src/commands.ts b/src/commands.ts index 75124d0..bd66b38 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -21,7 +21,6 @@ import * as deploy_deploy from './deploy'; import * as deploy_helpers from './helpers'; import * as deploy_log from './log'; import * as deploy_pull from './pull'; -import * as deploy_session from './session'; import * as deploy_targets from './targets'; import * as deploy_values from './values'; import * as deploy_workspaces from './workspaces'; @@ -261,7 +260,7 @@ export async function reloadCommands(newCfg: deploy_contracts.Configuration) { require: (moduleId) => { return deploy_helpers.requireFromExtension(moduleId); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: ME.settingFolder, state: undefined, workspaceRoot: ME.rootPath, diff --git a/src/contracts.ts b/src/contracts.ts index 48d76a5..39bee04 100644 --- a/src/contracts.ts +++ b/src/contracts.ts @@ -292,6 +292,20 @@ export interface Configuration extends deploy_packages.WithFastFileCheckSettings readonly timeToWaitBeforeActivateRemoveOnChange?: number; } +/** + * List of deploy events. + */ +export enum DeployEvent { + /** + * Before deploy a file. + */ + BeforeDeployFile = 1, + /** + * After file has been deployed (successfully). + */ + FileDeployed = 2, +} + /** * List of deploy operations. */ diff --git a/src/extension.ts b/src/extension.ts index f0e17c2..1cb6690 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -589,12 +589,9 @@ async function activateExtension(context: vscode.ExtensionContext) { // events WF.next(() => { - context.subscriptions.push({ - dispose: () => { - deploy_helpers.EVENTS - .removeAllListeners(); - } - }); + context.subscriptions.push( + deploy_helpers.EVENT_DISPOSER + ); }); // output channel diff --git a/src/helpers.ts b/src/helpers.ts index e82cae1..e4883b2 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -667,33 +667,6 @@ export function isSymbol(val: any): val is symbol { return _.isSymbol(val); } -/** - * Loads a module from a script. - * - * @param {string} file The path to the script. - * @param {boolean} [fromCache] Cache module or not. - * - * @return {TModule} The loaded module. - */ -export function loadModule(file: string, fromCache = false): TModule { - file = toStringSafe(file); - if (isEmptyString(file)) { - file = './module.js'; - } - if (!Path.isAbsolute(file)) { - file = Path.join(process.cwd(), file); - } - file = Path.resolve(file); - - fromCache = toBooleanSafe(fromCache); - - if (!fromCache) { - delete require.cache[file]; - } - - return require(file); -} - /** * Promise version of 'FS.lstat()' function. * diff --git a/src/list.ts b/src/list.ts index 7788897..dc650c7 100644 --- a/src/list.ts +++ b/src/list.ts @@ -21,7 +21,6 @@ import * as deploy_files from './files'; import * as deploy_helpers from './helpers'; import * as deploy_log from './log'; import * as deploy_plugins from './plugins'; -import * as deploy_session from './session'; import * as deploy_targets from './targets'; import * as deploy_transformers from './transformers'; import * as deploy_workspaces from './workspaces'; @@ -120,7 +119,7 @@ function createPullDataTransformerContext(file: deploy_contracts.WithNameAndPath require: (id) => { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: WORKSPACE.settingFolder, state: undefined, workspaceRoot: WORKSPACE.rootPath, diff --git a/src/plugins.ts b/src/plugins.ts index 1b2155c..c7ff507 100644 --- a/src/plugins.ts +++ b/src/plugins.ts @@ -19,7 +19,6 @@ import * as deploy_clients from './clients'; import * as deploy_contracts from './contracts'; import * as deploy_files from './files'; import * as deploy_helpers from './helpers'; -import * as deploy_session from './session'; import * as deploy_targets from './targets'; import * as deploy_transformers from './transformers'; import * as deploy_values from './values'; @@ -549,7 +548,7 @@ export abstract class FileToUploadBase implements FileToUpload { require: (id) => { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: ME.workspace.settingFolder, state: undefined, workspaceRoot: ME.workspace.rootPath, diff --git a/src/plugins/app.ts b/src/plugins/app.ts index 8e44cbf..07a63e7 100644 --- a/src/plugins/app.ts +++ b/src/plugins/app.ts @@ -21,7 +21,6 @@ import * as deploy_files from '../files'; import * as deploy_helpers from '../helpers'; import * as deploy_log from '../log'; import * as deploy_plugins from '../plugins'; -import * as deploy_session from '../session'; import * as deploy_targets from '../targets'; import * as deploy_values from '../values'; import * as deploy_workspace from '../workspaces'; @@ -655,7 +654,7 @@ class AppPlugin extends deploy_plugins.PluginBase { require: (id) => { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: undefined, state: undefined, target: target, @@ -837,7 +836,7 @@ class AppPlugin extends deploy_plugins.PluginBase { require: (id) => { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: undefined, state: undefined, target: target, diff --git a/src/plugins/ftp.ts b/src/plugins/ftp.ts index 63906a5..f256366 100644 --- a/src/plugins/ftp.ts +++ b/src/plugins/ftp.ts @@ -20,7 +20,6 @@ import * as deploy_clients_ftp from '../clients/ftp'; import * as deploy_contracts from '../contracts'; import * as deploy_helpers from '../helpers'; import * as deploy_plugins from '../plugins'; -import * as deploy_session from '../session'; import * as deploy_targets from '../targets'; import * as deploy_workspaces from '../workspaces'; import * as Events from 'events'; @@ -60,6 +59,28 @@ interface FTPContext extends deploy_plugins.AsyncFileClientPluginContext { } +/** + * Script arguments for a deploy event. + */ +export interface FTPDeployEventScriptArguments extends deploy_contracts.ScriptArguments { + /** + * The kind of deploy event. + */ + readonly deployEvent: deploy_contracts.DeployEvent; + /** + * The kind of operation. + */ + readonly deployOperation: deploy_contracts.DeployOperation; + /** + * The underlying target. + */ + readonly target: FTPTarget; + /** + * The underlying workspace. + */ + readonly workspace: deploy_workspaces.Workspace; +} + /** * A 'ftp' target. */ @@ -121,15 +142,7 @@ export interface FTPTarget extends deploy_targets.Target { /** * Arguments for an upload based event. */ -export interface FTPUploadScriptArguments extends deploy_contracts.ScriptArguments { - /** - * The underlying target. - */ - readonly target: FTPTarget; - /** - * The underlying workspace. - */ - readonly workspace: deploy_workspaces.Workspace; +export interface FTPUploadScriptArguments extends FTPDeployEventScriptArguments { } /** @@ -250,6 +263,8 @@ class FTPPlugin extends deploy_plugins.AsyncFileClientPluginBase { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: undefined, state: undefined, target: target, @@ -346,6 +361,8 @@ class FTPPlugin extends deploy_plugins.AsyncFileClientPluginBase { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: undefined, state: undefined, target: target, diff --git a/src/plugins/script.ts b/src/plugins/script.ts index e0b94c4..4d2aa39 100644 --- a/src/plugins/script.ts +++ b/src/plugins/script.ts @@ -19,7 +19,6 @@ import * as deploy_contracts from '../contracts'; import * as deploy_files from '../files'; import * as deploy_helpers from '../helpers'; import * as deploy_plugins from '../plugins'; -import * as deploy_session from '../session'; import * as deploy_targets from '../targets'; import * as deploy_workspaces from '../workspaces'; import * as Events from 'events'; @@ -141,7 +140,7 @@ class ScriptPlugin extends deploy_plugins.PluginBase { require: (id) => { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: undefined, state: undefined, target: context.target, diff --git a/src/plugins/sftp.ts b/src/plugins/sftp.ts index 2dc972a..99dff00 100644 --- a/src/plugins/sftp.ts +++ b/src/plugins/sftp.ts @@ -20,7 +20,6 @@ import * as deploy_clients_sftp from '../clients/sftp'; import * as deploy_contracts from '../contracts'; import * as deploy_helpers from '../helpers'; import * as deploy_plugins from '../plugins'; -import * as deploy_session from '../session'; import * as deploy_targets from '../targets'; import * as deploy_workspaces from '../workspaces'; import * as Events from 'events'; @@ -61,6 +60,28 @@ interface SFTPContext extends deploy_plugins.AsyncFileClientPluginContext { } +/** + * Script arguments for a deploy event. + */ +export interface SFTPDeployEventScriptArguments extends deploy_contracts.ScriptArguments { + /** + * The kind of deploy event. + */ + readonly deployEvent: deploy_contracts.DeployEvent; + /** + * The kind of operation. + */ + readonly deployOperation: deploy_contracts.DeployOperation; + /** + * The underlying target. + */ + readonly target: SFTPTarget; + /** + * The underlying workspace. + */ + readonly workspace: deploy_workspaces.Workspace; +} + /** * A 'sftp' target. */ @@ -159,7 +180,7 @@ export interface SFTPTarget extends deploy_targets.Target { /** * Arguments for an upload based event. */ -export interface SFTPUploadScriptArguments extends deploy_contracts.ScriptArguments { +export interface SFTPUploadScriptArguments extends SFTPDeployEventScriptArguments { /** * The underlying target. */ @@ -314,6 +335,8 @@ class SFTPPlugin extends deploy_plugins.AsyncFileClientPluginBase { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: undefined, state: undefined, target: target, @@ -410,6 +433,8 @@ class SFTPPlugin extends deploy_plugins.AsyncFileClientPluginBase { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: undefined, state: undefined, target: target, diff --git a/src/pull.ts b/src/pull.ts index 646b821..0d1a020 100644 --- a/src/pull.ts +++ b/src/pull.ts @@ -23,7 +23,6 @@ import * as deploy_helpers from './helpers'; import * as deploy_html from './html'; import * as deploy_packages from './packages'; import * as deploy_plugins from './plugins'; -import * as deploy_session from './session'; import * as deploy_targets from './targets'; import * as deploy_transformers from './transformers'; import * as deploy_workspaces from './workspaces'; @@ -719,7 +718,7 @@ export async function pullFilesFrom(files: string[], require: (id) => { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: ME.settingFolder, state: undefined, workspaceRoot: ME.rootPath, diff --git a/src/session.ts b/src/session.ts deleted file mode 100644 index a5586c4..0000000 --- a/src/session.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file is part of the vscode-deploy-reloaded distribution. - * Copyright (c) Marcel Joachim Kloubert. - * - * vscode-deploy-reloaded is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, version 3. - * - * vscode-deploy-reloaded is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import * as deploy_contracts from './contracts'; - - -/** - * The global extension wide state object. - */ -export const SESSION_STATE: deploy_contracts.KeyValuePairs = {}; diff --git a/src/targets/operations/http.ts b/src/targets/operations/http.ts index 935518d..166d5d1 100644 --- a/src/targets/operations/http.ts +++ b/src/targets/operations/http.ts @@ -18,7 +18,6 @@ import * as deploy_contracts from '../../contracts'; import * as deploy_helpers from '../../helpers'; import * as deploy_http from '../../http'; -import * as deploy_session from '../../session'; import * as deploy_targets from '../../targets'; import * as i18 from '../../i18'; import * as Url from 'url'; @@ -216,7 +215,7 @@ export async function execute(context: deploy_targets.TargetOperationExecutionCo require: (id) => { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: WORKSPACE.settingFolder, state: undefined, url: URL, diff --git a/src/targets/operations/script.ts b/src/targets/operations/script.ts index 94fddfd..ef18c26 100644 --- a/src/targets/operations/script.ts +++ b/src/targets/operations/script.ts @@ -17,7 +17,6 @@ import * as deploy_contracts from '../../contracts'; import * as deploy_helpers from '../../helpers'; -import * as deploy_session from '../../session'; import * as deploy_targets from '../../targets'; import * as i18 from '../../i18'; @@ -117,7 +116,7 @@ export async function execute(context: deploy_targets.TargetOperationExecutionCo require: (id) => { return deploy_helpers.requireFromExtension(id); }, - sessionState: deploy_session.SESSION_STATE, + sessionState: deploy_helpers.SESSION, settingFolder: WORKSPACE.settingFolder, state: undefined, workspaceRoot: WORKSPACE.rootPath,