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
Showing
7 changed files
with
75 additions
and
10 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
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 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<Map<string, any>>; | ||
channels(): Promise<Error>; | ||
serviceName(): string; | ||
serviceId(): string; | ||
getRouter(): Router | null; | ||
connect(): Observable<object | Error>; | ||
disconnect(): Promise<null>; | ||
listen(): Observable<object>; | ||
send(data: object): Promise<any>; | ||
} |
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,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<any>; | ||
parse(event: any): Promise<IActivityStream | null>; | ||
normalize(evt: 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,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,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; | ||
} |
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