@godspeedsystems/plugins-express-as-http
Version:
Godspeed event source plugin for express as http server
25 lines (24 loc) • 1.23 kB
TypeScript
import { PlainObject, GSCloudEvent, GSStatus, GSEventSource } from "@godspeedsystems/core";
import express from "express";
export default class EventSource extends GSEventSource {
initClient(): Promise<PlainObject>;
setupMiddleware(app: express.Express): void;
setupAuthentication(app: express.Express): void;
setupJwtAuthentication(app: express.Express, jwtConfig: PlainObject): void;
setupGoogleAuthentication(app: express.Express, googleConfig: PlainObject): void;
setupLinkedInAuthentication(app: express.Express, linkedinConfig: PlainObject): void;
setupGithubAuthentication(app: express.Express, githubConfig: PlainObject): void;
setupMetrics(app: express.Express): void;
private authnHOF;
subscribeToEvent(eventRoute: string, eventConfig: PlainObject, processEvent: (event: GSCloudEvent, eventConfig: PlainObject) => Promise<GSStatus>, event?: PlainObject): Promise<void>;
}
declare const SourceType = "ES";
declare const Type = "express";
declare const CONFIG_FILE_NAME = "http";
declare const DEFAULT_CONFIG: {
port: number;
docs: {
endpoint: string;
};
};
export { EventSource, SourceType, Type, CONFIG_FILE_NAME, DEFAULT_CONFIG };