@seip/bluebird-js 0.1.6 → 0.2.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.
Files changed (152) hide show
  1. package/.vscode/extensions.json +7 -7
  2. package/.vscode/settings.json +10 -10
  3. package/AGENTS.md +266 -116
  4. package/README.md +258 -245
  5. package/app/models/user.js +19 -0
  6. package/app/resources/html/home.html +137 -0
  7. package/app/resources/html/layouts/main.html +54 -0
  8. package/app/resources/html/notFound.html +14 -0
  9. package/app/resources/html/terms.html +46 -0
  10. package/app/resources/index.html +27 -0
  11. package/app/resources/layouts/AppLayout.jsx +89 -0
  12. package/app/resources/main.jsx +18 -0
  13. package/app/resources/pages/Dashboard.jsx +98 -0
  14. package/app/resources/pages/Home.jsx +140 -0
  15. package/app/resources/pages/Login.jsx +35 -0
  16. package/app/resources/pages/NotFound.jsx +16 -0
  17. package/app/resources/pages/Register.jsx +55 -0
  18. package/app/resources/routes.jsx +54 -0
  19. package/app/resources/spa.js +67 -0
  20. package/app/resources/styles.css +9 -0
  21. package/app/routes/api.js +85 -50
  22. package/app/routes/auth.js +209 -0
  23. package/app/routes/web.js +49 -37
  24. package/core/ai.d.ts +151 -151
  25. package/core/ai.js +1071 -1051
  26. package/core/app.d.ts +2 -18
  27. package/core/app.js +978 -792
  28. package/core/auth.d.ts +2 -13
  29. package/core/auth.js +444 -326
  30. package/core/cli/backup.js +167 -167
  31. package/core/cli/build.js +37 -0
  32. package/core/cli/dev.js +155 -0
  33. package/core/cli/doctor.js +37 -2
  34. package/core/cli/export.js +191 -0
  35. package/core/cli/init.js +101 -332
  36. package/core/cli/nginx.js +1 -1
  37. package/core/cli/templates.js +139 -0
  38. package/core/cli/view.js +73 -136
  39. package/core/config.js +44 -2
  40. package/core/csrf.js +156 -24
  41. package/core/database.js +737 -684
  42. package/core/debug.js +1 -1
  43. package/core/html.js +8 -1
  44. package/core/index.d.ts +1286 -1431
  45. package/core/paths.js +55 -0
  46. package/core/ratelimit.js +10 -1
  47. package/core/react/client/api.js +237 -0
  48. package/core/react/client/auth.js +236 -0
  49. package/core/react/client/components.js +1321 -0
  50. package/core/react/client/i18n.js +338 -0
  51. package/core/react/client/index.d.ts +249 -0
  52. package/core/react/client/index.js +49 -0
  53. package/core/react/client/router.js +26 -0
  54. package/core/react/client/theme.css +512 -0
  55. package/core/render-cache.js +250 -212
  56. package/core/render.d.ts +25 -21
  57. package/core/render.js +613 -603
  58. package/core/router.d.ts +2 -3
  59. package/core/router.js +171 -171
  60. package/core/seo.js +10 -0
  61. package/core/spa.js +599 -0
  62. package/core/view-loader.js +81 -455
  63. package/core/vite-plugin.d.ts +18 -0
  64. package/core/vite-plugin.js +162 -0
  65. package/core/vite.js +250 -145
  66. package/index.js +22 -18
  67. package/jsconfig.json +5 -3
  68. package/package.json +114 -92
  69. package/production.md +8 -3
  70. package/public/js/bluebird.js +1160 -0
  71. package/templates/_auth/app/database.js +19 -0
  72. package/templates/_auth/app/models/user.js +22 -0
  73. package/templates/_auth/app/routes/auth-router.js +304 -0
  74. package/templates/_base/app/resources/html/layouts/main.html +55 -0
  75. package/templates/_base/app/resources/html/notFound.html +14 -0
  76. package/templates/_base/app/resources/index.html +27 -0
  77. package/templates/_base/app/resources/styles.css +9 -0
  78. package/templates/api/app/models/note.js +18 -0
  79. package/templates/api/app/routes/api.js +82 -0
  80. package/templates/api/app/routes/auth.js +11 -0
  81. package/templates/api/index.js +19 -0
  82. package/templates/api/template.json +13 -0
  83. package/templates/auth/app/mail.js +11 -0
  84. package/templates/auth/app/models/password_reset.js +18 -0
  85. package/templates/auth/app/resources/html/home.html +21 -0
  86. package/templates/auth/app/resources/html/partials/nav.html +2 -0
  87. package/templates/auth/app/resources/layouts/AppLayout.jsx +60 -0
  88. package/templates/auth/app/resources/main.jsx +18 -0
  89. package/templates/auth/app/resources/pages/Dashboard.jsx +51 -0
  90. package/templates/auth/app/resources/pages/ForgotPassword.jsx +34 -0
  91. package/templates/auth/app/resources/pages/Login.jsx +36 -0
  92. package/templates/auth/app/resources/pages/NotFound.jsx +16 -0
  93. package/templates/auth/app/resources/pages/Profile.jsx +99 -0
  94. package/templates/auth/app/resources/pages/Register.jsx +50 -0
  95. package/templates/auth/app/resources/pages/ResetPassword.jsx +50 -0
  96. package/templates/auth/app/resources/routes.jsx +54 -0
  97. package/templates/auth/app/resources/spa.js +29 -0
  98. package/templates/auth/app/routes/api.js +17 -0
  99. package/templates/auth/app/routes/auth.js +13 -0
  100. package/templates/auth/app/routes/web.js +21 -0
  101. package/templates/auth/index.js +19 -0
  102. package/templates/auth/template.json +15 -0
  103. package/templates/blank/app/models/.gitkeep +0 -0
  104. package/templates/blank/app/resources/html/home.html +27 -0
  105. package/templates/blank/app/resources/html/partials/nav.html +1 -0
  106. package/templates/blank/app/resources/main.jsx +16 -0
  107. package/templates/blank/app/resources/pages/Home.jsx +42 -0
  108. package/templates/blank/app/resources/pages/NotFound.jsx +27 -0
  109. package/templates/blank/app/resources/routes.jsx +15 -0
  110. package/templates/blank/app/resources/spa.js +24 -0
  111. package/templates/blank/app/routes/api.js +11 -0
  112. package/templates/blank/app/routes/web.js +21 -0
  113. package/templates/blank/index.js +13 -0
  114. package/templates/blank/template.json +12 -0
  115. package/templates/blog/app/lib/blog.js +149 -0
  116. package/templates/blog/app/models/post.js +22 -0
  117. package/templates/blog/app/resources/html/home.html +28 -0
  118. package/templates/blog/app/resources/html/not-found.html +5 -0
  119. package/templates/blog/app/resources/html/partials/nav.html +2 -0
  120. package/templates/blog/app/resources/html/partials/post-card.html +9 -0
  121. package/templates/blog/app/resources/html/post.html +8 -0
  122. package/templates/blog/app/resources/layouts/AdminLayout.jsx +54 -0
  123. package/templates/blog/app/resources/main.jsx +18 -0
  124. package/templates/blog/app/resources/pages/Login.jsx +31 -0
  125. package/templates/blog/app/resources/pages/NotFound.jsx +16 -0
  126. package/templates/blog/app/resources/pages/PostEditor.jsx +51 -0
  127. package/templates/blog/app/resources/pages/Posts.jsx +83 -0
  128. package/templates/blog/app/resources/pages/Register.jsx +43 -0
  129. package/templates/blog/app/resources/routes.jsx +51 -0
  130. package/templates/blog/app/resources/spa.js +25 -0
  131. package/templates/blog/app/resources/styles.css +40 -0
  132. package/templates/blog/app/routes/api.js +77 -0
  133. package/templates/blog/app/routes/auth.js +10 -0
  134. package/templates/blog/app/routes/web.js +114 -0
  135. package/templates/blog/index.js +21 -0
  136. package/templates/blog/template.json +14 -0
  137. package/vite.config.js +11 -0
  138. package/app/views/about.jsx +0 -98
  139. package/app/views/components/Header.jsx +0 -42
  140. package/app/views/components/LiveCounter.jsx +0 -66
  141. package/app/views/dashboard.jsx +0 -300
  142. package/app/views/index.jsx +0 -123
  143. package/app/views/layouts/main/view.jsx +0 -201
  144. package/app/views/legal/terms.html +0 -29
  145. package/app/views/login.jsx +0 -141
  146. package/core/actions.d.ts +0 -4
  147. package/core/actions.js +0 -329
  148. package/core/jsx.d.ts +0 -38
  149. package/core/jsx.js +0 -1432
  150. package/core/vite.d.ts +0 -3
  151. package/public/js/bluebird-client.js +0 -3161
  152. package/public/js/tailwind.js +0 -8
package/core/index.d.ts CHANGED
@@ -1,1431 +1,1286 @@
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
- export * from "./ai.js";
6
-
7
- /**
8
- * Standard pagination metadata structure.
9
- */
10
- export interface PaginationMeta {
11
- page?: number;
12
- limit?: number;
13
- total?: number;
14
- totalPages?: number;
15
- }
16
-
17
- /**
18
- * Uploaded file object populated by multer middleware.
19
- */
20
- export interface UploadedFile {
21
- fieldname: string;
22
- originalname: string;
23
- encoding: string;
24
- mimetype: string;
25
- size: number;
26
- destination: string;
27
- filename: string;
28
- path: string;
29
- buffer?: Buffer;
30
- }
31
-
32
- /**
33
- * Standard Bluebird API JSON response envelope.
34
- */
35
- export interface ApiResponse<T = any> {
36
- status: "success" | "error";
37
- message: string;
38
- data?: T;
39
- errors?: any;
40
- pagination?: PaginationMeta;
41
- }
42
-
43
- declare global {
44
- namespace Express {
45
- interface Response {
46
- /**
47
- * Sends a standardized JSON success response.
48
- * @param data Data payload to return.
49
- * @param message Success message.
50
- * @param statusCode HTTP status code (default: 200).
51
- */
52
- success<T = any>(data?: T, message?: string, statusCode?: number): Response;
53
-
54
- /**
55
- * Sends a standardized HTTP 200 OK success response.
56
- * @param data Data payload.
57
- * @param message Success message.
58
- */
59
- ok<T = any>(data?: T, message?: string): Response;
60
-
61
- /**
62
- * Sends a standardized HTTP 201 Created success response.
63
- * @param data Data payload.
64
- * @param message Success message.
65
- */
66
- created<T = any>(data?: T, message?: string): Response;
67
-
68
- /**
69
- * Sends a standardized HTTP 400 Bad Request error response.
70
- * @param message Error message.
71
- * @param errors Detailed errors array or object.
72
- */
73
- badRequest(message?: string, errors?: any): Response;
74
-
75
- /**
76
- * Sends a standardized HTTP 401 Unauthorized error response.
77
- * @param message Error message.
78
- */
79
- unauthorized(message?: string): Response;
80
-
81
- /**
82
- * Sends a standardized HTTP 403 Forbidden error response.
83
- * @param message Error message.
84
- */
85
- forbidden(message?: string): Response;
86
-
87
- /**
88
- * Sends a standardized HTTP 404 Not Found error response.
89
- * @param message Error message.
90
- */
91
- notFound(message?: string): Response;
92
-
93
- /**
94
- * Sends a standardized HTTP 500 Internal Server Error response.
95
- * @param message Error message.
96
- * @param errors Error details.
97
- */
98
- serverError(message?: string, errors?: any): Response;
99
-
100
- /**
101
- * Sends a standardized JSON error response.
102
- * @param message Error message.
103
- * @param statusCode HTTP status code (default: 400).
104
- * @param errors Array or object of detailed errors.
105
- */
106
- error(message?: string, statusCode?: number, errors?: any): Response;
107
-
108
- /**
109
- * Sends a standardized paginated JSON response.
110
- * @param data Array of records for current page.
111
- * @param pagination Object containing page, limit, and total count.
112
- * @param message Success message.
113
- */
114
- paginate<T = any>(
115
- data?: T[],
116
- pagination?: PaginationMeta,
117
- message?: string
118
- ): Response;
119
- }
120
-
121
- interface Request {
122
- lang?: string;
123
- user?: any;
124
- csrfToken?(): string;
125
- file?: UploadedFile;
126
- files?: UploadedFile[] | Record<string, UploadedFile[]>;
127
- [key: string]: any;
128
- }
129
- }
130
- }
131
-
132
- export class AppError extends Error {
133
- statusCode: number;
134
- errors: any;
135
- isOperational: boolean;
136
-
137
- constructor(message: string, statusCode?: number, errors?: any);
138
- }
139
-
140
- /**
141
- * CORS configuration options.
142
- */
143
- export interface CorsOptions {
144
- origin?:
145
- | string
146
- | boolean
147
- | string[]
148
- | ((origin: string | undefined, req: Request) => boolean);
149
- methods?: string | string[];
150
- allowedHeaders?: string | string[];
151
- exposedHeaders?: string | string[];
152
- credentials?: boolean;
153
- maxAge?: number;
154
- }
155
-
156
- /**
157
- * Security response headers options.
158
- */
159
- export interface SecurityHeadersOptions {
160
- csp?: string | false;
161
- frameOptions?: string;
162
- referrerPolicy?: string;
163
- permissionsPolicy?: string;
164
- }
165
-
166
- /**
167
- * Static asset serving options.
168
- */
169
- export interface AppStaticOptions {
170
- path: string;
171
- options?: Record<string, any>;
172
- }
173
-
174
- /**
175
- * Rate limit configuration options.
176
- */
177
- export interface RateLimitOptions {
178
- windowMs?: number;
179
- max?: number;
180
- message?: string;
181
- statusCode?: number;
182
- headers?: boolean;
183
- driver?: "memory" | "redis";
184
- keyGenerator?: (req: Request) => string;
185
- skip?: (req: Request) => boolean;
186
- }
187
-
188
- export class RateLimit {
189
- static middleware(options?: RateLimitOptions | boolean): (req: Request, res: Response, next: NextFunction) => Promise<any>;
190
- static clear(): void;
191
- }
192
-
193
- export class Seo {
194
- static registerRoute(basePath: string, routePath: string | RegExp, languages?: string[]): void;
195
- static getRoutes(): string[];
196
- static clear(): void;
197
- static generateSitemap(baseUrl?: string): string;
198
- static generateRobots(baseUrl?: string, disallow?: string[]): string;
199
- }
200
-
201
- /**
202
- * WebSocket manager configuration options.
203
- */
204
- export interface WebSocketOptions {
205
- path?: string;
206
- auth?: boolean;
207
- maxPayload?: number;
208
- }
209
-
210
- /**
211
- * Active WebSocket client connection interface.
212
- */
213
- export interface WebSocketClient {
214
- isAlive?: boolean;
215
- user?: any;
216
- rooms?: Set<string>;
217
- send(data: any): void;
218
- on(event: string, handler: (...args: any[]) => void): void;
219
- close(code?: number, reason?: string): void;
220
- [key: string]: any;
221
- }
222
-
223
- export type WebSocketConnectionHandler = (ws: WebSocketClient, req: Request) => void;
224
-
225
- export class WebSocketManager {
226
- server: HttpServer;
227
- path: string;
228
- requireAuth: boolean;
229
- maxPayload: number;
230
- rooms: Map<string, Set<WebSocketClient>>;
231
- clients: Set<WebSocketClient>;
232
-
233
- constructor(server: HttpServer | any, options?: WebSocketOptions);
234
- onConnection(handler: WebSocketConnectionHandler): void;
235
- join(room: string, ws: WebSocketClient): void;
236
- leave(room: string, ws: WebSocketClient): void;
237
- broadcast(data: any, room?: string | null): void;
238
- }
239
-
240
- /**
241
- * Application initialization options.
242
- */
243
- export interface AppOptions {
244
- routes?: Array<Router | ExpressRouter | any>;
245
- cors?: boolean | CorsOptions;
246
- middlewares?: Array<RequestHandler | any>;
247
- port?: number | string;
248
- host?: string;
249
- appUrl?: string;
250
- logger?: boolean;
251
- notFound?: boolean;
252
- json?: boolean | Record<string, any>;
253
- urlencoded?: boolean | Record<string, any>;
254
- static?: AppStaticOptions;
255
- cookieParser?: boolean;
256
- swagger?: boolean | SwaggerOptions;
257
- compression?: boolean;
258
- security?: boolean | SecurityHeadersOptions;
259
- rateLimit?: boolean | RateLimitOptions;
260
- autoRoutes?: boolean;
261
- noAutoDiscoverRoutes?: boolean;
262
- desktop?: boolean;
263
- userDataPath?: string;
264
- appPath?: string;
265
- allowLan?: boolean;
266
- trustProxy?: boolean | number | string;
267
- }
268
-
269
- export class App {
270
- app: ExpressRouter | any;
271
- server: HttpServer;
272
- wsManager: WebSocketManager | null;
273
- routes: any[];
274
- cors: boolean | CorsOptions;
275
- middlewares: any[];
276
- port: number | string;
277
- host: string;
278
- appUrl: string;
279
- logger: boolean;
280
- notFound: boolean;
281
- desktop: boolean;
282
- allowLan: boolean;
283
- trustProxy: boolean | number | string;
284
-
285
- constructor(options?: AppOptions);
286
-
287
- use(record: any): void;
288
- set(key: string, value: any): void;
289
- websocket(
290
- options?:
291
- | WebSocketConnectionHandler
292
- | WebSocketOptions
293
- ): WebSocketManager;
294
- getPort(): number;
295
- getUrl(): string;
296
- run(): Promise<any>;
297
- runDesktop(options?: {
298
- appPath?: string;
299
- userDataPath?: string;
300
- allowLan?: boolean;
301
- host?: string;
302
- port?: number;
303
- }): Promise<{ server: HttpServer; port: number; url: string; lanUrl?: string; lanIp?: string }>;
304
- close(): Promise<void>;
305
-
306
- static helmet(options?: any): (req: Request, res: Response, next: NextFunction) => void;
307
- static securityHeaders(options?: SecurityHeadersOptions): (req: Request, res: Response, next: NextFunction) => void;
308
- static rateLimit(options?: RateLimitOptions | boolean): (req: Request, res: Response, next: NextFunction) => Promise<any>;
309
- static ai(options?: any): any;
310
- }
311
-
312
- /**
313
- * Router configuration options.
314
- */
315
- export interface RouterOptions {
316
- seo?: boolean;
317
- languages?: string[];
318
- }
319
-
320
- export class Router {
321
- router: ExpressRouter;
322
- path: string;
323
-
324
- constructor(path?: string, options?: RouterOptions);
325
-
326
- use(...middleware: Array<RequestHandler | any>): void;
327
- get(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
328
- post(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
329
- put(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
330
- delete(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
331
- patch(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
332
- options(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
333
- getRouter(): ExpressRouter;
334
- getPath(): string;
335
- }
336
-
337
- /**
338
- * Validation rule configuration for a single field.
339
- */
340
- export interface ValidationRule {
341
- required?: boolean;
342
- min?: number;
343
- max?: number;
344
- email?: boolean;
345
- number?: boolean;
346
- alpha?: boolean;
347
- alphanumeric?: boolean;
348
- boolean?: boolean;
349
- date?: boolean;
350
- url?: boolean;
351
- in?: any[];
352
- equals?: any;
353
- password?: boolean;
354
- pattern?: RegExp | string;
355
- xss?: boolean;
356
- messages?: Partial<
357
- Record<
358
- | "required"
359
- | "min"
360
- | "max"
361
- | "email"
362
- | "number"
363
- | "alpha"
364
- | "alphanumeric"
365
- | "boolean"
366
- | "date"
367
- | "url"
368
- | "in"
369
- | "equals"
370
- | "password"
371
- | "pattern",
372
- string
373
- >
374
- >;
375
- }
376
-
377
- /**
378
- * Validator schema definition.
379
- */
380
- export type ValidationSchema = Record<string, ValidationRule>;
381
-
382
- /**
383
- * Validation failure item.
384
- */
385
- export interface ValidationError {
386
- field: string;
387
- message: string;
388
- }
389
-
390
- /**
391
- * Validation output result.
392
- */
393
- export interface ValidationResult {
394
- success: boolean;
395
- error: boolean;
396
- errors: ValidationError[];
397
- message: string[];
398
- html?: string[];
399
- }
400
-
401
- export class Validator {
402
- schema: ValidationSchema;
403
- lang_default: string | null;
404
- messages: Record<string, any>;
405
-
406
- constructor(schema: ValidationSchema, lang_default?: string, messages?: Record<string, any>);
407
- middleware(): (req: Request, res: Response, next: NextFunction) => void;
408
- validate(req: Request | Record<string, any>): Promise<ValidationResult>;
409
- static xssMiddleware(): (req: Request, res: Response, next: NextFunction) => void;
410
- static sanitizeObject<T = any>(obj: T): T;
411
- static mutateSanitized(obj: any): void;
412
- }
413
-
414
- /**
415
- * Password hashing options.
416
- */
417
- export interface HashMakeOptions {
418
- driver?: "scrypt" | "bcrypt";
419
- rounds?: number;
420
- N?: number;
421
- r?: number;
422
- p?: number;
423
- }
424
-
425
- export class Hash {
426
- static make(password: string, options?: HashMakeOptions): Promise<string>;
427
- static hash(password: string, options?: HashMakeOptions): Promise<string>;
428
- static verify(password: string, hash: string): Promise<boolean>;
429
- static check(password: string, hash: string): Promise<boolean>;
430
- static needsRehash(hash: string, options?: HashMakeOptions): boolean;
431
- }
432
-
433
- /**
434
- * Auth protect middleware options.
435
- */
436
- export interface AuthProtectOptions {
437
- redirect?: string | null;
438
- key?: string;
439
- cookieKey?: string;
440
- secret?: string;
441
- }
442
-
443
- /**
444
- * Auth login options.
445
- */
446
- export interface AuthLoginOptions {
447
- expiresIn?: string | number;
448
- cookie?: Record<string, any>;
449
- secret?: string;
450
- }
451
-
452
- /**
453
- * Decoded Auth JWT token payload.
454
- */
455
- export type AuthTokenPayload = Record<string, any> & {
456
- _sessionId?: string;
457
- exp?: number;
458
- iat?: number;
459
- };
460
-
461
- export class Auth {
462
- static encrypt(payload: any, secret?: string): string;
463
- static decrypt<T = any>(data: string, secret?: string): T | null;
464
- static generateToken(payload: any, secret?: string, expiresIn?: string | number): string;
465
- static verifyToken<T = any>(token: string, secret?: string): T | null;
466
- static protect(options?: AuthProtectOptions): (req: Request, res: Response, next: NextFunction) => Promise<any>;
467
- static login(res: Response, data: any, key?: string, options?: AuthLoginOptions): Promise<string>;
468
- static logout(res: Response, key?: string, options?: Record<string, any>, req?: Request | null): Promise<boolean>;
469
- }
470
-
471
- export type CacheDriver = "memory" | "redis" | "file";
472
-
473
- /**
474
- * Cache middleware options.
475
- */
476
- export interface CacheMiddlewareOptions {
477
- driver?: "memory" | "redis";
478
- allowAuthenticated?: boolean;
479
- key?: (req: Request) => string;
480
- }
481
-
482
- /**
483
- * Cache read options.
484
- */
485
- export interface CacheGetOptions {
486
- driver?: CacheDriver;
487
- }
488
-
489
- /**
490
- * Cache write options.
491
- */
492
- export interface CacheSetOptions {
493
- driver?: CacheDriver;
494
- fallbackDriver?: CacheDriver;
495
- }
496
-
497
- export class Cache {
498
- static middleware(seconds?: number, options?: CacheMiddlewareOptions): (req: Request, res: Response, next: NextFunction) => Promise<any>;
499
- static get<T = any>(key: string, options?: CacheGetOptions): Promise<T | null>;
500
- static set(key: string, value: any, seconds?: number, options?: CacheSetOptions): Promise<boolean>;
501
- static deduplicate<T = any>(key: string, loader: () => Promise<T>): Promise<T>;
502
- static delete(keys: string | string[]): Promise<boolean>;
503
- static del(keys: string | string[]): Promise<boolean>;
504
- static deletePrefix(prefix: string): Promise<boolean>;
505
- static clear(): Promise<boolean>;
506
- static getMode(): string;
507
- static size(): number;
508
- }
509
-
510
- export function getRedisClient(): any;
511
-
512
- /**
513
- * Render island / client component options.
514
- */
515
- export interface RenderIslandOptions {
516
- persist?: boolean;
517
- persistent?: boolean;
518
- fallback?: any;
519
- skeleton?: any;
520
- minHeight?: string | number;
521
- minWidth?: string | number;
522
- className?: string;
523
- style?: Record<string, any> | string;
524
- ssr?: boolean;
525
- tag?: string;
526
- client?: Function;
527
- onMount?: Function;
528
- }
529
-
530
- /**
531
- * Server Action definition options.
532
- */
533
- export interface ActionDefinitionOptions {
534
- schema?: ValidationSchema | Validator;
535
- maxBytes?: number | string;
536
- limit?: number | string;
537
- maxDepth?: number;
538
- maxKeys?: number;
539
- csrf?: boolean;
540
- }
541
-
542
- /**
543
- * Server Action execution context.
544
- */
545
- export interface ActionContext<TBody = Record<string, any>> {
546
- req: Request;
547
- res: Response;
548
- user?: any;
549
- body: TBody;
550
- params: Record<string, string>;
551
- query: Record<string, any>;
552
- action: string;
553
- }
554
-
555
- export class Actions {
556
- static define<TBody = Record<string, any>, TResult = any>(
557
- optionsOrHandler: ActionDefinitionOptions | ((ctx: ActionContext<TBody>, body: TBody) => Promise<TResult> | TResult),
558
- handlerFn?: (ctx: ActionContext<TBody>, body: TBody) => Promise<TResult> | TResult
559
- ): any;
560
- static createDispatcher(viewName: string, actionsMap: Record<string, any>): (req: Request, res: Response) => Promise<any>;
561
- }
562
-
563
- /**
564
- * Props for `<Island>` / `<Client>` JSX components.
565
- */
566
- export interface IslandComponentProps extends RenderIslandOptions {
567
- component?: string | Function;
568
- name?: string;
569
- props?: Record<string, any>;
570
- children?: any;
571
- [key: string]: any;
572
- }
573
-
574
- export interface ErrorBoundaryProps {
575
- fallback?: any | ((error: Error) => any);
576
- onError?: (error: Error) => void;
577
- children?: any;
578
- }
579
-
580
- export interface SuspenseProps {
581
- fallback?: any;
582
- children?: any;
583
- }
584
-
585
- export interface HeadProps {
586
- children?: any;
587
- }
588
-
589
- export interface TitleProps {
590
- children?: any;
591
- }
592
-
593
- export interface MetaProps {
594
- name?: string;
595
- property?: string;
596
- content?: string;
597
- charSet?: string;
598
- httpEquiv?: string;
599
- [key: string]: any;
600
- }
601
-
602
- export interface UseActionOptions {
603
- url?: string;
604
- partial?: boolean;
605
- onSuccess?: (data: any) => void;
606
- onError?: (error: any) => void;
607
- onSettled?: () => void;
608
- }
609
-
610
- export const ERROR_BOUNDARY: symbol;
611
- export const SUSPENSE_ELEMENT: symbol;
612
- export const HEAD_ELEMENT: symbol;
613
- export const TITLE_ELEMENT: symbol;
614
- export const META_ELEMENT: symbol;
615
-
616
- export function h(type: any, props?: Record<string, any> | null, ...children: any[]): any;
617
- export function createElement(type: any, props?: Record<string, any> | null, ...children: any[]): any;
618
- export function jsx(type: any, props: Record<string, any>, key?: string | number): any;
619
- export function jsxs(type: any, props: Record<string, any>, key?: string | number): any;
620
- export const Fragment: symbol;
621
- export function Island(options?: IslandComponentProps): Promise<any>;
622
- export function Client(options?: IslandComponentProps): Promise<any>;
623
- export function ErrorBoundary(props?: ErrorBoundaryProps): any;
624
- export function Suspense(props?: SuspenseProps): any;
625
- export function Head(props?: HeadProps): any;
626
- export function Title(props?: TitleProps): any;
627
- export function Meta(props?: MetaProps): any;
628
- export function isJsxElement(val: any): boolean;
629
- export function renderJsxToString(node: any, ctx?: Record<string, any>): Promise<string>;
630
- export function compileJsx(source: string, options?: { ts?: boolean; typescript?: boolean }): string;
631
- export function stripTsTypes(code: string): string;
632
- export function registerJsxLoader(): void;
633
- export function useState<T>(initial?: T | (() => T)): [T, (value: T | ((prev: T) => T)) => void];
634
- export function useEffect(effectFn: () => void | (() => void), deps?: any[]): void;
635
- export function useRef<T>(initial?: T): { current: T };
636
- export function useMemo<T>(fn: () => T, deps?: any[]): T;
637
- export function useCallback<T extends (...args: any[]) => any>(fn: T, deps?: any[]): T;
638
- export function useAction(
639
- actionName: string | Function,
640
- options?: UseActionOptions
641
- ): [
642
- execute: (payload?: any) => Promise<any>,
643
- isPending: boolean,
644
- data: any,
645
- error: any,
646
- reset: () => void
647
- ];
648
- export function useActionState<T>(
649
- actionFn: string | ((prevState: T, payload?: any) => Promise<T> | T),
650
- initialState: T
651
- ): [state: T, dispatch: (payload?: any) => Promise<T>, isPending: boolean];
652
-
653
- /**
654
- * Options for serving raw static HTML files.
655
- */
656
- export interface RenderHtmlOptions {
657
- ttl?: number;
658
- }
659
-
660
- export class Render {
661
- static island(
662
- name: string | Function,
663
- props?: Record<string, any>,
664
- options?: RenderIslandOptions
665
- ): string;
666
- static component(partialName: string, props?: Record<string, any>): Promise<string>;
667
- static html(res: Response, relativePath: string, options?: RenderHtmlOptions): Promise<void>;
668
- static send(res: Response, viewName: string, data?: Record<string, any>, ttl?: number): Promise<void>;
669
- static partial(res: Response, partialName: string, data?: Record<string, any>, ttl?: number): Promise<void>;
670
- static stream(
671
- res: Response,
672
- viewName: string,
673
- data?: Record<string, any>,
674
- options?: number | { ttl?: number }
675
- ): Promise<void>;
676
- static view(
677
- viewName: string,
678
- dataOrFn?: Record<string, any> | ((req: Request, res: Response) => any),
679
- ttl?: number
680
- ): (req: Request, res: Response) => Promise<void>;
681
- static cache(
682
- seconds?: number,
683
- options?: { allowAuthenticated?: boolean }
684
- ): (req: Request, res: Response, next: NextFunction) => Promise<any>;
685
- static redirect(req: Request, res: Response, url: string, status?: number): void;
686
- static clearTemplateCache(): void;
687
- static invalidate(keys?: string | string[]): Promise<void>;
688
- static autoRoutes(targetRouter?: Router): Promise<Array<{ viewName: string; routePath: string; cache: number; seo: boolean }>>;
689
- }
690
-
691
- export * from "./html.js";
692
-
693
- /**
694
- * Vite integration options.
695
- */
696
- export interface ViteOptions {
697
- entry?: string;
698
- viteUrl?: string;
699
- debug?: boolean;
700
- }
701
-
702
- export class Vite {
703
- static tags(options?: ViteOptions): string;
704
- static clearCache(): void;
705
- }
706
-
707
- export const DB_TYPE: "sqlite" | "postgres" | "mysql" | "none" | string;
708
-
709
- /**
710
- * Database query execution options.
711
- */
712
- export interface DatabaseQueryOptions {
713
- cache?: number;
714
- cachePrefix?: string;
715
- return_row?: boolean;
716
- [key: string]: any;
717
- }
718
-
719
- /**
720
- * Standard paginated query result.
721
- */
722
- export interface PaginatedResult<T = any> {
723
- data: T[];
724
- total: number;
725
- page: number;
726
- limit: number;
727
- totalPages: number;
728
- }
729
-
730
- /**
731
- * Transaction runner client.
732
- */
733
- export interface DatabaseTransactionClient {
734
- query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
735
- }
736
-
737
- export interface DatabaseBackupOptions {
738
- out?: string;
739
- compress?: boolean;
740
- keep?: number;
741
- filename?: string;
742
- dbInstance?: Database;
743
- dbType?: string;
744
- }
745
-
746
- export interface DatabaseBackupResult {
747
- success: boolean;
748
- file: string;
749
- filename: string;
750
- size: number;
751
- rotated: number;
752
- dbType: string;
753
- }
754
-
755
- export interface DatabaseRestoreOptions {
756
- safetyBackup?: boolean;
757
- verify?: boolean;
758
- dbInstance?: Database;
759
- dbType?: string;
760
- }
761
-
762
- export interface DatabaseRestoreResult {
763
- success: boolean;
764
- restoredFrom: string;
765
- targetFile: string;
766
- preRestoreBackup?: string | null;
767
- size?: number;
768
- dbType: string;
769
- }
770
-
771
- export class Database {
772
- backup(options?: DatabaseBackupOptions): Promise<DatabaseBackupResult>;
773
- restore(filePath: string, options?: DatabaseRestoreOptions): Promise<DatabaseRestoreResult>;
774
- static backup(options?: DatabaseBackupOptions): Promise<DatabaseBackupResult>;
775
- static restore(filePath: string, options?: DatabaseRestoreOptions): Promise<DatabaseRestoreResult>;
776
- type: string;
777
- constructor(connectionLimit?: number, queueLimit?: number, config?: any);
778
- init(retries?: number): Promise<boolean>;
779
- query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
780
- paginate<T = any>(
781
- sql: string,
782
- params?: any[],
783
- options?: { page?: number; limit?: number; cache?: number }
784
- ): Promise<PaginatedResult<T>>;
785
- transaction<T = any>(callback: (tx: DatabaseTransactionClient) => Promise<T>): Promise<T>;
786
- executeTransaction<T = any>(callback: (tx: DatabaseTransactionClient) => Promise<T>): Promise<T>;
787
- close(): Promise<void>;
788
- static closeAll(): Promise<void>;
789
- }
790
-
791
- /**
792
- * Queue dispatching options.
793
- */
794
- export interface QueueDispatchOptions {
795
- delayMs?: number;
796
- }
797
-
798
- /**
799
- * Queue job item structure.
800
- */
801
- export interface QueueJob<T = any> {
802
- id: string;
803
- name: string;
804
- payload: T;
805
- createdAt: string;
806
- }
807
-
808
- export type QueueHandler<T = any> = (payload: T) => Promise<any> | any;
809
-
810
- export class Queue {
811
- static process<T = any>(jobName: string, handler: QueueHandler<T>): void;
812
- static dispatch<T = any>(jobName: string, payload?: T, options?: QueueDispatchOptions): Promise<boolean>;
813
- static work(): Promise<void>;
814
- static stop(): void;
815
- static loadJobs(jobsDir?: string): Promise<void>;
816
- }
817
-
818
- /**
819
- * CSRF middleware options.
820
- */
821
- export interface CsrfOptions {
822
- cookieName?: string;
823
- headerName?: string;
824
- bodyKey?: string;
825
- maxAgeMs?: number;
826
- secret?: string;
827
- }
828
-
829
- export class Csrf {
830
- static generateToken(secret?: string): string;
831
- static verifyToken(token: string, secret?: string, maxAgeMs?: number): boolean;
832
- static middleware(options?: CsrfOptions): (req: Request, res: Response, next: NextFunction) => void;
833
- }
834
-
835
- export interface ModelSchemaColumn {
836
- type: "int" | "integer" | "bigint" | "string" | "text" | "boolean" | "date" | "float" | "json" | (string & {});
837
- primary?: boolean;
838
- auto?: boolean;
839
- unique?: boolean;
840
- required?: boolean;
841
- nullable?: boolean;
842
- default?: any;
843
- hidden?: boolean;
844
- length?: number;
845
- min?: number;
846
- max?: number;
847
- email?: boolean;
848
- hash?: boolean;
849
- in?: any[];
850
- references?: string;
851
- onDelete?: "cascade" | "set null" | "restrict" | "no action" | (string & {});
852
- }
853
-
854
- /**
855
- * Options for Model.find query.
856
- */
857
- export interface ModelFindOptions {
858
- withDeleted?: boolean;
859
- withHidden?: boolean;
860
- cache?: number;
861
- oneMany?: typeof Model | Array<typeof Model>;
862
- belongsTo?: typeof Model | Array<typeof Model>;
863
- }
864
-
865
- /**
866
- * Options for Model.all query.
867
- */
868
- export interface ModelAllOptions {
869
- where?: Record<string, any>;
870
- order?: string | string[];
871
- limit?: number;
872
- offset?: number;
873
- withDeleted?: boolean;
874
- withHidden?: boolean;
875
- cache?: number;
876
- oneMany?: typeof Model | Array<typeof Model>;
877
- belongsTo?: typeof Model | Array<typeof Model>;
878
- }
879
-
880
- /**
881
- * Options for Model.paginate query.
882
- */
883
- export interface ModelPaginateOptions {
884
- where?: Record<string, any>;
885
- order?: string | string[];
886
- page?: number;
887
- limit?: number;
888
- withDeleted?: boolean;
889
- withHidden?: boolean;
890
- cache?: number;
891
- }
892
-
893
- /**
894
- * Options for Model.delete operation.
895
- */
896
- export interface ModelDeleteOptions {
897
- force?: boolean;
898
- cascade?: Array<typeof Model>;
899
- }
900
-
901
- export class Model {
902
- static table: string;
903
- static primaryKey: string;
904
- static timestamps: boolean;
905
- static softDelete: boolean;
906
- static schema: Record<string, ModelSchemaColumn>;
907
- static fillable: string[];
908
- static guarded: string[];
909
-
910
- static getDatabase(): Database;
911
- static setDatabase(db: Database): void;
912
- static close(): Promise<void>;
913
- static query<T = any>(sql: string, params?: any[], options?: any): Promise<T>;
914
- static transaction<T = any>(callback: (tx: DatabaseTransactionClient | any) => Promise<T>): Promise<T>;
915
- static invalidateCache(): Promise<void>;
916
- static find<T = any>(
917
- idOrConditions: number | string | Record<string, any>,
918
- options?: ModelFindOptions
919
- ): Promise<T | null>;
920
- static first<T = any>(
921
- idOrConditions?: number | string | Record<string, any>,
922
- options?: ModelFindOptions
923
- ): Promise<T | null>;
924
- static count(where?: Record<string, any>): Promise<number>;
925
- static exists(where?: Record<string, any>): Promise<boolean>;
926
- static firstOrCreate<T = any>(where: Record<string, any>, defaults?: Record<string, any>): Promise<T>;
927
- static updateOrCreate<T = any>(where: Record<string, any>, values?: Record<string, any>): Promise<T>;
928
- static all<T = any>(options?: ModelAllOptions): Promise<T[]>;
929
- static paginate<T = any>(options?: ModelPaginateOptions): Promise<PaginatedResult<T>>;
930
- static create(data: Record<string, any>, options?: { only?: string[]; except?: string[] }): Promise<number | string>;
931
- static update(
932
- idOrConditions: number | string | Record<string, any>,
933
- data: Record<string, any>,
934
- options?: { only?: string[]; except?: string[] }
935
- ): Promise<number>;
936
- static delete(
937
- idOrConditions: number | string | Record<string, any>,
938
- options?: ModelDeleteOptions
939
- ): Promise<number>;
940
- static restore(idOrConditions: number | string | Record<string, any>): Promise<number>;
941
- static validator(mode?: "create" | "update", lang?: string): Validator;
942
- static columnToSQL(col: string, def: ModelSchemaColumn, dialect?: "sqlite" | "mysql" | "postgres"): string;
943
- static toDDL(dialect?: "sqlite" | "mysql" | "postgres"): string;
944
- }
945
-
946
- export interface UploadDiskOptions {
947
- folder?: string;
948
- fileSize?: number;
949
- allowedTypes?: string[];
950
- }
951
-
952
- export interface UploadMiddleware {
953
- single(fieldName: string): (req: Request, res: Response, next: NextFunction) => void;
954
- array(fieldName: string, maxCount?: number): (req: Request, res: Response, next: NextFunction) => void;
955
- fields(fields: Array<{ name: string; maxCount?: number }>): (req: Request, res: Response, next: NextFunction) => void;
956
- none(): (req: Request, res: Response, next: NextFunction) => void;
957
- any(): (req: Request, res: Response, next: NextFunction) => void;
958
- }
959
-
960
- export class Upload {
961
- static storage(folder?: string): any;
962
- static disk(options?: UploadDiskOptions): UploadMiddleware;
963
- static url(filename: string, folder?: string): string;
964
- }
965
-
966
- export interface SwaggerOptions {
967
- route?: string;
968
- url?: string;
969
- info?: {
970
- title?: string;
971
- version?: string;
972
- description?: string;
973
- };
974
- apis?: string[];
975
- }
976
-
977
- export class Swagger {
978
- static init(app: any, options?: SwaggerOptions): Promise<boolean>;
979
- }
980
-
981
- export interface AppProps {
982
- debug: boolean;
983
- desktop: boolean;
984
- userDataDir: string;
985
- appDir: string;
986
- title: string;
987
- description: string;
988
- version: string;
989
- host: string;
990
- appUrl: string;
991
- port: number;
992
- jwtSecret?: string;
993
- langMeta: string;
994
- static: { path: string; options: Record<string, any> };
995
- descriptionMeta?: string;
996
- keywordsMeta?: string;
997
- titleMeta?: string;
998
- authorMeta?: string;
999
- }
1000
-
1001
- export class Config {
1002
- static dirname(): string;
1003
- static appDir(): string;
1004
- static setAppDir(dirPath: string): void;
1005
- static isDesktop(): boolean;
1006
- static setUserDataDir(customDir: string): void;
1007
- static userDataDir(): string;
1008
- static reload(): AppProps;
1009
- static props(): AppProps;
1010
- }
1011
-
1012
- export class Logger {
1013
- folder: string;
1014
- constructor();
1015
- nowFolder(): string;
1016
- now(): string;
1017
- _log(file: string, level: string, message: string): void;
1018
- log(file: string, level: string, message: string): void;
1019
- info(message: string): void;
1020
- error(message: string): void;
1021
- warn(message: string): void;
1022
- warning(message: string): void;
1023
- debug(message: string): void;
1024
- }
1025
-
1026
- export class Debug {
1027
- constructor();
1028
- static shouldTrack(req: Request): boolean;
1029
- static middlewareMetrics(app: any): void;
1030
- getRouter(): { path: string; router: ExpressRouter };
1031
- }
1032
-
1033
- export interface CommonMiddleware {
1034
- auth: (req: Request, res: Response, next: NextFunction) => Promise<any>;
1035
- webAuth: (req: Request, res: Response, next: NextFunction) => Promise<any>;
1036
- logger: (req: Request, res: Response, next: NextFunction) => void;
1037
- }
1038
-
1039
- export const Middleware: CommonMiddleware;
1040
-
1041
- export default App;
1042
-
1043
- declare module "@seip/bluebird-js/core/model.js" {
1044
- import {
1045
- Model,
1046
- ModelSchemaColumn,
1047
- ModelFindOptions,
1048
- ModelAllOptions,
1049
- ModelPaginateOptions,
1050
- ModelDeleteOptions,
1051
- PaginatedResult,
1052
- } from "@seip/bluebird-js";
1053
- export {
1054
- Model,
1055
- ModelSchemaColumn,
1056
- ModelFindOptions,
1057
- ModelAllOptions,
1058
- ModelPaginateOptions,
1059
- ModelDeleteOptions,
1060
- PaginatedResult,
1061
- };
1062
- export default Model;
1063
- }
1064
-
1065
- declare module "@seip/bluebird-js/core/app.js" {
1066
- import App, {
1067
- AppError,
1068
- WebSocketManager,
1069
- AppOptions,
1070
- CorsOptions,
1071
- SecurityHeadersOptions,
1072
- AppStaticOptions,
1073
- } from "@seip/bluebird-js";
1074
- export {
1075
- App,
1076
- AppError,
1077
- WebSocketManager,
1078
- AppOptions,
1079
- CorsOptions,
1080
- SecurityHeadersOptions,
1081
- AppStaticOptions,
1082
- };
1083
- export default App;
1084
- }
1085
-
1086
- declare module "@seip/bluebird-js/core/router.js" {
1087
- import { Router, RouterOptions } from "@seip/bluebird-js";
1088
- export { Router, RouterOptions };
1089
- export default Router;
1090
- }
1091
-
1092
- declare module "@seip/bluebird-js/core/render.js" {
1093
- import {
1094
- Render,
1095
- RenderIslandOptions,
1096
- RenderHtmlOptions,
1097
- IslandComponentProps,
1098
- h,
1099
- Fragment,
1100
- Island,
1101
- Client,
1102
- ErrorBoundary,
1103
- Suspense,
1104
- Head,
1105
- Title,
1106
- Meta,
1107
- useAction,
1108
- useActionState,
1109
- } from "@seip/bluebird-js";
1110
- export {
1111
- Render,
1112
- RenderIslandOptions,
1113
- RenderHtmlOptions,
1114
- IslandComponentProps,
1115
- h,
1116
- Fragment,
1117
- Island,
1118
- Client,
1119
- ErrorBoundary,
1120
- Suspense,
1121
- Head,
1122
- Title,
1123
- Meta,
1124
- useAction,
1125
- useActionState,
1126
- };
1127
- export default Render;
1128
- }
1129
-
1130
- declare module "@seip/bluebird-js/core/jsx.js" {
1131
- import {
1132
- h,
1133
- createElement,
1134
- jsx,
1135
- jsxs,
1136
- Fragment,
1137
- Island,
1138
- Client,
1139
- ErrorBoundary,
1140
- Suspense,
1141
- Head,
1142
- Title,
1143
- Meta,
1144
- useAction,
1145
- useActionState,
1146
- useState,
1147
- useEffect,
1148
- useRef,
1149
- useMemo,
1150
- useCallback,
1151
- IslandComponentProps,
1152
- isJsxElement,
1153
- renderJsxToString,
1154
- compileJsx,
1155
- stripTsTypes,
1156
- registerJsxLoader,
1157
- } from "@seip/bluebird-js";
1158
- export {
1159
- h,
1160
- createElement,
1161
- jsx,
1162
- jsxs,
1163
- Fragment,
1164
- Island,
1165
- Client,
1166
- ErrorBoundary,
1167
- Suspense,
1168
- Head,
1169
- Title,
1170
- Meta,
1171
- useAction,
1172
- useActionState,
1173
- useState,
1174
- useEffect,
1175
- useRef,
1176
- useMemo,
1177
- useCallback,
1178
- IslandComponentProps,
1179
- isJsxElement,
1180
- renderJsxToString,
1181
- compileJsx,
1182
- stripTsTypes,
1183
- registerJsxLoader,
1184
- };
1185
- }
1186
-
1187
- declare module "@seip/bluebird-js/core/html.js" {
1188
- import {
1189
- SafeHtml,
1190
- isSafeHtml,
1191
- escapeHtml,
1192
- safeJson,
1193
- HtmlTag,
1194
- html,
1195
- ScriptTag,
1196
- script,
1197
- each,
1198
- cached,
1199
- defer,
1200
- } from "@seip/bluebird-js";
1201
- export {
1202
- SafeHtml,
1203
- isSafeHtml,
1204
- escapeHtml,
1205
- safeJson,
1206
- HtmlTag,
1207
- html,
1208
- ScriptTag,
1209
- script,
1210
- each,
1211
- cached,
1212
- defer,
1213
- };
1214
- export default html;
1215
- }
1216
-
1217
- declare module "@seip/bluebird-js/core/validate.js" {
1218
- import {
1219
- Validator,
1220
- ValidationRule,
1221
- ValidationSchema,
1222
- ValidationError,
1223
- ValidationResult,
1224
- } from "@seip/bluebird-js";
1225
- export {
1226
- Validator,
1227
- ValidationRule,
1228
- ValidationSchema,
1229
- ValidationError,
1230
- ValidationResult,
1231
- };
1232
- export default Validator;
1233
- }
1234
-
1235
- declare module "@seip/bluebird-js/core/database.js" {
1236
- import {
1237
- Database,
1238
- DB_TYPE,
1239
- DatabaseQueryOptions,
1240
- DatabaseTransactionClient,
1241
- PaginatedResult,
1242
- } from "@seip/bluebird-js";
1243
- export {
1244
- Database,
1245
- DB_TYPE,
1246
- DatabaseQueryOptions,
1247
- DatabaseTransactionClient,
1248
- PaginatedResult,
1249
- };
1250
- export default Database;
1251
- }
1252
-
1253
- declare module "@seip/bluebird-js/core/auth.js" {
1254
- import {
1255
- Auth,
1256
- AuthProtectOptions,
1257
- AuthLoginOptions,
1258
- AuthTokenPayload,
1259
- } from "@seip/bluebird-js";
1260
- export {
1261
- Auth,
1262
- AuthProtectOptions,
1263
- AuthLoginOptions,
1264
- AuthTokenPayload,
1265
- };
1266
- export default Auth;
1267
- }
1268
-
1269
- declare module "@seip/bluebird-js/core/cache.js" {
1270
- import {
1271
- Cache,
1272
- getRedisClient,
1273
- CacheDriver,
1274
- CacheMiddlewareOptions,
1275
- CacheGetOptions,
1276
- CacheSetOptions,
1277
- } from "@seip/bluebird-js";
1278
- export {
1279
- Cache,
1280
- getRedisClient,
1281
- CacheDriver,
1282
- CacheMiddlewareOptions,
1283
- CacheGetOptions,
1284
- CacheSetOptions,
1285
- };
1286
- export default Cache;
1287
- }
1288
-
1289
- declare module "@seip/bluebird-js/core/redis.js" {
1290
- export function initRedis(): Promise<any>;
1291
- export function getRedisClient(): any;
1292
- export function isRedisConnectedStatus(): boolean;
1293
- export function redisGet(key: string): Promise<any>;
1294
- export function redisSet(key: string, value: any, seconds?: number): Promise<boolean>;
1295
- export function redisDel(keys: string | string[]): Promise<boolean>;
1296
- export function redisClearPrefix(prefix: string): Promise<boolean>;
1297
- export function disconnectRedis(): Promise<void>;
1298
-
1299
- const redisHandler: {
1300
- initRedis: typeof initRedis;
1301
- getRedisClient: typeof getRedisClient;
1302
- isRedisConnectedStatus: typeof isRedisConnectedStatus;
1303
- redisGet: typeof redisGet;
1304
- redisSet: typeof redisSet;
1305
- redisDel: typeof redisDel;
1306
- redisClearPrefix: typeof redisClearPrefix;
1307
- disconnectRedis: typeof disconnectRedis;
1308
- };
1309
- export default redisHandler;
1310
- }
1311
-
1312
- declare module "@seip/bluebird-js/core/csrf.js" {
1313
- import { Csrf, CsrfOptions } from "@seip/bluebird-js";
1314
- export { Csrf, CsrfOptions };
1315
- export default Csrf;
1316
- }
1317
-
1318
- declare module "@seip/bluebird-js/core/hash.js" {
1319
- import { Hash, HashMakeOptions } from "@seip/bluebird-js";
1320
- export { Hash, HashMakeOptions };
1321
- export default Hash;
1322
- }
1323
-
1324
- declare module "@seip/bluebird-js/core/queue.js" {
1325
- import {
1326
- Queue,
1327
- QueueDispatchOptions,
1328
- QueueJob,
1329
- QueueHandler,
1330
- } from "@seip/bluebird-js";
1331
- export {
1332
- Queue,
1333
- QueueDispatchOptions,
1334
- QueueJob,
1335
- QueueHandler,
1336
- };
1337
- export default Queue;
1338
- }
1339
-
1340
- declare module "@seip/bluebird-js/core/upload.js" {
1341
- import {
1342
- Upload,
1343
- UploadDiskOptions,
1344
- UploadMiddleware,
1345
- UploadedFile,
1346
- } from "@seip/bluebird-js";
1347
- export {
1348
- Upload,
1349
- UploadDiskOptions,
1350
- UploadMiddleware,
1351
- UploadedFile,
1352
- };
1353
- export default Upload;
1354
- }
1355
-
1356
- declare module "@seip/bluebird-js/core/ws.js" {
1357
- import {
1358
- WebSocketManager,
1359
- WebSocketOptions,
1360
- WebSocketClient,
1361
- WebSocketConnectionHandler,
1362
- } from "@seip/bluebird-js";
1363
- export {
1364
- WebSocketManager,
1365
- WebSocketOptions,
1366
- WebSocketClient,
1367
- WebSocketConnectionHandler,
1368
- };
1369
- export default WebSocketManager;
1370
- }
1371
-
1372
- declare module "@seip/bluebird-js/core/swagger.js" {
1373
- import { Swagger, SwaggerOptions } from "@seip/bluebird-js";
1374
- export { Swagger, SwaggerOptions };
1375
- export default Swagger;
1376
- }
1377
-
1378
- declare module "@seip/bluebird-js/core/logger.js" {
1379
- import { Logger } from "@seip/bluebird-js";
1380
- export { Logger };
1381
- export default Logger;
1382
- }
1383
-
1384
- declare module "@seip/bluebird-js/core/config.js" {
1385
- import { Config, AppProps } from "@seip/bluebird-js";
1386
- export { Config, AppProps };
1387
- export default Config;
1388
- }
1389
-
1390
- declare module "@seip/bluebird-js/core/debug.js" {
1391
- import { Debug } from "@seip/bluebird-js";
1392
- export { Debug };
1393
- export default Debug;
1394
- }
1395
-
1396
- declare module "@seip/bluebird-js/core/middleware.js" {
1397
- import { Middleware, CommonMiddleware } from "@seip/bluebird-js";
1398
- export { Middleware, CommonMiddleware };
1399
- export default Middleware;
1400
- }
1401
-
1402
- declare module "@seip/bluebird-js/core/vite.js" {
1403
- import { Vite, ViteOptions } from "@seip/bluebird-js";
1404
- export { Vite, ViteOptions };
1405
- export default Vite;
1406
- }
1407
-
1408
- declare module "@seip/bluebird-js/core/ratelimit.js" {
1409
- import { RateLimit, RateLimitOptions } from "@seip/bluebird-js";
1410
- export { RateLimit, RateLimitOptions };
1411
- export default RateLimit;
1412
- }
1413
-
1414
- declare module "@seip/bluebird-js/core/seo.js" {
1415
- import { Seo } from "@seip/bluebird-js";
1416
- export { Seo };
1417
- export default Seo;
1418
- }
1419
-
1420
- declare module "@seip/bluebird-js/core/actions.js" {
1421
- import { Actions, ActionDefinitionOptions, ActionContext } from "@seip/bluebird-js";
1422
- export { Actions, ActionDefinitionOptions, ActionContext };
1423
- export default Actions;
1424
- }
1425
-
1426
- declare module "@seip/bluebird-js/core/ai.js" {
1427
- import { AI, ai, AIOptions, AIAskOptions, AIResult, AIStreamChunk } from "@seip/bluebird-js";
1428
- export { AI, ai, AIOptions, AIAskOptions, AIResult, AIStreamChunk };
1429
- export default AI;
1430
- }
1431
-
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
+ export * from "./ai.js";
6
+
7
+ /**
8
+ * Standard pagination metadata structure.
9
+ */
10
+ export interface PaginationMeta {
11
+ page?: number;
12
+ limit?: number;
13
+ total?: number;
14
+ totalPages?: number;
15
+ }
16
+
17
+ /**
18
+ * Uploaded file object populated by multer middleware.
19
+ */
20
+ export interface UploadedFile {
21
+ fieldname: string;
22
+ originalname: string;
23
+ encoding: string;
24
+ mimetype: string;
25
+ size: number;
26
+ destination: string;
27
+ filename: string;
28
+ path: string;
29
+ buffer?: Buffer;
30
+ }
31
+
32
+ /**
33
+ * Standard Bluebird API JSON response envelope.
34
+ */
35
+ export interface ApiResponse<T = any> {
36
+ status: "success" | "error";
37
+ message: string;
38
+ data?: T;
39
+ errors?: any;
40
+ pagination?: PaginationMeta;
41
+ }
42
+
43
+ declare global {
44
+ namespace Express {
45
+ interface Response {
46
+ /**
47
+ * Sends a standardized JSON success response.
48
+ * @param data Data payload to return.
49
+ * @param message Success message.
50
+ * @param statusCode HTTP status code (default: 200).
51
+ */
52
+ success<T = any>(data?: T, message?: string, statusCode?: number): Response;
53
+
54
+ /**
55
+ * Sends a standardized HTTP 200 OK success response.
56
+ * @param data Data payload.
57
+ * @param message Success message.
58
+ */
59
+ ok<T = any>(data?: T, message?: string): Response;
60
+
61
+ /**
62
+ * Sends a standardized HTTP 201 Created success response.
63
+ * @param data Data payload.
64
+ * @param message Success message.
65
+ */
66
+ created<T = any>(data?: T, message?: string): Response;
67
+
68
+ /**
69
+ * Sends a standardized HTTP 400 Bad Request error response.
70
+ * @param message Error message.
71
+ * @param errors Detailed errors array or object.
72
+ */
73
+ badRequest(message?: string, errors?: any): Response;
74
+
75
+ /**
76
+ * Sends a standardized HTTP 401 Unauthorized error response.
77
+ * @param message Error message.
78
+ */
79
+ unauthorized(message?: string): Response;
80
+
81
+ /**
82
+ * Sends a standardized HTTP 403 Forbidden error response.
83
+ * @param message Error message.
84
+ */
85
+ forbidden(message?: string): Response;
86
+
87
+ /**
88
+ * Sends a standardized HTTP 404 Not Found error response.
89
+ * @param message Error message.
90
+ */
91
+ notFound(message?: string): Response;
92
+
93
+ /**
94
+ * Sends a standardized HTTP 500 Internal Server Error response.
95
+ * @param message Error message.
96
+ * @param errors Error details.
97
+ */
98
+ serverError(message?: string, errors?: any): Response;
99
+
100
+ /**
101
+ * Sends a standardized JSON error response.
102
+ * @param message Error message.
103
+ * @param statusCode HTTP status code (default: 400).
104
+ * @param errors Array or object of detailed errors.
105
+ */
106
+ error(message?: string, statusCode?: number, errors?: any): Response;
107
+
108
+ /**
109
+ * Sends a standardized paginated JSON response.
110
+ * @param data Array of records for current page.
111
+ * @param pagination Object containing page, limit, and total count.
112
+ * @param message Success message.
113
+ */
114
+ paginate<T = any>(
115
+ data?: T[],
116
+ pagination?: PaginationMeta,
117
+ message?: string
118
+ ): Response;
119
+
120
+ /**
121
+ * Initializes a Server-Sent Events (SSE) stream with automatic keep-alive and Nginx unbuffering.
122
+ */
123
+ sse(options?: {
124
+ keepAliveMs?: number;
125
+ retry?: number;
126
+ headers?: Record<string, string>;
127
+ }): {
128
+ send(data: any, eventName?: string | null, id?: string | number | null): boolean;
129
+ event(eventName: string, data: any, id?: string | number | null): boolean;
130
+ comment(text?: string): void;
131
+ onClose(cb: () => void): void;
132
+ close(): void;
133
+ };
134
+ }
135
+
136
+ interface Request {
137
+ lang?: string;
138
+ user?: any;
139
+ csrfToken?(): string;
140
+ file?: UploadedFile;
141
+ files?: UploadedFile[] | Record<string, UploadedFile[]>;
142
+ [key: string]: any;
143
+ }
144
+ }
145
+ }
146
+
147
+ export class AppError extends Error {
148
+ statusCode: number;
149
+ errors: any;
150
+ isOperational: boolean;
151
+
152
+ constructor(message: string, statusCode?: number, errors?: any);
153
+ }
154
+
155
+ /**
156
+ * CORS configuration options.
157
+ */
158
+ export interface CorsOptions {
159
+ /**
160
+ * Allowed origins. `"*"` (default) never reflects the request origin and never sends credentials.
161
+ * Use an allowlist (string, array, RegExp, predicate) or `true` (reflect any origin) for credentialed CORS.
162
+ */
163
+ origin?:
164
+ | string
165
+ | boolean
166
+ | string[]
167
+ | RegExp
168
+ | ((origin: string | undefined, req: Request) => boolean);
169
+ methods?: string | string[];
170
+ allowedHeaders?: string | string[];
171
+ exposedHeaders?: string | string[];
172
+ /** Sends `Access-Control-Allow-Credentials: true` (ignored with `origin: "*"`). Defaults to `false`. */
173
+ credentials?: boolean;
174
+ maxAge?: number;
175
+ }
176
+
177
+ /**
178
+ * Security response headers options.
179
+ */
180
+ export interface SecurityHeadersOptions {
181
+ /** Content-Security-Policy. `{nonce}` is replaced by a per-request nonce exposed as `res.locals.cspNonce`. */
182
+ csp?: string | false;
183
+ /** Generate a per-request CSP nonce even when the policy has no `{nonce}` placeholder. */
184
+ nonce?: boolean;
185
+ frameOptions?: string;
186
+ referrerPolicy?: string;
187
+ permissionsPolicy?: string;
188
+ }
189
+
190
+ /**
191
+ * Static asset serving options.
192
+ */
193
+ export interface AppStaticOptions {
194
+ path: string;
195
+ options?: Record<string, any>;
196
+ }
197
+
198
+ /**
199
+ * Rate limit configuration options.
200
+ */
201
+ export interface RateLimitOptions {
202
+ windowMs?: number;
203
+ max?: number;
204
+ message?: string;
205
+ statusCode?: number;
206
+ headers?: boolean;
207
+ driver?: "memory" | "redis";
208
+ keyGenerator?: (req: Request) => string;
209
+ skip?: (req: Request) => boolean;
210
+ /** Bucket namespace (defaults to a per-limiter id so limiters never share counters). */
211
+ prefix?: string;
212
+ }
213
+
214
+ export class RateLimit {
215
+ static middleware(options?: RateLimitOptions | boolean): (req: Request, res: Response, next: NextFunction) => Promise<any>;
216
+ static clear(): void;
217
+ }
218
+
219
+ export class Seo {
220
+ static registerRoute(basePath: string, routePath: string | RegExp, languages?: string[]): void;
221
+ static unregisterRoute(fullPath: string): boolean;
222
+ static getRoutes(): string[];
223
+ static clear(): void;
224
+ static generateSitemap(baseUrl?: string): string;
225
+ static generateRobots(baseUrl?: string, disallow?: string[]): string;
226
+ }
227
+
228
+ /**
229
+ * WebSocket manager configuration options.
230
+ */
231
+ export interface WebSocketOptions {
232
+ path?: string;
233
+ auth?: boolean;
234
+ maxPayload?: number;
235
+ }
236
+
237
+ /**
238
+ * Active WebSocket client connection interface.
239
+ */
240
+ export interface WebSocketClient {
241
+ isAlive?: boolean;
242
+ user?: any;
243
+ rooms?: Set<string>;
244
+ send(data: any): void;
245
+ on(event: string, handler: (...args: any[]) => void): void;
246
+ close(code?: number, reason?: string): void;
247
+ [key: string]: any;
248
+ }
249
+
250
+ export type WebSocketConnectionHandler = (ws: WebSocketClient, req: Request) => void;
251
+
252
+ export class WebSocketManager {
253
+ server: HttpServer;
254
+ path: string;
255
+ requireAuth: boolean;
256
+ maxPayload: number;
257
+ rooms: Map<string, Set<WebSocketClient>>;
258
+ clients: Set<WebSocketClient>;
259
+
260
+ constructor(server: HttpServer | any, options?: WebSocketOptions);
261
+ onConnection(handler: WebSocketConnectionHandler): void;
262
+ join(room: string, ws: WebSocketClient): void;
263
+ leave(room: string, ws: WebSocketClient): void;
264
+ broadcast(data: any, room?: string | null): void;
265
+ }
266
+
267
+ export interface ViteOptions {
268
+ dev?: boolean;
269
+ configFile?: string;
270
+ }
271
+
272
+ /**
273
+ * Application initialization options.
274
+ */
275
+ export interface AppOptions {
276
+ routes?: Array<Router | ExpressRouter | any>;
277
+ cors?: boolean | CorsOptions;
278
+ middlewares?: Array<RequestHandler | any>;
279
+ port?: number | string;
280
+ host?: string;
281
+ appUrl?: string;
282
+ logger?: boolean;
283
+ notFound?: boolean;
284
+ json?: boolean | Record<string, any>;
285
+ urlencoded?: boolean | Record<string, any>;
286
+ static?: AppStaticOptions;
287
+ cookieParser?: boolean;
288
+ swagger?: boolean | SwaggerOptions;
289
+ compression?: boolean;
290
+ security?: boolean | SecurityHeadersOptions;
291
+ rateLimit?: boolean | RateLimitOptions;
292
+ vite?: boolean | ViteOptions;
293
+ desktop?: boolean;
294
+ userDataPath?: string;
295
+ appPath?: string;
296
+ allowLan?: boolean;
297
+ trustProxy?: boolean | number | string;
298
+ debug?: boolean;
299
+ }
300
+
301
+ export class App {
302
+ app: ExpressRouter | any;
303
+ server: HttpServer;
304
+ wsManager: WebSocketManager | null;
305
+ routes: any[];
306
+ cors: boolean | CorsOptions;
307
+ middlewares: any[];
308
+ port: number | string;
309
+ host: string;
310
+ appUrl: string;
311
+ logger: boolean;
312
+ notFound: boolean;
313
+ desktop: boolean;
314
+ allowLan: boolean;
315
+ trustProxy: boolean | number | string;
316
+
317
+ constructor(options?: AppOptions);
318
+
319
+ use(record: any): void;
320
+ set(key: string, value: any): void;
321
+ websocket(
322
+ options?:
323
+ | WebSocketConnectionHandler
324
+ | WebSocketOptions
325
+ ): WebSocketManager;
326
+ getPort(): number;
327
+ getUrl(): string;
328
+ run(): Promise<any>;
329
+ runDesktop(options?: {
330
+ appPath?: string;
331
+ userDataPath?: string;
332
+ allowLan?: boolean;
333
+ host?: string;
334
+ port?: number;
335
+ }): Promise<{ server: HttpServer; port: number; url: string; lanUrl?: string; lanIp?: string }>;
336
+ close(): Promise<void>;
337
+
338
+ static helmet(options?: any): (req: Request, res: Response, next: NextFunction) => void;
339
+ static securityHeaders(options?: SecurityHeadersOptions): (req: Request, res: Response, next: NextFunction) => void;
340
+ static rateLimit(options?: RateLimitOptions | boolean): (req: Request, res: Response, next: NextFunction) => Promise<any>;
341
+ static ai(options?: any): any;
342
+ }
343
+
344
+ /**
345
+ * Router configuration options.
346
+ */
347
+ export interface RouterOptions {
348
+ seo?: boolean;
349
+ languages?: string[];
350
+ }
351
+
352
+ export class Router {
353
+ router: ExpressRouter;
354
+ path: string;
355
+
356
+ constructor(path?: string, options?: RouterOptions);
357
+
358
+ use(...middleware: Array<RequestHandler | any>): void;
359
+ get(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
360
+ post(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
361
+ put(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
362
+ delete(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
363
+ patch(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
364
+ options(path: string | RegExp, ...callback: Array<RequestHandler | any>): void;
365
+ /** Mounts a React SPA with per-URL SEO metadata, JSON-LD, scripts/styles, and full-width skeleton. */
366
+ spa(path: string, options?: SpaOptions): void;
367
+ SPA(path: string, options?: SpaOptions): void;
368
+ getRouter(): ExpressRouter;
369
+ getPath(): string;
370
+ }
371
+
372
+ /**
373
+ * Validation rule configuration for a single field.
374
+ */
375
+ export interface ValidationRule {
376
+ required?: boolean;
377
+ min?: number;
378
+ max?: number;
379
+ email?: boolean;
380
+ number?: boolean;
381
+ alpha?: boolean;
382
+ alphanumeric?: boolean;
383
+ boolean?: boolean;
384
+ date?: boolean;
385
+ url?: boolean;
386
+ in?: any[];
387
+ equals?: any;
388
+ password?: boolean;
389
+ pattern?: RegExp | string;
390
+ xss?: boolean;
391
+ messages?: Partial<
392
+ Record<
393
+ | "required"
394
+ | "min"
395
+ | "max"
396
+ | "email"
397
+ | "number"
398
+ | "alpha"
399
+ | "alphanumeric"
400
+ | "boolean"
401
+ | "date"
402
+ | "url"
403
+ | "in"
404
+ | "equals"
405
+ | "password"
406
+ | "pattern",
407
+ string
408
+ >
409
+ >;
410
+ }
411
+
412
+ /**
413
+ * Validator schema definition.
414
+ */
415
+ export type ValidationSchema = Record<string, ValidationRule>;
416
+
417
+ /**
418
+ * Validation failure item.
419
+ */
420
+ export interface ValidationError {
421
+ field: string;
422
+ message: string;
423
+ }
424
+
425
+ /**
426
+ * Validation output result.
427
+ */
428
+ export interface ValidationResult {
429
+ success: boolean;
430
+ error: boolean;
431
+ errors: ValidationError[];
432
+ message: string[];
433
+ html?: string[];
434
+ }
435
+
436
+ export class Validator {
437
+ schema: ValidationSchema;
438
+ lang_default: string | null;
439
+ messages: Record<string, any>;
440
+
441
+ constructor(schema: ValidationSchema, lang_default?: string, messages?: Record<string, any>);
442
+ middleware(): (req: Request, res: Response, next: NextFunction) => void;
443
+ validate(req: Request | Record<string, any>): Promise<ValidationResult>;
444
+ static xssMiddleware(): (req: Request, res: Response, next: NextFunction) => void;
445
+ static sanitizeObject<T = any>(obj: T): T;
446
+ static mutateSanitized(obj: any): void;
447
+ }
448
+
449
+ /**
450
+ * Password hashing options.
451
+ */
452
+ export interface HashMakeOptions {
453
+ driver?: "scrypt" | "bcrypt";
454
+ rounds?: number;
455
+ N?: number;
456
+ r?: number;
457
+ p?: number;
458
+ }
459
+
460
+ export class Hash {
461
+ static make(password: string, options?: HashMakeOptions): Promise<string>;
462
+ static hash(password: string, options?: HashMakeOptions): Promise<string>;
463
+ static verify(password: string, hash: string): Promise<boolean>;
464
+ static check(password: string, hash: string): Promise<boolean>;
465
+ static needsRehash(hash: string, options?: HashMakeOptions): boolean;
466
+ }
467
+
468
+ /**
469
+ * Auth protect middleware options.
470
+ */
471
+ export interface AuthProtectOptions {
472
+ redirect?: string | null;
473
+ key?: string;
474
+ cookieKey?: string;
475
+ roles?: string | string[] | null;
476
+ secret?: string;
477
+ /** Set false to skip the global `Auth.configure({ resolveUser })` hook for this route. */
478
+ resolveUser?: boolean;
479
+ }
480
+
481
+ /**
482
+ * Auth login options.
483
+ */
484
+ export interface AuthLoginOptions {
485
+ expiresIn?: string | number;
486
+ rotateCsrf?: boolean;
487
+ /** Set false to return the token without setting the auth cookie (bearer clients). */
488
+ setCookie?: boolean;
489
+ cookie?: Record<string, any>;
490
+ secret?: string;
491
+ }
492
+
493
+ /**
494
+ * Decoded Auth JWT token payload.
495
+ */
496
+ export type AuthTokenPayload = Record<string, any> & {
497
+ _sessionId?: string;
498
+ exp?: number;
499
+ iat?: number;
500
+ };
501
+
502
+ export class Auth {
503
+ static encrypt(payload: any, secret?: string): string;
504
+ static decrypt<T = any>(data: string, secret?: string): T | null;
505
+ static generateToken(payload: any, secret?: string, expiresIn?: string | number): string;
506
+ static verifyToken<T = any>(token: string, secret?: string): T | null;
507
+ static hasRole(user: any, roles?: string | string[] | null): boolean;
508
+ static optional(options?: Pick<AuthProtectOptions, "key" | "cookieKey" | "secret">): (req: Request, res: Response, next: NextFunction) => Promise<any>;
509
+ static protect(options?: AuthProtectOptions): (req: Request, res: Response, next: NextFunction) => Promise<any>;
510
+ static login(res: Response, data: any, key?: string, options?: AuthLoginOptions): Promise<string>;
511
+ static logout(res: Response, key?: string, options?: Record<string, any>, req?: Request | null): Promise<boolean>;
512
+ /** Reloads the user on every authenticated request; return null to reject the session (deleted user, changed session version). */
513
+ static configure(options?: {
514
+ resolveUser?: ((payload: AuthTokenPayload, req: Request) => Promise<Record<string, any> | null> | Record<string, any> | null) | null;
515
+ }): void;
516
+ }
517
+
518
+ export type CacheDriver = "memory" | "redis" | "file";
519
+
520
+ /**
521
+ * Cache middleware options.
522
+ */
523
+ export interface CacheMiddlewareOptions {
524
+ driver?: "memory" | "redis";
525
+ allowAuthenticated?: boolean;
526
+ key?: (req: Request) => string;
527
+ }
528
+
529
+ /**
530
+ * Cache read options.
531
+ */
532
+ export interface CacheGetOptions {
533
+ driver?: CacheDriver;
534
+ }
535
+
536
+ /**
537
+ * Cache write options.
538
+ */
539
+ export interface CacheSetOptions {
540
+ driver?: CacheDriver;
541
+ fallbackDriver?: CacheDriver;
542
+ }
543
+
544
+ export class Cache {
545
+ static middleware(seconds?: number, options?: CacheMiddlewareOptions): (req: Request, res: Response, next: NextFunction) => Promise<any>;
546
+ static get<T = any>(key: string, options?: CacheGetOptions): Promise<T | null>;
547
+ static set(key: string, value: any, seconds?: number, options?: CacheSetOptions): Promise<boolean>;
548
+ static deduplicate<T = any>(key: string, loader: () => Promise<T>): Promise<T>;
549
+ static delete(keys: string | string[]): Promise<boolean>;
550
+ static del(keys: string | string[]): Promise<boolean>;
551
+ static deletePrefix(prefix: string): Promise<boolean>;
552
+ static clear(): Promise<boolean>;
553
+ static getMode(): string;
554
+ static size(): number;
555
+ }
556
+
557
+ export function getRedisClient(): any;
558
+
559
+ /**
560
+ * Per-URL SEO and skeleton metadata entry inside `router.spa(..., { meta })`.
561
+ */
562
+ export interface SpaMetaEntry {
563
+ title?: string;
564
+ titleTemplate?: string;
565
+ description?: string;
566
+ keywords?: string | string[];
567
+ author?: string;
568
+ canonical?: string | boolean;
569
+ baseUrl?: string;
570
+ image?: string;
571
+ ogType?: string;
572
+ robots?: boolean | string;
573
+ lang?: string;
574
+ jsonld?: Record<string, any> | Record<string, any>[];
575
+ jsonLd?: Record<string, any> | Record<string, any>[];
576
+ head?: Array<string | Record<string, any>> | string;
577
+ body?: Array<string | Record<string, any>> | string;
578
+ metaTags?: Array<Record<string, string>>;
579
+ links?: Array<Record<string, string>>;
580
+ htmlAttrs?: Record<string, string | boolean>;
581
+ bodyAttrs?: Record<string, string | boolean>;
582
+ skeleton?: "app" | "auth" | "page" | false | string;
583
+ rootClass?: string;
584
+ }
585
+
586
+ export type SpaMetaResolver =
587
+ | SpaMetaEntry
588
+ | ((req: Request, params: Record<string, string>) => SpaMetaEntry | Promise<SpaMetaEntry>);
589
+
590
+ /**
591
+ * Configuration options for `router.spa()`.
592
+ */
593
+ export interface SpaOptions extends SpaMetaEntry {
594
+ /** Mount path used by `npx bluebird-js export` and `routerWeb.spa(spa.mount, spa)` (e.g. "/app"). */
595
+ mount?: string;
596
+ meta?: Record<string, SpaMetaResolver>;
597
+ /** React entry (default "app/resources/main.jsx"). */
598
+ entry?: string;
599
+ /** Extra stylesheets linked in <head> (the entry already imports "./styles.css"). */
600
+ styles?: string | string[];
601
+ /** HTML shell (default "app/resources/index.html", false = built-in shell). */
602
+ template?: string | false;
603
+ cache?: number;
604
+ cacheQuery?: string[];
605
+ seo?: boolean;
606
+ }
607
+
608
+ /**
609
+ * Options for rendering HTML views with `Render.html()`, `Render.send()`, and `Render.view()`.
610
+ */
611
+ export interface RenderOptions {
612
+ layout?: string | false;
613
+ cache?: number;
614
+ ttl?: number;
615
+ query?: string[];
616
+ cacheQuery?: string[];
617
+ raw?: boolean;
618
+ }
619
+
620
+ export class Render {
621
+ static renderString(template: string, data?: Record<string, any>, ctx?: Record<string, any>): Promise<string>;
622
+ static component(viewName: string, data?: Record<string, any>, ctx?: Record<string, any>): Promise<string>;
623
+ static html(res: Response, viewName: string, data?: Record<string, any>, options?: number | RenderOptions): Promise<any>;
624
+ static send(
625
+ res: Response,
626
+ viewName: string,
627
+ data?: Record<string, any>,
628
+ ttlOrOptions?: number | RenderOptions
629
+ ): Promise<any>;
630
+ static partial(res: Response, partialName: string, data?: Record<string, any>): Promise<any>;
631
+ static view(
632
+ viewName: string,
633
+ dataOrFn?: Record<string, any> | ((req: Request, res: Response) => any),
634
+ options?: number | RenderOptions
635
+ ): RequestHandler;
636
+ static cache(
637
+ seconds?: number,
638
+ options?: { allowAuthenticated?: boolean; query?: string[] }
639
+ ): (req: Request, res: Response, next: NextFunction) => Promise<any>;
640
+ static redirect(req: Request, res: Response, url: string, status?: number): void;
641
+ static clearTemplateCache(): void;
642
+ static invalidate(keys?: string | string[]): Promise<void>;
643
+ }
644
+
645
+ export * from "./html.js";
646
+
647
+
648
+ export const DB_TYPE: "sqlite" | "postgres" | "mysql" | "none" | string;
649
+
650
+ /**
651
+ * Database query execution options.
652
+ */
653
+ export interface DatabaseQueryOptions {
654
+ cache?: number;
655
+ cachePrefix?: string;
656
+ return_row?: boolean;
657
+ [key: string]: any;
658
+ }
659
+
660
+ /**
661
+ * Standard paginated query result.
662
+ */
663
+ export interface PaginatedResult<T = any> {
664
+ data: T[];
665
+ total: number;
666
+ page: number;
667
+ limit: number;
668
+ totalPages: number;
669
+ }
670
+
671
+ /**
672
+ * Transaction runner client.
673
+ */
674
+ export interface DatabaseTransactionClient {
675
+ query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
676
+ }
677
+
678
+ export interface DatabaseBackupOptions {
679
+ out?: string;
680
+ compress?: boolean;
681
+ keep?: number;
682
+ filename?: string;
683
+ dbInstance?: Database;
684
+ dbType?: string;
685
+ }
686
+
687
+ export interface DatabaseBackupResult {
688
+ success: boolean;
689
+ file: string;
690
+ filename: string;
691
+ size: number;
692
+ rotated: number;
693
+ dbType: string;
694
+ }
695
+
696
+ export interface DatabaseRestoreOptions {
697
+ safetyBackup?: boolean;
698
+ verify?: boolean;
699
+ dbInstance?: Database;
700
+ dbType?: string;
701
+ }
702
+
703
+ export interface DatabaseRestoreResult {
704
+ success: boolean;
705
+ restoredFrom: string;
706
+ targetFile: string;
707
+ preRestoreBackup?: string | null;
708
+ size?: number;
709
+ dbType: string;
710
+ }
711
+
712
+ export class Database {
713
+ backup(options?: DatabaseBackupOptions): Promise<DatabaseBackupResult>;
714
+ restore(filePath: string, options?: DatabaseRestoreOptions): Promise<DatabaseRestoreResult>;
715
+ static backup(options?: DatabaseBackupOptions): Promise<DatabaseBackupResult>;
716
+ static restore(filePath: string, options?: DatabaseRestoreOptions): Promise<DatabaseRestoreResult>;
717
+ type: string;
718
+ constructor(connectionLimit?: number, queueLimit?: number, config?: any);
719
+ init(retries?: number): Promise<boolean>;
720
+ query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
721
+ paginate<T = any>(
722
+ sql: string,
723
+ params?: any[],
724
+ options?: { page?: number; limit?: number; cache?: number }
725
+ ): Promise<PaginatedResult<T>>;
726
+ transaction<T = any>(callback: (tx: DatabaseTransactionClient) => Promise<T>): Promise<T>;
727
+ executeTransaction<T = any>(callback: (tx: DatabaseTransactionClient) => Promise<T>): Promise<T>;
728
+ close(): Promise<void>;
729
+ static closeAll(): Promise<void>;
730
+ }
731
+
732
+ /**
733
+ * Queue dispatching options.
734
+ */
735
+ export interface QueueDispatchOptions {
736
+ delayMs?: number;
737
+ }
738
+
739
+ /**
740
+ * Queue job item structure.
741
+ */
742
+ export interface QueueJob<T = any> {
743
+ id: string;
744
+ name: string;
745
+ payload: T;
746
+ createdAt: string;
747
+ }
748
+
749
+ export type QueueHandler<T = any> = (payload: T) => Promise<any> | any;
750
+
751
+ export class Queue {
752
+ static process<T = any>(jobName: string, handler: QueueHandler<T>): void;
753
+ static dispatch<T = any>(jobName: string, payload?: T, options?: QueueDispatchOptions): Promise<boolean>;
754
+ static work(): Promise<void>;
755
+ static stop(): void;
756
+ static loadJobs(jobsDir?: string): Promise<void>;
757
+ }
758
+
759
+ /**
760
+ * CSRF middleware options.
761
+ */
762
+ export interface CsrfOptions {
763
+ cookieName?: string;
764
+ headerName?: string;
765
+ bodyKey?: string;
766
+ maxAgeMs?: number;
767
+ secret?: string;
768
+ /** Exempt bearer-token requests sent without an auth cookie (default true). */
769
+ allowToken?: boolean;
770
+ authCookie?: string;
771
+ }
772
+
773
+ export class Csrf {
774
+ static cookieName: string;
775
+ static generateToken(secret?: string): string;
776
+ static verifyToken(token: string, secret?: string, maxAgeMs?: number): boolean;
777
+ static safeEqual(a: string, b: string): boolean;
778
+ static cookieOptions(): Record<string, any>;
779
+ /** Returns the request's valid CSRF token, issuing a fresh `_csrf` cookie when missing. */
780
+ static ensure(req: Request, res: Response): string;
781
+ /** Issues a new CSRF token cookie (called automatically on Auth.login/logout). */
782
+ static rotate(res: Response): string;
783
+ /** Timing-safe double-submit verification (header or body, never query string). */
784
+ static verifyRequest(req: Request, options?: CsrfOptions): boolean;
785
+ /** True for `Authorization: Bearer` / `X-Auth-Mode: token` requests without an auth cookie. */
786
+ static isTokenRequest(req: Request, authCookie?: string): boolean;
787
+ static middleware(options?: CsrfOptions): (req: Request, res: Response, next: NextFunction) => void;
788
+ }
789
+
790
+ export interface ModelSchemaColumn {
791
+ type: "int" | "integer" | "bigint" | "string" | "text" | "boolean" | "date" | "float" | "json" | (string & {});
792
+ primary?: boolean;
793
+ auto?: boolean;
794
+ unique?: boolean;
795
+ required?: boolean;
796
+ nullable?: boolean;
797
+ default?: any;
798
+ hidden?: boolean;
799
+ length?: number;
800
+ min?: number;
801
+ max?: number;
802
+ email?: boolean;
803
+ hash?: boolean;
804
+ in?: any[];
805
+ references?: string;
806
+ onDelete?: "cascade" | "set null" | "restrict" | "no action" | (string & {});
807
+ }
808
+
809
+ /**
810
+ * Options for Model.find query.
811
+ */
812
+ export interface ModelFindOptions {
813
+ withDeleted?: boolean;
814
+ withHidden?: boolean;
815
+ cache?: number;
816
+ oneMany?: typeof Model | Array<typeof Model>;
817
+ belongsTo?: typeof Model | Array<typeof Model>;
818
+ }
819
+
820
+ /**
821
+ * Options for Model.all query.
822
+ */
823
+ export interface ModelAllOptions {
824
+ where?: Record<string, any>;
825
+ order?: string | string[];
826
+ limit?: number;
827
+ offset?: number;
828
+ withDeleted?: boolean;
829
+ withHidden?: boolean;
830
+ cache?: number;
831
+ oneMany?: typeof Model | Array<typeof Model>;
832
+ belongsTo?: typeof Model | Array<typeof Model>;
833
+ }
834
+
835
+ /**
836
+ * Options for Model.paginate query.
837
+ */
838
+ export interface ModelPaginateOptions {
839
+ where?: Record<string, any>;
840
+ order?: string | string[];
841
+ page?: number;
842
+ limit?: number;
843
+ withDeleted?: boolean;
844
+ withHidden?: boolean;
845
+ cache?: number;
846
+ }
847
+
848
+ /**
849
+ * Options for Model.delete operation.
850
+ */
851
+ export interface ModelDeleteOptions {
852
+ force?: boolean;
853
+ cascade?: Array<typeof Model>;
854
+ }
855
+
856
+ export class Model {
857
+ static table: string;
858
+ static primaryKey: string;
859
+ static timestamps: boolean;
860
+ static softDelete: boolean;
861
+ static schema: Record<string, ModelSchemaColumn>;
862
+ static fillable: string[];
863
+ static guarded: string[];
864
+
865
+ static getDatabase(): Database;
866
+ static setDatabase(db: Database): void;
867
+ static close(): Promise<void>;
868
+ static query<T = any>(sql: string, params?: any[], options?: any): Promise<T>;
869
+ static transaction<T = any>(callback: (tx: DatabaseTransactionClient | any) => Promise<T>): Promise<T>;
870
+ static invalidateCache(): Promise<void>;
871
+ static find<T = any>(
872
+ idOrConditions: number | string | Record<string, any>,
873
+ options?: ModelFindOptions
874
+ ): Promise<T | null>;
875
+ static first<T = any>(
876
+ idOrConditions?: number | string | Record<string, any>,
877
+ options?: ModelFindOptions
878
+ ): Promise<T | null>;
879
+ static count(where?: Record<string, any>): Promise<number>;
880
+ static exists(where?: Record<string, any>): Promise<boolean>;
881
+ static firstOrCreate<T = any>(where: Record<string, any>, defaults?: Record<string, any>): Promise<T>;
882
+ static updateOrCreate<T = any>(where: Record<string, any>, values?: Record<string, any>): Promise<T>;
883
+ static all<T = any>(options?: ModelAllOptions): Promise<T[]>;
884
+ static paginate<T = any>(options?: ModelPaginateOptions): Promise<PaginatedResult<T>>;
885
+ static create(data: Record<string, any>, options?: { only?: string[]; except?: string[] }): Promise<number | string>;
886
+ static update(
887
+ idOrConditions: number | string | Record<string, any>,
888
+ data: Record<string, any>,
889
+ options?: { only?: string[]; except?: string[] }
890
+ ): Promise<number>;
891
+ static delete(
892
+ idOrConditions: number | string | Record<string, any>,
893
+ options?: ModelDeleteOptions
894
+ ): Promise<number>;
895
+ static restore(idOrConditions: number | string | Record<string, any>): Promise<number>;
896
+ static validator(mode?: "create" | "update", lang?: string): Validator;
897
+ static columnToSQL(col: string, def: ModelSchemaColumn, dialect?: "sqlite" | "mysql" | "postgres"): string;
898
+ static toDDL(dialect?: "sqlite" | "mysql" | "postgres"): string;
899
+ }
900
+
901
+ export interface UploadDiskOptions {
902
+ folder?: string;
903
+ fileSize?: number;
904
+ allowedTypes?: string[];
905
+ }
906
+
907
+ export interface UploadMiddleware {
908
+ single(fieldName: string): (req: Request, res: Response, next: NextFunction) => void;
909
+ array(fieldName: string, maxCount?: number): (req: Request, res: Response, next: NextFunction) => void;
910
+ fields(fields: Array<{ name: string; maxCount?: number }>): (req: Request, res: Response, next: NextFunction) => void;
911
+ none(): (req: Request, res: Response, next: NextFunction) => void;
912
+ any(): (req: Request, res: Response, next: NextFunction) => void;
913
+ }
914
+
915
+ export class Upload {
916
+ static storage(folder?: string): any;
917
+ static disk(options?: UploadDiskOptions): UploadMiddleware;
918
+ static url(filename: string, folder?: string): string;
919
+ }
920
+
921
+ export interface SwaggerOptions {
922
+ route?: string;
923
+ url?: string;
924
+ info?: {
925
+ title?: string;
926
+ version?: string;
927
+ description?: string;
928
+ };
929
+ apis?: string[];
930
+ }
931
+
932
+ export class Swagger {
933
+ static init(app: any, options?: SwaggerOptions): Promise<boolean>;
934
+ }
935
+
936
+ export interface AppProps {
937
+ debug: boolean;
938
+ desktop: boolean;
939
+ userDataDir: string;
940
+ appDir: string;
941
+ title: string;
942
+ description: string;
943
+ version: string;
944
+ host: string;
945
+ appUrl: string;
946
+ port: number;
947
+ jwtSecret?: string;
948
+ langMeta: string;
949
+ static: { path: string; options: Record<string, any> };
950
+ descriptionMeta?: string;
951
+ keywordsMeta?: string;
952
+ titleMeta?: string;
953
+ authorMeta?: string;
954
+ }
955
+
956
+ export class Config {
957
+ static dirname(): string;
958
+ static appDir(): string;
959
+ static setAppDir(dirPath: string): void;
960
+ static isDesktop(): boolean;
961
+ static setUserDataDir(customDir: string): void;
962
+ static userDataDir(): string;
963
+ static reload(): AppProps;
964
+ static props(): AppProps;
965
+ }
966
+
967
+ export class Logger {
968
+ folder: string;
969
+ constructor();
970
+ nowFolder(): string;
971
+ now(): string;
972
+ _log(file: string, level: string, message: string): void;
973
+ log(file: string, level: string, message: string): void;
974
+ info(message: string): void;
975
+ error(message: string): void;
976
+ warn(message: string): void;
977
+ warning(message: string): void;
978
+ debug(message: string): void;
979
+ }
980
+
981
+ export class Debug {
982
+ constructor();
983
+ static shouldTrack(req: Request): boolean;
984
+ static middlewareMetrics(app: any): void;
985
+ getRouter(): { path: string; router: ExpressRouter };
986
+ }
987
+
988
+ export interface CommonMiddleware {
989
+ auth: (req: Request, res: Response, next: NextFunction) => Promise<any>;
990
+ webAuth: (req: Request, res: Response, next: NextFunction) => Promise<any>;
991
+ logger: (req: Request, res: Response, next: NextFunction) => void;
992
+ }
993
+
994
+ export const Middleware: CommonMiddleware;
995
+
996
+ export default App;
997
+
998
+ declare module "@seip/bluebird-js/core/model.js" {
999
+ import {
1000
+ Model,
1001
+ ModelSchemaColumn,
1002
+ ModelFindOptions,
1003
+ ModelAllOptions,
1004
+ ModelPaginateOptions,
1005
+ ModelDeleteOptions,
1006
+ PaginatedResult,
1007
+ } from "@seip/bluebird-js";
1008
+ export {
1009
+ Model,
1010
+ ModelSchemaColumn,
1011
+ ModelFindOptions,
1012
+ ModelAllOptions,
1013
+ ModelPaginateOptions,
1014
+ ModelDeleteOptions,
1015
+ PaginatedResult,
1016
+ };
1017
+ export default Model;
1018
+ }
1019
+
1020
+ declare module "@seip/bluebird-js/core/app.js" {
1021
+ import App, {
1022
+ AppError,
1023
+ WebSocketManager,
1024
+ AppOptions,
1025
+ CorsOptions,
1026
+ SecurityHeadersOptions,
1027
+ AppStaticOptions,
1028
+ } from "@seip/bluebird-js";
1029
+ export {
1030
+ App,
1031
+ AppError,
1032
+ WebSocketManager,
1033
+ AppOptions,
1034
+ CorsOptions,
1035
+ SecurityHeadersOptions,
1036
+ AppStaticOptions,
1037
+ };
1038
+ export default App;
1039
+ }
1040
+
1041
+ declare module "@seip/bluebird-js/core/router.js" {
1042
+ import { Router, RouterOptions, SpaOptions, SpaMetaEntry } from "@seip/bluebird-js";
1043
+ export { Router, RouterOptions, SpaOptions, SpaMetaEntry };
1044
+ export default Router;
1045
+ }
1046
+
1047
+ declare module "@seip/bluebird-js/core/render.js" {
1048
+ import { Render, RenderOptions } from "@seip/bluebird-js";
1049
+ export { Render, RenderOptions };
1050
+ export default Render;
1051
+ }
1052
+
1053
+ declare module "@seip/bluebird-js/core/html.js" {
1054
+ import {
1055
+ SafeHtml,
1056
+ isSafeHtml,
1057
+ escapeHtml,
1058
+ safeJson,
1059
+ HtmlTag,
1060
+ html,
1061
+ ScriptTag,
1062
+ script,
1063
+ each,
1064
+ cached,
1065
+ defer,
1066
+ } from "@seip/bluebird-js";
1067
+ export {
1068
+ SafeHtml,
1069
+ isSafeHtml,
1070
+ escapeHtml,
1071
+ safeJson,
1072
+ HtmlTag,
1073
+ html,
1074
+ ScriptTag,
1075
+ script,
1076
+ each,
1077
+ cached,
1078
+ defer,
1079
+ };
1080
+ export default html;
1081
+ }
1082
+
1083
+ declare module "@seip/bluebird-js/core/validate.js" {
1084
+ import {
1085
+ Validator,
1086
+ ValidationRule,
1087
+ ValidationSchema,
1088
+ ValidationError,
1089
+ ValidationResult,
1090
+ } from "@seip/bluebird-js";
1091
+ export {
1092
+ Validator,
1093
+ ValidationRule,
1094
+ ValidationSchema,
1095
+ ValidationError,
1096
+ ValidationResult,
1097
+ };
1098
+ export default Validator;
1099
+ }
1100
+
1101
+ declare module "@seip/bluebird-js/core/database.js" {
1102
+ import {
1103
+ Database,
1104
+ DB_TYPE,
1105
+ DatabaseQueryOptions,
1106
+ DatabaseTransactionClient,
1107
+ PaginatedResult,
1108
+ } from "@seip/bluebird-js";
1109
+ export {
1110
+ Database,
1111
+ DB_TYPE,
1112
+ DatabaseQueryOptions,
1113
+ DatabaseTransactionClient,
1114
+ PaginatedResult,
1115
+ };
1116
+ export default Database;
1117
+ }
1118
+
1119
+ declare module "@seip/bluebird-js/core/auth.js" {
1120
+ import {
1121
+ Auth,
1122
+ AuthProtectOptions,
1123
+ AuthLoginOptions,
1124
+ AuthTokenPayload,
1125
+ } from "@seip/bluebird-js";
1126
+ export {
1127
+ Auth,
1128
+ AuthProtectOptions,
1129
+ AuthLoginOptions,
1130
+ AuthTokenPayload,
1131
+ };
1132
+ export default Auth;
1133
+ }
1134
+
1135
+ declare module "@seip/bluebird-js/core/cache.js" {
1136
+ import {
1137
+ Cache,
1138
+ getRedisClient,
1139
+ CacheDriver,
1140
+ CacheMiddlewareOptions,
1141
+ CacheGetOptions,
1142
+ CacheSetOptions,
1143
+ } from "@seip/bluebird-js";
1144
+ export {
1145
+ Cache,
1146
+ getRedisClient,
1147
+ CacheDriver,
1148
+ CacheMiddlewareOptions,
1149
+ CacheGetOptions,
1150
+ CacheSetOptions,
1151
+ };
1152
+ export default Cache;
1153
+ }
1154
+
1155
+ declare module "@seip/bluebird-js/core/redis.js" {
1156
+ export function initRedis(): Promise<any>;
1157
+ export function getRedisClient(): any;
1158
+ export function isRedisConnectedStatus(): boolean;
1159
+ export function redisGet(key: string): Promise<any>;
1160
+ export function redisSet(key: string, value: any, seconds?: number): Promise<boolean>;
1161
+ export function redisDel(keys: string | string[]): Promise<boolean>;
1162
+ export function redisClearPrefix(prefix: string): Promise<boolean>;
1163
+ export function disconnectRedis(): Promise<void>;
1164
+
1165
+ const redisHandler: {
1166
+ initRedis: typeof initRedis;
1167
+ getRedisClient: typeof getRedisClient;
1168
+ isRedisConnectedStatus: typeof isRedisConnectedStatus;
1169
+ redisGet: typeof redisGet;
1170
+ redisSet: typeof redisSet;
1171
+ redisDel: typeof redisDel;
1172
+ redisClearPrefix: typeof redisClearPrefix;
1173
+ disconnectRedis: typeof disconnectRedis;
1174
+ };
1175
+ export default redisHandler;
1176
+ }
1177
+
1178
+ declare module "@seip/bluebird-js/core/csrf.js" {
1179
+ import { Csrf, CsrfOptions } from "@seip/bluebird-js";
1180
+ export { Csrf, CsrfOptions };
1181
+ export default Csrf;
1182
+ }
1183
+
1184
+ declare module "@seip/bluebird-js/core/hash.js" {
1185
+ import { Hash, HashMakeOptions } from "@seip/bluebird-js";
1186
+ export { Hash, HashMakeOptions };
1187
+ export default Hash;
1188
+ }
1189
+
1190
+ declare module "@seip/bluebird-js/core/queue.js" {
1191
+ import {
1192
+ Queue,
1193
+ QueueDispatchOptions,
1194
+ QueueJob,
1195
+ QueueHandler,
1196
+ } from "@seip/bluebird-js";
1197
+ export {
1198
+ Queue,
1199
+ QueueDispatchOptions,
1200
+ QueueJob,
1201
+ QueueHandler,
1202
+ };
1203
+ export default Queue;
1204
+ }
1205
+
1206
+ declare module "@seip/bluebird-js/core/upload.js" {
1207
+ import {
1208
+ Upload,
1209
+ UploadDiskOptions,
1210
+ UploadMiddleware,
1211
+ UploadedFile,
1212
+ } from "@seip/bluebird-js";
1213
+ export {
1214
+ Upload,
1215
+ UploadDiskOptions,
1216
+ UploadMiddleware,
1217
+ UploadedFile,
1218
+ };
1219
+ export default Upload;
1220
+ }
1221
+
1222
+ declare module "@seip/bluebird-js/core/ws.js" {
1223
+ import {
1224
+ WebSocketManager,
1225
+ WebSocketOptions,
1226
+ WebSocketClient,
1227
+ WebSocketConnectionHandler,
1228
+ } from "@seip/bluebird-js";
1229
+ export {
1230
+ WebSocketManager,
1231
+ WebSocketOptions,
1232
+ WebSocketClient,
1233
+ WebSocketConnectionHandler,
1234
+ };
1235
+ export default WebSocketManager;
1236
+ }
1237
+
1238
+ declare module "@seip/bluebird-js/core/swagger.js" {
1239
+ import { Swagger, SwaggerOptions } from "@seip/bluebird-js";
1240
+ export { Swagger, SwaggerOptions };
1241
+ export default Swagger;
1242
+ }
1243
+
1244
+ declare module "@seip/bluebird-js/core/logger.js" {
1245
+ import { Logger } from "@seip/bluebird-js";
1246
+ export { Logger };
1247
+ export default Logger;
1248
+ }
1249
+
1250
+ declare module "@seip/bluebird-js/core/config.js" {
1251
+ import { Config, AppProps } from "@seip/bluebird-js";
1252
+ export { Config, AppProps };
1253
+ export default Config;
1254
+ }
1255
+
1256
+ declare module "@seip/bluebird-js/core/debug.js" {
1257
+ import { Debug } from "@seip/bluebird-js";
1258
+ export { Debug };
1259
+ export default Debug;
1260
+ }
1261
+
1262
+ declare module "@seip/bluebird-js/core/middleware.js" {
1263
+ import { Middleware, CommonMiddleware } from "@seip/bluebird-js";
1264
+ export { Middleware, CommonMiddleware };
1265
+ export default Middleware;
1266
+ }
1267
+
1268
+
1269
+ declare module "@seip/bluebird-js/core/ratelimit.js" {
1270
+ import { RateLimit, RateLimitOptions } from "@seip/bluebird-js";
1271
+ export { RateLimit, RateLimitOptions };
1272
+ export default RateLimit;
1273
+ }
1274
+
1275
+ declare module "@seip/bluebird-js/core/seo.js" {
1276
+ import { Seo } from "@seip/bluebird-js";
1277
+ export { Seo };
1278
+ export default Seo;
1279
+ }
1280
+
1281
+ declare module "@seip/bluebird-js/core/ai.js" {
1282
+ import { AI, ai, AIOptions, AIAskOptions, AIResult, AIStreamChunk } from "@seip/bluebird-js";
1283
+ export { AI, ai, AIOptions, AIAskOptions, AIResult, AIStreamChunk };
1284
+ export default AI;
1285
+ }
1286
+