milkio 1.0.0-beta.156 → 1.0.0-beta.158
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 +4 -4
- package/context/index.d.ts +2 -3
- package/event/index.d.ts +6 -6
- package/exception/index.d.ts +0 -1
- package/execute/index.d.ts +4 -4
- package/index.d.ts +0 -1
- package/index.js +11 -16
- package/logger/index.d.ts +3 -3
- package/meta/index.d.ts +1 -1
- package/package.json +1 -1
- package/stream/index.d.ts +4 -4
- package/types/index.d.ts +1 -0
- package/world/index.d.ts +6 -6
- package/handler/index.d.ts +0 -3
package/action/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { $meta } from "../meta/index.ts";
|
|
2
|
+
import { $context } from "../context/index.ts";
|
|
3
3
|
export type ActionInit = {
|
|
4
4
|
meta?: Record<any, any>;
|
|
5
|
-
handler: (context:
|
|
5
|
+
handler: (context: $context, params: any) => Promise<unknown>;
|
|
6
6
|
};
|
|
7
7
|
export type Action<ActionInitT extends ActionInit> = {
|
|
8
|
-
meta?:
|
|
8
|
+
meta?: $meta;
|
|
9
9
|
handler: ActionInitT["handler"];
|
|
10
10
|
};
|
package/context/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { MilkioHttpRequest, MilkioHttpResponse, $types, Logger, Action, MilkioRuntimeInit, MilkioInit } from "../index.ts";
|
|
2
|
-
export interface
|
|
2
|
+
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>>;
|
|
@@ -27,4 +26,4 @@ export interface ContextHttp<ParamsParsed = any> {
|
|
|
27
26
|
request: MilkioHttpRequest;
|
|
28
27
|
response: MilkioHttpResponse;
|
|
29
28
|
}
|
|
30
|
-
export type ContextCreatedHandler = (context:
|
|
29
|
+
export type ContextCreatedHandler = (context: $context) => Promise<void> | void;
|
package/event/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { $context, ContextHttp, Results, Logger, $meta } from "../index.ts";
|
|
2
2
|
export interface $events {
|
|
3
3
|
"*": {
|
|
4
4
|
key: keyof $events;
|
|
@@ -15,7 +15,7 @@ export interface $events {
|
|
|
15
15
|
path: string;
|
|
16
16
|
logger: Logger;
|
|
17
17
|
http: ContextHttp<Record<string, any>>;
|
|
18
|
-
context:
|
|
18
|
+
context: $context;
|
|
19
19
|
success: boolean;
|
|
20
20
|
};
|
|
21
21
|
"milkio:httpNotFound": {
|
|
@@ -28,15 +28,15 @@ export interface $events {
|
|
|
28
28
|
executeId: string;
|
|
29
29
|
path: string;
|
|
30
30
|
logger: Logger;
|
|
31
|
-
meta:
|
|
32
|
-
context:
|
|
31
|
+
meta: $meta;
|
|
32
|
+
context: $context;
|
|
33
33
|
};
|
|
34
34
|
"milkio:executeAfter": {
|
|
35
35
|
executeId: string;
|
|
36
36
|
path: string;
|
|
37
37
|
logger: Logger;
|
|
38
|
-
meta:
|
|
39
|
-
context:
|
|
38
|
+
meta: $meta;
|
|
39
|
+
context: $context;
|
|
40
40
|
results: Results<any>;
|
|
41
41
|
};
|
|
42
42
|
}
|
package/exception/index.d.ts
CHANGED
package/execute/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { $context, $meta, Logger, Results, GeneratedInit } from "../index.ts";
|
|
2
2
|
export declare function __initExecuter(generated: GeneratedInit, runtime: any): {
|
|
3
|
-
__call: (context:
|
|
3
|
+
__call: (context: $context, module: {
|
|
4
4
|
meta: any;
|
|
5
5
|
handler: any;
|
|
6
6
|
}, params?: any) => Promise<any>;
|
|
@@ -21,8 +21,8 @@ export declare function __initExecuter(generated: GeneratedInit, runtime: any):
|
|
|
21
21
|
headers: Headers;
|
|
22
22
|
params: Record<any, unknown>;
|
|
23
23
|
results: Results<any>;
|
|
24
|
-
context:
|
|
25
|
-
meta: Readonly
|
|
24
|
+
context: $context;
|
|
25
|
+
meta: Readonly<$meta>;
|
|
26
26
|
type: "action" | "stream";
|
|
27
27
|
emptyResult: boolean;
|
|
28
28
|
resultsTypeSafety: boolean;
|
package/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export * from "./execute/index.ts";
|
|
|
6
6
|
export * from "./bootstrap/index.ts";
|
|
7
7
|
export * from "./event/index.ts";
|
|
8
8
|
export * from "./flow/index.ts";
|
|
9
|
-
export * from "./handler/index.ts";
|
|
10
9
|
export * from "./world/index.ts";
|
|
11
10
|
export * from "./action/index.ts";
|
|
12
11
|
export * from "./stream/index.ts";
|