@seip/bluebird-js 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env_example +54 -0
- package/AGENTS.md +426 -0
- package/LICENSE +21 -0
- package/README.md +292 -3
- package/app/routes/api.js +50 -0
- package/app/routes/web.js +55 -0
- package/app/views/about.js +63 -0
- package/app/views/dashboard.js +147 -0
- package/app/views/index.js +80 -0
- package/app/views/layouts/main/view.js +81 -0
- package/app/views/legal/terms.html +19 -0
- package/app/views/login.js +80 -0
- package/core/app.d.ts +18 -0
- package/core/app.js +684 -0
- package/core/auth.d.ts +13 -0
- package/core/auth.js +326 -0
- package/core/cache.d.ts +17 -0
- package/core/cache.js +475 -0
- package/core/cli/doctor.js +287 -0
- package/core/cli/ecosystem.js +162 -0
- package/core/cli/init.js +779 -0
- package/core/cli/migrate.js +541 -0
- package/core/cli/model.js +66 -0
- package/core/cli/nginx.js +199 -0
- package/core/cli/route.js +121 -0
- package/core/cli/swagger.js +45 -0
- package/core/cli/view.js +96 -0
- package/core/config.d.ts +3 -0
- package/core/config.js +111 -0
- package/core/csrf.d.ts +3 -0
- package/core/csrf.js +114 -0
- package/core/database.d.ts +15 -0
- package/core/database.js +636 -0
- package/core/debug.d.ts +3 -0
- package/core/debug.js +250 -0
- package/core/hash.d.ts +3 -0
- package/core/hash.js +194 -0
- package/core/html.d.ts +42 -0
- package/core/html.js +217 -0
- package/core/index.d.ts +1176 -0
- package/core/logger.d.ts +3 -0
- package/core/logger.js +127 -0
- package/core/middleware.d.ts +3 -0
- package/core/middleware.js +28 -0
- package/core/model.d.ts +19 -0
- package/core/model.js +600 -0
- package/core/queue.d.ts +13 -0
- package/core/queue.js +172 -0
- package/core/ratelimit.d.ts +3 -0
- package/core/ratelimit.js +145 -0
- package/core/redis.d.ts +21 -0
- package/core/redis.js +230 -0
- package/core/render-cache.js +212 -0
- package/core/render.d.ts +3 -0
- package/core/render.js +320 -0
- package/core/router.d.ts +3 -0
- package/core/router.js +171 -0
- package/core/seo.d.ts +3 -0
- package/core/seo.js +106 -0
- package/core/swagger.d.ts +3 -0
- package/core/swagger.js +60 -0
- package/core/upload.d.ts +13 -0
- package/core/upload.js +102 -0
- package/core/util/colors.js +82 -0
- package/core/validate.d.ts +15 -0
- package/core/validate.js +364 -0
- package/core/view-loader.js +162 -0
- package/core/vite.d.ts +3 -0
- package/core/vite.js +145 -0
- package/core/ws.d.ts +13 -0
- package/core/ws.js +245 -0
- package/index.js +18 -0
- package/jsconfig.json +15 -0
- package/package.json +85 -5
- package/production.md +273 -0
- package/public/css/bluebird.min.css +2 -0
- package/public/images/favicon.ico +0 -0
- package/public/js/bluebird-client.js +1781 -0
- package/public/js/bluebird.min.js +1073 -0
package/core/index.d.ts
ADDED
|
@@ -0,0 +1,1176 @@
|
|
|
1
|
+
import type { Server as HttpServer } from "node:http";
|
|
2
|
+
import { Router as ExpressRouter, Request, Response, NextFunction, RequestHandler } from "express";
|
|
3
|
+
|
|
4
|
+
export type { Request, Response, NextFunction, RequestHandler };
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Standard pagination metadata structure.
|
|
8
|
+
*/
|
|
9
|
+
export interface PaginationMeta {
|
|
10
|
+
page?: number;
|
|
11
|
+
limit?: number;
|
|
12
|
+
total?: number;
|
|
13
|
+
totalPages?: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Uploaded file object populated by multer middleware.
|
|
18
|
+
*/
|
|
19
|
+
export interface UploadedFile {
|
|
20
|
+
fieldname: string;
|
|
21
|
+
originalname: string;
|
|
22
|
+
encoding: string;
|
|
23
|
+
mimetype: string;
|
|
24
|
+
size: number;
|
|
25
|
+
destination: string;
|
|
26
|
+
filename: string;
|
|
27
|
+
path: string;
|
|
28
|
+
buffer?: Buffer;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Standard Bluebird API JSON response envelope.
|
|
33
|
+
*/
|
|
34
|
+
export interface ApiResponse<T = any> {
|
|
35
|
+
status: "success" | "error";
|
|
36
|
+
message: string;
|
|
37
|
+
data?: T;
|
|
38
|
+
errors?: any;
|
|
39
|
+
pagination?: PaginationMeta;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare global {
|
|
43
|
+
namespace Express {
|
|
44
|
+
interface Response {
|
|
45
|
+
/**
|
|
46
|
+
* Sends a standardized JSON success response.
|
|
47
|
+
* @param data Data payload to return.
|
|
48
|
+
* @param message Success message.
|
|
49
|
+
* @param statusCode HTTP status code (default: 200).
|
|
50
|
+
*/
|
|
51
|
+
success<T = any>(data?: T, message?: string, statusCode?: number): Response;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Sends a standardized HTTP 200 OK success response.
|
|
55
|
+
* @param data Data payload.
|
|
56
|
+
* @param message Success message.
|
|
57
|
+
*/
|
|
58
|
+
ok<T = any>(data?: T, message?: string): Response;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Sends a standardized HTTP 201 Created success response.
|
|
62
|
+
* @param data Data payload.
|
|
63
|
+
* @param message Success message.
|
|
64
|
+
*/
|
|
65
|
+
created<T = any>(data?: T, message?: string): Response;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Sends a standardized HTTP 400 Bad Request error response.
|
|
69
|
+
* @param message Error message.
|
|
70
|
+
* @param errors Detailed errors array or object.
|
|
71
|
+
*/
|
|
72
|
+
badRequest(message?: string, errors?: any): Response;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Sends a standardized HTTP 401 Unauthorized error response.
|
|
76
|
+
* @param message Error message.
|
|
77
|
+
*/
|
|
78
|
+
unauthorized(message?: string): Response;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Sends a standardized HTTP 403 Forbidden error response.
|
|
82
|
+
* @param message Error message.
|
|
83
|
+
*/
|
|
84
|
+
forbidden(message?: string): Response;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Sends a standardized HTTP 404 Not Found error response.
|
|
88
|
+
* @param message Error message.
|
|
89
|
+
*/
|
|
90
|
+
notFound(message?: string): Response;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Sends a standardized HTTP 500 Internal Server Error response.
|
|
94
|
+
* @param message Error message.
|
|
95
|
+
* @param errors Error details.
|
|
96
|
+
*/
|
|
97
|
+
serverError(message?: string, errors?: any): Response;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Sends a standardized JSON error response.
|
|
101
|
+
* @param message Error message.
|
|
102
|
+
* @param statusCode HTTP status code (default: 400).
|
|
103
|
+
* @param errors Array or object of detailed errors.
|
|
104
|
+
*/
|
|
105
|
+
error(message?: string, statusCode?: number, errors?: any): Response;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Sends a standardized paginated JSON response.
|
|
109
|
+
* @param data Array of records for current page.
|
|
110
|
+
* @param pagination Object containing page, limit, and total count.
|
|
111
|
+
* @param message Success message.
|
|
112
|
+
*/
|
|
113
|
+
paginate<T = any>(
|
|
114
|
+
data?: T[],
|
|
115
|
+
pagination?: PaginationMeta,
|
|
116
|
+
message?: string
|
|
117
|
+
): Response;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface Request {
|
|
121
|
+
lang?: string;
|
|
122
|
+
user?: any;
|
|
123
|
+
csrfToken?(): string;
|
|
124
|
+
file?: UploadedFile;
|
|
125
|
+
files?: UploadedFile[] | Record<string, UploadedFile[]>;
|
|
126
|
+
[key: string]: any;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export class AppError extends Error {
|
|
132
|
+
statusCode: number;
|
|
133
|
+
errors: any;
|
|
134
|
+
isOperational: boolean;
|
|
135
|
+
|
|
136
|
+
constructor(message: string, statusCode?: number, errors?: any);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* CORS configuration options.
|
|
141
|
+
*/
|
|
142
|
+
export interface CorsOptions {
|
|
143
|
+
origin?:
|
|
144
|
+
| string
|
|
145
|
+
| boolean
|
|
146
|
+
| string[]
|
|
147
|
+
| ((origin: string | undefined, req: Request) => boolean);
|
|
148
|
+
methods?: string | string[];
|
|
149
|
+
allowedHeaders?: string | string[];
|
|
150
|
+
exposedHeaders?: string | string[];
|
|
151
|
+
credentials?: boolean;
|
|
152
|
+
maxAge?: number;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Security response headers options.
|
|
157
|
+
*/
|
|
158
|
+
export interface SecurityHeadersOptions {
|
|
159
|
+
csp?: string | false;
|
|
160
|
+
frameOptions?: string;
|
|
161
|
+
referrerPolicy?: string;
|
|
162
|
+
permissionsPolicy?: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Static asset serving options.
|
|
167
|
+
*/
|
|
168
|
+
export interface AppStaticOptions {
|
|
169
|
+
path: string;
|
|
170
|
+
options?: Record<string, any>;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Rate limit configuration options.
|
|
175
|
+
*/
|
|
176
|
+
export interface RateLimitOptions {
|
|
177
|
+
windowMs?: number;
|
|
178
|
+
max?: number;
|
|
179
|
+
message?: string;
|
|
180
|
+
statusCode?: number;
|
|
181
|
+
headers?: boolean;
|
|
182
|
+
driver?: "memory" | "redis";
|
|
183
|
+
keyGenerator?: (req: Request) => string;
|
|
184
|
+
skip?: (req: Request) => boolean;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export class RateLimit {
|
|
188
|
+
static middleware(options?: RateLimitOptions | boolean): (req: Request, res: Response, next: NextFunction) => Promise<any>;
|
|
189
|
+
static clear(): void;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export class Seo {
|
|
193
|
+
static registerRoute(basePath: string, routePath: string | RegExp, languages?: string[]): void;
|
|
194
|
+
static getRoutes(): string[];
|
|
195
|
+
static clear(): void;
|
|
196
|
+
static generateSitemap(baseUrl?: string): string;
|
|
197
|
+
static generateRobots(baseUrl?: string, disallow?: string[]): string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* WebSocket manager configuration options.
|
|
202
|
+
*/
|
|
203
|
+
export interface WebSocketOptions {
|
|
204
|
+
path?: string;
|
|
205
|
+
auth?: boolean;
|
|
206
|
+
maxPayload?: number;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Active WebSocket client connection interface.
|
|
211
|
+
*/
|
|
212
|
+
export interface WebSocketClient {
|
|
213
|
+
isAlive?: boolean;
|
|
214
|
+
user?: any;
|
|
215
|
+
rooms?: Set<string>;
|
|
216
|
+
send(data: any): void;
|
|
217
|
+
on(event: string, handler: (...args: any[]) => void): void;
|
|
218
|
+
close(code?: number, reason?: string): void;
|
|
219
|
+
[key: string]: any;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export type WebSocketConnectionHandler = (ws: WebSocketClient, req: Request) => void;
|
|
223
|
+
|
|
224
|
+
export class WebSocketManager {
|
|
225
|
+
server: HttpServer;
|
|
226
|
+
path: string;
|
|
227
|
+
requireAuth: boolean;
|
|
228
|
+
maxPayload: number;
|
|
229
|
+
rooms: Map<string, Set<WebSocketClient>>;
|
|
230
|
+
clients: Set<WebSocketClient>;
|
|
231
|
+
|
|
232
|
+
constructor(server: HttpServer | any, options?: WebSocketOptions);
|
|
233
|
+
onConnection(handler: WebSocketConnectionHandler): void;
|
|
234
|
+
join(room: string, ws: WebSocketClient): void;
|
|
235
|
+
leave(room: string, ws: WebSocketClient): void;
|
|
236
|
+
broadcast(data: any, room?: string | null): void;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Application initialization options.
|
|
241
|
+
*/
|
|
242
|
+
export interface AppOptions {
|
|
243
|
+
routes?: Array<Router | ExpressRouter | any>;
|
|
244
|
+
cors?: boolean | CorsOptions;
|
|
245
|
+
middlewares?: Array<RequestHandler | any>;
|
|
246
|
+
port?: number | string;
|
|
247
|
+
host?: string;
|
|
248
|
+
appUrl?: string;
|
|
249
|
+
logger?: boolean;
|
|
250
|
+
notFound?: boolean;
|
|
251
|
+
json?: boolean | Record<string, any>;
|
|
252
|
+
urlencoded?: boolean | Record<string, any>;
|
|
253
|
+
static?: AppStaticOptions;
|
|
254
|
+
cookieParser?: boolean;
|
|
255
|
+
swagger?: boolean | SwaggerOptions;
|
|
256
|
+
compression?: boolean;
|
|
257
|
+
security?: boolean | SecurityHeadersOptions;
|
|
258
|
+
rateLimit?: boolean | RateLimitOptions;
|
|
259
|
+
desktop?: boolean;
|
|
260
|
+
userDataPath?: string;
|
|
261
|
+
trustProxy?: boolean | number | string;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export class App {
|
|
265
|
+
app: ExpressRouter | any;
|
|
266
|
+
server: HttpServer;
|
|
267
|
+
wsManager: WebSocketManager | null;
|
|
268
|
+
routes: any[];
|
|
269
|
+
cors: boolean | CorsOptions;
|
|
270
|
+
middlewares: any[];
|
|
271
|
+
port: number | string;
|
|
272
|
+
host: string;
|
|
273
|
+
appUrl: string;
|
|
274
|
+
logger: boolean;
|
|
275
|
+
notFound: boolean;
|
|
276
|
+
desktop: boolean;
|
|
277
|
+
trustProxy: boolean | number | string;
|
|
278
|
+
|
|
279
|
+
constructor(options?: AppOptions);
|
|
280
|
+
|
|
281
|
+
use(record: any): void;
|
|
282
|
+
set(key: string, value: any): void;
|
|
283
|
+
websocket(
|
|
284
|
+
options?:
|
|
285
|
+
| WebSocketConnectionHandler
|
|
286
|
+
| WebSocketOptions
|
|
287
|
+
): WebSocketManager;
|
|
288
|
+
getPort(): number;
|
|
289
|
+
getUrl(): string;
|
|
290
|
+
run(): Promise<any>;
|
|
291
|
+
runDesktop(): Promise<{ server: HttpServer; port: number; url: string }>;
|
|
292
|
+
close(): Promise<void>;
|
|
293
|
+
|
|
294
|
+
static helmet(options?: any): (req: Request, res: Response, next: NextFunction) => void;
|
|
295
|
+
static securityHeaders(options?: SecurityHeadersOptions): (req: Request, res: Response, next: NextFunction) => void;
|
|
296
|
+
static rateLimit(options?: RateLimitOptions | boolean): (req: Request, res: Response, next: NextFunction) => Promise<any>;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Router configuration options.
|
|
301
|
+
*/
|
|
302
|
+
export interface RouterOptions {
|
|
303
|
+
seo?: boolean;
|
|
304
|
+
languages?: string[];
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export class Router {
|
|
308
|
+
router: ExpressRouter;
|
|
309
|
+
path: string;
|
|
310
|
+
|
|
311
|
+
constructor(path?: string, options?: RouterOptions);
|
|
312
|
+
|
|
313
|
+
use(...middleware: Array<RequestHandler | any>): void;
|
|
314
|
+
get(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
|
|
315
|
+
post(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
|
|
316
|
+
put(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
|
|
317
|
+
delete(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
|
|
318
|
+
patch(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
|
|
319
|
+
options(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
|
|
320
|
+
getRouter(): ExpressRouter;
|
|
321
|
+
getPath(): string;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Validation rule configuration for a single field.
|
|
326
|
+
*/
|
|
327
|
+
export interface ValidationRule {
|
|
328
|
+
required?: boolean;
|
|
329
|
+
min?: number;
|
|
330
|
+
max?: number;
|
|
331
|
+
email?: boolean;
|
|
332
|
+
number?: boolean;
|
|
333
|
+
alpha?: boolean;
|
|
334
|
+
alphanumeric?: boolean;
|
|
335
|
+
boolean?: boolean;
|
|
336
|
+
date?: boolean;
|
|
337
|
+
url?: boolean;
|
|
338
|
+
in?: any[];
|
|
339
|
+
equals?: any;
|
|
340
|
+
password?: boolean;
|
|
341
|
+
pattern?: RegExp | string;
|
|
342
|
+
xss?: boolean;
|
|
343
|
+
messages?: Partial<
|
|
344
|
+
Record<
|
|
345
|
+
| "required"
|
|
346
|
+
| "min"
|
|
347
|
+
| "max"
|
|
348
|
+
| "email"
|
|
349
|
+
| "number"
|
|
350
|
+
| "alpha"
|
|
351
|
+
| "alphanumeric"
|
|
352
|
+
| "boolean"
|
|
353
|
+
| "date"
|
|
354
|
+
| "url"
|
|
355
|
+
| "in"
|
|
356
|
+
| "equals"
|
|
357
|
+
| "password"
|
|
358
|
+
| "pattern",
|
|
359
|
+
string
|
|
360
|
+
>
|
|
361
|
+
>;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Validator schema definition.
|
|
366
|
+
*/
|
|
367
|
+
export type ValidationSchema = Record<string, ValidationRule>;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Validation failure item.
|
|
371
|
+
*/
|
|
372
|
+
export interface ValidationError {
|
|
373
|
+
field: string;
|
|
374
|
+
message: string;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Validation output result.
|
|
379
|
+
*/
|
|
380
|
+
export interface ValidationResult {
|
|
381
|
+
success: boolean;
|
|
382
|
+
error: boolean;
|
|
383
|
+
errors: ValidationError[];
|
|
384
|
+
message: string[];
|
|
385
|
+
html?: string[];
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export class Validator {
|
|
389
|
+
schema: ValidationSchema;
|
|
390
|
+
lang_default: string | null;
|
|
391
|
+
messages: Record<string, any>;
|
|
392
|
+
|
|
393
|
+
constructor(schema: ValidationSchema, lang_default?: string, messages?: Record<string, any>);
|
|
394
|
+
middleware(): (req: Request, res: Response, next: NextFunction) => void;
|
|
395
|
+
validate(req: Request | Record<string, any>): Promise<ValidationResult>;
|
|
396
|
+
static xssMiddleware(): (req: Request, res: Response, next: NextFunction) => void;
|
|
397
|
+
static sanitizeObject<T = any>(obj: T): T;
|
|
398
|
+
static mutateSanitized(obj: any): void;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Password hashing options.
|
|
403
|
+
*/
|
|
404
|
+
export interface HashMakeOptions {
|
|
405
|
+
driver?: "scrypt" | "bcrypt";
|
|
406
|
+
rounds?: number;
|
|
407
|
+
N?: number;
|
|
408
|
+
r?: number;
|
|
409
|
+
p?: number;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export class Hash {
|
|
413
|
+
static make(password: string, options?: HashMakeOptions): Promise<string>;
|
|
414
|
+
static hash(password: string, options?: HashMakeOptions): Promise<string>;
|
|
415
|
+
static verify(password: string, hash: string): Promise<boolean>;
|
|
416
|
+
static check(password: string, hash: string): Promise<boolean>;
|
|
417
|
+
static needsRehash(hash: string, options?: HashMakeOptions): boolean;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Auth protect middleware options.
|
|
422
|
+
*/
|
|
423
|
+
export interface AuthProtectOptions {
|
|
424
|
+
redirect?: string | null;
|
|
425
|
+
key?: string;
|
|
426
|
+
cookieKey?: string;
|
|
427
|
+
secret?: string;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Auth login options.
|
|
432
|
+
*/
|
|
433
|
+
export interface AuthLoginOptions {
|
|
434
|
+
expiresIn?: string | number;
|
|
435
|
+
cookie?: Record<string, any>;
|
|
436
|
+
secret?: string;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Decoded Auth JWT token payload.
|
|
441
|
+
*/
|
|
442
|
+
export type AuthTokenPayload = Record<string, any> & {
|
|
443
|
+
_sessionId?: string;
|
|
444
|
+
exp?: number;
|
|
445
|
+
iat?: number;
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
export class Auth {
|
|
449
|
+
static encrypt(payload: any, secret?: string): string;
|
|
450
|
+
static decrypt<T = any>(data: string, secret?: string): T | null;
|
|
451
|
+
static generateToken(payload: any, secret?: string, expiresIn?: string | number): string;
|
|
452
|
+
static verifyToken<T = any>(token: string, secret?: string): T | null;
|
|
453
|
+
static protect(options?: AuthProtectOptions): (req: Request, res: Response, next: NextFunction) => Promise<any>;
|
|
454
|
+
static login(res: Response, data: any, key?: string, options?: AuthLoginOptions): Promise<string>;
|
|
455
|
+
static logout(res: Response, key?: string, options?: Record<string, any>, req?: Request | null): Promise<boolean>;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export type CacheDriver = "memory" | "redis" | "file";
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Cache middleware options.
|
|
462
|
+
*/
|
|
463
|
+
export interface CacheMiddlewareOptions {
|
|
464
|
+
driver?: "memory" | "redis";
|
|
465
|
+
allowAuthenticated?: boolean;
|
|
466
|
+
key?: (req: Request) => string;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Cache read options.
|
|
471
|
+
*/
|
|
472
|
+
export interface CacheGetOptions {
|
|
473
|
+
driver?: CacheDriver;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Cache write options.
|
|
478
|
+
*/
|
|
479
|
+
export interface CacheSetOptions {
|
|
480
|
+
driver?: CacheDriver;
|
|
481
|
+
fallbackDriver?: CacheDriver;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export class Cache {
|
|
485
|
+
static middleware(seconds?: number, options?: CacheMiddlewareOptions): (req: Request, res: Response, next: NextFunction) => Promise<any>;
|
|
486
|
+
static get<T = any>(key: string, options?: CacheGetOptions): Promise<T | null>;
|
|
487
|
+
static set(key: string, value: any, seconds?: number, options?: CacheSetOptions): Promise<boolean>;
|
|
488
|
+
static deduplicate<T = any>(key: string, loader: () => Promise<T>): Promise<T>;
|
|
489
|
+
static delete(keys: string | string[]): Promise<boolean>;
|
|
490
|
+
static del(keys: string | string[]): Promise<boolean>;
|
|
491
|
+
static deletePrefix(prefix: string): Promise<boolean>;
|
|
492
|
+
static clear(): Promise<boolean>;
|
|
493
|
+
static getMode(): string;
|
|
494
|
+
static size(): number;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export function getRedisClient(): any;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Render island options.
|
|
501
|
+
*/
|
|
502
|
+
export interface RenderIslandOptions {
|
|
503
|
+
persist?: boolean;
|
|
504
|
+
fallback?: string;
|
|
505
|
+
tag?: string;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export class Render {
|
|
509
|
+
static island(
|
|
510
|
+
name: string,
|
|
511
|
+
props?: Record<string, any>,
|
|
512
|
+
options?: RenderIslandOptions
|
|
513
|
+
): string;
|
|
514
|
+
static component(partialName: string, props?: Record<string, any>): Promise<string>;
|
|
515
|
+
static html(res: Response, relativePath: string, options?: { ttl?: number }): Promise<void>;
|
|
516
|
+
static send(res: Response, viewName: string, data?: Record<string, any>, ttl?: number): Promise<void>;
|
|
517
|
+
static partial(res: Response, partialName: string, data?: Record<string, any>, ttl?: number): Promise<void>;
|
|
518
|
+
static stream(res: Response, viewName: string, data?: Record<string, any>): Promise<void>;
|
|
519
|
+
static view(viewName: string, staticData?: Record<string, any>): (req: Request, res: Response) => void;
|
|
520
|
+
static cache(seconds?: number): (req: Request, res: Response, next: NextFunction) => Promise<any>;
|
|
521
|
+
static clearTemplateCache(): void;
|
|
522
|
+
static invalidate(keys?: string | string[]): Promise<void>;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export * from "./html.js";
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Vite integration options.
|
|
529
|
+
*/
|
|
530
|
+
export interface ViteOptions {
|
|
531
|
+
entry?: string;
|
|
532
|
+
viteUrl?: string;
|
|
533
|
+
debug?: boolean;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export class Vite {
|
|
537
|
+
static tags(options?: ViteOptions): string;
|
|
538
|
+
static clearCache(): void;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
export const DB_TYPE: "sqlite" | "postgres" | "mysql" | "none" | string;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Database query execution options.
|
|
545
|
+
*/
|
|
546
|
+
export interface DatabaseQueryOptions {
|
|
547
|
+
cache?: number;
|
|
548
|
+
cachePrefix?: string;
|
|
549
|
+
return_row?: boolean;
|
|
550
|
+
[key: string]: any;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Standard paginated query result.
|
|
555
|
+
*/
|
|
556
|
+
export interface PaginatedResult<T = any> {
|
|
557
|
+
data: T[];
|
|
558
|
+
total: number;
|
|
559
|
+
page: number;
|
|
560
|
+
limit: number;
|
|
561
|
+
totalPages: number;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Transaction runner client.
|
|
566
|
+
*/
|
|
567
|
+
export interface DatabaseTransactionClient {
|
|
568
|
+
query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
export class Database {
|
|
572
|
+
type: string;
|
|
573
|
+
constructor(connectionLimit?: number, queueLimit?: number, config?: any);
|
|
574
|
+
init(retries?: number): Promise<boolean>;
|
|
575
|
+
query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
|
|
576
|
+
paginate<T = any>(
|
|
577
|
+
sql: string,
|
|
578
|
+
params?: any[],
|
|
579
|
+
options?: { page?: number; limit?: number; cache?: number }
|
|
580
|
+
): Promise<PaginatedResult<T>>;
|
|
581
|
+
transaction<T = any>(callback: (tx: DatabaseTransactionClient) => Promise<T>): Promise<T>;
|
|
582
|
+
executeTransaction<T = any>(callback: (tx: DatabaseTransactionClient) => Promise<T>): Promise<T>;
|
|
583
|
+
close(): Promise<void>;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Queue dispatching options.
|
|
588
|
+
*/
|
|
589
|
+
export interface QueueDispatchOptions {
|
|
590
|
+
delayMs?: number;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Queue job item structure.
|
|
595
|
+
*/
|
|
596
|
+
export interface QueueJob<T = any> {
|
|
597
|
+
id: string;
|
|
598
|
+
name: string;
|
|
599
|
+
payload: T;
|
|
600
|
+
createdAt: string;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export type QueueHandler<T = any> = (payload: T) => Promise<any> | any;
|
|
604
|
+
|
|
605
|
+
export class Queue {
|
|
606
|
+
static process<T = any>(jobName: string, handler: QueueHandler<T>): void;
|
|
607
|
+
static dispatch<T = any>(jobName: string, payload?: T, options?: QueueDispatchOptions): Promise<boolean>;
|
|
608
|
+
static work(): Promise<void>;
|
|
609
|
+
static stop(): void;
|
|
610
|
+
static loadJobs(jobsDir?: string): Promise<void>;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* CSRF middleware options.
|
|
615
|
+
*/
|
|
616
|
+
export interface CsrfOptions {
|
|
617
|
+
cookieName?: string;
|
|
618
|
+
headerName?: string;
|
|
619
|
+
bodyKey?: string;
|
|
620
|
+
maxAgeMs?: number;
|
|
621
|
+
secret?: string;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
export class Csrf {
|
|
625
|
+
static generateToken(secret?: string): string;
|
|
626
|
+
static verifyToken(token: string, secret?: string, maxAgeMs?: number): boolean;
|
|
627
|
+
static middleware(options?: CsrfOptions): (req: Request, res: Response, next: NextFunction) => void;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
export interface ModelSchemaColumn {
|
|
631
|
+
type: "int" | "integer" | "bigint" | "string" | "text" | "boolean" | "date" | "float" | "json" | (string & {});
|
|
632
|
+
primary?: boolean;
|
|
633
|
+
auto?: boolean;
|
|
634
|
+
unique?: boolean;
|
|
635
|
+
required?: boolean;
|
|
636
|
+
nullable?: boolean;
|
|
637
|
+
default?: any;
|
|
638
|
+
hidden?: boolean;
|
|
639
|
+
length?: number;
|
|
640
|
+
min?: number;
|
|
641
|
+
max?: number;
|
|
642
|
+
email?: boolean;
|
|
643
|
+
hash?: boolean;
|
|
644
|
+
in?: any[];
|
|
645
|
+
references?: string;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Options for Model.find query.
|
|
650
|
+
*/
|
|
651
|
+
export interface ModelFindOptions {
|
|
652
|
+
withDeleted?: boolean;
|
|
653
|
+
withHidden?: boolean;
|
|
654
|
+
cache?: number;
|
|
655
|
+
oneMany?: typeof Model | Array<typeof Model>;
|
|
656
|
+
belongsTo?: typeof Model | Array<typeof Model>;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Options for Model.all query.
|
|
661
|
+
*/
|
|
662
|
+
export interface ModelAllOptions {
|
|
663
|
+
where?: Record<string, any>;
|
|
664
|
+
order?: string | string[];
|
|
665
|
+
limit?: number;
|
|
666
|
+
offset?: number;
|
|
667
|
+
withDeleted?: boolean;
|
|
668
|
+
withHidden?: boolean;
|
|
669
|
+
cache?: number;
|
|
670
|
+
oneMany?: typeof Model | Array<typeof Model>;
|
|
671
|
+
belongsTo?: typeof Model | Array<typeof Model>;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Options for Model.paginate query.
|
|
676
|
+
*/
|
|
677
|
+
export interface ModelPaginateOptions {
|
|
678
|
+
where?: Record<string, any>;
|
|
679
|
+
order?: string | string[];
|
|
680
|
+
page?: number;
|
|
681
|
+
limit?: number;
|
|
682
|
+
withDeleted?: boolean;
|
|
683
|
+
withHidden?: boolean;
|
|
684
|
+
cache?: number;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Options for Model.delete operation.
|
|
689
|
+
*/
|
|
690
|
+
export interface ModelDeleteOptions {
|
|
691
|
+
force?: boolean;
|
|
692
|
+
cascade?: Array<typeof Model>;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export class Model {
|
|
696
|
+
static table: string;
|
|
697
|
+
static primaryKey: string;
|
|
698
|
+
static timestamps: boolean;
|
|
699
|
+
static softDelete: boolean;
|
|
700
|
+
static schema: Record<string, ModelSchemaColumn>;
|
|
701
|
+
|
|
702
|
+
static getDatabase(): Database;
|
|
703
|
+
static setDatabase(db: Database): void;
|
|
704
|
+
static query<T = any>(sql: string, params?: any[], options?: any): Promise<T>;
|
|
705
|
+
static transaction<T = any>(callback: (tx: DatabaseTransactionClient | any) => Promise<T>): Promise<T>;
|
|
706
|
+
static invalidateCache(): Promise<void>;
|
|
707
|
+
static find<T = any>(
|
|
708
|
+
idOrConditions: number | string | Record<string, any>,
|
|
709
|
+
options?: ModelFindOptions
|
|
710
|
+
): Promise<T | null>;
|
|
711
|
+
static all<T = any>(options?: ModelAllOptions): Promise<T[]>;
|
|
712
|
+
static paginate<T = any>(options?: ModelPaginateOptions): Promise<PaginatedResult<T>>;
|
|
713
|
+
static create(data: Record<string, any>): Promise<number | string>;
|
|
714
|
+
static update(idOrConditions: number | string | Record<string, any>, data: Record<string, any>): Promise<number>;
|
|
715
|
+
static delete(
|
|
716
|
+
idOrConditions: number | string | Record<string, any>,
|
|
717
|
+
options?: ModelDeleteOptions
|
|
718
|
+
): Promise<number>;
|
|
719
|
+
static restore(idOrConditions: number | string | Record<string, any>): Promise<number>;
|
|
720
|
+
static validator(mode?: "create" | "update", lang?: string): Validator;
|
|
721
|
+
static toDDL(dialect?: "sqlite" | "mysql" | "postgres"): string;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
export interface UploadDiskOptions {
|
|
725
|
+
folder?: string;
|
|
726
|
+
fileSize?: number;
|
|
727
|
+
allowedTypes?: string[];
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export interface UploadMiddleware {
|
|
731
|
+
single(fieldName: string): (req: Request, res: Response, next: NextFunction) => void;
|
|
732
|
+
array(fieldName: string, maxCount?: number): (req: Request, res: Response, next: NextFunction) => void;
|
|
733
|
+
fields(fields: Array<{ name: string; maxCount?: number }>): (req: Request, res: Response, next: NextFunction) => void;
|
|
734
|
+
none(): (req: Request, res: Response, next: NextFunction) => void;
|
|
735
|
+
any(): (req: Request, res: Response, next: NextFunction) => void;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
export class Upload {
|
|
739
|
+
static storage(folder?: string): any;
|
|
740
|
+
static disk(options?: UploadDiskOptions): UploadMiddleware;
|
|
741
|
+
static url(filename: string, folder?: string): string;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
export interface SwaggerOptions {
|
|
745
|
+
route?: string;
|
|
746
|
+
url?: string;
|
|
747
|
+
info?: {
|
|
748
|
+
title?: string;
|
|
749
|
+
version?: string;
|
|
750
|
+
description?: string;
|
|
751
|
+
};
|
|
752
|
+
apis?: string[];
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
export class Swagger {
|
|
756
|
+
static init(app: any, options?: SwaggerOptions): Promise<boolean>;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
export interface AppProps {
|
|
760
|
+
debug: boolean;
|
|
761
|
+
desktop: boolean;
|
|
762
|
+
userDataDir: string;
|
|
763
|
+
title: string;
|
|
764
|
+
description: string;
|
|
765
|
+
version: string;
|
|
766
|
+
host: string;
|
|
767
|
+
appUrl: string;
|
|
768
|
+
port: number;
|
|
769
|
+
jwtSecret?: string;
|
|
770
|
+
langMeta: string;
|
|
771
|
+
static: { path: string; options: Record<string, any> };
|
|
772
|
+
descriptionMeta?: string;
|
|
773
|
+
keywordsMeta?: string;
|
|
774
|
+
titleMeta?: string;
|
|
775
|
+
authorMeta?: string;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
export class Config {
|
|
779
|
+
static dirname(): string;
|
|
780
|
+
static isDesktop(): boolean;
|
|
781
|
+
static setUserDataDir(customDir: string): void;
|
|
782
|
+
static userDataDir(): string;
|
|
783
|
+
static reload(): AppProps;
|
|
784
|
+
static props(): AppProps;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export class Logger {
|
|
788
|
+
folder: string;
|
|
789
|
+
constructor();
|
|
790
|
+
nowFolder(): string;
|
|
791
|
+
now(): string;
|
|
792
|
+
_log(file: string, level: string, message: string): void;
|
|
793
|
+
log(file: string, level: string, message: string): void;
|
|
794
|
+
info(message: string): void;
|
|
795
|
+
error(message: string): void;
|
|
796
|
+
warn(message: string): void;
|
|
797
|
+
warning(message: string): void;
|
|
798
|
+
debug(message: string): void;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
export class Debug {
|
|
802
|
+
constructor();
|
|
803
|
+
static shouldTrack(req: Request): boolean;
|
|
804
|
+
static middlewareMetrics(app: any): void;
|
|
805
|
+
getRouter(): { path: string; router: ExpressRouter };
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
export interface CommonMiddleware {
|
|
809
|
+
auth: (req: Request, res: Response, next: NextFunction) => Promise<any>;
|
|
810
|
+
webAuth: (req: Request, res: Response, next: NextFunction) => Promise<any>;
|
|
811
|
+
logger: (req: Request, res: Response, next: NextFunction) => void;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
export const Middleware: CommonMiddleware;
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Options for declarative client-side island hydration.
|
|
818
|
+
*/
|
|
819
|
+
export interface RenderIslandOptions {
|
|
820
|
+
tag?: string;
|
|
821
|
+
persist?: boolean;
|
|
822
|
+
fallback?: string;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Options for serving raw static HTML files.
|
|
827
|
+
*/
|
|
828
|
+
export interface RenderHtmlOptions {
|
|
829
|
+
ttl?: number;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Modern HTML and view rendering engine for Bluebird.js.
|
|
834
|
+
*/
|
|
835
|
+
export class Render {
|
|
836
|
+
static island(name: string, props?: Record<string, any>, options?: RenderIslandOptions): string;
|
|
837
|
+
static component(viewName: string, data?: Record<string, any>): Promise<string>;
|
|
838
|
+
static partial(res: Response, partialName: string, data?: Record<string, any>): Promise<any>;
|
|
839
|
+
static html(res: Response, relativePath: string, options?: RenderHtmlOptions): Promise<any>;
|
|
840
|
+
static send(res: Response, viewName: string, data?: Record<string, any>, ttl?: number): Promise<any>;
|
|
841
|
+
static view(viewName: string, staticData?: Record<string, any>): (req: Request, res: Response) => Promise<any>;
|
|
842
|
+
static cache(seconds?: number): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
843
|
+
static stream(res: Response, viewName: string, data?: Record<string, any>): Promise<void>;
|
|
844
|
+
static clearTemplateCache(): void;
|
|
845
|
+
static invalidate(keys?: string | string[]): Promise<void>;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* SafeHtml container class wrapping trusted or sanitized HTML markup.
|
|
850
|
+
*/
|
|
851
|
+
export class SafeHtml {
|
|
852
|
+
value: string;
|
|
853
|
+
constructor(value: string);
|
|
854
|
+
toString(): string;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
export function isSafeHtml(val: any): val is SafeHtml;
|
|
858
|
+
export function escapeHtml(value: any): string;
|
|
859
|
+
export function safeJson(data: any): string;
|
|
860
|
+
|
|
861
|
+
export interface HtmlTag {
|
|
862
|
+
(strings: TemplateStringsArray, ...values: any[]): SafeHtml;
|
|
863
|
+
raw(str: string): SafeHtml;
|
|
864
|
+
json(obj: any): SafeHtml;
|
|
865
|
+
script: typeof script;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
export const html: HtmlTag;
|
|
869
|
+
|
|
870
|
+
export interface ScriptTag {
|
|
871
|
+
(strings: TemplateStringsArray, ...values: any[]): SafeHtml;
|
|
872
|
+
(src: string): SafeHtml;
|
|
873
|
+
(options: { src: string; defer?: boolean; module?: boolean }): SafeHtml;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
export const script: ScriptTag;
|
|
877
|
+
|
|
878
|
+
export function cached(
|
|
879
|
+
key: string,
|
|
880
|
+
options: number | { ttl?: number; vary?: string[] },
|
|
881
|
+
renderFn: () => SafeHtml | string | Promise<SafeHtml | string>
|
|
882
|
+
): Promise<SafeHtml>;
|
|
883
|
+
|
|
884
|
+
export function defer<T>(
|
|
885
|
+
promise: Promise<T>,
|
|
886
|
+
fallback: SafeHtml | string,
|
|
887
|
+
renderer: (data: T) => SafeHtml | string | Promise<SafeHtml | string>
|
|
888
|
+
): { __bluebird_deferred__: true; promise: Promise<T>; fallback: string; renderer: Function };
|
|
889
|
+
|
|
890
|
+
export default App;
|
|
891
|
+
|
|
892
|
+
declare module "@seip/bluebird-js/core/model.js" {
|
|
893
|
+
import {
|
|
894
|
+
Model,
|
|
895
|
+
ModelSchemaColumn,
|
|
896
|
+
ModelFindOptions,
|
|
897
|
+
ModelAllOptions,
|
|
898
|
+
ModelPaginateOptions,
|
|
899
|
+
ModelDeleteOptions,
|
|
900
|
+
PaginatedResult,
|
|
901
|
+
} from "@seip/bluebird-js";
|
|
902
|
+
export {
|
|
903
|
+
Model,
|
|
904
|
+
ModelSchemaColumn,
|
|
905
|
+
ModelFindOptions,
|
|
906
|
+
ModelAllOptions,
|
|
907
|
+
ModelPaginateOptions,
|
|
908
|
+
ModelDeleteOptions,
|
|
909
|
+
PaginatedResult,
|
|
910
|
+
};
|
|
911
|
+
export default Model;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
declare module "@seip/bluebird-js/core/app.js" {
|
|
915
|
+
import App, {
|
|
916
|
+
AppError,
|
|
917
|
+
WebSocketManager,
|
|
918
|
+
AppOptions,
|
|
919
|
+
CorsOptions,
|
|
920
|
+
SecurityHeadersOptions,
|
|
921
|
+
AppStaticOptions,
|
|
922
|
+
} from "@seip/bluebird-js";
|
|
923
|
+
export {
|
|
924
|
+
App,
|
|
925
|
+
AppError,
|
|
926
|
+
WebSocketManager,
|
|
927
|
+
AppOptions,
|
|
928
|
+
CorsOptions,
|
|
929
|
+
SecurityHeadersOptions,
|
|
930
|
+
AppStaticOptions,
|
|
931
|
+
};
|
|
932
|
+
export default App;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
declare module "@seip/bluebird-js/core/router.js" {
|
|
936
|
+
import { Router, RouterOptions } from "@seip/bluebird-js";
|
|
937
|
+
export { Router, RouterOptions };
|
|
938
|
+
export default Router;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
declare module "@seip/bluebird-js/core/render.js" {
|
|
942
|
+
import { Render, RenderIslandOptions, RenderHtmlOptions } from "@seip/bluebird-js";
|
|
943
|
+
export { Render, RenderIslandOptions, RenderHtmlOptions };
|
|
944
|
+
export default Render;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
declare module "@seip/bluebird-js/core/html.js" {
|
|
948
|
+
import {
|
|
949
|
+
SafeHtml,
|
|
950
|
+
isSafeHtml,
|
|
951
|
+
escapeHtml,
|
|
952
|
+
safeJson,
|
|
953
|
+
HtmlTag,
|
|
954
|
+
html,
|
|
955
|
+
ScriptTag,
|
|
956
|
+
script,
|
|
957
|
+
cached,
|
|
958
|
+
defer,
|
|
959
|
+
} from "@seip/bluebird-js";
|
|
960
|
+
export {
|
|
961
|
+
SafeHtml,
|
|
962
|
+
isSafeHtml,
|
|
963
|
+
escapeHtml,
|
|
964
|
+
safeJson,
|
|
965
|
+
HtmlTag,
|
|
966
|
+
html,
|
|
967
|
+
ScriptTag,
|
|
968
|
+
script,
|
|
969
|
+
cached,
|
|
970
|
+
defer,
|
|
971
|
+
};
|
|
972
|
+
export default html;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
declare module "@seip/bluebird-js/core/validate.js" {
|
|
976
|
+
import {
|
|
977
|
+
Validator,
|
|
978
|
+
ValidationRule,
|
|
979
|
+
ValidationSchema,
|
|
980
|
+
ValidationError,
|
|
981
|
+
ValidationResult,
|
|
982
|
+
} from "@seip/bluebird-js";
|
|
983
|
+
export {
|
|
984
|
+
Validator,
|
|
985
|
+
ValidationRule,
|
|
986
|
+
ValidationSchema,
|
|
987
|
+
ValidationError,
|
|
988
|
+
ValidationResult,
|
|
989
|
+
};
|
|
990
|
+
export default Validator;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
declare module "@seip/bluebird-js/core/database.js" {
|
|
994
|
+
import {
|
|
995
|
+
Database,
|
|
996
|
+
DB_TYPE,
|
|
997
|
+
DatabaseQueryOptions,
|
|
998
|
+
DatabaseTransactionClient,
|
|
999
|
+
PaginatedResult,
|
|
1000
|
+
} from "@seip/bluebird-js";
|
|
1001
|
+
export {
|
|
1002
|
+
Database,
|
|
1003
|
+
DB_TYPE,
|
|
1004
|
+
DatabaseQueryOptions,
|
|
1005
|
+
DatabaseTransactionClient,
|
|
1006
|
+
PaginatedResult,
|
|
1007
|
+
};
|
|
1008
|
+
export default Database;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
declare module "@seip/bluebird-js/core/auth.js" {
|
|
1012
|
+
import {
|
|
1013
|
+
Auth,
|
|
1014
|
+
AuthProtectOptions,
|
|
1015
|
+
AuthLoginOptions,
|
|
1016
|
+
AuthTokenPayload,
|
|
1017
|
+
} from "@seip/bluebird-js";
|
|
1018
|
+
export {
|
|
1019
|
+
Auth,
|
|
1020
|
+
AuthProtectOptions,
|
|
1021
|
+
AuthLoginOptions,
|
|
1022
|
+
AuthTokenPayload,
|
|
1023
|
+
};
|
|
1024
|
+
export default Auth;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
declare module "@seip/bluebird-js/core/cache.js" {
|
|
1028
|
+
import {
|
|
1029
|
+
Cache,
|
|
1030
|
+
getRedisClient,
|
|
1031
|
+
CacheDriver,
|
|
1032
|
+
CacheMiddlewareOptions,
|
|
1033
|
+
CacheGetOptions,
|
|
1034
|
+
CacheSetOptions,
|
|
1035
|
+
} from "@seip/bluebird-js";
|
|
1036
|
+
export {
|
|
1037
|
+
Cache,
|
|
1038
|
+
getRedisClient,
|
|
1039
|
+
CacheDriver,
|
|
1040
|
+
CacheMiddlewareOptions,
|
|
1041
|
+
CacheGetOptions,
|
|
1042
|
+
CacheSetOptions,
|
|
1043
|
+
};
|
|
1044
|
+
export default Cache;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
declare module "@seip/bluebird-js/core/redis.js" {
|
|
1048
|
+
export function initRedis(): Promise<any>;
|
|
1049
|
+
export function getRedisClient(): any;
|
|
1050
|
+
export function isRedisConnectedStatus(): boolean;
|
|
1051
|
+
export function redisGet(key: string): Promise<any>;
|
|
1052
|
+
export function redisSet(key: string, value: any, seconds?: number): Promise<boolean>;
|
|
1053
|
+
export function redisDel(keys: string | string[]): Promise<boolean>;
|
|
1054
|
+
export function redisClearPrefix(prefix: string): Promise<boolean>;
|
|
1055
|
+
export function disconnectRedis(): Promise<void>;
|
|
1056
|
+
|
|
1057
|
+
const redisHandler: {
|
|
1058
|
+
initRedis: typeof initRedis;
|
|
1059
|
+
getRedisClient: typeof getRedisClient;
|
|
1060
|
+
isRedisConnectedStatus: typeof isRedisConnectedStatus;
|
|
1061
|
+
redisGet: typeof redisGet;
|
|
1062
|
+
redisSet: typeof redisSet;
|
|
1063
|
+
redisDel: typeof redisDel;
|
|
1064
|
+
redisClearPrefix: typeof redisClearPrefix;
|
|
1065
|
+
disconnectRedis: typeof disconnectRedis;
|
|
1066
|
+
};
|
|
1067
|
+
export default redisHandler;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
declare module "@seip/bluebird-js/core/csrf.js" {
|
|
1071
|
+
import { Csrf, CsrfOptions } from "@seip/bluebird-js";
|
|
1072
|
+
export { Csrf, CsrfOptions };
|
|
1073
|
+
export default Csrf;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
declare module "@seip/bluebird-js/core/hash.js" {
|
|
1077
|
+
import { Hash, HashMakeOptions } from "@seip/bluebird-js";
|
|
1078
|
+
export { Hash, HashMakeOptions };
|
|
1079
|
+
export default Hash;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
declare module "@seip/bluebird-js/core/queue.js" {
|
|
1083
|
+
import {
|
|
1084
|
+
Queue,
|
|
1085
|
+
QueueDispatchOptions,
|
|
1086
|
+
QueueJob,
|
|
1087
|
+
QueueHandler,
|
|
1088
|
+
} from "@seip/bluebird-js";
|
|
1089
|
+
export {
|
|
1090
|
+
Queue,
|
|
1091
|
+
QueueDispatchOptions,
|
|
1092
|
+
QueueJob,
|
|
1093
|
+
QueueHandler,
|
|
1094
|
+
};
|
|
1095
|
+
export default Queue;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
declare module "@seip/bluebird-js/core/upload.js" {
|
|
1099
|
+
import {
|
|
1100
|
+
Upload,
|
|
1101
|
+
UploadDiskOptions,
|
|
1102
|
+
UploadMiddleware,
|
|
1103
|
+
UploadedFile,
|
|
1104
|
+
} from "@seip/bluebird-js";
|
|
1105
|
+
export {
|
|
1106
|
+
Upload,
|
|
1107
|
+
UploadDiskOptions,
|
|
1108
|
+
UploadMiddleware,
|
|
1109
|
+
UploadedFile,
|
|
1110
|
+
};
|
|
1111
|
+
export default Upload;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
declare module "@seip/bluebird-js/core/ws.js" {
|
|
1115
|
+
import {
|
|
1116
|
+
WebSocketManager,
|
|
1117
|
+
WebSocketOptions,
|
|
1118
|
+
WebSocketClient,
|
|
1119
|
+
WebSocketConnectionHandler,
|
|
1120
|
+
} from "@seip/bluebird-js";
|
|
1121
|
+
export {
|
|
1122
|
+
WebSocketManager,
|
|
1123
|
+
WebSocketOptions,
|
|
1124
|
+
WebSocketClient,
|
|
1125
|
+
WebSocketConnectionHandler,
|
|
1126
|
+
};
|
|
1127
|
+
export default WebSocketManager;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
declare module "@seip/bluebird-js/core/swagger.js" {
|
|
1131
|
+
import { Swagger, SwaggerOptions } from "@seip/bluebird-js";
|
|
1132
|
+
export { Swagger, SwaggerOptions };
|
|
1133
|
+
export default Swagger;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
declare module "@seip/bluebird-js/core/logger.js" {
|
|
1137
|
+
import { Logger } from "@seip/bluebird-js";
|
|
1138
|
+
export { Logger };
|
|
1139
|
+
export default Logger;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
declare module "@seip/bluebird-js/core/config.js" {
|
|
1143
|
+
import { Config, AppProps } from "@seip/bluebird-js";
|
|
1144
|
+
export { Config, AppProps };
|
|
1145
|
+
export default Config;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
declare module "@seip/bluebird-js/core/debug.js" {
|
|
1149
|
+
import { Debug } from "@seip/bluebird-js";
|
|
1150
|
+
export { Debug };
|
|
1151
|
+
export default Debug;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
declare module "@seip/bluebird-js/core/middleware.js" {
|
|
1155
|
+
import { Middleware, CommonMiddleware } from "@seip/bluebird-js";
|
|
1156
|
+
export { Middleware, CommonMiddleware };
|
|
1157
|
+
export default Middleware;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
declare module "@seip/bluebird-js/core/vite.js" {
|
|
1161
|
+
import { Vite, ViteOptions } from "@seip/bluebird-js";
|
|
1162
|
+
export { Vite, ViteOptions };
|
|
1163
|
+
export default Vite;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
declare module "@seip/bluebird-js/core/ratelimit.js" {
|
|
1167
|
+
import { RateLimit, RateLimitOptions } from "@seip/bluebird-js";
|
|
1168
|
+
export { RateLimit, RateLimitOptions };
|
|
1169
|
+
export default RateLimit;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
declare module "@seip/bluebird-js/core/seo.js" {
|
|
1173
|
+
import { Seo } from "@seip/bluebird-js";
|
|
1174
|
+
export { Seo };
|
|
1175
|
+
export default Seo;
|
|
1176
|
+
}
|