milkio 1.0.0-alpha.21 → 1.0.0-alpha.23
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/.co.toml +0 -0
- package/.publish/publish.json +0 -0
- package/.publish/releases/0.0.0.md +0 -0
- package/.publish/releases/0.1.0.md +0 -0
- package/.publish/releases/0.2.0.md +0 -0
- package/.publish/releases/0.3.0.md +0 -0
- package/.publish/releases/0.4.0.md +0 -0
- package/.publish/releases/0.5.0.md +0 -0
- package/.publish/releases/0.6.0.md +0 -0
- package/.publish/releases/0.8.0.md +0 -0
- package/.publish/releases/1.0.0-alpha.21.md +13 -0
- package/.publish/releases-github/0.0.0.md +0 -0
- package/.publish/releases-github/0.1.0.md +0 -0
- package/.publish/releases-github/0.2.0.md +0 -0
- package/.publish/releases-github/0.3.0.md +0 -0
- package/.publish/releases-github/0.4.0.md +0 -0
- package/.publish/releases-github/0.5.0.md +0 -0
- package/.publish/releases-github/0.6.0.md +0 -0
- package/.publish/releases-github/0.8.0.md +0 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/action/index.ts +0 -0
- package/command/index.ts +1 -1
- package/context/index.ts +2 -2
- package/events/index.ts +0 -0
- package/exception/index.ts +0 -0
- package/execute/execute-id-generator.ts +0 -0
- package/execute/index.ts +2 -2
- package/index.ts +0 -0
- package/listener/index.ts +1 -1
- package/logger/index.ts +1 -1
- package/meta/index.ts +0 -0
- package/package.json +1 -1
- package/step/index.ts +2 -2
- package/stream/index.ts +0 -0
- package/tsconfig.json +0 -0
- package/types/index.ts +0 -0
- package/utils/create-id.ts +0 -0
- package/utils/send-cookbook-event.ts +0 -0
- package/world/index.ts +2 -2
package/.co.toml
CHANGED
|
File without changes
|
package/.publish/publish.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/action/index.ts
CHANGED
|
File without changes
|
package/command/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type Command<CommandInitT extends CommandInit> = {
|
|
|
15
15
|
handler: CommandInitT["handler"];
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
export const __initCommander =
|
|
18
|
+
export const __initCommander = (generated: GeneratedInit, runtime: any) => {
|
|
19
19
|
const commander = async (argv: Array<string>, options?: { onNotFound?: () => any }) => {
|
|
20
20
|
const params = {
|
|
21
21
|
path: "index",
|
package/context/index.ts
CHANGED
|
@@ -6,8 +6,8 @@ export interface $context {
|
|
|
6
6
|
environment: string;
|
|
7
7
|
path: string;
|
|
8
8
|
logger: Logger;
|
|
9
|
-
http
|
|
10
|
-
|
|
9
|
+
http: ContextHttp<Record<any, any>>;
|
|
10
|
+
createStep: () => Steps<{}>;
|
|
11
11
|
getConfig: <Namespace extends keyof $types["generated"]["configSchema"]>(namespace: Namespace) => Promise<Readonly<Awaited<ReturnType<$types["generated"]["configSchema"][Namespace][0]>>>>;
|
|
12
12
|
call: <Module extends Promise<{ default: Action<any> }>>(module: Module, params: Parameters<Awaited<Module>["default"]["handler"]>[1]) => Promise<ReturnType<Awaited<Module>["default"]["handler"]>>;
|
|
13
13
|
}
|
package/events/index.ts
CHANGED
|
File without changes
|
package/exception/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/execute/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TSON } from "@southern-aurora/tson";
|
|
|
3
3
|
import { reject, type $context, type $meta, type Logger, type MilkioRuntimeInit, type Results, type GeneratedInit, type MilkioInit, createStep, getConfig } from "..";
|
|
4
4
|
import { headersToJSON } from "../utils/headers-to-json";
|
|
5
5
|
|
|
6
|
-
export const __initExecuter =
|
|
6
|
+
export const __initExecuter = (generated: GeneratedInit, runtime: any) => {
|
|
7
7
|
const __execute = async (
|
|
8
8
|
env: Record<any, any> | undefined,
|
|
9
9
|
envMode: string | undefined,
|
|
@@ -72,7 +72,7 @@ export const __initExecuter = <MilkioRuntime extends MilkioRuntimeInit<MilkioRun
|
|
|
72
72
|
executeId: options.createdExecuteId,
|
|
73
73
|
getConfig: (namespace: string) => getConfig(generated, env, envMode, namespace),
|
|
74
74
|
call: (module: any, options: any) => __call(context, module, options),
|
|
75
|
-
|
|
75
|
+
createStep: createStep,
|
|
76
76
|
} as unknown as $context;
|
|
77
77
|
const results: Results<unknown> = { value: undefined };
|
|
78
78
|
|
package/index.ts
CHANGED
|
File without changes
|
package/listener/index.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type MilkioHttpResponse = Mixin<
|
|
|
14
14
|
}
|
|
15
15
|
>;
|
|
16
16
|
|
|
17
|
-
export const __initListener =
|
|
17
|
+
export const __initListener = (generated: GeneratedInit, runtime: any, executer: ReturnType<typeof __initExecuter>) => {
|
|
18
18
|
const port = runtime.port;
|
|
19
19
|
const fetch = async (options: {
|
|
20
20
|
request: MilkioHttpRequest;
|
package/logger/index.ts
CHANGED
|
@@ -52,7 +52,7 @@ export const createLogger = <MilkioRuntime extends MilkioRuntimeInit<MilkioRunti
|
|
|
52
52
|
if (!inserting(log)) return log;
|
|
53
53
|
|
|
54
54
|
logger._.logs.push([...log]);
|
|
55
|
-
if (runtime.
|
|
55
|
+
if (runtime.develop) {
|
|
56
56
|
void sendCookbookEvent(runtime, {
|
|
57
57
|
type: "milkio@logger",
|
|
58
58
|
log: log,
|
package/meta/index.ts
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/step/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ type ToEmptyObject<T> = T extends undefined | null | never ? {} : T extends obje
|
|
|
11
11
|
|
|
12
12
|
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>>>>;
|
|
13
13
|
|
|
14
|
-
export const createStep = (): Steps<{}>
|
|
14
|
+
export const createStep = (): Steps<{}> => {
|
|
15
15
|
const stepController = {
|
|
16
16
|
$milkioType: "step",
|
|
17
17
|
_steps: [] as Array<(stage: any) => Promise<any>>,
|
|
@@ -32,5 +32,5 @@ export const createStep = (): Steps<{}>["step"] => {
|
|
|
32
32
|
return result;
|
|
33
33
|
},
|
|
34
34
|
};
|
|
35
|
-
return stepController
|
|
35
|
+
return stepController as any as Steps<{}>;
|
|
36
36
|
};
|
package/stream/index.ts
CHANGED
|
File without changes
|
package/tsconfig.json
CHANGED
|
File without changes
|
package/types/index.ts
CHANGED
|
File without changes
|
package/utils/create-id.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/world/index.ts
CHANGED
|
@@ -81,7 +81,7 @@ export type MilkioWorld<MilkioOptions extends MilkioInit = MilkioInit> = {
|
|
|
81
81
|
emit: Awaited<ReturnType<typeof __initEventManager>>["emit"];
|
|
82
82
|
ping: (options?: { timeout?: number }) => Promise<Ping>;
|
|
83
83
|
// commander
|
|
84
|
-
commander: Awaited<ReturnType<typeof __initCommander
|
|
84
|
+
commander: Awaited<ReturnType<typeof __initCommander>>;
|
|
85
85
|
// listener
|
|
86
|
-
listener: Awaited<ReturnType<typeof __initListener
|
|
86
|
+
listener: Awaited<ReturnType<typeof __initListener>>;
|
|
87
87
|
};
|