@seip/bluebird-js 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/index.d.ts CHANGED
@@ -1,1431 +1,1470 @@
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
+ 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
+ static action: typeof action;
562
+ static fn: typeof action;
563
+ }
564
+
565
+ export function action<TBody = Record<string, any>, TResult = any>(
566
+ optionsOrHandler: ActionDefinitionOptions | ((ctx: ActionContext<TBody>, body: TBody) => Promise<TResult> | TResult),
567
+ handlerFn?: (ctx: ActionContext<TBody>, body: TBody) => Promise<TResult> | TResult
568
+ ): any;
569
+
570
+ /**
571
+ * Props for `<Island>` / `<Client>` JSX components.
572
+ */
573
+ export interface IslandComponentProps extends RenderIslandOptions {
574
+ component?: string | Function;
575
+ name?: string;
576
+ props?: Record<string, any>;
577
+ children?: any;
578
+ [key: string]: any;
579
+ }
580
+
581
+ export interface ErrorBoundaryProps {
582
+ fallback?: any | ((error: Error) => any);
583
+ onError?: (error: Error) => void;
584
+ children?: any;
585
+ }
586
+
587
+ export interface SuspenseProps {
588
+ fallback?: any;
589
+ children?: any;
590
+ }
591
+
592
+ export interface HeadProps {
593
+ children?: any;
594
+ }
595
+
596
+ export interface TitleProps {
597
+ children?: any;
598
+ }
599
+
600
+ export interface MetaProps {
601
+ name?: string;
602
+ property?: string;
603
+ content?: string;
604
+ charSet?: string;
605
+ httpEquiv?: string;
606
+ [key: string]: any;
607
+ }
608
+
609
+ export interface ScriptProps {
610
+ data?: Record<string, any>;
611
+ onPageLoad?: boolean;
612
+ persist?: boolean;
613
+ persistent?: boolean;
614
+ src?: string;
615
+ type?: string;
616
+ defer?: boolean;
617
+ async?: boolean;
618
+ children?: ((data: any, info?: { url: string; initial: boolean }) => void | (() => void)) | string;
619
+ [key: string]: any;
620
+ }
621
+
622
+ export interface UseActionOptions {
623
+ url?: string;
624
+ partial?: boolean;
625
+ onSuccess?: (data: any) => void;
626
+ onError?: (error: any) => void;
627
+ onSettled?: () => void;
628
+ }
629
+
630
+ export const ERROR_BOUNDARY: symbol;
631
+ export const SUSPENSE_ELEMENT: symbol;
632
+ export const HEAD_ELEMENT: symbol;
633
+ export const TITLE_ELEMENT: symbol;
634
+ export const META_ELEMENT: symbol;
635
+ export const SCRIPT_ELEMENT: symbol;
636
+
637
+ export function h(type: any, props?: Record<string, any> | null, ...children: any[]): any;
638
+ export function createElement(type: any, props?: Record<string, any> | null, ...children: any[]): any;
639
+ export function jsx(type: any, props: Record<string, any>, key?: string | number): any;
640
+ export function jsxs(type: any, props: Record<string, any>, key?: string | number): any;
641
+ export const Fragment: symbol;
642
+ export function Island(options?: IslandComponentProps): Promise<any>;
643
+ export function Client(options?: IslandComponentProps): Promise<any>;
644
+ export function client<T extends Function>(Component: T, defaultOptions?: IslandComponentProps): T;
645
+ export function ErrorBoundary(props?: ErrorBoundaryProps): any;
646
+ export function Suspense(props?: SuspenseProps): any;
647
+ export function Head(props?: HeadProps): any;
648
+ export function Title(props?: TitleProps): any;
649
+ export function Meta(props?: MetaProps): any;
650
+ export function Script(props?: ScriptProps): any;
651
+ export function isJsxElement(val: any): boolean;
652
+ export function renderJsxToString(node: any, ctx?: Record<string, any>): Promise<string>;
653
+ export function compileJsx(source: string, options?: { ts?: boolean; typescript?: boolean }): string;
654
+ export function stripTsTypes(code: string): string;
655
+ export function registerJsxLoader(): void;
656
+ export function useState<T>(initial?: T | (() => T)): [T, (value: T | ((prev: T) => T)) => void];
657
+ export function useEffect(effectFn: () => void | (() => void), deps?: any[]): void;
658
+ export function useRef<T>(initial?: T): { current: T };
659
+ export function useMemo<T>(fn: () => T, deps?: any[]): T;
660
+ export function useCallback<T extends (...args: any[]) => any>(fn: T, deps?: any[]): T;
661
+ export function useAction(
662
+ actionName: string | Function,
663
+ options?: UseActionOptions
664
+ ): [
665
+ execute: (payload?: any) => Promise<any>,
666
+ isPending: boolean,
667
+ data: any,
668
+ error: any,
669
+ reset: () => void
670
+ ];
671
+ export function useActionState<T>(
672
+ actionFn: string | ((prevState: T, payload?: any) => Promise<T> | T),
673
+ initialState: T
674
+ ): [state: T, dispatch: (payload?: any) => Promise<T>, isPending: boolean];
675
+
676
+ /**
677
+ * Options for serving raw static HTML files.
678
+ */
679
+ export interface RenderHtmlOptions {
680
+ ttl?: number;
681
+ }
682
+
683
+ export class Render {
684
+ static island(
685
+ name: string | Function,
686
+ props?: Record<string, any>,
687
+ options?: RenderIslandOptions
688
+ ): string;
689
+ static component(partialName: string, props?: Record<string, any>): Promise<string>;
690
+ static html(res: Response, relativePath: string, options?: RenderHtmlOptions): Promise<void>;
691
+ static send(res: Response, viewName: string, data?: Record<string, any>, ttl?: number): Promise<void>;
692
+ static partial(res: Response, partialName: string, data?: Record<string, any>, ttl?: number): Promise<void>;
693
+ static stream(
694
+ res: Response,
695
+ viewName: string,
696
+ data?: Record<string, any>,
697
+ options?: number | { ttl?: number }
698
+ ): Promise<void>;
699
+ static view(
700
+ viewName: string,
701
+ dataOrFn?: Record<string, any> | ((req: Request, res: Response) => any),
702
+ ttl?: number
703
+ ): (req: Request, res: Response) => Promise<void>;
704
+ static cache(
705
+ seconds?: number,
706
+ options?: { allowAuthenticated?: boolean }
707
+ ): (req: Request, res: Response, next: NextFunction) => Promise<any>;
708
+ static redirect(req: Request, res: Response, url: string, status?: number): void;
709
+ static clearTemplateCache(): void;
710
+ static invalidate(keys?: string | string[]): Promise<void>;
711
+ static autoRoutes(targetRouter?: Router): Promise<Array<{ viewName: string; routePath: string; cache: number; seo: boolean }>>;
712
+ }
713
+
714
+ export * from "./html.js";
715
+
716
+ /**
717
+ * Vite integration options.
718
+ */
719
+ export interface ViteOptions {
720
+ entry?: string;
721
+ viteUrl?: string;
722
+ debug?: boolean;
723
+ }
724
+
725
+ export class Vite {
726
+ static tags(options?: ViteOptions): string;
727
+ static clearCache(): void;
728
+ }
729
+
730
+ export const DB_TYPE: "sqlite" | "postgres" | "mysql" | "none" | string;
731
+
732
+ /**
733
+ * Database query execution options.
734
+ */
735
+ export interface DatabaseQueryOptions {
736
+ cache?: number;
737
+ cachePrefix?: string;
738
+ return_row?: boolean;
739
+ [key: string]: any;
740
+ }
741
+
742
+ /**
743
+ * Standard paginated query result.
744
+ */
745
+ export interface PaginatedResult<T = any> {
746
+ data: T[];
747
+ total: number;
748
+ page: number;
749
+ limit: number;
750
+ totalPages: number;
751
+ }
752
+
753
+ /**
754
+ * Transaction runner client.
755
+ */
756
+ export interface DatabaseTransactionClient {
757
+ query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
758
+ }
759
+
760
+ export interface DatabaseBackupOptions {
761
+ out?: string;
762
+ compress?: boolean;
763
+ keep?: number;
764
+ filename?: string;
765
+ dbInstance?: Database;
766
+ dbType?: string;
767
+ }
768
+
769
+ export interface DatabaseBackupResult {
770
+ success: boolean;
771
+ file: string;
772
+ filename: string;
773
+ size: number;
774
+ rotated: number;
775
+ dbType: string;
776
+ }
777
+
778
+ export interface DatabaseRestoreOptions {
779
+ safetyBackup?: boolean;
780
+ verify?: boolean;
781
+ dbInstance?: Database;
782
+ dbType?: string;
783
+ }
784
+
785
+ export interface DatabaseRestoreResult {
786
+ success: boolean;
787
+ restoredFrom: string;
788
+ targetFile: string;
789
+ preRestoreBackup?: string | null;
790
+ size?: number;
791
+ dbType: string;
792
+ }
793
+
794
+ export class Database {
795
+ backup(options?: DatabaseBackupOptions): Promise<DatabaseBackupResult>;
796
+ restore(filePath: string, options?: DatabaseRestoreOptions): Promise<DatabaseRestoreResult>;
797
+ static backup(options?: DatabaseBackupOptions): Promise<DatabaseBackupResult>;
798
+ static restore(filePath: string, options?: DatabaseRestoreOptions): Promise<DatabaseRestoreResult>;
799
+ type: string;
800
+ constructor(connectionLimit?: number, queueLimit?: number, config?: any);
801
+ init(retries?: number): Promise<boolean>;
802
+ query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
803
+ paginate<T = any>(
804
+ sql: string,
805
+ params?: any[],
806
+ options?: { page?: number; limit?: number; cache?: number }
807
+ ): Promise<PaginatedResult<T>>;
808
+ transaction<T = any>(callback: (tx: DatabaseTransactionClient) => Promise<T>): Promise<T>;
809
+ executeTransaction<T = any>(callback: (tx: DatabaseTransactionClient) => Promise<T>): Promise<T>;
810
+ close(): Promise<void>;
811
+ static closeAll(): Promise<void>;
812
+ }
813
+
814
+ /**
815
+ * Queue dispatching options.
816
+ */
817
+ export interface QueueDispatchOptions {
818
+ delayMs?: number;
819
+ }
820
+
821
+ /**
822
+ * Queue job item structure.
823
+ */
824
+ export interface QueueJob<T = any> {
825
+ id: string;
826
+ name: string;
827
+ payload: T;
828
+ createdAt: string;
829
+ }
830
+
831
+ export type QueueHandler<T = any> = (payload: T) => Promise<any> | any;
832
+
833
+ export class Queue {
834
+ static process<T = any>(jobName: string, handler: QueueHandler<T>): void;
835
+ static dispatch<T = any>(jobName: string, payload?: T, options?: QueueDispatchOptions): Promise<boolean>;
836
+ static work(): Promise<void>;
837
+ static stop(): void;
838
+ static loadJobs(jobsDir?: string): Promise<void>;
839
+ }
840
+
841
+ /**
842
+ * CSRF middleware options.
843
+ */
844
+ export interface CsrfOptions {
845
+ cookieName?: string;
846
+ headerName?: string;
847
+ bodyKey?: string;
848
+ maxAgeMs?: number;
849
+ secret?: string;
850
+ }
851
+
852
+ export class Csrf {
853
+ static generateToken(secret?: string): string;
854
+ static verifyToken(token: string, secret?: string, maxAgeMs?: number): boolean;
855
+ static middleware(options?: CsrfOptions): (req: Request, res: Response, next: NextFunction) => void;
856
+ }
857
+
858
+ export interface ModelSchemaColumn {
859
+ type: "int" | "integer" | "bigint" | "string" | "text" | "boolean" | "date" | "float" | "json" | (string & {});
860
+ primary?: boolean;
861
+ auto?: boolean;
862
+ unique?: boolean;
863
+ required?: boolean;
864
+ nullable?: boolean;
865
+ default?: any;
866
+ hidden?: boolean;
867
+ length?: number;
868
+ min?: number;
869
+ max?: number;
870
+ email?: boolean;
871
+ hash?: boolean;
872
+ in?: any[];
873
+ references?: string;
874
+ onDelete?: "cascade" | "set null" | "restrict" | "no action" | (string & {});
875
+ }
876
+
877
+ /**
878
+ * Options for Model.find query.
879
+ */
880
+ export interface ModelFindOptions {
881
+ withDeleted?: boolean;
882
+ withHidden?: boolean;
883
+ cache?: number;
884
+ oneMany?: typeof Model | Array<typeof Model>;
885
+ belongsTo?: typeof Model | Array<typeof Model>;
886
+ }
887
+
888
+ /**
889
+ * Options for Model.all query.
890
+ */
891
+ export interface ModelAllOptions {
892
+ where?: Record<string, any>;
893
+ order?: string | string[];
894
+ limit?: number;
895
+ offset?: number;
896
+ withDeleted?: boolean;
897
+ withHidden?: boolean;
898
+ cache?: number;
899
+ oneMany?: typeof Model | Array<typeof Model>;
900
+ belongsTo?: typeof Model | Array<typeof Model>;
901
+ }
902
+
903
+ /**
904
+ * Options for Model.paginate query.
905
+ */
906
+ export interface ModelPaginateOptions {
907
+ where?: Record<string, any>;
908
+ order?: string | string[];
909
+ page?: number;
910
+ limit?: number;
911
+ withDeleted?: boolean;
912
+ withHidden?: boolean;
913
+ cache?: number;
914
+ }
915
+
916
+ /**
917
+ * Options for Model.delete operation.
918
+ */
919
+ export interface ModelDeleteOptions {
920
+ force?: boolean;
921
+ cascade?: Array<typeof Model>;
922
+ }
923
+
924
+ export class Model {
925
+ static table: string;
926
+ static primaryKey: string;
927
+ static timestamps: boolean;
928
+ static softDelete: boolean;
929
+ static schema: Record<string, ModelSchemaColumn>;
930
+ static fillable: string[];
931
+ static guarded: string[];
932
+
933
+ static getDatabase(): Database;
934
+ static setDatabase(db: Database): void;
935
+ static close(): Promise<void>;
936
+ static query<T = any>(sql: string, params?: any[], options?: any): Promise<T>;
937
+ static transaction<T = any>(callback: (tx: DatabaseTransactionClient | any) => Promise<T>): Promise<T>;
938
+ static invalidateCache(): Promise<void>;
939
+ static find<T = any>(
940
+ idOrConditions: number | string | Record<string, any>,
941
+ options?: ModelFindOptions
942
+ ): Promise<T | null>;
943
+ static first<T = any>(
944
+ idOrConditions?: number | string | Record<string, any>,
945
+ options?: ModelFindOptions
946
+ ): Promise<T | null>;
947
+ static count(where?: Record<string, any>): Promise<number>;
948
+ static exists(where?: Record<string, any>): Promise<boolean>;
949
+ static firstOrCreate<T = any>(where: Record<string, any>, defaults?: Record<string, any>): Promise<T>;
950
+ static updateOrCreate<T = any>(where: Record<string, any>, values?: Record<string, any>): Promise<T>;
951
+ static all<T = any>(options?: ModelAllOptions): Promise<T[]>;
952
+ static paginate<T = any>(options?: ModelPaginateOptions): Promise<PaginatedResult<T>>;
953
+ static create(data: Record<string, any>, options?: { only?: string[]; except?: string[] }): Promise<number | string>;
954
+ static update(
955
+ idOrConditions: number | string | Record<string, any>,
956
+ data: Record<string, any>,
957
+ options?: { only?: string[]; except?: string[] }
958
+ ): Promise<number>;
959
+ static delete(
960
+ idOrConditions: number | string | Record<string, any>,
961
+ options?: ModelDeleteOptions
962
+ ): Promise<number>;
963
+ static restore(idOrConditions: number | string | Record<string, any>): Promise<number>;
964
+ static validator(mode?: "create" | "update", lang?: string): Validator;
965
+ static columnToSQL(col: string, def: ModelSchemaColumn, dialect?: "sqlite" | "mysql" | "postgres"): string;
966
+ static toDDL(dialect?: "sqlite" | "mysql" | "postgres"): string;
967
+ }
968
+
969
+ export interface UploadDiskOptions {
970
+ folder?: string;
971
+ fileSize?: number;
972
+ allowedTypes?: string[];
973
+ }
974
+
975
+ export interface UploadMiddleware {
976
+ single(fieldName: string): (req: Request, res: Response, next: NextFunction) => void;
977
+ array(fieldName: string, maxCount?: number): (req: Request, res: Response, next: NextFunction) => void;
978
+ fields(fields: Array<{ name: string; maxCount?: number }>): (req: Request, res: Response, next: NextFunction) => void;
979
+ none(): (req: Request, res: Response, next: NextFunction) => void;
980
+ any(): (req: Request, res: Response, next: NextFunction) => void;
981
+ }
982
+
983
+ export class Upload {
984
+ static storage(folder?: string): any;
985
+ static disk(options?: UploadDiskOptions): UploadMiddleware;
986
+ static url(filename: string, folder?: string): string;
987
+ }
988
+
989
+ export interface SwaggerOptions {
990
+ route?: string;
991
+ url?: string;
992
+ info?: {
993
+ title?: string;
994
+ version?: string;
995
+ description?: string;
996
+ };
997
+ apis?: string[];
998
+ }
999
+
1000
+ export class Swagger {
1001
+ static init(app: any, options?: SwaggerOptions): Promise<boolean>;
1002
+ }
1003
+
1004
+ export interface AppProps {
1005
+ debug: boolean;
1006
+ desktop: boolean;
1007
+ userDataDir: string;
1008
+ appDir: string;
1009
+ title: string;
1010
+ description: string;
1011
+ version: string;
1012
+ host: string;
1013
+ appUrl: string;
1014
+ port: number;
1015
+ jwtSecret?: string;
1016
+ langMeta: string;
1017
+ static: { path: string; options: Record<string, any> };
1018
+ descriptionMeta?: string;
1019
+ keywordsMeta?: string;
1020
+ titleMeta?: string;
1021
+ authorMeta?: string;
1022
+ }
1023
+
1024
+ export class Config {
1025
+ static dirname(): string;
1026
+ static appDir(): string;
1027
+ static setAppDir(dirPath: string): void;
1028
+ static isDesktop(): boolean;
1029
+ static setUserDataDir(customDir: string): void;
1030
+ static userDataDir(): string;
1031
+ static reload(): AppProps;
1032
+ static props(): AppProps;
1033
+ }
1034
+
1035
+ export class Logger {
1036
+ folder: string;
1037
+ constructor();
1038
+ nowFolder(): string;
1039
+ now(): string;
1040
+ _log(file: string, level: string, message: string): void;
1041
+ log(file: string, level: string, message: string): void;
1042
+ info(message: string): void;
1043
+ error(message: string): void;
1044
+ warn(message: string): void;
1045
+ warning(message: string): void;
1046
+ debug(message: string): void;
1047
+ }
1048
+
1049
+ export class Debug {
1050
+ constructor();
1051
+ static shouldTrack(req: Request): boolean;
1052
+ static middlewareMetrics(app: any): void;
1053
+ getRouter(): { path: string; router: ExpressRouter };
1054
+ }
1055
+
1056
+ export interface CommonMiddleware {
1057
+ auth: (req: Request, res: Response, next: NextFunction) => Promise<any>;
1058
+ webAuth: (req: Request, res: Response, next: NextFunction) => Promise<any>;
1059
+ logger: (req: Request, res: Response, next: NextFunction) => void;
1060
+ }
1061
+
1062
+ export const Middleware: CommonMiddleware;
1063
+
1064
+ export default App;
1065
+
1066
+ declare module "@seip/bluebird-js/core/model.js" {
1067
+ import {
1068
+ Model,
1069
+ ModelSchemaColumn,
1070
+ ModelFindOptions,
1071
+ ModelAllOptions,
1072
+ ModelPaginateOptions,
1073
+ ModelDeleteOptions,
1074
+ PaginatedResult,
1075
+ } from "@seip/bluebird-js";
1076
+ export {
1077
+ Model,
1078
+ ModelSchemaColumn,
1079
+ ModelFindOptions,
1080
+ ModelAllOptions,
1081
+ ModelPaginateOptions,
1082
+ ModelDeleteOptions,
1083
+ PaginatedResult,
1084
+ };
1085
+ export default Model;
1086
+ }
1087
+
1088
+ declare module "@seip/bluebird-js/core/app.js" {
1089
+ import App, {
1090
+ AppError,
1091
+ WebSocketManager,
1092
+ AppOptions,
1093
+ CorsOptions,
1094
+ SecurityHeadersOptions,
1095
+ AppStaticOptions,
1096
+ } from "@seip/bluebird-js";
1097
+ export {
1098
+ App,
1099
+ AppError,
1100
+ WebSocketManager,
1101
+ AppOptions,
1102
+ CorsOptions,
1103
+ SecurityHeadersOptions,
1104
+ AppStaticOptions,
1105
+ };
1106
+ export default App;
1107
+ }
1108
+
1109
+ declare module "@seip/bluebird-js/core/router.js" {
1110
+ import { Router, RouterOptions } from "@seip/bluebird-js";
1111
+ export { Router, RouterOptions };
1112
+ export default Router;
1113
+ }
1114
+
1115
+ declare module "@seip/bluebird-js/core/render.js" {
1116
+ import {
1117
+ Render,
1118
+ RenderIslandOptions,
1119
+ RenderHtmlOptions,
1120
+ IslandComponentProps,
1121
+ h,
1122
+ Fragment,
1123
+ Island,
1124
+ Client,
1125
+ client,
1126
+ ErrorBoundary,
1127
+ Suspense,
1128
+ Head,
1129
+ Title,
1130
+ Meta,
1131
+ Script,
1132
+ SCRIPT_ELEMENT,
1133
+ action,
1134
+ useAction,
1135
+ useActionState,
1136
+ } from "@seip/bluebird-js";
1137
+ export {
1138
+ Render,
1139
+ RenderIslandOptions,
1140
+ RenderHtmlOptions,
1141
+ IslandComponentProps,
1142
+ h,
1143
+ Fragment,
1144
+ Island,
1145
+ Client,
1146
+ client,
1147
+ ErrorBoundary,
1148
+ Suspense,
1149
+ Head,
1150
+ Title,
1151
+ Meta,
1152
+ Script,
1153
+ SCRIPT_ELEMENT,
1154
+ action,
1155
+ useAction,
1156
+ useActionState,
1157
+ };
1158
+ export default Render;
1159
+ }
1160
+
1161
+ declare module "@seip/bluebird-js/core/jsx.js" {
1162
+ import {
1163
+ h,
1164
+ createElement,
1165
+ jsx,
1166
+ jsxs,
1167
+ Fragment,
1168
+ Island,
1169
+ Client,
1170
+ client,
1171
+ ErrorBoundary,
1172
+ Suspense,
1173
+ Head,
1174
+ Title,
1175
+ Meta,
1176
+ Script,
1177
+ SCRIPT_ELEMENT,
1178
+ action,
1179
+ useAction,
1180
+ useActionState,
1181
+ useState,
1182
+ useEffect,
1183
+ useRef,
1184
+ useMemo,
1185
+ useCallback,
1186
+ IslandComponentProps,
1187
+ isJsxElement,
1188
+ renderJsxToString,
1189
+ compileJsx,
1190
+ stripTsTypes,
1191
+ registerJsxLoader,
1192
+ } from "@seip/bluebird-js";
1193
+ export {
1194
+ h,
1195
+ createElement,
1196
+ jsx,
1197
+ jsxs,
1198
+ Fragment,
1199
+ Island,
1200
+ Client,
1201
+ client,
1202
+ ErrorBoundary,
1203
+ Suspense,
1204
+ Head,
1205
+ Title,
1206
+ Meta,
1207
+ Script,
1208
+ SCRIPT_ELEMENT,
1209
+ action,
1210
+ useAction,
1211
+ useActionState,
1212
+ useState,
1213
+ useEffect,
1214
+ useRef,
1215
+ useMemo,
1216
+ useCallback,
1217
+ IslandComponentProps,
1218
+ isJsxElement,
1219
+ renderJsxToString,
1220
+ compileJsx,
1221
+ stripTsTypes,
1222
+ registerJsxLoader,
1223
+ };
1224
+ }
1225
+
1226
+ declare module "@seip/bluebird-js/core/html.js" {
1227
+ import {
1228
+ SafeHtml,
1229
+ isSafeHtml,
1230
+ escapeHtml,
1231
+ safeJson,
1232
+ HtmlTag,
1233
+ html,
1234
+ ScriptTag,
1235
+ script,
1236
+ each,
1237
+ cached,
1238
+ defer,
1239
+ } from "@seip/bluebird-js";
1240
+ export {
1241
+ SafeHtml,
1242
+ isSafeHtml,
1243
+ escapeHtml,
1244
+ safeJson,
1245
+ HtmlTag,
1246
+ html,
1247
+ ScriptTag,
1248
+ script,
1249
+ each,
1250
+ cached,
1251
+ defer,
1252
+ };
1253
+ export default html;
1254
+ }
1255
+
1256
+ declare module "@seip/bluebird-js/core/validate.js" {
1257
+ import {
1258
+ Validator,
1259
+ ValidationRule,
1260
+ ValidationSchema,
1261
+ ValidationError,
1262
+ ValidationResult,
1263
+ } from "@seip/bluebird-js";
1264
+ export {
1265
+ Validator,
1266
+ ValidationRule,
1267
+ ValidationSchema,
1268
+ ValidationError,
1269
+ ValidationResult,
1270
+ };
1271
+ export default Validator;
1272
+ }
1273
+
1274
+ declare module "@seip/bluebird-js/core/database.js" {
1275
+ import {
1276
+ Database,
1277
+ DB_TYPE,
1278
+ DatabaseQueryOptions,
1279
+ DatabaseTransactionClient,
1280
+ PaginatedResult,
1281
+ } from "@seip/bluebird-js";
1282
+ export {
1283
+ Database,
1284
+ DB_TYPE,
1285
+ DatabaseQueryOptions,
1286
+ DatabaseTransactionClient,
1287
+ PaginatedResult,
1288
+ };
1289
+ export default Database;
1290
+ }
1291
+
1292
+ declare module "@seip/bluebird-js/core/auth.js" {
1293
+ import {
1294
+ Auth,
1295
+ AuthProtectOptions,
1296
+ AuthLoginOptions,
1297
+ AuthTokenPayload,
1298
+ } from "@seip/bluebird-js";
1299
+ export {
1300
+ Auth,
1301
+ AuthProtectOptions,
1302
+ AuthLoginOptions,
1303
+ AuthTokenPayload,
1304
+ };
1305
+ export default Auth;
1306
+ }
1307
+
1308
+ declare module "@seip/bluebird-js/core/cache.js" {
1309
+ import {
1310
+ Cache,
1311
+ getRedisClient,
1312
+ CacheDriver,
1313
+ CacheMiddlewareOptions,
1314
+ CacheGetOptions,
1315
+ CacheSetOptions,
1316
+ } from "@seip/bluebird-js";
1317
+ export {
1318
+ Cache,
1319
+ getRedisClient,
1320
+ CacheDriver,
1321
+ CacheMiddlewareOptions,
1322
+ CacheGetOptions,
1323
+ CacheSetOptions,
1324
+ };
1325
+ export default Cache;
1326
+ }
1327
+
1328
+ declare module "@seip/bluebird-js/core/redis.js" {
1329
+ export function initRedis(): Promise<any>;
1330
+ export function getRedisClient(): any;
1331
+ export function isRedisConnectedStatus(): boolean;
1332
+ export function redisGet(key: string): Promise<any>;
1333
+ export function redisSet(key: string, value: any, seconds?: number): Promise<boolean>;
1334
+ export function redisDel(keys: string | string[]): Promise<boolean>;
1335
+ export function redisClearPrefix(prefix: string): Promise<boolean>;
1336
+ export function disconnectRedis(): Promise<void>;
1337
+
1338
+ const redisHandler: {
1339
+ initRedis: typeof initRedis;
1340
+ getRedisClient: typeof getRedisClient;
1341
+ isRedisConnectedStatus: typeof isRedisConnectedStatus;
1342
+ redisGet: typeof redisGet;
1343
+ redisSet: typeof redisSet;
1344
+ redisDel: typeof redisDel;
1345
+ redisClearPrefix: typeof redisClearPrefix;
1346
+ disconnectRedis: typeof disconnectRedis;
1347
+ };
1348
+ export default redisHandler;
1349
+ }
1350
+
1351
+ declare module "@seip/bluebird-js/core/csrf.js" {
1352
+ import { Csrf, CsrfOptions } from "@seip/bluebird-js";
1353
+ export { Csrf, CsrfOptions };
1354
+ export default Csrf;
1355
+ }
1356
+
1357
+ declare module "@seip/bluebird-js/core/hash.js" {
1358
+ import { Hash, HashMakeOptions } from "@seip/bluebird-js";
1359
+ export { Hash, HashMakeOptions };
1360
+ export default Hash;
1361
+ }
1362
+
1363
+ declare module "@seip/bluebird-js/core/queue.js" {
1364
+ import {
1365
+ Queue,
1366
+ QueueDispatchOptions,
1367
+ QueueJob,
1368
+ QueueHandler,
1369
+ } from "@seip/bluebird-js";
1370
+ export {
1371
+ Queue,
1372
+ QueueDispatchOptions,
1373
+ QueueJob,
1374
+ QueueHandler,
1375
+ };
1376
+ export default Queue;
1377
+ }
1378
+
1379
+ declare module "@seip/bluebird-js/core/upload.js" {
1380
+ import {
1381
+ Upload,
1382
+ UploadDiskOptions,
1383
+ UploadMiddleware,
1384
+ UploadedFile,
1385
+ } from "@seip/bluebird-js";
1386
+ export {
1387
+ Upload,
1388
+ UploadDiskOptions,
1389
+ UploadMiddleware,
1390
+ UploadedFile,
1391
+ };
1392
+ export default Upload;
1393
+ }
1394
+
1395
+ declare module "@seip/bluebird-js/core/ws.js" {
1396
+ import {
1397
+ WebSocketManager,
1398
+ WebSocketOptions,
1399
+ WebSocketClient,
1400
+ WebSocketConnectionHandler,
1401
+ } from "@seip/bluebird-js";
1402
+ export {
1403
+ WebSocketManager,
1404
+ WebSocketOptions,
1405
+ WebSocketClient,
1406
+ WebSocketConnectionHandler,
1407
+ };
1408
+ export default WebSocketManager;
1409
+ }
1410
+
1411
+ declare module "@seip/bluebird-js/core/swagger.js" {
1412
+ import { Swagger, SwaggerOptions } from "@seip/bluebird-js";
1413
+ export { Swagger, SwaggerOptions };
1414
+ export default Swagger;
1415
+ }
1416
+
1417
+ declare module "@seip/bluebird-js/core/logger.js" {
1418
+ import { Logger } from "@seip/bluebird-js";
1419
+ export { Logger };
1420
+ export default Logger;
1421
+ }
1422
+
1423
+ declare module "@seip/bluebird-js/core/config.js" {
1424
+ import { Config, AppProps } from "@seip/bluebird-js";
1425
+ export { Config, AppProps };
1426
+ export default Config;
1427
+ }
1428
+
1429
+ declare module "@seip/bluebird-js/core/debug.js" {
1430
+ import { Debug } from "@seip/bluebird-js";
1431
+ export { Debug };
1432
+ export default Debug;
1433
+ }
1434
+
1435
+ declare module "@seip/bluebird-js/core/middleware.js" {
1436
+ import { Middleware, CommonMiddleware } from "@seip/bluebird-js";
1437
+ export { Middleware, CommonMiddleware };
1438
+ export default Middleware;
1439
+ }
1440
+
1441
+ declare module "@seip/bluebird-js/core/vite.js" {
1442
+ import { Vite, ViteOptions } from "@seip/bluebird-js";
1443
+ export { Vite, ViteOptions };
1444
+ export default Vite;
1445
+ }
1446
+
1447
+ declare module "@seip/bluebird-js/core/ratelimit.js" {
1448
+ import { RateLimit, RateLimitOptions } from "@seip/bluebird-js";
1449
+ export { RateLimit, RateLimitOptions };
1450
+ export default RateLimit;
1451
+ }
1452
+
1453
+ declare module "@seip/bluebird-js/core/seo.js" {
1454
+ import { Seo } from "@seip/bluebird-js";
1455
+ export { Seo };
1456
+ export default Seo;
1457
+ }
1458
+
1459
+ declare module "@seip/bluebird-js/core/actions.js" {
1460
+ import { Actions, action, ActionDefinitionOptions, ActionContext } from "@seip/bluebird-js";
1461
+ export { Actions, action, ActionDefinitionOptions, ActionContext };
1462
+ export default Actions;
1463
+ }
1464
+
1465
+ declare module "@seip/bluebird-js/core/ai.js" {
1466
+ import { AI, ai, AIOptions, AIAskOptions, AIResult, AIStreamChunk } from "@seip/bluebird-js";
1467
+ export { AI, ai, AIOptions, AIAskOptions, AIResult, AIStreamChunk };
1468
+ export default AI;
1469
+ }
1470
+