elysia 1.1.9 → 1.1.12
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/bunfig.toml +2 -0
- package/dist/bun/index.d.ts +17 -5
- package/dist/bun/index.js +113 -113
- package/dist/bun/index.js.map +8 -8
- package/dist/cjs/compose.js +40 -4
- package/dist/cjs/cookies.js +18 -0
- package/dist/cjs/dynamic-handle.js +36 -3
- package/dist/cjs/error.js +18 -0
- package/dist/cjs/handler.d.ts +2 -0
- package/dist/cjs/handler.js +28 -0
- package/dist/cjs/index.d.ts +17 -5
- package/dist/cjs/index.js +145 -40
- package/dist/cjs/trace.js +18 -0
- package/dist/cjs/type-system.d.ts +12 -2
- package/dist/cjs/type-system.js +18 -0
- package/dist/cjs/types.d.ts +8 -2
- package/dist/cjs/utils.js +24 -2
- package/dist/cjs/ws/index.js +18 -0
- package/dist/compose.mjs +45 -8
- package/dist/cookies.mjs +20 -1
- package/dist/dynamic-handle.mjs +38 -4
- package/dist/error.mjs +20 -1
- package/dist/handler.d.ts +2 -0
- package/dist/handler.mjs +29 -1
- package/dist/index.d.ts +17 -5
- package/dist/index.mjs +152 -47
- package/dist/trace.mjs +20 -1
- package/dist/type-system.d.ts +12 -2
- package/dist/type-system.mjs +19 -0
- package/dist/types.d.ts +8 -2
- package/dist/utils.mjs +32 -9
- package/dist/ws/index.mjs +20 -1
- package/package.json +2 -2
package/bunfig.toml
ADDED
package/dist/bun/index.d.ts
CHANGED
|
@@ -88,10 +88,12 @@ export default class Elysia<const in out BasePath extends string = '', const in
|
|
|
88
88
|
dynamic: Memoirist<DynamicHandler>;
|
|
89
89
|
static: {
|
|
90
90
|
http: {
|
|
91
|
+
static: Record<string, Response>;
|
|
91
92
|
handlers: ComposedHandler[];
|
|
92
93
|
map: Record<string, {
|
|
93
94
|
code: string;
|
|
94
95
|
all?: string;
|
|
96
|
+
static?: Function;
|
|
95
97
|
}>;
|
|
96
98
|
all: string;
|
|
97
99
|
};
|
|
@@ -131,8 +133,8 @@ export default class Elysia<const in out BasePath extends string = '', const in
|
|
|
131
133
|
* @example
|
|
132
134
|
* ```typescript
|
|
133
135
|
* new Elysia()
|
|
134
|
-
* .onStart(({
|
|
135
|
-
* console.log("Running at ${url}:${port}")
|
|
136
|
+
* .onStart(({ server }) => {
|
|
137
|
+
* console.log("Running at ${server?.url}:${server?.port}")
|
|
136
138
|
* })
|
|
137
139
|
* .listen(3000)
|
|
138
140
|
* ```
|
|
@@ -803,8 +805,8 @@ export default class Elysia<const in out BasePath extends string = '', const in
|
|
|
803
805
|
schema: {};
|
|
804
806
|
}>;
|
|
805
807
|
as(type: 'plugin'): Elysia<BasePath, Scoped, Singleton, Definitions, Metadata, Routes, {
|
|
806
|
-
derive:
|
|
807
|
-
resolve:
|
|
808
|
+
derive: Prettify<Ephemeral['derive'] & Volatile['derive']>;
|
|
809
|
+
resolve: Prettify<Ephemeral['resolve'] & Volatile['resolve']>;
|
|
808
810
|
schema: MergeSchema<Volatile['schema'], Ephemeral['schema']>;
|
|
809
811
|
}, {
|
|
810
812
|
derive: {};
|
|
@@ -1590,8 +1592,17 @@ export default class Elysia<const in out BasePath extends string = '', const in
|
|
|
1590
1592
|
* // Sometime later
|
|
1591
1593
|
* app.stop()
|
|
1592
1594
|
* ```
|
|
1595
|
+
*
|
|
1596
|
+
* @example
|
|
1597
|
+
* ```typescript
|
|
1598
|
+
* const app = new Elysia()
|
|
1599
|
+
* .get("/", () => 'hi')
|
|
1600
|
+
* .listen(3000)
|
|
1601
|
+
*
|
|
1602
|
+
* app.stop(true) // Abruptly any requests inflight
|
|
1603
|
+
* ```
|
|
1593
1604
|
*/
|
|
1594
|
-
stop: () => Promise<void>;
|
|
1605
|
+
stop: (closeActiveConnections?: boolean) => Promise<void>;
|
|
1595
1606
|
/**
|
|
1596
1607
|
* Wait until all lazy loaded modules all load is fully
|
|
1597
1608
|
*/
|
|
@@ -1606,4 +1617,5 @@ export { ELYSIA_TRACE, type TraceEvent, type TraceListener, type TraceHandler, t
|
|
|
1606
1617
|
export { getSchemaValidator, mergeHook, mergeObjectArray, getResponseSchemaValidator, redirect, StatusMap, InvertedStatusMap, form, replaceSchemaType, replaceUrlPath, checksum, cloneInference, deduplicateChecksum, ELYSIA_FORM_DATA, ELYSIA_REQUEST_ID } from './utils';
|
|
1607
1618
|
export { error, mapValueError, ParseError, NotFoundError, ValidationError, InternalServerError, InvalidCookieSignature, ERROR_CODE, ELYSIA_RESPONSE } from './error';
|
|
1608
1619
|
export type { EphemeralType, CreateEden, ComposeElysiaResponse, ElysiaConfig, SingletonBase, DefinitionBase, RouteBase, Handler, ComposedHandler, InputSchema, LocalHook, MergeSchema, RouteSchema, UnwrapRoute, InternalRoute, HTTPMethod, SchemaValidator, VoidHandler, PreHandler, BodyHandler, OptionalHandler, AfterResponseHandler, ErrorHandler, AfterHandler, LifeCycleEvent, LifeCycleStore, LifeCycleType, MaybePromise, ListenCallback, UnwrapSchema, Checksum, DocumentDecoration, InferContext, InferHandler, ResolvePath, MapResponse, MacroQueue, BaseMacro, MacroManager, BaseMacroFn, MacroToProperty, ResolveMacroContext, MergeElysiaInstances, MaybeArray, ModelValidator, MetadataBase, UnwrapBodySchema, UnwrapGroupGuardRoute, ModelValidatorError, ExcludeElysiaResponse, CoExist } from './types';
|
|
1620
|
+
export { TypeSystemPolicy } from '@sinclair/typebox/system';
|
|
1609
1621
|
export type { Static, TSchema } from '@sinclair/typebox';
|