@lolyjs/core 0.2.0-alpha.27 → 0.2.0-alpha.29
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/README.md +321 -0
- package/dist/cli.cjs +904 -315
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +898 -309
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +916 -316
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +38 -3
- package/dist/index.d.ts +38 -3
- package/dist/index.js +910 -310
- package/dist/index.js.map +1 -1
- package/dist/{index.types-DMOO-uvF.d.mts → index.types-B9j4OQft.d.mts} +1 -0
- package/dist/{index.types-DMOO-uvF.d.ts → index.types-B9j4OQft.d.ts} +1 -0
- package/dist/react/cache.cjs.map +1 -1
- package/dist/react/cache.d.mts +3 -1
- package/dist/react/cache.d.ts +3 -1
- package/dist/react/cache.js.map +1 -1
- package/dist/react/components.cjs +1 -4
- package/dist/react/components.cjs.map +1 -1
- package/dist/react/components.js +1 -4
- package/dist/react/components.js.map +1 -1
- package/dist/runtime.cjs +16 -5
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +16 -5
- package/dist/runtime.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import http from 'http';
|
|
2
|
-
export { a as ApiContext, A as ApiMiddleware, G as GenerateStaticParams, L as LoaderResult, M as MetadataLoader, R as RouteMiddleware, S as ServerContext, b as ServerLoader, W as WssActions } from './index.types-
|
|
2
|
+
export { a as ApiContext, A as ApiMiddleware, G as GenerateStaticParams, L as LoaderResult, M as MetadataLoader, R as RouteMiddleware, S as ServerContext, b as ServerLoader, W as WssActions } from './index.types-B9j4OQft.mjs';
|
|
3
3
|
import { Socket } from 'socket.io';
|
|
4
|
+
import { Request, Response } from 'express';
|
|
4
5
|
export { c as bootstrapClient } from './bootstrap-BfGTMUkj.mjs';
|
|
5
6
|
import { ZodSchema, z } from 'zod';
|
|
6
7
|
import * as express_rate_limit from 'express-rate-limit';
|
|
7
8
|
import pino, { Logger as Logger$1 } from 'pino';
|
|
8
|
-
import { Request, Response } from 'express';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Framework configuration interface.
|
|
@@ -336,6 +336,41 @@ interface WssRouteDefinition<TUser = any> {
|
|
|
336
336
|
events: Record<string, WssEventDefinition<any, TUser>>;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
+
/**
|
|
340
|
+
* Rewrite condition types.
|
|
341
|
+
* Used in the `has` array to conditionally apply rewrites.
|
|
342
|
+
*/
|
|
343
|
+
type RewriteConditionType = "host" | "header" | "cookie" | "query";
|
|
344
|
+
/**
|
|
345
|
+
* Rewrite condition.
|
|
346
|
+
* Defines when a rewrite should be applied.
|
|
347
|
+
*/
|
|
348
|
+
interface RewriteCondition {
|
|
349
|
+
type: RewriteConditionType;
|
|
350
|
+
key?: string;
|
|
351
|
+
value: string;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Rewrite destination can be:
|
|
355
|
+
* - A string (static or with :param placeholders)
|
|
356
|
+
* - An async function that returns a string (for dynamic rewrites)
|
|
357
|
+
*/
|
|
358
|
+
type RewriteDestination = string | ((params: Record<string, string>, req: Request) => Promise<string> | string);
|
|
359
|
+
/**
|
|
360
|
+
* Rewrite rule configuration.
|
|
361
|
+
* Defines how to rewrite a URL pattern.
|
|
362
|
+
*/
|
|
363
|
+
interface RewriteRule {
|
|
364
|
+
source: string;
|
|
365
|
+
destination: RewriteDestination;
|
|
366
|
+
has?: RewriteCondition[];
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Rewrite configuration.
|
|
370
|
+
* Array of rewrite rules to apply in order.
|
|
371
|
+
*/
|
|
372
|
+
type RewriteConfig = RewriteRule[];
|
|
373
|
+
|
|
339
374
|
/**
|
|
340
375
|
* Realtime/WebSocket configuration
|
|
341
376
|
*/
|
|
@@ -675,4 +710,4 @@ declare function requestLoggerMiddleware(options?: {
|
|
|
675
710
|
*/
|
|
676
711
|
declare function getRequestLogger(req: Request): Logger;
|
|
677
712
|
|
|
678
|
-
export { type AuthContext, type AuthFn, DEFAULT_CONFIG, type FrameworkConfig, type GuardFn, type InitServerData, type LogLevel, Logger, type LoggerContext, type LoggerOptions, type RateLimitCfg, type RealtimeConfig, type RealtimeLogger, type RealtimeMetrics, type RealtimeStateStore, type Schema, type ServerConfig, ValidationError, type WssContext, type WssEventDefinition, type WssHandler, type WssRouteDefinition, buildApp, commonSchemas, createModuleLogger, createRateLimiter, defaultRateLimiter, defineWssRoute, generateRequestId, getAppDir, getBuildDir, getLogger, getRequestLogger, getStaticDir, lenientRateLimiter, loadConfig, logger, requestLoggerMiddleware, resetLogger, safeValidate, sanitizeObject, sanitizeParams, sanitizeQuery, sanitizeString, setLogger, startDevServer, startProdServer, strictRateLimiter, validate, withCache };
|
|
713
|
+
export { type AuthContext, type AuthFn, DEFAULT_CONFIG, type FrameworkConfig, type GuardFn, type InitServerData, type LogLevel, Logger, type LoggerContext, type LoggerOptions, type RateLimitCfg, type RealtimeConfig, type RealtimeLogger, type RealtimeMetrics, type RealtimeStateStore, type RewriteCondition, type RewriteConfig, type RewriteDestination, type RewriteRule, type Schema, type ServerConfig, ValidationError, type WssContext, type WssEventDefinition, type WssHandler, type WssRouteDefinition, buildApp, commonSchemas, createModuleLogger, createRateLimiter, defaultRateLimiter, defineWssRoute, generateRequestId, getAppDir, getBuildDir, getLogger, getRequestLogger, getStaticDir, lenientRateLimiter, loadConfig, logger, requestLoggerMiddleware, resetLogger, safeValidate, sanitizeObject, sanitizeParams, sanitizeQuery, sanitizeString, setLogger, startDevServer, startProdServer, strictRateLimiter, validate, withCache };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import http from 'http';
|
|
2
|
-
export { a as ApiContext, A as ApiMiddleware, G as GenerateStaticParams, L as LoaderResult, M as MetadataLoader, R as RouteMiddleware, S as ServerContext, b as ServerLoader, W as WssActions } from './index.types-
|
|
2
|
+
export { a as ApiContext, A as ApiMiddleware, G as GenerateStaticParams, L as LoaderResult, M as MetadataLoader, R as RouteMiddleware, S as ServerContext, b as ServerLoader, W as WssActions } from './index.types-B9j4OQft.js';
|
|
3
3
|
import { Socket } from 'socket.io';
|
|
4
|
+
import { Request, Response } from 'express';
|
|
4
5
|
export { c as bootstrapClient } from './bootstrap-BfGTMUkj.js';
|
|
5
6
|
import { ZodSchema, z } from 'zod';
|
|
6
7
|
import * as express_rate_limit from 'express-rate-limit';
|
|
7
8
|
import pino, { Logger as Logger$1 } from 'pino';
|
|
8
|
-
import { Request, Response } from 'express';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Framework configuration interface.
|
|
@@ -336,6 +336,41 @@ interface WssRouteDefinition<TUser = any> {
|
|
|
336
336
|
events: Record<string, WssEventDefinition<any, TUser>>;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
+
/**
|
|
340
|
+
* Rewrite condition types.
|
|
341
|
+
* Used in the `has` array to conditionally apply rewrites.
|
|
342
|
+
*/
|
|
343
|
+
type RewriteConditionType = "host" | "header" | "cookie" | "query";
|
|
344
|
+
/**
|
|
345
|
+
* Rewrite condition.
|
|
346
|
+
* Defines when a rewrite should be applied.
|
|
347
|
+
*/
|
|
348
|
+
interface RewriteCondition {
|
|
349
|
+
type: RewriteConditionType;
|
|
350
|
+
key?: string;
|
|
351
|
+
value: string;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Rewrite destination can be:
|
|
355
|
+
* - A string (static or with :param placeholders)
|
|
356
|
+
* - An async function that returns a string (for dynamic rewrites)
|
|
357
|
+
*/
|
|
358
|
+
type RewriteDestination = string | ((params: Record<string, string>, req: Request) => Promise<string> | string);
|
|
359
|
+
/**
|
|
360
|
+
* Rewrite rule configuration.
|
|
361
|
+
* Defines how to rewrite a URL pattern.
|
|
362
|
+
*/
|
|
363
|
+
interface RewriteRule {
|
|
364
|
+
source: string;
|
|
365
|
+
destination: RewriteDestination;
|
|
366
|
+
has?: RewriteCondition[];
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Rewrite configuration.
|
|
370
|
+
* Array of rewrite rules to apply in order.
|
|
371
|
+
*/
|
|
372
|
+
type RewriteConfig = RewriteRule[];
|
|
373
|
+
|
|
339
374
|
/**
|
|
340
375
|
* Realtime/WebSocket configuration
|
|
341
376
|
*/
|
|
@@ -675,4 +710,4 @@ declare function requestLoggerMiddleware(options?: {
|
|
|
675
710
|
*/
|
|
676
711
|
declare function getRequestLogger(req: Request): Logger;
|
|
677
712
|
|
|
678
|
-
export { type AuthContext, type AuthFn, DEFAULT_CONFIG, type FrameworkConfig, type GuardFn, type InitServerData, type LogLevel, Logger, type LoggerContext, type LoggerOptions, type RateLimitCfg, type RealtimeConfig, type RealtimeLogger, type RealtimeMetrics, type RealtimeStateStore, type Schema, type ServerConfig, ValidationError, type WssContext, type WssEventDefinition, type WssHandler, type WssRouteDefinition, buildApp, commonSchemas, createModuleLogger, createRateLimiter, defaultRateLimiter, defineWssRoute, generateRequestId, getAppDir, getBuildDir, getLogger, getRequestLogger, getStaticDir, lenientRateLimiter, loadConfig, logger, requestLoggerMiddleware, resetLogger, safeValidate, sanitizeObject, sanitizeParams, sanitizeQuery, sanitizeString, setLogger, startDevServer, startProdServer, strictRateLimiter, validate, withCache };
|
|
713
|
+
export { type AuthContext, type AuthFn, DEFAULT_CONFIG, type FrameworkConfig, type GuardFn, type InitServerData, type LogLevel, Logger, type LoggerContext, type LoggerOptions, type RateLimitCfg, type RealtimeConfig, type RealtimeLogger, type RealtimeMetrics, type RealtimeStateStore, type RewriteCondition, type RewriteConfig, type RewriteDestination, type RewriteRule, type Schema, type ServerConfig, ValidationError, type WssContext, type WssEventDefinition, type WssHandler, type WssRouteDefinition, buildApp, commonSchemas, createModuleLogger, createRateLimiter, defaultRateLimiter, defineWssRoute, generateRequestId, getAppDir, getBuildDir, getLogger, getRequestLogger, getStaticDir, lenientRateLimiter, loadConfig, logger, requestLoggerMiddleware, resetLogger, safeValidate, sanitizeObject, sanitizeParams, sanitizeQuery, sanitizeString, setLogger, startDevServer, startProdServer, strictRateLimiter, validate, withCache };
|