@mionjs/router 0.8.0-alpha.0
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/cjs/index.cjs +154 -0
- package/.dist/cjs/index.cjs.map +1 -0
- package/.dist/cjs/index.d.ts +19 -0
- package/.dist/cjs/package.json +1 -0
- package/.dist/cjs/src/callContext.cjs +125 -0
- package/.dist/cjs/src/callContext.cjs.map +1 -0
- package/.dist/cjs/src/callContext.d.ts +10 -0
- package/.dist/cjs/src/constants.cjs +45 -0
- package/.dist/cjs/src/constants.cjs.map +1 -0
- package/.dist/cjs/src/constants.d.ts +10 -0
- package/.dist/cjs/src/defaultRoutes.cjs +16 -0
- package/.dist/cjs/src/defaultRoutes.cjs.map +1 -0
- package/.dist/cjs/src/defaultRoutes.d.ts +3 -0
- package/.dist/cjs/src/dispatch.cjs +141 -0
- package/.dist/cjs/src/dispatch.cjs.map +1 -0
- package/.dist/cjs/src/dispatch.d.ts +3 -0
- package/.dist/cjs/src/lib/aotCacheLoader.cjs +13 -0
- package/.dist/cjs/src/lib/aotCacheLoader.cjs.map +1 -0
- package/.dist/cjs/src/lib/aotCacheLoader.d.ts +1 -0
- package/.dist/cjs/src/lib/aotEmitter.cjs +70 -0
- package/.dist/cjs/src/lib/aotEmitter.cjs.map +1 -0
- package/.dist/cjs/src/lib/aotEmitter.d.ts +17 -0
- package/.dist/cjs/src/lib/dispatchError.cjs +39 -0
- package/.dist/cjs/src/lib/dispatchError.cjs.map +1 -0
- package/.dist/cjs/src/lib/dispatchError.d.ts +5 -0
- package/.dist/cjs/src/lib/handlers.cjs +52 -0
- package/.dist/cjs/src/lib/handlers.cjs.map +1 -0
- package/.dist/cjs/src/lib/handlers.d.ts +9 -0
- package/.dist/cjs/src/lib/headers.cjs +64 -0
- package/.dist/cjs/src/lib/headers.cjs.map +1 -0
- package/.dist/cjs/src/lib/headers.d.ts +2 -0
- package/.dist/cjs/src/lib/methodsCache.cjs +55 -0
- package/.dist/cjs/src/lib/methodsCache.cjs.map +1 -0
- package/.dist/cjs/src/lib/methodsCache.d.ts +11 -0
- package/.dist/cjs/src/lib/queryBody.cjs +34 -0
- package/.dist/cjs/src/lib/queryBody.cjs.map +1 -0
- package/.dist/cjs/src/lib/queryBody.d.ts +7 -0
- package/.dist/cjs/src/lib/reflection.cjs +342 -0
- package/.dist/cjs/src/lib/reflection.cjs.map +1 -0
- package/.dist/cjs/src/lib/reflection.d.ts +12 -0
- package/.dist/cjs/src/lib/remoteMethods.cjs +109 -0
- package/.dist/cjs/src/lib/remoteMethods.cjs.map +1 -0
- package/.dist/cjs/src/lib/remoteMethods.d.ts +10 -0
- package/.dist/cjs/src/lib/test/aotEmitter-test-router.cjs +24 -0
- package/.dist/cjs/src/lib/test/aotEmitter-test-router.cjs.map +1 -0
- package/.dist/cjs/src/lib/test/aotEmitter-test-router.d.ts +4 -0
- package/.dist/cjs/src/router.cjs +429 -0
- package/.dist/cjs/src/router.cjs.map +1 -0
- package/.dist/cjs/src/router.d.ts +30 -0
- package/.dist/cjs/src/routes/client.routes.cjs +76 -0
- package/.dist/cjs/src/routes/client.routes.cjs.map +1 -0
- package/.dist/cjs/src/routes/client.routes.d.ts +16 -0
- package/.dist/cjs/src/routes/errors.routes.cjs +49 -0
- package/.dist/cjs/src/routes/errors.routes.cjs.map +1 -0
- package/.dist/cjs/src/routes/errors.routes.d.ts +7 -0
- package/.dist/cjs/src/routes/mion.routes.cjs +13 -0
- package/.dist/cjs/src/routes/mion.routes.cjs.map +1 -0
- package/.dist/cjs/src/routes/mion.routes.d.ts +10 -0
- package/.dist/cjs/src/routes/serializer.routes.cjs +191 -0
- package/.dist/cjs/src/routes/serializer.routes.cjs.map +1 -0
- package/.dist/cjs/src/routes/serializer.routes.d.ts +9 -0
- package/.dist/cjs/src/routesFlow.cjs +227 -0
- package/.dist/cjs/src/routesFlow.cjs.map +1 -0
- package/.dist/cjs/src/routesFlow.d.ts +7 -0
- package/.dist/cjs/src/types/context.cjs +31 -0
- package/.dist/cjs/src/types/context.cjs.map +1 -0
- package/.dist/cjs/src/types/context.d.ts +57 -0
- package/.dist/cjs/src/types/definitions.cjs +15 -0
- package/.dist/cjs/src/types/definitions.cjs.map +1 -0
- package/.dist/cjs/src/types/definitions.d.ts +20 -0
- package/.dist/cjs/src/types/general.cjs +14 -0
- package/.dist/cjs/src/types/general.cjs.map +1 -0
- package/.dist/cjs/src/types/general.d.ts +27 -0
- package/.dist/cjs/src/types/guards.cjs +66 -0
- package/.dist/cjs/src/types/guards.cjs.map +1 -0
- package/.dist/cjs/src/types/guards.d.ts +17 -0
- package/.dist/cjs/src/types/handlers.cjs +13 -0
- package/.dist/cjs/src/types/handlers.cjs.map +1 -0
- package/.dist/cjs/src/types/handlers.d.ts +12 -0
- package/.dist/cjs/src/types/publicMethods.cjs +24 -0
- package/.dist/cjs/src/types/publicMethods.cjs.map +1 -0
- package/.dist/cjs/src/types/publicMethods.d.ts +45 -0
- package/.dist/cjs/src/types/remoteMethods.cjs +25 -0
- package/.dist/cjs/src/types/remoteMethods.cjs.map +1 -0
- package/.dist/cjs/src/types/remoteMethods.d.ts +44 -0
- package/.dist/esm/index.d.ts +19 -0
- package/.dist/esm/index.js +145 -0
- package/.dist/esm/index.js.map +1 -0
- package/.dist/esm/src/callContext.d.ts +10 -0
- package/.dist/esm/src/callContext.js +125 -0
- package/.dist/esm/src/callContext.js.map +1 -0
- package/.dist/esm/src/constants.d.ts +10 -0
- package/.dist/esm/src/constants.js +45 -0
- package/.dist/esm/src/constants.js.map +1 -0
- package/.dist/esm/src/defaultRoutes.d.ts +3 -0
- package/.dist/esm/src/defaultRoutes.js +16 -0
- package/.dist/esm/src/defaultRoutes.js.map +1 -0
- package/.dist/esm/src/dispatch.d.ts +3 -0
- package/.dist/esm/src/dispatch.js +141 -0
- package/.dist/esm/src/dispatch.js.map +1 -0
- package/.dist/esm/src/lib/aotCacheLoader.d.ts +1 -0
- package/.dist/esm/src/lib/aotCacheLoader.js +13 -0
- package/.dist/esm/src/lib/aotCacheLoader.js.map +1 -0
- package/.dist/esm/src/lib/aotEmitter.d.ts +17 -0
- package/.dist/esm/src/lib/aotEmitter.js +70 -0
- package/.dist/esm/src/lib/aotEmitter.js.map +1 -0
- package/.dist/esm/src/lib/dispatchError.d.ts +5 -0
- package/.dist/esm/src/lib/dispatchError.js +39 -0
- package/.dist/esm/src/lib/dispatchError.js.map +1 -0
- package/.dist/esm/src/lib/handlers.d.ts +9 -0
- package/.dist/esm/src/lib/handlers.js +52 -0
- package/.dist/esm/src/lib/handlers.js.map +1 -0
- package/.dist/esm/src/lib/headers.d.ts +2 -0
- package/.dist/esm/src/lib/headers.js +64 -0
- package/.dist/esm/src/lib/headers.js.map +1 -0
- package/.dist/esm/src/lib/methodsCache.d.ts +11 -0
- package/.dist/esm/src/lib/methodsCache.js +56 -0
- package/.dist/esm/src/lib/methodsCache.js.map +1 -0
- package/.dist/esm/src/lib/queryBody.d.ts +7 -0
- package/.dist/esm/src/lib/queryBody.js +34 -0
- package/.dist/esm/src/lib/queryBody.js.map +1 -0
- package/.dist/esm/src/lib/reflection.d.ts +12 -0
- package/.dist/esm/src/lib/reflection.js +320 -0
- package/.dist/esm/src/lib/reflection.js.map +1 -0
- package/.dist/esm/src/lib/remoteMethods.d.ts +10 -0
- package/.dist/esm/src/lib/remoteMethods.js +109 -0
- package/.dist/esm/src/lib/remoteMethods.js.map +1 -0
- package/.dist/esm/src/lib/test/aotEmitter-test-router.d.ts +4 -0
- package/.dist/esm/src/lib/test/aotEmitter-test-router.js +24 -0
- package/.dist/esm/src/lib/test/aotEmitter-test-router.js.map +1 -0
- package/.dist/esm/src/router.d.ts +30 -0
- package/.dist/esm/src/router.js +431 -0
- package/.dist/esm/src/router.js.map +1 -0
- package/.dist/esm/src/routes/client.routes.d.ts +16 -0
- package/.dist/esm/src/routes/client.routes.js +76 -0
- package/.dist/esm/src/routes/client.routes.js.map +1 -0
- package/.dist/esm/src/routes/errors.routes.d.ts +7 -0
- package/.dist/esm/src/routes/errors.routes.js +49 -0
- package/.dist/esm/src/routes/errors.routes.js.map +1 -0
- package/.dist/esm/src/routes/mion.routes.d.ts +10 -0
- package/.dist/esm/src/routes/mion.routes.js +13 -0
- package/.dist/esm/src/routes/mion.routes.js.map +1 -0
- package/.dist/esm/src/routes/serializer.routes.d.ts +9 -0
- package/.dist/esm/src/routes/serializer.routes.js +191 -0
- package/.dist/esm/src/routes/serializer.routes.js.map +1 -0
- package/.dist/esm/src/routesFlow.d.ts +7 -0
- package/.dist/esm/src/routesFlow.js +227 -0
- package/.dist/esm/src/routesFlow.js.map +1 -0
- package/.dist/esm/src/types/context.d.ts +57 -0
- package/.dist/esm/src/types/context.js +31 -0
- package/.dist/esm/src/types/context.js.map +1 -0
- package/.dist/esm/src/types/definitions.d.ts +20 -0
- package/.dist/esm/src/types/definitions.js +15 -0
- package/.dist/esm/src/types/definitions.js.map +1 -0
- package/.dist/esm/src/types/general.d.ts +27 -0
- package/.dist/esm/src/types/general.js +14 -0
- package/.dist/esm/src/types/general.js.map +1 -0
- package/.dist/esm/src/types/guards.d.ts +17 -0
- package/.dist/esm/src/types/guards.js +66 -0
- package/.dist/esm/src/types/guards.js.map +1 -0
- package/.dist/esm/src/types/handlers.d.ts +12 -0
- package/.dist/esm/src/types/handlers.js +13 -0
- package/.dist/esm/src/types/handlers.js.map +1 -0
- package/.dist/esm/src/types/publicMethods.d.ts +45 -0
- package/.dist/esm/src/types/publicMethods.js +24 -0
- package/.dist/esm/src/types/publicMethods.js.map +1 -0
- package/.dist/esm/src/types/remoteMethods.d.ts +44 -0
- package/.dist/esm/src/types/remoteMethods.js +25 -0
- package/.dist/esm/src/types/remoteMethods.js.map +1 -0
- package/LICENSE +21 -0
- package/README.md +34 -0
- package/package.json +67 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AnyObject, DataViewSerializer, SerializerCode, RpcError, RoutesFlowMapping } from '@mionjs/core';
|
|
2
|
+
import { MethodsExecutionChain } from './remoteMethods.ts';
|
|
3
|
+
export interface CallContext<ContextData extends Record<string, any> = any> {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly request: MionRequest;
|
|
6
|
+
readonly response: MionResponse;
|
|
7
|
+
shared: ContextData;
|
|
8
|
+
readonly executionChain: MethodsExecutionChain;
|
|
9
|
+
readonly urlQuery?: string;
|
|
10
|
+
readonly routesFlowRouteIds?: string[];
|
|
11
|
+
}
|
|
12
|
+
export type RawRequestBody = string | ArrayBuffer | Uint8Array | AnyObject;
|
|
13
|
+
export type RawResponseBody = string | ArrayBuffer | Uint8Array | AnyObject;
|
|
14
|
+
export interface MionRequest {
|
|
15
|
+
readonly headers: Readonly<Omit<MionHeaders, 'append' | 'set' | 'delete'>>;
|
|
16
|
+
readonly rawBody: RawRequestBody;
|
|
17
|
+
readonly bodyType: SerializerCode;
|
|
18
|
+
readonly body: Readonly<AnyObject>;
|
|
19
|
+
readonly thrownErrors?: Readonly<Record<string, RpcError<string>>>;
|
|
20
|
+
}
|
|
21
|
+
export interface MionResponse {
|
|
22
|
+
readonly statusCode: number;
|
|
23
|
+
readonly headers: Readonly<MionHeaders>;
|
|
24
|
+
readonly rawBody: RawResponseBody;
|
|
25
|
+
readonly serializer: SerializerCode;
|
|
26
|
+
readonly body: Readonly<ResponseBody>;
|
|
27
|
+
readonly hasErrors: boolean;
|
|
28
|
+
readonly binSerializer?: DataViewSerializer | undefined;
|
|
29
|
+
}
|
|
30
|
+
export interface MionHeaders {
|
|
31
|
+
append(name: string, value: string): void;
|
|
32
|
+
delete(name: string): void;
|
|
33
|
+
set(name: string, value: string): void;
|
|
34
|
+
get(name: string): string | undefined | null;
|
|
35
|
+
has(name: string): boolean;
|
|
36
|
+
entries(): IterableIterator<[string, string]>;
|
|
37
|
+
keys(): IterableIterator<string>;
|
|
38
|
+
values(): IterableIterator<string>;
|
|
39
|
+
}
|
|
40
|
+
export type ContextDataFactory<ContextData extends Record<string, any>> = () => ContextData;
|
|
41
|
+
export interface ResponseBody extends Record<string, any> {
|
|
42
|
+
'@thrownErrors'?: Record<string, RpcError<string>>;
|
|
43
|
+
}
|
|
44
|
+
export interface RoutesFlowExecutionResult {
|
|
45
|
+
executionChain: MethodsExecutionChain;
|
|
46
|
+
routesFlowRouteIds?: string[];
|
|
47
|
+
mappings?: RoutesFlowMapping[];
|
|
48
|
+
}
|
|
49
|
+
export declare type __ΩCallContext = any[];
|
|
50
|
+
export declare type __ΩRawRequestBody = any[];
|
|
51
|
+
export declare type __ΩRawResponseBody = any[];
|
|
52
|
+
export declare type __ΩMionRequest = any[];
|
|
53
|
+
export declare type __ΩMionResponse = any[];
|
|
54
|
+
export declare type __ΩMionHeaders = any[];
|
|
55
|
+
export declare type __ΩContextDataFactory = any[];
|
|
56
|
+
export declare type __ΩResponseBody = any[];
|
|
57
|
+
export declare type __ΩRoutesFlowExecutionResult = any[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const __ΩReadonly = ["T", "Readonly", 'l+e#!e"!fRb!Pde"!gN#%w"y'];
|
|
2
|
+
const __ΩOmit = ["T", "K", () => __ΩPick, () => __ΩExclude, "Omit", 'b!b"e!!e!!ge!"o$#o##w%y'];
|
|
3
|
+
const __ΩRecord = ["K", "T", "Record", `l'e#"Rb!b"Pde"!N#!w#y`];
|
|
4
|
+
const __ΩIterableIterator = ["T", "TReturn", "TNext", () => __ΩIterator, 0, () => Symbol.iterator, "IterableIterator", `b!"c""c#Pe"!e""e"#o$$Pe#!e#"e##o%$1&Mw'y`];
|
|
5
|
+
const __ΩPick = ["T", "K", "Pick", 'l+e#!e"!fRb!b"Pde""N#!w#y'];
|
|
6
|
+
const __ΩExclude = ["T", "U", "Exclude", 'l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)w#y'];
|
|
7
|
+
const __ΩIterator = ["T", "TReturn", "TNext", "param0", () => __ΩIteratorResult, "next", "value", () => __ΩIteratorResult, "return", "e", () => __ΩIteratorResult, "throw", "Iterator", `b!"c""c#PPPPGPe%#GJ@2$e#!e#"o%#1&Pe#"2'8e#!e#"o(#1)8P"2*8e#!e#"o+#1,8Mw-y`];
|
|
8
|
+
const __ΩIteratorResult = ["T", "TReturn", () => __ΩIteratorYieldResult, () => __ΩIteratorReturnResult, "IteratorResult", 'b!"c"Pe"!o#"e""o$"Jw%y'];
|
|
9
|
+
const __ΩIteratorYieldResult = ["TYield", false, "done", "value", "IteratorYieldResult", 'b!P."4#8e"!4$Mw%y'];
|
|
10
|
+
const __ΩIteratorReturnResult = ["TReturn", true, "done", "value", "IteratorReturnResult", 'b!P."4#e"!4$Mw%y'];
|
|
11
|
+
const __ΩCallContext = ["ContextData", "path", () => __ΩMionRequest, "request", () => __ΩMionResponse, "response", "shared", "MethodsExecutionChain", "executionChain", "urlQuery", "routesFlowRouteIds", "CallContext", `"c!P&4"9n#4$9n%4&9e"!4'"w(4)9&4*89&F4+89Mw,y`];
|
|
12
|
+
const __ΩRawRequestBody = ["AnyObject", "RawRequestBody", 'P&_W"w!Jw"y'];
|
|
13
|
+
const __ΩRawResponseBody = ["AnyObject", "RawResponseBody", 'P&_W"w!Jw"y'];
|
|
14
|
+
const __ΩMionRequest = [() => __ΩReadonly, () => __ΩOmit, () => __ΩMionHeaders, "append", "set", "delete", "headers", () => __ΩRawRequestBody, "rawBody", "SerializerCode", "bodyType", () => __ΩReadonly, "AnyObject", "body", () => __ΩReadonly, () => __ΩRecord, "RpcError", "thrownErrors", "MionRequest", `Pn#P.$.%.&Jo"#o!"4'9n(4)9"w*4+9"w-o,"4.9&"w1o0#o/"4289Mw3y`];
|
|
15
|
+
const __ΩMionResponse = ["statusCode", () => __ΩReadonly, () => __ΩMionHeaders, "headers", () => __ΩRawResponseBody, "rawBody", "SerializerCode", "serializer", () => __ΩReadonly, () => __ΩResponseBody, "body", "hasErrors", "DataViewSerializer", "binSerializer", "MionResponse", `P'4!9n#o""4$9n%4&9"w'4(9n*o)"4+9)4,9P"w--J4.89Mw/y`];
|
|
16
|
+
const __ΩMionHeaders = ["name", "value", "append", "delete", "set", "get", "has", () => __ΩIterableIterator, "entries", () => __ΩIterableIterator, "keys", () => __ΩIterableIterator, "values", "MionHeaders", `PP&2!&2"$1#P&2!$1$P&2!&2"$1%P&2!P&-,J1&P&2!)1'PP&&Go("1)P&o*"1+P&o,"1-Mw.y`];
|
|
17
|
+
const __ΩContextDataFactory = ["ContextData", "", "ContextDataFactory", 'b!Pe"!/"w#y'];
|
|
18
|
+
const __ΩResponseBody = [() => __ΩRecord, () => __ΩRecord, "RpcError", "@thrownErrors", "ResponseBody", 'P&"o!#&"w#o"#4$8Mw%y'];
|
|
19
|
+
const __ΩRoutesFlowExecutionResult = ["MethodsExecutionChain", "executionChain", "routesFlowRouteIds", "RoutesFlowMapping", "mappings", "RoutesFlowExecutionResult", 'P"w!4"&F4#8"w$F4%8Mw&y'];
|
|
20
|
+
export {
|
|
21
|
+
__ΩCallContext,
|
|
22
|
+
__ΩContextDataFactory,
|
|
23
|
+
__ΩMionHeaders,
|
|
24
|
+
__ΩMionRequest,
|
|
25
|
+
__ΩMionResponse,
|
|
26
|
+
__ΩRawRequestBody,
|
|
27
|
+
__ΩRawResponseBody,
|
|
28
|
+
__ΩResponseBody,
|
|
29
|
+
__ΩRoutesFlowExecutionResult
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Handler, HeaderHandler, RawMiddleFnHandler } from './handlers.ts';
|
|
2
|
+
import { HeadersMiddleFnOptions, HeadersMethod, MiddleFnOptions, MiddleFnMethod, RawMiddleFnOptions, RawMethod, RouteOptions, RouteMethod } from './remoteMethods.ts';
|
|
3
|
+
export type RouteDef<H extends Handler = any> = Pick<RouteMethod<H>, 'type' | 'handler'> & {
|
|
4
|
+
options?: RouteOptions;
|
|
5
|
+
};
|
|
6
|
+
export type MiddleFnDef<H extends Handler = any> = Pick<MiddleFnMethod<H>, 'type' | 'handler'> & {
|
|
7
|
+
options?: MiddleFnOptions;
|
|
8
|
+
};
|
|
9
|
+
export type HeadersMiddleFnDef<H extends HeaderHandler = any> = Pick<HeadersMethod<H>, 'type' | 'handler'> & {
|
|
10
|
+
options?: HeadersMiddleFnOptions;
|
|
11
|
+
};
|
|
12
|
+
export type RawMiddleFnDef<H extends RawMiddleFnHandler = any> = Pick<RawMethod<H>, 'type' | 'handler'> & {
|
|
13
|
+
options?: RawMiddleFnOptions;
|
|
14
|
+
};
|
|
15
|
+
export type AnyHandlerDef = RouteDef | MiddleFnDef | HeadersMiddleFnDef | RawMiddleFnDef;
|
|
16
|
+
export declare type __ΩRouteDef = any[];
|
|
17
|
+
export declare type __ΩMiddleFnDef = any[];
|
|
18
|
+
export declare type __ΩHeadersMiddleFnDef = any[];
|
|
19
|
+
export declare type __ΩRawMiddleFnDef = any[];
|
|
20
|
+
export declare type __ΩAnyHandlerDef = any[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { __ΩRouteMethod as ___RouteMethod, __ΩRouteOptions as ___RouteOptions, __ΩMiddleFnMethod as ___MiddleFnMethod, __ΩMiddleFnOptions as ___MiddleFnOptions, __ΩHeadersMethod as ___HeadersMethod, __ΩHeadersMiddleFnOptions as ___HeadersMiddleFnOptions, __ΩRawMethod as ___RawMethod, __ΩRawMiddleFnOptions as ___RawMiddleFnOptions } from "./remoteMethods.js";
|
|
2
|
+
const __ΩPick = ["T", "K", "Pick", 'l+e#!e"!fRb!b"Pde""N#!w#y'];
|
|
3
|
+
const __ΩRouteDef = ["H", () => __ΩPick, () => ___RouteMethod, "type", "handler", () => ___RouteOptions, "options", "RouteDef", `"c!Pe"!o#"P.$.%Jo"#Pn&4'8MKw(y`];
|
|
4
|
+
const __ΩMiddleFnDef = ["H", () => __ΩPick, () => ___MiddleFnMethod, "type", "handler", () => ___MiddleFnOptions, "options", "MiddleFnDef", `"c!Pe"!o#"P.$.%Jo"#Pn&4'8MKw(y`];
|
|
5
|
+
const __ΩHeadersMiddleFnDef = ["H", () => __ΩPick, () => ___HeadersMethod, "type", "handler", () => ___HeadersMiddleFnOptions, "options", "HeadersMiddleFnDef", `"c!Pe"!o#"P.$.%Jo"#Pn&4'8MKw(y`];
|
|
6
|
+
const __ΩRawMiddleFnDef = ["H", () => __ΩPick, () => ___RawMethod, "type", "handler", () => ___RawMiddleFnOptions, "options", "RawMiddleFnDef", `"c!Pe"!o#"P.$.%Jo"#Pn&4'8MKw(y`];
|
|
7
|
+
const __ΩAnyHandlerDef = [() => __ΩRouteDef, () => __ΩMiddleFnDef, () => __ΩHeadersMiddleFnDef, () => __ΩRawMiddleFnDef, "AnyHandlerDef", 'Pn!n"n#n$Jw%y'];
|
|
8
|
+
export {
|
|
9
|
+
__ΩAnyHandlerDef,
|
|
10
|
+
__ΩHeadersMiddleFnDef,
|
|
11
|
+
__ΩMiddleFnDef,
|
|
12
|
+
__ΩRawMiddleFnDef,
|
|
13
|
+
__ΩRouteDef
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CoreRouterOptions, SerializerMode } from '@mionjs/core';
|
|
2
|
+
import { ContextDataFactory } from './context.ts';
|
|
3
|
+
import { HeadersMiddleFnDef, MiddleFnDef, RawMiddleFnDef, RouteDef } from './definitions.ts';
|
|
4
|
+
import { RunTypeOptions } from '@mionjs/run-types';
|
|
5
|
+
export type Route = RouteDef;
|
|
6
|
+
export type RouterEntry = Routes | MiddleFnDef | RouteDef | RawMiddleFnDef | HeadersMiddleFnDef;
|
|
7
|
+
export interface Routes {
|
|
8
|
+
[key: string]: RouterEntry;
|
|
9
|
+
}
|
|
10
|
+
export interface RouterOptions<Req = any, ContextData extends Record<string, any> = any> extends CoreRouterOptions {
|
|
11
|
+
basePath: string;
|
|
12
|
+
suffix: string;
|
|
13
|
+
pathTransform?: (request: Req, path: string) => string;
|
|
14
|
+
contextDataFactory?: ContextDataFactory<ContextData>;
|
|
15
|
+
serializer: SerializerMode;
|
|
16
|
+
runTypeOptions: RunTypeOptions;
|
|
17
|
+
getPublicRoutesData: boolean;
|
|
18
|
+
autoGenerateErrorId: boolean;
|
|
19
|
+
skipClientRoutes: boolean;
|
|
20
|
+
aot: boolean;
|
|
21
|
+
maxContextPoolSize: number;
|
|
22
|
+
maxRoutesFlowsCacheSize: number;
|
|
23
|
+
}
|
|
24
|
+
export declare type __ΩRoute = any[];
|
|
25
|
+
export declare type __ΩRouterEntry = any[];
|
|
26
|
+
export declare type __ΩRoutes = any[];
|
|
27
|
+
export declare type __ΩRouterOptions = any[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __ΩCoreRouterOptions as ___CoreRouterOptions, __ΩSerializerMode as ___SerializerMode } from "@mionjs/core";
|
|
2
|
+
import { __ΩContextDataFactory as ___ContextDataFactory } from "./context.js";
|
|
3
|
+
import { __ΩRouteDef as ___RouteDef, __ΩMiddleFnDef as ___MiddleFnDef, __ΩRawMiddleFnDef as ___RawMiddleFnDef, __ΩHeadersMiddleFnDef as ___HeadersMiddleFnDef } from "./definitions.js";
|
|
4
|
+
const __ΩRoute = [() => ___RouteDef, "Route", 'n!w"y'];
|
|
5
|
+
const __ΩRouterEntry = [() => __ΩRoutes, () => ___MiddleFnDef, () => ___RouteDef, () => ___RawMiddleFnDef, () => ___HeadersMiddleFnDef, "RouterEntry", 'Pn!n"n#n$n%Jw&y'];
|
|
6
|
+
const __ΩRoutes = [() => __ΩRouterEntry, "Routes", 'P&n!LMw"y'];
|
|
7
|
+
const __ΩRouterOptions = ["Req", "ContextData", () => ___CoreRouterOptions, "basePath", "suffix", "request", "path", "", "pathTransform", () => ___ContextDataFactory, "contextDataFactory", () => ___SerializerMode, "serializer", "RunTypeOptions", "runTypeOptions", "getPublicRoutesData", "autoGenerateErrorId", "skipClientRoutes", "aot", "maxContextPoolSize", "maxRoutesFlowsCacheSize", "RouterOptions", `"c!"c"Pn#&4$&4%Pe#!2&&2'&/(4)8e""o*"4+8n,4-"w.4/)40)41)42)43'44'45Mw6y`];
|
|
8
|
+
export {
|
|
9
|
+
__ΩRoute,
|
|
10
|
+
__ΩRouterEntry,
|
|
11
|
+
__ΩRouterOptions,
|
|
12
|
+
__ΩRoutes
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=general.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"general.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HeadersMiddleFnDef, MiddleFnDef, RawMiddleFnDef, RouteDef } from './definitions.ts';
|
|
2
|
+
import { Route, RouterEntry, Routes } from './general.ts';
|
|
3
|
+
import { RawMethod, HeadersMethod, RouteMethod, RemoteMethod } from './remoteMethods.ts';
|
|
4
|
+
export declare function isRouteDef(entry: RouterEntry): entry is RouteDef;
|
|
5
|
+
export declare function isMiddleFnDef(entry: RouterEntry): entry is MiddleFnDef;
|
|
6
|
+
export declare function isRawMiddleFnDef(entry: RouterEntry): entry is RawMiddleFnDef;
|
|
7
|
+
export declare function isHeadersMiddleFnDef(entry: RouterEntry): entry is HeadersMiddleFnDef;
|
|
8
|
+
export declare function isAnyMiddleFnDef(entry: RouterEntry): entry is HeadersMiddleFnDef | MiddleFnDef | RawMiddleFnDef;
|
|
9
|
+
export declare function isRoute(entry: RouterEntry): entry is Route;
|
|
10
|
+
export declare function isRoutes(entry: RouterEntry | Routes): entry is Route;
|
|
11
|
+
export declare function isExecutable(entry: RemoteMethod | {
|
|
12
|
+
pathPointer: string[];
|
|
13
|
+
}): entry is RemoteMethod;
|
|
14
|
+
export declare function isRawExecutable(entry: RemoteMethod): entry is RawMethod;
|
|
15
|
+
export declare function isPublicExecutable(entry: RemoteMethod): entry is RemoteMethod;
|
|
16
|
+
export declare function isHeaderExecutable(entry: RemoteMethod): entry is HeadersMethod;
|
|
17
|
+
export declare function isRouteExecutable(entry: RemoteMethod): entry is RouteMethod;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { __ΩRouterEntry as ___RouterEntry, __ΩRoutes as ___Routes } from "./general.js";
|
|
2
|
+
import { __ΩRemoteMethod as ___RemoteMethod } from "./remoteMethods.js";
|
|
3
|
+
import { HandlerType } from "@mionjs/core";
|
|
4
|
+
function isRouteDef(entry) {
|
|
5
|
+
return entry.type === HandlerType.route;
|
|
6
|
+
}
|
|
7
|
+
isRouteDef.__type = [() => ___RouterEntry, "entry", "isRouteDef", 'Pn!2"!/#'];
|
|
8
|
+
function isMiddleFnDef(entry) {
|
|
9
|
+
return entry.type === HandlerType.middleFn;
|
|
10
|
+
}
|
|
11
|
+
isMiddleFnDef.__type = [() => ___RouterEntry, "entry", "isMiddleFnDef", 'Pn!2"!/#'];
|
|
12
|
+
function isRawMiddleFnDef(entry) {
|
|
13
|
+
return entry.type === HandlerType.rawMiddleFn;
|
|
14
|
+
}
|
|
15
|
+
isRawMiddleFnDef.__type = [() => ___RouterEntry, "entry", "isRawMiddleFnDef", 'Pn!2"!/#'];
|
|
16
|
+
function isHeadersMiddleFnDef(entry) {
|
|
17
|
+
return entry.type === HandlerType.headersMiddleFn;
|
|
18
|
+
}
|
|
19
|
+
isHeadersMiddleFnDef.__type = [() => ___RouterEntry, "entry", "isHeadersMiddleFnDef", 'Pn!2"!/#'];
|
|
20
|
+
function isAnyMiddleFnDef(entry) {
|
|
21
|
+
return isMiddleFnDef(entry) || isRawMiddleFnDef(entry) || isHeadersMiddleFnDef(entry);
|
|
22
|
+
}
|
|
23
|
+
isAnyMiddleFnDef.__type = [() => ___RouterEntry, "entry", "isAnyMiddleFnDef", 'Pn!2"!/#'];
|
|
24
|
+
function isRoute(entry) {
|
|
25
|
+
return entry.type === HandlerType.route;
|
|
26
|
+
}
|
|
27
|
+
isRoute.__type = [() => ___RouterEntry, "entry", "isRoute", 'Pn!2"!/#'];
|
|
28
|
+
function isRoutes(entry) {
|
|
29
|
+
return typeof entry === "object";
|
|
30
|
+
}
|
|
31
|
+
isRoutes.__type = [() => ___RouterEntry, () => ___Routes, "entry", "isRoutes", 'PPn!n"J2#!/$'];
|
|
32
|
+
function isExecutable(entry) {
|
|
33
|
+
return typeof entry?.id === "string" && (entry.routes === "undefined" || typeof entry.handler === "function");
|
|
34
|
+
}
|
|
35
|
+
isExecutable.__type = [() => ___RemoteMethod, "pathPointer", "entry", "isExecutable", 'PPn!P&F4"MJ2#!/$'];
|
|
36
|
+
function isRawExecutable(entry) {
|
|
37
|
+
return entry.type === HandlerType.rawMiddleFn;
|
|
38
|
+
}
|
|
39
|
+
isRawExecutable.__type = [() => ___RemoteMethod, "entry", "isRawExecutable", 'Pn!2"!/#'];
|
|
40
|
+
function isPublicExecutable(entry) {
|
|
41
|
+
return entry.hasReturnData || entry.type === HandlerType.route || !!entry.paramNames?.length || !!entry.headersParam?.headerNames?.length;
|
|
42
|
+
}
|
|
43
|
+
isPublicExecutable.__type = [() => ___RemoteMethod, "entry", "isPublicExecutable", 'Pn!2"!/#'];
|
|
44
|
+
function isHeaderExecutable(entry) {
|
|
45
|
+
return entry.type === HandlerType.headersMiddleFn;
|
|
46
|
+
}
|
|
47
|
+
isHeaderExecutable.__type = [() => ___RemoteMethod, "entry", "isHeaderExecutable", 'Pn!2"!/#'];
|
|
48
|
+
function isRouteExecutable(entry) {
|
|
49
|
+
return entry.type === HandlerType.route;
|
|
50
|
+
}
|
|
51
|
+
isRouteExecutable.__type = [() => ___RemoteMethod, "entry", "isRouteExecutable", 'Pn!2"!/#'];
|
|
52
|
+
export {
|
|
53
|
+
isAnyMiddleFnDef,
|
|
54
|
+
isExecutable,
|
|
55
|
+
isHeaderExecutable,
|
|
56
|
+
isHeadersMiddleFnDef,
|
|
57
|
+
isMiddleFnDef,
|
|
58
|
+
isPublicExecutable,
|
|
59
|
+
isRawExecutable,
|
|
60
|
+
isRawMiddleFnDef,
|
|
61
|
+
isRoute,
|
|
62
|
+
isRouteDef,
|
|
63
|
+
isRouteExecutable,
|
|
64
|
+
isRoutes
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guards.js","sources":["../../../../src/types/guards.ts"],"sourcesContent":["/* ########\n * 2023 mion\n * Author: Ma-jerez\n * License: MIT\n * The software is provided \"as is\", without warranty of any kind.\n * ######## */\n\nimport {HeadersMiddleFnDef, MiddleFnDef, RawMiddleFnDef, RouteDef} from './definitions.ts';\nimport {Route, RouterEntry, Routes} from './general.ts';\nimport {RawMethod} from './remoteMethods.ts';\nimport {HeadersMethod} from './remoteMethods.ts';\nimport {RouteMethod} from './remoteMethods.ts';\nimport {RemoteMethod} from './remoteMethods.ts';\nimport {HandlerType} from '@mionjs/core';\n\n// ####### type guards #######\n\nexport function isRouteDef(entry: RouterEntry): entry is RouteDef {\n return entry.type === HandlerType.route;\n}\n\nexport function isMiddleFnDef(entry: RouterEntry): entry is MiddleFnDef {\n return entry.type === HandlerType.middleFn;\n}\n\nexport function isRawMiddleFnDef(entry: RouterEntry): entry is RawMiddleFnDef {\n return entry.type === HandlerType.rawMiddleFn;\n}\n\nexport function isHeadersMiddleFnDef(entry: RouterEntry): entry is HeadersMiddleFnDef {\n return entry.type === HandlerType.headersMiddleFn;\n}\n\nexport function isAnyMiddleFnDef(entry: RouterEntry): entry is HeadersMiddleFnDef | MiddleFnDef | RawMiddleFnDef {\n return isMiddleFnDef(entry) || isRawMiddleFnDef(entry) || isHeadersMiddleFnDef(entry);\n}\n\nexport function isRoute(entry: RouterEntry): entry is Route {\n return entry.type === HandlerType.route;\n}\n\nexport function isRoutes(entry: RouterEntry | Routes): entry is Route {\n return typeof entry === 'object';\n}\n\nexport function isExecutable(entry: RemoteMethod | {pathPointer: string[]}): entry is RemoteMethod {\n return (\n typeof (entry as RemoteMethod)?.id === 'string' &&\n ((entry as any).routes === 'undefined' || typeof (entry as RemoteMethod).handler === 'function')\n );\n}\nexport function isRawExecutable(entry: RemoteMethod): entry is RawMethod {\n return entry.type === HandlerType.rawMiddleFn;\n}\n\nexport function isPublicExecutable(entry: RemoteMethod): entry is RemoteMethod {\n return (\n entry.hasReturnData ||\n entry.type === HandlerType.route ||\n !!entry.paramNames?.length ||\n !!(entry as HeadersMethod).headersParam?.headerNames?.length\n );\n}\n\nexport function isHeaderExecutable(entry: RemoteMethod): entry is HeadersMethod {\n return entry.type === HandlerType.headersMiddleFn;\n}\n\nexport function isRouteExecutable(entry: RemoteMethod): entry is RouteMethod {\n return entry.type === HandlerType.route;\n}\n"],"names":[],"mappings":";;;AAiBM,SAAU,WAAW,OAAkB;AACzC,SAAO,MAAM,SAAS,YAAY;AACtC;;AAEM,SAAU,cAAc,OAAkB;AAC5C,SAAO,MAAM,SAAS,YAAY;AACtC;;AAEM,SAAU,iBAAiB,OAAkB;AAC/C,SAAO,MAAM,SAAS,YAAY;AACtC;;AAEM,SAAU,qBAAqB,OAAkB;AACnD,SAAO,MAAM,SAAS,YAAY;AACtC;;AAEM,SAAU,iBAAiB,OAAkB;AAC/C,SAAO,cAAc,KAAK,KAAK,iBAAiB,KAAK,KAAK,qBAAqB,KAAK;AACxF;;AAEM,SAAU,QAAQ,OAAkB;AACtC,SAAO,MAAM,SAAS,YAAY;AACtC;;AAEM,SAAU,SAAS,OAA2B;AAChD,SAAO,OAAO,UAAU;AAC5B;;AAEM,SAAU,aAAa,OAA6C;AACtE,SACI,OAAQ,OAAwB,OAAO,aACrC,MAAc,WAAW,eAAe,OAAQ,MAAuB,YAAY;AAE7F;;AACM,SAAU,gBAAgB,OAAmB;AAC/C,SAAO,MAAM,SAAS,YAAY;AACtC;;AAEM,SAAU,mBAAmB,OAAmB;AAClD,SACI,MAAM,iBACN,MAAM,SAAS,YAAY,SAC3B,CAAC,CAAC,MAAM,YAAY,UACpB,CAAC,CAAE,MAAwB,cAAc,aAAa;AAE9D;;AAEM,SAAU,mBAAmB,OAAmB;AAClD,SAAO,MAAM,SAAS,YAAY;AACtC;;AAEM,SAAU,kBAAkB,OAAmB;AACjD,SAAO,MAAM,SAAS,YAAY;AACtC;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HeadersSubset } from '@mionjs/core';
|
|
2
|
+
import { CallContext } from './context.ts';
|
|
3
|
+
import { RouterOptions } from './general.ts';
|
|
4
|
+
import { MayReturnError } from './publicMethods.ts';
|
|
5
|
+
export type Handler<Context extends CallContext = any, Params extends any[] = any[], Ret = any> = (context: Context, ...parameters: Params) => Ret | Promise<Ret>;
|
|
6
|
+
export type HeaderHandler<Context extends CallContext = any, ExpectedHeaders extends HeadersSubset<any> = any, Params extends any[] = any[], Ret = any> = (context: Context, headers: ExpectedHeaders, ...parameters: Params) => Ret | Promise<Ret>;
|
|
7
|
+
export type RawMiddleFnHandler<Context extends CallContext = any, RawReq = any, RawResp = any, Opts extends RouterOptions<RawReq> = RouterOptions<RawReq>> = (ctx: Context, request: RawReq, response: RawResp, opts: Opts) => MayReturnError;
|
|
8
|
+
export type AnyHandler<Context extends CallContext = any, Params extends any[] = any, Ret = any> = Handler<Context, Params, Ret>;
|
|
9
|
+
export declare type __ΩHandler = any[];
|
|
10
|
+
export declare type __ΩHeaderHandler = any[];
|
|
11
|
+
export declare type __ΩRawMiddleFnHandler = any[];
|
|
12
|
+
export declare type __ΩAnyHandler = any[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __ΩRouterOptions as ___RouterOptions } from "./general.js";
|
|
2
|
+
import { __ΩMayReturnError as ___MayReturnError } from "./publicMethods.js";
|
|
3
|
+
const __ΩHandler = ["Context", "Params", "Ret", "context", "parameters", "", "Handler", '"c!"Fc""c#Pe"!2$e""@2%Pe##e##`J/&w\'y'];
|
|
4
|
+
const __ΩHeaderHandler = ["Context", "ExpectedHeaders", "Params", "Ret", "context", "headers", "parameters", "", "HeaderHandler", '"c!"c""Fc#"c$Pe"!2%e""2&e"#@2\'Pe#$e#$`J/(w)y'];
|
|
5
|
+
const __ΩRawMiddleFnHandler = ["Context", "RawReq", "RawResp", () => ___RouterOptions, "Opts", "ctx", "request", "response", "opts", () => ___MayReturnError, "", "RawMiddleFnHandler", `"c!"c""c#e!"o$"c%Pe"!2&e""2'e"#2(e"$2)n*/+w,y`];
|
|
6
|
+
const __ΩAnyHandler = ["Context", "Params", "Ret", () => __ΩHandler, "AnyHandler", '"c!"c""c#e!!e!"e!#o$$w%y'];
|
|
7
|
+
export {
|
|
8
|
+
__ΩAnyHandler,
|
|
9
|
+
__ΩHandler,
|
|
10
|
+
__ΩHeaderHandler,
|
|
11
|
+
__ΩRawMiddleFnHandler
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Prettify, RpcError, MethodMetadata, HandlerType } from '@mionjs/core';
|
|
2
|
+
import { CallContext } from './context.ts';
|
|
3
|
+
import { Routes } from './general.ts';
|
|
4
|
+
import { Handler } from './handlers.ts';
|
|
5
|
+
import { HeadersMiddleFnDef, MiddleFnDef, RawMiddleFnDef, RouteDef } from './definitions.ts';
|
|
6
|
+
export type MayReturnError = void | RpcError<string> | Promise<RpcError<string> | void>;
|
|
7
|
+
export type MiddleFnsCollection = {
|
|
8
|
+
[key: string]: MiddleFnDef | HeadersMiddleFnDef | RawMiddleFnDef;
|
|
9
|
+
};
|
|
10
|
+
export interface PrivateMiddleFnDef extends MiddleFnDef {
|
|
11
|
+
handler: (ctx?: any) => void | never | undefined;
|
|
12
|
+
}
|
|
13
|
+
export type PrivateDef = PrivateMiddleFnDef | RawMiddleFnDef;
|
|
14
|
+
export type PublicApi<Type extends Routes> = Prettify<{
|
|
15
|
+
[Property in keyof Type as Type[Property] extends PrivateDef ? never : Property]: Type[Property] extends MiddleFnDef ? PublicMiddleFn<PublicHandler<Type[Property]['handler']>> : Type[Property] extends HeadersMiddleFnDef ? PublicHeadersFn<PublicHandler<Type[Property]['handler']>> : Type[Property] extends RouteDef ? PublicRoute<PublicHandler<Type[Property]['handler']>> : Type[Property] extends Routes ? PublicApi<Type[Property]> : never;
|
|
16
|
+
}>;
|
|
17
|
+
export type RemoteApi = {
|
|
18
|
+
[key: string]: PublicRoute | PublicMiddleFn | PublicHeadersFn | RemoteApi;
|
|
19
|
+
};
|
|
20
|
+
export interface PublicRoute<H extends Handler = any> extends MethodMetadata {
|
|
21
|
+
type: typeof HandlerType.route;
|
|
22
|
+
middleFnIds: string[];
|
|
23
|
+
headerNames: undefined;
|
|
24
|
+
handler: H;
|
|
25
|
+
}
|
|
26
|
+
export interface PublicMiddleFn<H extends Handler = any> extends MethodMetadata {
|
|
27
|
+
type: typeof HandlerType.middleFn;
|
|
28
|
+
handler: H;
|
|
29
|
+
}
|
|
30
|
+
export interface PublicHeadersFn<H extends Handler = any> extends MethodMetadata {
|
|
31
|
+
type: typeof HandlerType.headersMiddleFn;
|
|
32
|
+
headerNames: string[];
|
|
33
|
+
handler: H;
|
|
34
|
+
}
|
|
35
|
+
export type PublicHandler<H extends Handler> = H extends (ctx: CallContext, ...rest: infer Req) => infer Resp ? (...rest: Req) => Promise<Awaited<Resp>> : never;
|
|
36
|
+
export declare type __ΩMayReturnError = any[];
|
|
37
|
+
export declare type __ΩMiddleFnsCollection = any[];
|
|
38
|
+
export declare type __ΩPrivateMiddleFnDef = any[];
|
|
39
|
+
export declare type __ΩPrivateDef = any[];
|
|
40
|
+
export declare type __ΩPublicApi = any[];
|
|
41
|
+
export declare type __ΩRemoteApi = any[];
|
|
42
|
+
export declare type __ΩPublicRoute = any[];
|
|
43
|
+
export declare type __ΩPublicMiddleFn = any[];
|
|
44
|
+
export declare type __ΩPublicHeadersFn = any[];
|
|
45
|
+
export declare type __ΩPublicHandler = any[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const __ΩAwaited = ["T", "onfulfilled", "args", "then", "value", "", 0, "Awaited", `le$!Re"!o'"R!RPde#!Ph"!2%h&"@2#"/&qk'.QRPde#!p0Re$!RPdde#!P%PPh$!2"h$"@2#"1$MKqkJRQRPde%!pVRPe#!P,-Jqk#vQRb!Pde"!p~w(y`];
|
|
2
|
+
const __ΩMayReturnError = ["RpcError", "MayReturnError", 'P$"w!P"w!$J`Jw"y'];
|
|
3
|
+
const __ΩMiddleFnsCollection = ["MiddleFnDef", "HeadersMiddleFnDef", "RawMiddleFnDef", "MiddleFnsCollection", 'P&P"w!"w""w#JLMw$y'];
|
|
4
|
+
const __ΩPrivateMiddleFnDef = ["MiddleFnDef", "ctx", "", "handler", "PrivateMiddleFnDef", 'P"w!P"2"8P$!-J/#4$Mw%y'];
|
|
5
|
+
const __ΩPrivateDef = [() => __ΩPrivateMiddleFnDef, "RawMiddleFnDef", "PrivateDef", 'Pn!"w"Jw#y'];
|
|
6
|
+
const __ΩPublicApi = ["Type", "Prettify", "PublicApi", 'b!"w"w#y'];
|
|
7
|
+
const __ΩRemoteApi = [() => __ΩPublicRoute, () => __ΩPublicMiddleFn, () => __ΩPublicHeadersFn, 0, "RemoteApi", 'P&Pn!n"n#n$JLMw%y'];
|
|
8
|
+
const __ΩPublicRoute = ["H", "MethodMetadata", () => HandlerType.route, "type", "middleFnIds", "headerNames", "handler", "PublicRoute", `"c!P"w"i#4$&F4%-4&e"!4'Mw(y`];
|
|
9
|
+
const __ΩPublicMiddleFn = ["H", "MethodMetadata", () => HandlerType.middleFn, "type", "handler", "PublicMiddleFn", '"c!P"w"i#4$e"!4%Mw&y'];
|
|
10
|
+
const __ΩPublicHeadersFn = ["H", "MethodMetadata", () => HandlerType.headersMiddleFn, "type", "headerNames", "handler", "PublicHeadersFn", `"c!P"w"i#4$&F4%e"!4&Mw'y`];
|
|
11
|
+
const __ΩPublicHandler = ["H", "CallContext", "ctx", "rest", "", () => __ΩAwaited, "PublicHandler", 'lSPe#!@2$e#"o&"`/%R!RPdde#!P"w"2#h"!@2$h""/%qk#4QRb!Pde"!p6w\'y'];
|
|
12
|
+
export {
|
|
13
|
+
__ΩMayReturnError,
|
|
14
|
+
__ΩMiddleFnsCollection,
|
|
15
|
+
__ΩPrivateDef,
|
|
16
|
+
__ΩPrivateMiddleFnDef,
|
|
17
|
+
__ΩPublicApi,
|
|
18
|
+
__ΩPublicHandler,
|
|
19
|
+
__ΩPublicHeadersFn,
|
|
20
|
+
__ΩPublicMiddleFn,
|
|
21
|
+
__ΩPublicRoute,
|
|
22
|
+
__ΩRemoteApi
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=publicMethods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicMethods.js","sources":["../../../../src/types/publicMethods.ts"],"sourcesContent":["/* ########\n * 2023 mion\n * Author: Ma-jerez\n * License: MIT\n * The software is provided \"as is\", without warranty of any kind.\n * ######## */\n\nimport type {Prettify, RpcError, MethodMetadata} from '@mionjs/core';\nimport type {CallContext} from './context.ts';\nimport type {Routes} from './general.ts';\nimport type {Handler} from './handlers.ts';\nimport type {HeadersMiddleFnDef, MiddleFnDef, RawMiddleFnDef, RouteDef} from './definitions.ts';\nimport {HandlerType} from '@mionjs/core'; // do not import type only\n\n// ####### Raw MiddleFns #######\n\nexport type MayReturnError = void | RpcError<string> | Promise<RpcError<string> | void>;\n\nexport type MiddleFnsCollection = {\n [key: string]: MiddleFnDef | HeadersMiddleFnDef | RawMiddleFnDef;\n};\n\n// ####### Private MiddleFns #######\n\nexport interface PrivateMiddleFnDef extends MiddleFnDef {\n handler: (ctx?: any) => void | never | undefined;\n}\n\nexport type PrivateDef = PrivateMiddleFnDef | RawMiddleFnDef;\n\n// ####### Remote Methods Metadata #######\n\n/** Data structure containing all public routes & middleFns.\n * is a Ts Mapped type the remove private middleFns and rawMiddleFns\n */\n// prettier-ignore\nexport type PublicApi<Type extends Routes> = Prettify<{\n [Property in keyof Type as Type[Property] extends PrivateDef ? never : Property]\n : Type[Property] extends MiddleFnDef\n ? PublicMiddleFn<PublicHandler<Type[Property]['handler']>>\n : Type[Property] extends HeadersMiddleFnDef\n ? PublicHeadersFn<PublicHandler<Type[Property]['handler']>>\n : Type[Property] extends RouteDef // Routes\n ? PublicRoute<PublicHandler<Type[Property]['handler']>>\n : Type[Property] extends Routes // Routes & PureRoutes (recursion)\n ? PublicApi<Type[Property]>\n : never;\n}>;\n\n// type-remote-api-start\n/** Same as Public Api but no type mapping, should be easier to use than PublicApi when non strong types are required. */\nexport type RemoteApi = {\n [key: string]: PublicRoute | PublicMiddleFn | PublicHeadersFn | RemoteApi;\n};\n// type-remote-api-end\n\n/** Public Routes, handler type is the same as RemoteRoute but does not include the context */\nexport interface PublicRoute<H extends Handler = any> extends MethodMetadata {\n type: typeof HandlerType.route;\n middleFnIds: string[];\n headerNames: undefined;\n handler: H;\n}\n\n/** Public MiddleFns, handler type is the same as RemoteMiddleFns but does not include the context */\nexport interface PublicMiddleFn<H extends Handler = any> extends MethodMetadata {\n type: typeof HandlerType.middleFn;\n handler: H;\n}\n\n/** Public HeadersFns, handler type is the same as HeadersFns but does not include the context */\nexport interface PublicHeadersFn<H extends Handler = any> extends MethodMetadata {\n type: typeof HandlerType.headersMiddleFn;\n headerNames: string[];\n handler: H;\n}\n\n/** Removes the context from handlers */\n// prettier-ignore\nexport type PublicHandler<H extends Handler> =\n H extends (ctx: CallContext, ...rest: infer Req) => infer Resp\n ? (...rest: Req) => Promise<Awaited<Resp>>\n : never;\n"],"names":[],"mappings":";;;;;;;iEA0D6B,OAAK,QAAA,eAAA,eAAA,WAAA,eAAA,6BAAA;oEAQL,UAAQ,QAAA,WAAA,kBAAA,sBAAA;qEAMR,iBAAe,QAAA,eAAA,WAAA,mBAAA,0BAAA;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { HeadersMethodWithJitFns, MethodWithJitFns, RemoteMethodOpts, RouteOnlyOptions, SerializerCode, HandlerType } from '@mionjs/core';
|
|
2
|
+
import { AnyHandler, Handler, HeaderHandler, RawMiddleFnHandler } from './handlers.ts';
|
|
3
|
+
export interface RemoteMethod<H extends AnyHandler = AnyHandler> extends MethodWithJitFns {
|
|
4
|
+
options: RemoteMethodOpts;
|
|
5
|
+
handler: H;
|
|
6
|
+
methodCaller?: (...args: any[]) => any;
|
|
7
|
+
}
|
|
8
|
+
export interface RouteMethod<H extends Handler = any> extends RemoteMethod<H> {
|
|
9
|
+
type: typeof HandlerType.route;
|
|
10
|
+
options: RouteOnlyOptions;
|
|
11
|
+
}
|
|
12
|
+
export interface MiddleFnMethod<H extends Handler = any> extends RemoteMethod<H> {
|
|
13
|
+
type: typeof HandlerType.middleFn;
|
|
14
|
+
}
|
|
15
|
+
export interface HeadersMethod<H extends HeaderHandler = any> extends RemoteMethod<H> {
|
|
16
|
+
type: typeof HandlerType.headersMiddleFn;
|
|
17
|
+
headersParam: HeadersMethodWithJitFns;
|
|
18
|
+
}
|
|
19
|
+
export interface RawMethod<H extends RawMiddleFnHandler = any> extends RemoteMethod<H> {
|
|
20
|
+
type: typeof HandlerType.rawMiddleFn;
|
|
21
|
+
options: RemoteMethodOpts & {
|
|
22
|
+
validateParams: false;
|
|
23
|
+
validateReturn?: false;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export type RouteOptions = Partial<Pick<RouteMethod['options'], 'description' | 'validateParams' | 'validateReturn' | 'serializer' | 'isMutation'>>;
|
|
27
|
+
export type MiddleFnOptions = Partial<Pick<MiddleFnMethod['options'], 'description' | 'validateParams' | 'validateReturn' | 'runOnError'>>;
|
|
28
|
+
export type HeadersMiddleFnOptions = Partial<Pick<HeadersMethod['options'], 'description' | 'validateParams' | 'validateReturn' | 'runOnError'>>;
|
|
29
|
+
export type RawMiddleFnOptions = Partial<Pick<RawMethod['options'], 'description' | 'runOnError'>>;
|
|
30
|
+
export interface MethodsExecutionChain {
|
|
31
|
+
routeIndex: number;
|
|
32
|
+
methods: RemoteMethod[];
|
|
33
|
+
serializer: SerializerCode;
|
|
34
|
+
}
|
|
35
|
+
export declare type __ΩRemoteMethod = any[];
|
|
36
|
+
export declare type __ΩRouteMethod = any[];
|
|
37
|
+
export declare type __ΩMiddleFnMethod = any[];
|
|
38
|
+
export declare type __ΩHeadersMethod = any[];
|
|
39
|
+
export declare type __ΩRawMethod = any[];
|
|
40
|
+
export declare type __ΩRouteOptions = any[];
|
|
41
|
+
export declare type __ΩMiddleFnOptions = any[];
|
|
42
|
+
export declare type __ΩHeadersMiddleFnOptions = any[];
|
|
43
|
+
export declare type __ΩRawMiddleFnOptions = any[];
|
|
44
|
+
export declare type __ΩMethodsExecutionChain = any[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const __ΩPartial = ["T", "Partial", 'l+e#!e"!fRb!Pde"!gN#"w"y'];
|
|
2
|
+
const __ΩPick = ["T", "K", "Pick", 'l+e#!e"!fRb!b"Pde""N#!w#y'];
|
|
3
|
+
const __ΩRemoteMethod = ["AnyHandler", "H", "MethodWithJitFns", "RemoteMethodOpts", "options", "handler", "args", "", "methodCaller", "RemoteMethod", `"w!c"P"w#"w$4%e"!4&P"@2'"/(4)8Mw*y`];
|
|
4
|
+
const __ΩRouteMethod = ["H", () => __ΩRemoteMethod, () => HandlerType.route, "type", "RouteOnlyOptions", "options", "RouteMethod", `"c!Pe"!o""i#4$"w%4&Mw'y`];
|
|
5
|
+
const __ΩMiddleFnMethod = ["H", () => __ΩRemoteMethod, () => HandlerType.middleFn, "type", "MiddleFnMethod", '"c!Pe"!o""i#4$Mw%y'];
|
|
6
|
+
const __ΩHeadersMethod = ["H", () => __ΩRemoteMethod, () => HandlerType.headersMiddleFn, "type", "HeadersMethodWithJitFns", "headersParam", "HeadersMethod", `"c!Pe"!o""i#4$"w%4&Mw'y`];
|
|
7
|
+
const __ΩRawMethod = ["H", () => __ΩRemoteMethod, () => HandlerType.rawMiddleFn, "type", "RemoteMethodOpts", false, "validateParams", false, "validateReturn", "options", "RawMethod", `"c!Pe"!o""i#4$P"w%P.&4'.(4)8MK4*Mw+y`];
|
|
8
|
+
const __ΩRouteOptions = [() => __ΩPartial, () => __ΩPick, () => __ΩRouteMethod, "options", "description", "validateParams", "validateReturn", "serializer", "isMutation", "RouteOptions", `n#.$fP.%.&.'.(.)Jo"#o!"w*y`];
|
|
9
|
+
const __ΩMiddleFnOptions = [() => __ΩPartial, () => __ΩPick, () => __ΩMiddleFnMethod, "options", "description", "validateParams", "validateReturn", "runOnError", "MiddleFnOptions", `n#.$fP.%.&.'.(Jo"#o!"w)y`];
|
|
10
|
+
const __ΩHeadersMiddleFnOptions = [() => __ΩPartial, () => __ΩPick, () => __ΩHeadersMethod, "options", "description", "validateParams", "validateReturn", "runOnError", "HeadersMiddleFnOptions", `n#.$fP.%.&.'.(Jo"#o!"w)y`];
|
|
11
|
+
const __ΩRawMiddleFnOptions = [() => __ΩPartial, () => __ΩPick, () => __ΩRawMethod, "options", "description", "runOnError", "RawMiddleFnOptions", `n#.$fP.%.&Jo"#o!"w'y`];
|
|
12
|
+
const __ΩMethodsExecutionChain = ["routeIndex", () => __ΩRemoteMethod, "methods", "SerializerCode", "serializer", "MethodsExecutionChain", `P'4!n"F4#"w$4%Mw&y`];
|
|
13
|
+
export {
|
|
14
|
+
__ΩHeadersMethod,
|
|
15
|
+
__ΩHeadersMiddleFnOptions,
|
|
16
|
+
__ΩMethodsExecutionChain,
|
|
17
|
+
__ΩMiddleFnMethod,
|
|
18
|
+
__ΩMiddleFnOptions,
|
|
19
|
+
__ΩRawMethod,
|
|
20
|
+
__ΩRawMiddleFnOptions,
|
|
21
|
+
__ΩRemoteMethod,
|
|
22
|
+
__ΩRouteMethod,
|
|
23
|
+
__ΩRouteOptions
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=remoteMethods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteMethods.js","sources":["../../../../src/types/remoteMethods.ts"],"sourcesContent":["// ####### Executables #######\n\nimport type {HeadersMethodWithJitFns, MethodWithJitFns, RemoteMethodOpts, RouteOnlyOptions, SerializerCode} from '@mionjs/core'; // do not import type only\nimport type {AnyHandler, Handler, HeaderHandler, RawMiddleFnHandler} from './handlers.ts'; // do not import type only\nimport {HandlerType} from '@mionjs/core'; // do not import type only\n\n/** Contains the handlers for middleFns and routes */\nexport interface RemoteMethod<H extends AnyHandler = AnyHandler> extends MethodWithJitFns {\n /** router options */\n options: RemoteMethodOpts;\n handler: H;\n methodCaller?: (...args: any[]) => any;\n}\n\nexport interface RouteMethod<H extends Handler = any> extends RemoteMethod<H> {\n type: typeof HandlerType.route;\n options: RouteOnlyOptions;\n}\nexport interface MiddleFnMethod<H extends Handler = any> extends RemoteMethod<H> {\n type: typeof HandlerType.middleFn;\n}\nexport interface HeadersMethod<H extends HeaderHandler = any> extends RemoteMethod<H> {\n type: typeof HandlerType.headersMiddleFn;\n headersParam: HeadersMethodWithJitFns;\n}\nexport interface RawMethod<H extends RawMiddleFnHandler = any> extends RemoteMethod<H> {\n type: typeof HandlerType.rawMiddleFn;\n options: RemoteMethodOpts & {\n validateParams: false;\n validateReturn?: false;\n };\n}\n\nexport type RouteOptions = Partial<\n Pick<RouteMethod['options'], 'description' | 'validateParams' | 'validateReturn' | 'serializer' | 'isMutation'>\n>;\nexport type MiddleFnOptions = Partial<\n Pick<MiddleFnMethod['options'], 'description' | 'validateParams' | 'validateReturn' | 'runOnError'>\n>;\nexport type HeadersMiddleFnOptions = Partial<\n Pick<HeadersMethod['options'], 'description' | 'validateParams' | 'validateReturn' | 'runOnError'>\n>;\n// RawMiddleFnOptions doesn't need encoding - raw middleFns handle their own serialization\nexport type RawMiddleFnOptions = Partial<Pick<RawMethod['options'], 'description' | 'runOnError'>>;\n\nexport interface MethodsExecutionChain {\n routeIndex: number;\n methods: RemoteMethod[];\n /** Precalculated serializer code for the route's response body type */\n serializer: SerializerCode;\n}\n"],"names":[],"mappings":";;;sEAe6B,OAAK,QAAA,oBAAA,WAAA,eAAA,yBAAA;yEAIL,UAAQ,QAAA,kBAAA,oBAAA;wEAGR,iBAAe,QAAA,2BAAA,gBAAA,iBAAA,yBAAA;oEAIf,aAAW,QAAA,oBAAA,OAAA,kBAAA,OAAA,kBAAA,WAAA,aAAA,sCAAA;;;;;;"}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Mion
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/MionKit/mion/master/assets/public/bannerx90-dark.png">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/MionKit/mion/master/assets/public/bannerx90.png">
|
|
5
|
+
<img alt='mion, Typescript Full Stack APIs' src='https://raw.githubusercontent.com/MionKit/mion/master/assets/public/bannerx90.png'>
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
<p align="center">
|
|
9
|
+
<strong>RPC Like router with automatic Validation and Serialization.
|
|
10
|
+
</strong>
|
|
11
|
+
</p>
|
|
12
|
+
<p align=center>
|
|
13
|
+
|
|
14
|
+
<img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square&maxAge=99999999" alt="npm" style="max-width:100%;">
|
|
15
|
+
<img src="https://img.shields.io/badge/license-MIT-97ca00.svg?style=flat-square&maxAge=99999999" alt="npm" style="max-width:100%;">
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
# `@mionjs/router`
|
|
19
|
+
|
|
20
|
+
🚀 Lightweight and fast HTTP router with automatic validation and serialization out of the box.
|
|
21
|
+
|
|
22
|
+
Thanks to it's **Remote Method Call** routing style is quite performant as there is no need to parse URLs or match regular expressions when finding a route. Just a direct mapping from url to the route handler.
|
|
23
|
+
|
|
24
|
+
mion's is lightweight and fast. Unlike traditional routers. The Http method is not relevant, there are no parameters in the Url and data is sent and received in JSON format via the request body or headers. mion's router leverages a simple in-memory map for route lookup, making it extremely fast.
|
|
25
|
+
|
|
26
|
+
## Check Out The [Website And Documentation](http://mion.io) 📚
|
|
27
|
+
|
|
28
|
+
[](http://mion.io)
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
##
|
|
33
|
+
|
|
34
|
+
_[MIT](../../LICENSE) LICENSE_
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mionjs/router",
|
|
3
|
+
"version": "0.8.0-alpha.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Typescript RPC Like router with automatic Validation and Serialization",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"typescript",
|
|
8
|
+
"API",
|
|
9
|
+
"RPC",
|
|
10
|
+
"json",
|
|
11
|
+
"schema",
|
|
12
|
+
"generate",
|
|
13
|
+
"server",
|
|
14
|
+
"serverless",
|
|
15
|
+
"framework",
|
|
16
|
+
"node"
|
|
17
|
+
],
|
|
18
|
+
"author": "ma jerez",
|
|
19
|
+
"homepage": "https://mion.io/",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"browser": {},
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"source": "./index.ts",
|
|
25
|
+
"types": "./.dist/esm/index.d.ts",
|
|
26
|
+
"require": "./.dist/cjs/index.cjs",
|
|
27
|
+
"default": "./.dist/esm/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./aot": {
|
|
30
|
+
"source": "./src/lib/aotEmitter.ts",
|
|
31
|
+
"types": "./.dist/esm/src/lib/aotEmitter.d.ts",
|
|
32
|
+
"require": "./.dist/cjs/src/lib/aotEmitter.cjs",
|
|
33
|
+
"default": "./.dist/esm/src/lib/aotEmitter.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"directories": {
|
|
37
|
+
"lib": ".dist"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
".dist"
|
|
41
|
+
],
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/MionKit/mion.git"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"dev": "vite build --watch",
|
|
52
|
+
"dev:test": "vitest watch",
|
|
53
|
+
"lint": "npx eslint src",
|
|
54
|
+
"format": "prettier --write src/**/*.ts",
|
|
55
|
+
"build": "vite build",
|
|
56
|
+
"clean": "rimraf .dist & rimraf .coverage",
|
|
57
|
+
"fresh-start": "npm run clean && rimraf node_modules"
|
|
58
|
+
},
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/MionKit/mion/issues"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@mionjs/core": "^0.8.0-alpha.0",
|
|
64
|
+
"@mionjs/run-types": "^0.8.0-alpha.0"
|
|
65
|
+
},
|
|
66
|
+
"gitHead": "5d2ec524ba39d040338ce8946d8edf78aa7291a3"
|
|
67
|
+
}
|