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..c3c72a9b --- /dev/null +++ b/broid-viber/lib/core/interfaces.d.ts @@ -0,0 +1,14 @@ +export interface IAdapterHTTPOptions { + host: string; + port: number; +} +export interface IAdapterOptions { + avatar: string; + http: IAdapterHTTPOptions; + logLevel: string; + serviceID: string; + token: string; + tokenSecret: string; + username: string; + webhookURL: 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/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"