azure-pipelines-tasks-webdeployment-common 4.233.0 → 4.242.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ const assert = require("assert");
15
15
  const ziputility_1 = require("../ziputility");
16
16
  function runL1ZipUtilityTests() {
17
17
  it("Should skip ZIP entries validation", () => __awaiter(this, void 0, void 0, function* () {
18
- const archive = path.join(__dirname, 'L1ZipUtility', 'potentially_malicious.zip');
18
+ const archive = path.join(__dirname, '..', '..', 'Tests', 'L1ZipUtility', 'potentially_malicious.zip');
19
19
  const exists = yield ziputility_1.checkIfFilesExistsInZip(archive, ['index.html']);
20
20
  assert.strictEqual(exists, true);
21
21
  }));
@@ -5,7 +5,7 @@ import { checkIfFilesExistsInZip } from "../ziputility";
5
5
  export function runL1ZipUtilityTests(this: Mocha.Suite): void {
6
6
 
7
7
  it("Should skip ZIP entries validation", async () => {
8
- const archive = path.join(__dirname, 'L1ZipUtility', 'potentially_malicious.zip');
8
+ const archive = path.join(__dirname, '..', '..', 'Tests', 'L1ZipUtility', 'potentially_malicious.zip');
9
9
 
10
10
  const exists = await checkIfFilesExistsInZip(archive, ['index.html']);
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-pipelines-tasks-webdeployment-common",
3
- "version": "4.233.0",
3
+ "version": "4.242.0",
4
4
  "description": "Common Lib for MSDeploy Utility",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,7 +23,6 @@
23
23
  "@xmldom/xmldom": "git+https://github.com/xmldom/xmldom.git#0.8.6",
24
24
  "archiver": "1.2.0",
25
25
  "azure-pipelines-task-lib": "^4.2.0",
26
- "decompress-zip": "^0.3.3",
27
26
  "ltx": "2.8.0",
28
27
  "node-stream-zip": "^1.15.0",
29
28
  "q": "1.4.1",
package/ziputility.js CHANGED
@@ -15,7 +15,6 @@ const path = require("path");
15
15
  const Q = require("q");
16
16
  const fs = require("fs");
17
17
  const StreamZip = require("node-stream-zip");
18
- var DecompressZip = require('decompress-zip');
19
18
  var archiver = require('archiver');
20
19
  const deleteDir = (path) => tl.exist(path) && tl.rmRF(path);
21
20
  const extractWindowsZip = (fromFile, toDir, usePowerShell) => __awaiter(void 0, void 0, void 0, function* () {
@@ -141,17 +140,16 @@ exports.archiveFolder = archiveFolder;
141
140
  function getArchivedEntries(archivedPackage) {
142
141
  return __awaiter(this, void 0, void 0, function* () {
143
142
  var deferred = Q.defer();
144
- var unzipper = new DecompressZip(archivedPackage);
145
- unzipper.on('error', function (error) {
146
- deferred.reject(error);
147
- });
148
- unzipper.on('list', function (files) {
149
- var packageComponent = {
150
- "entries": files
143
+ const zip = new StreamZip.async({ file: archivedPackage });
144
+ zip.entries().then(entries => {
145
+ var packageConmponent = {
146
+ 'entries': Object.keys(entries)
151
147
  };
152
- deferred.resolve(packageComponent);
148
+ zip.close();
149
+ deferred.resolve(packageConmponent);
150
+ }).catch(error => {
151
+ deferred.reject(error);
153
152
  });
154
- unzipper.list();
155
153
  return deferred.promise;
156
154
  });
157
155
  }