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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.38.8";
4
+ const version = "0.38.10";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -597,27 +597,7 @@ function getUrlPrefix(path, method) {
597
597
 
598
598
  async function orchestrate(route, event, _input) {
599
599
  const silgiCtx = useSilgi();
600
- if (route.method !== event.req.method) {
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);
@@ -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?: string;
706
+ route: string;
707
707
  method?: HTTPMethod;
708
708
  schema?: ResolvedSchemaDefinition;
709
709
  setup: ServiceSetup;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.38.8",
4
+ "version": "0.38.10",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {