Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

artifact-engine

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

artifact-engine - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

13

Engine/artifactEngine.js
"use strict";
const path = require('path');
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
var tl = require('vsts-task-lib/task');
var minimatch = require('minimatch');
const models = require('../Models');
const ci = require('./cilogger');
const artifactItemStore_1 = require('../Store/artifactItemStore');
const models = require("../Models");
const ci = require("./cilogger");
const artifactItemStore_1 = require("../Store/artifactItemStore");
const artifactEngineOptions_1 = require("./artifactEngineOptions");
const logger_1 = require('./logger');
const worker_1 = require('./worker');
const logger_1 = require("./logger");
const worker_1 = require("./worker");
class ArtifactEngine {

@@ -12,0 +13,0 @@ constructor() {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ArtifactEngineOptions {

@@ -3,0 +4,0 @@ constructor() {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tl = require('vsts-task-lib');

@@ -6,11 +7,11 @@ var packagejson = require('../package.json');

function getDefaultProps() {
var hostType = (tl.getVariable('SYSTEM.HOSTTYPE') || "").toLowerCase();
return {
serverurl: tl.getVariable('System.TEAMFOUNDATIONSERVERURI'),
releaseurl: tl.getVariable('Release.ReleaseWebUrl'),
taskDisplayName: tl.getVariable('Task.DisplayName'),
jobid: tl.getVariable('System.Jobid'),
releaseid: tl.getVariable('Release.ReleaseId'),
builduri: tl.getVariable('Build.BuildUri'),
buildid: tl.getVariable('Build.Buildid'),
agentVersion: tl.getVariable('Agent.Version'),
hostType: hostType,
definitionName: hostType === 'release' ? tl.getVariable('RELEASE.DEFINITIONNAME') : tl.getVariable('BUILD.DEFINITIONNAME'),
processId: hostType === 'release' ? tl.getVariable('RELEASE.RELEASEID') : tl.getVariable('BUILD.BUILDID'),
processUrl: hostType === 'release' ? tl.getVariable('RELEASE.RELEASEWEBURL') : (tl.getVariable('SYSTEM.TEAMFOUNDATIONSERVERURI') + tl.getVariable('SYSTEM.TEAMPROJECT') + '/_build?buildId=' + tl.getVariable('BUILD.BUILDID')),
taskDisplayName: tl.getVariable('TASK.DISPLAYNAME'),
jobid: tl.getVariable('SYSTEM.JOBID'),
agentVersion: tl.getVariable('AGENT.VERSION'),
version: packagejson.version

@@ -17,0 +18,0 @@ };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var artifactEngineOptions_1 = require("./artifactEngineOptions");

@@ -3,0 +4,0 @@ exports.ArtifactEngineOptions = artifactEngineOptions_1.ArtifactEngineOptions;

@@ -5,11 +5,12 @@ "use strict";

function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments)).next());
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const Models_1 = require('../Models');
const ticketState_1 = require('../Models/ticketState');
Object.defineProperty(exports, "__esModule", { value: true });
const Models_1 = require("../Models");
const ticketState_1 = require("../Models/ticketState");
var tl = require('vsts-task-lib');
const ci = require('./cilogger');
const ci = require("./cilogger");
class Logger {

@@ -31,21 +32,23 @@ constructor(store) {

if (Logger.verbose) {
var progressLogger = () => __awaiter(this, void 0, void 0, function* () { return setTimeout(() => {
var tickets = this.store.getTickets();
var queuedItems = tickets.filter(x => x.state == ticketState_1.TicketState.InQueue);
var processingItems = tickets.filter(x => x.state == ticketState_1.TicketState.Processing);
var processedItems = tickets.filter(x => x.state == ticketState_1.TicketState.Processed);
var skippedItems = tickets.filter(x => x.state == ticketState_1.TicketState.Skipped);
var failedItems = tickets.filter(x => x.state == ticketState_1.TicketState.Failed);
var currentTime = new Date();
tl.debug("Total Items: " + tickets.length
+ ", Processed: " + processedItems.length
+ ", Processing: " + processingItems.length
+ ", Queued: " + queuedItems.length
+ ", Skipped: " + skippedItems.length
+ ", Failed: " + failedItems.length
+ ", Time elapsed: " + ((currentTime.valueOf() - this.startTime.valueOf()) / 1000) + "secs");
if (this.store.itemsPendingProcessing()) {
progressLogger();
}
}, 5000); });
var progressLogger = () => __awaiter(this, void 0, void 0, function* () {
return setTimeout(() => {
var tickets = this.store.getTickets();
var queuedItems = tickets.filter(x => x.state == ticketState_1.TicketState.InQueue);
var processingItems = tickets.filter(x => x.state == ticketState_1.TicketState.Processing);
var processedItems = tickets.filter(x => x.state == ticketState_1.TicketState.Processed);
var skippedItems = tickets.filter(x => x.state == ticketState_1.TicketState.Skipped);
var failedItems = tickets.filter(x => x.state == ticketState_1.TicketState.Failed);
var currentTime = new Date();
tl.debug("Total Items: " + tickets.length
+ ", Processed: " + processedItems.length
+ ", Processing: " + processingItems.length
+ ", Queued: " + queuedItems.length
+ ", Skipped: " + skippedItems.length
+ ", Failed: " + failedItems.length
+ ", Time elapsed: " + ((currentTime.valueOf() - this.startTime.valueOf()) / 1000) + "secs");
if (this.store.itemsPendingProcessing()) {
progressLogger();
}
}, 5000);
});
progressLogger();

@@ -52,0 +55,0 @@ }

"use strict";
const logger_1 = require('./logger');
Object.defineProperty(exports, "__esModule", { value: true });
const logger_1 = require("./logger");
class Worker {

@@ -4,0 +5,0 @@ constructor(id, execute, getNextItem, canExit) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ArtifactDownloadTicket {

@@ -3,0 +4,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ArtifactItem {

@@ -3,0 +4,0 @@ constructor() {

@@ -0,1 +1,2 @@

/// <reference types="node" />
import { ArtifactItem } from "./artifactItem";

@@ -2,0 +3,0 @@ export interface IArtifactProvider {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=artifactprovider.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class Constants {

@@ -3,0 +4,0 @@ }

"use strict";
var artifactDownloadTicket_1 = require('./artifactDownloadTicket');
Object.defineProperty(exports, "__esModule", { value: true });
var artifactDownloadTicket_1 = require("./artifactDownloadTicket");
exports.ArtifactDownloadTicket = artifactDownloadTicket_1.ArtifactDownloadTicket;
var artifactItem_1 = require("./artifactItem");
exports.ArtifactItem = artifactItem_1.ArtifactItem;
var itemType_1 = require('./itemType');
var itemType_1 = require("./itemType");
exports.ItemType = itemType_1.ItemType;
var ticketState_1 = require('./ticketState');
var ticketState_1 = require("./ticketState");
exports.TicketState = ticketState_1.TicketState;
var constants_1 = require('./constants');
var constants_1 = require("./constants");
exports.Constants = constants_1.Constants;
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ItemType;
(function (ItemType) {

@@ -6,4 +8,3 @@ ItemType[ItemType["Any"] = "any"] = "Any";

ItemType[ItemType["File"] = "file"] = "File";
})(exports.ItemType || (exports.ItemType = {}));
var ItemType = exports.ItemType;
})(ItemType = exports.ItemType || (exports.ItemType = {}));
//# sourceMappingURL=itemType.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var TicketState;
(function (TicketState) {

@@ -8,4 +10,3 @@ TicketState[TicketState["InQueue"] = "inqueue"] = "InQueue";

TicketState[TicketState["Failed"] = "failed"] = "Failed";
})(exports.TicketState || (exports.TicketState = {}));
var TicketState = exports.TicketState;
})(TicketState = exports.TicketState || (exports.TicketState = {}));
//# sourceMappingURL=ticketState.js.map
{
"name": "artifact-engine",
"version": "0.1.5",
"version": "0.1.6",
"description": "Artifact Engine to download artifacts from jenkins, teamcity, vsts",

@@ -27,5 +27,5 @@ "repository": {

"@types/minimatch": "^2.0.29",
"@types/mocha": "^2.2.5",
"@types/mockery": "1.4.29",
"@types/node": "6.0.31",
"@types/node": "^6.0.92",
"@types/mocha": "^2.2.44",
"assert": "1.4.1",

@@ -37,3 +37,3 @@ "mocha": "2.3.3",

"sinon": "4.0.1",
"typescript": "1.8.7",
"typescript": "2.4.2",
"nock": "9.1.0"

@@ -40,0 +40,0 @@ },

@@ -0,1 +1,2 @@

/// <reference types="node" />
import * as models from '../Models';

@@ -2,0 +3,0 @@ export declare class FilesystemProvider implements models.IArtifactProvider {

"use strict";
const path = require('path');
const fs = require('fs');
const models = require('../Models');
const logger_1 = require('../Engine/logger');
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const fs = require("fs");
const models = require("../Models");
const logger_1 = require("../Engine/logger");
class FilesystemProvider {

@@ -38,2 +39,3 @@ constructor(rootLocation) {

const outputFilename = path.join(this._rootLocation, item.path);
// create parent folder if it has not already been created
const folder = path.dirname(outputFilename);

@@ -74,2 +76,3 @@ try {

var filePath = path.join(itemsPath, file);
// do not follow symbolic link
var itemStat;

@@ -76,0 +79,0 @@ try {

"use strict";
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
Object.defineProperty(exports, "__esModule", { value: true });
class BasicCredentialHandler {

@@ -7,2 +10,4 @@ constructor(username, password) {

}
// currently implements pre-authorization
// TODO: support preAuth = false where it hooks on 401
prepareRequest(options) {

@@ -12,2 +17,3 @@ options.headers['Authorization'] = 'Basic ' + new Buffer(this.username + ':' + this.password).toString('base64');

}
// This handler cannot handle 401
canHandleAuthentication(res) {

@@ -14,0 +20,0 @@ return false;

"use strict";
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
Object.defineProperty(exports, "__esModule", { value: true });
class BearerCredentialHandler {

@@ -6,2 +9,4 @@ constructor(token) {

}
// currently implements pre-authorization
// TODO: support preAuth = false where it hooks on 401
prepareRequest(options) {

@@ -11,2 +16,3 @@ options.headers['Authorization'] = 'Bearer ' + this.token;

}
// This handler cannot handle 401
canHandleAuthentication(res) {

@@ -13,0 +19,0 @@ return false;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var basiccreds_1 = require("./basiccreds");

@@ -3,0 +4,0 @@ exports.BasicCredentialHandler = basiccreds_1.BasicCredentialHandler;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
;
//# sourceMappingURL=interfaces.js.map
"use strict";
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
Object.defineProperty(exports, "__esModule", { value: true });
class PersonalAccessTokenCredentialHandler {

@@ -6,2 +9,4 @@ constructor(token) {

}
// currently implements pre-authorization
// TODO: support preAuth = false where it hooks on 401
prepareRequest(options) {

@@ -11,2 +16,3 @@ options.headers['Authorization'] = 'Basic ' + new Buffer('PAT:' + this.token).toString('base64');

}
// This handler cannot handle 401
canHandleAuthentication(res) {

@@ -13,0 +19,0 @@ return false;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var webProvider_1 = require("./webProvider");

@@ -3,0 +4,0 @@ exports.WebProvider = webProvider_1.WebProvider;

@@ -0,1 +1,2 @@

/// <reference types="node" />
import * as models from '../Models';

@@ -2,0 +3,0 @@ import { ItemType } from '../Models';

@@ -5,10 +5,11 @@ "use strict";

function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments)).next());
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const Stream = require('stream');
const models = require('../Models');
const Models_1 = require('../Models');
Object.defineProperty(exports, "__esModule", { value: true });
const Stream = require("stream");
const models = require("../Models");
const Models_1 = require("../Models");
class StubProvider {

@@ -23,3 +24,3 @@ constructor() {

getRootItems() {
return __awaiter(this, void 0, Promise, function* () {
return __awaiter(this, void 0, void 0, function* () {
this.getRootItemsCalledCount++;

@@ -30,3 +31,3 @@ return [this.getItem(1, 1, 3, Models_1.ItemType.File), this.getItem(1, 2, 3, Models_1.ItemType.File), this.getItem(1, 3, 3, Models_1.ItemType.File), this.getItem(2, 1, 1, Models_1.ItemType.Folder), this.getItem(3, 1, 5, Models_1.ItemType.File), this.getItem(4, 1, 3, Models_1.ItemType.File), this.getItem(5, 1, 4, Models_1.ItemType.Folder)];

getArtifactItems(artifactItem) {
return __awaiter(this, void 0, Promise, function* () {
return __awaiter(this, void 0, void 0, function* () {
this.getArtifactItemsCalledCount++;

@@ -40,3 +41,3 @@ if (artifactItem.path === 'path5') {

getArtifactItem(artifactItem) {
return __awaiter(this, void 0, Promise, function* () {
return __awaiter(this, void 0, void 0, function* () {
this.getArtifactItemCalledCount++;

@@ -43,0 +44,0 @@ this.itemsDownloaded.push(artifactItem);

@@ -0,1 +1,2 @@

/// <reference types="node" />
import * as stream from 'stream';

@@ -2,0 +3,0 @@ import * as httpm from 'typed-rest-client/HttpClient';

"use strict";
const fs = require('fs');
const path = require('path');
const zlib = require('zlib');
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const path = require("path");
const zlib = require("zlib");
var handlebars = require('handlebars');
const httpm = require('typed-rest-client/HttpClient');
const httpm = require("typed-rest-client/HttpClient");
var tl = require('vsts-task-lib');
const models = require('../Models');
const logger_1 = require('../Engine/logger');
const models = require("../Models");
const logger_1 = require("../Engine/logger");
var packagejson = require('../package.json');

@@ -11,0 +12,0 @@ class WebProvider {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const models = require("../Models");

@@ -3,0 +4,0 @@ class ArtifactItemStore {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc