milkio 1.0.0-alpha.48 → 1.0.0-alpha.49
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/context/index.ts +2 -1
- package/execute/index.ts +1 -0
- package/listener/index.ts +1 -1
- package/package.json +1 -1
package/context/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { MilkioHttpRequest, MilkioHttpResponse, $types, Logger, Action } from '..'
|
|
1
|
+
import type { MilkioHttpRequest, MilkioHttpResponse, $types, Logger, Action, MilkioRuntimeInit, MilkioInit } from '..'
|
|
2
2
|
|
|
3
3
|
export interface $context {
|
|
4
|
+
_: MilkioRuntimeInit<MilkioInit>
|
|
4
5
|
develop: boolean
|
|
5
6
|
executeId: string
|
|
6
7
|
environment: string
|
package/execute/index.ts
CHANGED
|
@@ -73,6 +73,7 @@ export function __initExecuter(generated: GeneratedInit, runtime: any) {
|
|
|
73
73
|
executeId: options.createdExecuteId,
|
|
74
74
|
config: runtime.runtime.config,
|
|
75
75
|
call: (module: any, options: any) => __call(context, module, options),
|
|
76
|
+
_: runtime
|
|
76
77
|
} as unknown as $context
|
|
77
78
|
const results: Results<any> = { value: undefined }
|
|
78
79
|
|
package/listener/index.ts
CHANGED
|
@@ -87,7 +87,7 @@ export function __initListener(generated: GeneratedInit, runtime: any, executer:
|
|
|
87
87
|
|
|
88
88
|
await runtime.emit('milkio:httpRequest', { executeId, logger, path: http.path.string as string, http })
|
|
89
89
|
|
|
90
|
-
if (!runtime.develop && ((http.path.string as string).
|
|
90
|
+
if (!runtime.develop && ((http.path.string as string).startsWith('/__/'))) {
|
|
91
91
|
await runtime.emit('milkio:httpNotFound', { executeId, logger, path: http.path.string as string, http })
|
|
92
92
|
throw reject('NOT_FOUND', { path: http.path.string as string })
|
|
93
93
|
}
|