milkio 1.0.0-alpha.20 → 1.0.0-alpha.22
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/.publish/releases/1.0.0-alpha.21.md +13 -0
- package/context/index.ts +2 -1
- package/execute/index.ts +2 -1
- package/package.json +1 -1
- package/step/index.ts +2 -2
package/context/index.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type MilkioHttpRequest, type MilkioHttpResponse, type $types, type Logger, type Steps, type Mixin, type ExecuteOptions, type Action } from "..";
|
|
2
2
|
|
|
3
3
|
export interface $context {
|
|
4
|
+
develop: boolean;
|
|
4
5
|
executeId: string;
|
|
5
6
|
environment: string;
|
|
6
7
|
path: string;
|
|
7
8
|
logger: Logger;
|
|
8
9
|
http?: ContextHttp<Record<any, any>>;
|
|
9
|
-
|
|
10
|
+
createStep: () => Steps<{}>;
|
|
10
11
|
getConfig: <Namespace extends keyof $types["generated"]["configSchema"]>(namespace: Namespace) => Promise<Readonly<Awaited<ReturnType<$types["generated"]["configSchema"][Namespace][0]>>>>;
|
|
11
12
|
call: <Module extends Promise<{ default: Action<any> }>>(module: Module, params: Parameters<Awaited<Module>["default"]["handler"]>[1]) => Promise<ReturnType<Awaited<Module>["default"]["handler"]>>;
|
|
12
13
|
}
|
package/execute/index.ts
CHANGED
|
@@ -65,13 +65,14 @@ export const __initExecuter = <MilkioRuntime extends MilkioRuntimeInit<MilkioRun
|
|
|
65
65
|
if (options.mixinContext?.http?.params?.string) options.mixinContext.http.params.parsed = params; // listen でパースしたパラメータを渡す
|
|
66
66
|
const context = {
|
|
67
67
|
...(options.mixinContext ? options.mixinContext : {}),
|
|
68
|
+
develop: runtime.develop,
|
|
68
69
|
envMode,
|
|
69
70
|
path: options.path,
|
|
70
71
|
logger: options.createdLogger,
|
|
71
72
|
executeId: options.createdExecuteId,
|
|
72
73
|
getConfig: (namespace: string) => getConfig(generated, env, envMode, namespace),
|
|
73
74
|
call: (module: any, options: any) => __call(context, module, options),
|
|
74
|
-
|
|
75
|
+
createStep: createStep,
|
|
75
76
|
} as unknown as $context;
|
|
76
77
|
const results: Results<unknown> = { value: undefined };
|
|
77
78
|
|
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
|
};
|