milkio 1.0.0-beta.17 → 1.0.0-beta.170

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/action/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import type { $context, $meta } from "../index.ts";
2
- export declare function action<ActionInitT extends ActionInit>(init: ActionInitT): Action<ActionInitT>;
1
+ import { $meta } from "../meta/index.ts";
2
+ import { $context } from "../context/index.ts";
3
3
  export type ActionInit = {
4
- meta?: $meta;
4
+ meta?: Record<any, any>;
5
5
  handler: (context: $context, params: any) => Promise<unknown>;
6
6
  };
7
7
  export type Action<ActionInitT extends ActionInit> = {
8
- $milkioType: "action";
9
- meta: ActionInitT["meta"] extends undefined ? {} : ActionInitT["meta"];
8
+ meta?: $meta;
10
9
  handler: ActionInitT["handler"];
11
10
  };
@@ -3,14 +3,13 @@ export interface $context {
3
3
  _: MilkioRuntimeInit<MilkioInit>;
4
4
  develop: boolean;
5
5
  executeId: string;
6
- emit: MilkioRuntimeInit<MilkioInit>["emit"];
7
6
  path: string;
8
7
  logger: Logger;
9
8
  http: ContextHttp<Record<any, any>>;
9
+ headers: Headers;
10
10
  config: Readonly<Awaited<ReturnType<$types["configSchema"]["get"]>>>;
11
- call: <Module extends Promise<{
12
- default: Action<any>;
13
- }>>(module: Module, params: Parameters<Awaited<Module>["default"]["handler"]>[1]) => Promise<ReturnType<Awaited<Module>["default"]["handler"]>>;
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"]>>;
14
13
  onFinally: (handler: () => void | Promise<void>) => void;
15
14
  }
16
15
  export interface ContextHttp<ParamsParsed = any> {
package/event/index.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import type { $context, ContextHttp, Results, Logger, $meta } from "../index.ts";
2
2
  export interface $events {
3
+ "*": {
4
+ key: keyof $events;
5
+ value: any;
6
+ };
3
7
  "milkio:httpRequest": {
4
8
  executeId: string;
5
9
  path: string;
@@ -12,6 +16,7 @@ export interface $events {
12
16
  logger: Logger;
13
17
  http: ContextHttp<Record<string, any>>;
14
18
  context: $context;
19
+ success: boolean;
15
20
  };
16
21
  "milkio:httpNotFound": {
17
22
  executeId: string;
@@ -1,6 +1,5 @@
1
1
  import type { MilkioResponseReject, Logger } from "../index.ts";
2
2
  export interface $rejectCode {
3
- FAIL: string;
4
3
  REQUEST_FAIL: any;
5
4
  NOT_DEVELOP_MODE: string;
6
5
  REQUEST_TIMEOUT: {
@@ -33,6 +32,7 @@ export interface $rejectCode {
33
32
  expected: string;
34
33
  };
35
34
  INTERNAL_SERVER_ERROR: undefined;
35
+ METHOD_NOT_ALLOWED: undefined;
36
36
  }
37
37
  export declare function reject<Code extends keyof $rejectCode, RejectData extends $rejectCode[Code]>(code: Code, data: RejectData): MilkioRejectError<Code, RejectData>;
38
38
  export type MilkioRejectError<Code extends keyof $rejectCode = keyof $rejectCode, RejectData extends $rejectCode[Code] = $rejectCode[Code]> = {
@@ -1,2 +1,2 @@
1
- export type ExecuteIdGenerator = (request?: Request) => string | Promise<string>;
1
+ export type ExecuteIdGenerator = (headers?: Headers) => string | Promise<string>;
2
2
  export declare function defineDefaultExecuteIdGenerator(): () => string;
@@ -1,14 +1,15 @@
1
1
  import type { $context, $meta, Logger, Results, GeneratedInit } from "../index.ts";
2
2
  export declare function __initExecuter(generated: GeneratedInit, runtime: any): {
3
3
  __call: (context: $context, module: {
4
- default: any;
4
+ meta: any;
5
+ handler: any;
5
6
  }, params?: any) => Promise<any>;
6
7
  __execute: (routeSchema: any, options: {
7
8
  createdExecuteId: string;
8
9
  createdLogger: Logger;
9
10
  path: string;
10
11
  headers: Record<string, string> | Headers;
11
- mixinContext: Record<any, any> | undefined;
12
+ context: any | undefined;
12
13
  } & ({
13
14
  params: Record<any, any>;
14
15
  paramsType: "raw";
package/index.d.ts CHANGED
@@ -1,16 +1,14 @@
1
+ export * from "./utils/part.ts";
1
2
  export * from "./type-safety/index.ts";
2
- export * from "@southern-aurora/tson";
3
3
  export * from "./types/index.ts";
4
4
  export * from "./config/index.ts";
5
5
  export * from "./execute/index.ts";
6
- export * from "./bootstrap/index.ts";
7
6
  export * from "./event/index.ts";
8
7
  export * from "./flow/index.ts";
9
- export * from "./handler/index.ts";
10
8
  export * from "./world/index.ts";
11
- export * from "./command/index.ts";
12
9
  export * from "./action/index.ts";
13
10
  export * from "./stream/index.ts";
11
+ export * from "./typia/index.ts";
14
12
  export * from "./logger/index.ts";
15
13
  export * from "./context/index.ts";
16
14
  export * from "./meta/index.ts";