From 9f9b7afcd86fbef4af2e29813c76e7f831f17b0c Mon Sep 17 00:00:00 2001 From: Marcelo Schmidt Date: Mon, 30 Jul 2018 23:27:25 -0300 Subject: [PATCH 01/11] Adds SubscriptionRead and ISubscriptionBridge --- package-lock.json | 2 +- src/server/accessors/Reader.ts | 14 +++++++++++--- src/server/accessors/SubscriptionRead.ts | 13 +++++++++++++ src/server/accessors/index.ts | 2 ++ src/server/bridges/AppBridges.ts | 2 ++ src/server/bridges/ISubscriptionBridge.ts | 5 +++++ src/server/bridges/index.ts | 2 ++ src/server/managers/AppAccessorManager.ts | 5 +++-- tests/server/accessors/Reader.spec.ts | 8 +++++--- tests/test-data/bridges/appBridges.ts | 8 ++++++++ tests/test-data/bridges/subscriptionBridge.ts | 9 +++++++++ 11 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 src/server/accessors/SubscriptionRead.ts create mode 100644 src/server/bridges/ISubscriptionBridge.ts create mode 100644 tests/test-data/bridges/subscriptionBridge.ts diff --git a/package-lock.json b/package-lock.json index 06d1fd7b3..5bbec85e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/apps-engine", - "version": "0.6.8", + "version": "0.6.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/server/accessors/Reader.ts b/src/server/accessors/Reader.ts index b90c4034c..a4d954258 100644 --- a/src/server/accessors/Reader.ts +++ b/src/server/accessors/Reader.ts @@ -5,13 +5,18 @@ import { IPersistenceRead, IRead, IRoomRead, + ISubscriptionRead, IUserRead, } from '@rocket.chat/apps-ts-definition/accessors'; export class Reader implements IRead { - constructor(private env: IEnvironmentRead, private message: IMessageRead, - private persist: IPersistenceRead, private room: IRoomRead, - private user: IUserRead, private noti: INotifier) { } + constructor(private env: IEnvironmentRead, + private message: IMessageRead, + private persist: IPersistenceRead, + private room: IRoomRead, + private subscription: ISubscriptionRead, + private user: IUserRead, + private noti: INotifier) { } public getEnvironmentReader(): IEnvironmentRead { return this.env; @@ -28,6 +33,9 @@ export class Reader implements IRead { public getRoomReader(): IRoomRead { return this.room; } + public getSubscriptionReader(): ISubscriptionRead { + return this.subscription; + } public getUserReader(): IUserRead { return this.user; diff --git a/src/server/accessors/SubscriptionRead.ts b/src/server/accessors/SubscriptionRead.ts new file mode 100644 index 000000000..b8c99ad7e --- /dev/null +++ b/src/server/accessors/SubscriptionRead.ts @@ -0,0 +1,13 @@ +import { ISubscriptionRead } from '@rocket.chat/apps-ts-definition/accessors'; +import { ISubscription } from '@rocket.chat/apps-ts-definition/subscriptions'; + +import { ISubscriptionBridge } from '../bridges'; + +export class SubscriptionRead implements ISubscriptionRead { + constructor(private subscriptionBridge: ISubscriptionBridge, private appId: string) { } + + public getByRoomId(roomId: string): Promise { + return this.subscriptionBridge.getByRoomId(roomId, this.appId); + } + +} diff --git a/src/server/accessors/index.ts b/src/server/accessors/index.ts index 5524e637c..8daaa59cf 100644 --- a/src/server/accessors/index.ts +++ b/src/server/accessors/index.ts @@ -24,6 +24,7 @@ import { SettingRead } from './SettingRead'; import { SettingsExtend } from './SettingsExtend'; import { SlashCommandsExtend } from './SlashCommandsExtend'; import { SlashCommandsModify } from './SlashCommandsModify'; +import { SubscriptionRead } from './SubscriptionRead'; import { UserRead } from './UserRead'; export { @@ -53,5 +54,6 @@ export { SettingsExtend, SlashCommandsExtend, SlashCommandsModify, + SubscriptionRead, UserRead, }; diff --git a/src/server/bridges/AppBridges.ts b/src/server/bridges/AppBridges.ts index 7fb684d63..11a93c912 100644 --- a/src/server/bridges/AppBridges.ts +++ b/src/server/bridges/AppBridges.ts @@ -8,6 +8,7 @@ import { IMessageBridge } from './IMessageBridge'; import { IPersistenceBridge } from './IPersistenceBridge'; import { IRoomBridge } from './IRoomBridge'; import { IServerSettingBridge } from './IServerSettingBridge'; +import { ISubscriptionBridge } from './ISubscriptionBridge'; import { IUserBridge } from './IUserBridge'; export abstract class AppBridges { @@ -21,5 +22,6 @@ export abstract class AppBridges { public abstract getAppActivationBridge(): IAppActivationBridge; public abstract getRoomBridge(): IRoomBridge; public abstract getServerSettingBridge(): IServerSettingBridge; + public abstract getSubscriptionBridge(): ISubscriptionBridge; public abstract getUserBridge(): IUserBridge; } diff --git a/src/server/bridges/ISubscriptionBridge.ts b/src/server/bridges/ISubscriptionBridge.ts new file mode 100644 index 000000000..00c1ae5dd --- /dev/null +++ b/src/server/bridges/ISubscriptionBridge.ts @@ -0,0 +1,5 @@ +import { ISubscription } from '@rocket.chat/apps-ts-definition/subscriptions'; + +export interface ISubscriptionBridge { + getByRoomId(roomId: string, appId: string): Promise; +} diff --git a/src/server/bridges/index.ts b/src/server/bridges/index.ts index 5442304db..3f5609ce2 100644 --- a/src/server/bridges/index.ts +++ b/src/server/bridges/index.ts @@ -9,6 +9,7 @@ import { IMessageBridge } from './IMessageBridge'; import { IPersistenceBridge } from './IPersistenceBridge'; import { IRoomBridge } from './IRoomBridge'; import { IServerSettingBridge } from './IServerSettingBridge'; +import { ISubscriptionBridge } from './ISubscriptionBridge'; import { IUserBridge } from './IUserBridge'; export { @@ -23,6 +24,7 @@ export { IAppCommandBridge, IRoomBridge, IServerSettingBridge, + ISubscriptionBridge, IUserBridge, AppBridges, }; diff --git a/src/server/managers/AppAccessorManager.ts b/src/server/managers/AppAccessorManager.ts index bc053524f..3e38f46b0 100644 --- a/src/server/managers/AppAccessorManager.ts +++ b/src/server/managers/AppAccessorManager.ts @@ -16,6 +16,7 @@ import { SettingsExtend, SlashCommandsExtend, SlashCommandsModify, + SubscriptionRead, UserRead, } from '../accessors'; import { ConfigurationModify } from '../accessors/ConfigurationModify'; @@ -123,10 +124,10 @@ export class AppAccessorManager { const msg = new MessageRead(this.bridges.getMessageBridge(), appId); const persist = new PersistenceRead(this.bridges.getPersistenceBridge(), appId); const room = new RoomRead(this.bridges.getRoomBridge(), appId); + const subscr = new SubscriptionRead(this.bridges.getSubscriptionBridge(), appId); const user = new UserRead(this.bridges.getUserBridge(), appId); const noti = new Notifier(this.bridges.getMessageBridge(), appId); - - this.readers.set(appId, new Reader(env, msg, persist, room, user, noti)); + this.readers.set(appId, new Reader(env, msg, persist, room, subscr, user, noti)); } return this.readers.get(appId); diff --git a/tests/server/accessors/Reader.spec.ts b/tests/server/accessors/Reader.spec.ts index 8c2af0f9f..4ea23f6eb 100644 --- a/tests/server/accessors/Reader.spec.ts +++ b/tests/server/accessors/Reader.spec.ts @@ -1,4 +1,4 @@ -import { IEnvironmentRead, IMessageRead, INotifier, IPersistenceRead, IRoomRead, IUserRead } from '@rocket.chat/apps-ts-definition/accessors'; +import { IEnvironmentRead, IMessageRead, INotifier, IPersistenceRead, IRoomRead, ISubscriptionRead, IUserRead } from '@rocket.chat/apps-ts-definition/accessors'; import { Expect, SetupFixture, Test } from 'alsatian'; import { Reader } from '../../../src/server/accessors'; @@ -8,6 +8,7 @@ export class ReaderAccessorTestFixture { private msg: IMessageRead; private pr: IPersistenceRead; private rm: IRoomRead; + private sb: ISubscriptionRead; private ur: IUserRead; private ni: INotifier; @@ -17,15 +18,16 @@ export class ReaderAccessorTestFixture { this.msg = {} as IMessageRead; this.pr = {} as IPersistenceRead; this.rm = {} as IRoomRead; + this.sb = {} as ISubscriptionRead; this.ur = {} as IUserRead; this.ni = {} as INotifier; } @Test() public useReader() { - Expect(() => new Reader(this.env, this.msg, this.pr, this.rm, this.ur, this.ni)).not.toThrow(); + Expect(() => new Reader(this.env, this.msg, this.pr, this.rm, this.sb, this.ur, this.ni)).not.toThrow(); - const rd = new Reader(this.env, this.msg, this.pr, this.rm, this.ur, this.ni); + const rd = new Reader(this.env, this.msg, this.pr, this.rm, this.sb, this.ur, this.ni); Expect(rd.getEnvironmentReader()).toBeDefined(); Expect(rd.getMessageReader()).toBeDefined(); Expect(rd.getNotifier()).toBeDefined(); diff --git a/tests/test-data/bridges/appBridges.ts b/tests/test-data/bridges/appBridges.ts index 90a2866f5..eb4428640 100644 --- a/tests/test-data/bridges/appBridges.ts +++ b/tests/test-data/bridges/appBridges.ts @@ -9,6 +9,7 @@ import { IPersistenceBridge, IRoomBridge, IServerSettingBridge, + ISubscriptionBridge, IUserBridge, } from '../../../src/server/bridges'; import { TestsActivationBridge } from './activationBridge'; @@ -20,6 +21,7 @@ import { TestsMessageBridge } from './messageBridge'; import { TestsPersisBridge } from './persisBridge'; import { TestsRoomBridge } from './roomBridge'; import { TestsServerSettingBridge } from './serverSettingBridge'; +import { TestsSubscriptionBridge } from './subscriptionBridge'; import { TestsUserBridge } from './userBridge'; export class TestsAppBridges extends AppBridges { @@ -31,6 +33,7 @@ export class TestsAppBridges extends AppBridges { private readonly msgBridge: TestsMessageBridge; private readonly persisBridge: TestsPersisBridge; private readonly roomBridge: TestsRoomBridge; + private readonly subscriptionBridge: TestsSubscriptionBridge; private readonly userBridge: TestsUserBridge; private readonly httpBridge: TestsHttpBridge; @@ -44,6 +47,7 @@ export class TestsAppBridges extends AppBridges { this.msgBridge = new TestsMessageBridge(); this.persisBridge = new TestsPersisBridge(); this.roomBridge = new TestsRoomBridge(); + this.subscriptionBridge = new TestsSubscriptionBridge(); this.userBridge = new TestsUserBridge(); this.httpBridge = new TestsHttpBridge(); } @@ -88,6 +92,10 @@ export class TestsAppBridges extends AppBridges { return this.roomBridge; } + public getSubscriptionBridge(): ISubscriptionBridge { + return this.subscriptionBridge; + } + public getUserBridge(): IUserBridge { return this.userBridge; } diff --git a/tests/test-data/bridges/subscriptionBridge.ts b/tests/test-data/bridges/subscriptionBridge.ts new file mode 100644 index 000000000..b2c032286 --- /dev/null +++ b/tests/test-data/bridges/subscriptionBridge.ts @@ -0,0 +1,9 @@ +import { ISubscription } from '@rocket.chat/apps-ts-definition/subscriptions'; + +import { ISubscriptionBridge } from '../../../src/server/bridges'; + +export class TestsSubscriptionBridge implements ISubscriptionBridge { + public getByRoomId(roomId: string, appId: string): Promise { + throw new Error('Method not implemented.'); + } +} From 0fd7864a9c7413d88566a785e3a91c1d2f124ffd Mon Sep 17 00:00:00 2001 From: Marcelo Schmidt Date: Tue, 31 Jul 2018 17:49:35 -0300 Subject: [PATCH 02/11] Return IterableIterator of ISubscription, instead of single item --- package-lock.json | 3590 ++++++++++++++++- src/server/accessors/SubscriptionRead.ts | 2 +- src/server/bridges/ISubscriptionBridge.ts | 2 +- tests/test-data/bridges/subscriptionBridge.ts | 2 +- 4 files changed, 3590 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5bbec85e0..63e686fc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,9 +28,3593 @@ } }, "@rocket.chat/apps-ts-definition": { - "version": "0.9.13", - "resolved": "https://registry.npmjs.org/@rocket.chat/apps-ts-definition/-/apps-ts-definition-0.9.13.tgz", - "integrity": "sha512-2fqbJG8TPq19o2uZCE3UqRpNobAfAcgu0WkM8PAmhf1de459Z2gbmzbCBAsQJq6eOrGkqDry0GTzEneiCEvwZg==" + "version": "file:../Rocket.Chat.Apps-ts-definition/dist", + "dependencies": { + "@gulp-sourcemaps/identity-map": { + "version": "1.0.2", + "bundled": true, + "requires": { + "acorn": "5.7.1", + "css": "2.2.3", + "normalize-path": "2.1.1", + "source-map": "0.6.1", + "through2": "2.0.3" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true + } + } + }, + "@gulp-sourcemaps/map-sources": { + "version": "1.0.0", + "bundled": true, + "requires": { + "normalize-path": "2.1.1", + "through2": "2.0.3" + } + }, + "@types/events": { + "version": "1.2.0", + "bundled": true + }, + "@types/fancy-log": { + "version": "1.3.0", + "bundled": true + }, + "@types/fs-extra": { + "version": "5.0.1", + "bundled": true, + "requires": { + "@types/node": "10.5.4" + } + }, + "@types/glob": { + "version": "5.0.35", + "bundled": true, + "requires": { + "@types/events": "1.2.0", + "@types/minimatch": "3.0.3", + "@types/node": "10.5.4" + } + }, + "@types/handlebars": { + "version": "4.0.36", + "bundled": true + }, + "@types/highlight.js": { + "version": "9.12.2", + "bundled": true + }, + "@types/lodash": { + "version": "4.14.104", + "bundled": true + }, + "@types/marked": { + "version": "0.3.0", + "bundled": true + }, + "@types/minimatch": { + "version": "3.0.3", + "bundled": true + }, + "@types/node": { + "version": "10.5.4", + "bundled": true + }, + "@types/shelljs": { + "version": "0.7.8", + "bundled": true, + "requires": { + "@types/glob": "5.0.35", + "@types/node": "10.5.4" + } + }, + "acorn": { + "version": "5.7.1", + "bundled": true + }, + "acorn-jsx": { + "version": "3.0.1", + "bundled": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "bundled": true + } + } + }, + "ajv": { + "version": "5.5.2", + "bundled": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "bundled": true + }, + "align-text": { + "version": "0.1.4", + "bundled": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "amdefine": { + "version": "1.0.1", + "bundled": true + }, + "ansi-colors": { + "version": "1.1.0", + "bundled": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-cyan": { + "version": "0.1.1", + "bundled": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-escapes": { + "version": "3.1.0", + "bundled": true + }, + "ansi-gray": { + "version": "0.1.1", + "bundled": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-red": { + "version": "0.1.1", + "bundled": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "ansi-styles": { + "version": "2.2.1", + "bundled": true + }, + "ansi-wrap": { + "version": "0.1.0", + "bundled": true + }, + "append-buffer": { + "version": "1.0.2", + "bundled": true, + "requires": { + "buffer-equal": "1.0.0" + } + }, + "archy": { + "version": "1.0.0", + "bundled": true + }, + "argparse": { + "version": "1.0.10", + "bundled": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "arr-diff": { + "version": "4.0.0", + "bundled": true + }, + "arr-flatten": { + "version": "1.1.0", + "bundled": true + }, + "arr-union": { + "version": "3.1.0", + "bundled": true + }, + "array-differ": { + "version": "1.0.0", + "bundled": true + }, + "array-each": { + "version": "1.0.1", + "bundled": true + }, + "array-slice": { + "version": "1.1.0", + "bundled": true + }, + "array-union": { + "version": "1.0.2", + "bundled": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "bundled": true + }, + "array-unique": { + "version": "0.3.2", + "bundled": true + }, + "arrify": { + "version": "1.0.1", + "bundled": true + }, + "assign-symbols": { + "version": "1.0.0", + "bundled": true + }, + "async": { + "version": "2.6.1", + "bundled": true, + "requires": { + "lodash": "4.17.10" + } + }, + "atob": { + "version": "2.1.1", + "bundled": true + }, + "babel-code-frame": { + "version": "6.26.0", + "bundled": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "bundled": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "base": { + "version": "0.11.2", + "bundled": true, + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "beeper": { + "version": "1.1.1", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "bundled": true, + "requires": { + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.2", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "buffer-equal": { + "version": "1.0.0", + "bundled": true + }, + "buffer-from": { + "version": "1.1.0", + "bundled": true + }, + "builtin-modules": { + "version": "1.1.1", + "bundled": true + }, + "cache-base": { + "version": "1.0.1", + "bundled": true, + "requires": { + "collection-visit": "1.0.0", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" + } + }, + "caller-path": { + "version": "0.1.0", + "bundled": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "bundled": true + }, + "camelcase": { + "version": "1.2.1", + "bundled": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "bundled": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "2.4.1", + "bundled": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "bundled": true, + "requires": { + "color-convert": "1.9.2" + } + }, + "supports-color": { + "version": "5.4.0", + "bundled": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "chardet": { + "version": "0.4.2", + "bundled": true + }, + "circular-json": { + "version": "0.3.3", + "bundled": true + }, + "class-utils": { + "version": "0.3.6", + "bundled": true, + "requires": { + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, + "cli-cursor": { + "version": "2.1.0", + "bundled": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "bundled": true + }, + "cliui": { + "version": "2.1.0", + "bundled": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "bundled": true, + "optional": true + } + } + }, + "clone": { + "version": "1.0.4", + "bundled": true + }, + "clone-buffer": { + "version": "1.0.0", + "bundled": true + }, + "clone-stats": { + "version": "0.0.1", + "bundled": true + }, + "cloneable-readable": { + "version": "1.1.2", + "bundled": true, + "requires": { + "inherits": "2.0.3", + "process-nextick-args": "2.0.0", + "readable-stream": "2.3.6" + } + }, + "co": { + "version": "4.6.0", + "bundled": true + }, + "collection-visit": { + "version": "1.0.0", + "bundled": true, + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, + "color-convert": { + "version": "1.9.2", + "bundled": true, + "requires": { + "color-name": "1.1.1" + } + }, + "color-name": { + "version": "1.1.1", + "bundled": true + }, + "color-support": { + "version": "1.1.3", + "bundled": true + }, + "commander": { + "version": "2.16.0", + "bundled": true + }, + "component-emitter": { + "version": "1.2.1", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "concat-stream": { + "version": "1.6.2", + "bundled": true, + "requires": { + "buffer-from": "1.1.0", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" + } + }, + "convert-source-map": { + "version": "1.5.1", + "bundled": true + }, + "copy-descriptor": { + "version": "0.1.1", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "cross-spawn": { + "version": "5.1.0", + "bundled": true, + "requires": { + "lru-cache": "4.1.3", + "shebang-command": "1.2.0", + "which": "1.3.1" + } + }, + "css": { + "version": "2.2.3", + "bundled": true, + "requires": { + "inherits": "2.0.3", + "source-map": "0.1.43", + "source-map-resolve": "0.5.2", + "urix": "0.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.1.43", + "bundled": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "d": { + "version": "1.0.0", + "bundled": true, + "requires": { + "es5-ext": "0.10.45" + } + }, + "dateformat": { + "version": "2.2.0", + "bundled": true + }, + "debug": { + "version": "3.1.0", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-fabulous": { + "version": "1.1.0", + "bundled": true, + "requires": { + "debug": "3.1.0", + "memoizee": "0.4.12", + "object-assign": "4.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "bundled": true, + "optional": true + }, + "decode-uri-component": { + "version": "0.2.0", + "bundled": true + }, + "deep-is": { + "version": "0.1.3", + "bundled": true + }, + "defaults": { + "version": "1.0.3", + "bundled": true, + "requires": { + "clone": "1.0.4" + } + }, + "define-properties": { + "version": "1.1.2", + "bundled": true, + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "bundled": true, + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "del": { + "version": "3.0.0", + "bundled": true, + "requires": { + "globby": "6.1.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", + "p-map": "1.2.0", + "pify": "3.0.0", + "rimraf": "2.6.2" + } + }, + "deprecated": { + "version": "0.0.1", + "bundled": true + }, + "detect-file": { + "version": "1.0.0", + "bundled": true + }, + "detect-newline": { + "version": "2.1.0", + "bundled": true + }, + "diff": { + "version": "3.5.0", + "bundled": true + }, + "doctrine": { + "version": "2.1.0", + "bundled": true, + "requires": { + "esutils": "2.0.2" + } + }, + "duplexer2": { + "version": "0.0.2", + "bundled": true, + "requires": { + "readable-stream": "1.1.14" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "bundled": true + }, + "readable-stream": { + "version": "1.1.14", + "bundled": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "bundled": true + } + } + }, + "duplexify": { + "version": "3.6.0", + "bundled": true, + "requires": { + "end-of-stream": "1.4.1", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "stream-shift": "1.0.0" + }, + "dependencies": { + "end-of-stream": { + "version": "1.4.1", + "bundled": true, + "requires": { + "once": "1.4.0" + } + } + } + }, + "end-of-stream": { + "version": "0.1.5", + "bundled": true, + "requires": { + "once": "1.3.3" + }, + "dependencies": { + "once": { + "version": "1.3.3", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + } + } + }, + "es5-ext": { + "version": "0.10.45", + "bundled": true, + "requires": { + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1", + "next-tick": "1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45", + "es6-symbol": "3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.1", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "bundled": true + }, + "eslint": { + "version": "4.19.1", + "bundled": true, + "requires": { + "ajv": "5.5.2", + "babel-code-frame": "6.26.0", + "chalk": "2.4.1", + "concat-stream": "1.6.2", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", + "eslint-scope": "3.7.3", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.4", + "esquery": "1.0.1", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.7.0", + "ignore": "3.3.10", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.12.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.10", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "regexpp": "1.1.0", + "require-uncached": "1.0.3", + "semver": "5.5.0", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + } + }, + "eslint-scope": { + "version": "3.7.3", + "bundled": true, + "requires": { + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "bundled": true + }, + "espree": { + "version": "3.5.4", + "bundled": true, + "requires": { + "acorn": "5.7.1", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "4.0.1", + "bundled": true + }, + "esquery": { + "version": "1.0.1", + "bundled": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "bundled": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "estraverse": { + "version": "4.2.0", + "bundled": true + }, + "esutils": { + "version": "2.0.2", + "bundled": true + }, + "event-emitter": { + "version": "0.3.5", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45" + } + }, + "expand-brackets": { + "version": "2.1.4", + "bundled": true, + "requires": { + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "bundled": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "bundled": true, + "requires": { + "homedir-polyfill": "1.0.1" + } + }, + "extend": { + "version": "3.0.2", + "bundled": true + }, + "extend-shallow": { + "version": "3.0.2", + "bundled": true, + "requires": { + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "external-editor": { + "version": "2.2.0", + "bundled": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.23", + "tmp": "0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "bundled": true, + "requires": { + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "fancy-log": { + "version": "1.3.2", + "bundled": true, + "requires": { + "ansi-gray": "0.1.1", + "color-support": "1.1.3", + "time-stamp": "1.1.0" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "bundled": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "bundled": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "bundled": true + }, + "figures": { + "version": "2.0.0", + "bundled": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "bundled": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + } + }, + "fill-range": { + "version": "4.0.0", + "bundled": true, + "requires": { + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "find-index": { + "version": "0.1.1", + "bundled": true + }, + "findup-sync": { + "version": "2.0.0", + "bundled": true, + "requires": { + "detect-file": "1.0.0", + "is-glob": "3.1.0", + "micromatch": "3.1.10", + "resolve-dir": "1.0.1" + } + }, + "fined": { + "version": "1.1.0", + "bundled": true, + "requires": { + "expand-tilde": "2.0.2", + "is-plain-object": "2.0.4", + "object.defaults": "1.1.0", + "object.pick": "1.3.0", + "parse-filepath": "1.0.2" + } + }, + "first-chunk-stream": { + "version": "1.0.0", + "bundled": true + }, + "flagged-respawn": { + "version": "1.0.0", + "bundled": true + }, + "flat-cache": { + "version": "1.3.0", + "bundled": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + }, + "dependencies": { + "del": { + "version": "2.2.2", + "bundled": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } + }, + "globby": { + "version": "5.0.0", + "bundled": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pify": { + "version": "2.3.0", + "bundled": true + } + } + }, + "flush-write-stream": { + "version": "1.0.3", + "bundled": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.6" + } + }, + "for-in": { + "version": "1.0.2", + "bundled": true + }, + "for-own": { + "version": "1.0.0", + "bundled": true, + "requires": { + "for-in": "1.0.2" + } + }, + "foreach": { + "version": "2.0.5", + "bundled": true + }, + "fragment-cache": { + "version": "0.2.1", + "bundled": true, + "requires": { + "map-cache": "0.2.2" + } + }, + "fs-extra": { + "version": "5.0.0", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "4.0.0", + "universalify": "0.1.2" + } + }, + "fs-mkdirp-stream": { + "version": "1.0.0", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "through2": "2.0.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "function-bind": { + "version": "1.1.1", + "bundled": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "bundled": true + }, + "gaze": { + "version": "0.5.2", + "bundled": true, + "requires": { + "globule": "0.1.0" + } + }, + "get-value": { + "version": "2.0.6", + "bundled": true + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-parent": { + "version": "3.1.0", + "bundled": true, + "requires": { + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + } + }, + "glob-stream": { + "version": "3.1.18", + "bundled": true, + "requires": { + "glob": "4.5.3", + "glob2base": "0.0.12", + "minimatch": "2.0.10", + "ordered-read-streams": "0.1.0", + "through2": "0.6.5", + "unique-stream": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "4.5.3", + "bundled": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "2.0.10", + "once": "1.4.0" + } + }, + "isarray": { + "version": "0.0.1", + "bundled": true + }, + "minimatch": { + "version": "2.0.10", + "bundled": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "readable-stream": { + "version": "1.0.34", + "bundled": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "bundled": true + }, + "through2": { + "version": "0.6.5", + "bundled": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + } + } + }, + "glob-watcher": { + "version": "0.0.6", + "bundled": true, + "requires": { + "gaze": "0.5.2" + } + }, + "glob2base": { + "version": "0.0.12", + "bundled": true, + "requires": { + "find-index": "0.1.1" + } + }, + "global-modules": { + "version": "1.0.0", + "bundled": true, + "requires": { + "global-prefix": "1.0.2", + "is-windows": "1.0.2", + "resolve-dir": "1.0.1" + } + }, + "global-prefix": { + "version": "1.0.2", + "bundled": true, + "requires": { + "expand-tilde": "2.0.2", + "homedir-polyfill": "1.0.1", + "ini": "1.3.5", + "is-windows": "1.0.2", + "which": "1.3.1" + } + }, + "globals": { + "version": "11.7.0", + "bundled": true + }, + "globby": { + "version": "6.1.0", + "bundled": true, + "requires": { + "array-union": "1.0.2", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "bundled": true + } + } + }, + "globule": { + "version": "0.1.0", + "bundled": true, + "requires": { + "glob": "3.1.21", + "lodash": "1.0.2", + "minimatch": "0.2.14" + }, + "dependencies": { + "glob": { + "version": "3.1.21", + "bundled": true, + "requires": { + "graceful-fs": "1.2.3", + "inherits": "1.0.2", + "minimatch": "0.2.14" + } + }, + "graceful-fs": { + "version": "1.2.3", + "bundled": true + }, + "inherits": { + "version": "1.0.2", + "bundled": true + }, + "lodash": { + "version": "1.0.2", + "bundled": true + }, + "lru-cache": { + "version": "2.7.3", + "bundled": true + }, + "minimatch": { + "version": "0.2.14", + "bundled": true, + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "glogg": { + "version": "1.0.1", + "bundled": true, + "requires": { + "sparkles": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true + }, + "gulp": { + "version": "3.9.1", + "bundled": true, + "requires": { + "archy": "1.0.0", + "chalk": "1.1.3", + "deprecated": "0.0.1", + "gulp-util": "3.0.8", + "interpret": "1.1.0", + "liftoff": "2.5.0", + "minimist": "1.2.0", + "orchestrator": "0.3.8", + "pretty-hrtime": "1.0.3", + "semver": "4.3.6", + "tildify": "1.2.0", + "v8flags": "2.1.1", + "vinyl-fs": "0.3.14" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "bundled": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "bundled": true + }, + "semver": { + "version": "4.3.6", + "bundled": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "gulp-shell": { + "version": "0.6.5", + "bundled": true, + "requires": { + "async": "2.6.1", + "chalk": "2.4.1", + "fancy-log": "1.3.2", + "lodash": "4.17.10", + "lodash.template": "4.4.0", + "plugin-error": "0.1.2", + "through2": "2.0.3" + }, + "dependencies": { + "lodash.template": { + "version": "4.4.0", + "bundled": true, + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.templatesettings": "4.1.0" + } + }, + "lodash.templatesettings": { + "version": "4.1.0", + "bundled": true, + "requires": { + "lodash._reinterpolate": "3.0.0" + } + } + } + }, + "gulp-sourcemaps": { + "version": "2.6.4", + "bundled": true, + "requires": { + "@gulp-sourcemaps/identity-map": "1.0.2", + "@gulp-sourcemaps/map-sources": "1.0.0", + "acorn": "5.7.1", + "convert-source-map": "1.5.1", + "css": "2.2.3", + "debug-fabulous": "1.1.0", + "detect-newline": "2.1.0", + "graceful-fs": "4.1.11", + "source-map": "0.6.1", + "strip-bom-string": "1.0.0", + "through2": "2.0.3" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true + } + } + }, + "gulp-tslint": { + "version": "8.1.3", + "bundled": true, + "requires": { + "@types/fancy-log": "1.3.0", + "chalk": "2.3.1", + "fancy-log": "1.3.2", + "map-stream": "0.0.7", + "plugin-error": "1.0.1", + "through": "2.3.8" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "bundled": true, + "requires": { + "color-convert": "1.9.2" + } + }, + "chalk": { + "version": "2.3.1", + "bundled": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "plugin-error": { + "version": "1.0.1", + "bundled": true, + "requires": { + "ansi-colors": "1.1.0", + "arr-diff": "4.0.0", + "arr-union": "3.1.0", + "extend-shallow": "3.0.2" + } + }, + "supports-color": { + "version": "5.4.0", + "bundled": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "gulp-typescript": { + "version": "4.0.2", + "bundled": true, + "requires": { + "ansi-colors": "1.1.0", + "plugin-error": "0.1.2", + "source-map": "0.6.1", + "through2": "2.0.3", + "vinyl": "2.2.0", + "vinyl-fs": "3.0.3" + }, + "dependencies": { + "clone": { + "version": "2.1.1", + "bundled": true + }, + "clone-stats": { + "version": "1.0.0", + "bundled": true + }, + "glob-stream": { + "version": "6.1.0", + "bundled": true, + "requires": { + "extend": "3.0.2", + "glob": "7.1.2", + "glob-parent": "3.1.0", + "is-negated-glob": "1.0.0", + "ordered-read-streams": "1.0.1", + "pumpify": "1.5.1", + "readable-stream": "2.3.6", + "remove-trailing-separator": "1.1.0", + "to-absolute-glob": "2.0.2", + "unique-stream": "2.2.1" + } + }, + "ordered-read-streams": { + "version": "1.0.1", + "bundled": true, + "requires": { + "readable-stream": "2.3.6" + } + }, + "replace-ext": { + "version": "1.0.0", + "bundled": true + }, + "source-map": { + "version": "0.6.1", + "bundled": true + }, + "unique-stream": { + "version": "2.2.1", + "bundled": true, + "requires": { + "json-stable-stringify": "1.0.1", + "through2-filter": "2.0.0" + } + }, + "vinyl": { + "version": "2.2.0", + "bundled": true, + "requires": { + "clone": "2.1.1", + "clone-buffer": "1.0.0", + "clone-stats": "1.0.0", + "cloneable-readable": "1.1.2", + "remove-trailing-separator": "1.1.0", + "replace-ext": "1.0.0" + } + }, + "vinyl-fs": { + "version": "3.0.3", + "bundled": true, + "requires": { + "fs-mkdirp-stream": "1.0.0", + "glob-stream": "6.1.0", + "graceful-fs": "4.1.11", + "is-valid-glob": "1.0.0", + "lazystream": "1.0.0", + "lead": "1.0.0", + "object.assign": "4.1.0", + "pumpify": "1.5.1", + "readable-stream": "2.3.6", + "remove-bom-buffer": "3.0.0", + "remove-bom-stream": "1.2.0", + "resolve-options": "1.1.0", + "through2": "2.0.3", + "to-through": "2.0.0", + "value-or-function": "3.0.0", + "vinyl": "2.2.0", + "vinyl-sourcemap": "1.1.0" + } + } + } + }, + "gulp-util": { + "version": "3.0.8", + "bundled": true, + "requires": { + "array-differ": "1.0.0", + "array-uniq": "1.0.3", + "beeper": "1.1.1", + "chalk": "1.1.3", + "dateformat": "2.2.0", + "fancy-log": "1.3.2", + "gulplog": "1.0.0", + "has-gulplog": "0.1.0", + "lodash._reescape": "3.0.0", + "lodash._reevaluate": "3.0.0", + "lodash._reinterpolate": "3.0.0", + "lodash.template": "3.6.2", + "minimist": "1.2.0", + "multipipe": "0.1.2", + "object-assign": "3.0.0", + "replace-ext": "0.0.1", + "through2": "2.0.3", + "vinyl": "0.5.3" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "bundled": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "bundled": true + }, + "object-assign": { + "version": "3.0.0", + "bundled": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "gulplog": { + "version": "1.0.0", + "bundled": true, + "requires": { + "glogg": "1.0.1" + } + }, + "handlebars": { + "version": "4.0.11", + "bundled": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "bundled": true + }, + "source-map": { + "version": "0.4.4", + "bundled": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "has-ansi": { + "version": "2.0.0", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "bundled": true + }, + "has-gulplog": { + "version": "0.1.0", + "bundled": true, + "requires": { + "sparkles": "1.0.1" + } + }, + "has-symbols": { + "version": "1.0.0", + "bundled": true + }, + "has-value": { + "version": "1.0.0", + "bundled": true, + "requires": { + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" + } + }, + "has-values": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "bundled": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "highlight.js": { + "version": "9.12.0", + "bundled": true + }, + "homedir-polyfill": { + "version": "1.0.1", + "bundled": true, + "requires": { + "parse-passwd": "1.0.0" + } + }, + "iconv-lite": { + "version": "0.4.23", + "bundled": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore": { + "version": "3.3.10", + "bundled": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.5", + "bundled": true + }, + "inquirer": { + "version": "3.3.0", + "bundled": true, + "requires": { + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.2.0", + "figures": "2.0.0", + "lodash": "4.17.10", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + } + }, + "interpret": { + "version": "1.1.0", + "bundled": true + }, + "is-absolute": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-relative": "1.0.0", + "is-windows": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "bundled": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "bundled": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "bundled": true + }, + "is-extglob": { + "version": "2.1.1", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true + }, + "is-glob": { + "version": "3.1.0", + "bundled": true, + "requires": { + "is-extglob": "2.1.1" + } + }, + "is-negated-glob": { + "version": "1.0.0", + "bundled": true + }, + "is-number": { + "version": "3.0.0", + "bundled": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-path-cwd": { + "version": "1.0.0", + "bundled": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "bundled": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "bundled": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "bundled": true, + "requires": { + "isobject": "3.0.1" + } + }, + "is-promise": { + "version": "2.1.0", + "bundled": true + }, + "is-relative": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-unc-path": "1.0.0" + } + }, + "is-resolvable": { + "version": "1.1.0", + "bundled": true + }, + "is-unc-path": { + "version": "1.0.0", + "bundled": true, + "requires": { + "unc-path-regex": "0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "bundled": true + }, + "is-valid-glob": { + "version": "1.0.0", + "bundled": true + }, + "is-windows": { + "version": "1.0.2", + "bundled": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true + }, + "isobject": { + "version": "3.0.1", + "bundled": true + }, + "js-tokens": { + "version": "3.0.2", + "bundled": true + }, + "js-yaml": { + "version": "3.12.0", + "bundled": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.1" + } + }, + "json-schema-traverse": { + "version": "0.3.1", + "bundled": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "bundled": true + }, + "jsonfile": { + "version": "4.0.0", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "jsonify": { + "version": "0.0.0", + "bundled": true + }, + "kind-of": { + "version": "6.0.2", + "bundled": true + }, + "lazy-cache": { + "version": "1.0.4", + "bundled": true, + "optional": true + }, + "lazystream": { + "version": "1.0.0", + "bundled": true, + "requires": { + "readable-stream": "2.3.6" + } + }, + "lead": { + "version": "1.0.0", + "bundled": true, + "requires": { + "flush-write-stream": "1.0.3" + } + }, + "levn": { + "version": "0.3.0", + "bundled": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "liftoff": { + "version": "2.5.0", + "bundled": true, + "requires": { + "extend": "3.0.2", + "findup-sync": "2.0.0", + "fined": "1.1.0", + "flagged-respawn": "1.0.0", + "is-plain-object": "2.0.4", + "object.map": "1.0.1", + "rechoir": "0.6.2", + "resolve": "1.8.1" + } + }, + "lodash": { + "version": "4.17.10", + "bundled": true + }, + "lodash._basecopy": { + "version": "3.0.1", + "bundled": true + }, + "lodash._basetostring": { + "version": "3.0.1", + "bundled": true + }, + "lodash._basevalues": { + "version": "3.0.0", + "bundled": true + }, + "lodash._getnative": { + "version": "3.9.1", + "bundled": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "bundled": true + }, + "lodash._reescape": { + "version": "3.0.0", + "bundled": true + }, + "lodash._reevaluate": { + "version": "3.0.0", + "bundled": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "bundled": true + }, + "lodash._root": { + "version": "3.0.1", + "bundled": true + }, + "lodash.escape": { + "version": "3.2.0", + "bundled": true, + "requires": { + "lodash._root": "3.0.1" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "bundled": true + }, + "lodash.isarray": { + "version": "3.0.4", + "bundled": true + }, + "lodash.keys": { + "version": "3.1.2", + "bundled": true, + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.restparam": { + "version": "3.6.1", + "bundled": true + }, + "lodash.template": { + "version": "3.6.2", + "bundled": true, + "requires": { + "lodash._basecopy": "3.0.1", + "lodash._basetostring": "3.0.1", + "lodash._basevalues": "3.0.0", + "lodash._isiterateecall": "3.0.9", + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0", + "lodash.keys": "3.1.2", + "lodash.restparam": "3.6.1", + "lodash.templatesettings": "3.1.1" + } + }, + "lodash.templatesettings": { + "version": "3.1.1", + "bundled": true, + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0" + } + }, + "longest": { + "version": "1.0.1", + "bundled": true + }, + "lru-cache": { + "version": "4.1.3", + "bundled": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "lru-queue": { + "version": "0.1.0", + "bundled": true, + "requires": { + "es5-ext": "0.10.45" + } + }, + "make-iterator": { + "version": "1.0.1", + "bundled": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "bundled": true + }, + "map-stream": { + "version": "0.0.7", + "bundled": true + }, + "map-visit": { + "version": "1.0.0", + "bundled": true, + "requires": { + "object-visit": "1.0.1" + } + }, + "marked": { + "version": "0.3.19", + "bundled": true + }, + "memoizee": { + "version": "0.4.12", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45", + "es6-weak-map": "2.0.2", + "event-emitter": "0.3.5", + "is-promise": "2.1.0", + "lru-queue": "0.1.0", + "next-tick": "1.0.0", + "timers-ext": "0.1.5" + } + }, + "merge2": { + "version": "1.2.2", + "bundled": true + }, + "micromatch": { + "version": "3.1.10", + "bundled": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.13", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "mimic-fn": { + "version": "1.2.0", + "bundled": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "mixin-deep": { + "version": "1.3.1", + "bundled": true, + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + }, + "multipipe": { + "version": "0.1.2", + "bundled": true, + "requires": { + "duplexer2": "0.0.2" + } + }, + "mute-stream": { + "version": "0.0.7", + "bundled": true + }, + "nanomatch": { + "version": "1.2.13", + "bundled": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "natives": { + "version": "1.1.4", + "bundled": true + }, + "natural-compare": { + "version": "1.4.0", + "bundled": true + }, + "next-tick": { + "version": "1.0.0", + "bundled": true + }, + "normalize-path": { + "version": "2.1.1", + "bundled": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "now-and-later": { + "version": "2.0.0", + "bundled": true, + "requires": { + "once": "1.4.0" + } + }, + "object-assign": { + "version": "4.1.1", + "bundled": true + }, + "object-copy": { + "version": "0.1.0", + "bundled": true, + "requires": { + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "object-keys": { + "version": "1.0.12", + "bundled": true + }, + "object-visit": { + "version": "1.0.1", + "bundled": true, + "requires": { + "isobject": "3.0.1" + } + }, + "object.assign": { + "version": "4.1.0", + "bundled": true, + "requires": { + "define-properties": "1.1.2", + "function-bind": "1.1.1", + "has-symbols": "1.0.0", + "object-keys": "1.0.12" + } + }, + "object.defaults": { + "version": "1.1.0", + "bundled": true, + "requires": { + "array-each": "1.0.1", + "array-slice": "1.1.0", + "for-own": "1.0.0", + "isobject": "3.0.1" + } + }, + "object.map": { + "version": "1.0.1", + "bundled": true, + "requires": { + "for-own": "1.0.0", + "make-iterator": "1.0.1" + } + }, + "object.pick": { + "version": "1.3.0", + "bundled": true, + "requires": { + "isobject": "3.0.1" + } + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "2.0.1", + "bundled": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.3", + "bundled": true + } + } + }, + "optionator": { + "version": "0.8.2", + "bundled": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "orchestrator": { + "version": "0.3.8", + "bundled": true, + "requires": { + "end-of-stream": "0.1.5", + "sequencify": "0.0.7", + "stream-consume": "0.1.1" + } + }, + "ordered-read-streams": { + "version": "0.1.0", + "bundled": true + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true + }, + "p-map": { + "version": "1.2.0", + "bundled": true + }, + "parse-filepath": { + "version": "1.0.2", + "bundled": true, + "requires": { + "is-absolute": "1.0.0", + "map-cache": "0.2.2", + "path-root": "0.1.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "bundled": true + }, + "pascalcase": { + "version": "0.1.1", + "bundled": true + }, + "path-dirname": { + "version": "1.0.2", + "bundled": true + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "path-is-inside": { + "version": "1.0.2", + "bundled": true + }, + "path-parse": { + "version": "1.0.5", + "bundled": true + }, + "path-root": { + "version": "0.1.1", + "bundled": true, + "requires": { + "path-root-regex": "0.1.2" + } + }, + "path-root-regex": { + "version": "0.1.2", + "bundled": true + }, + "pify": { + "version": "3.0.0", + "bundled": true + }, + "pinkie": { + "version": "2.0.4", + "bundled": true + }, + "pinkie-promise": { + "version": "2.0.1", + "bundled": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "plugin-error": { + "version": "0.1.2", + "bundled": true, + "requires": { + "ansi-cyan": "0.1.1", + "ansi-red": "0.1.1", + "arr-diff": "1.1.0", + "arr-union": "2.1.0", + "extend-shallow": "1.1.4" + }, + "dependencies": { + "arr-diff": { + "version": "1.1.0", + "bundled": true, + "requires": { + "arr-flatten": "1.1.0", + "array-slice": "0.2.3" + } + }, + "arr-union": { + "version": "2.1.0", + "bundled": true + }, + "array-slice": { + "version": "0.2.3", + "bundled": true + }, + "extend-shallow": { + "version": "1.1.4", + "bundled": true, + "requires": { + "kind-of": "1.1.0" + } + }, + "kind-of": { + "version": "1.1.0", + "bundled": true + } + } + }, + "pluralize": { + "version": "7.0.0", + "bundled": true + }, + "posix-character-classes": { + "version": "0.1.1", + "bundled": true + }, + "prelude-ls": { + "version": "1.1.2", + "bundled": true + }, + "pretty-hrtime": { + "version": "1.0.3", + "bundled": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true + }, + "progress": { + "version": "2.0.0", + "bundled": true + }, + "pseudomap": { + "version": "1.0.2", + "bundled": true + }, + "pump": { + "version": "2.0.1", + "bundled": true, + "requires": { + "end-of-stream": "1.4.1", + "once": "1.4.0" + }, + "dependencies": { + "end-of-stream": { + "version": "1.4.1", + "bundled": true, + "requires": { + "once": "1.4.0" + } + } + } + }, + "pumpify": { + "version": "1.5.1", + "bundled": true, + "requires": { + "duplexify": "3.6.0", + "inherits": "2.0.3", + "pump": "2.0.1" + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "rechoir": { + "version": "0.6.2", + "bundled": true, + "requires": { + "resolve": "1.8.1" + } + }, + "regex-not": { + "version": "1.0.2", + "bundled": true, + "requires": { + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" + } + }, + "regexpp": { + "version": "1.1.0", + "bundled": true + }, + "remove-bom-buffer": { + "version": "3.0.0", + "bundled": true, + "requires": { + "is-buffer": "1.1.6", + "is-utf8": "0.2.1" + } + }, + "remove-bom-stream": { + "version": "1.2.0", + "bundled": true, + "requires": { + "remove-bom-buffer": "3.0.0", + "safe-buffer": "5.1.2", + "through2": "2.0.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "bundled": true + }, + "repeat-element": { + "version": "1.1.2", + "bundled": true + }, + "repeat-string": { + "version": "1.6.1", + "bundled": true + }, + "replace-ext": { + "version": "0.0.1", + "bundled": true + }, + "require-uncached": { + "version": "1.0.3", + "bundled": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "resolve": { + "version": "1.8.1", + "bundled": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "resolve-dir": { + "version": "1.0.1", + "bundled": true, + "requires": { + "expand-tilde": "2.0.2", + "global-modules": "1.0.0" + } + }, + "resolve-from": { + "version": "1.0.1", + "bundled": true + }, + "resolve-options": { + "version": "1.1.0", + "bundled": true, + "requires": { + "value-or-function": "3.0.0" + } + }, + "resolve-url": { + "version": "0.2.1", + "bundled": true + }, + "restore-cursor": { + "version": "2.0.0", + "bundled": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "bundled": true + }, + "right-align": { + "version": "0.1.3", + "bundled": true, + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "requires": { + "glob": "7.1.2" + } + }, + "run-async": { + "version": "2.3.0", + "bundled": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "bundled": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "bundled": true, + "requires": { + "rx-lite": "4.0.8" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "safe-regex": { + "version": "1.1.0", + "bundled": true, + "requires": { + "ret": "0.1.15" + } + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true + }, + "semver": { + "version": "5.5.0", + "bundled": true + }, + "sequencify": { + "version": "0.0.7", + "bundled": true + }, + "set-value": { + "version": "2.0.0", + "bundled": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true + }, + "shelljs": { + "version": "0.8.2", + "bundled": true, + "requires": { + "glob": "7.1.2", + "interpret": "1.1.0", + "rechoir": "0.6.2" + } + }, + "sigmund": { + "version": "1.0.1", + "bundled": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true + }, + "slice-ansi": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } + }, + "snapdragon": { + "version": "0.8.2", + "bundled": true, + "requires": { + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.2", + "use": "3.1.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "bundled": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "bundled": true, + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "bundled": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "bundled": true + }, + "source-map-resolve": { + "version": "0.5.2", + "bundled": true, + "requires": { + "atob": "2.1.1", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "bundled": true + }, + "sparkles": { + "version": "1.0.1", + "bundled": true + }, + "split-string": { + "version": "3.1.0", + "bundled": true, + "requires": { + "extend-shallow": "3.0.2" + } + }, + "sprintf-js": { + "version": "1.0.3", + "bundled": true + }, + "static-extend": { + "version": "0.1.2", + "bundled": true, + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, + "stream-consume": { + "version": "0.1.1", + "bundled": true + }, + "stream-shift": { + "version": "1.0.0", + "bundled": true + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "requires": { + "ansi-regex": "3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true + } + } + }, + "strip-bom": { + "version": "1.0.0", + "bundled": true, + "requires": { + "first-chunk-stream": "1.0.0", + "is-utf8": "0.2.1" + } + }, + "strip-bom-string": { + "version": "1.0.0", + "bundled": true + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true + }, + "supports-color": { + "version": "2.0.0", + "bundled": true + }, + "table": { + "version": "4.0.2", + "bundled": true, + "requires": { + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.4.1", + "lodash": "4.17.10", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + } + }, + "text-table": { + "version": "0.2.0", + "bundled": true + }, + "through": { + "version": "2.3.8", + "bundled": true + }, + "through2": { + "version": "2.0.3", + "bundled": true, + "requires": { + "readable-stream": "2.3.6", + "xtend": "4.0.1" + } + }, + "through2-filter": { + "version": "2.0.0", + "bundled": true, + "requires": { + "through2": "2.0.3", + "xtend": "4.0.1" + } + }, + "tildify": { + "version": "1.2.0", + "bundled": true, + "requires": { + "os-homedir": "1.0.2" + } + }, + "time-stamp": { + "version": "1.1.0", + "bundled": true + }, + "timers-ext": { + "version": "0.1.5", + "bundled": true, + "requires": { + "es5-ext": "0.10.45", + "next-tick": "1.0.0" + } + }, + "tmp": { + "version": "0.0.33", + "bundled": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "to-absolute-glob": { + "version": "2.0.2", + "bundled": true, + "requires": { + "is-absolute": "1.0.0", + "is-negated-glob": "1.0.0" + } + }, + "to-object-path": { + "version": "0.3.0", + "bundled": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "bundled": true, + "requires": { + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "bundled": true, + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + } + }, + "to-through": { + "version": "2.0.0", + "bundled": true, + "requires": { + "through2": "2.0.3" + } + }, + "tslib": { + "version": "1.9.3", + "bundled": true + }, + "tslint": { + "version": "5.11.0", + "bundled": true, + "requires": { + "babel-code-frame": "6.26.0", + "builtin-modules": "1.1.1", + "chalk": "2.4.1", + "commander": "2.16.0", + "diff": "3.5.0", + "glob": "7.1.2", + "js-yaml": "3.12.0", + "minimatch": "3.0.4", + "resolve": "1.8.1", + "semver": "5.5.0", + "tslib": "1.9.3", + "tsutils": "2.29.0" + } + }, + "tsutils": { + "version": "2.29.0", + "bundled": true, + "requires": { + "tslib": "1.9.3" + } + }, + "type-check": { + "version": "0.3.2", + "bundled": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "bundled": true + }, + "typedoc": { + "version": "0.11.1", + "bundled": true, + "requires": { + "@types/fs-extra": "5.0.1", + "@types/handlebars": "4.0.36", + "@types/highlight.js": "9.12.2", + "@types/lodash": "4.14.104", + "@types/marked": "0.3.0", + "@types/minimatch": "3.0.3", + "@types/shelljs": "0.7.8", + "fs-extra": "5.0.0", + "handlebars": "4.0.11", + "highlight.js": "9.12.0", + "lodash": "4.17.10", + "marked": "0.3.19", + "minimatch": "3.0.4", + "progress": "2.0.0", + "shelljs": "0.8.2", + "typedoc-default-themes": "0.5.0", + "typescript": "2.7.2" + }, + "dependencies": { + "typescript": { + "version": "2.7.2", + "bundled": true + } + } + }, + "typedoc-default-themes": { + "version": "0.5.0", + "bundled": true + }, + "typescript": { + "version": "2.9.2", + "bundled": true + }, + "uglify-js": { + "version": "2.8.29", + "bundled": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "unc-path-regex": { + "version": "0.1.2", + "bundled": true + }, + "union-value": { + "version": "1.0.0", + "bundled": true, + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "bundled": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } + } + }, + "unique-stream": { + "version": "1.0.0", + "bundled": true + }, + "universalify": { + "version": "0.1.2", + "bundled": true + }, + "unset-value": { + "version": "1.0.0", + "bundled": true, + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "bundled": true, + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "bundled": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "bundled": true + } + } + }, + "urix": { + "version": "0.1.0", + "bundled": true + }, + "use": { + "version": "3.1.1", + "bundled": true + }, + "user-home": { + "version": "1.1.1", + "bundled": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "v8flags": { + "version": "2.1.1", + "bundled": true, + "requires": { + "user-home": "1.1.1" + } + }, + "value-or-function": { + "version": "3.0.0", + "bundled": true + }, + "vinyl": { + "version": "0.5.3", + "bundled": true, + "requires": { + "clone": "1.0.4", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-fs": { + "version": "0.3.14", + "bundled": true, + "requires": { + "defaults": "1.0.3", + "glob-stream": "3.1.18", + "glob-watcher": "0.0.6", + "graceful-fs": "3.0.11", + "mkdirp": "0.5.1", + "strip-bom": "1.0.0", + "through2": "0.6.5", + "vinyl": "0.4.6" + }, + "dependencies": { + "clone": { + "version": "0.2.0", + "bundled": true + }, + "graceful-fs": { + "version": "3.0.11", + "bundled": true, + "requires": { + "natives": "1.1.4" + } + }, + "isarray": { + "version": "0.0.1", + "bundled": true + }, + "readable-stream": { + "version": "1.0.34", + "bundled": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "bundled": true + }, + "through2": { + "version": "0.6.5", + "bundled": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + }, + "vinyl": { + "version": "0.4.6", + "bundled": true, + "requires": { + "clone": "0.2.0", + "clone-stats": "0.0.1" + } + } + } + }, + "vinyl-sourcemap": { + "version": "1.1.0", + "bundled": true, + "requires": { + "append-buffer": "1.0.2", + "convert-source-map": "1.5.1", + "graceful-fs": "4.1.11", + "normalize-path": "2.1.1", + "now-and-later": "2.0.0", + "remove-bom-buffer": "3.0.0", + "vinyl": "2.2.0" + }, + "dependencies": { + "clone": { + "version": "2.1.1", + "bundled": true + }, + "clone-stats": { + "version": "1.0.0", + "bundled": true + }, + "replace-ext": { + "version": "1.0.0", + "bundled": true + }, + "vinyl": { + "version": "2.2.0", + "bundled": true, + "requires": { + "clone": "2.1.1", + "clone-buffer": "1.0.0", + "clone-stats": "1.0.0", + "cloneable-readable": "1.1.2", + "remove-trailing-separator": "1.1.0", + "replace-ext": "1.0.0" + } + } + } + }, + "which": { + "version": "1.3.1", + "bundled": true, + "requires": { + "isexe": "2.0.0" + } + }, + "window-size": { + "version": "0.1.0", + "bundled": true, + "optional": true + }, + "wordwrap": { + "version": "1.0.0", + "bundled": true + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "write": { + "version": "0.2.1", + "bundled": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "xtend": { + "version": "4.0.1", + "bundled": true + }, + "yallist": { + "version": "2.1.2", + "bundled": true + }, + "yargs": { + "version": "3.10.0", + "bundled": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } }, "@types/adm-zip": { "version": "0.4.31", diff --git a/src/server/accessors/SubscriptionRead.ts b/src/server/accessors/SubscriptionRead.ts index b8c99ad7e..76faa42ab 100644 --- a/src/server/accessors/SubscriptionRead.ts +++ b/src/server/accessors/SubscriptionRead.ts @@ -6,7 +6,7 @@ import { ISubscriptionBridge } from '../bridges'; export class SubscriptionRead implements ISubscriptionRead { constructor(private subscriptionBridge: ISubscriptionBridge, private appId: string) { } - public getByRoomId(roomId: string): Promise { + public getByRoomId(roomId: string): Promise> { return this.subscriptionBridge.getByRoomId(roomId, this.appId); } diff --git a/src/server/bridges/ISubscriptionBridge.ts b/src/server/bridges/ISubscriptionBridge.ts index 00c1ae5dd..6e112fd97 100644 --- a/src/server/bridges/ISubscriptionBridge.ts +++ b/src/server/bridges/ISubscriptionBridge.ts @@ -1,5 +1,5 @@ import { ISubscription } from '@rocket.chat/apps-ts-definition/subscriptions'; export interface ISubscriptionBridge { - getByRoomId(roomId: string, appId: string): Promise; + getByRoomId(roomId: string, appId: string): Promise>; } diff --git a/tests/test-data/bridges/subscriptionBridge.ts b/tests/test-data/bridges/subscriptionBridge.ts index b2c032286..8c02ea2a4 100644 --- a/tests/test-data/bridges/subscriptionBridge.ts +++ b/tests/test-data/bridges/subscriptionBridge.ts @@ -3,7 +3,7 @@ import { ISubscription } from '@rocket.chat/apps-ts-definition/subscriptions'; import { ISubscriptionBridge } from '../../../src/server/bridges'; export class TestsSubscriptionBridge implements ISubscriptionBridge { - public getByRoomId(roomId: string, appId: string): Promise { + public getByRoomId(roomId: string, appId: string): Promise> { throw new Error('Method not implemented.'); } } From c85a7aa3395078b1d82f360f4deff63d3d0602f0 Mon Sep 17 00:00:00 2001 From: Marcelo Schmidt Date: Tue, 8 Oct 2019 09:12:46 -0300 Subject: [PATCH 03/11] Fix importing ISubscription --- tests/test-data/bridges/subscriptionBridge.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-data/bridges/subscriptionBridge.ts b/tests/test-data/bridges/subscriptionBridge.ts index b81e557dd..fe0c482bb 100644 --- a/tests/test-data/bridges/subscriptionBridge.ts +++ b/tests/test-data/bridges/subscriptionBridge.ts @@ -1,4 +1,4 @@ -import { ISubscription } from '../../../definition/subscriptions'; +import { ISubscription } from '../../../src/definition/subscriptions'; import { ISubscriptionBridge } from '../../../src/server/bridges'; export class TestsSubscriptionBridge implements ISubscriptionBridge { From acb3d2cfd4225bc417f74ba364d59186620716ab Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Tue, 8 Oct 2019 09:14:26 -0500 Subject: [PATCH 04/11] Various code style changes --- src/definition/subscriptions/index.ts | 3 +-- src/server/accessors/Reader.ts | 1 + src/server/accessors/SubscriptionRead.ts | 1 - tests/server/accessors/Reader.spec.ts | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/definition/subscriptions/index.ts b/src/definition/subscriptions/index.ts index 669c04463..c4f3d54c4 100644 --- a/src/definition/subscriptions/index.ts +++ b/src/definition/subscriptions/index.ts @@ -1,2 +1 @@ -import { ISubscription } from './ISubscription'; -export { ISubscription }; +export { ISubscription } from './ISubscription'; diff --git a/src/server/accessors/Reader.ts b/src/server/accessors/Reader.ts index 5335702ca..c3904f435 100644 --- a/src/server/accessors/Reader.ts +++ b/src/server/accessors/Reader.ts @@ -39,6 +39,7 @@ export class Reader implements IRead { public getRoomReader(): IRoomRead { return this.room; } + public getSubscriptionReader(): ISubscriptionRead { return this.subscription; } diff --git a/src/server/accessors/SubscriptionRead.ts b/src/server/accessors/SubscriptionRead.ts index 8e766fe52..88d003b5b 100644 --- a/src/server/accessors/SubscriptionRead.ts +++ b/src/server/accessors/SubscriptionRead.ts @@ -9,5 +9,4 @@ export class SubscriptionRead implements ISubscriptionRead { public getByRoomId(roomId: string): Promise> { return this.subscriptionBridge.getByRoomId(roomId, this.appId); } - } diff --git a/tests/server/accessors/Reader.spec.ts b/tests/server/accessors/Reader.spec.ts index 0121ec76e..9dc7f2500 100644 --- a/tests/server/accessors/Reader.spec.ts +++ b/tests/server/accessors/Reader.spec.ts @@ -37,6 +37,7 @@ export class ReaderAccessorTestFixture { Expect(rd.getNotifier()).toBeDefined(); Expect(rd.getPersistenceReader()).toBeDefined(); Expect(rd.getRoomReader()).toBeDefined(); + Expect(rd.getSubscriptionReader()).toBeDefined(); Expect(rd.getUserReader()).toBeDefined(); Expect(rd.getLivechatReader()).toBeDefined(); Expect(rd.getUploadReader()).toBeDefined(); From bade966f3cc59c9afed82bdbc65e91b4d2e60cf1 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Wed, 9 Oct 2019 11:08:12 -0500 Subject: [PATCH 05/11] Add more fields to the subscription interface with documentation. --- src/definition/subscriptions/ISubscription.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/definition/subscriptions/ISubscription.ts b/src/definition/subscriptions/ISubscription.ts index 3c3b21e50..923db00af 100644 --- a/src/definition/subscriptions/ISubscription.ts +++ b/src/definition/subscriptions/ISubscription.ts @@ -1,3 +1,27 @@ +import { IRoom } from '../rooms'; +import { IUser } from '../users'; + export interface ISubscription { + /** The id of the subscription. */ id: string; + /** The room the subscription is for (kinda maps to `rid`). */ + room: IRoom; + /** The user the subscription is for (kinda maps to `u`). */ + user: IUser; + /** Whether the room the subscription is for is hidden from the UI (maps to `open`). */ + isHidden: boolean; + /** Whether the subscription has an alert or notification for the user (maps to `alert`). */ + hasAlert: boolean; + /** The actual number to display on the room's list; it is the sum of userMentionsCount and groupMentionsCount (maps to `unread`). */ + unreadCount: number; + /** The number of times the user has been mentioned (maps to `userMentions`). */ + userMentionsCount: number; + /** The number of times the groups a user is part of has been mentioned (maps to `groupMentions`). */ + groupMentionsCount: number; + /** The date when the subscription was created (maps to `ts`). */ + createdAt: Date; + /** The date when the subscription was last updated (maps to `_updatedAt`). */ + updatedAt?: Date; + /** The last date/time the subscription was seen or marked as read (maps to `ls`). */ + lastSeenAt?: Date; } From bd15cc0783dda758eeb7c860df8b5e8a6e6c996e Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Wed, 9 Oct 2019 11:22:54 -0500 Subject: [PATCH 06/11] Rename the subscriptions to be room subscriptions --- src/definition/accessors/IRead.ts | 6 ++--- .../accessors/IRoomSubscriptionRead.ts | 23 +++++++++++++++++++ src/definition/accessors/ISubscriptionRead.ts | 15 ------------ src/definition/accessors/index.ts | 4 ++-- ...{ISubscription.ts => IRoomSubscription.ts} | 7 +++++- src/definition/subscriptions/index.ts | 2 +- src/server/accessors/Reader.ts | 8 +++---- src/server/accessors/RoomSubscriptionRead.ts | 16 +++++++++++++ src/server/accessors/SubscriptionRead.ts | 12 ---------- src/server/accessors/index.ts | 4 ++-- src/server/bridges/AppBridges.ts | 4 ++-- src/server/bridges/IRoomSubscriptionBridge.ts | 7 ++++++ src/server/bridges/ISubscriptionBridge.ts | 5 ---- src/server/bridges/index.ts | 4 ++-- src/server/managers/AppAccessorManager.ts | 4 ++-- tests/server/accessors/Reader.spec.ts | 8 +++---- tests/test-data/bridges/appBridges.ts | 4 ++-- tests/test-data/bridges/subscriptionBridge.ts | 12 ++++++---- 18 files changed, 84 insertions(+), 61 deletions(-) create mode 100644 src/definition/accessors/IRoomSubscriptionRead.ts delete mode 100644 src/definition/accessors/ISubscriptionRead.ts rename src/definition/subscriptions/{ISubscription.ts => IRoomSubscription.ts} (85%) create mode 100644 src/server/accessors/RoomSubscriptionRead.ts delete mode 100644 src/server/accessors/SubscriptionRead.ts create mode 100644 src/server/bridges/IRoomSubscriptionBridge.ts delete mode 100644 src/server/bridges/ISubscriptionBridge.ts diff --git a/src/definition/accessors/IRead.ts b/src/definition/accessors/IRead.ts index ac0aac6d3..66c229050 100644 --- a/src/definition/accessors/IRead.ts +++ b/src/definition/accessors/IRead.ts @@ -4,7 +4,7 @@ import { IMessageRead } from './IMessageRead'; import { INotifier } from './INotifier'; import { IPersistenceRead } from './IPersistenceRead'; import { IRoomRead } from './IRoomRead'; -import { ISubscriptionRead } from './ISubscriptionRead'; +import { IRoomSubscriptionRead } from './IRoomSubscriptionRead'; import { IUploadRead } from './IUploadRead'; import { IUserRead } from './IUserRead'; @@ -26,8 +26,8 @@ export interface IRead { /** Gets the IRoomRead instance. */ getRoomReader(): IRoomRead; - /** Gets the ISubscriptionRead instance. */ - getSubscriptionReader(): ISubscriptionRead; + /** Gets the IRoomSubscriptionRead instance. */ + getRoomSubscriptionReader(): IRoomSubscriptionRead; /** Gets the IUserRead instance. */ getUserReader(): IUserRead; diff --git a/src/definition/accessors/IRoomSubscriptionRead.ts b/src/definition/accessors/IRoomSubscriptionRead.ts new file mode 100644 index 000000000..c340c5689 --- /dev/null +++ b/src/definition/accessors/IRoomSubscriptionRead.ts @@ -0,0 +1,23 @@ +import { IRoomSubscription } from '../subscriptions'; + +/** + * This accessor provides methods for accessing + * subscriptions in a read-only-fashion. + */ +export interface IRoomSubscriptionRead { + /** + * Gets a list of subscriptions by a room id. + * + * @param roomId the id of the room + * @returns an iterator of subscriptions + */ + getByRoomId(roomId: string): Promise>; + + /** + * Gets a list of all the subscriptions for a user by their id. + * + * @param userId the id of the user + * @returns an iterator of subscriptions for the user + */ + getByUserId(userId: string): Promise>; +} diff --git a/src/definition/accessors/ISubscriptionRead.ts b/src/definition/accessors/ISubscriptionRead.ts deleted file mode 100644 index b30e0e203..000000000 --- a/src/definition/accessors/ISubscriptionRead.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ISubscription } from '../subscriptions/ISubscription'; - -/** - * This accessor provides methods for accessing - * subscriptions in a read-only-fashion. - */ -export interface ISubscriptionRead { - /** - * Gets a list of subscriptions by a room id. - * - * @param roomId the id of the room - * @returns an iterator of subscriptions - */ - getByRoomId(roomId: string): Promise>; -} diff --git a/src/definition/accessors/index.ts b/src/definition/accessors/index.ts index 6e3288cf7..fcbed4286 100644 --- a/src/definition/accessors/index.ts +++ b/src/definition/accessors/index.ts @@ -34,13 +34,13 @@ import { IRead } from './IRead'; import { IRoomBuilder } from './IRoomBuilder'; import { IRoomExtender } from './IRoomExtender'; import { IRoomRead } from './IRoomRead'; +import { IRoomSubscriptionRead } from './IRoomSubscriptionRead'; import { IServerSettingRead } from './IServerSettingRead'; import { IServerSettingsModify } from './IServerSettingsModify'; import { ISettingRead } from './ISettingRead'; import { ISettingsExtend } from './ISettingsExtend'; import { ISlashCommandsExtend } from './ISlashCommandsExtend'; import { ISlashCommandsModify } from './ISlashCommandsModify'; -import { ISubscriptionRead } from './ISubscriptionRead'; import { IUploadRead } from './IUploadRead'; import { IUserRead } from './IUserRead'; @@ -77,13 +77,13 @@ export { IRoomBuilder, IRoomExtender, IRoomRead, + IRoomSubscriptionRead, IServerSettingRead, IServerSettingsModify, ISettingRead, ISettingsExtend, ISlashCommandsExtend, ISlashCommandsModify, - ISubscriptionRead, IUploadRead, IUserRead, LogMessageSeverity, diff --git a/src/definition/subscriptions/ISubscription.ts b/src/definition/subscriptions/IRoomSubscription.ts similarity index 85% rename from src/definition/subscriptions/ISubscription.ts rename to src/definition/subscriptions/IRoomSubscription.ts index 923db00af..938133082 100644 --- a/src/definition/subscriptions/ISubscription.ts +++ b/src/definition/subscriptions/IRoomSubscription.ts @@ -1,7 +1,12 @@ import { IRoom } from '../rooms'; import { IUser } from '../users'; -export interface ISubscription { +/** + * This interface represents a user's subscription to + * a room and includes information about that user's + * settings and information in relation to the room. + */ +export interface IRoomSubscription { /** The id of the subscription. */ id: string; /** The room the subscription is for (kinda maps to `rid`). */ diff --git a/src/definition/subscriptions/index.ts b/src/definition/subscriptions/index.ts index c4f3d54c4..9ea23bb06 100644 --- a/src/definition/subscriptions/index.ts +++ b/src/definition/subscriptions/index.ts @@ -1 +1 @@ -export { ISubscription } from './ISubscription'; +export { IRoomSubscription } from './IRoomSubscription'; diff --git a/src/server/accessors/Reader.ts b/src/server/accessors/Reader.ts index c3904f435..e0e12dffe 100644 --- a/src/server/accessors/Reader.ts +++ b/src/server/accessors/Reader.ts @@ -6,7 +6,7 @@ import { IPersistenceRead, IRead, IRoomRead, - ISubscriptionRead, + IRoomSubscriptionRead, IUploadRead, IUserRead, } from '../../definition/accessors'; @@ -17,7 +17,7 @@ export class Reader implements IRead { private message: IMessageRead, private persist: IPersistenceRead, private room: IRoomRead, - private subscription: ISubscriptionRead, + private roomSubscription: IRoomSubscriptionRead, private user: IUserRead, private noti: INotifier, private livechat: ILivechatRead, @@ -40,8 +40,8 @@ export class Reader implements IRead { return this.room; } - public getSubscriptionReader(): ISubscriptionRead { - return this.subscription; + public getRoomSubscriptionReader(): IRoomSubscriptionRead { + return this.roomSubscription; } public getUserReader(): IUserRead { diff --git a/src/server/accessors/RoomSubscriptionRead.ts b/src/server/accessors/RoomSubscriptionRead.ts new file mode 100644 index 000000000..f69adbeb3 --- /dev/null +++ b/src/server/accessors/RoomSubscriptionRead.ts @@ -0,0 +1,16 @@ +import { IRoomSubscriptionRead } from '../../definition/accessors'; +import { IRoomSubscription } from '../../definition/subscriptions'; + +import { IRoomSubscriptionBridge } from '../bridges'; + +export class RoomSubscriptionRead implements IRoomSubscriptionRead { + constructor(private subscriptionBridge: IRoomSubscriptionBridge, private appId: string) { } + + public getByRoomId(roomId: string): Promise> { + return this.subscriptionBridge.getByRoomId(roomId, this.appId); + } + + public getByUserId(userId: string): Promise> { + return this.subscriptionBridge.getByUserId(userId, this.appId); + } +} diff --git a/src/server/accessors/SubscriptionRead.ts b/src/server/accessors/SubscriptionRead.ts deleted file mode 100644 index 88d003b5b..000000000 --- a/src/server/accessors/SubscriptionRead.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ISubscriptionRead } from '../../definition/accessors'; -import { ISubscription } from '../../definition/subscriptions'; - -import { ISubscriptionBridge } from '../bridges'; - -export class SubscriptionRead implements ISubscriptionRead { - constructor(private subscriptionBridge: ISubscriptionBridge, private appId: string) { } - - public getByRoomId(roomId: string): Promise> { - return this.subscriptionBridge.getByRoomId(roomId, this.appId); - } -} diff --git a/src/server/accessors/index.ts b/src/server/accessors/index.ts index fc2095b3a..906ba996e 100644 --- a/src/server/accessors/index.ts +++ b/src/server/accessors/index.ts @@ -20,13 +20,13 @@ import { Reader } from './Reader'; import { RoomBuilder } from './RoomBuilder'; import { RoomExtender } from './RoomExtender'; import { RoomRead } from './RoomRead'; +import { RoomSubscriptionRead } from './RoomSubscriptionRead'; import { ServerSettingRead } from './ServerSettingRead'; import { ServerSettingsModify } from './ServerSettingsModify'; import { SettingRead } from './SettingRead'; import { SettingsExtend } from './SettingsExtend'; import { SlashCommandsExtend } from './SlashCommandsExtend'; import { SlashCommandsModify } from './SlashCommandsModify'; -import { SubscriptionRead } from './SubscriptionRead'; import { UploadRead } from './UploadRead'; import { UserRead } from './UserRead'; @@ -53,13 +53,13 @@ export { RoomBuilder, RoomExtender, RoomRead, + RoomSubscriptionRead, ServerSettingRead, ServerSettingsModify, SettingRead, SettingsExtend, SlashCommandsExtend, SlashCommandsModify, - SubscriptionRead, UploadRead, UserRead, }; diff --git a/src/server/bridges/AppBridges.ts b/src/server/bridges/AppBridges.ts index eb81925d3..8307e974b 100644 --- a/src/server/bridges/AppBridges.ts +++ b/src/server/bridges/AppBridges.ts @@ -10,8 +10,8 @@ import { ILivechatBridge } from './ILivechatBridge'; import { IMessageBridge } from './IMessageBridge'; import { IPersistenceBridge } from './IPersistenceBridge'; import { IRoomBridge } from './IRoomBridge'; +import { IRoomSubscriptionBridge } from './IRoomSubscriptionBridge'; import { IServerSettingBridge } from './IServerSettingBridge'; -import { ISubscriptionBridge } from './ISubscriptionBridge'; import { IUploadBridge } from './IUploadBridge'; import { IUserBridge } from './IUserBridge'; @@ -27,9 +27,9 @@ export abstract class AppBridges { public abstract getPersistenceBridge(): IPersistenceBridge; public abstract getAppActivationBridge(): IAppActivationBridge; public abstract getRoomBridge(): IRoomBridge; + public abstract getRoomSubscriptionBridge(): IRoomSubscriptionBridge; public abstract getInternalBridge(): IInternalBridge; public abstract getServerSettingBridge(): IServerSettingBridge; - public abstract getSubscriptionBridge(): ISubscriptionBridge; public abstract getUploadBridge(): IUploadBridge; public abstract getUserBridge(): IUserBridge; } diff --git a/src/server/bridges/IRoomSubscriptionBridge.ts b/src/server/bridges/IRoomSubscriptionBridge.ts new file mode 100644 index 000000000..f0e2ae655 --- /dev/null +++ b/src/server/bridges/IRoomSubscriptionBridge.ts @@ -0,0 +1,7 @@ +import { IRoomSubscription } from '../../definition/subscriptions'; + +export interface IRoomSubscriptionBridge { + getByRoomId(roomId: string, appId: string): Promise>; + + getByUserId(userId: string, appId: string): Promise>; +} diff --git a/src/server/bridges/ISubscriptionBridge.ts b/src/server/bridges/ISubscriptionBridge.ts deleted file mode 100644 index 1e081f4b1..000000000 --- a/src/server/bridges/ISubscriptionBridge.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { ISubscription } from '../../definition/subscriptions'; - -export interface ISubscriptionBridge { - getByRoomId(roomId: string, appId: string): Promise>; -} diff --git a/src/server/bridges/index.ts b/src/server/bridges/index.ts index 700ba677f..5ac350dfb 100644 --- a/src/server/bridges/index.ts +++ b/src/server/bridges/index.ts @@ -11,8 +11,8 @@ import { ILivechatBridge } from './ILivechatBridge'; import { IMessageBridge } from './IMessageBridge'; import { IPersistenceBridge } from './IPersistenceBridge'; import { IRoomBridge } from './IRoomBridge'; +import { IRoomSubscriptionBridge } from './IRoomSubscriptionBridge'; import { IServerSettingBridge } from './IServerSettingBridge'; -import { ISubscriptionBridge } from './ISubscriptionBridge'; import { IUploadBridge } from './IUploadBridge'; import { IUserBridge } from './IUserBridge'; @@ -29,9 +29,9 @@ export { IAppCommandBridge, IAppApiBridge, IRoomBridge, + IRoomSubscriptionBridge, IInternalBridge, IServerSettingBridge, - ISubscriptionBridge, IUserBridge, IUploadBridge, AppBridges, diff --git a/src/server/managers/AppAccessorManager.ts b/src/server/managers/AppAccessorManager.ts index cb97f3a68..691f649c2 100644 --- a/src/server/managers/AppAccessorManager.ts +++ b/src/server/managers/AppAccessorManager.ts @@ -12,12 +12,12 @@ import { PersistenceRead, Reader, RoomRead, + RoomSubscriptionRead, ServerSettingRead, SettingRead, SettingsExtend, SlashCommandsExtend, SlashCommandsModify, - SubscriptionRead, UploadRead, UserRead, } from '../accessors'; @@ -128,7 +128,7 @@ export class AppAccessorManager { const msg = new MessageRead(this.bridges.getMessageBridge(), appId); const persist = new PersistenceRead(this.bridges.getPersistenceBridge(), appId); const room = new RoomRead(this.bridges.getRoomBridge(), appId); - const subscr = new SubscriptionRead(this.bridges.getSubscriptionBridge(), appId); + const subscr = new RoomSubscriptionRead(this.bridges.getRoomSubscriptionBridge(), appId); const user = new UserRead(this.bridges.getUserBridge(), appId); const noti = new Notifier(this.bridges.getMessageBridge(), appId); const livechat = new LivechatRead(this.bridges.getLivechatBridge(), appId); diff --git a/tests/server/accessors/Reader.spec.ts b/tests/server/accessors/Reader.spec.ts index 9dc7f2500..808b99070 100644 --- a/tests/server/accessors/Reader.spec.ts +++ b/tests/server/accessors/Reader.spec.ts @@ -1,5 +1,5 @@ import { Expect, SetupFixture, Test } from 'alsatian'; -import { IEnvironmentRead, ILivechatRead, IMessageRead, INotifier, IPersistenceRead, IRoomRead, ISubscriptionRead, IUploadRead, IUserRead } from '../../../src/definition/accessors'; +import { IEnvironmentRead, ILivechatRead, IMessageRead, INotifier, IPersistenceRead, IRoomRead, IRoomSubscriptionRead, IUploadRead, IUserRead } from '../../../src/definition/accessors'; import { Reader } from '../../../src/server/accessors'; @@ -8,7 +8,7 @@ export class ReaderAccessorTestFixture { private msg: IMessageRead; private pr: IPersistenceRead; private rm: IRoomRead; - private sb: ISubscriptionRead; + private sb: IRoomSubscriptionRead; private ur: IUserRead; private ni: INotifier; private livechat: ILivechatRead; @@ -20,7 +20,7 @@ export class ReaderAccessorTestFixture { this.msg = {} as IMessageRead; this.pr = {} as IPersistenceRead; this.rm = {} as IRoomRead; - this.sb = {} as ISubscriptionRead; + this.sb = {} as IRoomSubscriptionRead; this.ur = {} as IUserRead; this.ni = {} as INotifier; this.livechat = {} as ILivechatRead; @@ -37,7 +37,7 @@ export class ReaderAccessorTestFixture { Expect(rd.getNotifier()).toBeDefined(); Expect(rd.getPersistenceReader()).toBeDefined(); Expect(rd.getRoomReader()).toBeDefined(); - Expect(rd.getSubscriptionReader()).toBeDefined(); + Expect(rd.getRoomSubscriptionReader()).toBeDefined(); Expect(rd.getUserReader()).toBeDefined(); Expect(rd.getLivechatReader()).toBeDefined(); Expect(rd.getUploadReader()).toBeDefined(); diff --git a/tests/test-data/bridges/appBridges.ts b/tests/test-data/bridges/appBridges.ts index 5fde2b402..82c63676c 100644 --- a/tests/test-data/bridges/appBridges.ts +++ b/tests/test-data/bridges/appBridges.ts @@ -10,8 +10,8 @@ import { IMessageBridge, IPersistenceBridge, IRoomBridge, + IRoomSubscriptionBridge, IServerSettingBridge, - ISubscriptionBridge, IUploadBridge, IUserBridge, } from '../../../src/server/bridges'; @@ -111,7 +111,7 @@ export class TestsAppBridges extends AppBridges { return this.roomBridge; } - public getSubscriptionBridge(): ISubscriptionBridge { + public getRoomSubscriptionBridge(): IRoomSubscriptionBridge { return this.subscriptionBridge; } diff --git a/tests/test-data/bridges/subscriptionBridge.ts b/tests/test-data/bridges/subscriptionBridge.ts index fe0c482bb..2763e5e41 100644 --- a/tests/test-data/bridges/subscriptionBridge.ts +++ b/tests/test-data/bridges/subscriptionBridge.ts @@ -1,8 +1,12 @@ -import { ISubscription } from '../../../src/definition/subscriptions'; -import { ISubscriptionBridge } from '../../../src/server/bridges'; +import { IRoomSubscription } from '../../../src/definition/subscriptions'; +import { IRoomSubscriptionBridge } from '../../../src/server/bridges'; -export class TestsSubscriptionBridge implements ISubscriptionBridge { - public getByRoomId(roomId: string, appId: string): Promise> { +export class TestsSubscriptionBridge implements IRoomSubscriptionBridge { + public getByRoomId(roomId: string, appId: string): Promise> { + throw new Error('Method not implemented.'); + } + + public getByUserId(userId: string, appId: string): Promise> { throw new Error('Method not implemented.'); } } From de72a0aa89cab0cbd7c7d21c66b92a8f7c7830c0 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Wed, 9 Oct 2019 14:57:23 -0500 Subject: [PATCH 07/11] Let's try an async iterable iterator --- src/definition/accessors/IRoomSubscriptionRead.ts | 4 ++-- src/definition/subscriptions/IRoomSubscription.ts | 2 +- src/server/accessors/RoomSubscriptionRead.ts | 4 ++-- src/server/bridges/IRoomSubscriptionBridge.ts | 4 ++-- tests/test-data/bridges/subscriptionBridge.ts | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/definition/accessors/IRoomSubscriptionRead.ts b/src/definition/accessors/IRoomSubscriptionRead.ts index c340c5689..263a184e5 100644 --- a/src/definition/accessors/IRoomSubscriptionRead.ts +++ b/src/definition/accessors/IRoomSubscriptionRead.ts @@ -11,7 +11,7 @@ export interface IRoomSubscriptionRead { * @param roomId the id of the room * @returns an iterator of subscriptions */ - getByRoomId(roomId: string): Promise>; + getByRoomId(roomId: string): Promise>; /** * Gets a list of all the subscriptions for a user by their id. @@ -19,5 +19,5 @@ export interface IRoomSubscriptionRead { * @param userId the id of the user * @returns an iterator of subscriptions for the user */ - getByUserId(userId: string): Promise>; + getByUserId(userId: string): Promise>; } diff --git a/src/definition/subscriptions/IRoomSubscription.ts b/src/definition/subscriptions/IRoomSubscription.ts index 938133082..d1c1ee9ea 100644 --- a/src/definition/subscriptions/IRoomSubscription.ts +++ b/src/definition/subscriptions/IRoomSubscription.ts @@ -7,7 +7,7 @@ import { IUser } from '../users'; * settings and information in relation to the room. */ export interface IRoomSubscription { - /** The id of the subscription. */ + /** The id of the subscription (maps to `_id`). */ id: string; /** The room the subscription is for (kinda maps to `rid`). */ room: IRoom; diff --git a/src/server/accessors/RoomSubscriptionRead.ts b/src/server/accessors/RoomSubscriptionRead.ts index f69adbeb3..2cae8a5d6 100644 --- a/src/server/accessors/RoomSubscriptionRead.ts +++ b/src/server/accessors/RoomSubscriptionRead.ts @@ -6,11 +6,11 @@ import { IRoomSubscriptionBridge } from '../bridges'; export class RoomSubscriptionRead implements IRoomSubscriptionRead { constructor(private subscriptionBridge: IRoomSubscriptionBridge, private appId: string) { } - public getByRoomId(roomId: string): Promise> { + public getByRoomId(roomId: string): Promise> { return this.subscriptionBridge.getByRoomId(roomId, this.appId); } - public getByUserId(userId: string): Promise> { + public getByUserId(userId: string): Promise> { return this.subscriptionBridge.getByUserId(userId, this.appId); } } diff --git a/src/server/bridges/IRoomSubscriptionBridge.ts b/src/server/bridges/IRoomSubscriptionBridge.ts index f0e2ae655..d27ae7b91 100644 --- a/src/server/bridges/IRoomSubscriptionBridge.ts +++ b/src/server/bridges/IRoomSubscriptionBridge.ts @@ -1,7 +1,7 @@ import { IRoomSubscription } from '../../definition/subscriptions'; export interface IRoomSubscriptionBridge { - getByRoomId(roomId: string, appId: string): Promise>; + getByRoomId(roomId: string, appId: string): Promise>; - getByUserId(userId: string, appId: string): Promise>; + getByUserId(userId: string, appId: string): Promise>; } diff --git a/tests/test-data/bridges/subscriptionBridge.ts b/tests/test-data/bridges/subscriptionBridge.ts index 2763e5e41..49cac56fb 100644 --- a/tests/test-data/bridges/subscriptionBridge.ts +++ b/tests/test-data/bridges/subscriptionBridge.ts @@ -2,11 +2,11 @@ import { IRoomSubscription } from '../../../src/definition/subscriptions'; import { IRoomSubscriptionBridge } from '../../../src/server/bridges'; export class TestsSubscriptionBridge implements IRoomSubscriptionBridge { - public getByRoomId(roomId: string, appId: string): Promise> { + public getByRoomId(roomId: string, appId: string): Promise> { throw new Error('Method not implemented.'); } - public getByUserId(userId: string, appId: string): Promise> { + public getByUserId(userId: string, appId: string): Promise> { throw new Error('Method not implemented.'); } } From 8556115e793ae564ab57139653918e55f5660ba1 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Thu, 10 Oct 2019 08:42:17 -0500 Subject: [PATCH 08/11] Revert async iterable iterator for subscriptions --- src/definition/accessors/IRoomSubscriptionRead.ts | 4 ++-- src/server/accessors/RoomSubscriptionRead.ts | 4 ++-- src/server/bridges/IRoomSubscriptionBridge.ts | 4 ++-- tests/test-data/bridges/subscriptionBridge.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/definition/accessors/IRoomSubscriptionRead.ts b/src/definition/accessors/IRoomSubscriptionRead.ts index 263a184e5..c340c5689 100644 --- a/src/definition/accessors/IRoomSubscriptionRead.ts +++ b/src/definition/accessors/IRoomSubscriptionRead.ts @@ -11,7 +11,7 @@ export interface IRoomSubscriptionRead { * @param roomId the id of the room * @returns an iterator of subscriptions */ - getByRoomId(roomId: string): Promise>; + getByRoomId(roomId: string): Promise>; /** * Gets a list of all the subscriptions for a user by their id. @@ -19,5 +19,5 @@ export interface IRoomSubscriptionRead { * @param userId the id of the user * @returns an iterator of subscriptions for the user */ - getByUserId(userId: string): Promise>; + getByUserId(userId: string): Promise>; } diff --git a/src/server/accessors/RoomSubscriptionRead.ts b/src/server/accessors/RoomSubscriptionRead.ts index 2cae8a5d6..f69adbeb3 100644 --- a/src/server/accessors/RoomSubscriptionRead.ts +++ b/src/server/accessors/RoomSubscriptionRead.ts @@ -6,11 +6,11 @@ import { IRoomSubscriptionBridge } from '../bridges'; export class RoomSubscriptionRead implements IRoomSubscriptionRead { constructor(private subscriptionBridge: IRoomSubscriptionBridge, private appId: string) { } - public getByRoomId(roomId: string): Promise> { + public getByRoomId(roomId: string): Promise> { return this.subscriptionBridge.getByRoomId(roomId, this.appId); } - public getByUserId(userId: string): Promise> { + public getByUserId(userId: string): Promise> { return this.subscriptionBridge.getByUserId(userId, this.appId); } } diff --git a/src/server/bridges/IRoomSubscriptionBridge.ts b/src/server/bridges/IRoomSubscriptionBridge.ts index d27ae7b91..f0e2ae655 100644 --- a/src/server/bridges/IRoomSubscriptionBridge.ts +++ b/src/server/bridges/IRoomSubscriptionBridge.ts @@ -1,7 +1,7 @@ import { IRoomSubscription } from '../../definition/subscriptions'; export interface IRoomSubscriptionBridge { - getByRoomId(roomId: string, appId: string): Promise>; + getByRoomId(roomId: string, appId: string): Promise>; - getByUserId(userId: string, appId: string): Promise>; + getByUserId(userId: string, appId: string): Promise>; } diff --git a/tests/test-data/bridges/subscriptionBridge.ts b/tests/test-data/bridges/subscriptionBridge.ts index 49cac56fb..2763e5e41 100644 --- a/tests/test-data/bridges/subscriptionBridge.ts +++ b/tests/test-data/bridges/subscriptionBridge.ts @@ -2,11 +2,11 @@ import { IRoomSubscription } from '../../../src/definition/subscriptions'; import { IRoomSubscriptionBridge } from '../../../src/server/bridges'; export class TestsSubscriptionBridge implements IRoomSubscriptionBridge { - public getByRoomId(roomId: string, appId: string): Promise> { + public getByRoomId(roomId: string, appId: string): Promise> { throw new Error('Method not implemented.'); } - public getByUserId(userId: string, appId: string): Promise> { + public getByUserId(userId: string, appId: string): Promise> { throw new Error('Method not implemented.'); } } From 37045f55d12ff682753c9fc21fc0e33c21176d02 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Fri, 8 May 2020 15:39:49 -0500 Subject: [PATCH 09/11] Reimplement the AsyncIterableIterator for the SubscriptionRead interface --- src/definition/accessors/IRoomSubscriptionRead.ts | 6 +++--- src/definition/package.json | 2 +- src/definition/subscriptions/IRoomSubscriptionIterator.ts | 3 +++ src/definition/subscriptions/index.ts | 1 + src/server/accessors/RoomSubscriptionRead.ts | 6 +++--- src/server/bridges/IRoomSubscriptionBridge.ts | 6 +++--- src/server/compiler/AppCompiler.ts | 4 ++-- tests/test-data/bridges/subscriptionBridge.ts | 6 +++--- tsconfig.json | 2 +- 9 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 src/definition/subscriptions/IRoomSubscriptionIterator.ts diff --git a/src/definition/accessors/IRoomSubscriptionRead.ts b/src/definition/accessors/IRoomSubscriptionRead.ts index c340c5689..edfe13078 100644 --- a/src/definition/accessors/IRoomSubscriptionRead.ts +++ b/src/definition/accessors/IRoomSubscriptionRead.ts @@ -1,4 +1,4 @@ -import { IRoomSubscription } from '../subscriptions'; +import { IRoomSubscriptionIterator } from '../subscriptions'; /** * This accessor provides methods for accessing @@ -11,7 +11,7 @@ export interface IRoomSubscriptionRead { * @param roomId the id of the room * @returns an iterator of subscriptions */ - getByRoomId(roomId: string): Promise>; + getByRoomId(roomId: string): Promise; /** * Gets a list of all the subscriptions for a user by their id. @@ -19,5 +19,5 @@ export interface IRoomSubscriptionRead { * @param userId the id of the user * @returns an iterator of subscriptions for the user */ - getByUserId(userId: string): Promise>; + getByUserId(userId: string): Promise; } diff --git a/src/definition/package.json b/src/definition/package.json index 616be7204..ddaad849e 100644 --- a/src/definition/package.json +++ b/src/definition/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/apps-ts-definition", - "version": "1.14.0-beta", + "version": "1.14.0", "description": "Contains the TypeScript definitions for the Rocket.Chat Applications.", "main": "index.js", "typings": "index", diff --git a/src/definition/subscriptions/IRoomSubscriptionIterator.ts b/src/definition/subscriptions/IRoomSubscriptionIterator.ts new file mode 100644 index 000000000..f0c9549b9 --- /dev/null +++ b/src/definition/subscriptions/IRoomSubscriptionIterator.ts @@ -0,0 +1,3 @@ +import { IRoomSubscription } from './IRoomSubscription'; + +export interface IRoomSubscriptionIterator extends AsyncIterableIterator {} diff --git a/src/definition/subscriptions/index.ts b/src/definition/subscriptions/index.ts index 9ea23bb06..2f57e60a8 100644 --- a/src/definition/subscriptions/index.ts +++ b/src/definition/subscriptions/index.ts @@ -1 +1,2 @@ export { IRoomSubscription } from './IRoomSubscription'; +export { IRoomSubscriptionIterator } from './IRoomSubscriptionIterator'; diff --git a/src/server/accessors/RoomSubscriptionRead.ts b/src/server/accessors/RoomSubscriptionRead.ts index f69adbeb3..07d331e63 100644 --- a/src/server/accessors/RoomSubscriptionRead.ts +++ b/src/server/accessors/RoomSubscriptionRead.ts @@ -1,16 +1,16 @@ import { IRoomSubscriptionRead } from '../../definition/accessors'; -import { IRoomSubscription } from '../../definition/subscriptions'; +import { IRoomSubscriptionIterator } from '../../definition/subscriptions'; import { IRoomSubscriptionBridge } from '../bridges'; export class RoomSubscriptionRead implements IRoomSubscriptionRead { constructor(private subscriptionBridge: IRoomSubscriptionBridge, private appId: string) { } - public getByRoomId(roomId: string): Promise> { + public getByRoomId(roomId: string): Promise { return this.subscriptionBridge.getByRoomId(roomId, this.appId); } - public getByUserId(userId: string): Promise> { + public getByUserId(userId: string): Promise { return this.subscriptionBridge.getByUserId(userId, this.appId); } } diff --git a/src/server/bridges/IRoomSubscriptionBridge.ts b/src/server/bridges/IRoomSubscriptionBridge.ts index f0e2ae655..cb397a518 100644 --- a/src/server/bridges/IRoomSubscriptionBridge.ts +++ b/src/server/bridges/IRoomSubscriptionBridge.ts @@ -1,7 +1,7 @@ -import { IRoomSubscription } from '../../definition/subscriptions'; +import { IRoomSubscriptionIterator } from '../../definition/subscriptions'; export interface IRoomSubscriptionBridge { - getByRoomId(roomId: string, appId: string): Promise>; + getByRoomId(roomId: string, appId: string): Promise; - getByUserId(userId: string, appId: string): Promise>; + getByUserId(userId: string, appId: string): Promise; } diff --git a/src/server/compiler/AppCompiler.ts b/src/server/compiler/AppCompiler.ts index 6ec7154f9..a299a183a 100644 --- a/src/server/compiler/AppCompiler.ts +++ b/src/server/compiler/AppCompiler.ts @@ -122,7 +122,7 @@ export class AppCompiler { return resolvedModules.push(rs.resolvedModule); } - console.log(`Failed to resolve module: ${ moduleName }`); + console.warn(`Failed to resolve module: ${ moduleName }`); } /** @@ -195,7 +195,7 @@ export class AppCompiler { if (moduleNames.length > resolvedModules.length) { const failedCount = moduleNames.length - resolvedModules.length; - console.log(`Failed to resolved ${ failedCount } modules for ${ info.name } v${ info.version }!`); + console.warn(`Failed to resolved ${ failedCount } modules for ${ info.name } v${ info.version }!`); } return resolvedModules; diff --git a/tests/test-data/bridges/subscriptionBridge.ts b/tests/test-data/bridges/subscriptionBridge.ts index 2763e5e41..8ef558183 100644 --- a/tests/test-data/bridges/subscriptionBridge.ts +++ b/tests/test-data/bridges/subscriptionBridge.ts @@ -1,12 +1,12 @@ -import { IRoomSubscription } from '../../../src/definition/subscriptions'; +import { IRoomSubscriptionIterator } from '../../../src/definition/subscriptions'; import { IRoomSubscriptionBridge } from '../../../src/server/bridges'; export class TestsSubscriptionBridge implements IRoomSubscriptionBridge { - public getByRoomId(roomId: string, appId: string): Promise> { + public getByRoomId(roomId: string, appId: string): Promise { throw new Error('Method not implemented.'); } - public getByUserId(userId: string, appId: string): Promise> { + public getByUserId(userId: string, appId: string): Promise { throw new Error('Method not implemented.'); } } diff --git a/tsconfig.json b/tsconfig.json index b2266c9b5..ca1d4a9af 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ "experimentalDecorators": true, "moduleResolution": "node", "types": ["node"], - "lib": ["es2017", "dom"], + "lib": ["es2018", "dom"], "outDir": "." }, "exclude": [ From 8a730a3f2a3df85693b190bd3c734c65cc185775 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Mon, 11 May 2020 09:48:34 -0500 Subject: [PATCH 10/11] Use the esnext library when compiling apps --- src/server/compiler/AppCompiler.ts | 1 + tests/server/compiler/AppCompiler.spec.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/server/compiler/AppCompiler.ts b/src/server/compiler/AppCompiler.ts index a299a183a..88f8f4dc3 100644 --- a/src/server/compiler/AppCompiler.ts +++ b/src/server/compiler/AppCompiler.ts @@ -36,6 +36,7 @@ export class AppCompiler { types: ['node'], // Set this to true if you would like to see the module resolution process traceResolution: false, + lib: ['lib.esnext.d.ts'], }; this.libraryFiles = {}; diff --git a/tests/server/compiler/AppCompiler.spec.ts b/tests/server/compiler/AppCompiler.spec.ts index 7a5eb31e3..5663bd57d 100644 --- a/tests/server/compiler/AppCompiler.spec.ts +++ b/tests/server/compiler/AppCompiler.spec.ts @@ -23,6 +23,7 @@ export class AppCompilerTestFixture { emitDecoratorMetadata: true, experimentalDecorators: true, traceResolution: false, + lib: ['lib.esnext.d.ts'], }; Expect((compiler as any).compilerOptions).toEqual(expectedOptions); From b83acd8c9c550cb46524d5e9aada04f51bd15911 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Mon, 11 May 2020 14:02:10 -0500 Subject: [PATCH 11/11] Remove the specific iterator and go generic --- src/definition/accessors/IRoomSubscriptionRead.ts | 6 +++--- src/definition/subscriptions/IRoomSubscriptionIterator.ts | 3 --- src/definition/subscriptions/index.ts | 1 - src/server/accessors/RoomSubscriptionRead.ts | 6 +++--- src/server/bridges/IRoomSubscriptionBridge.ts | 6 +++--- tests/test-data/bridges/subscriptionBridge.ts | 6 +++--- 6 files changed, 12 insertions(+), 16 deletions(-) delete mode 100644 src/definition/subscriptions/IRoomSubscriptionIterator.ts diff --git a/src/definition/accessors/IRoomSubscriptionRead.ts b/src/definition/accessors/IRoomSubscriptionRead.ts index edfe13078..263a184e5 100644 --- a/src/definition/accessors/IRoomSubscriptionRead.ts +++ b/src/definition/accessors/IRoomSubscriptionRead.ts @@ -1,4 +1,4 @@ -import { IRoomSubscriptionIterator } from '../subscriptions'; +import { IRoomSubscription } from '../subscriptions'; /** * This accessor provides methods for accessing @@ -11,7 +11,7 @@ export interface IRoomSubscriptionRead { * @param roomId the id of the room * @returns an iterator of subscriptions */ - getByRoomId(roomId: string): Promise; + getByRoomId(roomId: string): Promise>; /** * Gets a list of all the subscriptions for a user by their id. @@ -19,5 +19,5 @@ export interface IRoomSubscriptionRead { * @param userId the id of the user * @returns an iterator of subscriptions for the user */ - getByUserId(userId: string): Promise; + getByUserId(userId: string): Promise>; } diff --git a/src/definition/subscriptions/IRoomSubscriptionIterator.ts b/src/definition/subscriptions/IRoomSubscriptionIterator.ts deleted file mode 100644 index f0c9549b9..000000000 --- a/src/definition/subscriptions/IRoomSubscriptionIterator.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IRoomSubscription } from './IRoomSubscription'; - -export interface IRoomSubscriptionIterator extends AsyncIterableIterator {} diff --git a/src/definition/subscriptions/index.ts b/src/definition/subscriptions/index.ts index 2f57e60a8..9ea23bb06 100644 --- a/src/definition/subscriptions/index.ts +++ b/src/definition/subscriptions/index.ts @@ -1,2 +1 @@ export { IRoomSubscription } from './IRoomSubscription'; -export { IRoomSubscriptionIterator } from './IRoomSubscriptionIterator'; diff --git a/src/server/accessors/RoomSubscriptionRead.ts b/src/server/accessors/RoomSubscriptionRead.ts index 07d331e63..2cae8a5d6 100644 --- a/src/server/accessors/RoomSubscriptionRead.ts +++ b/src/server/accessors/RoomSubscriptionRead.ts @@ -1,16 +1,16 @@ import { IRoomSubscriptionRead } from '../../definition/accessors'; -import { IRoomSubscriptionIterator } from '../../definition/subscriptions'; +import { IRoomSubscription } from '../../definition/subscriptions'; import { IRoomSubscriptionBridge } from '../bridges'; export class RoomSubscriptionRead implements IRoomSubscriptionRead { constructor(private subscriptionBridge: IRoomSubscriptionBridge, private appId: string) { } - public getByRoomId(roomId: string): Promise { + public getByRoomId(roomId: string): Promise> { return this.subscriptionBridge.getByRoomId(roomId, this.appId); } - public getByUserId(userId: string): Promise { + public getByUserId(userId: string): Promise> { return this.subscriptionBridge.getByUserId(userId, this.appId); } } diff --git a/src/server/bridges/IRoomSubscriptionBridge.ts b/src/server/bridges/IRoomSubscriptionBridge.ts index cb397a518..d27ae7b91 100644 --- a/src/server/bridges/IRoomSubscriptionBridge.ts +++ b/src/server/bridges/IRoomSubscriptionBridge.ts @@ -1,7 +1,7 @@ -import { IRoomSubscriptionIterator } from '../../definition/subscriptions'; +import { IRoomSubscription } from '../../definition/subscriptions'; export interface IRoomSubscriptionBridge { - getByRoomId(roomId: string, appId: string): Promise; + getByRoomId(roomId: string, appId: string): Promise>; - getByUserId(userId: string, appId: string): Promise; + getByUserId(userId: string, appId: string): Promise>; } diff --git a/tests/test-data/bridges/subscriptionBridge.ts b/tests/test-data/bridges/subscriptionBridge.ts index 8ef558183..49cac56fb 100644 --- a/tests/test-data/bridges/subscriptionBridge.ts +++ b/tests/test-data/bridges/subscriptionBridge.ts @@ -1,12 +1,12 @@ -import { IRoomSubscriptionIterator } from '../../../src/definition/subscriptions'; +import { IRoomSubscription } from '../../../src/definition/subscriptions'; import { IRoomSubscriptionBridge } from '../../../src/server/bridges'; export class TestsSubscriptionBridge implements IRoomSubscriptionBridge { - public getByRoomId(roomId: string, appId: string): Promise { + public getByRoomId(roomId: string, appId: string): Promise> { throw new Error('Method not implemented.'); } - public getByUserId(userId: string, appId: string): Promise { + public getByUserId(userId: string, appId: string): Promise> { throw new Error('Method not implemented.'); } }