-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
f25b54d
commit bda2413
Showing
8 changed files
with
64 additions
and
0 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,7 @@ | ||
declare function SendJSON(json: any, status?: number): Promise<Response>; | ||
declare function Success(message: string, status?: number): Promise<Response>; | ||
declare function Failure(message: string, status?: number): Promise<Response>; | ||
declare function ServerFailure(message: string, status?: number): Promise<Response>; | ||
declare function Redirect(destination: string, status?: number): Response; | ||
declare function Html(html: string, status?: number): Response; | ||
export { SendJSON, Success, Failure, ServerFailure, Redirect, Html }; |
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 @@ | ||
export declare function param(req: Request): Promise<string | null>; |
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 @@ | ||
export declare function query(query: string, req: Request): Promise<string | undefined>; |
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,18 @@ | ||
declare class Mongo { | ||
private client; | ||
connect(url: string): Promise<void>; | ||
getCollection(db: string, col: string): Promise<any>; | ||
getDatabase(db: string): Promise<any>; | ||
update(db: string, col: string, query: any, update: any): Promise<any>; | ||
insert(db: string, col: string, data: any): Promise<any>; | ||
find(db: string, col: string, query: any): Promise<any[]>; | ||
findOne(db: string, col: string, query: any): Promise<any>; | ||
delete(db: string, col: string, query: any): Promise<any>; | ||
close(): Promise<void>; | ||
} | ||
declare class MongoService { | ||
private static instance; | ||
constructor(); | ||
static getInstance(): Mongo; | ||
} | ||
export default MongoService; |
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 @@ | ||
declare class Pg { | ||
private pool; | ||
connect(config: object): Promise<void>; | ||
endConnection(): Promise<void>; | ||
query(text: string, params?: any[]): Promise<any>; | ||
} | ||
declare class PgService { | ||
private static instance; | ||
constructor(); | ||
static getInstance(): Pg; | ||
} | ||
export default PgService; |
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 @@ | ||
import { SendJSON, Success, Failure, ServerFailure, Redirect, Html } from "../helpers/helper.ts"; | ||
import { query } from "../helpers/query.ts"; | ||
import { param } from "../helpers/param.ts"; | ||
import MongoService from "../instances/mongodb.ts"; | ||
import PgService from "../instances/postgres.ts"; | ||
declare class ProBun { | ||
private port; | ||
private routes; | ||
private logger; | ||
private mongoUri; | ||
private pgConfig; | ||
constructor(props: { | ||
port: number; | ||
routes: string; | ||
logger: boolean; | ||
mongoUri?: any; | ||
pgConfig?: any; | ||
}); | ||
start(): Promise<void>; | ||
definePreMiddleware(middleware: any): void; | ||
definePostMiddleware(middleware: any): void; | ||
} | ||
export { ProBun, SendJSON, Success, Failure, ServerFailure, Redirect, Html, query, param, MongoService, PgService }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.