@cudenix/cudenix 0.0.1 → 0.0.2
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/app.d.ts +6 -6
- package/dist/app.js +6 -6
- package/dist/context.d.ts +3 -3
- package/dist/context.js +3 -3
- package/dist/ecosystem/client/client.d.ts +4 -4
- package/dist/ecosystem/client/client.js +4 -4
- package/dist/ecosystem/client/index.d.ts +1 -3
- package/dist/ecosystem/client/index.d.ts.map +1 -1
- package/dist/ecosystem/client/index.js +1 -3
- package/dist/ecosystem/client/index.js.map +1 -1
- package/dist/ecosystem/client/ws.js +1 -1
- package/dist/ecosystem/cluster/cluster.d.ts +1 -1
- package/dist/ecosystem/cluster/index.d.ts +1 -1
- package/dist/ecosystem/cluster/index.js +1 -1
- package/dist/ecosystem/events/index.d.ts +1 -1
- package/dist/ecosystem/events/index.js +1 -1
- package/dist/ecosystem/i18n/i18n.d.ts +2 -2
- package/dist/ecosystem/i18n/i18n.js +4 -4
- package/dist/ecosystem/i18n/index.d.ts +1 -1
- package/dist/ecosystem/i18n/index.js +1 -1
- package/dist/error.d.ts +1 -1
- package/dist/group.d.ts +1 -1
- package/dist/group.js +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.js +11 -11
- package/dist/middleware.d.ts +4 -4
- package/dist/module.d.ts +9 -9
- package/dist/module.js +6 -6
- package/dist/route.d.ts +5 -5
- package/dist/route.js +2 -2
- package/dist/storage.d.ts +1 -1
- package/dist/store.d.ts +2 -2
- package/dist/success.d.ts +1 -1
- package/dist/types/conditionally-omit.d.ts +1 -1
- package/dist/types/generator-sse.d.ts +2 -2
- package/dist/types/index.d.ts +13 -13
- package/dist/utils/get-cookies.js +1 -1
- package/dist/validator.d.ts +3 -3
- package/package.json +1 -1
package/dist/app.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Server, TLSServeOptions } from "bun";
|
|
2
|
-
import { Context } from "./context";
|
|
3
|
-
import type { AnyMiddleware } from "./middleware";
|
|
4
|
-
import { type AnyModule } from "./module";
|
|
5
|
-
import type { AnyRoute } from "./route";
|
|
6
|
-
import type { AnyStore } from "./store";
|
|
7
|
-
import type { AnyValidator, validatorConfig } from "./validator";
|
|
2
|
+
import { Context } from "./context.js";
|
|
3
|
+
import type { AnyMiddleware } from "./middleware.js";
|
|
4
|
+
import { type AnyModule } from "./module.js";
|
|
5
|
+
import type { AnyRoute } from "./route.js";
|
|
6
|
+
import type { AnyStore } from "./store.js";
|
|
7
|
+
import type { AnyValidator, validatorConfig } from "./validator.js";
|
|
8
8
|
type Addon = (...options: any[]) => string;
|
|
9
9
|
type Chain = (AnyMiddleware | AnyRoute | AnyStore | AnyValidator)[];
|
|
10
10
|
type Config = ReturnType<typeof validatorConfig>;
|
package/dist/app.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Context } from "./context";
|
|
2
|
-
import { Error } from "./error";
|
|
3
|
-
import { Module } from "./module";
|
|
4
|
-
import { asyncLocalStorage } from "./storage";
|
|
5
|
-
import { merge } from "./utils/merge";
|
|
6
|
-
import { pathToRegexp, useContextBodyRegexp, useContextCookiesRegexp, useContextHeadersRegexp, useContextParamsRegexp, useContextQueryRegexp, } from "./utils/regexp";
|
|
1
|
+
import { Context } from "./context.js";
|
|
2
|
+
import { Error } from "./error.js";
|
|
3
|
+
import { Module } from "./module.js";
|
|
4
|
+
import { asyncLocalStorage } from "./storage.js";
|
|
5
|
+
import { merge } from "./utils/merge.js";
|
|
6
|
+
import { pathToRegexp, useContextBodyRegexp, useContextCookiesRegexp, useContextHeadersRegexp, useContextParamsRegexp, useContextQueryRegexp, } from "./utils/regexp.js";
|
|
7
7
|
const App = function (module) {
|
|
8
8
|
this.endpoints = new Map();
|
|
9
9
|
this.memory = new Map();
|
package/dist/context.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Server } from "bun";
|
|
2
|
-
import type { Endpoint } from "./app";
|
|
3
|
-
import type { AnyError } from "./error";
|
|
4
|
-
import type { AnySuccess } from "./success";
|
|
2
|
+
import type { Endpoint } from "./app.js";
|
|
3
|
+
import type { AnyError } from "./error.js";
|
|
4
|
+
import type { AnySuccess } from "./success.js";
|
|
5
5
|
export interface DeveloperContext<Stores extends Record<PropertyKey, unknown>, Validators extends Record<PropertyKey, unknown>> {
|
|
6
6
|
memory: Map<string, unknown>;
|
|
7
7
|
request: {
|
package/dist/context.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Empty } from "./utils/empty";
|
|
2
|
-
import { getCookies } from "./utils/get-cookies";
|
|
3
|
-
import { getUrlQueryRegexp, pathToRegexp } from "./utils/regexp";
|
|
1
|
+
import { Empty } from "./utils/empty.js";
|
|
2
|
+
import { getCookies } from "./utils/get-cookies.js";
|
|
3
|
+
import { getUrlQueryRegexp, pathToRegexp } from "./utils/regexp.js";
|
|
4
4
|
export const Context = function (endpoint, memory, path, request, server) {
|
|
5
5
|
this.endpoint = endpoint;
|
|
6
6
|
this.memory = memory;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { SSE } from "../../ecosystem/client/sse";
|
|
2
|
-
import type { WS } from "../../ecosystem/client/ws";
|
|
3
|
-
import type { AnyModule } from "../../module";
|
|
4
|
-
import type { ConditionallyOptional, GeneratorSSE, Merge } from "../../types";
|
|
1
|
+
import type { SSE } from "../../ecosystem/client/sse.js";
|
|
2
|
+
import type { WS } from "../../ecosystem/client/ws.js";
|
|
3
|
+
import type { AnyModule } from "../../module.js";
|
|
4
|
+
import type { ConditionallyOptional, GeneratorSSE, Merge } from "../../types/index.js";
|
|
5
5
|
type RequestOptions<Request> = Merge<Omit<RequestInit, "method"> & {
|
|
6
6
|
headers?: Record<string, string | readonly string[]>;
|
|
7
7
|
}, Request extends Record<PropertyKey, unknown> ? ConditionallyOptional<Request, undefined> : NonNullable<unknown>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Empty } from "../../utils/empty";
|
|
2
|
-
import { isFile } from "../../utils/file";
|
|
1
|
+
import { Empty } from "../../utils/empty.js";
|
|
2
|
+
import { isFile } from "../../utils/file.js";
|
|
3
3
|
const transform = (value) => {
|
|
4
4
|
try {
|
|
5
5
|
return JSON.parse(value);
|
|
@@ -105,7 +105,7 @@ const createProxy = (url, options = new Empty(), paths = []) => {
|
|
|
105
105
|
_url = _url.startsWith("https://")
|
|
106
106
|
? _url.replace("https://", "wss://")
|
|
107
107
|
: _url.replace("http://", "ws://");
|
|
108
|
-
return (await import("../../ecosystem/client/ws")).ws(_url);
|
|
108
|
+
return (await import("../../ecosystem/client/ws.js")).ws(_url);
|
|
109
109
|
}
|
|
110
110
|
const response = await fetch(_url, mergedOptions);
|
|
111
111
|
const contentType = response.headers
|
|
@@ -116,7 +116,7 @@ const createProxy = (url, options = new Empty(), paths = []) => {
|
|
|
116
116
|
return await response.json();
|
|
117
117
|
}
|
|
118
118
|
if (contentType === "text/event-stream") {
|
|
119
|
-
return (await import("../../ecosystem/client/sse")).sse(response.url, {
|
|
119
|
+
return (await import("../../ecosystem/client/sse.js")).sse(response.url, {
|
|
120
120
|
withCredentials: true,
|
|
121
121
|
});
|
|
122
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ecosystem/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ecosystem/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ecosystem/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ecosystem/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "../../ecosystem/cluster/cluster";
|
|
1
|
+
export * from "../../ecosystem/cluster/cluster.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "../../ecosystem/cluster/cluster";
|
|
1
|
+
export * from "../../ecosystem/cluster/cluster.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "../../ecosystem/events/events";
|
|
1
|
+
export * from "../../ecosystem/events/events.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "../../ecosystem/events/events";
|
|
1
|
+
export * from "../../ecosystem/events/events.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { App } from "../../app";
|
|
1
|
+
import type { App } from "../../app.js";
|
|
2
2
|
import type { I18nTranslations } from "@cudenix/cudenix/i18n";
|
|
3
3
|
interface Translation {
|
|
4
4
|
[key: string]: string | Translation | (string | Translation)[];
|
|
@@ -15,7 +15,7 @@ interface I18nAddonOptions extends Pick<I18n, "cookie" | "header"> {
|
|
|
15
15
|
watch?: boolean;
|
|
16
16
|
}
|
|
17
17
|
export declare function i18nAddon(path: string, language: string, options?: I18nAddonOptions): (this: App) => string;
|
|
18
|
-
export declare const i18nModule: () => Promise<import("../../module").Module<import("
|
|
18
|
+
export declare const i18nModule: () => Promise<import("../../module.js").Module<import("../../index.js").MergeErrors<{}, import("../../index.js").TransformError<never>>, "/", {}, {}, import("../../index.js").MergeSuccesses<{}, import("../../index.js").TransformSuccess<never>>, {
|
|
19
19
|
inputs: NonNullable<unknown>;
|
|
20
20
|
outputs: NonNullable<unknown>;
|
|
21
21
|
}>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync, readdirSync, watch, writeFileSync } from "node:fs";
|
|
2
|
-
import { getRequestContext } from "../../storage";
|
|
3
|
-
import { Empty } from "../../utils/empty";
|
|
4
|
-
import { getCookies } from "../../utils/get-cookies";
|
|
2
|
+
import { getRequestContext } from "../../storage.js";
|
|
3
|
+
import { Empty } from "../../utils/empty.js";
|
|
4
|
+
import { getCookies } from "../../utils/get-cookies.js";
|
|
5
5
|
const loadTranslation = (path, language) => {
|
|
6
6
|
return JSON.parse(readFileSync(`${path}/${language}/${language}.json`, "utf8"));
|
|
7
7
|
};
|
|
@@ -61,7 +61,7 @@ export function i18nAddon(path, language, options) {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
export const i18nModule = async () => {
|
|
64
|
-
const module = (await import("../../module")).module;
|
|
64
|
+
const module = (await import("../../module.js")).module;
|
|
65
65
|
return module().middleware((context, next) => {
|
|
66
66
|
const i18n = context.memory.get("i18n");
|
|
67
67
|
if (!i18n) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "../../ecosystem/i18n/i18n";
|
|
1
|
+
export * from "../../ecosystem/i18n/i18n.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "../../ecosystem/i18n/i18n";
|
|
1
|
+
export * from "../../ecosystem/i18n/i18n.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/error.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtractContent } from "./types";
|
|
1
|
+
import type { ExtractContent } from "./types/index.js";
|
|
2
2
|
export type FilterError<Type> = Extract<Type, AnyError>;
|
|
3
3
|
export type IgnoreError<Type> = Exclude<Type, AnyError>;
|
|
4
4
|
export type TransformError<Error extends AnyError> = {
|
package/dist/group.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyModule } from "./module";
|
|
1
|
+
import type { AnyModule } from "./module.js";
|
|
2
2
|
export type GroupFn<Module extends AnyModule, Return extends AnyModule> = (module: Module) => Return;
|
|
3
3
|
export type AnyGroupFn = GroupFn<any, any>;
|
|
4
4
|
export interface Group<Module extends AnyModule, Prefix extends `/${string}`, Return extends AnyModule> {
|
package/dist/group.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from "./app";
|
|
2
|
-
export * from "./context";
|
|
3
|
-
export * from "./error";
|
|
4
|
-
export * from "./group";
|
|
5
|
-
export * from "./middleware";
|
|
6
|
-
export * from "./module";
|
|
7
|
-
export * from "./route";
|
|
8
|
-
export * from "./storage";
|
|
9
|
-
export * from "./store";
|
|
10
|
-
export * from "./success";
|
|
11
|
-
export type * from "./types";
|
|
12
|
-
export * from "./validator";
|
|
1
|
+
export * from "./app.js";
|
|
2
|
+
export * from "./context.js";
|
|
3
|
+
export * from "./error.js";
|
|
4
|
+
export * from "./group.js";
|
|
5
|
+
export * from "./middleware.js";
|
|
6
|
+
export * from "./module.js";
|
|
7
|
+
export * from "./route.js";
|
|
8
|
+
export * from "./storage.js";
|
|
9
|
+
export * from "./store.js";
|
|
10
|
+
export * from "./success.js";
|
|
11
|
+
export type * from "./types/index.js";
|
|
12
|
+
export * from "./validator.js";
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from "./app";
|
|
2
|
-
export * from "./context";
|
|
3
|
-
export * from "./error";
|
|
4
|
-
export * from "./group";
|
|
5
|
-
export * from "./middleware";
|
|
6
|
-
export * from "./module";
|
|
7
|
-
export * from "./route";
|
|
8
|
-
export * from "./storage";
|
|
9
|
-
export * from "./store";
|
|
10
|
-
export * from "./success";
|
|
11
|
-
export * from "./validator";
|
|
1
|
+
export * from "./app.js";
|
|
2
|
+
export * from "./context.js";
|
|
3
|
+
export * from "./error.js";
|
|
4
|
+
export * from "./group.js";
|
|
5
|
+
export * from "./middleware.js";
|
|
6
|
+
export * from "./module.js";
|
|
7
|
+
export * from "./route.js";
|
|
8
|
+
export * from "./storage.js";
|
|
9
|
+
export * from "./store.js";
|
|
10
|
+
export * from "./success.js";
|
|
11
|
+
export * from "./validator.js";
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/dist/middleware.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { DeveloperContext } from "./context";
|
|
2
|
-
import type { AnyError } from "./error";
|
|
3
|
-
import type { AnySuccess } from "./success";
|
|
4
|
-
import type { MaybePromise } from "./types";
|
|
1
|
+
import type { DeveloperContext } from "./context.js";
|
|
2
|
+
import type { AnyError } from "./error.js";
|
|
3
|
+
import type { AnySuccess } from "./success.js";
|
|
4
|
+
import type { MaybePromise } from "./types/index.js";
|
|
5
5
|
export type MiddlewareFn<Return extends MaybePromise<AnyError | AnySuccess | void>, Stores extends Record<PropertyKey, unknown>, Validators extends Record<PropertyKey, unknown>> = (context: DeveloperContext<Stores, Validators>, next: () => Promise<void>) => Return;
|
|
6
6
|
export type AnyMiddlewareFn = MiddlewareFn<any, any, any>;
|
|
7
7
|
export interface Middleware<Return extends MaybePromise<AnyError | AnySuccess | void>, Stores extends Record<PropertyKey, unknown>, Validators extends Record<PropertyKey, unknown>> {
|
package/dist/module.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { DeveloperContext } from "./context";
|
|
2
|
-
import type { AnyError, FilterError, IgnoreError, MergeErrors, TransformError } from "./error";
|
|
3
|
-
import { type AnyGroup, type GroupFn, type GroupOptions } from "./group";
|
|
4
|
-
import { type AnyMiddleware, type MiddlewareFn } from "./middleware";
|
|
5
|
-
import { type AnyRoute, type ParseRoute, type PathToObject, type RouteFn, type RouteFnReturnGenerator, type RouteFnReturnWS, type RouteOptions } from "./route";
|
|
6
|
-
import { type AnyStore, type StoreFn } from "./store";
|
|
7
|
-
import type { AnySuccess, FilterSuccess, MergeSuccesses, TransformSuccess } from "./success";
|
|
8
|
-
import type { ConditionallyOmit, ExtendsType, ExtractUrlParams, HttpMethod, MaybePromise, MergePaths, RequiredKeys, ValueOf } from "./types";
|
|
9
|
-
import { type AnyValidator, type DeepInferValidatorError, type DeepInferValidatorInput, type DeepInferValidatorOutput, type MergeInferValidatorRequest, type TransformValidatorError, type ValidatorOptions, type ValidatorRequest } from "./validator";
|
|
1
|
+
import type { DeveloperContext } from "./context.js";
|
|
2
|
+
import type { AnyError, FilterError, IgnoreError, MergeErrors, TransformError } from "./error.js";
|
|
3
|
+
import { type AnyGroup, type GroupFn, type GroupOptions } from "./group.js";
|
|
4
|
+
import { type AnyMiddleware, type MiddlewareFn } from "./middleware.js";
|
|
5
|
+
import { type AnyRoute, type ParseRoute, type PathToObject, type RouteFn, type RouteFnReturnGenerator, type RouteFnReturnWS, type RouteOptions } from "./route.js";
|
|
6
|
+
import { type AnyStore, type StoreFn } from "./store.js";
|
|
7
|
+
import type { AnySuccess, FilterSuccess, MergeSuccesses, TransformSuccess } from "./success.js";
|
|
8
|
+
import type { ConditionallyOmit, ExtendsType, ExtractUrlParams, HttpMethod, MaybePromise, MergePaths, RequiredKeys, ValueOf } from "./types/index.js";
|
|
9
|
+
import { type AnyValidator, type DeepInferValidatorError, type DeepInferValidatorInput, type DeepInferValidatorOutput, type MergeInferValidatorRequest, type TransformValidatorError, type ValidatorOptions, type ValidatorRequest } from "./validator.js";
|
|
10
10
|
export type ModuleChain = (AnyGroup | AnyMiddleware | AnyModule | AnyRoute | AnyStore | AnyValidator)[];
|
|
11
11
|
export interface Module<Errors extends Record<PropertyKey, unknown>, Prefix extends `/${string}`, Routes extends Record<PropertyKey, unknown>, Stores extends Record<PropertyKey, unknown>, Successes extends Record<PropertyKey, unknown>, Validators extends {
|
|
12
12
|
inputs: Record<PropertyKey, unknown>;
|
package/dist/module.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Group, } from "./group";
|
|
2
|
-
import { Middleware, } from "./middleware";
|
|
3
|
-
import { Route, } from "./route";
|
|
4
|
-
import { Store } from "./store";
|
|
5
|
-
import { Empty } from "./utils/empty";
|
|
6
|
-
import { Validator, } from "./validator";
|
|
1
|
+
import { Group, } from "./group.js";
|
|
2
|
+
import { Middleware, } from "./middleware.js";
|
|
3
|
+
import { Route, } from "./route.js";
|
|
4
|
+
import { Store } from "./store.js";
|
|
5
|
+
import { Empty } from "./utils/empty.js";
|
|
6
|
+
import { Validator, } from "./validator.js";
|
|
7
7
|
export const Module = function ({ prefix } = new Empty()) {
|
|
8
8
|
this.chain = [];
|
|
9
9
|
this.prefix = prefix ?? "";
|
package/dist/route.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { WebSocketHandler } from "bun";
|
|
2
|
-
import type { DeveloperContext } from "./context";
|
|
3
|
-
import type { AnyError } from "./error";
|
|
4
|
-
import type { AnySuccess } from "./success";
|
|
5
|
-
import type { ConditionallyOmit, ExtendsType, ExtractUrlParams, GeneratorSSE, HttpMethod, MaybePromise } from "./types";
|
|
6
|
-
import { type AnyValidator, type DeepInferValidatorOutput, type MergeInferValidatorRequest, type ValidatorOptions, type ValidatorRequest } from "./validator";
|
|
2
|
+
import type { DeveloperContext } from "./context.js";
|
|
3
|
+
import type { AnyError } from "./error.js";
|
|
4
|
+
import type { AnySuccess } from "./success.js";
|
|
5
|
+
import type { ConditionallyOmit, ExtendsType, ExtractUrlParams, GeneratorSSE, HttpMethod, MaybePromise } from "./types/index.js";
|
|
6
|
+
import { type AnyValidator, type DeepInferValidatorOutput, type MergeInferValidatorRequest, type ValidatorOptions, type ValidatorRequest } from "./validator.js";
|
|
7
7
|
export type PathToObject<Path extends string, Value> = Path extends `${infer First}/${infer Rest}` ? {
|
|
8
8
|
[Key in First]: PathToObject<Rest, Value>;
|
|
9
9
|
} : {
|
package/dist/route.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Empty } from "./utils/empty";
|
|
2
|
-
import { Validator, } from "./validator";
|
|
1
|
+
import { Empty } from "./utils/empty.js";
|
|
2
|
+
import { Validator, } from "./validator.js";
|
|
3
3
|
export const Route = function (method, path, route, { validator } = new Empty()) {
|
|
4
4
|
this.method = method;
|
|
5
5
|
this.path = path;
|
package/dist/storage.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
-
import type { Context } from "./context";
|
|
2
|
+
import type { Context } from "./context.js";
|
|
3
3
|
export declare const asyncLocalStorage: AsyncLocalStorage<Context>;
|
|
4
4
|
export declare const getRequestContext: () => Context | undefined;
|
|
5
5
|
//# sourceMappingURL=storage.d.ts.map
|
package/dist/store.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DeveloperContext } from "./context";
|
|
2
|
-
import type { AnyError } from "./error";
|
|
1
|
+
import type { DeveloperContext } from "./context.js";
|
|
2
|
+
import type { AnyError } from "./error.js";
|
|
3
3
|
export type StoreFn<Return extends Record<PropertyKey, unknown> | AnyError, Stores extends Record<PropertyKey, unknown>, Validators extends Record<PropertyKey, unknown>> = (context: DeveloperContext<Stores, Validators>) => Return | Promise<Return>;
|
|
4
4
|
export type AnyStoreFn = StoreFn<any, any, any>;
|
|
5
5
|
export interface Store<Return extends Record<PropertyKey, unknown> | AnyError, Stores extends Record<PropertyKey, unknown>, Validators extends Record<PropertyKey, unknown>> {
|
package/dist/success.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnyError } from "../error";
|
|
2
|
-
import type { AnySuccess } from "../success";
|
|
1
|
+
import type { AnyError } from "../error.js";
|
|
2
|
+
import type { AnySuccess } from "../success.js";
|
|
3
3
|
export interface GeneratorSSE<Data extends AnyError | AnySuccess> {
|
|
4
4
|
data: Data;
|
|
5
5
|
event?: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export type * from "../types/conditionally-omit";
|
|
2
|
-
export type * from "../types/conditionally-optional";
|
|
3
|
-
export type * from "../types/extends-type";
|
|
4
|
-
export type * from "../types/extract-content";
|
|
5
|
-
export type * from "../types/extract-url-params";
|
|
6
|
-
export type * from "../types/generator-sse";
|
|
7
|
-
export type * from "../types/http-method";
|
|
8
|
-
export type * from "../types/maybe-promise";
|
|
9
|
-
export type * from "../types/merge";
|
|
10
|
-
export type * from "../types/merge-paths";
|
|
11
|
-
export type * from "../types/required-keys";
|
|
12
|
-
export type * from "../types/value-of";
|
|
13
|
-
export type * from "../types/ws";
|
|
1
|
+
export type * from "../types/conditionally-omit.js";
|
|
2
|
+
export type * from "../types/conditionally-optional.js";
|
|
3
|
+
export type * from "../types/extends-type.js";
|
|
4
|
+
export type * from "../types/extract-content.js";
|
|
5
|
+
export type * from "../types/extract-url-params.js";
|
|
6
|
+
export type * from "../types/generator-sse.js";
|
|
7
|
+
export type * from "../types/http-method.js";
|
|
8
|
+
export type * from "../types/maybe-promise.js";
|
|
9
|
+
export type * from "../types/merge.js";
|
|
10
|
+
export type * from "../types/merge-paths.js";
|
|
11
|
+
export type * from "../types/required-keys.js";
|
|
12
|
+
export type * from "../types/value-of.js";
|
|
13
|
+
export type * from "../types/ws.js";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/validator.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { App } from "./app";
|
|
2
|
-
import type { Error } from "./error";
|
|
3
|
-
import type { ConditionallyOmit, ExtendsType, MaybePromise } from "./types";
|
|
1
|
+
import type { App } from "./app.js";
|
|
2
|
+
import type { Error } from "./error.js";
|
|
3
|
+
import type { ConditionallyOmit, ExtendsType, MaybePromise } from "./types/index.js";
|
|
4
4
|
import type { InferValidatorError, InferValidatorInput, InferValidatorOutput } from "@cudenix/cudenix";
|
|
5
5
|
export type ValidatorConfigValidator = (schema: any, input: unknown, type: keyof ValidatorRequest) => MaybePromise<{
|
|
6
6
|
content: unknown;
|
package/package.json
CHANGED