milkio 1.0.0-beta.147 → 1.0.0-beta.149
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 -3
- package/context/index.d.ts +2 -2
- package/event/index.d.ts +6 -6
- package/execute/index.d.ts +4 -4
- package/index.js +1 -1
- package/logger/index.d.ts +3 -3
- package/meta/index.d.ts +1 -1
- package/package.json +1 -1
- package/stream/index.d.ts +3 -3
package/action/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MilkioContext } from "../index.ts";
|
|
2
2
|
export declare function action<ActionInitT extends ActionInit>(init: ActionInitT): Action<ActionInitT>;
|
|
3
3
|
export type ActionInit = {
|
|
4
|
-
meta?:
|
|
5
|
-
handler: (context:
|
|
4
|
+
meta?: Record<any, any>;
|
|
5
|
+
handler: (context: MilkioContext, params: any) => Promise<unknown>;
|
|
6
6
|
};
|
|
7
7
|
export type Action<ActionInitT extends ActionInit> = {
|
|
8
8
|
$milkioType: "action";
|
|
9
|
+
meta: any;
|
|
9
10
|
handler: ActionInitT["handler"];
|
|
10
11
|
};
|
package/context/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MilkioHttpRequest, MilkioHttpResponse, $types, Logger, Action, MilkioRuntimeInit, MilkioInit } from "../index.ts";
|
|
2
|
-
export interface
|
|
2
|
+
export interface MilkioContext {
|
|
3
3
|
_: MilkioRuntimeInit<MilkioInit>;
|
|
4
4
|
develop: boolean;
|
|
5
5
|
executeId: string;
|
|
@@ -29,4 +29,4 @@ export interface ContextHttp<ParamsParsed = any> {
|
|
|
29
29
|
request: MilkioHttpRequest;
|
|
30
30
|
response: MilkioHttpResponse;
|
|
31
31
|
}
|
|
32
|
-
export type ContextCreatedHandler = (context:
|
|
32
|
+
export type ContextCreatedHandler = (context: MilkioContext) => Promise<void> | void;
|
package/event/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MilkioContext, ContextHttp, Results, Logger, MilkioMeta } 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: MilkioContext;
|
|
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: MilkioMeta;
|
|
32
|
+
context: MilkioContext;
|
|
33
33
|
};
|
|
34
34
|
"milkio:executeAfter": {
|
|
35
35
|
executeId: string;
|
|
36
36
|
path: string;
|
|
37
37
|
logger: Logger;
|
|
38
|
-
meta:
|
|
39
|
-
context:
|
|
38
|
+
meta: MilkioMeta;
|
|
39
|
+
context: MilkioContext;
|
|
40
40
|
results: Results<any>;
|
|
41
41
|
};
|
|
42
42
|
}
|
package/execute/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MilkioContext, MilkioMeta, Logger, Results, GeneratedInit } from "../index.ts";
|
|
2
2
|
export declare function __initExecuter(generated: GeneratedInit, runtime: any): {
|
|
3
|
-
__call: (context:
|
|
3
|
+
__call: (context: MilkioContext, module: {
|
|
4
4
|
default: any;
|
|
5
5
|
}, params?: any) => Promise<any>;
|
|
6
6
|
__execute: (routeSchema: any, options: {
|
|
@@ -20,8 +20,8 @@ export declare function __initExecuter(generated: GeneratedInit, runtime: any):
|
|
|
20
20
|
headers: Headers;
|
|
21
21
|
params: Record<any, unknown>;
|
|
22
22
|
results: Results<any>;
|
|
23
|
-
context:
|
|
24
|
-
meta: Readonly
|
|
23
|
+
context: MilkioContext;
|
|
24
|
+
meta: Readonly<MilkioMeta>;
|
|
25
25
|
type: "action" | "stream";
|
|
26
26
|
emptyResult: boolean;
|
|
27
27
|
resultsTypeSafety: boolean;
|