milkio 1.3.3 → 1.3.5
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/index.js +29 -27
- package/package.json +1 -1
- package/action/index.d.ts +0 -10
- package/config/index.d.ts +0 -8
- package/context/index.d.ts +0 -30
- package/event/index.d.ts +0 -51
- package/exception/index.d.ts +0 -51
- package/execute/execute-id-generator.d.ts +0 -3
- package/execute/index.d.ts +0 -32
- package/flow/index.d.ts +0 -8
- package/index.d.ts +0 -17
- package/listener/index.d.ts +0 -26
- package/logger/index.d.ts +0 -20
- package/meta/index.d.ts +0 -12
- package/step/index.d.ts +0 -11
- package/stream/index.d.ts +0 -9
- package/type-safety/index.d.ts +0 -9
- package/types/index.d.ts +0 -76
- package/typia/index.d.ts +0 -3
- package/utils/build-cors-headers.d.ts +0 -2
- package/utils/create-id.d.ts +0 -1
- package/utils/headers-to-json.d.ts +0 -1
- package/utils/merge-deep.d.ts +0 -1
- package/utils/part.d.ts +0 -1
- package/utils/revive-json-parse.d.ts +0 -1
- package/utils/send-cookbook-event.d.ts +0 -7
- package/utils/trie.d.ts +0 -9
- package/world/index.d.ts +0 -49
package/package.json
CHANGED
package/action/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { $meta } from "../meta/index.ts";
|
|
2
|
-
import { $context } from "../context/index.ts";
|
|
3
|
-
export type ActionInit = {
|
|
4
|
-
meta?: Record<any, any>;
|
|
5
|
-
handler: (context: $context, params: any) => Promise<unknown>;
|
|
6
|
-
};
|
|
7
|
-
export type Action<ActionInitT extends ActionInit> = {
|
|
8
|
-
meta?: $meta;
|
|
9
|
-
handler: ActionInitT["handler"];
|
|
10
|
-
};
|
package/config/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare function config<ConfigT extends Config>(config: ConfigT): ConfigT;
|
|
2
|
-
export type Config = (mode: string) => Promise<Record<string, unknown>> | Record<string, unknown>;
|
|
3
|
-
export interface ConfigEnvironments<T extends Config> {
|
|
4
|
-
[key: string]: (env: Record<string, string>) => Partial<Awaited<ReturnType<T>>> | Promise<Partial<Awaited<ReturnType<T>>>>;
|
|
5
|
-
}
|
|
6
|
-
export declare function envToString(value: string | number | undefined, defaultValue: string): string;
|
|
7
|
-
export declare function envToNumber(value: string | undefined, defaultValue: number): number;
|
|
8
|
-
export declare function envToBoolean(value: string | number | undefined, defaultValue: boolean): boolean;
|
package/context/index.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { MilkioHttpRequest, MilkioHttpResponse, $types, Logger, Action, MilkioRuntimeInit, MilkioInit, CorsConfig } from "../index.ts";
|
|
2
|
-
export interface $context {
|
|
3
|
-
_: MilkioRuntimeInit<MilkioInit>;
|
|
4
|
-
develop: boolean;
|
|
5
|
-
executeId: string;
|
|
6
|
-
path: string;
|
|
7
|
-
logger: Logger;
|
|
8
|
-
http: ContextHttp<Record<any, any>>;
|
|
9
|
-
headers: Headers;
|
|
10
|
-
config: Readonly<Awaited<ReturnType<$types["configSchema"]["get"]>>>;
|
|
11
|
-
typia: Readonly<$types["generated"]["typiaSchema"]>;
|
|
12
|
-
call: <Module extends Promise<Action<any>>>(module: Module, params: Parameters<Awaited<Module>["handler"]>[1]) => Promise<ReturnType<Awaited<Module>["handler"]>>;
|
|
13
|
-
onFinally: (handler: () => void | Promise<void>) => void;
|
|
14
|
-
}
|
|
15
|
-
export interface ContextHttp<ParamsParsed = any> {
|
|
16
|
-
url: URL;
|
|
17
|
-
ip: string;
|
|
18
|
-
path: {
|
|
19
|
-
string: keyof $types["generated"]["routeSchema"];
|
|
20
|
-
array: Array<string>;
|
|
21
|
-
};
|
|
22
|
-
params: {
|
|
23
|
-
string: string;
|
|
24
|
-
parsed: ParamsParsed;
|
|
25
|
-
};
|
|
26
|
-
request: MilkioHttpRequest;
|
|
27
|
-
response: MilkioHttpResponse;
|
|
28
|
-
cors: CorsConfig;
|
|
29
|
-
}
|
|
30
|
-
export type ContextCreatedHandler = (context: $context) => Promise<void> | void;
|
package/event/index.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { $context, ContextHttp, Results, Logger, $meta } from "../index.ts";
|
|
2
|
-
export interface $events {
|
|
3
|
-
"*": {
|
|
4
|
-
key: keyof $events;
|
|
5
|
-
value: any;
|
|
6
|
-
};
|
|
7
|
-
"milkio:httpRequest": {
|
|
8
|
-
executeId: string;
|
|
9
|
-
path: string;
|
|
10
|
-
logger: Logger;
|
|
11
|
-
http: ContextHttp<Record<string, any>>;
|
|
12
|
-
};
|
|
13
|
-
"milkio:httpResponse": {
|
|
14
|
-
executeId: string;
|
|
15
|
-
path: string;
|
|
16
|
-
logger: Logger;
|
|
17
|
-
http: ContextHttp<Record<string, any>>;
|
|
18
|
-
context: $context;
|
|
19
|
-
success: boolean;
|
|
20
|
-
};
|
|
21
|
-
"milkio:httpNotFound": {
|
|
22
|
-
executeId: string;
|
|
23
|
-
path: string;
|
|
24
|
-
logger: Logger;
|
|
25
|
-
http: ContextHttp<Record<string, any>>;
|
|
26
|
-
};
|
|
27
|
-
"milkio:executeBefore": {
|
|
28
|
-
executeId: string;
|
|
29
|
-
path: string;
|
|
30
|
-
logger: Logger;
|
|
31
|
-
meta: $meta;
|
|
32
|
-
context: $context;
|
|
33
|
-
};
|
|
34
|
-
"milkio:executeAfter": {
|
|
35
|
-
executeId: string;
|
|
36
|
-
path: string;
|
|
37
|
-
logger: Logger;
|
|
38
|
-
meta: $meta;
|
|
39
|
-
context: $context;
|
|
40
|
-
results: Results<any>;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export declare function __initEventManager(): {
|
|
44
|
-
on: <Key extends keyof $events, Handler extends (event: $events[Key]) => Promise<void | boolean> | void | boolean>(key: Key, handler: Handler) => () => void;
|
|
45
|
-
off: <Key extends keyof $events, Handler extends (event: $events[Key]) => void>(key: Key, handler: Handler) => void;
|
|
46
|
-
emit: <Key extends keyof $events, Value extends $events[Key]>(key: Key, value: Value) => Promise<void>;
|
|
47
|
-
_hasEmitHandlers: (key: string) => boolean;
|
|
48
|
-
readonly _version: number;
|
|
49
|
-
emitAnyApproved: <Key extends keyof $events, Value extends $events[Key]>(key: Key, value: Value) => Promise<boolean>;
|
|
50
|
-
emitAllApproved: <Key extends keyof $events, Value extends $events[Key]>(key: Key, value: Value) => Promise<boolean>;
|
|
51
|
-
};
|
package/exception/index.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { MilkioResponseReject, Logger } from "../index.ts";
|
|
2
|
-
export interface $rejectCode {
|
|
3
|
-
REQUEST_FAIL: any;
|
|
4
|
-
NOT_DEVELOP_MODE: string;
|
|
5
|
-
REQUEST_TIMEOUT: {
|
|
6
|
-
timeout: number;
|
|
7
|
-
message: string;
|
|
8
|
-
};
|
|
9
|
-
NOT_FOUND: {
|
|
10
|
-
path: string;
|
|
11
|
-
};
|
|
12
|
-
PARAMS_TYPE_INCORRECT: {
|
|
13
|
-
path: string;
|
|
14
|
-
expected: string;
|
|
15
|
-
value: any;
|
|
16
|
-
message: string;
|
|
17
|
-
} | null;
|
|
18
|
-
RESULTS_TYPE_INCORRECT: {
|
|
19
|
-
path: string;
|
|
20
|
-
expected: string;
|
|
21
|
-
value: any;
|
|
22
|
-
message: string;
|
|
23
|
-
} | null;
|
|
24
|
-
UNACCEPTABLE: {
|
|
25
|
-
expected: string;
|
|
26
|
-
message: string;
|
|
27
|
-
};
|
|
28
|
-
PARAMS_TYPE_NOT_SUPPORTED: {
|
|
29
|
-
expected: string;
|
|
30
|
-
contentType: string | null;
|
|
31
|
-
params: string;
|
|
32
|
-
};
|
|
33
|
-
RESULTS_TYPE_NOT_SUPPORTED: {
|
|
34
|
-
expected: string;
|
|
35
|
-
};
|
|
36
|
-
INTERNAL_SERVER_ERROR: undefined;
|
|
37
|
-
METHOD_NOT_ALLOWED: undefined;
|
|
38
|
-
NETWORK_ERROR: undefined;
|
|
39
|
-
}
|
|
40
|
-
export type Reject = {
|
|
41
|
-
<Code extends keyof $rejectCode>(code: Code, ...data: $rejectCode[Code] extends undefined ? [] | [undefined] : [$rejectCode[Code]]): MilkioRejectError<Code, $rejectCode[Code]>;
|
|
42
|
-
<T>(obj: T): MilkioRejectError<Extract<keyof T, keyof $rejectCode>, any>;
|
|
43
|
-
};
|
|
44
|
-
export declare const reject: Reject;
|
|
45
|
-
export type MilkioRejectError<Code extends keyof $rejectCode = keyof $rejectCode, RejectData extends $rejectCode[Code] = $rejectCode[Code]> = {
|
|
46
|
-
code: Code;
|
|
47
|
-
data: RejectData;
|
|
48
|
-
stack: string;
|
|
49
|
-
$milkioReject: true;
|
|
50
|
-
};
|
|
51
|
-
export declare function exceptionHandler(executeId: string, logger: Logger, error: MilkioRejectError<any, any> | any): MilkioResponseReject;
|
package/execute/index.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { $context, $meta, Logger, Results, GeneratedInit } from "../index.ts";
|
|
2
|
-
export declare function __initExecuter(generated: GeneratedInit, runtime: any): {
|
|
3
|
-
__call: (context: $context, module: {
|
|
4
|
-
meta: any;
|
|
5
|
-
handler: any;
|
|
6
|
-
}, params?: any) => Promise<any>;
|
|
7
|
-
__execute: (routeSchema: any, options: {
|
|
8
|
-
createdExecuteId: string;
|
|
9
|
-
createdLogger: Logger;
|
|
10
|
-
path: string;
|
|
11
|
-
headers: Record<string, string> | Headers;
|
|
12
|
-
context: any | undefined;
|
|
13
|
-
paramsContentType?: string;
|
|
14
|
-
} & ({
|
|
15
|
-
params: Record<any, any>;
|
|
16
|
-
paramsType: "raw";
|
|
17
|
-
} | {
|
|
18
|
-
params: string;
|
|
19
|
-
paramsType: "string";
|
|
20
|
-
})) => Promise<{
|
|
21
|
-
executeId: string;
|
|
22
|
-
headers: Headers;
|
|
23
|
-
params: Record<any, unknown>;
|
|
24
|
-
results: Results<any>;
|
|
25
|
-
context: $context;
|
|
26
|
-
meta: Readonly<$meta>;
|
|
27
|
-
type: "action" | "stream";
|
|
28
|
-
emptyResult: boolean;
|
|
29
|
-
resultsTypeSafety: boolean;
|
|
30
|
-
finales: Array<() => void | Promise<void>>;
|
|
31
|
-
}>;
|
|
32
|
-
};
|
package/flow/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type MilkioFlow<T, TReturn = any, TNext = any> = {
|
|
2
|
-
emit: (flow: T) => void;
|
|
3
|
-
[Symbol.asyncIterator]: () => MilkioFlow<T>;
|
|
4
|
-
next(...[value]: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
|
|
5
|
-
return(): Promise<IteratorResult<T, TReturn>>;
|
|
6
|
-
throw(error: any): Promise<IteratorResult<T, TReturn>>;
|
|
7
|
-
};
|
|
8
|
-
export declare function createFlow<T>(): MilkioFlow<T>;
|
package/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export * from "./utils/part.ts";
|
|
2
|
-
export * from "./type-safety/index.ts";
|
|
3
|
-
export * from "./types/index.ts";
|
|
4
|
-
export * from "./config/index.ts";
|
|
5
|
-
export * from "./execute/index.ts";
|
|
6
|
-
export * from "./event/index.ts";
|
|
7
|
-
export * from "./flow/index.ts";
|
|
8
|
-
export * from "./world/index.ts";
|
|
9
|
-
export * from "./action/index.ts";
|
|
10
|
-
export * from "./stream/index.ts";
|
|
11
|
-
export * from "./typia/index.ts";
|
|
12
|
-
export * from "./logger/index.ts";
|
|
13
|
-
export * from "./context/index.ts";
|
|
14
|
-
export * from "./meta/index.ts";
|
|
15
|
-
export * from "./step/index.ts";
|
|
16
|
-
export * from "./listener/index.ts";
|
|
17
|
-
export * from "./exception/index.ts";
|
package/listener/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Mixin, GeneratedInit } from "../index.ts";
|
|
2
|
-
import type { __initExecuter } from "../execute/index.ts";
|
|
3
|
-
export type MilkioHttpRequest = Request;
|
|
4
|
-
export type MilkioHttpResponse = Mixin<ResponseInit, {
|
|
5
|
-
body: string | ReadableStream<Uint8Array> | Uint8Array | ArrayBuffer | Blob | null;
|
|
6
|
-
status: number;
|
|
7
|
-
headers: Record<string, string>;
|
|
8
|
-
}>;
|
|
9
|
-
export declare function __initListener(generated: GeneratedInit, runtime: any, executer: ReturnType<typeof __initExecuter>): {
|
|
10
|
-
port: any;
|
|
11
|
-
fetch: (options: {
|
|
12
|
-
request: MilkioHttpRequest;
|
|
13
|
-
envMode?: string;
|
|
14
|
-
env?: Record<any, any>;
|
|
15
|
-
routeSchema?: any;
|
|
16
|
-
rawResponse?: boolean;
|
|
17
|
-
}) => Promise<Response>;
|
|
18
|
-
handleMessage: (port: {
|
|
19
|
-
postMessage(message: any): void;
|
|
20
|
-
}, options: {
|
|
21
|
-
executeId: string;
|
|
22
|
-
path: string;
|
|
23
|
-
params?: Record<any, any>;
|
|
24
|
-
headers?: Record<string, string>;
|
|
25
|
-
} | string) => Promise<void>;
|
|
26
|
-
};
|
package/logger/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { $context, MilkioInit, MilkioRuntimeInit } from "../index.ts";
|
|
2
|
-
export type Log = ["(debug)" | "(info)" | "(warn)" | "(error)" | "(request)" | "(response)", string, string, string, string, ...Array<unknown>];
|
|
3
|
-
export interface Logger {
|
|
4
|
-
_: {
|
|
5
|
-
logs: Array<Log>;
|
|
6
|
-
tags: Map<string, unknown>;
|
|
7
|
-
submit: (context: $context) => Promise<void> | void;
|
|
8
|
-
};
|
|
9
|
-
setTag: (key: string, value: unknown) => void;
|
|
10
|
-
setLog: (...log: Log) => void;
|
|
11
|
-
debug: (description: string, ...params: Array<unknown>) => Log;
|
|
12
|
-
info: (description: string, ...params: Array<unknown>) => Log;
|
|
13
|
-
warn: (description: string, ...params: Array<unknown>) => Log;
|
|
14
|
-
error: (description: string, ...params: Array<unknown>) => Log;
|
|
15
|
-
request: (description: string, ...params: Array<unknown>) => Log;
|
|
16
|
-
response: (description: string, ...params: Array<unknown>) => Log;
|
|
17
|
-
}
|
|
18
|
-
export type LoggerInsertingHandler = (log: Log) => boolean;
|
|
19
|
-
export type LoggerSubmittingHandler = (context: $context, logs: Array<Log>, tags: Map<string, unknown>) => Promise<void> | void;
|
|
20
|
-
export declare function createLogger<MilkioRuntime extends MilkioRuntimeInit<MilkioRuntimeInit<MilkioInit>> = MilkioRuntimeInit<MilkioInit>>(runtime: MilkioRuntime, path: string, executeId: string): Logger;
|
package/meta/index.d.ts
DELETED
package/step/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface Steps<StageT extends Record<any, any>> {
|
|
2
|
-
step: StepFunction<StageT>;
|
|
3
|
-
run: () => Promise<Remove_<StageT>>;
|
|
4
|
-
}
|
|
5
|
-
type Remove_<T> = {
|
|
6
|
-
[K in keyof T as K extends `_${string}` ? never : K]: T[K];
|
|
7
|
-
};
|
|
8
|
-
type ToEmptyObject<T> = T extends undefined | null | never ? {} : T extends object ? T : {};
|
|
9
|
-
export type StepFunction<StageT extends Record<any, any>> = <HandlerT extends (stage: Readonly<StageT>) => Record<any, any> | Promise<Record<any, any>>>(handler: HandlerT) => Steps<Awaited<StageT> & ToEmptyObject<Awaited<ReturnType<HandlerT>>>>;
|
|
10
|
-
export declare function createStep(): Steps<{}>;
|
|
11
|
-
export {};
|
package/stream/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { $context, $meta } from "../index.ts";
|
|
2
|
-
export type StreamInit = {
|
|
3
|
-
meta?: $meta;
|
|
4
|
-
handler: (context: $context, params: any) => AsyncGenerator<unknown>;
|
|
5
|
-
};
|
|
6
|
-
export type Stream<StreamInitT extends StreamInit> = {
|
|
7
|
-
meta?: $meta;
|
|
8
|
-
handler: StreamInitT["handler"];
|
|
9
|
-
};
|
package/type-safety/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type TypeSafety<Value extends Record<any, any>> = (value: Value) => TypeSafetyValue;
|
|
2
|
-
export interface TypeSafetyValue {
|
|
3
|
-
type: <Type extends Record<any, any>>() => Type;
|
|
4
|
-
}
|
|
5
|
-
export interface TypeSafetyType<Type extends Record<any, any>> {
|
|
6
|
-
$milkioType: "type-safety";
|
|
7
|
-
value: Type;
|
|
8
|
-
}
|
|
9
|
-
export declare function typeSafety<Value extends Record<any, any>>(value: Value): TypeSafetyValue;
|
package/types/index.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { $rejectCode } from "../index.ts";
|
|
2
|
-
export interface $types {
|
|
3
|
-
[key: string]: Record<any, any>;
|
|
4
|
-
}
|
|
5
|
-
export type Override<P, S> = Omit<P, keyof S> & S;
|
|
6
|
-
export type Mixin<T, U> = U & Omit<T, keyof U>;
|
|
7
|
-
export type GeneratorGeneric<T> = T extends AsyncGenerator<infer I> ? I : never;
|
|
8
|
-
export type DBSelect<T extends Record<any, any>, K extends keyof T> = Omit<T, K>;
|
|
9
|
-
export type DBCreate<T, KO extends keyof T | never = never, TO extends Omit<T, KO> = Omit<T, KO>> = {
|
|
10
|
-
[K in keyof TO]?: TO[K] extends null ? undefined : Exclude<TO[K], null>;
|
|
11
|
-
};
|
|
12
|
-
export type DBUpdate<T, KO extends keyof T | never = never, TO extends Partial<Omit<T, KO>> = Partial<Omit<T, KO>>> = {
|
|
13
|
-
[K in keyof TO]?: TO[K] extends null ? undefined : Exclude<TO[K], null>;
|
|
14
|
-
};
|
|
15
|
-
export type ExecuteId = string | "global";
|
|
16
|
-
export interface GeneratedInit {
|
|
17
|
-
routeSchema: any;
|
|
18
|
-
handlerSchema: any;
|
|
19
|
-
typiaSchema: any;
|
|
20
|
-
events: any;
|
|
21
|
-
}
|
|
22
|
-
export interface Results<T> {
|
|
23
|
-
value: T;
|
|
24
|
-
}
|
|
25
|
-
export interface ExecuteOptions {
|
|
26
|
-
params?: Record<any, any>;
|
|
27
|
-
headers?: Record<string, string>;
|
|
28
|
-
}
|
|
29
|
-
export type Ping = [
|
|
30
|
-
{
|
|
31
|
-
connect: false;
|
|
32
|
-
delay: number;
|
|
33
|
-
error: any;
|
|
34
|
-
},
|
|
35
|
-
null
|
|
36
|
-
] | [
|
|
37
|
-
null,
|
|
38
|
-
{
|
|
39
|
-
connect: true;
|
|
40
|
-
delay: number;
|
|
41
|
-
serverTimestamp: number;
|
|
42
|
-
}
|
|
43
|
-
];
|
|
44
|
-
export interface ExecuteResultsOption {
|
|
45
|
-
executeId: string;
|
|
46
|
-
}
|
|
47
|
-
export type ExecuteActionResults<Path extends keyof Generated["routeSchema"], Generated extends $types["generated"] = $types["generated"]> = Generated["routeSchema"][Path]["result"];
|
|
48
|
-
export type ExecuteStreamResults<Path extends keyof Generated["routeSchema"], Generated extends $types["generated"] = $types["generated"]> = GeneratorGeneric<Generated["routeSchema"][Path]["result"]>;
|
|
49
|
-
export interface MilkioResponseReject<Code extends keyof $rejectCode = keyof $rejectCode> {
|
|
50
|
-
success: false;
|
|
51
|
-
code: Code;
|
|
52
|
-
reject: $rejectCode[Code];
|
|
53
|
-
executeId: string;
|
|
54
|
-
}
|
|
55
|
-
export interface MilkioResponseSuccess<Path extends keyof Generated["routeSchema"], Generated extends $types["generated"] = $types["generated"]> {
|
|
56
|
-
success: true;
|
|
57
|
-
data: Generated["routeSchema"][Path]["result"];
|
|
58
|
-
executeId: string;
|
|
59
|
-
}
|
|
60
|
-
export type BreadBrowse<T, U extends Record<any, any> = {}> = Omit<{
|
|
61
|
-
data: Array<T>;
|
|
62
|
-
}, keyof U> & U;
|
|
63
|
-
export type BreadRead<T, U extends Record<any, any> = {}> = Omit<{
|
|
64
|
-
data: T;
|
|
65
|
-
}, keyof U> & U;
|
|
66
|
-
export type BreadEdit<U extends Record<any, any> = {}> = U;
|
|
67
|
-
export type BreadAdd<U extends Record<any, any> = {}> = U;
|
|
68
|
-
export type BreadDelete<U extends Record<any, any> = {}> = U;
|
|
69
|
-
export interface CorsConfig {
|
|
70
|
-
corsAllowMethods?: string[];
|
|
71
|
-
corsAllowHeaders?: string[];
|
|
72
|
-
corsExposeHeaders?: string[];
|
|
73
|
-
corsAllowOrigin?: string[];
|
|
74
|
-
corsAllowCredentials?: boolean;
|
|
75
|
-
corsMaxAge?: number;
|
|
76
|
-
}
|
package/typia/index.d.ts
DELETED
package/utils/create-id.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function __createId(): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function headersToJSON(headers: Headers): Record<string, string>;
|
package/utils/merge-deep.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function mergeDeep<T extends Record<string, any>, U extends Record<string, any>>(target: T, source: U): T;
|
package/utils/part.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function part<T extends () => unknown>(handler: T): ReturnType<T>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function reviveJSONParse<T>(json: T): T;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Log, MilkioInit, MilkioRuntimeInit } from "../index.ts";
|
|
2
|
-
interface CookbookEvent {
|
|
3
|
-
type: "milkio@logger";
|
|
4
|
-
log: Log;
|
|
5
|
-
}
|
|
6
|
-
export declare function sendCookbookEvent(runtime: MilkioRuntimeInit<MilkioInit>, event: CookbookEvent): Promise<void>;
|
|
7
|
-
export {};
|
package/utils/trie.d.ts
DELETED
package/world/index.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { type $types, __initListener, __initEventManager, type ExecuteId, type Logger, type Mixin, type GeneratedInit, type Ping, type LoggerSubmittingHandler, type LoggerInsertingHandler, type CorsConfig } from "../index.ts";
|
|
2
|
-
export interface MilkioInit {
|
|
3
|
-
port: number;
|
|
4
|
-
develop: boolean;
|
|
5
|
-
fetchEnv?: (key: string) => string | undefined;
|
|
6
|
-
accessKey?: string;
|
|
7
|
-
http?: {
|
|
8
|
-
cors?: CorsConfig;
|
|
9
|
-
};
|
|
10
|
-
ignorePathLevel?: number;
|
|
11
|
-
realIp?: (headers: Headers) => string;
|
|
12
|
-
executeId?: (headers: Headers) => string | Promise<string>;
|
|
13
|
-
onLoggerSubmitting?: LoggerSubmittingHandler;
|
|
14
|
-
onLoggerInserting?: LoggerInsertingHandler;
|
|
15
|
-
bootstraps?: Array<(world: any) => Promise<void> | void>;
|
|
16
|
-
}
|
|
17
|
-
export type MilkioRuntimeInit<T extends MilkioInit> = Mixin<T, {
|
|
18
|
-
executeId: (headers: Headers) => string | Promise<string>;
|
|
19
|
-
runtime: {
|
|
20
|
-
request: Map<ExecuteId, {
|
|
21
|
-
logger: Logger;
|
|
22
|
-
}>;
|
|
23
|
-
config: Awaited<ReturnType<$types["generated"]["configSchema"]>>;
|
|
24
|
-
app: any;
|
|
25
|
-
};
|
|
26
|
-
on: Awaited<ReturnType<typeof __initEventManager>>["on"];
|
|
27
|
-
off: Awaited<ReturnType<typeof __initEventManager>>["off"];
|
|
28
|
-
emit: Awaited<ReturnType<typeof __initEventManager>>["emit"];
|
|
29
|
-
emitAnyApproved: Awaited<ReturnType<typeof __initEventManager>>["emitAnyApproved"];
|
|
30
|
-
emitAllApproved: Awaited<ReturnType<typeof __initEventManager>>["emitAllApproved"];
|
|
31
|
-
_hasEmitHandlers: Awaited<ReturnType<typeof __initEventManager>>["_hasEmitHandlers"];
|
|
32
|
-
_emitHandlersVersion: number;
|
|
33
|
-
}>;
|
|
34
|
-
export declare function createWorld<MilkioOptions extends MilkioInit>(generated: GeneratedInit, configSchema: {
|
|
35
|
-
get: () => Promise<Record<any, any>>;
|
|
36
|
-
}, options: MilkioOptions): Promise<unknown>;
|
|
37
|
-
export interface MilkioWorld<Generated extends GeneratedInit, MilkioOptions extends MilkioInit = MilkioInit> {
|
|
38
|
-
_: MilkioRuntimeInit<MilkioOptions>;
|
|
39
|
-
on: <Key extends keyof Generated["events"], Handler extends (event: Generated["events"][Key]) => void>(key: Key, handler: Handler) => (() => void);
|
|
40
|
-
off: <Key extends keyof Generated["events"], Handler extends (event: Generated["events"][Key]) => void>(key: Key, handler: Handler) => void;
|
|
41
|
-
emit: <Key extends keyof Generated["events"], Value extends Generated["events"][Key]>(key: Key, value: Value) => Promise<void>;
|
|
42
|
-
emitAnyApproved: <Key extends keyof Generated["events"], Value extends Generated["events"][Key]>(key: Key, value: Value) => Promise<boolean>;
|
|
43
|
-
emitAllApproved: <Key extends keyof Generated["events"], Value extends Generated["events"][Key]>(key: Key, value: Value) => Promise<boolean>;
|
|
44
|
-
ping: (options?: {
|
|
45
|
-
timeout?: number;
|
|
46
|
-
}) => Promise<Ping>;
|
|
47
|
-
listener: Awaited<ReturnType<typeof __initListener>>;
|
|
48
|
-
config: Readonly<Awaited<ReturnType<$types["configSchema"]["get"]>>>;
|
|
49
|
-
}
|