Socket
Socket
Sign inDemoInstall

elysia

Package Overview
Dependencies
Maintainers
1
Versions
409
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elysia - npm Package Compare versions

Comparing version 1.0.0-exp.14 to 1.0.0-rc.0

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

2

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 { Q as AfterHandler, a0 as BodyHandler, ad as Checksum, C as ComposedHandler, aH as Context, e as Cookie, c as CookieOptions, D as DefinitionBase, E as Elysia, m as ElysiaConfig, a3 as ErrorHandler, A as HTTPMethod, H as Handler, B as InputSchema, a7 as InternalRoute, I as InternalServerError, l as InvalidCookieSignature, y as LifeCycleEvent, L as LifeCycleStore, a8 as ListenCallback, a6 as LocalHook, n as MaybePromise, F as MergeSchema, N as NotFoundError, K as OptionalHandler, P as ParseError, aI as PreContext, a1 as PreHandler, t as RouteBase, v as RouteSchema, S as SchemaValidator, s as SingletonBase, Z as TraceEvent, T as TraceHandler, _ as TraceProcess, a as TraceReporter, b as TraceStream, w as UnwrapRoute, U as UnwrapSchema, V as ValidationError, X as VoidHandler, E as default, k as error, at as getResponseSchemaValidator, as as getSchemaValidator, aV as mapCompactResponse, aU as mapEarlyResponse, aT as mapResponse, ar as mergeHook, ap as mergeObjectArray, aJ as t } from './dynamic-handle-BmhbbEgE.js';
import '@sinclair/typebox/compiler';

@@ -6,0 +6,0 @@ import 'openapi-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-BmhbbEgE.js';
import { TAnySchema } from '@sinclair/typebox';

@@ -3,0 +3,0 @@ import { Sucrose } from './sucrose.js';

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

export { aD as Context, aE as PreContext } from './dynamic-handle-BOErSqze.js';
export { aH as Context, aI as PreContext } from './dynamic-handle-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

@@ -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-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

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

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

@@ -81,2 +80,4 @@ // src/index.ts

} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value.Value.Errors(validator, value)];
message = JSON.stringify(

@@ -87,8 +88,5 @@ {

message: error2?.message,
expected: import_value.Value.Create(
// @ts-ignore private field
validator.schema
),
expected: import_value.Value.Create(schema),
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -132,5 +130,2 @@ null,

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

@@ -292,24 +287,39 @@ var import_cookie = require("cookie");

},
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))

@@ -316,0 +326,0 @@ return value;

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

export { aT as DynamicHandler, aV as createDynamicErrorHandler, aU as createDynamicHandler } from './dynamic-handle-BOErSqze.js';
export { aX as DynamicHandler, aZ as createDynamicErrorHandler, aY as createDynamicHandler } from './dynamic-handle-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

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

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

@@ -88,2 +87,4 @@ // src/index.ts

} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value.Value.Errors(validator, value)];
message = JSON.stringify(

@@ -94,8 +95,5 @@ {

message: error2?.message,
expected: import_value.Value.Create(
// @ts-ignore private field
validator.schema
),
expected: import_value.Value.Create(schema),
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -139,5 +137,2 @@ null,

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

@@ -493,24 +488,39 @@ var import_value2 = require("@sinclair/typebox/value");

},
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))

@@ -517,0 +527,0 @@ return value;

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';
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-BmhbbEgE.js';
import 'bun';

@@ -5,0 +5,0 @@ import 'memoirist';

@@ -50,7 +50,5 @@ "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"));

@@ -219,24 +217,39 @@ // src/handler.ts

},
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))

@@ -398,4 +411,5 @@ return value;

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

@@ -429,2 +443,4 @@ this.status = 400;

} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value4.Value.Errors(validator, value)];
message = JSON.stringify(

@@ -435,8 +451,5 @@ {

message: error2?.message,
expected: import_value4.Value.Create(
// @ts-ignore private field
validator.schema
),
expected: import_value4.Value.Create(schema),
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -443,0 +456,0 @@ null,

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

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';
export { aW as errorToResponse, aQ as isNotEmpty, aV as mapCompactResponse, aU as mapEarlyResponse, aT as mapResponse, aR as parseSetCookies, aS as serializeCookie } from './dynamic-handle-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

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

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

@@ -76,2 +75,4 @@ // src/index.ts

} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value.Value.Errors(validator, value)];
message = JSON.stringify(

@@ -82,8 +83,5 @@ {

message: error2?.message,
expected: import_value.Value.Create(
// @ts-ignore private field
validator.schema
),
expected: import_value.Value.Create(schema),
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -127,5 +125,2 @@ null,

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

@@ -396,24 +391,39 @@ var import_value2 = require("@sinclair/typebox/value");

},
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))

@@ -420,0 +430,0 @@ return value;

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 { Q as AfterHandler, a0 as BodyHandler, ad as Checksum, C as ComposedHandler, aH as Context, e as Cookie, c as CookieOptions, D as DefinitionBase, E as Elysia, m as ElysiaConfig, a3 as ErrorHandler, A as HTTPMethod, H as Handler, B as InputSchema, a7 as InternalRoute, I as InternalServerError, l as InvalidCookieSignature, y as LifeCycleEvent, L as LifeCycleStore, a8 as ListenCallback, a6 as LocalHook, n as MaybePromise, F as MergeSchema, N as NotFoundError, K as OptionalHandler, P as ParseError, aI as PreContext, a1 as PreHandler, t as RouteBase, v as RouteSchema, S as SchemaValidator, s as SingletonBase, Z as TraceEvent, T as TraceHandler, _ as TraceProcess, a as TraceReporter, b as TraceStream, w as UnwrapRoute, U as UnwrapSchema, V as ValidationError, X as VoidHandler, E as default, k as error, at as getResponseSchemaValidator, as as getSchemaValidator, aV as mapCompactResponse, aU as mapEarlyResponse, aT as mapResponse, ar as mergeHook, ap as mergeObjectArray, aJ as t } from './dynamic-handle-BmhbbEgE.js';
import '@sinclair/typebox/compiler';

@@ -6,0 +6,0 @@ import 'openapi-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-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

@@ -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-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

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 { aL as ElysiaType, aK as ElysiaTypeOptions, aM as TCookie, aJ as t } from './dynamic-handle-BmhbbEgE.js';
import 'bun';

@@ -5,0 +5,0 @@ export { TypeSystem, TypeSystemDuplicateFormat, TypeSystemDuplicateTypeKind, TypeSystemPolicy } from '@sinclair/typebox/system';

@@ -54,7 +54,5 @@ "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"));

@@ -133,2 +131,4 @@ // src/handler.ts

} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value3.Value.Errors(validator, value)];
message = JSON.stringify(

@@ -139,8 +139,5 @@ {

message: error2?.message,
expected: import_value3.Value.Create(
// @ts-ignore private field
validator.schema
),
expected: import_value3.Value.Create(schema),
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -322,24 +319,39 @@ null,

},
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))

@@ -346,0 +358,0 @@ return value;

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

@@ -3,0 +3,0 @@ import '@sinclair/typebox';

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 { aB as HTTPStatusName, aA as StatusMap, ay as asGlobal, ax as asGlobalHook, au as checksum, aF as createMacroManager, az as filterGlobalHook, av as getCookieValidator, at as getResponseSchemaValidator, as as getSchemaValidator, aG as isNumericString, ao as mergeCookie, an as mergeDeep, ar as mergeHook, aw as mergeLifeCycle, ap as mergeObjectArray, aq as primitiveHooks, am as replaceUrlPath, aC as signCookie, aE as traceBackMacro, aD as unsignCookie } from './dynamic-handle-BmhbbEgE.js';
import 'bun';

@@ -5,0 +5,0 @@ import 'memoirist';

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

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

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

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

@@ -86,2 +86,4 @@ // src/index.ts

} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value.Value.Errors(validator, value)];
message = JSON.stringify(

@@ -92,8 +94,5 @@ {

message: error2?.message,
expected: import_value.Value.Create(
// @ts-ignore private field
validator.schema
),
expected: import_value.Value.Create(schema),
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -137,5 +136,2 @@ null,

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

@@ -308,24 +304,39 @@ var import_cookie2 = require("cookie");

},
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))

@@ -375,6 +386,30 @@ return value;

};
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 = (item2) => item2 && typeof item2 === "object" && !Array.isArray(item2);
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);
};

@@ -442,3 +477,3 @@ var mergeObjectArray = (a = [], b = []) => {

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

@@ -659,7 +694,8 @@ b?.detail ?? {},

if (typeof fn === "function") {
return fn.$elysiaHookType === "global" && x.$elysiaScoped !== true ? fn : void 0;
return fn.$elysiaHookType === "global" && x.$elysiaGlobal === true ? fn : void 0;
}
const array = [];
if (!Array.isArray(fn)) {
if (fn.$elysiaHookType === "global" && fn.$elysiaScoped !== true)
const f = fn;
if (f.$elysiaHookType === "global" && f.$elysiaGlobal === true)
return fn;

@@ -669,3 +705,3 @@ return [];

for (const x2 of fn)
if (x2.$elysiaHookType === "global" && x2.$elysiaScoped !== true)
if (x2.$elysiaHookType === "global" && x2.$elysiaGlobal === true)
array.push(x2);

@@ -879,2 +915,3 @@ return array;

mergeCookie,
mergeDeep,
mergeHook,

@@ -881,0 +918,0 @@ mergeLifeCycle,

import 'bun';
import '@sinclair/typebox';
import '@sinclair/typebox/compiler';
export { aK as ElysiaWS, aJ as websocket } from '../dynamic-handle-BOErSqze.js';
export { aO as ElysiaWS, aN as websocket } from '../dynamic-handle-BmhbbEgE.js';
import 'memoirist';

@@ -6,0 +6,0 @@ import 'openapi-types';

@@ -45,7 +45,5 @@ "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"));

@@ -214,24 +212,39 @@ // src/handler.ts

},
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))

@@ -326,2 +339,4 @@ return value;

} else {
const schema = validator?.schema ?? validator;
const errors = "Errors" in validator ? [...validator.Errors(value)] : [...import_value4.Value.Errors(validator, value)];
message = JSON.stringify(

@@ -332,8 +347,5 @@ {

message: error2?.message,
expected: import_value4.Value.Create(
// @ts-ignore private field
validator.schema
),
expected: import_value4.Value.Create(schema),
found: value,
errors: [...validator.Errors(value)]
errors
},

@@ -340,0 +352,0 @@ null,

import 'bun';
import '@sinclair/typebox';
import '@sinclair/typebox/compiler';
export { aL as WS } from '../dynamic-handle-BOErSqze.js';
export { aP as WS } from '../dynamic-handle-BmhbbEgE.js';
import 'memoirist';

@@ -6,0 +6,0 @@ import 'openapi-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-BmhbbEgE.js';
import { TAnySchema } from '@sinclair/typebox';

@@ -3,0 +3,0 @@ import { Sucrose } from './sucrose.js';

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

export { aD as Context, aE as PreContext } from './dynamic-handle-BOErSqze.js';
export { aH as Context, aI as PreContext } from './dynamic-handle-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

@@ -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-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

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

export { aT as DynamicHandler, aV as createDynamicErrorHandler, aU as createDynamicHandler } from './dynamic-handle-BOErSqze.js';
export { aX as DynamicHandler, aZ as createDynamicErrorHandler, aY as createDynamicHandler } from './dynamic-handle-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

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';
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-BmhbbEgE.js';
import 'bun';

@@ -5,0 +5,0 @@ import 'memoirist';

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

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';
export { aW as errorToResponse, aQ as isNotEmpty, aV as mapCompactResponse, aU as mapEarlyResponse, aT as mapResponse, aR as parseSetCookies, aS as serializeCookie } from './dynamic-handle-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

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 { Q as AfterHandler, a0 as BodyHandler, ad as Checksum, C as ComposedHandler, aH as Context, e as Cookie, c as CookieOptions, D as DefinitionBase, E as Elysia, m as ElysiaConfig, a3 as ErrorHandler, A as HTTPMethod, H as Handler, B as InputSchema, a7 as InternalRoute, I as InternalServerError, l as InvalidCookieSignature, y as LifeCycleEvent, L as LifeCycleStore, a8 as ListenCallback, a6 as LocalHook, n as MaybePromise, F as MergeSchema, N as NotFoundError, K as OptionalHandler, P as ParseError, aI as PreContext, a1 as PreHandler, t as RouteBase, v as RouteSchema, S as SchemaValidator, s as SingletonBase, Z as TraceEvent, T as TraceHandler, _ as TraceProcess, a as TraceReporter, b as TraceStream, w as UnwrapRoute, U as UnwrapSchema, V as ValidationError, X as VoidHandler, E as default, k as error, at as getResponseSchemaValidator, as as getSchemaValidator, aV as mapCompactResponse, aU as mapEarlyResponse, aT as mapResponse, ar as mergeHook, ap as mergeObjectArray, aJ as t } from './dynamic-handle-BmhbbEgE.js';
import '@sinclair/typebox/compiler';

@@ -6,0 +6,0 @@ import 'openapi-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-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

@@ -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-BmhbbEgE.js';
import 'bun';

@@ -3,0 +3,0 @@ import 'memoirist';

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 { aL as ElysiaType, aK as ElysiaTypeOptions, aM as TCookie, aJ as t } from './dynamic-handle-BmhbbEgE.js';
import 'bun';

@@ -5,0 +5,0 @@ export { TypeSystem, TypeSystemDuplicateFormat, TypeSystemDuplicateTypeKind, TypeSystemPolicy } from '@sinclair/typebox/system';

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

@@ -3,0 +3,0 @@ import '@sinclair/typebox';

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 { aB as HTTPStatusName, aA as StatusMap, ay as asGlobal, ax as asGlobalHook, au as checksum, aF as createMacroManager, az as filterGlobalHook, av as getCookieValidator, at as getResponseSchemaValidator, as as getSchemaValidator, aG as isNumericString, ao as mergeCookie, an as mergeDeep, ar as mergeHook, aw as mergeLifeCycle, ap as mergeObjectArray, aq as primitiveHooks, am as replaceUrlPath, aC as signCookie, aE as traceBackMacro, aD as unsignCookie } from './dynamic-handle-BmhbbEgE.js';
import 'bun';

@@ -5,0 +5,0 @@ import 'memoirist';

import 'bun';
import '@sinclair/typebox';
import '@sinclair/typebox/compiler';
export { aK as ElysiaWS, aJ as websocket } from '../dynamic-handle-BOErSqze.js';
export { aO as ElysiaWS, aN as websocket } from '../dynamic-handle-BmhbbEgE.js';
import 'memoirist';

@@ -6,0 +6,0 @@ import 'openapi-types';

import 'bun';
import '@sinclair/typebox';
import '@sinclair/typebox/compiler';
export { aL as WS } from '../dynamic-handle-BOErSqze.js';
export { aP as WS } from '../dynamic-handle-BmhbbEgE.js';
import 'memoirist';

@@ -6,0 +6,0 @@ import 'openapi-types';

{
"name": "elysia",
"description": "Ergonomic Framework for Human",
"version": "1.0.0-exp.14",
"version": "1.0.0-rc.0",
"author": {

@@ -112,3 +112,2 @@ "name": "saltyAom",

"cookie": "^0.6.0",
"deepmerge": "^4.3.1",
"eventemitter3": "^5.0.1",

@@ -123,3 +122,2 @@ "fast-decode-uri-component": "^1.0.1",

"@types/cookie": "^0.6.0",
"@types/is-even": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^6.17.0",

@@ -126,0 +124,0 @@ "@typescript-eslint/parser": "^6.17.0",

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc