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.6 to 0.1.7

Providers/typed-rest-client/Handlers.d.ts

19

Engine/artifactEngine.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
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 {

@@ -33,5 +32,9 @@ constructor() {

this.logger.logSummary();
sourceProvider.dispose();
destProvider.dispose();
resolve(this.artifactItemStore.getTickets());
}, (err) => {
ci.publishEvent('reliability', { issueType: 'error', errorMessage: JSON.stringify(err, Object.getOwnPropertyNames(err)) });
sourceProvider.dispose();
destProvider.dispose();
reject(err);

@@ -41,2 +44,4 @@ });

ci.publishEvent('reliability', { issueType: 'error', errorMessage: JSON.stringify(err, Object.getOwnPropertyNames(err)) });
sourceProvider.dispose();
destProvider.dispose();
reject(err);

@@ -43,0 +48,0 @@ });

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

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

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

@@ -4,0 +3,0 @@ var packagejson = require('../package.json');

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

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

@@ -5,12 +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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const Models_1 = require("../Models");
const ticketState_1 = require("../Models/ticketState");
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 {

@@ -32,23 +31,21 @@ 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();

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

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

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

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

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

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

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

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

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

@@ -8,2 +7,3 @@ export interface IArtifactProvider {

putArtifactItem(artifactItem: ArtifactItem, stream: NodeJS.ReadableStream): Promise<ArtifactItem>;
dispose(): void;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=artifactprovider.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class Constants {

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var artifactDownloadTicket_1 = require("./artifactDownloadTicket");
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) {

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

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

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

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

@@ -21,4 +21,4 @@ "repository": {

"minimatch": "3.0.2",
"typed-rest-client": "^0.12.0",
"vsts-task-lib": "^2.1.0"
"vsts-task-lib": "^2.1.0",
"tunnel": "0.0.4"
},

@@ -28,5 +28,5 @@ "devDependencies": {

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

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

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

@@ -41,0 +41,0 @@ },

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

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

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

putArtifactItem(item: models.ArtifactItem, stream: NodeJS.ReadableStream): Promise<models.ArtifactItem>;
dispose(): void;
private getItems(itemsPath, parentRelativePath?);

@@ -11,0 +11,0 @@ private ensureDirectoryExistence(folder);

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

@@ -39,3 +38,2 @@ 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);

@@ -64,2 +62,4 @@ try {

}
dispose() {
}
getItems(itemsPath, parentRelativePath) {

@@ -77,3 +77,2 @@ var promise = new Promise((resolve, reject) => {

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

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

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

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

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

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

@@ -17,3 +16,4 @@ import { ItemType } from '../Models';

putArtifactItem(item: models.ArtifactItem, readStream: NodeJS.ReadableStream): Promise<models.ArtifactItem>;
dispose(): void;
delay(ms: number): Promise<{}>;
}

@@ -5,11 +5,10 @@ "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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const Stream = require("stream");
const models = require("../Models");
const Models_1 = require("../Models");
const Stream = require('stream');
const models = require('../Models');
const Models_1 = require('../Models');
class StubProvider {

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

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

@@ -31,3 +30,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, void 0, function* () {
return __awaiter(this, void 0, Promise, function* () {
this.getArtifactItemsCalledCount++;

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

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

@@ -78,2 +77,4 @@ this.itemsDownloaded.push(artifactItem);

}
dispose() {
}
delay(ms) {

@@ -80,0 +81,0 @@ return new Promise(resolve => setTimeout(resolve, ms));

@@ -1,6 +0,5 @@

/// <reference types="node" />
import * as stream from 'stream';
import * as httpm from 'typed-rest-client/HttpClient';
import * as httpm from './typed-rest-client/HttpClient';
import * as models from '../Models';
import { IRequestHandler, IRequestOptions } from './Handlers/interfaces';
import { IRequestHandler, IRequestOptions } from './typed-rest-client/Interfaces';
export declare class WebProvider implements models.IArtifactProvider {

@@ -12,2 +11,3 @@ constructor(rootItemsLocation: any, templateFile: string, variables: any, handler: IRequestHandler, requestOptions?: IRequestOptions);

putArtifactItem(item: models.ArtifactItem, readStream: stream.Readable): Promise<models.ArtifactItem>;
dispose(): void;
private getItems(itemsUrl);

@@ -14,0 +14,0 @@ private getTemplateFilePath();

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const path = require("path");
const zlib = require("zlib");
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');

@@ -21,2 +20,3 @@ class WebProvider {

this.options.cert = tl.getHttpCertConfiguration();
this.options.keepAlive = true;
this.httpc = new httpm.HttpClient('artifact-engine ' + packagejson.version, [handler], this.options);

@@ -64,2 +64,5 @@ this.variables = variables;

}
dispose() {
this.httpc.dispose();
}
getItems(itemsUrl) {

@@ -66,0 +69,0 @@ var promise = new Promise((resolve, reject) => {

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

@@ -4,0 +3,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