silgi 0.38.8 → 0.38.10
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/dist/cli/index.mjs +1 -1
- package/dist/core/index.mjs +1 -21
- package/dist/types/index.d.mts +2 -2
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/core/index.mjs
CHANGED
|
@@ -597,27 +597,7 @@ function getUrlPrefix(path, method) {
|
|
|
597
597
|
|
|
598
598
|
async function orchestrate(route, event, _input) {
|
|
599
599
|
const silgiCtx = useSilgi();
|
|
600
|
-
|
|
601
|
-
throw createError({
|
|
602
|
-
statusCode: 405,
|
|
603
|
-
statusMessage: "Method Not Allowed",
|
|
604
|
-
data: {
|
|
605
|
-
method: event.method,
|
|
606
|
-
expected: route.method,
|
|
607
|
-
route: route.route
|
|
608
|
-
}
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
if (!route.route) {
|
|
612
|
-
throw createError({
|
|
613
|
-
statusCode: 500,
|
|
614
|
-
statusMessage: "Route not found",
|
|
615
|
-
data: {
|
|
616
|
-
route
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
|
-
}
|
|
620
|
-
const silgiURL = getUrlPrefix(route.route, route.method);
|
|
600
|
+
const silgiURL = getUrlPrefix(route.route || event.req.url, route.method);
|
|
621
601
|
const input = _input || (route.setup.rules?.readBeforeBody === false ? {} : await parseRequestInput(event.req));
|
|
622
602
|
const hookContext = { earlyReturnValue: false };
|
|
623
603
|
const routerParams = _input ? input.path : getRouterParams(event);
|
package/dist/types/index.d.mts
CHANGED
|
@@ -576,7 +576,7 @@ type ModuleHookContext = Readonly<{
|
|
|
576
576
|
success?: boolean;
|
|
577
577
|
cached?: boolean;
|
|
578
578
|
}> & {
|
|
579
|
-
hookContext
|
|
579
|
+
hookContext: {
|
|
580
580
|
earlyReturnValue: any | false;
|
|
581
581
|
};
|
|
582
582
|
};
|
|
@@ -703,7 +703,7 @@ type HTTPMethod = SilgiRuntimeMethods extends Record<string, any> ? keyof SilgiR
|
|
|
703
703
|
interface SilgiMeta extends Record<string, unknown> {
|
|
704
704
|
}
|
|
705
705
|
interface SilgiRoute {
|
|
706
|
-
route
|
|
706
|
+
route: string;
|
|
707
707
|
method?: HTTPMethod;
|
|
708
708
|
schema?: ResolvedSchemaDefinition;
|
|
709
709
|
setup: ServiceSetup;
|