Socket
Socket
Sign inDemoInstall

elysia

Package Overview
Dependencies
7
Maintainers
1
Versions
331
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-exp.14 to 1.0.0-exp.15

dist/cjs/dynamic-handle-CQy7PKh8.d.ts

4

dist/bun/index.d.ts
import 'bun';
import 'memoirist';
export { Static, TSchema } from '@sinclair/typebox';
export { K as AfterHandler, $ as BodyHandler, ac as Checksum, C as ComposedHandler, aD as Context, e as Cookie, c as CookieOptions, D as DefinitionBase, E as Elysia, m as ElysiaConfig, a2 as ErrorHandler, z as HTTPMethod, H as Handler, A as InputSchema, a6 as InternalRoute, I as InternalServerError, l as InvalidCookieSignature, x as LifeCycleEvent, L as LifeCycleStore, a7 as ListenCallback, a5 as LocalHook, n as MaybePromise, B as MergeSchema, N as NotFoundError, J as OptionalHandler, P as ParseError, aE as PreContext, a0 as PreHandler, s as RouteBase, u as RouteSchema, S as SchemaValidator, r as SingletonBase, Y as TraceEvent, T as TraceHandler, Z as TraceProcess, a as TraceReporter, b as TraceStream, v as UnwrapRoute, U as UnwrapSchema, V as ValidationError, W as VoidHandler, E as default, k as error, ap as getResponseSchemaValidator, ao as getSchemaValidator, aR as mapCompactResponse, aQ as mapEarlyResponse, aP as mapResponse, an as mergeHook, al as mergeObjectArray, aF as t } from './dynamic-handle-BOErSqze.js';
export { A as AfterHandler, J as BodyHandler, a2 as Checksum, C as ComposedHandler, aw as Context, e as Cookie, c as CookieOptions, D as DefinitionBase, E as Elysia, g as ElysiaConfig, Q as ErrorHandler, t as HTTPMethod, H as Handler, I as InputSchema, Y as InternalRoute, r as LifeCycleEvent, L as LifeCycleStore, Z as ListenCallback, X as LocalHook, h as MaybePromise, u as MergeSchema, w as OptionalHandler, ax as PreContext, K as PreHandler, l as RouteBase, n as RouteSchema, S as SchemaValidator, k as SingletonBase, z as TraceEvent, T as TraceHandler, B as TraceProcess, a as TraceReporter, b as TraceStream, o as UnwrapRoute, U as UnwrapSchema, V as VoidHandler, E as default, aj as getResponseSchemaValidator, ai as getSchemaValidator, aK as mapCompactResponse, aJ as mapEarlyResponse, aI as mapResponse, ah as mergeHook, af as mergeObjectArray, ay as t } from './dynamic-handle-CQy7PKh8.js';
export { InternalServerError, InvalidCookieSignature, NotFoundError, ParseError, ValidationError, error } from './error.js';
import '@sinclair/typebox/compiler';

@@ -9,1 +10,2 @@ import 'openapi-types';

import '@sinclair/typebox/system';
import 'undici-types';

@@ -1,2 +0,2 @@

import { E as Elysia, L as LifeCycleStore, S as SchemaValidator, H as Handler, C as ComposedHandler } from './dynamic-handle-BOErSqze.js';
import { E as Elysia, L as LifeCycleStore, S as SchemaValidator, H as Handler, C as ComposedHandler } from './dynamic-handle-CQy7PKh8.js';
import { TAnySchema } from '@sinclair/typebox';

@@ -9,2 +9,4 @@ import { Sucrose } from './sucrose.js';

import 'eventemitter3';
import './error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -11,0 +13,0 @@

@@ -1,2 +0,3 @@

export { aD as Context, aE as PreContext } from './dynamic-handle-BOErSqze.js';
export { aw as Context, ax as PreContext } from './dynamic-handle-CQy7PKh8.js';
import './error.js';
import 'bun';

@@ -9,1 +10,2 @@ import 'memoirist';

import '@sinclair/typebox/system';
import 'undici-types';

@@ -1,2 +0,2 @@

export { e as Cookie, c as CookieOptions, d as ElysiaCookie, f as createCookieJar, p as parseCookie } from './dynamic-handle-BOErSqze.js';
export { e as Cookie, c as CookieOptions, d as ElysiaCookie, f as createCookieJar, p as parseCookie } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -8,2 +8,4 @@ import 'memoirist';

import 'eventemitter3';
import './error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -45,3 +45,2 @@ "use strict";

var import_compiler2 = require("@sinclair/typebox/compiler");
var import_deepmerge2 = __toESM(require("deepmerge"));

@@ -71,3 +70,3 @@ // src/index.ts

const customError = error2?.schema.error ? typeof error2.schema.error === "function" ? error2.schema.error(type, validator, value) : error2.schema.error : void 0;
const accessor = error2?.path?.slice(1) || "root";
const accessor = error2?.path || "root";
let message = "";

@@ -78,17 +77,30 @@ if (customError) {

message = JSON.stringify({
type,
message: error2?.message
type: "validation",
on: type,
message: error2?.message,
found: value
});
} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value.Value.Errors(validator, value)];
let expected;
try {
expected = import_value.Value.Create(schema);
} catch (error3) {
expected = {
type: "Could not create expected value",
// @ts-expect-error
message: error3?.message,
error: error3
};
}
message = JSON.stringify(
{
type,
at: accessor,
type: "validation",
on: type,
property: accessor,
message: error2?.message,
expected: import_value.Value.Create(
// @ts-ignore private field
validator.schema
),
expected,
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -104,3 +116,3 @@ null,

this.code = "VALIDATION";
this.status = 400;
this.status = 422;
Object.setPrototypeOf(this, _ValidationError.prototype);

@@ -133,4 +145,6 @@ }

// src/index.ts
var import_deepmerge = __toESM(require("deepmerge"));
// src/compose.ts
var import_value2 = require("@sinclair/typebox/value");
var import_fast_querystring = require("fast-querystring");
var import_fast_decode_uri_component = __toESM(require("fast-decode-uri-component"));

@@ -142,5 +156,2 @@ // src/handler.ts

// src/compose.ts
var import_value2 = require("@sinclair/typebox/value");
var import_fast_querystring = require("fast-querystring");
var import_fast_decode_uri_component = __toESM(require("fast-decode-uri-component"));
var headersHasToJSON = new Headers().toJSON;

@@ -273,2 +284,32 @@ var KindSymbol = Symbol.for("TypeBox.Kind");

},
Date: (property) => {
const schema = import_typebox.Type.Date(property);
return t.Transform(
t.Union(
[
import_typebox.Type.Date(property),
t.String({
format: "date",
default: (/* @__PURE__ */ new Date()).toISOString()
}),
t.String({
format: "date-time",
default: (/* @__PURE__ */ new Date()).toISOString()
})
],
property
)
).Decode((value) => {
if (value instanceof Date)
return value;
const date = new Date(value);
if (!import_value3.Value.Check(schema, date))
throw new ValidationError("property", schema, date);
return date;
}).Encode((value) => {
if (typeof value === "string")
return new Date(value);
return value;
});
},
BooleanString: (property) => {

@@ -295,24 +336,39 @@ const schema = import_typebox.Type.Boolean(property);

},
ObjectString: (properties, options) => t.Transform(
t.Union(
[
ObjectString: (properties = {}, options) => {
const schema = t.Object(properties, options);
const defaultValue = JSON.stringify(import_value3.Value.Create(schema));
return t.Transform(
t.Union([
t.String({
format: "ObjectString",
default: ""
default: defaultValue
}),
t.Object(properties, options)
],
options
)
).Decode((value) => {
if (typeof value === "string")
try {
return JSON.parse(value);
} catch {
schema
])
).Decode((value) => {
if (typeof value === "string") {
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value3.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return value;
}
return value;
}).Encode((value) => JSON.stringify(value)),
return value;
}).Encode((value) => {
if (typeof value === "string")
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value3.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return JSON.stringify(value);
});
},
File: import_system.TypeSystem.Type("File", validateFile),
Files: (options = {}) => t.Transform(t.Union([Files(options)])).Decode((value) => {
Files: (options = {}) => t.Transform(Files(options)).Decode((value) => {
if (Array.isArray(value))

@@ -355,2 +411,3 @@ return value;

t.Cookie = ElysiaType.Cookie;
t.Date = ElysiaType.Date;

@@ -380,3 +437,3 @@ // src/utils.ts

var primitiveHookMap = primitiveHooks.reduce(
(acc, x2) => (acc[x2] = true, acc),
(acc, x) => (acc[x] = true, acc),
{}

@@ -386,2 +443,67 @@ );

var hasHash = isBun && typeof Bun.hash === "function";
var StatusMap = {
Continue: 100,
"Switching Protocols": 101,
Processing: 102,
"Early Hints": 103,
OK: 200,
Created: 201,
Accepted: 202,
"Non-Authoritative Information": 203,
"No Content": 204,
"Reset Content": 205,
"Partial Content": 206,
"Multi-Status": 207,
"Already Reported": 208,
"Multiple Choices": 300,
"Moved Permanently": 301,
Found: 302,
"See Other": 303,
"Not Modified": 304,
"Temporary Redirect": 307,
"Permanent Redirect": 308,
"Bad Request": 400,
Unauthorized: 401,
"Payment Required": 402,
Forbidden: 403,
"Not Found": 404,
"Method Not Allowed": 405,
"Not Acceptable": 406,
"Proxy Authentication Required": 407,
"Request Timeout": 408,
Conflict: 409,
Gone: 410,
"Length Required": 411,
"Precondition Failed": 412,
"Payload Too Large": 413,
"URI Too Long": 414,
"Unsupported Media Type": 415,
"Range Not Satisfiable": 416,
"Expectation Failed": 417,
"I'm a teapot": 418,
"Misdirected Request": 421,
"Unprocessable Content": 422,
Locked: 423,
"Failed Dependency": 424,
"Too Early": 425,
"Upgrade Required": 426,
"Precondition Required": 428,
"Too Many Requests": 429,
"Request Header Fields Too Large": 431,
"Unavailable For Legal Reasons": 451,
"Internal Server Error": 500,
"Not Implemented": 501,
"Bad Gateway": 502,
"Service Unavailable": 503,
"Gateway Timeout": 504,
"HTTP Version Not Supported": 505,
"Variant Also Negotiates": 506,
"Insufficient Storage": 507,
"Loop Detected": 508,
"Not Extended": 510,
"Network Authentication Required": 511
};
var InvertedStatusMap = Object.fromEntries(
Object.entries(StatusMap).map(([k, v]) => [v, k])
);
function removeTrailingEquals(digest) {

@@ -521,15 +643,17 @@ let trimmedDigest = digest;

set(config) {
this.cookie = typeof config === "function" ? config(this.cookie) : config;
this.cookie = Object.assign(
{
...this.initial,
value: this.value
},
typeof config === "function" ? config(this.cookie) : config
);
return this;
}
remove(options) {
remove() {
if (this.value === void 0)
return;
this.set({
domain: options?.domain,
expires: /* @__PURE__ */ new Date(0),
maxAge: 0,
path: options?.path,
sameSite: options?.sameSite,
secure: options?.secure,
value: ""

@@ -536,0 +660,0 @@ });

@@ -1,2 +0,3 @@

export { aT as DynamicHandler, aV as createDynamicErrorHandler, aU as createDynamicHandler } from './dynamic-handle-BOErSqze.js';
export { aM as DynamicHandler, aO as createDynamicErrorHandler, aN as createDynamicHandler } from './dynamic-handle-CQy7PKh8.js';
import './error.js';
import 'bun';

@@ -9,1 +10,2 @@ import 'memoirist';

import '@sinclair/typebox/system';
import 'undici-types';

@@ -45,3 +45,2 @@ "use strict";

var import_compiler2 = require("@sinclair/typebox/compiler");
var import_deepmerge2 = __toESM(require("deepmerge"));

@@ -78,3 +77,3 @@ // src/index.ts

const customError = error2?.schema.error ? typeof error2.schema.error === "function" ? error2.schema.error(type, validator, value) : error2.schema.error : void 0;
const accessor = error2?.path?.slice(1) || "root";
const accessor = error2?.path || "root";
let message = "";

@@ -85,17 +84,30 @@ if (customError) {

message = JSON.stringify({
type,
message: error2?.message
type: "validation",
on: type,
message: error2?.message,
found: value
});
} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value.Value.Errors(validator, value)];
let expected;
try {
expected = import_value.Value.Create(schema);
} catch (error3) {
expected = {
type: "Could not create expected value",
// @ts-expect-error
message: error3?.message,
error: error3
};
}
message = JSON.stringify(
{
type,
at: accessor,
type: "validation",
on: type,
property: accessor,
message: error2?.message,
expected: import_value.Value.Create(
// @ts-ignore private field
validator.schema
),
expected,
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -111,3 +123,3 @@ null,

this.code = "VALIDATION";
this.status = 400;
this.status = 422;
Object.setPrototypeOf(this, _ValidationError.prototype);

@@ -140,5 +152,2 @@ }

// src/index.ts
var import_deepmerge = __toESM(require("deepmerge"));
// src/compose.ts

@@ -238,15 +247,17 @@ var import_value2 = require("@sinclair/typebox/value");

set(config) {
this.cookie = typeof config === "function" ? config(this.cookie) : config;
this.cookie = Object.assign(
{
...this.initial,
value: this.value
},
typeof config === "function" ? config(this.cookie) : config
);
return this;
}
remove(options) {
remove() {
if (this.value === void 0)
return;
this.set({
domain: options?.domain,
expires: /* @__PURE__ */ new Date(0),
maxAge: 0,
path: options?.path,
sameSite: options?.sameSite,
secure: options?.secure,
value: ""

@@ -474,2 +485,32 @@ });

},
Date: (property) => {
const schema = import_typebox.Type.Date(property);
return t.Transform(
t.Union(
[
import_typebox.Type.Date(property),
t.String({
format: "date",
default: (/* @__PURE__ */ new Date()).toISOString()
}),
t.String({
format: "date-time",
default: (/* @__PURE__ */ new Date()).toISOString()
})
],
property
)
).Decode((value) => {
if (value instanceof Date)
return value;
const date = new Date(value);
if (!import_value3.Value.Check(schema, date))
throw new ValidationError("property", schema, date);
return date;
}).Encode((value) => {
if (typeof value === "string")
return new Date(value);
return value;
});
},
BooleanString: (property) => {

@@ -496,24 +537,39 @@ const schema = import_typebox.Type.Boolean(property);

},
ObjectString: (properties, options) => t.Transform(
t.Union(
[
ObjectString: (properties = {}, options) => {
const schema = t.Object(properties, options);
const defaultValue = JSON.stringify(import_value3.Value.Create(schema));
return t.Transform(
t.Union([
t.String({
format: "ObjectString",
default: ""
default: defaultValue
}),
t.Object(properties, options)
],
options
)
).Decode((value) => {
if (typeof value === "string")
try {
return JSON.parse(value);
} catch {
schema
])
).Decode((value) => {
if (typeof value === "string") {
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value3.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return value;
}
return value;
}).Encode((value) => JSON.stringify(value)),
return value;
}).Encode((value) => {
if (typeof value === "string")
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value3.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return JSON.stringify(value);
});
},
File: import_system.TypeSystem.Type("File", validateFile),
Files: (options = {}) => t.Transform(t.Union([Files(options)])).Decode((value) => {
Files: (options = {}) => t.Transform(Files(options)).Decode((value) => {
if (Array.isArray(value))

@@ -556,2 +612,3 @@ return value;

t.Cookie = ElysiaType.Cookie;
t.Date = ElysiaType.Date;

@@ -581,3 +638,3 @@ // src/utils.ts

var primitiveHookMap = primitiveHooks.reduce(
(acc, x2) => (acc[x2] = true, acc),
(acc, x) => (acc[x] = true, acc),
{}

@@ -649,2 +706,5 @@ );

};
var InvertedStatusMap = Object.fromEntries(
Object.entries(StatusMap).map(([k, v]) => [v, k])
);
function removeTrailingEquals(digest) {

@@ -700,3 +760,3 @@ let trimmedDigest = digest;

var isNotEmpty = (obj) => {
for (const x2 in obj)
for (const x in obj)
return true;

@@ -745,3 +805,3 @@ return false;

"Set-Cookie",
`${setCookie[i].slice(0, index)}=${setCookie[i].slice(index + 1)}`
`${setCookie[i].slice(0, index)}=${setCookie[i].slice(index + 1) || ""}`
);

@@ -845,3 +905,3 @@ }

return response.then(
(x2) => mapResponse(x2, set)
(x) => mapResponse(x, set)
);

@@ -877,3 +937,3 @@ case "Function":

if (response instanceof Promise)
return response.then((x2) => mapResponse(x2, set));
return response.then((x) => mapResponse(x, set));
if (response instanceof Error)

@@ -938,4 +998,4 @@ return errorToResponse(response, set);

case "Promise":
return response.then((x2) => {
const r = mapCompactResponse(x2);
return response.then((x) => {
const r = mapCompactResponse(x);
if (r !== void 0)

@@ -962,3 +1022,3 @@ return r;

if (response instanceof Promise)
return response.then((x2) => mapResponse(x2, set));
return response.then((x) => mapResponse(x, set));
if (response instanceof Error)

@@ -1054,4 +1114,4 @@ return errorToResponse(response, set);

case "Promise":
return response.then((x2) => {
const r = mapEarlyResponse(x2, set);
return response.then((x) => {
const r = mapEarlyResponse(x, set);
if (r !== void 0)

@@ -1091,3 +1151,3 @@ return r;

if (response instanceof Promise)
return response.then((x2) => mapEarlyResponse(x2, set));
return response.then((x) => mapEarlyResponse(x, set));
if (response instanceof Error)

@@ -1150,4 +1210,4 @@ return errorToResponse(response, set);

case "Promise":
return response.then((x2) => {
const r = mapEarlyResponse(x2, set);
return response.then((x) => {
const r = mapEarlyResponse(x, set);
if (r !== void 0)

@@ -1175,3 +1235,3 @@ return r;

if (response instanceof Promise)
return response.then((x2) => mapEarlyResponse(x2, set));
return response.then((x) => mapEarlyResponse(x, set));
if (response instanceof Error)

@@ -1178,0 +1238,0 @@ return errorToResponse(response, set);

@@ -1,8 +0,172 @@

import '@sinclair/typebox/compiler';
import '@sinclair/typebox';
export { h as ELYSIA_RESPONSE, g as ERROR_CODE, j as ElysiaErrors, I as InternalServerError, l as InvalidCookieSignature, N as NotFoundError, P as ParseError, V as ValidationError, k as error, i as isProduction } from './dynamic-handle-BOErSqze.js';
import 'bun';
import 'memoirist';
import 'openapi-types';
import 'eventemitter3';
import '@sinclair/typebox/system';
import * as undici_types from 'undici-types';
import { TSchema } from '@sinclair/typebox';
import { TypeCheck } from '@sinclair/typebox/compiler';
declare const ERROR_CODE: unique symbol;
declare const ELYSIA_RESPONSE: unique symbol;
type ELYSIA_RESPONSE = typeof ELYSIA_RESPONSE;
declare const isProduction: boolean;
type ElysiaErrors = InternalServerError | NotFoundError | ParseError | ValidationError | InvalidCookieSignature;
declare const error: <const Code extends number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required", const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
readonly 100: "Continue";
readonly 101: "Switching Protocols";
readonly 102: "Processing";
readonly 103: "Early Hints";
readonly 200: "OK";
readonly 201: "Created";
readonly 202: "Accepted";
readonly 203: "Non-Authoritative Information";
readonly 204: "No Content";
readonly 205: "Reset Content";
readonly 206: "Partial Content";
readonly 207: "Multi-Status";
readonly 208: "Already Reported";
readonly 300: "Multiple Choices";
readonly 301: "Moved Permanently";
readonly 302: "Found";
readonly 303: "See Other";
readonly 304: "Not Modified";
readonly 307: "Temporary Redirect";
readonly 308: "Permanent Redirect";
readonly 400: "Bad Request";
readonly 401: "Unauthorized";
readonly 402: "Payment Required";
readonly 403: "Forbidden";
readonly 404: "Not Found";
readonly 405: "Method Not Allowed";
readonly 406: "Not Acceptable";
readonly 407: "Proxy Authentication Required";
readonly 408: "Request Timeout";
readonly 409: "Conflict";
readonly 410: "Gone";
readonly 411: "Length Required";
readonly 412: "Precondition Failed";
readonly 413: "Payload Too Large";
readonly 414: "URI Too Long";
readonly 415: "Unsupported Media Type";
readonly 416: "Range Not Satisfiable";
readonly 417: "Expectation Failed";
readonly 418: "I'm a teapot";
readonly 421: "Misdirected Request";
readonly 422: "Unprocessable Content";
readonly 423: "Locked";
readonly 424: "Failed Dependency";
readonly 425: "Too Early";
readonly 426: "Upgrade Required";
readonly 428: "Precondition Required";
readonly 429: "Too Many Requests";
readonly 431: "Request Header Fields Too Large";
readonly 451: "Unavailable For Legal Reasons";
readonly 500: "Internal Server Error";
readonly 501: "Not Implemented";
readonly 502: "Bad Gateway";
readonly 503: "Service Unavailable";
readonly 504: "Gateway Timeout";
readonly 505: "HTTP Version Not Supported";
readonly 506: "Variant Also Negotiates";
readonly 507: "Insufficient Storage";
readonly 508: "Loop Detected";
readonly 510: "Not Extended";
readonly 511: "Network Authentication Required";
}[Code] : Code, const Status extends number = Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
readonly Continue: 100;
readonly 'Switching Protocols': 101;
readonly Processing: 102;
readonly 'Early Hints': 103;
readonly OK: 200;
readonly Created: 201;
readonly Accepted: 202;
readonly 'Non-Authoritative Information': 203;
readonly 'No Content': 204;
readonly 'Reset Content': 205;
readonly 'Partial Content': 206;
readonly 'Multi-Status': 207;
readonly 'Already Reported': 208;
readonly 'Multiple Choices': 300;
readonly 'Moved Permanently': 301;
readonly Found: 302;
readonly 'See Other': 303;
readonly 'Not Modified': 304;
readonly 'Temporary Redirect': 307;
readonly 'Permanent Redirect': 308;
readonly 'Bad Request': 400;
readonly Unauthorized: 401;
readonly 'Payment Required': 402;
readonly Forbidden: 403;
readonly 'Not Found': 404;
readonly 'Method Not Allowed': 405;
readonly 'Not Acceptable': 406;
readonly 'Proxy Authentication Required': 407;
readonly 'Request Timeout': 408;
readonly Conflict: 409;
readonly Gone: 410;
readonly 'Length Required': 411;
readonly 'Precondition Failed': 412;
readonly 'Payload Too Large': 413;
readonly 'URI Too Long': 414;
readonly 'Unsupported Media Type': 415;
readonly 'Range Not Satisfiable': 416;
readonly 'Expectation Failed': 417;
readonly "I'm a teapot": 418;
readonly 'Misdirected Request': 421;
readonly 'Unprocessable Content': 422;
readonly Locked: 423;
readonly 'Failed Dependency': 424;
readonly 'Too Early': 425;
readonly 'Upgrade Required': 426;
readonly 'Precondition Required': 428;
readonly 'Too Many Requests': 429;
readonly 'Request Header Fields Too Large': 431;
readonly 'Unavailable For Legal Reasons': 451;
readonly 'Internal Server Error': 500;
readonly 'Not Implemented': 501;
readonly 'Bad Gateway': 502;
readonly 'Service Unavailable': 503;
readonly 'Gateway Timeout': 504;
readonly 'HTTP Version Not Supported': 505;
readonly 'Variant Also Negotiates': 506;
readonly 'Insufficient Storage': 507;
readonly 'Loop Detected': 508;
readonly 'Not Extended': 510;
readonly 'Network Authentication Required': 511;
}[Code] : Code>(code: Code, response?: T) => {
response: T;
_type: { [ERROR_CODE in Status]: T; };
[ELYSIA_RESPONSE]: Status;
};
declare class InternalServerError extends Error {
code: string;
status: number;
constructor(message?: string);
}
declare class NotFoundError extends Error {
code: string;
status: number;
constructor(message?: string);
}
declare class ParseError extends Error {
body?: unknown;
code: string;
status: number;
constructor(message?: string, body?: unknown);
}
declare class InvalidCookieSignature extends Error {
key: string;
code: string;
status: number;
constructor(key: string, message?: string);
}
declare class ValidationError extends Error {
type: string;
validator: TSchema | TypeCheck<any>;
value: unknown;
code: string;
status: number;
constructor(type: string, validator: TSchema | TypeCheck<any>, value: unknown);
get all(): any[];
static simplifyModel(validator: TSchema | TypeCheck<any>): any;
get model(): any;
toResponse(headers?: Record<string, any>): undici_types.Response;
}
export { ELYSIA_RESPONSE, ERROR_CODE, type ElysiaErrors, InternalServerError, InvalidCookieSignature, NotFoundError, ParseError, ValidationError, error, isProduction };

@@ -50,8 +50,11 @@ "use strict";

var import_compiler2 = require("@sinclair/typebox/compiler");
var import_deepmerge2 = __toESM(require("deepmerge"));
// src/index.ts
var import_eventemitter3 = __toESM(require("eventemitter3"));
var import_deepmerge = __toESM(require("deepmerge"));
// src/compose.ts
var import_value = require("@sinclair/typebox/value");
var import_fast_querystring = require("fast-querystring");
var import_fast_decode_uri_component2 = __toESM(require("fast-decode-uri-component"));
// src/handler.ts

@@ -68,5 +71,2 @@ var import_cookie2 = require("cookie");

// src/compose.ts
var import_value = require("@sinclair/typebox/value");
var import_fast_querystring = require("fast-querystring");
var import_fast_decode_uri_component2 = __toESM(require("fast-decode-uri-component"));
var headersHasToJSON = new Headers().toJSON;

@@ -199,2 +199,32 @@ var KindSymbol = Symbol.for("TypeBox.Kind");

},
Date: (property) => {
const schema = import_typebox.Type.Date(property);
return t.Transform(
t.Union(
[
import_typebox.Type.Date(property),
t.String({
format: "date",
default: (/* @__PURE__ */ new Date()).toISOString()
}),
t.String({
format: "date-time",
default: (/* @__PURE__ */ new Date()).toISOString()
})
],
property
)
).Decode((value) => {
if (value instanceof Date)
return value;
const date = new Date(value);
if (!import_value2.Value.Check(schema, date))
throw new ValidationError("property", schema, date);
return date;
}).Encode((value) => {
if (typeof value === "string")
return new Date(value);
return value;
});
},
BooleanString: (property) => {

@@ -221,24 +251,39 @@ const schema = import_typebox.Type.Boolean(property);

},
ObjectString: (properties, options) => t.Transform(
t.Union(
[
ObjectString: (properties = {}, options) => {
const schema = t.Object(properties, options);
const defaultValue = JSON.stringify(import_value2.Value.Create(schema));
return t.Transform(
t.Union([
t.String({
format: "ObjectString",
default: ""
default: defaultValue
}),
t.Object(properties, options)
],
options
)
).Decode((value) => {
if (typeof value === "string")
try {
return JSON.parse(value);
} catch {
schema
])
).Decode((value) => {
if (typeof value === "string") {
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value2.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return value;
}
return value;
}).Encode((value) => JSON.stringify(value)),
return value;
}).Encode((value) => {
if (typeof value === "string")
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value2.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return JSON.stringify(value);
});
},
File: import_system.TypeSystem.Type("File", validateFile),
Files: (options = {}) => t.Transform(t.Union([Files(options)])).Decode((value) => {
Files: (options = {}) => t.Transform(Files(options)).Decode((value) => {
if (Array.isArray(value))

@@ -281,2 +326,3 @@ return value;

t.Cookie = ElysiaType.Cookie;
t.Date = ElysiaType.Date;

@@ -306,3 +352,3 @@ // src/utils.ts

var primitiveHookMap = primitiveHooks.reduce(
(acc, x2) => (acc[x2] = true, acc),
(acc, x) => (acc[x] = true, acc),
{}

@@ -374,2 +420,5 @@ );

};
var InvertedStatusMap = Object.fromEntries(
Object.entries(StatusMap).map(([k, v]) => [v, k])
);
var encoder = new TextEncoder();

@@ -385,3 +434,6 @@

[ELYSIA_RESPONSE]: StatusMap[code] ?? code,
response,
response: response ?? (code in InvertedStatusMap ? (
// @ts-expect-error Always correct
InvertedStatusMap[code]
) : code),
_type: void 0

@@ -404,4 +456,5 @@ });

var ParseError = class extends Error {
constructor(message) {
constructor(message, body) {
super(message ?? "PARSE");
this.body = body;
this.code = "PARSE";

@@ -425,3 +478,3 @@ this.status = 400;

const customError = error2?.schema.error ? typeof error2.schema.error === "function" ? error2.schema.error(type, validator, value) : error2.schema.error : void 0;
const accessor = error2?.path?.slice(1) || "root";
const accessor = error2?.path || "root";
let message = "";

@@ -432,17 +485,30 @@ if (customError) {

message = JSON.stringify({
type,
message: error2?.message
type: "validation",
on: type,
message: error2?.message,
found: value
});
} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value4.Value.Errors(validator, value)];
let expected;
try {
expected = import_value4.Value.Create(schema);
} catch (error3) {
expected = {
type: "Could not create expected value",
// @ts-expect-error
message: error3?.message,
error: error3
};
}
message = JSON.stringify(
{
type,
at: accessor,
type: "validation",
on: type,
property: accessor,
message: error2?.message,
expected: import_value4.Value.Create(
// @ts-ignore private field
validator.schema
),
expected,
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -458,3 +524,3 @@ null,

this.code = "VALIDATION";
this.status = 400;
this.status = 422;
Object.setPrototypeOf(this, _ValidationError.prototype);

@@ -461,0 +527,0 @@ }

@@ -1,2 +0,3 @@

export { aS as errorToResponse, aM as isNotEmpty, aR as mapCompactResponse, aQ as mapEarlyResponse, aP as mapResponse, aN as parseSetCookies, aO as serializeCookie } from './dynamic-handle-BOErSqze.js';
import 'undici-types';
export { aL as errorToResponse, aF as isNotEmpty, aK as mapCompactResponse, aJ as mapEarlyResponse, aI as mapResponse, aG as parseSetCookies, aH as serializeCookie } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -8,2 +9,3 @@ import 'memoirist';

import 'eventemitter3';
import './error.js';
import '@sinclair/typebox/system';

@@ -48,3 +48,2 @@ "use strict";

var import_compiler2 = require("@sinclair/typebox/compiler");
var import_deepmerge2 = __toESM(require("deepmerge"));

@@ -66,3 +65,3 @@ // src/index.ts

const customError = error2?.schema.error ? typeof error2.schema.error === "function" ? error2.schema.error(type, validator, value) : error2.schema.error : void 0;
const accessor = error2?.path?.slice(1) || "root";
const accessor = error2?.path || "root";
let message = "";

@@ -73,17 +72,30 @@ if (customError) {

message = JSON.stringify({
type,
message: error2?.message
type: "validation",
on: type,
message: error2?.message,
found: value
});
} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value.Value.Errors(validator, value)];
let expected;
try {
expected = import_value.Value.Create(schema);
} catch (error3) {
expected = {
type: "Could not create expected value",
// @ts-expect-error
message: error3?.message,
error: error3
};
}
message = JSON.stringify(
{
type,
at: accessor,
type: "validation",
on: type,
property: accessor,
message: error2?.message,
expected: import_value.Value.Create(
// @ts-ignore private field
validator.schema
),
expected,
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -99,3 +111,3 @@ null,

this.code = "VALIDATION";
this.status = 400;
this.status = 422;
Object.setPrototypeOf(this, _ValidationError.prototype);

@@ -128,5 +140,2 @@ }

// src/index.ts
var import_deepmerge = __toESM(require("deepmerge"));
// src/compose.ts

@@ -226,15 +235,17 @@ var import_value2 = require("@sinclair/typebox/value");

set(config) {
this.cookie = typeof config === "function" ? config(this.cookie) : config;
this.cookie = Object.assign(
{
...this.initial,
value: this.value
},
typeof config === "function" ? config(this.cookie) : config
);
return this;
}
remove(options) {
remove() {
if (this.value === void 0)
return;
this.set({
domain: options?.domain,
expires: /* @__PURE__ */ new Date(0),
maxAge: 0,
path: options?.path,
sameSite: options?.sameSite,
secure: options?.secure,
value: ""

@@ -377,2 +388,32 @@ });

},
Date: (property) => {
const schema = import_typebox.Type.Date(property);
return t.Transform(
t.Union(
[
import_typebox.Type.Date(property),
t.String({
format: "date",
default: (/* @__PURE__ */ new Date()).toISOString()
}),
t.String({
format: "date-time",
default: (/* @__PURE__ */ new Date()).toISOString()
})
],
property
)
).Decode((value) => {
if (value instanceof Date)
return value;
const date = new Date(value);
if (!import_value3.Value.Check(schema, date))
throw new ValidationError("property", schema, date);
return date;
}).Encode((value) => {
if (typeof value === "string")
return new Date(value);
return value;
});
},
BooleanString: (property) => {

@@ -399,24 +440,39 @@ const schema = import_typebox.Type.Boolean(property);

},
ObjectString: (properties, options) => t.Transform(
t.Union(
[
ObjectString: (properties = {}, options) => {
const schema = t.Object(properties, options);
const defaultValue = JSON.stringify(import_value3.Value.Create(schema));
return t.Transform(
t.Union([
t.String({
format: "ObjectString",
default: ""
default: defaultValue
}),
t.Object(properties, options)
],
options
)
).Decode((value) => {
if (typeof value === "string")
try {
return JSON.parse(value);
} catch {
schema
])
).Decode((value) => {
if (typeof value === "string") {
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value3.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return value;
}
return value;
}).Encode((value) => JSON.stringify(value)),
return value;
}).Encode((value) => {
if (typeof value === "string")
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value3.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return JSON.stringify(value);
});
},
File: import_system.TypeSystem.Type("File", validateFile),
Files: (options = {}) => t.Transform(t.Union([Files(options)])).Decode((value) => {
Files: (options = {}) => t.Transform(Files(options)).Decode((value) => {
if (Array.isArray(value))

@@ -459,2 +515,3 @@ return value;

t.Cookie = ElysiaType.Cookie;
t.Date = ElysiaType.Date;

@@ -484,3 +541,3 @@ // src/utils.ts

var primitiveHookMap = primitiveHooks.reduce(
(acc, x2) => (acc[x2] = true, acc),
(acc, x) => (acc[x] = true, acc),
{}

@@ -552,2 +609,5 @@ );

};
var InvertedStatusMap = Object.fromEntries(
Object.entries(StatusMap).map(([k, v]) => [v, k])
);
var encoder = new TextEncoder();

@@ -558,3 +618,3 @@

var isNotEmpty = (obj) => {
for (const x2 in obj)
for (const x in obj)
return true;

@@ -603,3 +663,3 @@ return false;

"Set-Cookie",
`${setCookie[i].slice(0, index)}=${setCookie[i].slice(index + 1)}`
`${setCookie[i].slice(0, index)}=${setCookie[i].slice(index + 1) || ""}`
);

@@ -703,3 +763,3 @@ }

return response.then(
(x2) => mapResponse(x2, set)
(x) => mapResponse(x, set)
);

@@ -735,3 +795,3 @@ case "Function":

if (response instanceof Promise)
return response.then((x2) => mapResponse(x2, set));
return response.then((x) => mapResponse(x, set));
if (response instanceof Error)

@@ -796,4 +856,4 @@ return errorToResponse(response, set);

case "Promise":
return response.then((x2) => {
const r = mapCompactResponse(x2);
return response.then((x) => {
const r = mapCompactResponse(x);
if (r !== void 0)

@@ -820,3 +880,3 @@ return r;

if (response instanceof Promise)
return response.then((x2) => mapResponse(x2, set));
return response.then((x) => mapResponse(x, set));
if (response instanceof Error)

@@ -912,4 +972,4 @@ return errorToResponse(response, set);

case "Promise":
return response.then((x2) => {
const r = mapEarlyResponse(x2, set);
return response.then((x) => {
const r = mapEarlyResponse(x, set);
if (r !== void 0)

@@ -949,3 +1009,3 @@ return r;

if (response instanceof Promise)
return response.then((x2) => mapEarlyResponse(x2, set));
return response.then((x) => mapEarlyResponse(x, set));
if (response instanceof Error)

@@ -1008,4 +1068,4 @@ return errorToResponse(response, set);

case "Promise":
return response.then((x2) => {
const r = mapEarlyResponse(x2, set);
return response.then((x) => {
const r = mapEarlyResponse(x, set);
if (r !== void 0)

@@ -1033,3 +1093,3 @@ return r;

if (response instanceof Promise)
return response.then((x2) => mapEarlyResponse(x2, set));
return response.then((x) => mapEarlyResponse(x, set));
if (response instanceof Error)

@@ -1036,0 +1096,0 @@ return errorToResponse(response, set);

import 'bun';
import 'memoirist';
export { Static, TSchema } from '@sinclair/typebox';
export { K as AfterHandler, $ as BodyHandler, ac as Checksum, C as ComposedHandler, aD as Context, e as Cookie, c as CookieOptions, D as DefinitionBase, E as Elysia, m as ElysiaConfig, a2 as ErrorHandler, z as HTTPMethod, H as Handler, A as InputSchema, a6 as InternalRoute, I as InternalServerError, l as InvalidCookieSignature, x as LifeCycleEvent, L as LifeCycleStore, a7 as ListenCallback, a5 as LocalHook, n as MaybePromise, B as MergeSchema, N as NotFoundError, J as OptionalHandler, P as ParseError, aE as PreContext, a0 as PreHandler, s as RouteBase, u as RouteSchema, S as SchemaValidator, r as SingletonBase, Y as TraceEvent, T as TraceHandler, Z as TraceProcess, a as TraceReporter, b as TraceStream, v as UnwrapRoute, U as UnwrapSchema, V as ValidationError, W as VoidHandler, E as default, k as error, ap as getResponseSchemaValidator, ao as getSchemaValidator, aR as mapCompactResponse, aQ as mapEarlyResponse, aP as mapResponse, an as mergeHook, al as mergeObjectArray, aF as t } from './dynamic-handle-BOErSqze.js';
export { A as AfterHandler, J as BodyHandler, a2 as Checksum, C as ComposedHandler, aw as Context, e as Cookie, c as CookieOptions, D as DefinitionBase, E as Elysia, g as ElysiaConfig, Q as ErrorHandler, t as HTTPMethod, H as Handler, I as InputSchema, Y as InternalRoute, r as LifeCycleEvent, L as LifeCycleStore, Z as ListenCallback, X as LocalHook, h as MaybePromise, u as MergeSchema, w as OptionalHandler, ax as PreContext, K as PreHandler, l as RouteBase, n as RouteSchema, S as SchemaValidator, k as SingletonBase, z as TraceEvent, T as TraceHandler, B as TraceProcess, a as TraceReporter, b as TraceStream, o as UnwrapRoute, U as UnwrapSchema, V as VoidHandler, E as default, aj as getResponseSchemaValidator, ai as getSchemaValidator, aK as mapCompactResponse, aJ as mapEarlyResponse, aI as mapResponse, ah as mergeHook, af as mergeObjectArray, ay as t } from './dynamic-handle-CQy7PKh8.js';
export { InternalServerError, InvalidCookieSignature, NotFoundError, ParseError, ValidationError, error } from './error.js';
import '@sinclair/typebox/compiler';

@@ -9,1 +10,2 @@ import 'openapi-types';

import '@sinclair/typebox/system';
import 'undici-types';

@@ -1,2 +0,2 @@

import { L as LifeCycleStore, H as Handler, T as TraceHandler } from './dynamic-handle-BOErSqze.js';
import { L as LifeCycleStore, H as Handler, T as TraceHandler } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -8,2 +8,4 @@ import 'memoirist';

import 'eventemitter3';
import './error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -10,0 +12,0 @@

@@ -1,2 +0,2 @@

import { a as TraceReporter, T as TraceHandler, b as TraceStream } from './dynamic-handle-BOErSqze.js';
import { a as TraceReporter, T as TraceHandler, b as TraceStream } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -8,2 +8,4 @@ import 'memoirist';

import 'eventemitter3';
import './error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -10,0 +12,0 @@

import '@sinclair/typebox';
export { TypeCheck, TypeCompiler } from '@sinclair/typebox/compiler';
export { aH as ElysiaType, aG as ElysiaTypeOptions, aI as TCookie, aF as t } from './dynamic-handle-BOErSqze.js';
export { aA as ElysiaType, az as ElysiaTypeOptions, aB as TCookie, ay as t } from './dynamic-handle-CQy7PKh8.js';
export { TypeSystem, TypeSystemDuplicateFormat, TypeSystemDuplicateTypeKind, TypeSystemPolicy } from '@sinclair/typebox/system';
import 'bun';
export { TypeSystem, TypeSystemDuplicateFormat, TypeSystemDuplicateTypeKind, TypeSystemPolicy } from '@sinclair/typebox/system';
import 'memoirist';
import 'openapi-types';
import 'eventemitter3';
import './error.js';
import 'undici-types';

@@ -54,8 +54,11 @@ "use strict";

var import_compiler = require("@sinclair/typebox/compiler");
var import_deepmerge2 = __toESM(require("deepmerge"));
// src/index.ts
var import_eventemitter3 = __toESM(require("eventemitter3"));
var import_deepmerge = __toESM(require("deepmerge"));
// src/compose.ts
var import_value = require("@sinclair/typebox/value");
var import_fast_querystring = require("fast-querystring");
var import_fast_decode_uri_component2 = __toESM(require("fast-decode-uri-component"));
// src/handler.ts

@@ -72,5 +75,2 @@ var import_cookie2 = require("cookie");

// src/compose.ts
var import_value = require("@sinclair/typebox/value");
var import_fast_querystring = require("fast-querystring");
var import_fast_decode_uri_component2 = __toESM(require("fast-decode-uri-component"));
var headersHasToJSON = new Headers().toJSON;

@@ -106,3 +106,3 @@ var KindSymbol = Symbol.for("TypeBox.Kind");

var primitiveHookMap = primitiveHooks.reduce(
(acc, x2) => (acc[x2] = true, acc),
(acc, x) => (acc[x] = true, acc),
{}

@@ -112,2 +112,67 @@ );

var hasHash = isBun && typeof Bun.hash === "function";
var StatusMap = {
Continue: 100,
"Switching Protocols": 101,
Processing: 102,
"Early Hints": 103,
OK: 200,
Created: 201,
Accepted: 202,
"Non-Authoritative Information": 203,
"No Content": 204,
"Reset Content": 205,
"Partial Content": 206,
"Multi-Status": 207,
"Already Reported": 208,
"Multiple Choices": 300,
"Moved Permanently": 301,
Found: 302,
"See Other": 303,
"Not Modified": 304,
"Temporary Redirect": 307,
"Permanent Redirect": 308,
"Bad Request": 400,
Unauthorized: 401,
"Payment Required": 402,
Forbidden: 403,
"Not Found": 404,
"Method Not Allowed": 405,
"Not Acceptable": 406,
"Proxy Authentication Required": 407,
"Request Timeout": 408,
Conflict: 409,
Gone: 410,
"Length Required": 411,
"Precondition Failed": 412,
"Payload Too Large": 413,
"URI Too Long": 414,
"Unsupported Media Type": 415,
"Range Not Satisfiable": 416,
"Expectation Failed": 417,
"I'm a teapot": 418,
"Misdirected Request": 421,
"Unprocessable Content": 422,
Locked: 423,
"Failed Dependency": 424,
"Too Early": 425,
"Upgrade Required": 426,
"Precondition Required": 428,
"Too Many Requests": 429,
"Request Header Fields Too Large": 431,
"Unavailable For Legal Reasons": 451,
"Internal Server Error": 500,
"Not Implemented": 501,
"Bad Gateway": 502,
"Service Unavailable": 503,
"Gateway Timeout": 504,
"HTTP Version Not Supported": 505,
"Variant Also Negotiates": 506,
"Insufficient Storage": 507,
"Loop Detected": 508,
"Not Extended": 510,
"Network Authentication Required": 511
};
var InvertedStatusMap = Object.fromEntries(
Object.entries(StatusMap).map(([k, v]) => [v, k])
);
var encoder = new TextEncoder();

@@ -126,3 +191,3 @@

const customError = error2?.schema.error ? typeof error2.schema.error === "function" ? error2.schema.error(type, validator, value) : error2.schema.error : void 0;
const accessor = error2?.path?.slice(1) || "root";
const accessor = error2?.path || "root";
let message = "";

@@ -133,17 +198,30 @@ if (customError) {

message = JSON.stringify({
type,
message: error2?.message
type: "validation",
on: type,
message: error2?.message,
found: value
});
} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value3.Value.Errors(validator, value)];
let expected;
try {
expected = import_value3.Value.Create(schema);
} catch (error3) {
expected = {
type: "Could not create expected value",
// @ts-expect-error
message: error3?.message,
error: error3
};
}
message = JSON.stringify(
{
type,
at: accessor,
type: "validation",
on: type,
property: accessor,
message: error2?.message,
expected: import_value3.Value.Create(
// @ts-ignore private field
validator.schema
),
expected,
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -159,3 +237,3 @@ null,

this.code = "VALIDATION";
this.status = 400;
this.status = 422;
Object.setPrototypeOf(this, _ValidationError.prototype);

@@ -305,2 +383,32 @@ }

},
Date: (property) => {
const schema = import_typebox2.Type.Date(property);
return t.Transform(
t.Union(
[
import_typebox2.Type.Date(property),
t.String({
format: "date",
default: (/* @__PURE__ */ new Date()).toISOString()
}),
t.String({
format: "date-time",
default: (/* @__PURE__ */ new Date()).toISOString()
})
],
property
)
).Decode((value) => {
if (value instanceof Date)
return value;
const date = new Date(value);
if (!import_value4.Value.Check(schema, date))
throw new ValidationError("property", schema, date);
return date;
}).Encode((value) => {
if (typeof value === "string")
return new Date(value);
return value;
});
},
BooleanString: (property) => {

@@ -327,24 +435,39 @@ const schema = import_typebox2.Type.Boolean(property);

},
ObjectString: (properties, options) => t.Transform(
t.Union(
[
ObjectString: (properties = {}, options) => {
const schema = t.Object(properties, options);
const defaultValue = JSON.stringify(import_value4.Value.Create(schema));
return t.Transform(
t.Union([
t.String({
format: "ObjectString",
default: ""
default: defaultValue
}),
t.Object(properties, options)
],
options
)
).Decode((value) => {
if (typeof value === "string")
try {
return JSON.parse(value);
} catch {
schema
])
).Decode((value) => {
if (typeof value === "string") {
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value4.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return value;
}
return value;
}).Encode((value) => JSON.stringify(value)),
return value;
}).Encode((value) => {
if (typeof value === "string")
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value4.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return JSON.stringify(value);
});
},
File: import_system.TypeSystem.Type("File", validateFile),
Files: (options = {}) => t.Transform(t.Union([Files(options)])).Decode((value) => {
Files: (options = {}) => t.Transform(Files(options)).Decode((value) => {
if (Array.isArray(value))

@@ -387,2 +510,3 @@ return value;

t.Cookie = ElysiaType.Cookie;
t.Date = ElysiaType.Date;
// Annotate the CommonJS export names for ESM import in node:

@@ -389,0 +513,0 @@ 0 && (module.exports = {

@@ -1,2 +0,2 @@

export { a8 as AddPrefix, a9 as AddPrefixCapitalize, aa as AddSuffix, ab as AddSuffixCapitalize, K as AfterHandler, ad as BaseMacro, $ as BodyHandler, ac as Checksum, ah as ComposeElysiaResponse, C as ComposedHandler, y as ContentType, ag as CreateEden, D as DefinitionBase, m as ElysiaConfig, a2 as ErrorHandler, G as GetPathParameter, a1 as GracefulHandler, z as HTTPMethod, H as Handler, F as InlineHandler, A as InputSchema, a6 as InternalRoute, a3 as Isolate, x as LifeCycleEvent, L as LifeCycleStore, a7 as ListenCallback, a5 as LocalHook, af as MacroManager, ae as MacroToProperty, Q as MapResponse, M as MaybeArray, n as MaybePromise, ai as MergeElysiaInstances, B as MergeSchema, t as MetadataBase, a4 as NoInfer, O as ObjectValues, J as OptionalHandler, a0 as PreHandler, o as Prettify, q as Prettify2, R as Reconcile, s as RouteBase, u as RouteSchema, S as SchemaValidator, r as SingletonBase, Y as TraceEvent, T as TraceHandler, _ as TraceListener, Z as TraceProcess, a as TraceReporter, b as TraceStream, X as TransformHandler, w as UnwrapGroupGuardRoute, v as UnwrapRoute, U as UnwrapSchema, W as VoidHandler } from './dynamic-handle-BOErSqze.js';
export { _ as AddPrefix, $ as AddPrefixCapitalize, a0 as AddSuffix, a1 as AddSuffixCapitalize, A as AfterHandler, a3 as BaseMacro, J as BodyHandler, a2 as Checksum, a9 as ComposeElysiaResponse, C as ComposedHandler, s as ContentType, a8 as CreateEden, D as DefinitionBase, g as ElysiaConfig, a5 as ElysiaFn, Q as ErrorHandler, G as GetPathParameter, N as GracefulHandler, t as HTTPMethod, H as Handler, v as InlineHandler, I as InputSchema, Y as InternalRoute, W as Isolate, r as LifeCycleEvent, L as LifeCycleStore, ab as LifeCycleType, Z as ListenCallback, X as LocalHook, a6 as MacroManager, a7 as MacroQueue, a4 as MacroToProperty, x as MapResponse, M as MaybeArray, h as MaybePromise, aa as MergeElysiaInstances, u as MergeSchema, m as MetadataBase, O as ObjectValues, w as OptionalHandler, j as Partial2, K as PreHandler, P as Prettify, i as Prettify2, R as Reconcile, l as RouteBase, n as RouteSchema, S as SchemaValidator, k as SingletonBase, z as TraceEvent, T as TraceHandler, F as TraceListener, B as TraceProcess, a as TraceReporter, b as TraceStream, y as TransformHandler, q as UnwrapGroupGuardRoute, o as UnwrapRoute, U as UnwrapSchema, V as VoidHandler } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -7,3 +7,5 @@ import '@sinclair/typebox';

import 'eventemitter3';
import './error.js';
import 'memoirist';
import '@sinclair/typebox/system';
import 'undici-types';
import '@sinclair/typebox';
import '@sinclair/typebox/compiler';
export { ax as HTTPStatusName, aw as StatusMap, au as asGlobal, at as asGlobalHook, aq as checksum, aB as createMacroManager, av as filterGlobalHook, ar as getCookieValidator, ap as getResponseSchemaValidator, ao as getSchemaValidator, aC as isNumericString, ak as mergeCookie, an as mergeHook, as as mergeLifeCycle, al as mergeObjectArray, am as primitiveHooks, aj as replaceUrlPath, ay as signCookie, aA as traceBackMacro, az as unsignCookie } from './dynamic-handle-BOErSqze.js';
export { aq as InvertedStatusMap, ap as StatusMap, an as asHookType, ak as checksum, au as createMacroManager, ao as filterGlobalHook, al as getCookieValidator, aj as getResponseSchemaValidator, ai as getSchemaValidator, av as isNumericString, ae as mergeCookie, ad as mergeDeep, ah as mergeHook, am as mergeLifeCycle, af as mergeObjectArray, ag as primitiveHooks, ac as replaceUrlPath, ar as signCookie, at as traceBackMacro, as as unsignCookie } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -8,2 +8,4 @@ import 'memoirist';

import 'eventemitter3';
import './error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -33,5 +33,5 @@ "use strict";

__export(utils_exports, {
InvertedStatusMap: () => InvertedStatusMap,
StatusMap: () => StatusMap,
asGlobal: () => asGlobal,
asGlobalHook: () => asGlobalHook,
asHookType: () => asHookType,
checksum: () => checksum,

@@ -45,2 +45,3 @@ createMacroManager: () => createMacroManager,

mergeCookie: () => mergeCookie,
mergeDeep: () => mergeDeep,
mergeHook: () => mergeHook,

@@ -59,3 +60,2 @@ mergeLifeCycle: () => mergeLifeCycle,

var import_compiler2 = require("@sinclair/typebox/compiler");
var import_deepmerge2 = __toESM(require("deepmerge"));

@@ -77,3 +77,3 @@ // src/index.ts

const customError = error2?.schema.error ? typeof error2.schema.error === "function" ? error2.schema.error(type, validator, value) : error2.schema.error : void 0;
const accessor = error2?.path?.slice(1) || "root";
const accessor = error2?.path || "root";
let message = "";

@@ -84,17 +84,30 @@ if (customError) {

message = JSON.stringify({
type,
message: error2?.message
type: "validation",
on: type,
message: error2?.message,
found: value
});
} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value.Value.Errors(validator, value)];
let expected;
try {
expected = import_value.Value.Create(schema);
} catch (error3) {
expected = {
type: "Could not create expected value",
// @ts-expect-error
message: error3?.message,
error: error3
};
}
message = JSON.stringify(
{
type,
at: accessor,
type: "validation",
on: type,
property: accessor,
message: error2?.message,
expected: import_value.Value.Create(
// @ts-ignore private field
validator.schema
),
expected,
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -110,3 +123,3 @@ null,

this.code = "VALIDATION";
this.status = 400;
this.status = 422;
Object.setPrototypeOf(this, _ValidationError.prototype);

@@ -139,4 +152,6 @@ }

// src/index.ts
var import_deepmerge = __toESM(require("deepmerge"));
// src/compose.ts
var import_value2 = require("@sinclair/typebox/value");
var import_fast_querystring = require("fast-querystring");
var import_fast_decode_uri_component2 = __toESM(require("fast-decode-uri-component"));

@@ -153,3 +168,3 @@ // src/handler.ts

var isNotEmpty = (obj) => {
for (const x2 in obj)
for (const x in obj)
return true;

@@ -160,5 +175,2 @@ return false;

// src/compose.ts
var import_value2 = require("@sinclair/typebox/value");
var import_fast_querystring = require("fast-querystring");
var import_fast_decode_uri_component2 = __toESM(require("fast-decode-uri-component"));
var headersHasToJSON = new Headers().toJSON;

@@ -291,2 +303,32 @@ var KindSymbol = Symbol.for("TypeBox.Kind");

},
Date: (property) => {
const schema = import_typebox.Type.Date(property);
return t.Transform(
t.Union(
[
import_typebox.Type.Date(property),
t.String({
format: "date",
default: (/* @__PURE__ */ new Date()).toISOString()
}),
t.String({
format: "date-time",
default: (/* @__PURE__ */ new Date()).toISOString()
})
],
property
)
).Decode((value) => {
if (value instanceof Date)
return value;
const date = new Date(value);
if (!import_value3.Value.Check(schema, date))
throw new ValidationError("property", schema, date);
return date;
}).Encode((value) => {
if (typeof value === "string")
return new Date(value);
return value;
});
},
BooleanString: (property) => {

@@ -313,24 +355,39 @@ const schema = import_typebox.Type.Boolean(property);

},
ObjectString: (properties, options) => t.Transform(
t.Union(
[
ObjectString: (properties = {}, options) => {
const schema = t.Object(properties, options);
const defaultValue = JSON.stringify(import_value3.Value.Create(schema));
return t.Transform(
t.Union([
t.String({
format: "ObjectString",
default: ""
default: defaultValue
}),
t.Object(properties, options)
],
options
)
).Decode((value) => {
if (typeof value === "string")
try {
return JSON.parse(value);
} catch {
schema
])
).Decode((value) => {
if (typeof value === "string") {
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value3.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return value;
}
return value;
}).Encode((value) => JSON.stringify(value)),
return value;
}).Encode((value) => {
if (typeof value === "string")
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value3.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return JSON.stringify(value);
});
},
File: import_system.TypeSystem.Type("File", validateFile),
Files: (options = {}) => t.Transform(t.Union([Files(options)])).Decode((value) => {
Files: (options = {}) => t.Transform(Files(options)).Decode((value) => {
if (Array.isArray(value))

@@ -373,2 +430,3 @@ return value;

t.Cookie = ElysiaType.Cookie;
t.Date = ElysiaType.Date;

@@ -381,6 +439,30 @@ // src/utils.ts

};
var isClass = (v) => typeof v === "function" && /^\s*class\s+/.test(v.toString()) || // Handle import * as Sentry from '@sentry/bun'
// This also handle [object Date], [object Array]
// and FFI value like [object Prisma]
v.toString().startsWith("[object ") || // If object prototype is not pure, then probably a class-like object
isNotEmpty(Object.getPrototypeOf(v));
var isObject = (item) => item && typeof item === "object" && !Array.isArray(item);
var mergeDeep = (target, source, {
skipKeys
} = {}) => {
if (isObject(target) && isObject(source))
for (const [key, value] of Object.entries(source)) {
if (skipKeys?.includes(key))
continue;
if (!isObject(value) || !(key in target) || isClass(value)) {
target[key] = value;
continue;
}
target[key] = mergeDeep(
target[key],
value
);
}
return target;
};
var mergeCookie = (a, b) => {
const { properties: _, ...target } = a ?? {};
const { properties: __, ...source } = b ?? {};
return (0, import_deepmerge2.default)(target, source);
return mergeDeep(target, source);
};

@@ -396,11 +478,10 @@ var mergeObjectArray = (a = [], b = []) => {

b = [b];
for (const item2 of a) {
array.push(item2);
if (item2.$elysiaChecksum)
checksums.push(item2.$elysiaChecksum);
for (const item of a) {
array.push(item);
if (item.$elysiaChecksum)
checksums.push(item.$elysiaChecksum);
}
for (const item2 of b) {
if (!checksums.includes(item2?.$elysiaChecksum))
array.push(item2);
}
for (const item of b)
if (!checksums.includes(item?.$elysiaChecksum))
array.push(item);
return array;

@@ -430,3 +511,3 @@ };

var primitiveHookMap = primitiveHooks.reduce(
(acc, x2) => (acc[x2] = true, acc),
(acc, x) => (acc[x] = true, acc),
{}

@@ -450,3 +531,3 @@ );

type: a?.type || b?.type,
detail: (0, import_deepmerge2.default)(
detail: mergeDeep(
// @ts-ignore

@@ -580,15 +661,21 @@ b?.detail ?? {},

var mergeLifeCycle = (a, b, checksum2) => {
const injectChecksum = (x2) => {
if (!x2)
const injectChecksum = (x) => {
if (!x)
return;
if (!Array.isArray(x2)) {
if (checksum2 && !x2.$elysiaChecksum)
item.$elysiaChecksum = checksum2;
return x2;
if (!Array.isArray(x)) {
const fn = x;
if (checksum2 && !fn.$elysiaChecksum)
fn.$elysiaChecksum = checksum2;
if (fn.$elysiaHookType === "scoped")
fn.$elysiaHookType = "local";
return fn;
}
for (const item2 of x2) {
if (checksum2 && !item2.$elysiaChecksum)
item2.$elysiaChecksum = checksum2;
const fns = [...x];
for (const fn of fns) {
if (checksum2 && !fn.$elysiaChecksum)
fn.$elysiaChecksum = checksum2;
if (fn.$elysiaHookType === "scoped")
fn.$elysiaHookType = "local";
}
return x2;
return fns;
};

@@ -624,40 +711,19 @@ return {

};
var asGlobalHook = (hook, inject = true) => {
return {
// rest is validator
...hook,
type: hook?.type,
detail: hook?.detail,
parse: asGlobal(hook?.parse, inject),
transform: asGlobal(hook?.transform, inject),
beforeHandle: asGlobal(hook?.beforeHandle, inject),
afterHandle: asGlobal(hook?.afterHandle, inject),
onResponse: asGlobal(hook?.onResponse, inject),
error: asGlobal(hook?.error, inject),
mapResponse: asGlobal(hook?.mapResponse, inject)
};
};
var asGlobal = (fn, inject = true) => {
var asHookType = (fn, inject, { skipIfHasType = false } = {}) => {
if (!fn)
return fn;
if (typeof fn === "function") {
if (inject)
fn.$elysiaHookType = "global";
if (skipIfHasType)
fn.$elysiaHookType ??= inject;
else
fn.$elysiaHookType = void 0;
fn.$elysiaHookType = inject;
return fn;
}
if (!Array.isArray(fn)) {
if (inject)
fn.$elysiaHookType = "global";
else
fn.$elysiaHookType = void 0;
if (!Array.isArray(fn))
return fn;
}
for (const x2 of fn) {
if (inject)
x2.$elysiaHookType = "global";
for (const x of fn)
if (skipIfHasType)
x.$elysiaHookType ??= inject;
else
x2.$elysiaHookType = void 0;
}
x.$elysiaHookType = inject;
return fn;

@@ -668,14 +734,20 @@ };

return fn;
if (typeof fn === "function") {
return fn.$elysiaHookType === "global" && x.$elysiaScoped !== true ? fn : void 0;
}
if (typeof fn === "function")
switch (fn.$elysiaHookType) {
case "global":
case "scoped":
return fn;
default:
return void 0;
}
if (!Array.isArray(fn))
return [];
const array = [];
if (!Array.isArray(fn)) {
if (fn.$elysiaHookType === "global" && fn.$elysiaScoped !== true)
return fn;
return [];
}
for (const x2 of fn)
if (x2.$elysiaHookType === "global" && x2.$elysiaScoped !== true)
array.push(x2);
for (const x of fn)
switch (x.$elysiaHookType) {
case "global":
case "scoped":
array.push(x);
break;
}
return array;

@@ -760,2 +832,5 @@ };

};
var InvertedStatusMap = Object.fromEntries(
Object.entries(StatusMap).map(([k, v]) => [v, k])
);
function removeTrailingEquals(digest) {

@@ -878,5 +953,5 @@ let trimmedDigest = digest;

0 && (module.exports = {
InvertedStatusMap,
StatusMap,
asGlobal,
asGlobalHook,
asHookType,
checksum,

@@ -890,2 +965,3 @@ createMacroManager,

mergeCookie,
mergeDeep,
mergeHook,

@@ -892,0 +968,0 @@ mergeLifeCycle,

import 'bun';
import '@sinclair/typebox';
import '@sinclair/typebox/compiler';
export { aK as ElysiaWS, aJ as websocket } from '../dynamic-handle-BOErSqze.js';
export { aD as ElysiaWS, aC as websocket } from '../dynamic-handle-CQy7PKh8.js';
import 'memoirist';
import 'openapi-types';
import 'eventemitter3';
import '../error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -45,8 +45,11 @@ "use strict";

var import_compiler2 = require("@sinclair/typebox/compiler");
var import_deepmerge2 = __toESM(require("deepmerge"));
// src/index.ts
var import_eventemitter3 = __toESM(require("eventemitter3"));
var import_deepmerge = __toESM(require("deepmerge"));
// src/compose.ts
var import_value = require("@sinclair/typebox/value");
var import_fast_querystring = require("fast-querystring");
var import_fast_decode_uri_component2 = __toESM(require("fast-decode-uri-component"));
// src/handler.ts

@@ -63,5 +66,2 @@ var import_cookie2 = require("cookie");

// src/compose.ts
var import_value = require("@sinclair/typebox/value");
var import_fast_querystring = require("fast-querystring");
var import_fast_decode_uri_component2 = __toESM(require("fast-decode-uri-component"));
var headersHasToJSON = new Headers().toJSON;

@@ -194,2 +194,32 @@ var KindSymbol = Symbol.for("TypeBox.Kind");

},
Date: (property) => {
const schema = import_typebox.Type.Date(property);
return t.Transform(
t.Union(
[
import_typebox.Type.Date(property),
t.String({
format: "date",
default: (/* @__PURE__ */ new Date()).toISOString()
}),
t.String({
format: "date-time",
default: (/* @__PURE__ */ new Date()).toISOString()
})
],
property
)
).Decode((value) => {
if (value instanceof Date)
return value;
const date = new Date(value);
if (!import_value2.Value.Check(schema, date))
throw new ValidationError("property", schema, date);
return date;
}).Encode((value) => {
if (typeof value === "string")
return new Date(value);
return value;
});
},
BooleanString: (property) => {

@@ -216,24 +246,39 @@ const schema = import_typebox.Type.Boolean(property);

},
ObjectString: (properties, options) => t.Transform(
t.Union(
[
ObjectString: (properties = {}, options) => {
const schema = t.Object(properties, options);
const defaultValue = JSON.stringify(import_value2.Value.Create(schema));
return t.Transform(
t.Union([
t.String({
format: "ObjectString",
default: ""
default: defaultValue
}),
t.Object(properties, options)
],
options
)
).Decode((value) => {
if (typeof value === "string")
try {
return JSON.parse(value);
} catch {
schema
])
).Decode((value) => {
if (typeof value === "string") {
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value2.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return value;
}
return value;
}).Encode((value) => JSON.stringify(value)),
return value;
}).Encode((value) => {
if (typeof value === "string")
try {
value = JSON.parse(value);
} catch {
throw new ValidationError("property", schema, value);
}
if (!import_value2.Value.Check(schema, value))
throw new ValidationError("property", schema, value);
return JSON.stringify(value);
});
},
File: import_system.TypeSystem.Type("File", validateFile),
Files: (options = {}) => t.Transform(t.Union([Files(options)])).Decode((value) => {
Files: (options = {}) => t.Transform(Files(options)).Decode((value) => {
if (Array.isArray(value))

@@ -276,2 +321,3 @@ return value;

t.Cookie = ElysiaType.Cookie;
t.Date = ElysiaType.Date;

@@ -301,3 +347,3 @@ // src/utils.ts

var primitiveHookMap = primitiveHooks.reduce(
(acc, x2) => (acc[x2] = true, acc),
(acc, x) => (acc[x] = true, acc),
{}

@@ -307,2 +353,67 @@ );

var hasHash = isBun && typeof Bun.hash === "function";
var StatusMap = {
Continue: 100,
"Switching Protocols": 101,
Processing: 102,
"Early Hints": 103,
OK: 200,
Created: 201,
Accepted: 202,
"Non-Authoritative Information": 203,
"No Content": 204,
"Reset Content": 205,
"Partial Content": 206,
"Multi-Status": 207,
"Already Reported": 208,
"Multiple Choices": 300,
"Moved Permanently": 301,
Found: 302,
"See Other": 303,
"Not Modified": 304,
"Temporary Redirect": 307,
"Permanent Redirect": 308,
"Bad Request": 400,
Unauthorized: 401,
"Payment Required": 402,
Forbidden: 403,
"Not Found": 404,
"Method Not Allowed": 405,
"Not Acceptable": 406,
"Proxy Authentication Required": 407,
"Request Timeout": 408,
Conflict: 409,
Gone: 410,
"Length Required": 411,
"Precondition Failed": 412,
"Payload Too Large": 413,
"URI Too Long": 414,
"Unsupported Media Type": 415,
"Range Not Satisfiable": 416,
"Expectation Failed": 417,
"I'm a teapot": 418,
"Misdirected Request": 421,
"Unprocessable Content": 422,
Locked: 423,
"Failed Dependency": 424,
"Too Early": 425,
"Upgrade Required": 426,
"Precondition Required": 428,
"Too Many Requests": 429,
"Request Header Fields Too Large": 431,
"Unavailable For Legal Reasons": 451,
"Internal Server Error": 500,
"Not Implemented": 501,
"Bad Gateway": 502,
"Service Unavailable": 503,
"Gateway Timeout": 504,
"HTTP Version Not Supported": 505,
"Variant Also Negotiates": 506,
"Insufficient Storage": 507,
"Loop Detected": 508,
"Not Extended": 510,
"Network Authentication Required": 511
};
var InvertedStatusMap = Object.fromEntries(
Object.entries(StatusMap).map(([k, v]) => [v, k])
);
var encoder = new TextEncoder();

@@ -321,3 +432,3 @@

const customError = error2?.schema.error ? typeof error2.schema.error === "function" ? error2.schema.error(type, validator, value) : error2.schema.error : void 0;
const accessor = error2?.path?.slice(1) || "root";
const accessor = error2?.path || "root";
let message = "";

@@ -328,17 +439,30 @@ if (customError) {

message = JSON.stringify({
type,
message: error2?.message
type: "validation",
on: type,
message: error2?.message,
found: value
});
} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value4.Value.Errors(validator, value)];
let expected;
try {
expected = import_value4.Value.Create(schema);
} catch (error3) {
expected = {
type: "Could not create expected value",
// @ts-expect-error
message: error3?.message,
error: error3
};
}
message = JSON.stringify(
{
type,
at: accessor,
type: "validation",
on: type,
property: accessor,
message: error2?.message,
expected: import_value4.Value.Create(
// @ts-ignore private field
validator.schema
),
expected,
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -354,3 +478,3 @@ null,

this.code = "VALIDATION";
this.status = 400;
this.status = 422;
Object.setPrototypeOf(this, _ValidationError.prototype);

@@ -357,0 +481,0 @@ }

import 'bun';
import '@sinclair/typebox';
import '@sinclair/typebox/compiler';
export { aL as WS } from '../dynamic-handle-BOErSqze.js';
export { aE as WS } from '../dynamic-handle-CQy7PKh8.js';
import 'memoirist';
import 'openapi-types';
import 'eventemitter3';
import '../error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -1,2 +0,2 @@

import { E as Elysia, L as LifeCycleStore, S as SchemaValidator, H as Handler, C as ComposedHandler } from './dynamic-handle-BOErSqze.js';
import { E as Elysia, L as LifeCycleStore, S as SchemaValidator, H as Handler, C as ComposedHandler } from './dynamic-handle-CQy7PKh8.js';
import { TAnySchema } from '@sinclair/typebox';

@@ -9,2 +9,4 @@ import { Sucrose } from './sucrose.js';

import 'eventemitter3';
import './error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -11,0 +13,0 @@

@@ -1,2 +0,3 @@

export { aD as Context, aE as PreContext } from './dynamic-handle-BOErSqze.js';
export { aw as Context, ax as PreContext } from './dynamic-handle-CQy7PKh8.js';
import './error.js';
import 'bun';

@@ -9,1 +10,2 @@ import 'memoirist';

import '@sinclair/typebox/system';
import 'undici-types';

@@ -1,2 +0,2 @@

export { e as Cookie, c as CookieOptions, d as ElysiaCookie, f as createCookieJar, p as parseCookie } from './dynamic-handle-BOErSqze.js';
export { e as Cookie, c as CookieOptions, d as ElysiaCookie, f as createCookieJar, p as parseCookie } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -8,2 +8,4 @@ import 'memoirist';

import 'eventemitter3';
import './error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -1,2 +0,3 @@

export { aT as DynamicHandler, aV as createDynamicErrorHandler, aU as createDynamicHandler } from './dynamic-handle-BOErSqze.js';
export { aM as DynamicHandler, aO as createDynamicErrorHandler, aN as createDynamicHandler } from './dynamic-handle-CQy7PKh8.js';
import './error.js';
import 'bun';

@@ -9,1 +10,2 @@ import 'memoirist';

import '@sinclair/typebox/system';
import 'undici-types';

@@ -1,8 +0,172 @@

import '@sinclair/typebox/compiler';
import '@sinclair/typebox';
export { h as ELYSIA_RESPONSE, g as ERROR_CODE, j as ElysiaErrors, I as InternalServerError, l as InvalidCookieSignature, N as NotFoundError, P as ParseError, V as ValidationError, k as error, i as isProduction } from './dynamic-handle-BOErSqze.js';
import 'bun';
import 'memoirist';
import 'openapi-types';
import 'eventemitter3';
import '@sinclair/typebox/system';
import * as undici_types from 'undici-types';
import { TSchema } from '@sinclair/typebox';
import { TypeCheck } from '@sinclair/typebox/compiler';
declare const ERROR_CODE: unique symbol;
declare const ELYSIA_RESPONSE: unique symbol;
type ELYSIA_RESPONSE = typeof ELYSIA_RESPONSE;
declare const isProduction: boolean;
type ElysiaErrors = InternalServerError | NotFoundError | ParseError | ValidationError | InvalidCookieSignature;
declare const error: <const Code extends number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required", const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
readonly 100: "Continue";
readonly 101: "Switching Protocols";
readonly 102: "Processing";
readonly 103: "Early Hints";
readonly 200: "OK";
readonly 201: "Created";
readonly 202: "Accepted";
readonly 203: "Non-Authoritative Information";
readonly 204: "No Content";
readonly 205: "Reset Content";
readonly 206: "Partial Content";
readonly 207: "Multi-Status";
readonly 208: "Already Reported";
readonly 300: "Multiple Choices";
readonly 301: "Moved Permanently";
readonly 302: "Found";
readonly 303: "See Other";
readonly 304: "Not Modified";
readonly 307: "Temporary Redirect";
readonly 308: "Permanent Redirect";
readonly 400: "Bad Request";
readonly 401: "Unauthorized";
readonly 402: "Payment Required";
readonly 403: "Forbidden";
readonly 404: "Not Found";
readonly 405: "Method Not Allowed";
readonly 406: "Not Acceptable";
readonly 407: "Proxy Authentication Required";
readonly 408: "Request Timeout";
readonly 409: "Conflict";
readonly 410: "Gone";
readonly 411: "Length Required";
readonly 412: "Precondition Failed";
readonly 413: "Payload Too Large";
readonly 414: "URI Too Long";
readonly 415: "Unsupported Media Type";
readonly 416: "Range Not Satisfiable";
readonly 417: "Expectation Failed";
readonly 418: "I'm a teapot";
readonly 421: "Misdirected Request";
readonly 422: "Unprocessable Content";
readonly 423: "Locked";
readonly 424: "Failed Dependency";
readonly 425: "Too Early";
readonly 426: "Upgrade Required";
readonly 428: "Precondition Required";
readonly 429: "Too Many Requests";
readonly 431: "Request Header Fields Too Large";
readonly 451: "Unavailable For Legal Reasons";
readonly 500: "Internal Server Error";
readonly 501: "Not Implemented";
readonly 502: "Bad Gateway";
readonly 503: "Service Unavailable";
readonly 504: "Gateway Timeout";
readonly 505: "HTTP Version Not Supported";
readonly 506: "Variant Also Negotiates";
readonly 507: "Insufficient Storage";
readonly 508: "Loop Detected";
readonly 510: "Not Extended";
readonly 511: "Network Authentication Required";
}[Code] : Code, const Status extends number = Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
readonly Continue: 100;
readonly 'Switching Protocols': 101;
readonly Processing: 102;
readonly 'Early Hints': 103;
readonly OK: 200;
readonly Created: 201;
readonly Accepted: 202;
readonly 'Non-Authoritative Information': 203;
readonly 'No Content': 204;
readonly 'Reset Content': 205;
readonly 'Partial Content': 206;
readonly 'Multi-Status': 207;
readonly 'Already Reported': 208;
readonly 'Multiple Choices': 300;
readonly 'Moved Permanently': 301;
readonly Found: 302;
readonly 'See Other': 303;
readonly 'Not Modified': 304;
readonly 'Temporary Redirect': 307;
readonly 'Permanent Redirect': 308;
readonly 'Bad Request': 400;
readonly Unauthorized: 401;
readonly 'Payment Required': 402;
readonly Forbidden: 403;
readonly 'Not Found': 404;
readonly 'Method Not Allowed': 405;
readonly 'Not Acceptable': 406;
readonly 'Proxy Authentication Required': 407;
readonly 'Request Timeout': 408;
readonly Conflict: 409;
readonly Gone: 410;
readonly 'Length Required': 411;
readonly 'Precondition Failed': 412;
readonly 'Payload Too Large': 413;
readonly 'URI Too Long': 414;
readonly 'Unsupported Media Type': 415;
readonly 'Range Not Satisfiable': 416;
readonly 'Expectation Failed': 417;
readonly "I'm a teapot": 418;
readonly 'Misdirected Request': 421;
readonly 'Unprocessable Content': 422;
readonly Locked: 423;
readonly 'Failed Dependency': 424;
readonly 'Too Early': 425;
readonly 'Upgrade Required': 426;
readonly 'Precondition Required': 428;
readonly 'Too Many Requests': 429;
readonly 'Request Header Fields Too Large': 431;
readonly 'Unavailable For Legal Reasons': 451;
readonly 'Internal Server Error': 500;
readonly 'Not Implemented': 501;
readonly 'Bad Gateway': 502;
readonly 'Service Unavailable': 503;
readonly 'Gateway Timeout': 504;
readonly 'HTTP Version Not Supported': 505;
readonly 'Variant Also Negotiates': 506;
readonly 'Insufficient Storage': 507;
readonly 'Loop Detected': 508;
readonly 'Not Extended': 510;
readonly 'Network Authentication Required': 511;
}[Code] : Code>(code: Code, response?: T) => {
response: T;
_type: { [ERROR_CODE in Status]: T; };
[ELYSIA_RESPONSE]: Status;
};
declare class InternalServerError extends Error {
code: string;
status: number;
constructor(message?: string);
}
declare class NotFoundError extends Error {
code: string;
status: number;
constructor(message?: string);
}
declare class ParseError extends Error {
body?: unknown;
code: string;
status: number;
constructor(message?: string, body?: unknown);
}
declare class InvalidCookieSignature extends Error {
key: string;
code: string;
status: number;
constructor(key: string, message?: string);
}
declare class ValidationError extends Error {
type: string;
validator: TSchema | TypeCheck<any>;
value: unknown;
code: string;
status: number;
constructor(type: string, validator: TSchema | TypeCheck<any>, value: unknown);
get all(): any[];
static simplifyModel(validator: TSchema | TypeCheck<any>): any;
get model(): any;
toResponse(headers?: Record<string, any>): undici_types.Response;
}
export { ELYSIA_RESPONSE, ERROR_CODE, type ElysiaErrors, InternalServerError, InvalidCookieSignature, NotFoundError, ParseError, ValidationError, error, isProduction };

@@ -1,2 +0,3 @@

export { aS as errorToResponse, aM as isNotEmpty, aR as mapCompactResponse, aQ as mapEarlyResponse, aP as mapResponse, aN as parseSetCookies, aO as serializeCookie } from './dynamic-handle-BOErSqze.js';
import 'undici-types';
export { aL as errorToResponse, aF as isNotEmpty, aK as mapCompactResponse, aJ as mapEarlyResponse, aI as mapResponse, aG as parseSetCookies, aH as serializeCookie } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -8,2 +9,3 @@ import 'memoirist';

import 'eventemitter3';
import './error.js';
import '@sinclair/typebox/system';
import 'bun';
import 'memoirist';
export { Static, TSchema } from '@sinclair/typebox';
export { K as AfterHandler, $ as BodyHandler, ac as Checksum, C as ComposedHandler, aD as Context, e as Cookie, c as CookieOptions, D as DefinitionBase, E as Elysia, m as ElysiaConfig, a2 as ErrorHandler, z as HTTPMethod, H as Handler, A as InputSchema, a6 as InternalRoute, I as InternalServerError, l as InvalidCookieSignature, x as LifeCycleEvent, L as LifeCycleStore, a7 as ListenCallback, a5 as LocalHook, n as MaybePromise, B as MergeSchema, N as NotFoundError, J as OptionalHandler, P as ParseError, aE as PreContext, a0 as PreHandler, s as RouteBase, u as RouteSchema, S as SchemaValidator, r as SingletonBase, Y as TraceEvent, T as TraceHandler, Z as TraceProcess, a as TraceReporter, b as TraceStream, v as UnwrapRoute, U as UnwrapSchema, V as ValidationError, W as VoidHandler, E as default, k as error, ap as getResponseSchemaValidator, ao as getSchemaValidator, aR as mapCompactResponse, aQ as mapEarlyResponse, aP as mapResponse, an as mergeHook, al as mergeObjectArray, aF as t } from './dynamic-handle-BOErSqze.js';
export { A as AfterHandler, J as BodyHandler, a2 as Checksum, C as ComposedHandler, aw as Context, e as Cookie, c as CookieOptions, D as DefinitionBase, E as Elysia, g as ElysiaConfig, Q as ErrorHandler, t as HTTPMethod, H as Handler, I as InputSchema, Y as InternalRoute, r as LifeCycleEvent, L as LifeCycleStore, Z as ListenCallback, X as LocalHook, h as MaybePromise, u as MergeSchema, w as OptionalHandler, ax as PreContext, K as PreHandler, l as RouteBase, n as RouteSchema, S as SchemaValidator, k as SingletonBase, z as TraceEvent, T as TraceHandler, B as TraceProcess, a as TraceReporter, b as TraceStream, o as UnwrapRoute, U as UnwrapSchema, V as VoidHandler, E as default, aj as getResponseSchemaValidator, ai as getSchemaValidator, aK as mapCompactResponse, aJ as mapEarlyResponse, aI as mapResponse, ah as mergeHook, af as mergeObjectArray, ay as t } from './dynamic-handle-CQy7PKh8.js';
export { InternalServerError, InvalidCookieSignature, NotFoundError, ParseError, ValidationError, error } from './error.js';
import '@sinclair/typebox/compiler';

@@ -9,1 +10,2 @@ import 'openapi-types';

import '@sinclair/typebox/system';
import 'undici-types';

@@ -1,2 +0,2 @@

import { L as LifeCycleStore, H as Handler, T as TraceHandler } from './dynamic-handle-BOErSqze.js';
import { L as LifeCycleStore, H as Handler, T as TraceHandler } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -8,2 +8,4 @@ import 'memoirist';

import 'eventemitter3';
import './error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -10,0 +12,0 @@

@@ -1,2 +0,2 @@

import { a as TraceReporter, T as TraceHandler, b as TraceStream } from './dynamic-handle-BOErSqze.js';
import { a as TraceReporter, T as TraceHandler, b as TraceStream } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -8,2 +8,4 @@ import 'memoirist';

import 'eventemitter3';
import './error.js';
import 'undici-types';
import '@sinclair/typebox/system';

@@ -10,0 +12,0 @@

import '@sinclair/typebox';
export { TypeCheck, TypeCompiler } from '@sinclair/typebox/compiler';
export { aH as ElysiaType, aG as ElysiaTypeOptions, aI as TCookie, aF as t } from './dynamic-handle-BOErSqze.js';
export { aA as ElysiaType, az as ElysiaTypeOptions, aB as TCookie, ay as t } from './dynamic-handle-CQy7PKh8.js';
export { TypeSystem, TypeSystemDuplicateFormat, TypeSystemDuplicateTypeKind, TypeSystemPolicy } from '@sinclair/typebox/system';
import 'bun';
export { TypeSystem, TypeSystemDuplicateFormat, TypeSystemDuplicateTypeKind, TypeSystemPolicy } from '@sinclair/typebox/system';
import 'memoirist';
import 'openapi-types';
import 'eventemitter3';
import './error.js';
import 'undici-types';

@@ -1,2 +0,2 @@

export { a8 as AddPrefix, a9 as AddPrefixCapitalize, aa as AddSuffix, ab as AddSuffixCapitalize, K as AfterHandler, ad as BaseMacro, $ as BodyHandler, ac as Checksum, ah as ComposeElysiaResponse, C as ComposedHandler, y as ContentType, ag as CreateEden, D as DefinitionBase, m as ElysiaConfig, a2 as ErrorHandler, G as GetPathParameter, a1 as GracefulHandler, z as HTTPMethod, H as Handler, F as InlineHandler, A as InputSchema, a6 as InternalRoute, a3 as Isolate, x as LifeCycleEvent, L as LifeCycleStore, a7 as ListenCallback, a5 as LocalHook, af as MacroManager, ae as MacroToProperty, Q as MapResponse, M as MaybeArray, n as MaybePromise, ai as MergeElysiaInstances, B as MergeSchema, t as MetadataBase, a4 as NoInfer, O as ObjectValues, J as OptionalHandler, a0 as PreHandler, o as Prettify, q as Prettify2, R as Reconcile, s as RouteBase, u as RouteSchema, S as SchemaValidator, r as SingletonBase, Y as TraceEvent, T as TraceHandler, _ as TraceListener, Z as TraceProcess, a as TraceReporter, b as TraceStream, X as TransformHandler, w as UnwrapGroupGuardRoute, v as UnwrapRoute, U as UnwrapSchema, W as VoidHandler } from './dynamic-handle-BOErSqze.js';
export { _ as AddPrefix, $ as AddPrefixCapitalize, a0 as AddSuffix, a1 as AddSuffixCapitalize, A as AfterHandler, a3 as BaseMacro, J as BodyHandler, a2 as Checksum, a9 as ComposeElysiaResponse, C as ComposedHandler, s as ContentType, a8 as CreateEden, D as DefinitionBase, g as ElysiaConfig, a5 as ElysiaFn, Q as ErrorHandler, G as GetPathParameter, N as GracefulHandler, t as HTTPMethod, H as Handler, v as InlineHandler, I as InputSchema, Y as InternalRoute, W as Isolate, r as LifeCycleEvent, L as LifeCycleStore, ab as LifeCycleType, Z as ListenCallback, X as LocalHook, a6 as MacroManager, a7 as MacroQueue, a4 as MacroToProperty, x as MapResponse, M as MaybeArray, h as MaybePromise, aa as MergeElysiaInstances, u as MergeSchema, m as MetadataBase, O as ObjectValues, w as OptionalHandler, j as Partial2, K as PreHandler, P as Prettify, i as Prettify2, R as Reconcile, l as RouteBase, n as RouteSchema, S as SchemaValidator, k as SingletonBase, z as TraceEvent, T as TraceHandler, F as TraceListener, B as TraceProcess, a as TraceReporter, b as TraceStream, y as TransformHandler, q as UnwrapGroupGuardRoute, o as UnwrapRoute, U as UnwrapSchema, V as VoidHandler } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -7,3 +7,5 @@ import '@sinclair/typebox';

import 'eventemitter3';
import './error.js';
import 'memoirist';
import '@sinclair/typebox/system';
import 'undici-types';
import '@sinclair/typebox';
import '@sinclair/typebox/compiler';
export { ax as HTTPStatusName, aw as StatusMap, au as asGlobal, at as asGlobalHook, aq as checksum, aB as createMacroManager, av as filterGlobalHook, ar as getCookieValidator, ap as getResponseSchemaValidator, ao as getSchemaValidator, aC as isNumericString, ak as mergeCookie, an as mergeHook, as as mergeLifeCycle, al as mergeObjectArray, am as primitiveHooks, aj as replaceUrlPath, ay as signCookie, aA as traceBackMacro, az as unsignCookie } from './dynamic-handle-BOErSqze.js';
export { aq as InvertedStatusMap, ap as StatusMap, an as asHookType, ak as checksum, au as createMacroManager, ao as filterGlobalHook, al as getCookieValidator, aj as getResponseSchemaValidator, ai as getSchemaValidator, av as isNumericString, ae as mergeCookie, ad as mergeDeep, ah as mergeHook, am as mergeLifeCycle, af as mergeObjectArray, ag as primitiveHooks, ac as replaceUrlPath, ar as signCookie, at as traceBackMacro, as as unsignCookie } from './dynamic-handle-CQy7PKh8.js';
import 'bun';

@@ -8,2 +8,4 @@ import 'memoirist';

import 'eventemitter3';
import './error.js';
import 'undici-types';
import '@sinclair/typebox/system';
import 'bun';
import '@sinclair/typebox';
import '@sinclair/typebox/compiler';
export { aK as ElysiaWS, aJ as websocket } from '../dynamic-handle-BOErSqze.js';
export { aD as ElysiaWS, aC as websocket } from '../dynamic-handle-CQy7PKh8.js';
import 'memoirist';
import 'openapi-types';
import 'eventemitter3';
import '../error.js';
import 'undici-types';
import '@sinclair/typebox/system';
import 'bun';
import '@sinclair/typebox';
import '@sinclair/typebox/compiler';
export { aL as WS } from '../dynamic-handle-BOErSqze.js';
export { aE as WS } from '../dynamic-handle-CQy7PKh8.js';
import 'memoirist';
import 'openapi-types';
import 'eventemitter3';
import '../error.js';
import 'undici-types';
import '@sinclair/typebox/system';
{
"name": "elysia",
"description": "Ergonomic Framework for Human",
"version": "1.0.0-exp.14",
"version": "1.0.0-exp.15",
"author": {

@@ -110,5 +110,4 @@ "name": "saltyAom",

"dependencies": {
"@sinclair/typebox": "^0.32.8",
"@sinclair/typebox": "^0.32.15",
"cookie": "^0.6.0",
"deepmerge": "^4.3.1",
"eventemitter3": "^5.0.1",

@@ -121,5 +120,4 @@ "fast-decode-uri-component": "^1.0.1",

"@types/benchmark": "^2.1.5",
"@types/bun": "1.0.4",
"@types/bun": "^1.0.8",
"@types/cookie": "^0.6.0",
"@types/is-even": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^6.17.0",

@@ -136,3 +134,3 @@ "@typescript-eslint/parser": "^6.17.0",

"type-fest": "^4.10.1",
"typescript": "5.3.3"
"typescript": "^5.4.2"
},

@@ -139,0 +137,0 @@ "peerDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc