@seip/bluebird-js 0.0.1 → 0.1.1

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.
Files changed (81) hide show
  1. package/.env_example +53 -53
  2. package/AGENTS.md +426 -403
  3. package/LICENSE +1 -1
  4. package/README.md +292 -285
  5. package/app/routes/api.js +50 -50
  6. package/app/routes/web.js +55 -53
  7. package/app/views/about.js +63 -0
  8. package/app/views/dashboard.js +147 -0
  9. package/app/views/index.js +80 -0
  10. package/app/views/layouts/main/view.js +81 -0
  11. package/app/views/legal/terms.html +19 -0
  12. package/app/views/login.js +80 -0
  13. package/core/app.d.ts +18 -18
  14. package/core/app.js +684 -644
  15. package/core/auth.d.ts +13 -13
  16. package/core/auth.js +326 -326
  17. package/core/cache.d.ts +17 -17
  18. package/core/cache.js +475 -475
  19. package/core/cli/doctor.js +287 -287
  20. package/core/cli/ecosystem.js +162 -162
  21. package/core/cli/init.js +779 -779
  22. package/core/cli/migrate.js +541 -541
  23. package/core/cli/model.js +66 -66
  24. package/core/cli/nginx.js +199 -199
  25. package/core/cli/route.js +120 -120
  26. package/core/cli/view.js +55 -36
  27. package/core/config.d.ts +3 -3
  28. package/core/config.js +111 -111
  29. package/core/csrf.d.ts +3 -3
  30. package/core/csrf.js +114 -114
  31. package/core/database.d.ts +15 -15
  32. package/core/database.js +636 -636
  33. package/core/debug.d.ts +3 -3
  34. package/core/debug.js +249 -249
  35. package/core/hash.d.ts +3 -3
  36. package/core/hash.js +194 -194
  37. package/core/html.d.ts +42 -0
  38. package/core/html.js +217 -0
  39. package/core/index.d.ts +1176 -1071
  40. package/core/logger.d.ts +3 -3
  41. package/core/logger.js +127 -124
  42. package/core/middleware.d.ts +3 -3
  43. package/core/middleware.js +28 -28
  44. package/core/model.d.ts +19 -19
  45. package/core/model.js +600 -600
  46. package/core/queue.d.ts +13 -13
  47. package/core/queue.js +172 -172
  48. package/core/ratelimit.d.ts +3 -3
  49. package/core/ratelimit.js +145 -145
  50. package/core/redis.d.ts +21 -21
  51. package/core/redis.js +230 -230
  52. package/core/render-cache.js +212 -0
  53. package/core/render.d.ts +3 -3
  54. package/core/render.js +199 -555
  55. package/core/router.d.ts +3 -3
  56. package/core/router.js +171 -171
  57. package/core/seo.d.ts +3 -3
  58. package/core/seo.js +106 -106
  59. package/core/swagger.d.ts +3 -3
  60. package/core/swagger.js +60 -60
  61. package/core/upload.d.ts +13 -13
  62. package/core/upload.js +102 -102
  63. package/core/util/colors.js +82 -82
  64. package/core/validate.d.ts +15 -15
  65. package/core/validate.js +364 -364
  66. package/core/view-loader.js +162 -0
  67. package/core/vite.d.ts +3 -3
  68. package/core/vite.js +145 -145
  69. package/core/ws.d.ts +13 -13
  70. package/core/ws.js +245 -245
  71. package/index.js +18 -18
  72. package/jsconfig.json +15 -15
  73. package/package.json +85 -86
  74. package/production.md +273 -273
  75. package/public/css/bluebird.min.css +1 -1
  76. package/public/js/bluebird-client.js +1780 -1662
  77. package/public/js/bluebird.min.js +1072 -1072
  78. package/app/views/about.html +0 -161
  79. package/app/views/dashboard.html +0 -140
  80. package/app/views/index.html +0 -150
  81. package/app/views/login.html +0 -144
package/core/index.d.ts CHANGED
@@ -1,1071 +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 send(res: Response, viewName: string, data?: Record<string, any>, ttl?: number): Promise<void>;
516
- static partial(res: Response, partialName: string, data?: Record<string, any>, ttl?: number): Promise<void>;
517
- static stream(res: Response, viewName: string, data?: Record<string, any>): Promise<void>;
518
- static view(viewName: string, staticData?: Record<string, any>): (req: Request, res: Response) => void;
519
- static cache(seconds?: number): (req: Request, res: Response, next: NextFunction) => Promise<any>;
520
- static clearTemplateCache(): void;
521
- static invalidate(keys?: string | string[]): Promise<void>;
522
- }
523
-
524
- /**
525
- * Vite integration options.
526
- */
527
- export interface ViteOptions {
528
- entry?: string;
529
- viteUrl?: string;
530
- debug?: boolean;
531
- }
532
-
533
- export class Vite {
534
- static tags(options?: ViteOptions): string;
535
- static clearCache(): void;
536
- }
537
-
538
- export const DB_TYPE: "sqlite" | "postgres" | "mysql" | "none" | string;
539
-
540
- /**
541
- * Database query execution options.
542
- */
543
- export interface DatabaseQueryOptions {
544
- cache?: number;
545
- cachePrefix?: string;
546
- return_row?: boolean;
547
- [key: string]: any;
548
- }
549
-
550
- /**
551
- * Standard paginated query result.
552
- */
553
- export interface PaginatedResult<T = any> {
554
- data: T[];
555
- total: number;
556
- page: number;
557
- limit: number;
558
- totalPages: number;
559
- }
560
-
561
- /**
562
- * Transaction runner client.
563
- */
564
- export interface DatabaseTransactionClient {
565
- query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
566
- }
567
-
568
- export class Database {
569
- type: string;
570
- constructor(connectionLimit?: number, queueLimit?: number, config?: any);
571
- init(retries?: number): Promise<boolean>;
572
- query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
573
- paginate<T = any>(
574
- sql: string,
575
- params?: any[],
576
- options?: { page?: number; limit?: number; cache?: number }
577
- ): Promise<PaginatedResult<T>>;
578
- transaction<T = any>(callback: (tx: DatabaseTransactionClient) => Promise<T>): Promise<T>;
579
- executeTransaction<T = any>(callback: (tx: DatabaseTransactionClient) => Promise<T>): Promise<T>;
580
- close(): Promise<void>;
581
- }
582
-
583
- /**
584
- * Queue dispatching options.
585
- */
586
- export interface QueueDispatchOptions {
587
- delayMs?: number;
588
- }
589
-
590
- /**
591
- * Queue job item structure.
592
- */
593
- export interface QueueJob<T = any> {
594
- id: string;
595
- name: string;
596
- payload: T;
597
- createdAt: string;
598
- }
599
-
600
- export type QueueHandler<T = any> = (payload: T) => Promise<any> | any;
601
-
602
- export class Queue {
603
- static process<T = any>(jobName: string, handler: QueueHandler<T>): void;
604
- static dispatch<T = any>(jobName: string, payload?: T, options?: QueueDispatchOptions): Promise<boolean>;
605
- static work(): Promise<void>;
606
- static stop(): void;
607
- static loadJobs(jobsDir?: string): Promise<void>;
608
- }
609
-
610
- /**
611
- * CSRF middleware options.
612
- */
613
- export interface CsrfOptions {
614
- cookieName?: string;
615
- headerName?: string;
616
- bodyKey?: string;
617
- maxAgeMs?: number;
618
- secret?: string;
619
- }
620
-
621
- export class Csrf {
622
- static generateToken(secret?: string): string;
623
- static verifyToken(token: string, secret?: string, maxAgeMs?: number): boolean;
624
- static middleware(options?: CsrfOptions): (req: Request, res: Response, next: NextFunction) => void;
625
- }
626
-
627
- export interface ModelSchemaColumn {
628
- type: "int" | "integer" | "bigint" | "string" | "text" | "boolean" | "date" | "float" | "json" | (string & {});
629
- primary?: boolean;
630
- auto?: boolean;
631
- unique?: boolean;
632
- required?: boolean;
633
- nullable?: boolean;
634
- default?: any;
635
- hidden?: boolean;
636
- length?: number;
637
- min?: number;
638
- max?: number;
639
- email?: boolean;
640
- hash?: boolean;
641
- in?: any[];
642
- references?: string;
643
- }
644
-
645
- /**
646
- * Options for Model.find query.
647
- */
648
- export interface ModelFindOptions {
649
- withDeleted?: boolean;
650
- withHidden?: boolean;
651
- cache?: number;
652
- oneMany?: typeof Model | Array<typeof Model>;
653
- belongsTo?: typeof Model | Array<typeof Model>;
654
- }
655
-
656
- /**
657
- * Options for Model.all query.
658
- */
659
- export interface ModelAllOptions {
660
- where?: Record<string, any>;
661
- order?: string | string[];
662
- limit?: number;
663
- offset?: number;
664
- withDeleted?: boolean;
665
- withHidden?: boolean;
666
- cache?: number;
667
- oneMany?: typeof Model | Array<typeof Model>;
668
- belongsTo?: typeof Model | Array<typeof Model>;
669
- }
670
-
671
- /**
672
- * Options for Model.paginate query.
673
- */
674
- export interface ModelPaginateOptions {
675
- where?: Record<string, any>;
676
- order?: string | string[];
677
- page?: number;
678
- limit?: number;
679
- withDeleted?: boolean;
680
- withHidden?: boolean;
681
- cache?: number;
682
- }
683
-
684
- /**
685
- * Options for Model.delete operation.
686
- */
687
- export interface ModelDeleteOptions {
688
- force?: boolean;
689
- cascade?: Array<typeof Model>;
690
- }
691
-
692
- export class Model {
693
- static table: string;
694
- static primaryKey: string;
695
- static timestamps: boolean;
696
- static softDelete: boolean;
697
- static schema: Record<string, ModelSchemaColumn>;
698
-
699
- static getDatabase(): Database;
700
- static setDatabase(db: Database): void;
701
- static query<T = any>(sql: string, params?: any[], options?: any): Promise<T>;
702
- static transaction<T = any>(callback: (tx: DatabaseTransactionClient | any) => Promise<T>): Promise<T>;
703
- static invalidateCache(): Promise<void>;
704
- static find<T = any>(
705
- idOrConditions: number | string | Record<string, any>,
706
- options?: ModelFindOptions
707
- ): Promise<T | null>;
708
- static all<T = any>(options?: ModelAllOptions): Promise<T[]>;
709
- static paginate<T = any>(options?: ModelPaginateOptions): Promise<PaginatedResult<T>>;
710
- static create(data: Record<string, any>): Promise<number | string>;
711
- static update(idOrConditions: number | string | Record<string, any>, data: Record<string, any>): Promise<number>;
712
- static delete(
713
- idOrConditions: number | string | Record<string, any>,
714
- options?: ModelDeleteOptions
715
- ): Promise<number>;
716
- static restore(idOrConditions: number | string | Record<string, any>): Promise<number>;
717
- static validator(mode?: "create" | "update", lang?: string): Validator;
718
- static toDDL(dialect?: "sqlite" | "mysql" | "postgres"): string;
719
- }
720
-
721
- export interface UploadDiskOptions {
722
- folder?: string;
723
- fileSize?: number;
724
- allowedTypes?: string[];
725
- }
726
-
727
- export interface UploadMiddleware {
728
- single(fieldName: string): (req: Request, res: Response, next: NextFunction) => void;
729
- array(fieldName: string, maxCount?: number): (req: Request, res: Response, next: NextFunction) => void;
730
- fields(fields: Array<{ name: string; maxCount?: number }>): (req: Request, res: Response, next: NextFunction) => void;
731
- none(): (req: Request, res: Response, next: NextFunction) => void;
732
- any(): (req: Request, res: Response, next: NextFunction) => void;
733
- }
734
-
735
- export class Upload {
736
- static storage(folder?: string): any;
737
- static disk(options?: UploadDiskOptions): UploadMiddleware;
738
- static url(filename: string, folder?: string): string;
739
- }
740
-
741
- export interface SwaggerOptions {
742
- route?: string;
743
- url?: string;
744
- info?: {
745
- title?: string;
746
- version?: string;
747
- description?: string;
748
- };
749
- apis?: string[];
750
- }
751
-
752
- export class Swagger {
753
- static init(app: any, options?: SwaggerOptions): Promise<boolean>;
754
- }
755
-
756
- export interface AppProps {
757
- debug: boolean;
758
- desktop: boolean;
759
- userDataDir: string;
760
- title: string;
761
- description: string;
762
- version: string;
763
- host: string;
764
- appUrl: string;
765
- port: number;
766
- jwtSecret?: string;
767
- langMeta: string;
768
- static: { path: string; options: Record<string, any> };
769
- descriptionMeta?: string;
770
- keywordsMeta?: string;
771
- titleMeta?: string;
772
- authorMeta?: string;
773
- }
774
-
775
- export class Config {
776
- static dirname(): string;
777
- static isDesktop(): boolean;
778
- static setUserDataDir(customDir: string): void;
779
- static userDataDir(): string;
780
- static reload(): AppProps;
781
- static props(): AppProps;
782
- }
783
-
784
- export class Logger {
785
- folder: string;
786
- constructor();
787
- nowFolder(): string;
788
- now(): string;
789
- _log(file: string, level: string, message: string): void;
790
- log(file: string, level: string, message: string): void;
791
- info(message: string): void;
792
- error(message: string): void;
793
- warn(message: string): void;
794
- warning(message: string): void;
795
- debug(message: string): void;
796
- }
797
-
798
- export class Debug {
799
- constructor();
800
- static shouldTrack(req: Request): boolean;
801
- static middlewareMetrics(app: any): void;
802
- getRouter(): { path: string; router: ExpressRouter };
803
- }
804
-
805
- export interface CommonMiddleware {
806
- auth: (req: Request, res: Response, next: NextFunction) => Promise<any>;
807
- webAuth: (req: Request, res: Response, next: NextFunction) => Promise<any>;
808
- logger: (req: Request, res: Response, next: NextFunction) => void;
809
- }
810
-
811
- export const Middleware: CommonMiddleware;
812
-
813
- export default App;
814
-
815
- declare module "@seip/bluebird-js/core/model.js" {
816
- import {
817
- Model,
818
- ModelSchemaColumn,
819
- ModelFindOptions,
820
- ModelAllOptions,
821
- ModelPaginateOptions,
822
- ModelDeleteOptions,
823
- PaginatedResult,
824
- } from "@seip/bluebird-js";
825
- export {
826
- Model,
827
- ModelSchemaColumn,
828
- ModelFindOptions,
829
- ModelAllOptions,
830
- ModelPaginateOptions,
831
- ModelDeleteOptions,
832
- PaginatedResult,
833
- };
834
- export default Model;
835
- }
836
-
837
- declare module "@seip/bluebird-js/core/app.js" {
838
- import App, {
839
- AppError,
840
- WebSocketManager,
841
- AppOptions,
842
- CorsOptions,
843
- SecurityHeadersOptions,
844
- AppStaticOptions,
845
- } from "@seip/bluebird-js";
846
- export {
847
- App,
848
- AppError,
849
- WebSocketManager,
850
- AppOptions,
851
- CorsOptions,
852
- SecurityHeadersOptions,
853
- AppStaticOptions,
854
- };
855
- export default App;
856
- }
857
-
858
- declare module "@seip/bluebird-js/core/router.js" {
859
- import { Router, RouterOptions } from "@seip/bluebird-js";
860
- export { Router, RouterOptions };
861
- export default Router;
862
- }
863
-
864
- declare module "@seip/bluebird-js/core/render.js" {
865
- import { Render, RenderIslandOptions } from "@seip/bluebird-js";
866
- export { Render, RenderIslandOptions };
867
- export default Render;
868
- }
869
-
870
- declare module "@seip/bluebird-js/core/validate.js" {
871
- import {
872
- Validator,
873
- ValidationRule,
874
- ValidationSchema,
875
- ValidationError,
876
- ValidationResult,
877
- } from "@seip/bluebird-js";
878
- export {
879
- Validator,
880
- ValidationRule,
881
- ValidationSchema,
882
- ValidationError,
883
- ValidationResult,
884
- };
885
- export default Validator;
886
- }
887
-
888
- declare module "@seip/bluebird-js/core/database.js" {
889
- import {
890
- Database,
891
- DB_TYPE,
892
- DatabaseQueryOptions,
893
- DatabaseTransactionClient,
894
- PaginatedResult,
895
- } from "@seip/bluebird-js";
896
- export {
897
- Database,
898
- DB_TYPE,
899
- DatabaseQueryOptions,
900
- DatabaseTransactionClient,
901
- PaginatedResult,
902
- };
903
- export default Database;
904
- }
905
-
906
- declare module "@seip/bluebird-js/core/auth.js" {
907
- import {
908
- Auth,
909
- AuthProtectOptions,
910
- AuthLoginOptions,
911
- AuthTokenPayload,
912
- } from "@seip/bluebird-js";
913
- export {
914
- Auth,
915
- AuthProtectOptions,
916
- AuthLoginOptions,
917
- AuthTokenPayload,
918
- };
919
- export default Auth;
920
- }
921
-
922
- declare module "@seip/bluebird-js/core/cache.js" {
923
- import {
924
- Cache,
925
- getRedisClient,
926
- CacheDriver,
927
- CacheMiddlewareOptions,
928
- CacheGetOptions,
929
- CacheSetOptions,
930
- } from "@seip/bluebird-js";
931
- export {
932
- Cache,
933
- getRedisClient,
934
- CacheDriver,
935
- CacheMiddlewareOptions,
936
- CacheGetOptions,
937
- CacheSetOptions,
938
- };
939
- export default Cache;
940
- }
941
-
942
- declare module "@seip/bluebird-js/core/redis.js" {
943
- export function initRedis(): Promise<any>;
944
- export function getRedisClient(): any;
945
- export function isRedisConnectedStatus(): boolean;
946
- export function redisGet(key: string): Promise<any>;
947
- export function redisSet(key: string, value: any, seconds?: number): Promise<boolean>;
948
- export function redisDel(keys: string | string[]): Promise<boolean>;
949
- export function redisClearPrefix(prefix: string): Promise<boolean>;
950
- export function disconnectRedis(): Promise<void>;
951
-
952
- const redisHandler: {
953
- initRedis: typeof initRedis;
954
- getRedisClient: typeof getRedisClient;
955
- isRedisConnectedStatus: typeof isRedisConnectedStatus;
956
- redisGet: typeof redisGet;
957
- redisSet: typeof redisSet;
958
- redisDel: typeof redisDel;
959
- redisClearPrefix: typeof redisClearPrefix;
960
- disconnectRedis: typeof disconnectRedis;
961
- };
962
- export default redisHandler;
963
- }
964
-
965
- declare module "@seip/bluebird-js/core/csrf.js" {
966
- import { Csrf, CsrfOptions } from "@seip/bluebird-js";
967
- export { Csrf, CsrfOptions };
968
- export default Csrf;
969
- }
970
-
971
- declare module "@seip/bluebird-js/core/hash.js" {
972
- import { Hash, HashMakeOptions } from "@seip/bluebird-js";
973
- export { Hash, HashMakeOptions };
974
- export default Hash;
975
- }
976
-
977
- declare module "@seip/bluebird-js/core/queue.js" {
978
- import {
979
- Queue,
980
- QueueDispatchOptions,
981
- QueueJob,
982
- QueueHandler,
983
- } from "@seip/bluebird-js";
984
- export {
985
- Queue,
986
- QueueDispatchOptions,
987
- QueueJob,
988
- QueueHandler,
989
- };
990
- export default Queue;
991
- }
992
-
993
- declare module "@seip/bluebird-js/core/upload.js" {
994
- import {
995
- Upload,
996
- UploadDiskOptions,
997
- UploadMiddleware,
998
- UploadedFile,
999
- } from "@seip/bluebird-js";
1000
- export {
1001
- Upload,
1002
- UploadDiskOptions,
1003
- UploadMiddleware,
1004
- UploadedFile,
1005
- };
1006
- export default Upload;
1007
- }
1008
-
1009
- declare module "@seip/bluebird-js/core/ws.js" {
1010
- import {
1011
- WebSocketManager,
1012
- WebSocketOptions,
1013
- WebSocketClient,
1014
- WebSocketConnectionHandler,
1015
- } from "@seip/bluebird-js";
1016
- export {
1017
- WebSocketManager,
1018
- WebSocketOptions,
1019
- WebSocketClient,
1020
- WebSocketConnectionHandler,
1021
- };
1022
- export default WebSocketManager;
1023
- }
1024
-
1025
- declare module "@seip/bluebird-js/core/swagger.js" {
1026
- import { Swagger, SwaggerOptions } from "@seip/bluebird-js";
1027
- export { Swagger, SwaggerOptions };
1028
- export default Swagger;
1029
- }
1030
-
1031
- declare module "@seip/bluebird-js/core/logger.js" {
1032
- import { Logger } from "@seip/bluebird-js";
1033
- export { Logger };
1034
- export default Logger;
1035
- }
1036
-
1037
- declare module "@seip/bluebird-js/core/config.js" {
1038
- import { Config, AppProps } from "@seip/bluebird-js";
1039
- export { Config, AppProps };
1040
- export default Config;
1041
- }
1042
-
1043
- declare module "@seip/bluebird-js/core/debug.js" {
1044
- import { Debug } from "@seip/bluebird-js";
1045
- export { Debug };
1046
- export default Debug;
1047
- }
1048
-
1049
- declare module "@seip/bluebird-js/core/middleware.js" {
1050
- import { Middleware, CommonMiddleware } from "@seip/bluebird-js";
1051
- export { Middleware, CommonMiddleware };
1052
- export default Middleware;
1053
- }
1054
-
1055
- declare module "@seip/bluebird-js/core/vite.js" {
1056
- import { Vite, ViteOptions } from "@seip/bluebird-js";
1057
- export { Vite, ViteOptions };
1058
- export default Vite;
1059
- }
1060
-
1061
- declare module "@seip/bluebird-js/core/ratelimit.js" {
1062
- import { RateLimit, RateLimitOptions } from "@seip/bluebird-js";
1063
- export { RateLimit, RateLimitOptions };
1064
- export default RateLimit;
1065
- }
1066
-
1067
- declare module "@seip/bluebird-js/core/seo.js" {
1068
- import { Seo } from "@seip/bluebird-js";
1069
- export { Seo };
1070
- export default Seo;
1071
- }
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
+ }