diff --git a/Tasks/FtpUploadV2/Tests/L0.ts b/Tasks/FtpUploadV2/Tests/L0.ts index 6e8afaf578bb..a898ec6b1fd7 100644 --- a/Tasks/FtpUploadV2/Tests/L0.ts +++ b/Tasks/FtpUploadV2/Tests/L0.ts @@ -1,16 +1,140 @@ import fs = require('fs'); import assert = require('assert'); import path = require('path'); +import * as ttm from 'azure-pipelines-task-lib/mock-test'; describe('FtpUploadV2 Suite', function () { - before(() => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT!) || 20000); + + it('check args: no serverEndpoint', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0NoServerEndpoint.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: serverEndpoint'), 'Should have printed: Input required: serverEndpoint'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no rootFolder', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0NoRootFolder.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: rootFolder'), 'Should have printed: Input required: rootFolder'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no filePatterns', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0NoFilePatterns.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: filePatterns'), 'Should have printed: Input required: filePatterns'); + assert(tr.failed, 'task should have failed'); + + done(); }); - after(() => { + it('check args: no remotePath', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0NoRemotePath.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: remotePath'), 'Should have printed: Input required: remotePath'); + assert(tr.failed, 'task should have failed'); + + done(); }); - it('Does a basic hello world test', function(done: MochaDone) { - // TODO - add real tests + it('check args: no clean', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0NoClean.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: clean'), 'Should have printed: Input required: clean'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no preservePaths', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0NoPreservePaths.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: preservePaths'), 'Should have printed: Input required: preservePaths'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no trustSSL', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0NoTrustSSL.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.invokedToolCount === 0, 'should not run anything'); + assert(tr.stdOutContained('Input required: trustSSL'), 'Should have printed: Input required: trustSSL'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no protocol on server URL (ftp:// or ftps://)', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0NoProtocol.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('loc_mock_FTPNoProtocolSpecified'), 'Should have printed: loc_mock_FTPNoProtocolSpecified'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no host name on server URL', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0NoHostName.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('loc_mock_FTPNoHostSpecified'), 'Should have printed: loc_mock_FTPNoHostSpecified'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no files found', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0NoFilesFound.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('loc_mock_NoFilesFound'), 'Should have printed: loc_mock_NoFilesFound'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('task should complete successfully', (done: Mocha.Done) => { + const tp = path.join(__dirname, 'L0Successful.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + console.info(tr.stdout); + assert(tr.succeeded, 'task should succeed'); + done(); }); }); diff --git a/Tasks/FtpUploadV2/Tests/L0NoClean.ts b/Tasks/FtpUploadV2/Tests/L0NoClean.ts new file mode 100644 index 000000000000..1fb4547bf018 --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0NoClean.ts @@ -0,0 +1,39 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('credsType', 'serviceEndpoint'); +process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com"; +process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}"; +process.env["build.sourcesDirectory"] = "/"; +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/L0NoFilePatterns.ts b/Tasks/FtpUploadV2/Tests/L0NoFilePatterns.ts new file mode 100644 index 000000000000..f0a851fd78f4 --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0NoFilePatterns.ts @@ -0,0 +1,37 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('credsType', 'serviceEndpoint'); +process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com"; +process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}"; +process.env["build.sourcesDirectory"] = "/"; + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/L0NoFilesFound.ts b/Tasks/FtpUploadV2/Tests/L0NoFilesFound.ts new file mode 100644 index 000000000000..a17d784d78b9 --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0NoFilesFound.ts @@ -0,0 +1,39 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('credsType', 'inputs'); +tr.setInput('serverUrl', 'ftps://'); +tr.setInput('username', 'username'); +tr.setInput('password', 'password'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); +tr.setInput('overwrite', 'true'); +tr.setInput('preservePaths', 'true'); +tr.setInput('trustSSL', 'true'); +process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com"; +process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}"; +process.env["build.sourcesDirectory"] = "/"; + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + ] + }, + "match": { + "*": [ + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/L0NoHostName.ts b/Tasks/FtpUploadV2/Tests/L0NoHostName.ts new file mode 100644 index 000000000000..ca9b0196d05b --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0NoHostName.ts @@ -0,0 +1,45 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('credsType', 'inputs'); +tr.setInput('serverUrl', 'ftps://'); +tr.setInput('username', 'username'); +tr.setInput('password', 'password'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); +tr.setInput('overwrite', 'true'); +tr.setInput('preservePaths', 'true'); +tr.setInput('trustSSL', 'true'); +process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com"; +process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}"; +process.env["build.sourcesDirectory"] = "/"; + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/L0NoPreservePaths.ts b/Tasks/FtpUploadV2/Tests/L0NoPreservePaths.ts new file mode 100644 index 000000000000..85662c7fdade --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0NoPreservePaths.ts @@ -0,0 +1,41 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('credsType', 'serviceEndpoint'); +process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com"; +process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}"; +process.env["build.sourcesDirectory"] = "/"; +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); +tr.setInput('overwrite', 'true'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/L0NoProtocol.ts b/Tasks/FtpUploadV2/Tests/L0NoProtocol.ts new file mode 100644 index 000000000000..44c84485f9e0 --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0NoProtocol.ts @@ -0,0 +1,45 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('credsType', 'inputs'); +tr.setInput('serverUrl', 'noprotocol.microsoft.com'); +tr.setInput('username', 'myUsername'); +tr.setInput('password', 'myPassword'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); +tr.setInput('overwrite', 'true'); +tr.setInput('preservePaths', 'true'); +tr.setInput('trustSSL', 'true'); +process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com"; +process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}"; +process.env["build.sourcesDirectory"] = "/"; + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/L0NoRemotePath.ts b/Tasks/FtpUploadV2/Tests/L0NoRemotePath.ts new file mode 100644 index 000000000000..87a673e707d4 --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0NoRemotePath.ts @@ -0,0 +1,38 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('credsType', 'serviceEndpoint'); +process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com"; +process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}"; +process.env["build.sourcesDirectory"] = "/"; +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/L0NoRootFolder.ts b/Tasks/FtpUploadV2/Tests/L0NoRootFolder.ts new file mode 100644 index 000000000000..8972a7ec6c12 --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0NoRootFolder.ts @@ -0,0 +1,36 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('credsType', 'serviceEndpoint'); +process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com"; +process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}"; +process.env["build.sourcesDirectory"] = "/"; + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/L0NoServerEndpoint.ts b/Tasks/FtpUploadV2/Tests/L0NoServerEndpoint.ts new file mode 100644 index 000000000000..ba9740684299 --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0NoServerEndpoint.ts @@ -0,0 +1,37 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('credsType', 'serviceEndpoint'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/L0NoTrustSSL.ts b/Tasks/FtpUploadV2/Tests/L0NoTrustSSL.ts new file mode 100644 index 000000000000..fdc2d6b5dabf --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0NoTrustSSL.ts @@ -0,0 +1,42 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('credsType', 'serviceEndpoint'); +process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com"; +process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}"; +process.env["build.sourcesDirectory"] = "/"; +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); +tr.setInput('overwrite', 'true'); +tr.setInput('preservePaths', 'true'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/L0Successful.ts b/Tasks/FtpUploadV2/Tests/L0Successful.ts new file mode 100644 index 000000000000..338049fe5181 --- /dev/null +++ b/Tasks/FtpUploadV2/Tests/L0Successful.ts @@ -0,0 +1,72 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +const ftp = { + Client: function () { + this.ftp = { + log: () => { } + }; + this.access = (options: any) => { + return { + message: "ftp mock response", + }; + }; + this.trackProgress = (callback: (info: any) => void) => { + + }; + this.send = (cmd: string) => { + + }; + this.ensureDir = (path: string) => { }; + this.removeDir = (path: string) => { }; + this.close = () => { }; + }, + ftp: {}, + access: {}, + trackProgress: {}, + send: {}, + ensureDir: {}, + removeDir: {}, + close: {}, +} + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('credsType', 'serviceEndpoint'); +process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com"; +process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}"; +process.env["build.sourcesDirectory"] = "/"; +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); +tr.setInput('overwrite', 'true'); +tr.setInput('preservePaths', 'true'); +tr.setInput('trustSSL', 'true'); +tr.registerMock("basic-ftp", ftp); +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "exist": { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); diff --git a/Tasks/FtpUploadV2/Tests/package-lock.json b/Tasks/FtpUploadV2/Tests/package-lock.json index 04ef5eaf8472..ce24480dd17e 100644 --- a/Tasks/FtpUploadV2/Tests/package-lock.json +++ b/Tasks/FtpUploadV2/Tests/package-lock.json @@ -1,8 +1,24 @@ { "name": "ftp-upload-tests", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "ftp-upload-tests", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@types/mocha": "^5.2.7" + } + }, + "node_modules/@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "dev": true + } + }, "dependencies": { "@types/mocha": { "version": "5.2.7", diff --git a/Tasks/FtpUploadV2/Tests/package.json b/Tasks/FtpUploadV2/Tests/package.json index 8a8d59e43ced..5d38af358649 100644 --- a/Tasks/FtpUploadV2/Tests/package.json +++ b/Tasks/FtpUploadV2/Tests/package.json @@ -17,6 +17,6 @@ }, "homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme", "devDependencies": { - "@types/mocha": "^5.2.0" + "@types/mocha": "^5.2.7" } } diff --git a/Tasks/FtpUploadV2/ftpuploadtask.ts b/Tasks/FtpUploadV2/ftpuploadtask.ts index 1469c5ce0856..88d5497ee4c0 100644 --- a/Tasks/FtpUploadV2/ftpuploadtask.ts +++ b/Tasks/FtpUploadV2/ftpuploadtask.ts @@ -166,22 +166,22 @@ function getFtpOptions(): FtpOptions { if (tl.getInput("credsType") === "serviceEndpoint") { // server endpoint - const serverEndpoint: string = tl.getInput("serverEndpoint", true); + const serverEndpoint: string = tl.getInput("serverEndpoint", true)!; serverEndpointUrl = url.parse( - tl.getEndpointUrl(serverEndpoint, false) + tl.getEndpointUrl(serverEndpoint, false)! ); const serverEndpointAuth: tl.EndpointAuthorization = tl.getEndpointAuthorization( serverEndpoint, false - ); + )!; username = serverEndpointAuth["parameters"]["username"]; password = serverEndpointAuth["parameters"]["password"]; } else { // user entered credentials directly - serverEndpointUrl = url.parse(tl.getInput("serverUrl", true)); - username = tl.getInput("username", true); - password = tl.getInput("password", true); + serverEndpointUrl = url.parse(tl.getInput("serverUrl", true)!); + username = tl.getInput("username", true)!; + password = tl.getInput("password", true)!; } return { @@ -190,9 +190,9 @@ function getFtpOptions(): FtpOptions { password: password, // other standard options - rootFolder: tl.getPathInput("rootFolder", true), + rootFolder: tl.getPathInput("rootFolder", true)!, filePatterns: tl.getDelimitedInput("filePatterns", "\n", true), - remotePath: tl.getInput("remotePath", true).trim().replace(/\\/gi, "/"), // use forward slashes always + remotePath: tl.getInput("remotePath", true)!.trim().replace(/\\/gi, "/"), // use forward slashes always // advanced options clean: tl.getBoolInput("clean", true), diff --git a/Tasks/FtpUploadV2/package-lock.json b/Tasks/FtpUploadV2/package-lock.json index c91012d85b16..021deeff00c4 100644 --- a/Tasks/FtpUploadV2/package-lock.json +++ b/Tasks/FtpUploadV2/package-lock.json @@ -4,28 +4,65 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/concat-stream": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", + "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", + "requires": { + "@types/node": "*" + } + }, + "@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha1-yayFsqX9GENbjIXZ7LUObWyJP/g=", + "requires": { + "@types/node": "*" + } + }, + "@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==" + }, "@types/node": { "version": "8.10.44", "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.44.tgz", "integrity": "sha512-HY3SK7egERHGUfY8p6ztXIEQWcIPHouYhCGcLAPQin7gE2G/fALFz+epnMwcxKUS6aKqTVoAFdi+t1llQd3xcw==" }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, "azure-pipelines-task-lib": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-2.8.0.tgz", - "integrity": "sha512-PR8oap9z2j+o455W3PwAfB4SX1p4GdJc9OHQaQV0V+iQS1IBY6dVgcNSQMkHAXb0V1bbuLOFBLanXPe5eSgGTQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-3.1.10.tgz", + "integrity": "sha512-S5iH1mD9G7boOV0kjVsFkqlz/6FOZjQAajshj3ajzQK9Wr3XRq9JK9+grJP4ityG6of28X2XWpieFdJLhnWLoA==", "requires": { "minimatch": "3.0.4", "mockery": "^1.7.0", - "q": "^1.1.2", + "q": "^1.5.1", "semver": "^5.1.0", - "shelljs": "^0.3.0", + "shelljs": "^0.8.4", + "sync-request": "6.1.0", "uuid": "^3.0.1" } }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "basic-ftp": { "version": "3.4.3", @@ -33,19 +70,199 @@ "integrity": "sha512-e6OxKXoYwpOfDcvQ0jfY0Nn6mGqGBXqT9JQiney7GeQWZSkYgbcCSgB1O2FGafbxZxtRG0lk8G8RyD+lPpxAKg==" }, "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=" + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==" + }, + "http-basic": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", + "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", + "requires": { + "caseless": "^0.12.0", + "concat-stream": "^1.6.2", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + } + }, + "http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "requires": { + "@types/node": "^10.0.3" + }, + "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + } + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "is-core-module": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "requires": { + "has": "^1.0.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "mime-db": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" + }, + "mime-types": { + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "requires": { + "mime-db": "1.51.0" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -59,25 +276,190 @@ "resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz", "integrity": "sha1-9O3g2HUMHJcnwnLqLGBiniyaHE8=" }, + "object-inspect": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha1-juqz5U+laSD+Fro493+iGqzC104=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "promise": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.1.0.tgz", + "integrity": "sha512-W04AqnILOL/sPRXziNicCjSNRruLAuIHEOVBazepu0545DDNGYHz7ar9ZgZ1fMU8/MA4mVxp5rkBWRi6OXIy3Q==", + "requires": { + "asap": "~2.0.6" + } + }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, + "qs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "requires": { + "side-channel": "^1.0.4" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "requires": { + "resolve": "^1.1.6" + } + }, + "resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "requires": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "shelljs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", - "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=" + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "sync-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", + "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", + "requires": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + } + }, + "sync-rpc": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", + "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", + "requires": { + "get-port": "^3.1.0" + } + }, + "then-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", + "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", + "requires": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^8.1.1", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" } } } diff --git a/Tasks/FtpUploadV2/package.json b/Tasks/FtpUploadV2/package.json index 33949a8fb991..8ab80a9e9a14 100644 --- a/Tasks/FtpUploadV2/package.json +++ b/Tasks/FtpUploadV2/package.json @@ -15,7 +15,8 @@ "homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme", "dependencies": { "@types/node": "^8.0.0", - "azure-pipelines-task-lib": "^2.8.0", + "@types/mocha": "^5.2.7", + "azure-pipelines-task-lib": "^3.1.10", "basic-ftp": "^3.4.3" } } diff --git a/Tasks/FtpUploadV2/task.json b/Tasks/FtpUploadV2/task.json index fc33c469c289..15e510ec581f 100644 --- a/Tasks/FtpUploadV2/task.json +++ b/Tasks/FtpUploadV2/task.json @@ -18,7 +18,7 @@ "demands": [], "version": { "Major": 2, - "Minor": 198, + "Minor": 201, "Patch": 0 }, "minimumAgentVersion": "2.182.1", diff --git a/Tasks/FtpUploadV2/task.loc.json b/Tasks/FtpUploadV2/task.loc.json index f69e30580a4f..837531ff45c2 100644 --- a/Tasks/FtpUploadV2/task.loc.json +++ b/Tasks/FtpUploadV2/task.loc.json @@ -18,7 +18,7 @@ "demands": [], "version": { "Major": 2, - "Minor": 198, + "Minor": 201, "Patch": 0 }, "minimumAgentVersion": "2.182.1",