elysia 2.0.0-beta.30 → 2.0.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.d.ts +145 -92
- package/dist/base.js +2 -1
- package/dist/base.mjs +2 -1
- package/dist/compile/aot-capture.js +1 -1
- package/dist/compile/aot-capture.mjs +1 -1
- package/dist/compile/handler/jit.js +1 -1
- package/dist/compile/handler/jit.mjs +1 -1
- package/dist/compile/handler/params.js +1 -0
- package/dist/compile/handler/params.mjs +1 -0
- package/dist/compile/handler/utils.d.ts +1 -1
- package/dist/compile/handler/utils.js +8 -5
- package/dist/compile/handler/utils.mjs +8 -5
- package/dist/error.d.ts +2 -1
- package/dist/handler/error.d.ts +4 -1
- package/dist/handler/error.js +7 -4
- package/dist/handler/error.mjs +7 -4
- package/dist/package.js +1 -1
- package/dist/package.mjs +1 -1
- package/dist/type/bridge-live.d.ts +1 -1
- package/dist/type/bridge-live.js +1 -1
- package/dist/type/bridge-live.mjs +1 -1
- package/dist/type/bridge.d.ts +1 -1
- package/dist/type/coerce.d.ts +1 -1
- package/dist/type/typebox-value-live.d.ts +2 -2
- package/dist/type/typebox-value-live.js +2 -2
- package/dist/type/typebox-value-live.mjs +2 -2
- package/dist/type/typebox-value-ops.d.ts +2 -2
- package/dist/type/typebox-value-ops.js +2 -2
- package/dist/type/typebox-value-ops.mjs +2 -2
- package/dist/type/typebox-value.d.ts +6 -6
- package/dist/types.d.ts +270 -60
- package/dist/ws/route.js +7 -3
- package/dist/ws/route.mjs +8 -4
- package/dist/ws/types.d.ts +2 -2
- package/package.json +1 -1
package/dist/base.js
CHANGED
package/dist/base.mjs
CHANGED
|
@@ -13,8 +13,8 @@ const require_type_validator_frozen_check = require('../type/validator/frozen-ch
|
|
|
13
13
|
const require_type_validator_custom_error = require('../type/validator/custom-error.js');
|
|
14
14
|
const require_type_validator_exact_mirror = require('../type/validator/exact-mirror.js');
|
|
15
15
|
const require_type_validator_string_codec_aot = require('../type/validator/string-codec-aot.js');
|
|
16
|
-
let typebox_schema = require("typebox/schema");
|
|
17
16
|
let typebox_value = require("typebox/value");
|
|
17
|
+
let typebox_schema = require("typebox/schema");
|
|
18
18
|
|
|
19
19
|
//#region src/compile/aot-capture.ts
|
|
20
20
|
function emptyContainers(node, depth) {
|
|
@@ -12,8 +12,8 @@ import { buildFrozenCheck } from "../type/validator/frozen-check.mjs";
|
|
|
12
12
|
import { captureCustomErrors } from "../type/validator/custom-error.mjs";
|
|
13
13
|
import { getExactMirror } from "../type/validator/exact-mirror.mjs";
|
|
14
14
|
import { captureStringCodecEntries, compileWithBuild } from "../type/validator/string-codec-aot.mjs";
|
|
15
|
-
import { Build, Compile } from "typebox/schema";
|
|
16
15
|
import { Default } from "typebox/value";
|
|
16
|
+
import { Build, Compile } from "typebox/schema";
|
|
17
17
|
|
|
18
18
|
//#region src/compile/aot-capture.ts
|
|
19
19
|
function emptyContainers(node, depth) {
|
|
@@ -414,7 +414,7 @@ function compileHandlerJit(options, tailPass) {
|
|
|
414
414
|
link(hook.beforeHandle, "bf");
|
|
415
415
|
const deriveEntries = hook["~deriveEntries"];
|
|
416
416
|
const chainGuard = abortChainGuard();
|
|
417
|
-
const mapped = require_compile_handler_utils.mapBeforeHandle(hook.beforeHandle, deriveEntries, link, asyncMode, buildReport("beforeHandle"), chainGuard, arm);
|
|
417
|
+
const mapped = require_compile_handler_utils.mapBeforeHandle(hook.beforeHandle, deriveEntries, link, asyncMode, buildReport("beforeHandle"), chainGuard, arm, errorClasses);
|
|
418
418
|
code += beforeHandlePrefix ? `if(${chainGuard ? `!${chainGuard}&&` : ""}_r===undefined){\n${mapped}}\n` : mapped;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
@@ -414,7 +414,7 @@ function compileHandlerJit(options, tailPass) {
|
|
|
414
414
|
link(hook.beforeHandle, "bf");
|
|
415
415
|
const deriveEntries = hook["~deriveEntries"];
|
|
416
416
|
const chainGuard = abortChainGuard();
|
|
417
|
-
const mapped = mapBeforeHandle(hook.beforeHandle, deriveEntries, link, asyncMode, buildReport("beforeHandle"), chainGuard, arm);
|
|
417
|
+
const mapped = mapBeforeHandle(hook.beforeHandle, deriveEntries, link, asyncMode, buildReport("beforeHandle"), chainGuard, arm, errorClasses);
|
|
418
418
|
code += beforeHandlePrefix ? `if(${chainGuard ? `!${chainGuard}&&` : ""}_r===undefined){\n${mapped}}\n` : mapped;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
@@ -54,6 +54,7 @@ const handlerParams = () => _handlerParams ??= {
|
|
|
54
54
|
const classes = require_handler_utils.returnedErrorClasses(c.hook);
|
|
55
55
|
return classes ? require_handler_utils.forwardErrorOf(classes) : require_handler_utils.forwardError;
|
|
56
56
|
},
|
|
57
|
+
ec: (c) => require_handler_utils.returnedErrorClasses(c.hook),
|
|
57
58
|
fre: (c) => require_handler_utils.finalizeRouteErrorOf(c.hook),
|
|
58
59
|
fbr: () => require_handler_error.fallbackResponse,
|
|
59
60
|
aet: () => require_handler_error.adoptErrorType,
|
|
@@ -54,6 +54,7 @@ const handlerParams = () => _handlerParams ??= {
|
|
|
54
54
|
const classes = returnedErrorClasses(c.hook);
|
|
55
55
|
return classes ? forwardErrorOf(classes) : forwardError;
|
|
56
56
|
},
|
|
57
|
+
ec: (c) => returnedErrorClasses(c.hook),
|
|
57
58
|
fre: (c) => finalizeRouteErrorOf(c.hook),
|
|
58
59
|
fbr: () => fallbackResponse,
|
|
59
60
|
aet: () => adoptErrorType,
|
|
@@ -30,7 +30,7 @@ declare function deriveModes(hooks: Function[], entries?: readonly DeriveEntry[]
|
|
|
30
30
|
* their own entries joined already do
|
|
31
31
|
*/
|
|
32
32
|
declare function joinDeriveEntries(parts: readonly (Partial<AppHook> | undefined)[]): DeriveEntry[] | undefined;
|
|
33
|
-
declare function mapBeforeHandle(_hooks: AppHook['beforeHandle'] | AppHook['beforeHandle'][0], derive: readonly DeriveEntry[] | undefined, link: Link, mode: AsyncMode, report?: TraceReporter, abortGuard?: string, arm?: string): string;
|
|
33
|
+
declare function mapBeforeHandle(_hooks: AppHook['beforeHandle'] | AppHook['beforeHandle'][0], derive: readonly DeriveEntry[] | undefined, link: Link, mode: AsyncMode, report?: TraceReporter, abortGuard?: string, arm?: string, errorClasses?: Function[]): string;
|
|
34
34
|
type BeforeHandleContext = {
|
|
35
35
|
request: Request;
|
|
36
36
|
'~sig'?: AbortSignal;
|
|
@@ -203,12 +203,13 @@ function joinDeriveEntries(parts) {
|
|
|
203
203
|
}
|
|
204
204
|
if (at) return require_utils.occurrenceDeriveEntries(hooks, at);
|
|
205
205
|
}
|
|
206
|
-
function mapBeforeHandle(_hooks, derive, link, mode, report, abortGuard, arm) {
|
|
206
|
+
function mapBeforeHandle(_hooks, derive, link, mode, report, abortGuard, arm, errorClasses) {
|
|
207
207
|
const hooks = toArray(_hooks);
|
|
208
208
|
const modes = deriveModes(hooks, derive);
|
|
209
209
|
const tail = asyncTail(mode);
|
|
210
210
|
let code = "";
|
|
211
211
|
let needsEs = false;
|
|
212
|
+
const early = "if(tmp instanceof es||tmp instanceof Error" + (errorClasses ? "||ec.some((C)=>tmp instanceof C)" : "") + ")_r=tmp\n";
|
|
212
213
|
for (let i = 0; i < hooks.length; i++) {
|
|
213
214
|
const fn = hooks[i];
|
|
214
215
|
const guard = i > 0 ? `${abortGuard ? `!${abortGuard}&&` : ""}_r===undefined` : void 0;
|
|
@@ -222,18 +223,20 @@ function mapBeforeHandle(_hooks, derive, link, mode, report, abortGuard, arm) {
|
|
|
222
223
|
link(require_handler_utils.registerDeriveDisposable, "dsp");
|
|
223
224
|
if (modes[i]) {
|
|
224
225
|
link(replaceDeriveContext, "rdc");
|
|
225
|
-
code +=
|
|
226
|
+
code += early + "else if(tmp){if(typeof tmp==='object'||typeof tmp==='function'){const _pc=c;c=rdc(c,tmp);for(const _k of Reflect.ownKeys(tmp))dsp(c,c[_k],_pc)}tmp=undefined}\n";
|
|
226
227
|
} else {
|
|
227
228
|
const keys = extractDeriveKeys(fn);
|
|
228
229
|
const merge = !!keys && !!keys.length && !keys.includes("__proto__") ? keys.map((k) => `_v=tmp[${JSON.stringify(k)}];dsp(c,_v);c[${JSON.stringify(k)}]=_v`).join(";") : "if(Object.hasOwn(tmp,'__proto__')){for(const _k of Object.keys(tmp))dsp(c,tmp[_k]);Object.defineProperties(c,Object.getOwnPropertyDescriptors(tmp))}else{_v=Object.assign({},tmp);for(const _k of Reflect.ownKeys(_v)){dsp(c,_v[_k]);c[_k]=_v[_k]}}";
|
|
229
|
-
code += `if(tmp
|
|
230
|
-
else if(tmp){${merge};tmp=undefined}\n`;
|
|
230
|
+
code += early + `else if(tmp){${merge};tmp=undefined}\n`;
|
|
231
231
|
}
|
|
232
232
|
} else code += "if(tmp!==undefined)_r=tmp\n";
|
|
233
233
|
code += t.end("tmp");
|
|
234
234
|
if (tail || guard) code += "}\n";
|
|
235
235
|
}
|
|
236
|
-
if (needsEs)
|
|
236
|
+
if (needsEs) {
|
|
237
|
+
link(require_error.ElysiaStatus, "es");
|
|
238
|
+
if (errorClasses) link(errorClasses, "ec");
|
|
239
|
+
}
|
|
237
240
|
return code;
|
|
238
241
|
}
|
|
239
242
|
const compactBeforeHandleChunks = (prefix) => {
|
|
@@ -203,12 +203,13 @@ function joinDeriveEntries(parts) {
|
|
|
203
203
|
}
|
|
204
204
|
if (at) return occurrenceDeriveEntries(hooks, at);
|
|
205
205
|
}
|
|
206
|
-
function mapBeforeHandle(_hooks, derive, link, mode, report, abortGuard, arm) {
|
|
206
|
+
function mapBeforeHandle(_hooks, derive, link, mode, report, abortGuard, arm, errorClasses) {
|
|
207
207
|
const hooks = toArray(_hooks);
|
|
208
208
|
const modes = deriveModes(hooks, derive);
|
|
209
209
|
const tail = asyncTail(mode);
|
|
210
210
|
let code = "";
|
|
211
211
|
let needsEs = false;
|
|
212
|
+
const early = "if(tmp instanceof es||tmp instanceof Error" + (errorClasses ? "||ec.some((C)=>tmp instanceof C)" : "") + ")_r=tmp\n";
|
|
212
213
|
for (let i = 0; i < hooks.length; i++) {
|
|
213
214
|
const fn = hooks[i];
|
|
214
215
|
const guard = i > 0 ? `${abortGuard ? `!${abortGuard}&&` : ""}_r===undefined` : void 0;
|
|
@@ -222,18 +223,20 @@ function mapBeforeHandle(_hooks, derive, link, mode, report, abortGuard, arm) {
|
|
|
222
223
|
link(registerDeriveDisposable, "dsp");
|
|
223
224
|
if (modes[i]) {
|
|
224
225
|
link(replaceDeriveContext, "rdc");
|
|
225
|
-
code +=
|
|
226
|
+
code += early + "else if(tmp){if(typeof tmp==='object'||typeof tmp==='function'){const _pc=c;c=rdc(c,tmp);for(const _k of Reflect.ownKeys(tmp))dsp(c,c[_k],_pc)}tmp=undefined}\n";
|
|
226
227
|
} else {
|
|
227
228
|
const keys = extractDeriveKeys(fn);
|
|
228
229
|
const merge = !!keys && !!keys.length && !keys.includes("__proto__") ? keys.map((k) => `_v=tmp[${JSON.stringify(k)}];dsp(c,_v);c[${JSON.stringify(k)}]=_v`).join(";") : "if(Object.hasOwn(tmp,'__proto__')){for(const _k of Object.keys(tmp))dsp(c,tmp[_k]);Object.defineProperties(c,Object.getOwnPropertyDescriptors(tmp))}else{_v=Object.assign({},tmp);for(const _k of Reflect.ownKeys(_v)){dsp(c,_v[_k]);c[_k]=_v[_k]}}";
|
|
229
|
-
code += `if(tmp
|
|
230
|
-
else if(tmp){${merge};tmp=undefined}\n`;
|
|
230
|
+
code += early + `else if(tmp){${merge};tmp=undefined}\n`;
|
|
231
231
|
}
|
|
232
232
|
} else code += "if(tmp!==undefined)_r=tmp\n";
|
|
233
233
|
code += t.end("tmp");
|
|
234
234
|
if (tail || guard) code += "}\n";
|
|
235
235
|
}
|
|
236
|
-
if (needsEs)
|
|
236
|
+
if (needsEs) {
|
|
237
|
+
link(ElysiaStatus, "es");
|
|
238
|
+
if (errorClasses) link(errorClasses, "ec");
|
|
239
|
+
}
|
|
237
240
|
return code;
|
|
238
241
|
}
|
|
239
242
|
const compactBeforeHandleChunks = (prefix) => {
|
package/dist/error.d.ts
CHANGED
|
@@ -238,7 +238,8 @@ type TaggedHTTPError<Type extends string, Annotation = {}> = {
|
|
|
238
238
|
* Everything an owned `HTTPError` serves is an RFC 9457 problem document:
|
|
239
239
|
* `type` is the problem type carried on the wire, and the body (or the error
|
|
240
240
|
* message, when there is none) becomes `detail`, an object nested verbatim
|
|
241
|
-
* and never merged into the envelope
|
|
241
|
+
* and never merged into the envelope. Given neither, the document has no
|
|
242
|
+
* `detail`: `new OutOfCredit()` serves none, `new OutOfCredit('')` an empty one
|
|
242
243
|
*
|
|
243
244
|
* - `detail()` - the common case. Whatever it returns becomes the `detail`
|
|
244
245
|
* member of the problem document, verbatim, objects included. The envelope
|
package/dist/handler/error.d.ts
CHANGED
|
@@ -21,8 +21,11 @@ declare const resolveStatus: (status: unknown) => unknown;
|
|
|
21
21
|
* Body served by an error that carries a status but no usable body:
|
|
22
22
|
* its declared `response`, otherwise its message, or `mask` in its place
|
|
23
23
|
* on a production 5xx
|
|
24
|
+
*
|
|
25
|
+
* As a problem `detail`, an error given no message has none (`undefined`):
|
|
26
|
+
* `Error` only defines an own `message` for one passed, `''` included
|
|
24
27
|
*/
|
|
25
|
-
declare function statusFallbackBody(error: any, status: unknown, mask?: string): any;
|
|
28
|
+
declare function statusFallbackBody(error: any, status: unknown, mask?: string, asDetail?: boolean): any;
|
|
26
29
|
/**
|
|
27
30
|
* Read one annotation knob, a method (may be `async`) or a plain value.
|
|
28
31
|
* A method may have side effects, so only an error claiming a problem type
|
package/dist/handler/error.js
CHANGED
|
@@ -52,17 +52,20 @@ function fallbackResponse(context, error, mapResponse) {
|
|
|
52
52
|
return fallbackErrorResponse(context, error, mapResponse);
|
|
53
53
|
}
|
|
54
54
|
const resolveStatus = (status) => typeof status === "string" ? require_constants.StatusMap[status] ?? +status : status;
|
|
55
|
-
function statusFallbackBody(error, status, mask = "Internal Server Error") {
|
|
55
|
+
function statusFallbackBody(error, status, mask = "Internal Server Error", asDetail) {
|
|
56
56
|
const masked = require_universal_is_production.isProduction() && status >= 500;
|
|
57
57
|
const declared = error.response;
|
|
58
|
-
|
|
58
|
+
if (declared !== void 0 && !(masked && typeof declared === "object")) return declared;
|
|
59
|
+
if (masked) return mask;
|
|
60
|
+
const message = error.message ?? "";
|
|
61
|
+
return asDetail && message === "" && !Object.hasOwn(error, "message") ? void 0 : message;
|
|
59
62
|
}
|
|
60
63
|
const problemOf = (self, type, detail, status, claimsProblem) => {
|
|
61
64
|
const code = claimsProblem ? self.code : void 0;
|
|
62
65
|
return new require_error.ElysiaStatus(status, require_error.problemBody({
|
|
63
66
|
type: typeof type === "string" ? type : "about:blank",
|
|
64
67
|
...typeof code === "string" ? { code } : {},
|
|
65
|
-
detail,
|
|
68
|
+
...detail === void 0 ? {} : { detail },
|
|
66
69
|
status
|
|
67
70
|
}), { "content-type": require_error.PROBLEM_JSON });
|
|
68
71
|
};
|
|
@@ -93,7 +96,7 @@ function fallbackErrorResponse(context, error, mapResponse) {
|
|
|
93
96
|
const serveMessage = () => {
|
|
94
97
|
if (!claimsProblem) return legacy();
|
|
95
98
|
mergeHeaders();
|
|
96
|
-
return mapResponse(problemOf(self, type, statusFallbackBody(error, served, require_error.titleOf(served)), served, claimsProblem), context.set, context);
|
|
99
|
+
return mapResponse(problemOf(self, type, statusFallbackBody(error, served, require_error.titleOf(served), true), served, claimsProblem), context.set, context);
|
|
97
100
|
};
|
|
98
101
|
const serveAnnotation = (key) => {
|
|
99
102
|
let annotation;
|
package/dist/handler/error.mjs
CHANGED
|
@@ -52,17 +52,20 @@ function fallbackResponse(context, error, mapResponse) {
|
|
|
52
52
|
return fallbackErrorResponse(context, error, mapResponse);
|
|
53
53
|
}
|
|
54
54
|
const resolveStatus = (status) => typeof status === "string" ? StatusMap[status] ?? +status : status;
|
|
55
|
-
function statusFallbackBody(error, status, mask = "Internal Server Error") {
|
|
55
|
+
function statusFallbackBody(error, status, mask = "Internal Server Error", asDetail) {
|
|
56
56
|
const masked = isProduction() && status >= 500;
|
|
57
57
|
const declared = error.response;
|
|
58
|
-
|
|
58
|
+
if (declared !== void 0 && !(masked && typeof declared === "object")) return declared;
|
|
59
|
+
if (masked) return mask;
|
|
60
|
+
const message = error.message ?? "";
|
|
61
|
+
return asDetail && message === "" && !Object.hasOwn(error, "message") ? void 0 : message;
|
|
59
62
|
}
|
|
60
63
|
const problemOf = (self, type, detail, status, claimsProblem) => {
|
|
61
64
|
const code = claimsProblem ? self.code : void 0;
|
|
62
65
|
return new ElysiaStatus(status, problemBody({
|
|
63
66
|
type: typeof type === "string" ? type : "about:blank",
|
|
64
67
|
...typeof code === "string" ? { code } : {},
|
|
65
|
-
detail,
|
|
68
|
+
...detail === void 0 ? {} : { detail },
|
|
66
69
|
status
|
|
67
70
|
}), { "content-type": PROBLEM_JSON });
|
|
68
71
|
};
|
|
@@ -93,7 +96,7 @@ function fallbackErrorResponse(context, error, mapResponse) {
|
|
|
93
96
|
const serveMessage = () => {
|
|
94
97
|
if (!claimsProblem) return legacy();
|
|
95
98
|
mergeHeaders();
|
|
96
|
-
return mapResponse(problemOf(self, type, statusFallbackBody(error, served, titleOf(served)), served, claimsProblem), context.set, context);
|
|
99
|
+
return mapResponse(problemOf(self, type, statusFallbackBody(error, served, titleOf(served), true), served, claimsProblem), context.set, context);
|
|
97
100
|
};
|
|
98
101
|
const serveAnnotation = (key) => {
|
|
99
102
|
let annotation;
|
package/dist/package.js
CHANGED
package/dist/package.mjs
CHANGED
|
@@ -5,8 +5,8 @@ import { useTypebox as useTypebox$1 } from "./bridge.js";
|
|
|
5
5
|
import { TypeBoxValidatorCache, mayHaveFileType } from "./validator/validator-cache.js";
|
|
6
6
|
import { TypeBoxValidator } from "./validator/index.js";
|
|
7
7
|
import { Ref } from "typebox/type";
|
|
8
|
-
import { Check, Clone, Create, Decode, HasCodec } from "typebox/value";
|
|
9
8
|
import { Compile } from "typebox/compile";
|
|
9
|
+
import { Check, Clone, Create, Decode, HasCodec } from "typebox/value";
|
|
10
10
|
|
|
11
11
|
//#region src/type/bridge-live.d.ts
|
|
12
12
|
declare function useTypebox(_mod?: Parameters<typeof useTypebox$1>[0]): void;
|
package/dist/type/bridge-live.js
CHANGED
|
@@ -6,8 +6,8 @@ const require_type_validator_validator_cache = require('./validator/validator-ca
|
|
|
6
6
|
const require_type_validator_index = require('./validator/index.js');
|
|
7
7
|
const require_type_elysia_intersect = require('./elysia/intersect.js');
|
|
8
8
|
let typebox_type = require("typebox/type");
|
|
9
|
-
let typebox_value = require("typebox/value");
|
|
10
9
|
let typebox_compile = require("typebox/compile");
|
|
10
|
+
let typebox_value = require("typebox/value");
|
|
11
11
|
let typebox_system = require("typebox/system");
|
|
12
12
|
|
|
13
13
|
//#region src/type/bridge-live.ts
|
|
@@ -5,8 +5,8 @@ import { TypeBoxValidatorCache, mayHaveFileType } from "./validator/validator-ca
|
|
|
5
5
|
import { TypeBoxValidator } from "./validator/index.mjs";
|
|
6
6
|
import { Intersect } from "./elysia/intersect.mjs";
|
|
7
7
|
import { Ref } from "typebox/type";
|
|
8
|
-
import { Check, Clone, Create, Decode, HasCodec } from "typebox/value";
|
|
9
8
|
import { Compile } from "typebox/compile";
|
|
9
|
+
import { Check, Clone, Create, Decode, HasCodec } from "typebox/value";
|
|
10
10
|
import { Settings } from "typebox/system";
|
|
11
11
|
|
|
12
12
|
//#region src/type/bridge-live.ts
|
package/dist/type/bridge.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { hasTypes as hasTypes$1 } from "./utils.js";
|
|
|
4
4
|
import { TypeBoxValidatorCache as TypeBoxValidatorCache$1, mayHaveFileType as mayHaveFileType$1 } from "./validator/validator-cache.js";
|
|
5
5
|
import { TypeBoxValidator as TypeBoxValidator$1 } from "./validator/index.js";
|
|
6
6
|
import { Ref as Ref$1, TAny, TSchema } from "typebox/type";
|
|
7
|
-
import { Check as Check$1, Clone as Clone$1, Create as Create$1, Decode as Decode$2, HasCodec as HasCodec$1 } from "typebox/value";
|
|
8
7
|
import { Compile as Compile$1 } from "typebox/compile";
|
|
8
|
+
import { Check as Check$1, Clone as Clone$1, Create as Create$1, Decode as Decode$2, HasCodec as HasCodec$1 } from "typebox/value";
|
|
9
9
|
|
|
10
10
|
//#region src/type/bridge.d.ts
|
|
11
11
|
interface TypeboxModule {
|
package/dist/type/coerce.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ declare const coerceQuery: () => CoerceOption[];
|
|
|
30
30
|
declare const coerceBody: () => CoerceOption[];
|
|
31
31
|
declare const coerceFormData: () => CoerceOption[];
|
|
32
32
|
declare const coerceStringToStructure: () => CoerceOption[];
|
|
33
|
-
declare function applyCoercions(schema: BaseSchema | TSchema, coerces: CoerceOption[] | undefined):
|
|
33
|
+
declare function applyCoercions(schema: BaseSchema | TSchema, coerces: CoerceOption[] | undefined): TSchema | BaseSchema;
|
|
34
34
|
declare function captureCoercePlan(original: any, coerced: any): CoerceNode | null;
|
|
35
35
|
/** Full rebuild: scalar leaves + ObjectString/ArrayString sites (wired path). */
|
|
36
36
|
declare const buildCoercedFromPlan: (original: any, plan: CoerceNode, seen?: Set<string>) => any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TypeboxNamespaces } from "./typebox-value.js";
|
|
2
|
-
import { Build, Compile as SchemaCompile } from "typebox/schema";
|
|
3
|
-
import { Check, Clean, Clone, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec } from "typebox/value";
|
|
4
2
|
import { Compile } from "typebox/compile";
|
|
3
|
+
import { Check, Clean, Clone, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec } from "typebox/value";
|
|
4
|
+
import { Build, Compile as SchemaCompile } from "typebox/schema";
|
|
5
5
|
|
|
6
6
|
//#region src/type/typebox-value-live.d.ts
|
|
7
7
|
declare function injectTypebox(_typebox?: TypeboxNamespaces): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
3
|
-
let typebox_schema = require("typebox/schema");
|
|
4
|
-
let typebox_value = require("typebox/value");
|
|
5
3
|
let typebox_compile = require("typebox/compile");
|
|
4
|
+
let typebox_value = require("typebox/value");
|
|
6
5
|
let typebox_system = require("typebox/system");
|
|
6
|
+
let typebox_schema = require("typebox/schema");
|
|
7
7
|
|
|
8
8
|
//#region src/type/typebox-value-live.ts
|
|
9
9
|
typebox_system.Settings.Set({ unionPrioritySort: false });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import { Build, Compile as SchemaCompile } from "typebox/schema";
|
|
3
|
-
import { Check, Clean, Clone, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec } from "typebox/value";
|
|
4
2
|
import { Compile } from "typebox/compile";
|
|
3
|
+
import { Check, Clean, Clone, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec } from "typebox/value";
|
|
5
4
|
import { Settings } from "typebox/system";
|
|
5
|
+
import { Build, Compile as SchemaCompile } from "typebox/schema";
|
|
6
6
|
|
|
7
7
|
//#region src/type/typebox-value-live.ts
|
|
8
8
|
Settings.Set({ unionPrioritySort: false });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Build, Compile as SchemaCompile } from "typebox/schema";
|
|
2
|
-
import { Check, Clean, Clone, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec } from "typebox/value";
|
|
3
1
|
import { Compile } from "typebox/compile";
|
|
2
|
+
import { Check, Clean, Clone, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec } from "typebox/value";
|
|
3
|
+
import { Build, Compile as SchemaCompile } from "typebox/schema";
|
|
4
4
|
export { Build, Check, Clean, Clone, Compile, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec, SchemaCompile };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
3
|
-
let typebox_schema = require("typebox/schema");
|
|
4
|
-
let typebox_value = require("typebox/value");
|
|
5
3
|
let typebox_compile = require("typebox/compile");
|
|
4
|
+
let typebox_value = require("typebox/value");
|
|
5
|
+
let typebox_schema = require("typebox/schema");
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, 'Build', {
|
|
8
8
|
enumerable: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import { Build, Compile as SchemaCompile } from "typebox/schema";
|
|
3
|
-
import { Check, Clean, Clone, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec } from "typebox/value";
|
|
4
2
|
import { Compile } from "typebox/compile";
|
|
3
|
+
import { Check, Clean, Clone, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec } from "typebox/value";
|
|
4
|
+
import { Build, Compile as SchemaCompile } from "typebox/schema";
|
|
5
5
|
|
|
6
6
|
export { Build, Check, Clean, Clone, Compile, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec, SchemaCompile };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as _$
|
|
2
|
-
import {
|
|
1
|
+
import * as _$typebox_compile0 from "typebox/compile";
|
|
2
|
+
import { Compile as Compile$1 } from "typebox/compile";
|
|
3
3
|
import * as _$typebox_value0 from "typebox/value";
|
|
4
4
|
import { Check as Check$1, Clean as Clean$1, Clone as Clone$1, Create as Create$1, Decode as Decode$1, DecodeUnsafe as DecodeUnsafe$1, Default as Default$1, Encode as Encode$1, EncodeUnsafe as EncodeUnsafe$1, Errors as Errors$1, HasCodec as HasCodec$1 } from "typebox/value";
|
|
5
|
-
import * as _$
|
|
6
|
-
import { Compile as Compile$2 } from "typebox/
|
|
5
|
+
import * as _$typebox_schema0 from "typebox/schema";
|
|
6
|
+
import { Build as Build$1, Compile as Compile$2 } from "typebox/schema";
|
|
7
7
|
|
|
8
8
|
//#region src/type/typebox-value.d.ts
|
|
9
9
|
interface TypeboxNamespaces {
|
|
@@ -27,9 +27,9 @@ declare let Encode: typeof Encode$1;
|
|
|
27
27
|
declare let EncodeUnsafe: typeof EncodeUnsafe$1;
|
|
28
28
|
declare let Errors: typeof Errors$1;
|
|
29
29
|
declare let HasCodec: typeof HasCodec$1;
|
|
30
|
-
declare let SchemaCompile: typeof Compile$
|
|
30
|
+
declare let SchemaCompile: typeof Compile$2;
|
|
31
31
|
declare let Build: typeof Build$1;
|
|
32
|
-
declare let Compile: typeof Compile$
|
|
32
|
+
declare let Compile: typeof Compile$1;
|
|
33
33
|
declare function injectTypebox(typebox: TypeboxNamespaces): void;
|
|
34
34
|
//#endregion
|
|
35
35
|
export { Build, Check, Clean, Clone, Compile, Create, Decode, DecodeUnsafe, Default, Encode, EncodeUnsafe, Errors, HasCodec, SchemaCompile, TypeboxNamespaces, injectTypebox, preloadTypebox, load as warmTypebox };
|