From af37e1fa2988f07fdcf1c033fb18acd575b73f00 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:28:32 +0300 Subject: [PATCH 01/23] TypeScript config creates declarations for packages. --- _tools/tsconfig.json | 3 +-- broid-utils/tsconfig.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/_tools/tsconfig.json b/_tools/tsconfig.json index c36e8c4f..29d22c4e 100644 --- a/_tools/tsconfig.json +++ b/_tools/tsconfig.json @@ -1,7 +1,6 @@ { "compilerOptions": { - "removeComments": true, - "preserveConstEnums": true, + "declaration": true, "moduleResolution": "node", "target": "es2015", "module": "commonjs", diff --git a/broid-utils/tsconfig.json b/broid-utils/tsconfig.json index c36e8c4f..29d22c4e 100644 --- a/broid-utils/tsconfig.json +++ b/broid-utils/tsconfig.json @@ -1,7 +1,6 @@ { "compilerOptions": { - "removeComments": true, - "preserveConstEnums": true, + "declaration": true, "moduleResolution": "node", "target": "es2015", "module": "commonjs", From 5387c6f8edd270b17d2e39cecb11f0f9fa8defe9 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:28:53 +0300 Subject: [PATCH 02/23] d.ts for telegram --- broid-telegram/lib/core/Adapter.d.ts | 28 ++++++++++++++++++++++ broid-telegram/lib/core/Parser.d.ts | 14 +++++++++++ broid-telegram/lib/core/WebHookServer.d.ts | 15 ++++++++++++ broid-telegram/lib/core/index.d.ts | 2 ++ broid-telegram/lib/core/interfaces.d.ts | 11 +++++++++ broid-telegram/lib/test/Parser.d.ts | 0 broid-telegram/package.json | 1 + broid-telegram/src/core/interfaces.ts | 6 ++--- broid-telegram/yarn.lock | 12 ++-------- 9 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 broid-telegram/lib/core/Adapter.d.ts create mode 100644 broid-telegram/lib/core/Parser.d.ts create mode 100644 broid-telegram/lib/core/WebHookServer.d.ts create mode 100644 broid-telegram/lib/core/index.d.ts create mode 100644 broid-telegram/lib/core/interfaces.d.ts create mode 100644 broid-telegram/lib/test/Parser.d.ts diff --git a/broid-telegram/lib/core/Adapter.d.ts b/broid-telegram/lib/core/Adapter.d.ts new file mode 100644 index 00000000..72f6dc0a --- /dev/null +++ b/broid-telegram/lib/core/Adapter.d.ts @@ -0,0 +1,28 @@ +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private connected; + private serviceID; + private token; + private session; + private parser; + private logLevel; + private logger; + private router; + private webhookServer; + private webhookURL; + constructor(obj: IAdapterOptions); + users(): Promise; + channels(): Promise; + serviceId(): string; + serviceName(): string; + getRouter(): Router | null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; + private setupRouter(); +} diff --git a/broid-telegram/lib/core/Parser.d.ts b/broid-telegram/lib/core/Parser.d.ts new file mode 100644 index 00000000..09618264 --- /dev/null +++ b/broid-telegram/lib/core/Parser.d.ts @@ -0,0 +1,14 @@ +/// +import { IActivityStream } from '@broid/schemas'; +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + normalize(evt: any): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-telegram/lib/core/WebHookServer.d.ts b/broid-telegram/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..ce375f0f --- /dev/null +++ b/broid-telegram/lib/core/WebHookServer.d.ts @@ -0,0 +1,15 @@ +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-telegram/lib/core/index.d.ts b/broid-telegram/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-telegram/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-telegram/lib/core/interfaces.d.ts b/broid-telegram/lib/core/interfaces.d.ts new file mode 100644 index 00000000..82bbfe1e --- /dev/null +++ b/broid-telegram/lib/core/interfaces.d.ts @@ -0,0 +1,11 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + webhookURL: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; +} diff --git a/broid-telegram/lib/test/Parser.d.ts b/broid-telegram/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-telegram/package.json b/broid-telegram/package.json index 4c4e1f30..3010ddc9 100644 --- a/broid-telegram/package.json +++ b/broid-telegram/package.json @@ -2,6 +2,7 @@ "name": "@broid/telegram", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Telegram messages into Activity Streams 2 with Broid Integration", diff --git a/broid-telegram/src/core/interfaces.ts b/broid-telegram/src/core/interfaces.ts index 0b73dac5..e5829bbc 100644 --- a/broid-telegram/src/core/interfaces.ts +++ b/broid-telegram/src/core/interfaces.ts @@ -4,9 +4,9 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - logLevel: string; - http: IAdapterHTTPOptions; - serviceID: string; token: string; webhookURL: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; } diff --git a/broid-telegram/yarn.lock b/broid-telegram/yarn.lock index 02298e53..5563f575 100644 --- a/broid-telegram/yarn.lock +++ b/broid-telegram/yarn.lock @@ -31,11 +31,7 @@ version "3.5.2" resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.2.tgz#ecf1104217495e50fe0b588d538146cd6f733b89" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3844,11 +3840,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From e65d3967184473882fc154d730e75859f768e32f Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:29:02 +0300 Subject: [PATCH 03/23] d.ts for alexa --- broid-alexa/lib/core/Adapter.d.ts | 26 +++++++++++++++++++++++++ broid-alexa/lib/core/Parser.d.ts | 11 +++++++++++ broid-alexa/lib/core/WebHookServer.d.ts | 16 +++++++++++++++ broid-alexa/lib/core/index.d.ts | 2 ++ broid-alexa/lib/core/interfaces.d.ts | 24 +++++++++++++++++++++++ broid-alexa/lib/test/Adapter.d.ts | 0 broid-alexa/lib/test/Parser.d.ts | 0 broid-alexa/package.json | 1 + broid-alexa/src/core/interfaces.ts | 4 ++-- 9 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 broid-alexa/lib/core/Adapter.d.ts create mode 100644 broid-alexa/lib/core/Parser.d.ts create mode 100644 broid-alexa/lib/core/WebHookServer.d.ts create mode 100644 broid-alexa/lib/core/index.d.ts create mode 100644 broid-alexa/lib/core/interfaces.d.ts create mode 100644 broid-alexa/lib/test/Adapter.d.ts create mode 100644 broid-alexa/lib/test/Parser.d.ts diff --git a/broid-alexa/lib/core/Adapter.d.ts b/broid-alexa/lib/core/Adapter.d.ts new file mode 100644 index 00000000..b52a348a --- /dev/null +++ b/broid-alexa/lib/core/Adapter.d.ts @@ -0,0 +1,26 @@ +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapter, IAdapterOptions } from './interfaces'; +export declare class Adapter implements IAdapter { + private serviceID; + private connected; + private emitter; + private parser; + private logLevel; + private logger; + private router; + private webhookServer; + constructor(obj?: IAdapterOptions); + serviceName(): string; + getRouter(): Router | null; + users(): Promise | Error>; + channels(): Promise | Error>; + serviceId(): string; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: any): Promise; + private setupRouter(); +} diff --git a/broid-alexa/lib/core/Parser.d.ts b/broid-alexa/lib/core/Parser.d.ts new file mode 100644 index 00000000..ad1b8950 --- /dev/null +++ b/broid-alexa/lib/core/Parser.d.ts @@ -0,0 +1,11 @@ +/// +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + private createActivityStream(); +} diff --git a/broid-alexa/lib/core/WebHookServer.d.ts b/broid-alexa/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..4ca84a6b --- /dev/null +++ b/broid-alexa/lib/core/WebHookServer.d.ts @@ -0,0 +1,16 @@ +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + emitAsync: any; + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-alexa/lib/core/index.d.ts b/broid-alexa/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-alexa/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-alexa/lib/core/interfaces.d.ts b/broid-alexa/lib/core/interfaces.d.ts new file mode 100644 index 00000000..3ed3fa50 --- /dev/null +++ b/broid-alexa/lib/core/interfaces.d.ts @@ -0,0 +1,24 @@ +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + http?: IAdapterHTTPOptions; + logLevel?: string; + serviceID?: string; +} +export interface IAdapter { + serviceName(): string; + serviceId(): string; + getRouter(): Router | null; + users(): Promise | Error>; + channels(): Promise | Error>; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: any): Promise; +} diff --git a/broid-alexa/lib/test/Adapter.d.ts b/broid-alexa/lib/test/Adapter.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-alexa/lib/test/Parser.d.ts b/broid-alexa/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-alexa/package.json b/broid-alexa/package.json index eb08a190..db362266 100755 --- a/broid-alexa/package.json +++ b/broid-alexa/package.json @@ -2,6 +2,7 @@ "name": "@broid/alexa", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Alexa messages into Activity Streams 2 with Broid Integration", diff --git a/broid-alexa/src/core/interfaces.ts b/broid-alexa/src/core/interfaces.ts index a5ca9abd..51401928 100644 --- a/broid-alexa/src/core/interfaces.ts +++ b/broid-alexa/src/core/interfaces.ts @@ -9,8 +9,8 @@ export interface IAdapterHTTPOptions { export interface IAdapterOptions { http?: IAdapterHTTPOptions; - logLevel: string; - serviceID: string; + logLevel?: string; + serviceID?: string; } export interface IAdapter { From e381428fb69a3e5a97434a6eae6275535bde2a07 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:30:08 +0300 Subject: [PATCH 04/23] d.ts for callr --- broid-callr/lib/core/Adapter.d.ts | 30 +++++++++++++++++++++++++ broid-callr/lib/core/Parser.d.ts | 14 ++++++++++++ broid-callr/lib/core/WebHookServer.d.ts | 14 ++++++++++++ broid-callr/lib/core/index.d.ts | 2 ++ broid-callr/lib/core/interfaces.d.ts | 17 ++++++++++++++ broid-callr/lib/test/Parser.d.ts | 0 broid-callr/package.json | 1 + broid-callr/src/core/interfaces.ts | 6 ++--- broid-callr/yarn.lock | 12 ++-------- 9 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 broid-callr/lib/core/Adapter.d.ts create mode 100644 broid-callr/lib/core/Parser.d.ts create mode 100644 broid-callr/lib/core/WebHookServer.d.ts create mode 100644 broid-callr/lib/core/index.d.ts create mode 100644 broid-callr/lib/core/interfaces.d.ts create mode 100644 broid-callr/lib/test/Parser.d.ts diff --git a/broid-callr/lib/core/Adapter.d.ts b/broid-callr/lib/core/Adapter.d.ts new file mode 100644 index 00000000..d501ad1b --- /dev/null +++ b/broid-callr/lib/core/Adapter.d.ts @@ -0,0 +1,30 @@ +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private serviceID; + private token; + private tokenSecret; + private connected; + private emitter; + private session; + private parser; + private logLevel; + private username; + private logger; + private router; + private webhookServer; + private webhookURL; + constructor(obj: IAdapterOptions); + users(): Promise; + channels(): Promise; + serviceName(): string; + serviceId(): string; + getRouter(): Router; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; + private setupRouter(); +} diff --git a/broid-callr/lib/core/Parser.d.ts b/broid-callr/lib/core/Parser.d.ts new file mode 100644 index 00000000..a184e3d9 --- /dev/null +++ b/broid-callr/lib/core/Parser.d.ts @@ -0,0 +1,14 @@ +import { IActivityStream } from '@broid/schemas'; +import * as Promise from 'bluebird'; +import { ICallrWebHookEvent } from './interfaces'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + normalize(event: ICallrWebHookEvent): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-callr/lib/core/WebHookServer.d.ts b/broid-callr/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..6c713aee --- /dev/null +++ b/broid-callr/lib/core/WebHookServer.d.ts @@ -0,0 +1,14 @@ +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-callr/lib/core/index.d.ts b/broid-callr/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-callr/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-callr/lib/core/interfaces.d.ts b/broid-callr/lib/core/interfaces.d.ts new file mode 100644 index 00000000..e1cd65c8 --- /dev/null +++ b/broid-callr/lib/core/interfaces.d.ts @@ -0,0 +1,17 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + tokenSecret: string; + webhookURL: string; + logLevel?: string; + username?: string; + serviceID?: string; + http?: IAdapterHTTPOptions; +} +export interface ICallrWebHookEvent { + request: any; + response: any; +} diff --git a/broid-callr/lib/test/Parser.d.ts b/broid-callr/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-callr/package.json b/broid-callr/package.json index 87a4a7f4..1a0118bd 100644 --- a/broid-callr/package.json +++ b/broid-callr/package.json @@ -2,6 +2,7 @@ "name": "@broid/callr", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Callr messages into Activity Streams 2 with Broid Integration", diff --git a/broid-callr/src/core/interfaces.ts b/broid-callr/src/core/interfaces.ts index 4143f0cc..f5f74cdd 100644 --- a/broid-callr/src/core/interfaces.ts +++ b/broid-callr/src/core/interfaces.ts @@ -4,12 +4,12 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - logLevel: string; - serviceID: string; token: string; tokenSecret: string; - username: string; webhookURL: string; + logLevel?: string; + username?: string; + serviceID?: string; http?: IAdapterHTTPOptions; } diff --git a/broid-callr/yarn.lock b/broid-callr/yarn.lock index c771c2be..ecc4d0b9 100644 --- a/broid-callr/yarn.lock +++ b/broid-callr/yarn.lock @@ -21,11 +21,7 @@ request "^2.81.0" valid-url "^1.0.9" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3792,11 +3788,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From 4b28e4f677d748d8c1c7b507d736b17549925005 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:31:41 +0300 Subject: [PATCH 05/23] d.ts for discord --- broid-discord/lib/core/Adapter.d.ts | 23 +++++++++++++++++++++++ broid-discord/lib/core/Parser.d.ts | 12 ++++++++++++ broid-discord/lib/core/index.d.ts | 2 ++ broid-discord/lib/core/interfaces.d.ts | 17 +++++++++++++++++ broid-discord/lib/test/Parser.d.ts | 0 broid-discord/package.json | 1 + broid-discord/src/core/interfaces.ts | 4 ++-- broid-discord/yarn.lock | 12 ++---------- 8 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 broid-discord/lib/core/Adapter.d.ts create mode 100644 broid-discord/lib/core/Parser.d.ts create mode 100644 broid-discord/lib/core/index.d.ts create mode 100644 broid-discord/lib/core/interfaces.d.ts create mode 100644 broid-discord/lib/test/Parser.d.ts diff --git a/broid-discord/lib/core/Adapter.d.ts b/broid-discord/lib/core/Adapter.d.ts new file mode 100644 index 00000000..4ae0bcfd --- /dev/null +++ b/broid-discord/lib/core/Adapter.d.ts @@ -0,0 +1,23 @@ +/// +import * as Promise from 'bluebird'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + serviceID: string; + token: string | null; + private connected; + private session; + private parser; + private logLevel; + private logger; + constructor(obj?: IAdapterOptions); + users(): Promise; + channels(): Promise; + serviceId(): string; + serviceName(): string; + getRouter(): null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; +} diff --git a/broid-discord/lib/core/Parser.d.ts b/broid-discord/lib/core/Parser.d.ts new file mode 100644 index 00000000..5d48888e --- /dev/null +++ b/broid-discord/lib/core/Parser.d.ts @@ -0,0 +1,12 @@ +/// +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + private parseMedia(media, content); + private createActivityStream(normalized); +} diff --git a/broid-discord/lib/core/index.d.ts b/broid-discord/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-discord/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-discord/lib/core/interfaces.d.ts b/broid-discord/lib/core/interfaces.d.ts new file mode 100644 index 00000000..8f1fc2b2 --- /dev/null +++ b/broid-discord/lib/core/interfaces.d.ts @@ -0,0 +1,17 @@ +export interface IAdapterOptions { + token: string; + serviceID?: string; + logLevel?: string; +} +export interface IUserInformations { + readonly id: string; + readonly username: string; + readonly is_bot: boolean; + readonly avatar: string; +} +export interface IChannelInformations { + readonly guildID: string; + readonly id: string; + readonly name: string; + readonly topic: string; +} diff --git a/broid-discord/lib/test/Parser.d.ts b/broid-discord/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-discord/package.json b/broid-discord/package.json index c83e4a9a..0703b719 100644 --- a/broid-discord/package.json +++ b/broid-discord/package.json @@ -2,6 +2,7 @@ "name": "@broid/discord", "version": "2.2.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Discord messages into Activity Streams 2 with Broid Integration", diff --git a/broid-discord/src/core/interfaces.ts b/broid-discord/src/core/interfaces.ts index 03543f12..f2f71d55 100644 --- a/broid-discord/src/core/interfaces.ts +++ b/broid-discord/src/core/interfaces.ts @@ -1,7 +1,7 @@ export interface IAdapterOptions { token: string; - serviceID: string; - logLevel: string; + serviceID?: string; + logLevel?: string; } export interface IUserInformations { diff --git a/broid-discord/yarn.lock b/broid-discord/yarn.lock index 35905ed0..f6009358 100644 --- a/broid-discord/yarn.lock +++ b/broid-discord/yarn.lock @@ -31,11 +31,7 @@ version "3.5.2" resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.2.tgz#ecf1104217495e50fe0b588d538146cd6f733b89" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3675,11 +3671,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From b15b11340577afe9145ee267d2657418dd95fc49 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:32:45 +0300 Subject: [PATCH 06/23] d.ts for flowdock --- broid-flowdock/lib/core/Adapter.d.ts | 26 +++++++++++++++++++++++++ broid-flowdock/lib/core/Parser.d.ts | 11 +++++++++++ broid-flowdock/lib/core/index.d.ts | 2 ++ broid-flowdock/lib/core/interfaces.d.ts | 5 +++++ broid-flowdock/lib/test/Parser.d.ts | 0 broid-flowdock/package.json | 1 + broid-flowdock/src/core/interfaces.ts | 4 ++-- broid-flowdock/yarn.lock | 12 ++---------- 8 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 broid-flowdock/lib/core/Adapter.d.ts create mode 100644 broid-flowdock/lib/core/Parser.d.ts create mode 100644 broid-flowdock/lib/core/index.d.ts create mode 100644 broid-flowdock/lib/core/interfaces.d.ts create mode 100644 broid-flowdock/lib/test/Parser.d.ts diff --git a/broid-flowdock/lib/core/Adapter.d.ts b/broid-flowdock/lib/core/Adapter.d.ts new file mode 100644 index 00000000..91e91e32 --- /dev/null +++ b/broid-flowdock/lib/core/Adapter.d.ts @@ -0,0 +1,26 @@ +import * as Promise from 'bluebird'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private connected; + private serviceID; + private token; + private session; + private parser; + private logLevel; + private logger; + private storeUsers; + private storeFlows; + constructor(obj?: IAdapterOptions); + users(): Promise>; + channels(): Promise>; + serviceId(): string; + serviceName(): string; + getRouter(): null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: any): Promise; + private userByID(userID); + private flowByID(flowID); +} diff --git a/broid-flowdock/lib/core/Parser.d.ts b/broid-flowdock/lib/core/Parser.d.ts new file mode 100644 index 00000000..0e60ab48 --- /dev/null +++ b/broid-flowdock/lib/core/Parser.d.ts @@ -0,0 +1,11 @@ +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-flowdock/lib/core/index.d.ts b/broid-flowdock/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-flowdock/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-flowdock/lib/core/interfaces.d.ts b/broid-flowdock/lib/core/interfaces.d.ts new file mode 100644 index 00000000..06a1fa73 --- /dev/null +++ b/broid-flowdock/lib/core/interfaces.d.ts @@ -0,0 +1,5 @@ +export interface IAdapterOptions { + token: string; + serviceID?: string; + logLevel?: string; +} diff --git a/broid-flowdock/lib/test/Parser.d.ts b/broid-flowdock/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-flowdock/package.json b/broid-flowdock/package.json index 4ec11f0d..f5b82439 100644 --- a/broid-flowdock/package.json +++ b/broid-flowdock/package.json @@ -2,6 +2,7 @@ "name": "@broid/flowdock", "version": "2.2.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Flowdock messages into Activity Streams 2 with Broid Integration", diff --git a/broid-flowdock/src/core/interfaces.ts b/broid-flowdock/src/core/interfaces.ts index bce629ca..5cd016ba 100644 --- a/broid-flowdock/src/core/interfaces.ts +++ b/broid-flowdock/src/core/interfaces.ts @@ -1,5 +1,5 @@ export interface IAdapterOptions { token: string; - serviceID: string; - logLevel: string; + serviceID?: string; + logLevel?: string; } diff --git a/broid-flowdock/yarn.lock b/broid-flowdock/yarn.lock index 1f00a335..689d9a31 100644 --- a/broid-flowdock/yarn.lock +++ b/broid-flowdock/yarn.lock @@ -21,11 +21,7 @@ request "^2.81.0" valid-url "^1.0.9" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3662,11 +3658,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From 28796c738bed99fb676b61090737888bcaca940b Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:33:48 +0300 Subject: [PATCH 07/23] d.ts for gitter --- broid-gitter/lib/core/Adapter.d.ts | 25 +++++++++++++++++++++++++ broid-gitter/lib/core/Parser.d.ts | 11 +++++++++++ broid-gitter/lib/core/index.d.ts | 2 ++ broid-gitter/lib/core/interfaces.d.ts | 5 +++++ broid-gitter/lib/test/Parser.d.ts | 0 broid-gitter/package.json | 1 + broid-gitter/src/core/interfaces.ts | 4 ++-- broid-gitter/yarn.lock | 12 ++---------- 8 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 broid-gitter/lib/core/Adapter.d.ts create mode 100644 broid-gitter/lib/core/Parser.d.ts create mode 100644 broid-gitter/lib/core/index.d.ts create mode 100644 broid-gitter/lib/core/interfaces.d.ts create mode 100644 broid-gitter/lib/test/Parser.d.ts diff --git a/broid-gitter/lib/core/Adapter.d.ts b/broid-gitter/lib/core/Adapter.d.ts new file mode 100644 index 00000000..538910a5 --- /dev/null +++ b/broid-gitter/lib/core/Adapter.d.ts @@ -0,0 +1,25 @@ +import * as Promise from 'bluebird'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private ee; + private logLevel; + private logger; + private connected; + private me; + private parser; + private serviceID; + private session; + private token; + constructor(obj?: IAdapterOptions); + users(): Promise; + channels(): Promise; + serviceName(): string; + serviceId(): string; + getRouter(): null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: any): Promise; + private joinRoom(room); +} diff --git a/broid-gitter/lib/core/Parser.d.ts b/broid-gitter/lib/core/Parser.d.ts new file mode 100644 index 00000000..5e86e92b --- /dev/null +++ b/broid-gitter/lib/core/Parser.d.ts @@ -0,0 +1,11 @@ +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-gitter/lib/core/index.d.ts b/broid-gitter/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-gitter/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-gitter/lib/core/interfaces.d.ts b/broid-gitter/lib/core/interfaces.d.ts new file mode 100644 index 00000000..fb16b27d --- /dev/null +++ b/broid-gitter/lib/core/interfaces.d.ts @@ -0,0 +1,5 @@ +export interface IAdapterOptions { + token: string; + logLevel?: string; + serviceID?: string; +} diff --git a/broid-gitter/lib/test/Parser.d.ts b/broid-gitter/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-gitter/package.json b/broid-gitter/package.json index 9428b74b..db60012f 100755 --- a/broid-gitter/package.json +++ b/broid-gitter/package.json @@ -2,6 +2,7 @@ "name": "@broid/gitter", "version": "2.2.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Gitter messages into Activity Streams 2 with Broid Integration", diff --git a/broid-gitter/src/core/interfaces.ts b/broid-gitter/src/core/interfaces.ts index b80a00f4..55037c7e 100644 --- a/broid-gitter/src/core/interfaces.ts +++ b/broid-gitter/src/core/interfaces.ts @@ -1,5 +1,5 @@ export interface IAdapterOptions { - logLevel: string; - serviceID: string; token: string; + logLevel?: string; + serviceID?: string; } diff --git a/broid-gitter/yarn.lock b/broid-gitter/yarn.lock index b5dca89b..53718b98 100644 --- a/broid-gitter/yarn.lock +++ b/broid-gitter/yarn.lock @@ -53,11 +53,7 @@ request "^2.81.0" valid-url "^1.0.9" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3405,11 +3401,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From 653a80e33e57b39223da048bc0e1aea1e4988c12 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:34:42 +0300 Subject: [PATCH 08/23] d.ts for google-assistant --- broid-google-assistant/lib/core/Adapter.d.ts | 33 +++++++++++++++++++ broid-google-assistant/lib/core/Parser.d.ts | 14 ++++++++ .../lib/core/WebHookServer.d.ts | 15 +++++++++ broid-google-assistant/lib/core/index.d.ts | 2 ++ .../lib/core/interfaces.d.ts | 12 +++++++ broid-google-assistant/lib/test/Parser.d.ts | 0 broid-google-assistant/package.json | 1 + broid-google-assistant/src/core/interfaces.ts | 8 ++--- broid-google-assistant/yarn.lock | 12 ++----- 9 files changed, 83 insertions(+), 14 deletions(-) create mode 100644 broid-google-assistant/lib/core/Adapter.d.ts create mode 100644 broid-google-assistant/lib/core/Parser.d.ts create mode 100644 broid-google-assistant/lib/core/WebHookServer.d.ts create mode 100644 broid-google-assistant/lib/core/index.d.ts create mode 100644 broid-google-assistant/lib/core/interfaces.d.ts create mode 100644 broid-google-assistant/lib/test/Parser.d.ts diff --git a/broid-google-assistant/lib/core/Adapter.d.ts b/broid-google-assistant/lib/core/Adapter.d.ts new file mode 100644 index 00000000..e4880a62 --- /dev/null +++ b/broid-google-assistant/lib/core/Adapter.d.ts @@ -0,0 +1,33 @@ +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private assistant; + private actionsMap; + private serviceID; + private token; + private tokenSecret; + private connected; + private emitter; + private parser; + private logLevel; + private username; + private logger; + private router; + private webhookServer; + constructor(obj: IAdapterOptions); + serviceName(): string; + users(): Promise; + channels(): Promise; + serviceId(): string; + getRouter(): Router | null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; + private addIntent(trigger); + private setupRouter(); + private sendMessage(isSSML, content, noInputs); +} diff --git a/broid-google-assistant/lib/core/Parser.d.ts b/broid-google-assistant/lib/core/Parser.d.ts new file mode 100644 index 00000000..1e1b2c03 --- /dev/null +++ b/broid-google-assistant/lib/core/Parser.d.ts @@ -0,0 +1,14 @@ +/// +import * as actionsSdk from 'actions-on-google'; +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + private username; + constructor(serviceName: string, serviceID: string, username: string, logLevel: string); + validate(event: any): Promise; + parse(event: actionsSdk.ActionsSdkAssistant): Promise; + private createIdentifier(); + private createActivityStream(); +} diff --git a/broid-google-assistant/lib/core/WebHookServer.d.ts b/broid-google-assistant/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..ce375f0f --- /dev/null +++ b/broid-google-assistant/lib/core/WebHookServer.d.ts @@ -0,0 +1,15 @@ +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-google-assistant/lib/core/index.d.ts b/broid-google-assistant/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-google-assistant/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-google-assistant/lib/core/interfaces.d.ts b/broid-google-assistant/lib/core/interfaces.d.ts new file mode 100644 index 00000000..fa017927 --- /dev/null +++ b/broid-google-assistant/lib/core/interfaces.d.ts @@ -0,0 +1,12 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + tokenSecret: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; + username?: string; +} diff --git a/broid-google-assistant/lib/test/Parser.d.ts b/broid-google-assistant/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-google-assistant/package.json b/broid-google-assistant/package.json index bb8eaf27..1303e2f8 100755 --- a/broid-google-assistant/package.json +++ b/broid-google-assistant/package.json @@ -2,6 +2,7 @@ "name": "@broid/google-assistant", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Google Assistant messages into Activity Streams 2 with Broid Integration", diff --git a/broid-google-assistant/src/core/interfaces.ts b/broid-google-assistant/src/core/interfaces.ts index c5284bcc..1d4ec5ea 100644 --- a/broid-google-assistant/src/core/interfaces.ts +++ b/broid-google-assistant/src/core/interfaces.ts @@ -4,10 +4,10 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - logLevel: string; - http?: IAdapterHTTPOptions; - serviceID: string; token: string; tokenSecret: string; - username: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; + username?: string; } diff --git a/broid-google-assistant/yarn.lock b/broid-google-assistant/yarn.lock index 5988d527..db76feae 100644 --- a/broid-google-assistant/yarn.lock +++ b/broid-google-assistant/yarn.lock @@ -63,11 +63,7 @@ version "3.5.2" resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.2.tgz#ecf1104217495e50fe0b588d538146cd6f733b89" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3626,11 +3622,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From 9fc40af6da53ceaab683f79d184acf544d1f7b35 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:35:34 +0300 Subject: [PATCH 09/23] d.ts for groupme --- broid-groupme/lib/core/Adapter.d.ts | 29 +++++++++++++ broid-groupme/lib/core/Parser.d.ts | 12 +++++ broid-groupme/lib/core/WebHookServer.d.ts | 15 +++++++ broid-groupme/lib/core/client.d.ts | 4 ++ broid-groupme/lib/core/index.d.ts | 2 + broid-groupme/lib/core/interfaces.d.ts | 53 +++++++++++++++++++++++ broid-groupme/lib/test/Parser.d.ts | 0 broid-groupme/package.json | 1 + broid-groupme/src/core/interfaces.ts | 6 +-- broid-groupme/yarn.lock | 12 +---- 10 files changed, 121 insertions(+), 13 deletions(-) create mode 100644 broid-groupme/lib/core/Adapter.d.ts create mode 100644 broid-groupme/lib/core/Parser.d.ts create mode 100644 broid-groupme/lib/core/WebHookServer.d.ts create mode 100644 broid-groupme/lib/core/client.d.ts create mode 100644 broid-groupme/lib/core/index.d.ts create mode 100644 broid-groupme/lib/core/interfaces.d.ts create mode 100644 broid-groupme/lib/test/Parser.d.ts diff --git a/broid-groupme/lib/core/Adapter.d.ts b/broid-groupme/lib/core/Adapter.d.ts new file mode 100644 index 00000000..3fa0d889 --- /dev/null +++ b/broid-groupme/lib/core/Adapter.d.ts @@ -0,0 +1,29 @@ +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private serviceID; + private username; + private token; + private tokenSecret; + private connected; + private emitter; + private parser; + private logLevel; + private logger; + private router; + private webhookServer; + constructor(obj: IAdapterOptions); + serviceName(): string; + getRouter(): Router | null; + users(): Promise; + channels(): Promise; + serviceId(): string; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: any): Promise; + private setupRouter(); +} diff --git a/broid-groupme/lib/core/Parser.d.ts b/broid-groupme/lib/core/Parser.d.ts new file mode 100644 index 00000000..5cb0d11f --- /dev/null +++ b/broid-groupme/lib/core/Parser.d.ts @@ -0,0 +1,12 @@ +/// +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-groupme/lib/core/WebHookServer.d.ts b/broid-groupme/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..ce375f0f --- /dev/null +++ b/broid-groupme/lib/core/WebHookServer.d.ts @@ -0,0 +1,15 @@ +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-groupme/lib/core/client.d.ts b/broid-groupme/lib/core/client.d.ts new file mode 100644 index 00000000..b4d55792 --- /dev/null +++ b/broid-groupme/lib/core/client.d.ts @@ -0,0 +1,4 @@ +export declare function getMessages(token: string, groupId: string): Promise; +export declare function getMembers(token: string, groupId: string): Promise; +export declare function getGroups(token: string): Promise; +export declare function postMessage(token: string, payload: any): Promise; diff --git a/broid-groupme/lib/core/index.d.ts b/broid-groupme/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-groupme/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-groupme/lib/core/interfaces.d.ts b/broid-groupme/lib/core/interfaces.d.ts new file mode 100644 index 00000000..622f0838 --- /dev/null +++ b/broid-groupme/lib/core/interfaces.d.ts @@ -0,0 +1,53 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + tokenSecret: string; + username: string; + http?: IAdapterHTTPOptions; + logLevel?: string; + serviceID?: string; +} +export interface IAttachment { + type: string; + url?: string; + lat?: string; + lng?: string; + name?: string; + token: string; + placeholder?: string; + charmap?: number[][]; +} +export interface IMessageParams { + text: string; + attachments: IAttachment[]; +} +export interface IMessage extends IMessageParams { + id: string; + source_guid: string; + sender_id: string; + sender_type: string; + created_at: number; + user_id: string; + group_id: string; + name: string; + avatar_url: string; + system: boolean; + favorited_by: string[]; + recipient_id?: string; +} +export interface IMemberParsed { + avatar: string; + id: string; + username: string; +} +export interface IGroupParsed { + created_at: number; + id: string; + name: string; + members: IMemberParsed[]; + updated_at: number; + type: string; +} diff --git a/broid-groupme/lib/test/Parser.d.ts b/broid-groupme/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-groupme/package.json b/broid-groupme/package.json index eec733c9..062de874 100644 --- a/broid-groupme/package.json +++ b/broid-groupme/package.json @@ -2,6 +2,7 @@ "name": "@broid/groupme", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert GroupMe messages into Activity Streams 2 with Broid Integration", diff --git a/broid-groupme/src/core/interfaces.ts b/broid-groupme/src/core/interfaces.ts index 42fd8445..89b2a86b 100644 --- a/broid-groupme/src/core/interfaces.ts +++ b/broid-groupme/src/core/interfaces.ts @@ -4,12 +4,12 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - http?: IAdapterHTTPOptions; - logLevel: string; - serviceID: string; token: string; tokenSecret: string; username: string; + http?: IAdapterHTTPOptions; + logLevel?: string; + serviceID?: string; } export interface IAttachment { diff --git a/broid-groupme/yarn.lock b/broid-groupme/yarn.lock index 05b6fe4d..5cbb856d 100644 --- a/broid-groupme/yarn.lock +++ b/broid-groupme/yarn.lock @@ -69,11 +69,7 @@ dependencies: moment "*" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3701,11 +3697,7 @@ uuid@^2.0.1, uuid@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From cbbf6bd12798f7bc0e8ece8f1e26f78328928ebd Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:36:35 +0300 Subject: [PATCH 10/23] d.ts for irc --- broid-irc/lib/core/Adapter.d.ts | 28 ++++++++++++++++++++++++++++ broid-irc/lib/core/Parser.d.ts | 11 +++++++++++ broid-irc/lib/core/index.d.ts | 2 ++ broid-irc/lib/core/interfaces.d.ts | 8 ++++++++ broid-irc/lib/test/Parser.d.ts | 0 broid-irc/package.json | 1 + broid-irc/yarn.lock | 6 +----- 7 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 broid-irc/lib/core/Adapter.d.ts create mode 100644 broid-irc/lib/core/Parser.d.ts create mode 100644 broid-irc/lib/core/index.d.ts create mode 100644 broid-irc/lib/core/interfaces.d.ts create mode 100644 broid-irc/lib/test/Parser.d.ts diff --git a/broid-irc/lib/core/Adapter.d.ts b/broid-irc/lib/core/Adapter.d.ts new file mode 100644 index 00000000..5bf428ae --- /dev/null +++ b/broid-irc/lib/core/Adapter.d.ts @@ -0,0 +1,28 @@ +/// +import { ISendParameters } from '@broid/schemas'; +import * as Promise from 'bluebird'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + serviceID: string; + private connected; + private address; + private username; + private ircChannels; + private client; + private logLevel; + private connectTimeout; + private logger; + private ee; + private parser; + constructor(obj: IAdapterOptions); + serviceName(): string; + serviceId(): string; + getRouter(): null; + users(): Promise; + channels(): Promise; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: ISendParameters): Promise; +} diff --git a/broid-irc/lib/core/Parser.d.ts b/broid-irc/lib/core/Parser.d.ts new file mode 100644 index 00000000..98f54968 --- /dev/null +++ b/broid-irc/lib/core/Parser.d.ts @@ -0,0 +1,11 @@ +/// +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + private username; + constructor(serviceName: string, username: string, serviceID: string, logLevel: string); + validate(event: object | null): Promise; + parse(event: object | null): Promise; +} diff --git a/broid-irc/lib/core/index.d.ts b/broid-irc/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-irc/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-irc/lib/core/interfaces.d.ts b/broid-irc/lib/core/interfaces.d.ts new file mode 100644 index 00000000..3067a03c --- /dev/null +++ b/broid-irc/lib/core/interfaces.d.ts @@ -0,0 +1,8 @@ +export interface IAdapterOptions { + address: string; + username: string; + channels: string[]; + serviceID?: string; + logLevel?: string; + connectTimeout?: number; +} diff --git a/broid-irc/lib/test/Parser.d.ts b/broid-irc/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-irc/package.json b/broid-irc/package.json index 382ba127..67550afa 100644 --- a/broid-irc/package.json +++ b/broid-irc/package.json @@ -2,6 +2,7 @@ "name": "@broid/irc", "version": "2.2.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert IRC messages into Activity Streams 2 with Broid Integration", diff --git a/broid-irc/yarn.lock b/broid-irc/yarn.lock index f974853b..64c33479 100644 --- a/broid-irc/yarn.lock +++ b/broid-irc/yarn.lock @@ -3402,11 +3402,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From 9c3d94bb38ddaf8e177aaca8adaff9175a37a08d Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:37:42 +0300 Subject: [PATCH 11/23] d.ts for kik --- broid-kik/lib/core/Adapter.d.ts | 30 +++++++++++++++++++++++++++ broid-kik/lib/core/Parser.d.ts | 14 +++++++++++++ broid-kik/lib/core/WebHookServer.d.ts | 15 ++++++++++++++ broid-kik/lib/core/index.d.ts | 2 ++ broid-kik/lib/core/interfaces.d.ts | 12 +++++++++++ broid-kik/lib/test/Parser.d.ts | 0 broid-kik/package.json | 1 + broid-kik/src/core/interfaces.ts | 8 +++---- broid-kik/yarn.lock | 12 ++--------- 9 files changed, 80 insertions(+), 14 deletions(-) create mode 100644 broid-kik/lib/core/Adapter.d.ts create mode 100644 broid-kik/lib/core/Parser.d.ts create mode 100644 broid-kik/lib/core/WebHookServer.d.ts create mode 100644 broid-kik/lib/core/index.d.ts create mode 100644 broid-kik/lib/core/interfaces.d.ts create mode 100644 broid-kik/lib/test/Parser.d.ts diff --git a/broid-kik/lib/core/Adapter.d.ts b/broid-kik/lib/core/Adapter.d.ts new file mode 100644 index 00000000..106ddffb --- /dev/null +++ b/broid-kik/lib/core/Adapter.d.ts @@ -0,0 +1,30 @@ +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private serviceID; + private token; + private connected; + private session; + private parser; + private logLevel; + private username; + private logger; + private router; + private webhookServer; + private webhookURL; + private storeUsers; + constructor(obj: IAdapterOptions); + users(): Promise>; + channels(): Promise; + serviceName(): string; + serviceId(): string; + getRouter(): Router | null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; + private user(key, cache?); +} diff --git a/broid-kik/lib/core/Parser.d.ts b/broid-kik/lib/core/Parser.d.ts new file mode 100644 index 00000000..22f7546f --- /dev/null +++ b/broid-kik/lib/core/Parser.d.ts @@ -0,0 +1,14 @@ +/// +import { IActivityStream } from '@broid/schemas'; +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + normalize(event: any, userInformation: any): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-kik/lib/core/WebHookServer.d.ts b/broid-kik/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..ce375f0f --- /dev/null +++ b/broid-kik/lib/core/WebHookServer.d.ts @@ -0,0 +1,15 @@ +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-kik/lib/core/index.d.ts b/broid-kik/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-kik/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-kik/lib/core/interfaces.d.ts b/broid-kik/lib/core/interfaces.d.ts new file mode 100644 index 00000000..11a07e25 --- /dev/null +++ b/broid-kik/lib/core/interfaces.d.ts @@ -0,0 +1,12 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + webhookURL: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; + username?: string; +} diff --git a/broid-kik/lib/test/Parser.d.ts b/broid-kik/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-kik/package.json b/broid-kik/package.json index 11ea2bbb..bda4f787 100644 --- a/broid-kik/package.json +++ b/broid-kik/package.json @@ -2,6 +2,7 @@ "name": "@broid/kik", "version": "2.2.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Kik messages into Activity Streams 2 with Broid Integration", diff --git a/broid-kik/src/core/interfaces.ts b/broid-kik/src/core/interfaces.ts index 88584bc6..1fb23905 100644 --- a/broid-kik/src/core/interfaces.ts +++ b/broid-kik/src/core/interfaces.ts @@ -4,10 +4,10 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - logLevel: string; - http: IAdapterHTTPOptions; - serviceID: string; token: string; - username: string; webhookURL: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; + username?: string; } diff --git a/broid-kik/yarn.lock b/broid-kik/yarn.lock index c95ca2d7..200e7299 100644 --- a/broid-kik/yarn.lock +++ b/broid-kik/yarn.lock @@ -38,11 +38,7 @@ version "3.5.3" resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.3.tgz#a2c28be02c0855f526e43785fa326f282402e290" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" @@ -3779,11 +3775,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From fcafed351279885cd7f9f64fe8b7ced2ea5f6505 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:38:33 +0300 Subject: [PATCH 12/23] d.ts for line --- broid-line/lib/core/Adapter.d.ts | 29 ++++++++++++++++++++++++++ broid-line/lib/core/Parser.d.ts | 15 +++++++++++++ broid-line/lib/core/WebHookServer.d.ts | 15 +++++++++++++ broid-line/lib/core/index.d.ts | 2 ++ broid-line/lib/core/interfaces.d.ts | 16 ++++++++++++++ broid-line/lib/test/Parser.d.ts | 0 broid-line/package.json | 1 + broid-line/src/core/interfaces.ts | 6 +++--- broid-line/yarn.lock | 12 ++--------- 9 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 broid-line/lib/core/Adapter.d.ts create mode 100644 broid-line/lib/core/Parser.d.ts create mode 100644 broid-line/lib/core/WebHookServer.d.ts create mode 100644 broid-line/lib/core/index.d.ts create mode 100644 broid-line/lib/core/interfaces.d.ts create mode 100644 broid-line/lib/test/Parser.d.ts diff --git a/broid-line/lib/core/Adapter.d.ts b/broid-line/lib/core/Adapter.d.ts new file mode 100644 index 00000000..e66997e1 --- /dev/null +++ b/broid-line/lib/core/Adapter.d.ts @@ -0,0 +1,29 @@ +/// +import * as Promise from 'bluebird'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private connected; + private logLevel; + private logger; + private parser; + private router; + private serviceID; + private session; + private storeUsers; + private token; + private tokenSecret; + private username; + private webhookServer; + constructor(obj: IAdapterOptions); + users(): Promise>; + channels(): Promise; + serviceName(): string; + serviceId(): string; + getRouter(): null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; + private user(key, cache?); +} diff --git a/broid-line/lib/core/Parser.d.ts b/broid-line/lib/core/Parser.d.ts new file mode 100644 index 00000000..d66aae13 --- /dev/null +++ b/broid-line/lib/core/Parser.d.ts @@ -0,0 +1,15 @@ +/// +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + normalize(event: any): Promise; + private createIdentifier(); + private createActivityStream(normalized); + private createAuthor(source); + private createTarget(source); +} diff --git a/broid-line/lib/core/WebHookServer.d.ts b/broid-line/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..ce375f0f --- /dev/null +++ b/broid-line/lib/core/WebHookServer.d.ts @@ -0,0 +1,15 @@ +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-line/lib/core/index.d.ts b/broid-line/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-line/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-line/lib/core/interfaces.d.ts b/broid-line/lib/core/interfaces.d.ts new file mode 100644 index 00000000..2080232f --- /dev/null +++ b/broid-line/lib/core/interfaces.d.ts @@ -0,0 +1,16 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + tokenSecret: string; + username: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; +} +export interface IWebHookEvent { + response: any; + request: any; +} diff --git a/broid-line/lib/test/Parser.d.ts b/broid-line/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-line/package.json b/broid-line/package.json index 62367918..36f34395 100644 --- a/broid-line/package.json +++ b/broid-line/package.json @@ -2,6 +2,7 @@ "name": "@broid/line", "version": "2.2.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Line messages into Activity Streams 2 with Broid Integration", diff --git a/broid-line/src/core/interfaces.ts b/broid-line/src/core/interfaces.ts index d9d8fbb4..17d0d199 100644 --- a/broid-line/src/core/interfaces.ts +++ b/broid-line/src/core/interfaces.ts @@ -4,12 +4,12 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - logLevel: string; - http: IAdapterHTTPOptions; - serviceID: string; token: string; tokenSecret: string; username: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; } export interface IWebHookEvent { diff --git a/broid-line/yarn.lock b/broid-line/yarn.lock index 3e32bc56..7190fdbf 100644 --- a/broid-line/yarn.lock +++ b/broid-line/yarn.lock @@ -31,11 +31,7 @@ version "3.5.2" resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.2.tgz#ecf1104217495e50fe0b588d538146cd6f733b89" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3759,11 +3755,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From 87cf77dd2206c44895fa0958cf64f853fb2be648 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:39:37 +0300 Subject: [PATCH 13/23] d.ts for messenger --- broid-messenger/lib/core/Adapter.d.ts | 31 +++++++++++++++++++++ broid-messenger/lib/core/Parser.d.ts | 16 +++++++++++ broid-messenger/lib/core/WebHookServer.d.ts | 15 ++++++++++ broid-messenger/lib/core/helpers.d.ts | 7 +++++ broid-messenger/lib/core/index.d.ts | 2 ++ broid-messenger/lib/core/interfaces.d.ts | 16 +++++++++++ broid-messenger/lib/test/Parser.d.ts | 0 broid-messenger/package.json | 1 + broid-messenger/src/core/interfaces.ts | 6 ++-- broid-messenger/yarn.lock | 12 +++----- 10 files changed, 95 insertions(+), 11 deletions(-) create mode 100644 broid-messenger/lib/core/Adapter.d.ts create mode 100644 broid-messenger/lib/core/Parser.d.ts create mode 100644 broid-messenger/lib/core/WebHookServer.d.ts create mode 100644 broid-messenger/lib/core/helpers.d.ts create mode 100644 broid-messenger/lib/core/index.d.ts create mode 100644 broid-messenger/lib/core/interfaces.d.ts create mode 100644 broid-messenger/lib/test/Parser.d.ts diff --git a/broid-messenger/lib/core/Adapter.d.ts b/broid-messenger/lib/core/Adapter.d.ts new file mode 100644 index 00000000..46b37a8a --- /dev/null +++ b/broid-messenger/lib/core/Adapter.d.ts @@ -0,0 +1,31 @@ +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private connected; + private emitter; + private logLevel; + private logger; + private parser; + private router; + private serviceID; + private storeUsers; + private token; + private tokenSecret; + private consumerSecret; + private webhookServer; + constructor(obj: IAdapterOptions); + users(): Promise>; + channels(): Promise; + serviceId(): string; + serviceName(): string; + getRouter(): Router | null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; + private user(id, fields?, cache?); + private setupRouter(); +} diff --git a/broid-messenger/lib/core/Parser.d.ts b/broid-messenger/lib/core/Parser.d.ts new file mode 100644 index 00000000..46049a8d --- /dev/null +++ b/broid-messenger/lib/core/Parser.d.ts @@ -0,0 +1,16 @@ +/// +import { IActivityStream } from '@broid/schemas'; +import * as Promise from 'bluebird'; +import { IWebHookEvent } from './interfaces'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + normalize(event: IWebHookEvent): Promise; + private createIdentifier(); + private createActivityStream(normalized); + private parseAttachment(attachment); +} diff --git a/broid-messenger/lib/core/WebHookServer.d.ts b/broid-messenger/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..ce375f0f --- /dev/null +++ b/broid-messenger/lib/core/WebHookServer.d.ts @@ -0,0 +1,15 @@ +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-messenger/lib/core/helpers.d.ts b/broid-messenger/lib/core/helpers.d.ts new file mode 100644 index 00000000..f96b0fbe --- /dev/null +++ b/broid-messenger/lib/core/helpers.d.ts @@ -0,0 +1,7 @@ +export declare function isXHubSignatureValid(request: any, secret: string): boolean; +export declare function parseQuickReplies(quickReplies: any[]): any[]; +export declare function createQuickReplies(buttons: any[]): any[]; +export declare function createButtons(buttons: any[]): any[]; +export declare function createElement(data: any): any; +export declare function createCard(name: string, content: string, buttons?: any[], imageURL?: any): object; +export declare function createTextWithButtons(name: string, content: string, buttons?: any[]): object; diff --git a/broid-messenger/lib/core/index.d.ts b/broid-messenger/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-messenger/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-messenger/lib/core/interfaces.d.ts b/broid-messenger/lib/core/interfaces.d.ts new file mode 100644 index 00000000..4ef1eb9d --- /dev/null +++ b/broid-messenger/lib/core/interfaces.d.ts @@ -0,0 +1,16 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + tokenSecret: string; + consumerSecret: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; +} +export interface IWebHookEvent { + response: any; + request: any; +} diff --git a/broid-messenger/lib/test/Parser.d.ts b/broid-messenger/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-messenger/package.json b/broid-messenger/package.json index 5015a349..00ac3d93 100644 --- a/broid-messenger/package.json +++ b/broid-messenger/package.json @@ -2,6 +2,7 @@ "name": "@broid/messenger", "version": "2.2.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Facebook Messenger messages into Activity Streams 2 with Broid Integration", diff --git a/broid-messenger/src/core/interfaces.ts b/broid-messenger/src/core/interfaces.ts index 8ea9c663..f9df23f9 100644 --- a/broid-messenger/src/core/interfaces.ts +++ b/broid-messenger/src/core/interfaces.ts @@ -4,12 +4,12 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - logLevel: string; - http: IAdapterHTTPOptions; - serviceID: string; token: string; tokenSecret: string; consumerSecret: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; } export interface IWebHookEvent { diff --git a/broid-messenger/yarn.lock b/broid-messenger/yarn.lock index 376cf54b..724630e8 100644 --- a/broid-messenger/yarn.lock +++ b/broid-messenger/yarn.lock @@ -2,9 +2,9 @@ # yarn lockfile v1 -"@broid/schemas@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@broid/schemas/-/schemas-1.0.1.tgz#3e2a318be8e2789e50730ea37528db19baa71f14" +"@broid/schemas@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@broid/schemas/-/schemas-1.1.1.tgz#49dad830e1ba979b9dbdb07620141e45dbd16f37" dependencies: ajv "^5.0.1-beta.1" bluebird "^3.4.6" @@ -3836,11 +3836,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From 373e435d323e1765d68636e7dbd18d5893041be2 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:41:22 +0300 Subject: [PATCH 14/23] d.ts for ms-teams --- broid-ms-teams/lib/core/Adapter.d.ts | 32 ++++++++++++++++++++++ broid-ms-teams/lib/core/Parser.d.ts | 13 +++++++++ broid-ms-teams/lib/core/WebHookServer.d.ts | 16 +++++++++++ broid-ms-teams/lib/core/index.d.ts | 2 ++ broid-ms-teams/lib/core/interfaces.d.ts | 11 ++++++++ broid-ms-teams/lib/test/Parser.d.ts | 0 broid-ms-teams/package.json | 1 + broid-ms-teams/src/core/interfaces.ts | 6 ++-- broid-ms-teams/yarn.lock | 6 +--- 9 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 broid-ms-teams/lib/core/Adapter.d.ts create mode 100644 broid-ms-teams/lib/core/Parser.d.ts create mode 100644 broid-ms-teams/lib/core/WebHookServer.d.ts create mode 100644 broid-ms-teams/lib/core/index.d.ts create mode 100644 broid-ms-teams/lib/core/interfaces.d.ts create mode 100644 broid-ms-teams/lib/test/Parser.d.ts diff --git a/broid-ms-teams/lib/core/Adapter.d.ts b/broid-ms-teams/lib/core/Adapter.d.ts new file mode 100644 index 00000000..950f4040 --- /dev/null +++ b/broid-ms-teams/lib/core/Adapter.d.ts @@ -0,0 +1,32 @@ +/// +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private connected; + private logLevel; + private logger; + private parser; + private router; + private serviceID; + private storeUsers; + private storeAddresses; + private token; + private tokenSecret; + private webhookServer; + private session; + private sessionConnector; + constructor(obj: IAdapterOptions); + users(): Promise>; + channels(): Promise; + addresses(id: string): Promise; + serviceId(): string; + serviceName(): string; + getRouter(): Router | null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; +} diff --git a/broid-ms-teams/lib/core/Parser.d.ts b/broid-ms-teams/lib/core/Parser.d.ts new file mode 100644 index 00000000..59841b13 --- /dev/null +++ b/broid-ms-teams/lib/core/Parser.d.ts @@ -0,0 +1,13 @@ +/// +import { IActivityStream } from '@broid/schemas'; +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-ms-teams/lib/core/WebHookServer.d.ts b/broid-ms-teams/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..51391b87 --- /dev/null +++ b/broid-ms-teams/lib/core/WebHookServer.d.ts @@ -0,0 +1,16 @@ +/// +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-ms-teams/lib/core/index.d.ts b/broid-ms-teams/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-ms-teams/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-ms-teams/lib/core/interfaces.d.ts b/broid-ms-teams/lib/core/interfaces.d.ts new file mode 100644 index 00000000..19b176ec --- /dev/null +++ b/broid-ms-teams/lib/core/interfaces.d.ts @@ -0,0 +1,11 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + tokenSecret: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; +} diff --git a/broid-ms-teams/lib/test/Parser.d.ts b/broid-ms-teams/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-ms-teams/package.json b/broid-ms-teams/package.json index 0f065cb2..5c410568 100644 --- a/broid-ms-teams/package.json +++ b/broid-ms-teams/package.json @@ -2,6 +2,7 @@ "name": "@broid/ms-teams", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Microsoft Teams messages into Activity Streams 2 with Broid Integration", diff --git a/broid-ms-teams/src/core/interfaces.ts b/broid-ms-teams/src/core/interfaces.ts index 5d6b05d4..fa3945f7 100644 --- a/broid-ms-teams/src/core/interfaces.ts +++ b/broid-ms-teams/src/core/interfaces.ts @@ -4,9 +4,9 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - logLevel: string; - http?: IAdapterHTTPOptions; - serviceID: string; token: string; tokenSecret: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; } diff --git a/broid-ms-teams/yarn.lock b/broid-ms-teams/yarn.lock index 60f8aee3..523c64c6 100644 --- a/broid-ms-teams/yarn.lock +++ b/broid-ms-teams/yarn.lock @@ -3968,11 +3968,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From f326844aa61a7e5e4fca2c2a6a5b4ff83d69f82c Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:42:19 +0300 Subject: [PATCH 15/23] d.ts for nexmo --- broid-nexmo/lib/core/Adapter.d.ts | 30 +++++++++++++++++++++++++ broid-nexmo/lib/core/Parser.d.ts | 12 ++++++++++ broid-nexmo/lib/core/WebHookServer.d.ts | 17 ++++++++++++++ broid-nexmo/lib/core/index.d.ts | 2 ++ broid-nexmo/lib/core/interfaces.d.ts | 12 ++++++++++ broid-nexmo/lib/test/Parser.d.ts | 0 broid-nexmo/package.json | 1 + broid-nexmo/src/core/interfaces.ts | 6 ++--- broid-nexmo/yarn.lock | 12 ++-------- 9 files changed, 79 insertions(+), 13 deletions(-) create mode 100644 broid-nexmo/lib/core/Adapter.d.ts create mode 100644 broid-nexmo/lib/core/Parser.d.ts create mode 100644 broid-nexmo/lib/core/WebHookServer.d.ts create mode 100644 broid-nexmo/lib/core/index.d.ts create mode 100644 broid-nexmo/lib/core/interfaces.d.ts create mode 100644 broid-nexmo/lib/test/Parser.d.ts diff --git a/broid-nexmo/lib/core/Adapter.d.ts b/broid-nexmo/lib/core/Adapter.d.ts new file mode 100644 index 00000000..e5006be3 --- /dev/null +++ b/broid-nexmo/lib/core/Adapter.d.ts @@ -0,0 +1,30 @@ +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private serviceID; + private username; + private token; + private tokenSecret; + private connected; + private parser; + private logLevel; + private logger; + private webhookServer; + private session; + private emitter; + private router; + constructor(obj: IAdapterOptions); + users(): Promise; + channels(): Promise; + serviceId(): string; + getRouter(): Router | null; + serviceName(): string; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: any): Promise; + private setupRouter(); +} diff --git a/broid-nexmo/lib/core/Parser.d.ts b/broid-nexmo/lib/core/Parser.d.ts new file mode 100644 index 00000000..ee303350 --- /dev/null +++ b/broid-nexmo/lib/core/Parser.d.ts @@ -0,0 +1,12 @@ +/// +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + private createIdentifier(); + private createActivityStream(event); +} diff --git a/broid-nexmo/lib/core/WebHookServer.d.ts b/broid-nexmo/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..7625afee --- /dev/null +++ b/broid-nexmo/lib/core/WebHookServer.d.ts @@ -0,0 +1,17 @@ +/// +/// +import * as Promise from 'bluebird'; +import * as EventEmitter from 'events'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer extends EventEmitter { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(router: express.Router, options: IAdapterHTTPOptions, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-nexmo/lib/core/index.d.ts b/broid-nexmo/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-nexmo/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-nexmo/lib/core/interfaces.d.ts b/broid-nexmo/lib/core/interfaces.d.ts new file mode 100644 index 00000000..06a29a4b --- /dev/null +++ b/broid-nexmo/lib/core/interfaces.d.ts @@ -0,0 +1,12 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + tokenSecret: string; + username: string; + http?: IAdapterHTTPOptions; + logLevel?: string; + serviceID?: string; +} diff --git a/broid-nexmo/lib/test/Parser.d.ts b/broid-nexmo/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-nexmo/package.json b/broid-nexmo/package.json index 42876b22..21f30c41 100755 --- a/broid-nexmo/package.json +++ b/broid-nexmo/package.json @@ -2,6 +2,7 @@ "name": "@broid/nexmo", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Nexmo messages into Activity Streams 2 with Broid Integration", diff --git a/broid-nexmo/src/core/interfaces.ts b/broid-nexmo/src/core/interfaces.ts index 381b0a2d..afb9d183 100644 --- a/broid-nexmo/src/core/interfaces.ts +++ b/broid-nexmo/src/core/interfaces.ts @@ -4,10 +4,10 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - http: IAdapterHTTPOptions; - logLevel: string; - serviceID: string; token: string; tokenSecret: string; username: string; + http?: IAdapterHTTPOptions; + logLevel?: string; + serviceID?: string; } diff --git a/broid-nexmo/yarn.lock b/broid-nexmo/yarn.lock index ec3c2567..2ebfa53a 100644 --- a/broid-nexmo/yarn.lock +++ b/broid-nexmo/yarn.lock @@ -69,11 +69,7 @@ dependencies: moment "*" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3675,11 +3671,7 @@ uuid@^2.0.1, uuid@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From abe234e75a96597844d451a6094d3908f5a0facc Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:44:05 +0300 Subject: [PATCH 16/23] d.ts for schemas --- broid-schemas/lib/index.d.ts | 59 ++++++++++++++++++++++++++++++++++++ broid-schemas/package.json | 1 + broid-schemas/yarn.lock | 6 +--- 3 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 broid-schemas/lib/index.d.ts diff --git a/broid-schemas/lib/index.d.ts b/broid-schemas/lib/index.d.ts new file mode 100644 index 00000000..5f57b9f2 --- /dev/null +++ b/broid-schemas/lib/index.d.ts @@ -0,0 +1,59 @@ +/// +import * as Promise from 'bluebird'; +export interface IASBase { + id: string; + name?: string; + type: string; +} +export interface IASContext { + content: string; + name?: string; + type: string; +} +export interface IASMedia { + content?: string; + context?: IASContext; + id?: string; + mediaType?: string; + name?: string; + preview?: string; + type: string; + url: string; +} +export interface IASObject { + attachment?: IASMedia | IASMedia[] | null; + content?: string; + context?: IASContext; + id: string; + latitude?: number; + longitude?: number; + mediaType?: string; + name?: string; + preview?: string; + tag?: IASTag | IASTag[]; + type: string; + url?: string; +} +export interface IActivityStream { + readonly '@context': string; + readonly published: number; + readonly type: string; + readonly generator: IASBase; + actor?: IASBase; + target?: IASBase; + object?: IASObject; +} +export interface IASTag { + id: string; + name: string; + type: string; +} +export interface ISendParameters { + readonly '@context': string; + readonly type: string; + readonly generator: {}; + actor?: IASBase; + to: IASBase; + object: IASObject; +} +export default function (data: any, schema: string): Promise; diff --git a/broid-schemas/package.json b/broid-schemas/package.json index d041f43f..88cede81 100644 --- a/broid-schemas/package.json +++ b/broid-schemas/package.json @@ -2,6 +2,7 @@ "name": "@broid/schemas", "version": "1.1.1", "main": "lib/index.js", + "types": "lib/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Validate Broid activity streams 2.0 messages", diff --git a/broid-schemas/yarn.lock b/broid-schemas/yarn.lock index 0268e237..e07d0210 100644 --- a/broid-schemas/yarn.lock +++ b/broid-schemas/yarn.lock @@ -12,11 +12,7 @@ version "3.5.2" resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.2.tgz#ecf1104217495e50fe0b588d538146cd6f733b89" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.11": +"@types/node@*", "@types/node@^7.0.11": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" From d60a0330d45dc39410301d145617ef63c1d2ad74 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:45:02 +0300 Subject: [PATCH 17/23] d.ts for skype --- broid-skype/lib/core/Adapter.d.ts | 31 +++++++++++++++++++++++++ broid-skype/lib/core/Parser.d.ts | 13 +++++++++++ broid-skype/lib/core/WebHookServer.d.ts | 15 ++++++++++++ broid-skype/lib/core/index.d.ts | 2 ++ broid-skype/lib/core/interfaces.d.ts | 11 +++++++++ broid-skype/lib/test/Parser.d.ts | 0 broid-skype/package.json | 1 + broid-skype/src/core/interfaces.ts | 6 ++--- broid-skype/yarn.lock | 12 ++-------- 9 files changed, 78 insertions(+), 13 deletions(-) create mode 100644 broid-skype/lib/core/Adapter.d.ts create mode 100644 broid-skype/lib/core/Parser.d.ts create mode 100644 broid-skype/lib/core/WebHookServer.d.ts create mode 100644 broid-skype/lib/core/index.d.ts create mode 100644 broid-skype/lib/core/interfaces.d.ts create mode 100644 broid-skype/lib/test/Parser.d.ts diff --git a/broid-skype/lib/core/Adapter.d.ts b/broid-skype/lib/core/Adapter.d.ts new file mode 100644 index 00000000..bb816482 --- /dev/null +++ b/broid-skype/lib/core/Adapter.d.ts @@ -0,0 +1,31 @@ +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private connected; + private logLevel; + private logger; + private parser; + private router; + private serviceID; + private storeUsers; + private storeAddresses; + private token; + private tokenSecret; + private webhookServer; + private session; + private sessionConnector; + constructor(obj: IAdapterOptions); + users(): Promise>; + channels(): Promise; + addresses(id: string): Promise; + serviceId(): string; + getRouter(): Router | null; + serviceName(): string; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; +} diff --git a/broid-skype/lib/core/Parser.d.ts b/broid-skype/lib/core/Parser.d.ts new file mode 100644 index 00000000..e03ec4cb --- /dev/null +++ b/broid-skype/lib/core/Parser.d.ts @@ -0,0 +1,13 @@ +/// +import { IActivityStream } from '@broid/schemas'; +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-skype/lib/core/WebHookServer.d.ts b/broid-skype/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..8ab5f7b8 --- /dev/null +++ b/broid-skype/lib/core/WebHookServer.d.ts @@ -0,0 +1,15 @@ +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpServer; + private host; + private port; + constructor(router: express.Router, options: IAdapterHTTPOptions, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-skype/lib/core/index.d.ts b/broid-skype/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-skype/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-skype/lib/core/interfaces.d.ts b/broid-skype/lib/core/interfaces.d.ts new file mode 100644 index 00000000..19b176ec --- /dev/null +++ b/broid-skype/lib/core/interfaces.d.ts @@ -0,0 +1,11 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + tokenSecret: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; +} diff --git a/broid-skype/lib/test/Parser.d.ts b/broid-skype/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-skype/package.json b/broid-skype/package.json index 918319fc..1cf51453 100644 --- a/broid-skype/package.json +++ b/broid-skype/package.json @@ -2,6 +2,7 @@ "name": "@broid/skype", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Skype messages into Activity Streams 2 with Broid Integration", diff --git a/broid-skype/src/core/interfaces.ts b/broid-skype/src/core/interfaces.ts index 3093ed80..fa3945f7 100644 --- a/broid-skype/src/core/interfaces.ts +++ b/broid-skype/src/core/interfaces.ts @@ -4,9 +4,9 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - logLevel: string; - http: IAdapterHTTPOptions; - serviceID: string; token: string; tokenSecret: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; } diff --git a/broid-skype/yarn.lock b/broid-skype/yarn.lock index 000337d3..eebea899 100644 --- a/broid-skype/yarn.lock +++ b/broid-skype/yarn.lock @@ -31,11 +31,7 @@ version "3.5.2" resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.2.tgz#ecf1104217495e50fe0b588d538146cd6f733b89" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3948,11 +3944,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From 1efee1ecdfe819e8c6e28b51bf29412acd88632e Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:45:57 +0300 Subject: [PATCH 18/23] d.ts for slack --- broid-slack/lib/core/Adapter.d.ts | 34 +++++++ broid-slack/lib/core/Parser.d.ts | 14 +++ broid-slack/lib/core/WebHookServer.d.ts | 14 +++ broid-slack/lib/core/helpers.d.ts | 4 + broid-slack/lib/core/index.d.ts | 2 + broid-slack/lib/core/interfaces.d.ts | 128 ++++++++++++++++++++++++ broid-slack/lib/test/Parser.d.ts | 0 broid-slack/package.json | 1 + broid-slack/src/core/interfaces.ts | 8 +- broid-slack/yarn.lock | 12 +-- 10 files changed, 203 insertions(+), 14 deletions(-) create mode 100644 broid-slack/lib/core/Adapter.d.ts create mode 100644 broid-slack/lib/core/Parser.d.ts create mode 100644 broid-slack/lib/core/WebHookServer.d.ts create mode 100644 broid-slack/lib/core/helpers.d.ts create mode 100644 broid-slack/lib/core/index.d.ts create mode 100644 broid-slack/lib/core/interfaces.d.ts create mode 100644 broid-slack/lib/test/Parser.d.ts diff --git a/broid-slack/lib/core/Adapter.d.ts b/broid-slack/lib/core/Adapter.d.ts new file mode 100644 index 00000000..0a64e8d9 --- /dev/null +++ b/broid-slack/lib/core/Adapter.d.ts @@ -0,0 +1,34 @@ +import { ISendParameters } from '@broid/schemas'; +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private asUser; + private connected; + private emitter; + private logLevel; + private logger; + private parser; + private router; + private serviceID; + private session; + private sessionWeb; + private storeUsers; + private storeChannels; + private token; + private webhookServer; + constructor(obj: IAdapterOptions); + users(): Promise>; + channels(): Promise>; + serviceId(): string; + getRouter(): Router | null; + serviceName(): string; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: ISendParameters): Promise; + private channel(key, cache?); + private user(key, cache?); + private setupRoutes(); +} diff --git a/broid-slack/lib/core/Parser.d.ts b/broid-slack/lib/core/Parser.d.ts new file mode 100644 index 00000000..46add15f --- /dev/null +++ b/broid-slack/lib/core/Parser.d.ts @@ -0,0 +1,14 @@ +import * as Promise from 'bluebird'; +import { IMessage } from './interfaces'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: IMessage | null): Promise; + private createIdentifier(); + private createActivityStream(normalized); + private ts2Timestamp(ts); + private parseFile(attachment); +} diff --git a/broid-slack/lib/core/WebHookServer.d.ts b/broid-slack/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..a6ab5221 --- /dev/null +++ b/broid-slack/lib/core/WebHookServer.d.ts @@ -0,0 +1,14 @@ +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private host; + private httpClient; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-slack/lib/core/helpers.d.ts b/broid-slack/lib/core/helpers.d.ts new file mode 100644 index 00000000..a1c4e306 --- /dev/null +++ b/broid-slack/lib/core/helpers.d.ts @@ -0,0 +1,4 @@ +import { IWebHookEvent } from './interfaces'; +export declare function createActions(buttons: any[]): any[]; +export declare function createSendMessage(data: any, message: any, actions: string, attachments: any, responseURL: string): any; +export declare function parseWebHookEvent(event: IWebHookEvent): any; diff --git a/broid-slack/lib/core/index.d.ts b/broid-slack/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-slack/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-slack/lib/core/interfaces.d.ts b/broid-slack/lib/core/interfaces.d.ts new file mode 100644 index 00000000..31fa4052 --- /dev/null +++ b/broid-slack/lib/core/interfaces.d.ts @@ -0,0 +1,128 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + asUser?: boolean; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; +} +export interface IWebHookEvent { + response: any; + request: any; +} +export interface IMessage { + type: string; + channel: ISlackGroup | ISlackDirectMessage | ISlackChannel; + user: ISlackUser; + text: string; + ts: string; +} +export interface ISlackField { + value: string; + alt: string; +} +export interface ISlackProfile { + first_name: string; + last_name: string; + avatar_hash: string; + real_name: string; + real_name_normalized: string; + email: string; + image_24: string; + image_32: string; + image_48: string; + image_72: string; + image_192: string; + image_512: string; + fields: { + [name: string]: ISlackField; + }; +} +export interface ISlackUser { + id: string; + team_id: string; + name: string; + deleted: boolean; + color: string; + real_name: string; + tz: string; + tz_label: string; + tz_offset: number; + profile: ISlackProfile; + is_admin: boolean; + is_owner: boolean; + is_primary_owner: boolean; + is_restricted: boolean; + is_ultra_restricted: boolean; + is_bot: boolean; + presence: string; +} +export interface ISlackChannel { + id: string; + name: string; + is_channel: boolean; + created: 1426851129; + creator: string; + is_archived: boolean; + is_general: boolean; + has_pins: boolean; + is_member: boolean; +} +export interface ISlackDirectMessage { + id: string; + user: string; + created: number; + is_im: boolean; + is_org_shared: boolean; + has_pins: boolean; + last_read: string; + latest: ISlackMessage; + unread_count: number; + unread_count_display: number; + is_open: boolean; +} +export interface ISlackGroup { + id: string; + name: string; + is_group: boolean; + created: number; + creator: string; + is_archived: boolean; + is_mpim: boolean; + has_pins: boolean; + is_open: boolean; + last_read: string; + latest: ISlackMessage; + unread_count: number; + unread_count_display: number; + members: string[]; + topic: { + value: string; + creator: string; + last_set: number; + }; + purpose: { + value: string; + creator: string; + last_set: number; + }; +} +export interface ISlackMessage { + type: string; + subtype?: string; + file?: any; + channel: string; + user: string; + text: string; + ts: string; +} +export interface ISlackAction { + confirm?: any; + name: string; + text: string; + type: string; + value: string; +} diff --git a/broid-slack/lib/test/Parser.d.ts b/broid-slack/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-slack/package.json b/broid-slack/package.json index 5d7ff836..7fc7458b 100644 --- a/broid-slack/package.json +++ b/broid-slack/package.json @@ -2,6 +2,7 @@ "name": "@broid/slack", "version": "2.2.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Slack messages into Activity Streams 2 with Broid Integration", diff --git a/broid-slack/src/core/interfaces.ts b/broid-slack/src/core/interfaces.ts index bf9f2a9d..cd6a8f6b 100644 --- a/broid-slack/src/core/interfaces.ts +++ b/broid-slack/src/core/interfaces.ts @@ -4,11 +4,11 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - logLevel: string; - http: IAdapterHTTPOptions; - serviceID: string; token: string; - asUser: boolean; + asUser?: boolean; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; } export interface IWebHookEvent { diff --git a/broid-slack/yarn.lock b/broid-slack/yarn.lock index abafde89..c74a7410 100644 --- a/broid-slack/yarn.lock +++ b/broid-slack/yarn.lock @@ -38,11 +38,7 @@ winston "^2.1.1" ws "^1.0.1" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3874,11 +3870,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From 44b146973d34b4906cbc0a4ae10ea1f56a98884a Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:47:05 +0300 Subject: [PATCH 19/23] d.ts for twilio --- broid-twilio/lib/core/Adapter.d.ts | 30 ++++++++++++++++++++++++ broid-twilio/lib/core/Parser.d.ts | 14 +++++++++++ broid-twilio/lib/core/WebHookServer.d.ts | 15 ++++++++++++ broid-twilio/lib/core/index.d.ts | 2 ++ broid-twilio/lib/core/interfaces.d.ts | 29 +++++++++++++++++++++++ broid-twilio/lib/test/Parser.d.ts | 0 broid-twilio/package.json | 1 + broid-twilio/src/core/interfaces.ts | 8 +++---- broid-twilio/yarn.lock | 12 ++-------- 9 files changed, 97 insertions(+), 14 deletions(-) create mode 100644 broid-twilio/lib/core/Adapter.d.ts create mode 100644 broid-twilio/lib/core/Parser.d.ts create mode 100644 broid-twilio/lib/core/WebHookServer.d.ts create mode 100644 broid-twilio/lib/core/index.d.ts create mode 100644 broid-twilio/lib/core/interfaces.d.ts create mode 100644 broid-twilio/lib/test/Parser.d.ts diff --git a/broid-twilio/lib/core/Adapter.d.ts b/broid-twilio/lib/core/Adapter.d.ts new file mode 100644 index 00000000..c1df4581 --- /dev/null +++ b/broid-twilio/lib/core/Adapter.d.ts @@ -0,0 +1,30 @@ +/// +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private serviceID; + private token; + private tokenSecret; + private connected; + private session; + private parser; + private logLevel; + private username; + private logger; + private emitter; + private router; + private webhookServer; + constructor(obj: IAdapterOptions); + users(): Promise; + channels(): Promise; + serviceId(): string; + serviceName(): string; + getRouter(): Router | null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; + private setupRouter(); +} diff --git a/broid-twilio/lib/core/Parser.d.ts b/broid-twilio/lib/core/Parser.d.ts new file mode 100644 index 00000000..647ac066 --- /dev/null +++ b/broid-twilio/lib/core/Parser.d.ts @@ -0,0 +1,14 @@ +/// +import * as Promise from 'bluebird'; +import { ITwilioWebHookEvent } from './interfaces'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + normalize(event: ITwilioWebHookEvent): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-twilio/lib/core/WebHookServer.d.ts b/broid-twilio/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..ce375f0f --- /dev/null +++ b/broid-twilio/lib/core/WebHookServer.d.ts @@ -0,0 +1,15 @@ +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-twilio/lib/core/index.d.ts b/broid-twilio/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-twilio/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-twilio/lib/core/interfaces.d.ts b/broid-twilio/lib/core/interfaces.d.ts new file mode 100644 index 00000000..77603c8f --- /dev/null +++ b/broid-twilio/lib/core/interfaces.d.ts @@ -0,0 +1,29 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + tokenSecret: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; + username?: string; +} +export interface ITwilioWebHookEvent { + response: any; + request: any; +} +export interface ITwilioActivityStreamObject { + id: string; + content?: string; + mediaType?: string; + type: string; + url?: string; + attachment?: ITwilioMedia; +} +export interface ITwilioMedia { + mediaType: string; + type: string; + url: string; +} diff --git a/broid-twilio/lib/test/Parser.d.ts b/broid-twilio/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-twilio/package.json b/broid-twilio/package.json index c9e0236a..0acdc810 100644 --- a/broid-twilio/package.json +++ b/broid-twilio/package.json @@ -2,6 +2,7 @@ "name": "@broid/twilio", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Twilio messages into Activity Streams 2 with Broid Integration", diff --git a/broid-twilio/src/core/interfaces.ts b/broid-twilio/src/core/interfaces.ts index 00f4a169..125a606e 100644 --- a/broid-twilio/src/core/interfaces.ts +++ b/broid-twilio/src/core/interfaces.ts @@ -4,12 +4,12 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - logLevel: string; - http: IAdapterHTTPOptions; - serviceID: string; token: string; tokenSecret: string; - username: string; + logLevel?: string; + http?: IAdapterHTTPOptions; + serviceID?: string; + username?: string; } export interface ITwilioWebHookEvent { diff --git a/broid-twilio/yarn.lock b/broid-twilio/yarn.lock index 886ddaa4..366208b2 100644 --- a/broid-twilio/yarn.lock +++ b/broid-twilio/yarn.lock @@ -31,11 +31,7 @@ version "3.5.2" resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.2.tgz#ecf1104217495e50fe0b588d538146cd6f733b89" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3943,11 +3939,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From 4430f4a07d12cd16047dd853251a9bee4b1e2016 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:47:51 +0300 Subject: [PATCH 20/23] d.ts for twitter --- broid-twitter/lib/core/Adapter.d.ts | 32 ++++++++++++++++++++++++++ broid-twitter/lib/core/Parser.d.ts | 13 +++++++++++ broid-twitter/lib/core/index.d.ts | 2 ++ broid-twitter/lib/core/interfaces.d.ts | 17 ++++++++++++++ broid-twitter/lib/test/Parser.d.ts | 0 broid-twitter/package.json | 1 + broid-twitter/src/core/interfaces.ts | 4 ++-- broid-twitter/yarn.lock | 12 ++-------- 8 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 broid-twitter/lib/core/Adapter.d.ts create mode 100644 broid-twitter/lib/core/Parser.d.ts create mode 100644 broid-twitter/lib/core/index.d.ts create mode 100644 broid-twitter/lib/core/interfaces.d.ts create mode 100644 broid-twitter/lib/test/Parser.d.ts diff --git a/broid-twitter/lib/core/Adapter.d.ts b/broid-twitter/lib/core/Adapter.d.ts new file mode 100644 index 00000000..8c3ad4df --- /dev/null +++ b/broid-twitter/lib/core/Adapter.d.ts @@ -0,0 +1,32 @@ +import * as Promise from 'bluebird'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private connected; + private serviceID; + private username; + private myid; + private token; + private tokenSecret; + private consumerKey; + private consumerSecret; + private session; + private parser; + private logLevel; + private logger; + private storeUsers; + private sessionGET; + private sessionPOST; + constructor(obj?: IAdapterOptions); + users(): Promise>; + channels(): Promise; + serviceId(): string; + serviceName(): string; + getRouter(): null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; + private userById(key, cache?); + private createMedia(url, altText?); +} diff --git a/broid-twitter/lib/core/Parser.d.ts b/broid-twitter/lib/core/Parser.d.ts new file mode 100644 index 00000000..d9e37055 --- /dev/null +++ b/broid-twitter/lib/core/Parser.d.ts @@ -0,0 +1,13 @@ +import { IActivityStream } from '@broid/schemas'; +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + normalize(raw: any): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-twitter/lib/core/index.d.ts b/broid-twitter/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-twitter/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-twitter/lib/core/interfaces.d.ts b/broid-twitter/lib/core/interfaces.d.ts new file mode 100644 index 00000000..83783557 --- /dev/null +++ b/broid-twitter/lib/core/interfaces.d.ts @@ -0,0 +1,17 @@ +export interface IAdapterOptions { + token: string; + tokenSecret: string; + consumerSecret: string; + consumerKey: string; + username: string; + serviceID?: string; + logLevel?: string; +} +export interface ITwitterSendParameters { + status?: string; + twit_options: object; + text?: string; + screen_name?: string; + user_id?: string; + media_ids?: object[]; +} diff --git a/broid-twitter/lib/test/Parser.d.ts b/broid-twitter/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-twitter/package.json b/broid-twitter/package.json index 470d9b9e..41c5accc 100644 --- a/broid-twitter/package.json +++ b/broid-twitter/package.json @@ -2,6 +2,7 @@ "name": "@broid/twitter", "version": "2.2.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Twitter messages into Activity Streams 2 with Broid Integration", diff --git a/broid-twitter/src/core/interfaces.ts b/broid-twitter/src/core/interfaces.ts index 437fd7dd..86ce8842 100644 --- a/broid-twitter/src/core/interfaces.ts +++ b/broid-twitter/src/core/interfaces.ts @@ -4,8 +4,8 @@ export interface IAdapterOptions { consumerSecret: string; consumerKey: string; username: string; - serviceID: string; - logLevel: string; + serviceID?: string; + logLevel?: string; } export interface ITwitterSendParameters { diff --git a/broid-twitter/yarn.lock b/broid-twitter/yarn.lock index e122c689..7b561b76 100644 --- a/broid-twitter/yarn.lock +++ b/broid-twitter/yarn.lock @@ -21,11 +21,7 @@ request "^2.81.0" valid-url "^1.0.9" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3564,11 +3560,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From fe9664bdfd0221ad1d0fa059925f3af3b92d4455 Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:49:12 +0300 Subject: [PATCH 21/23] d.ts for utils --- broid-utils/lib/Logger.d.ts | 8 ++++++++ broid-utils/lib/index.d.ts | 11 +++++++++++ broid-utils/lib/index.js | 7 ++++--- broid-utils/package.json | 1 + broid-utils/yarn.lock | 6 +----- 5 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 broid-utils/lib/Logger.d.ts create mode 100644 broid-utils/lib/index.d.ts diff --git a/broid-utils/lib/Logger.d.ts b/broid-utils/lib/Logger.d.ts new file mode 100644 index 00000000..efe1077d --- /dev/null +++ b/broid-utils/lib/Logger.d.ts @@ -0,0 +1,8 @@ +export declare class Logger { + private pino; + constructor(name: string, level: string); + error(...messages: any[]): void; + warning(...messages: any[]): void; + info(...messages: any[]): void; + debug(...messages: any[]): void; +} diff --git a/broid-utils/lib/index.d.ts b/broid-utils/lib/index.d.ts new file mode 100644 index 00000000..3ec6a3f0 --- /dev/null +++ b/broid-utils/lib/index.d.ts @@ -0,0 +1,11 @@ +/// +/// +import * as Promise from 'bluebird'; +import { Logger } from './Logger'; +declare const cleanNulls: any; +declare function capitalizeFirstLetter(str: string): string; +declare const defaults: (arg1: {}, arg0?: any) => (b: T2) => any; +declare const concat: (x0: any[]) => string; +declare function isUrl(url: any): any; +declare function fileInfo(file: any, logger?: Logger): Promise<{}>; +export { capitalizeFirstLetter, cleanNulls, concat, defaults, fileInfo, isUrl, Logger }; diff --git a/broid-utils/lib/index.js b/broid-utils/lib/index.js index 25bc5068..a79e5886 100644 --- a/broid-utils/lib/index.js +++ b/broid-utils/lib/index.js @@ -23,8 +23,7 @@ function isUrl(url) { return validUrl.isWebUri(url); } exports.isUrl = isUrl; -function fileInfo(file) { - const logger = new Logger_1.Logger('fileInfo', 'debug'); +function fileInfo(file, logger) { return Promise.resolve(isUrl(file)) .then((is) => { if (is) { @@ -35,7 +34,9 @@ function fileInfo(file) { }) .then((infos) => R.dissoc('mime', R.assoc('mimetype', infos.mime, infos))) .catch((error) => { - logger.error(error); + if (logger) { + logger.debug(error); + } return { mimetype: '' }; }); } diff --git a/broid-utils/package.json b/broid-utils/package.json index 8e4034d9..918aeae1 100644 --- a/broid-utils/package.json +++ b/broid-utils/package.json @@ -2,6 +2,7 @@ "name": "@broid/utils", "version": "1.2.0", "main": "lib/index.js", + "types": "lib/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Broid Utils used in Broid Integrations.", diff --git a/broid-utils/yarn.lock b/broid-utils/yarn.lock index 39eb980d..39008163 100644 --- a/broid-utils/yarn.lock +++ b/broid-utils/yarn.lock @@ -12,11 +12,7 @@ version "3.5.2" resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.2.tgz#ecf1104217495e50fe0b588d538146cd6f733b89" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" From 9cde9a28f45c71e71d9b8fe8faeefa3b12e216dc Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:50:09 +0300 Subject: [PATCH 22/23] d.ts for viber --- broid-viber/lib/core/Adapter.d.ts | 30 +++++++++++++++++++++++++ broid-viber/lib/core/Parser.d.ts | 13 +++++++++++ broid-viber/lib/core/WebHookServer.d.ts | 14 ++++++++++++ broid-viber/lib/core/index.d.ts | 2 ++ broid-viber/lib/core/interfaces.d.ts | 14 ++++++++++++ broid-viber/lib/test/Parser.d.ts | 0 broid-viber/package.json | 1 + broid-viber/src/core/interfaces.ts | 8 +++---- broid-viber/yarn.lock | 12 ++-------- 9 files changed, 80 insertions(+), 14 deletions(-) create mode 100644 broid-viber/lib/core/Adapter.d.ts create mode 100644 broid-viber/lib/core/Parser.d.ts create mode 100644 broid-viber/lib/core/WebHookServer.d.ts create mode 100644 broid-viber/lib/core/index.d.ts create mode 100644 broid-viber/lib/core/interfaces.d.ts create mode 100644 broid-viber/lib/test/Parser.d.ts diff --git a/broid-viber/lib/core/Adapter.d.ts b/broid-viber/lib/core/Adapter.d.ts new file mode 100644 index 00000000..6a0208d7 --- /dev/null +++ b/broid-viber/lib/core/Adapter.d.ts @@ -0,0 +1,30 @@ +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + private avatar; + private connected; + private logger; + private logLevel; + private me; + private parser; + private serviceID; + private session; + private storeUsers; + private token; + private username; + private router; + private webhookServer; + private webhookURL; + constructor(obj: IAdapterOptions); + users(): Promise>; + channels(): Promise; + serviceName(): string; + serviceId(): string; + getRouter(): Router | null; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + send(data: object): Promise; +} diff --git a/broid-viber/lib/core/Parser.d.ts b/broid-viber/lib/core/Parser.d.ts new file mode 100644 index 00000000..b6e9724d --- /dev/null +++ b/broid-viber/lib/core/Parser.d.ts @@ -0,0 +1,13 @@ +import { IActivityStream } from '@broid/schemas'; +import * as Promise from 'bluebird'; +export declare class Parser { + serviceID: string; + generatorName: string; + private logger; + constructor(serviceName: string, serviceID: string, logLevel: string); + validate(event: any): Promise; + parse(event: any): Promise; + normalize(evt: any): Promise; + private createIdentifier(); + private createActivityStream(normalized); +} diff --git a/broid-viber/lib/core/WebHookServer.d.ts b/broid-viber/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..6c713aee --- /dev/null +++ b/broid-viber/lib/core/WebHookServer.d.ts @@ -0,0 +1,14 @@ +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private logger; + private httpClient; + private host; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel?: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-viber/lib/core/index.d.ts b/broid-viber/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-viber/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-viber/lib/core/interfaces.d.ts b/broid-viber/lib/core/interfaces.d.ts new file mode 100644 index 00000000..7c09b805 --- /dev/null +++ b/broid-viber/lib/core/interfaces.d.ts @@ -0,0 +1,14 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + token: string; + tokenSecret: string; + username: string; + webhookURL: string; + avatar: string; + http?: IAdapterHTTPOptions; + logLevel?: string; + serviceID?: string; +} diff --git a/broid-viber/lib/test/Parser.d.ts b/broid-viber/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-viber/package.json b/broid-viber/package.json index e18d4562..9d6137fa 100644 --- a/broid-viber/package.json +++ b/broid-viber/package.json @@ -2,6 +2,7 @@ "name": "@broid/viber", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert Viber messages into Activity Streams 2 with Broid Integration", diff --git a/broid-viber/src/core/interfaces.ts b/broid-viber/src/core/interfaces.ts index 6a4629a9..bcf29dd5 100644 --- a/broid-viber/src/core/interfaces.ts +++ b/broid-viber/src/core/interfaces.ts @@ -4,12 +4,12 @@ export interface IAdapterHTTPOptions { } export interface IAdapterOptions { - avatar: string; - http: IAdapterHTTPOptions; - logLevel: string; - serviceID: string; token: string; tokenSecret: string; username: string; webhookURL: string; + avatar: string; + http?: IAdapterHTTPOptions; + logLevel?: string; + serviceID?: string; } diff --git a/broid-viber/yarn.lock b/broid-viber/yarn.lock index 6e3a8eb0..337273b8 100644 --- a/broid-viber/yarn.lock +++ b/broid-viber/yarn.lock @@ -21,11 +21,7 @@ request "^2.81.0" valid-url "^1.0.9" -"@types/node@*": - version "8.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.12.tgz#0560c3e8c9e3da0aa07d0b86e0b0a02b5fd29480" - -"@types/node@^7.0.12": +"@types/node@*", "@types/node@^7.0.12": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9" @@ -3799,11 +3795,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" From e3217e47fc77237d6128147972413761c02cbc0c Mon Sep 17 00:00:00 2001 From: tenorok Date: Sun, 17 Dec 2017 20:51:14 +0300 Subject: [PATCH 23/23] d.ts for wechat --- broid-wechat/lib/core/Adapter.d.ts | 31 ++++++++++++++++++++++++ broid-wechat/lib/core/Parser.d.ts | 18 ++++++++++++++ broid-wechat/lib/core/WebHookServer.d.ts | 16 ++++++++++++ broid-wechat/lib/core/index.d.ts | 2 ++ broid-wechat/lib/core/interfaces.d.ts | 11 +++++++++ broid-wechat/lib/test/Parser.d.ts | 0 broid-wechat/package.json | 1 + broid-wechat/yarn.lock | 16 +++++------- 8 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 broid-wechat/lib/core/Adapter.d.ts create mode 100644 broid-wechat/lib/core/Parser.d.ts create mode 100644 broid-wechat/lib/core/WebHookServer.d.ts create mode 100644 broid-wechat/lib/core/index.d.ts create mode 100644 broid-wechat/lib/core/interfaces.d.ts create mode 100644 broid-wechat/lib/test/Parser.d.ts diff --git a/broid-wechat/lib/core/Adapter.d.ts b/broid-wechat/lib/core/Adapter.d.ts new file mode 100644 index 00000000..1f7fd9c9 --- /dev/null +++ b/broid-wechat/lib/core/Adapter.d.ts @@ -0,0 +1,31 @@ +/// +/// +import { ISendParameters } from '@broid/schemas'; +import * as Promise from 'bluebird'; +import { Router } from 'express'; +import { Observable } from 'rxjs/Rx'; +import { IAdapterOptions } from './interfaces'; +export declare class Adapter { + serviceID: string; + private appID; + private appSecret; + private client; + private connected; + private emitter; + private logLevel; + private logger; + private parser; + private router; + private webhookServer; + constructor(obj: IAdapterOptions); + serviceId(): string; + serviceName(): string; + connect(): Observable; + disconnect(): Promise; + listen(): Observable; + users(): Promise; + getRouter(): Router | null; + send(data: ISendParameters): Promise; + private uploadFile(url, fType, file); + private setupRouter(); +} diff --git a/broid-wechat/lib/core/Parser.d.ts b/broid-wechat/lib/core/Parser.d.ts new file mode 100644 index 00000000..28d33ff9 --- /dev/null +++ b/broid-wechat/lib/core/Parser.d.ts @@ -0,0 +1,18 @@ +/// +import { IActivityStream } from '@broid/schemas'; +import * as Promise from 'bluebird'; +export declare class Parser { + generatorName: string; + serviceID: string; + private logger; + private userCache; + private wechatClient; + constructor(serviceName: string, wechatClient: any, serviceID: string, logLevel: string); + validate(event: object | null): Promise; + parse(event: object): Promise; + private getUserName(openid); + private createActivityStream(normalized); + private parseImage(normalized); + private parseText(normalized); + private parseMultiMedia(normalized, messageType, mediaType); +} diff --git a/broid-wechat/lib/core/WebHookServer.d.ts b/broid-wechat/lib/core/WebHookServer.d.ts new file mode 100644 index 00000000..84748296 --- /dev/null +++ b/broid-wechat/lib/core/WebHookServer.d.ts @@ -0,0 +1,16 @@ +/// +/// +import * as Promise from 'bluebird'; +import * as express from 'express'; +import { IAdapterHTTPOptions } from './interfaces'; +export declare class WebHookServer { + private express; + private host; + private httpClient; + private logger; + private port; + constructor(options: IAdapterHTTPOptions, router: express.Router, logLevel: string); + listen(): void; + close(): Promise; + private setupExpress(router); +} diff --git a/broid-wechat/lib/core/index.d.ts b/broid-wechat/lib/core/index.d.ts new file mode 100644 index 00000000..6485757c --- /dev/null +++ b/broid-wechat/lib/core/index.d.ts @@ -0,0 +1,2 @@ +import { Adapter } from './Adapter'; +export = Adapter; diff --git a/broid-wechat/lib/core/interfaces.d.ts b/broid-wechat/lib/core/interfaces.d.ts new file mode 100644 index 00000000..d1066d67 --- /dev/null +++ b/broid-wechat/lib/core/interfaces.d.ts @@ -0,0 +1,11 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + appID: string; + appSecret: string; + serviceID?: string; + logLevel?: string; + http?: IAdapterHTTPOptions; +} diff --git a/broid-wechat/lib/test/Parser.d.ts b/broid-wechat/lib/test/Parser.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/broid-wechat/package.json b/broid-wechat/package.json index 8223ce1b..76f7c35e 100644 --- a/broid-wechat/package.json +++ b/broid-wechat/package.json @@ -2,6 +2,7 @@ "name": "@broid/wechat", "version": "2.1.0", "main": "lib/core/index.js", + "types": "lib/core/index.d.ts", "license": "AGPL-3.0+", "author": "Broid Team (https://broid.ai)", "description": "Convert WeChat messages into Activity Streams 2 with Broid Integration", diff --git a/broid-wechat/yarn.lock b/broid-wechat/yarn.lock index 7af1722f..1d9db5f6 100644 --- a/broid-wechat/yarn.lock +++ b/broid-wechat/yarn.lock @@ -1169,13 +1169,13 @@ debug-log@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" -debug@2, debug@2.6.3, debug@^2.1.1, debug@^2.1.3: +debug@2, debug@2.6.3, debug@^2.1.1, debug@^2.1.3, debug@^2.6.0: version "2.6.3" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" dependencies: ms "0.7.2" -debug@2.6.1, debug@^2.2.0, debug@^2.6.0: +debug@2.6.1, debug@^2.2.0: version "2.6.1" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.1.tgz#79855090ba2c4e3115cc7d8769491d58f0491351" dependencies: @@ -3783,11 +3783,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: +uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" @@ -3819,9 +3815,9 @@ watch@^1.0.1: exec-sh "^0.2.0" minimist "^1.2.0" -"wechat-api@git+https://git@github.com/node-webot/wechat-api.git#295ad45e199ef93610c4d3a9350de6992a932d8c": - version "1.32.0" - resolved "git+https://git@github.com/node-webot/wechat-api.git#295ad45e199ef93610c4d3a9350de6992a932d8c" +wechat-api@^1.35.0: + version "1.35.1" + resolved "https://registry.yarnpkg.com/wechat-api/-/wechat-api-1.35.1.tgz#cd639bc1729ecb5d80a6ac92064c24d8ed8ee65b" dependencies: formstream ">=1.0.0" urllib "2.21.0"