Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,587 changes: 3,500 additions & 1,087 deletions package-lock.json

Large diffs are not rendered by default.

33 changes: 20 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Enterprise Integration Patterns for javascript",
"version": "1.8.1",
"dependencies": {
"log4js": "^3.0.4"
"log4js": "^6.9.1"
},
"main": "build/lib/index.js",
"typings": "build/lib/index",
Expand All @@ -15,37 +15,44 @@
"watch": "tsc -w -p .",
"prepublishOnly": "npm test",
"pretest": "tslint src/*.ts && npm run build",
"test": "istanbul cover ./node_modules/.bin/_mocha build/test -- --recursive -R spec",
"posttest": "remap-istanbul -i coverage/coverage.json -o coverage/lcov-report -t html"
"test": "nyc mocha --recursive -R spec build/test",
"posttest": "nyc report --reporter=html --report-dir=coverage/lcov-report"
},
"author": "Nikos Kostoulas <kostoulas@workable.com>",
"contributors": [
"Nikos Dimos <dimos@workable.com>",
"Panos Matzavinos <matzavinos@workable.com>"
],
"license": "MIT",
"engines": {
"node": ">=24"
},
"devDependencies": {
"@types/amqplib": "0.5.1",
"@types/log4js": "0.0.32",
"@types/mocha": "^5.2.5",
"@types/node": "6.0.40",
"@types/mocha": "^10.0.9",
"@types/node": "^20.0.0",
"@types/node-uuid": "0.0.28",
"@types/should": "8.1.30",
"@types/sinon": "1.16.34",
"@types/source-map-support": "0.2.28",
"@types/sinon": "^17.0.0",
"@types/source-map-support": "^0.5.10",
"@types/supertest": "2.0.0",
"@types/uuid": "2.0.29",
"istanbul": "0.4.5",
"mocha": "^5.2.0",
"remap-istanbul": "^0.11.1",
"mocha": "^11.3.0",
"nyc": "^17.1.0",
"should": "11.2.0",
"sinon": "1.17.7",
"sinon": "^18.0.0",
"source-map-support": "^0.4.5",
"tslint": "^5.11.0",
"typescript": "2.1.5"
"typescript": "^4.9.5"
},
"repository": {
"type": "git",
"url": "Workable/eip"
},
"nyc": {
"include": [
"build/lib/**/*.js"
],
"sourceMap": true
}
}
2 changes: 1 addition & 1 deletion src/lib/processors/aggregator/aggregation-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as EventEmmiter from 'events';
import Store from './store';

abstract class AggregationStrategy extends EventEmmiter.EventEmitter {
abstract async process(event);
abstract process(event): void | Promise<void>;

inject(event, status = Store.STATUS.COMPLETED) {
this.emit('event', event, status);
Expand Down
6 changes: 3 additions & 3 deletions src/lib/processors/aggregator/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ abstract class Store {
COMPLETED: 'COMPLETED',
};

abstract async getById(id: string): Promise<any>;
abstract getById(id: string): Promise<any>;

abstract async append(id: string, headers: any, body: any): Promise<any>;
abstract append(id: string, headers: any, body: any): Promise<any>;

abstract async setStatus(id: string, status: string): Promise<any>;
abstract setStatus(id: string, status: string): Promise<any>;
}

export default Store;
2 changes: 1 addition & 1 deletion src/lib/processors/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract class Processor extends EventEmmiter.EventEmitter {
}
}

async abstract process(event: any);
abstract process(event: any): Promise<unknown | void>;
}

export default Processor;
6 changes: 3 additions & 3 deletions src/lib/processors/throttler/pub-sub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ abstract class PubSub extends EventEmmiter.EventEmitter {
super();
}

abstract async subscribe(id: string, event: any, subscribe: boolean): Promise<boolean>;
abstract subscribe(id: string, event: any, subscribe: boolean): Promise<boolean>;

abstract async publish(id: string, result: any);
abstract publish(id: string, result: any): void | Promise<void>;

abstract async timeout();
abstract timeout(): void | Promise<void>;

inject(id, event, result) {
this.emit(PubSub.PROCESSED, id, event, result);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/processors/throttler/queue.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as EventEmmiter from 'events';

abstract class Queue extends EventEmmiter.EventEmitter {
abstract async enqueue(id: string, priority: number, event: any);
abstract enqueue(id: string, priority: number, event: any): void | Promise<void>;

abstract async dequeue(): Promise<any[]>;
abstract dequeue(): Promise<any[]>;
}

export default Queue;
2 changes: 1 addition & 1 deletion src/test/processors/aggregator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as MaxNumStrategy from '../../lib/processors/aggregator/max-num-strateg

import * as sinon from 'sinon';
import * as should from 'should';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('Aggregator', function () {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AggregatorStrategy from '../../../lib/processors/aggregator/aggregation-strategy';

import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('AggragationStrategy', function () {
class AggregationStrategyTest extends AggregatorStrategy {
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/aggregator/max-num-strategy.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MaxNumStrategy from '../../../lib/processors/aggregator/max-num-strategy';

import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('AggragationStrategy', function () {
afterEach(function () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/aggregator/memory-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import MemoryStore from '../../../lib/processors/aggregator/memory-store';
import * as should from 'should';

import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('MemoryStore', function () {
let store: MemoryStore;
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/aggregator/memory-timer.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MemoryTimer from '../../../lib/processors/aggregator/memory-timer';

import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('Timer', function () {
let clock;
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/aggregator/store.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Store from '../../../lib/processors/aggregator/store';

import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('Store', function () {
class StoreTest extends Store {
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/aggregator/timer.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Timer from '../../../lib/processors/aggregator/timer';

import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('Timer', function () {
class TimerTest extends Timer {
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/dispatcher.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Dispatcher from '../../lib/processors/dispatcher';
import * as sinon from 'sinon';

const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('Dispatcher', function () {
let dispatcher;
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Filter from '../../lib/processors/filter';
import * as sinon from 'sinon';
import * as should from 'should';

const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('Filter', function () {
let filter;
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/logger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Logger from '../../lib/processors/logger';
import * as sinon from 'sinon';
import { getLogger } from '../../lib/logger';

const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('Logger', function () {
let logger;
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/mapper.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Mapper from '../../lib/processors/mapper';
import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('Mapper', function () {
let mapper;
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/processor.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Processsor from '../../lib/processors/processor';
import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('Processor', function () {
class TestProcessor extends Processsor {
Expand Down
4 changes: 2 additions & 2 deletions src/test/processors/resource-throttler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import Throttler from '../../lib/processors/resource-throttler';
import * as sinon from 'sinon';
import { init, getLogger } from '../../lib/logger';

const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

const wait = async () => {
for (let _ of [...Array(10).keys()]) {
await new Promise(r => r());
await new Promise<void>(r => r());
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/test/processors/throttler.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Throttler from '../../lib/processors/throttler';
import * as sinon from 'sinon';

const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

const wait = async () => {
for (let _ of [...Array(10).keys()]) {
await new Promise(r => r());
await new Promise<void>(r => r());
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/test/processors/throttler/memory-pub-sub.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PubSub from '../../../lib/processors/throttler/pub-sub';
import * as should from 'should';

import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('MemoryPubSub', function() {
let pubSub: MemoryPubSub;
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('MemoryPubSub', function() {
e.should.equal(event2);
result.should.eql('result');
id.should.eql('id');
r();
r(undefined);
});
});
(await pubSub.subscribe('id', event2)).should.equal(true);
Expand Down
2 changes: 1 addition & 1 deletion src/test/processors/throttler/memory-queue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import MemoryQueue from '../../../lib/processors/throttler/memory-queue';
import Queue from '../../../lib/processors/throttler/queue';

import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

describe('MemoryQueue', function() {
let queue: Queue;
Expand Down
2 changes: 1 addition & 1 deletion src/test/route.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Route from '../lib/route';
import Mapper from '../lib/processors/mapper';
import * as sinon from 'sinon';
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();

const asyncError = (name, timeout) => {
return new Promise((_, r) => setTimeout(() => r(new Error(name)), timeout));
Expand Down