This repository has been archived by the owner on Feb 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dustin Blackman
committed
Sep 11, 2017
1 parent
39f0ac9
commit 995a188
Showing
147 changed files
with
1,664 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/// <reference types="bluebird" /> | ||
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<Map<string, object> | Error>; | ||
channels(): Promise<Map<string, object> | Error>; | ||
serviceId(): string; | ||
connect(): Observable<object>; | ||
disconnect(): Promise<null>; | ||
listen(): Observable<object>; | ||
send(data: any): Promise<object | Error>; | ||
private setupRouter(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// <reference types="bluebird" /> | ||
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<object | null>; | ||
parse(event: any): Promise<object | null>; | ||
private createActivityStream(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/// <reference types="bluebird" /> | ||
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<null>; | ||
private setupExpress(router); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { Adapter } from './Adapter'; | ||
export = Adapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/// <reference types="bluebird" /> | ||
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<Map<string, object> | Error>; | ||
channels(): Promise<Map<string, object> | Error>; | ||
connect(): Observable<object>; | ||
disconnect(): Promise<null>; | ||
listen(): Observable<object>; | ||
send(data: any): Promise<object | Error>; | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Error>; | ||
channels(): Promise<Error>; | ||
serviceName(): string; | ||
serviceId(): string; | ||
getRouter(): Router; | ||
connect(): Observable<object>; | ||
disconnect(): Promise<null>; | ||
listen(): Observable<object>; | ||
send(data: object): Promise<object | Error>; | ||
private setupRouter(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<object>; | ||
parse(event: any): Promise<IActivityStream>; | ||
normalize(event: ICallrWebHookEvent): Promise<any>; | ||
private createIdentifier(); | ||
private createActivityStream(normalized); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<null>; | ||
private setupExpress(router); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { Adapter } from './Adapter'; | ||
export = Adapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export interface IAdapterHTTPOptions { | ||
host: string; | ||
port: number; | ||
} | ||
export interface IAdapterOptions { | ||
logLevel: string; | ||
serviceID: string; | ||
token: string; | ||
tokenSecret: string; | ||
username: string; | ||
webhookURL: string; | ||
http?: IAdapterHTTPOptions; | ||
} | ||
export interface ICallrWebHookEvent { | ||
request: any; | ||
response: any; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/// <reference types="bluebird" /> | ||
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<any>; | ||
channels(): Promise<any>; | ||
serviceId(): string; | ||
serviceName(): string; | ||
getRouter(): null; | ||
connect(): Observable<any>; | ||
disconnect(): Promise<null>; | ||
listen(): Observable<any>; | ||
send(data: object): Promise<object | Error>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference types="bluebird" /> | ||
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<object | null>; | ||
parse(event: any): Promise<any>; | ||
private parseMedia(media, content); | ||
private createActivityStream(normalized); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { Adapter } from './Adapter'; | ||
export = Adapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Map<string, any>>; | ||
channels(): Promise<Map<string, any>>; | ||
serviceId(): string; | ||
serviceName(): string; | ||
getRouter(): null; | ||
connect(): Observable<object>; | ||
disconnect(): Promise<null>; | ||
listen(): Observable<object>; | ||
send(data: any): Promise<object | Error>; | ||
private userByID(userID); | ||
private flowByID(flowID); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<object>; | ||
parse(event: any): Promise<any>; | ||
private createIdentifier(); | ||
private createActivityStream(normalized); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { Adapter } from './Adapter'; | ||
export = Adapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface IAdapterOptions { | ||
token: string; | ||
serviceID: string; | ||
logLevel: string; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Error>; | ||
channels(): Promise<any>; | ||
serviceName(): string; | ||
serviceId(): string; | ||
getRouter(): null; | ||
connect(): Observable<object>; | ||
disconnect(): Promise<null>; | ||
listen(): Observable<object>; | ||
send(data: any): Promise<object | Error>; | ||
private joinRoom(room); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<object | null>; | ||
parse(event: any): Promise<object | null>; | ||
private createIdentifier(); | ||
private createActivityStream(normalized); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { Adapter } from './Adapter'; | ||
export = Adapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface IAdapterOptions { | ||
logLevel: string; | ||
serviceID: string; | ||
token: string; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/// <reference types="bluebird" /> | ||
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<Error>; | ||
channels(): Promise<Error>; | ||
serviceId(): string; | ||
getRouter(): Router | null; | ||
connect(): Observable<object>; | ||
disconnect(): Promise<null>; | ||
listen(): Observable<object>; | ||
send(data: object): Promise<object | Error>; | ||
private addIntent(trigger); | ||
private setupRouter(); | ||
private sendMessage(isSSML, content, noInputs); | ||
} |
Oops, something went wrong.