silgi 0.41.16 → 0.41.17

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.41.16";
4
+ const version = "0.41.17";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -961,7 +961,7 @@ async function middleware(event, url) {
961
961
  cause: error
962
962
  });
963
963
  }
964
- return m.middleware.handler(event, silgiContext);
964
+ return m.middleware.handler?.(event, silgiContext);
965
965
  });
966
966
  }
967
967
  }
@@ -995,7 +995,7 @@ async function middleware(event, url) {
995
995
  cause: error
996
996
  });
997
997
  }
998
- return match.data.middleware.handler(event, silgiContext);
998
+ return match.data.middleware.handler?.(event, silgiContext);
999
999
  });
1000
1000
  }
1001
1001
  }
@@ -136,6 +136,9 @@ interface Resolvers {
136
136
  }
137
137
  interface RouteRules extends Record<string, unknown> {
138
138
  }
139
+ type MergeRouteRules = Partial<RouteRules> & {
140
+ readBeforeBody?: boolean;
141
+ };
139
142
  /**
140
143
  * Extracts the prefix (first segment) from a URL, including the leading slash.
141
144
  * @example ExtractPrefix<'/api/blueSpace/basket'> // '/api'
@@ -267,9 +270,7 @@ type ServiceHandler<Input extends StandardSchemaV1, Output extends StandardSchem
267
270
  */
268
271
  interface ServiceSetup<Input extends StandardSchemaV1 = StandardSchemaV1, Output extends StandardSchemaV1 = StandardSchemaV1, PathParams extends StandardSchemaV1 | never | undefined = never, QueryParams extends StandardSchemaV1 | never | undefined = never, Resolved extends boolean = false, HiddenParameters extends boolean = false> {
269
272
  handler?: ServiceHandler<Input, Output, PathParams, QueryParams, Resolved, HiddenParameters>;
270
- rules?: RouteRules & {
271
- readBeforeBody?: boolean;
272
- };
273
+ rules?: MergeRouteRules;
273
274
  modules?: Partial<SetupModuleOption>;
274
275
  storage?: StorageConfig<ServiceHandlerInput<Input, PathParams, QueryParams, HiddenParameters>>;
275
276
  }
@@ -508,8 +509,8 @@ type MiddlewareHandler<Response extends EventHandlerResponse = EventHandlerRespo
508
509
  * Middleware Setup tipi
509
510
  */
510
511
  interface MiddlewareSetup {
511
- handler: MiddlewareHandler;
512
- rules?: RouteRules;
512
+ handler?: MiddlewareHandler;
513
+ rules?: MergeRouteRules;
513
514
  modules?: Partial<SetupModuleOption>;
514
515
  storage?: StorageConfig;
515
516
  }
@@ -1221,4 +1222,4 @@ interface LoadConfigOptions {
1221
1222
  consola?: ConsolaInstance;
1222
1223
  }
1223
1224
 
1224
- export type { AllPaths, AllPrefixes, AppConfig, Awaitable, BaseMethodSchema, BuildSilgi, CaptureError, CapturedErrorContext, CommandType, Commands, CustomRequestInit, DeepPartial, DeepRequired, DefaultHooks, DefineFrameworkOptions, DotenvOptions, EnvOptions, EventHandlerResponse, ExtendContext, ExtendShared, ExtractNamespace, ExtractPathParamKeys, ExtractPathParams, ExtractPrefix, ExtractRoute, GenImport, GenerateAppOptions, HTTPMethod, HasPathParams, HookResult, LoadConfigOptions, MergeAll, MergedSilgiSchema, MetaData, MethodSchemas, MiddlewareHandler, MiddlewareSetup, ModuleDefinition, ModuleHookContext, ModuleMeta, ModuleOptionsCustom, ModuleSetupInstallResult, ModuleSetupReturn, NamespacesForPrefix, NitroBuildInfo, RequiredServiceType, ResolvedMiddlewareDefinition, ResolvedModuleMeta, ResolvedModuleOptions, ResolvedSchema, ResolvedSchemaDefinition, ResolvedServiceDefinition, ResolvedSilgiTemplate, Resolvers, RouteEntry, RouteRules, RouterParams, RoutesForPrefixAndNamespace, ScanFile, Schema, ServiceHandler, ServiceHandlerInput, ServiceSetup, ServicesObject, SetupModuleOption, Silgi, SilgiAppPlugin, SilgiCLI, SilgiCLIConfig, SilgiCLIHooks, SilgiCLIOptions, SilgiCommands, SilgiCompatibility, SilgiCompatibilityIssue, SilgiCompatibilityIssues, SilgiConfig, SilgiEvent, SilgiFetchClient, SilgiFetchOptions, SilgiFrameworkInfo, SilgiHooks, SilgiModule, SilgiModuleInput, SilgiModuleOptions, SilgiOptions, SilgiPreset, SilgiPresetMeta, SilgiRoute, SilgiRouterTypes, SilgiRuntimeConfig, SilgiRuntimeContext, SilgiRuntimeDefaultConfig, SilgiRuntimeHooks, SilgiRuntimeMethods, SilgiRuntimeOptions, SilgiRuntimeShareds, SilgiRuntimeSharedsExtend, SilgiSchema, SilgiStorageBase, SilgiTemplate, SilgiURL, StandardHTTPMethod, StorageConfig, StorageKeyGenerator, StorageKeyParams, StorageMounts, TSReference, TrimAfterFourSlashes, WithPathParams };
1225
+ export type { AllPaths, AllPrefixes, AppConfig, Awaitable, BaseMethodSchema, BuildSilgi, CaptureError, CapturedErrorContext, CommandType, Commands, CustomRequestInit, DeepPartial, DeepRequired, DefaultHooks, DefineFrameworkOptions, DotenvOptions, EnvOptions, EventHandlerResponse, ExtendContext, ExtendShared, ExtractNamespace, ExtractPathParamKeys, ExtractPathParams, ExtractPrefix, ExtractRoute, GenImport, GenerateAppOptions, HTTPMethod, HasPathParams, HookResult, LoadConfigOptions, MergeAll, MergeRouteRules, MergedSilgiSchema, MetaData, MethodSchemas, MiddlewareHandler, MiddlewareSetup, ModuleDefinition, ModuleHookContext, ModuleMeta, ModuleOptionsCustom, ModuleSetupInstallResult, ModuleSetupReturn, NamespacesForPrefix, NitroBuildInfo, RequiredServiceType, ResolvedMiddlewareDefinition, ResolvedModuleMeta, ResolvedModuleOptions, ResolvedSchema, ResolvedSchemaDefinition, ResolvedServiceDefinition, ResolvedSilgiTemplate, Resolvers, RouteEntry, RouteRules, RouterParams, RoutesForPrefixAndNamespace, ScanFile, Schema, ServiceHandler, ServiceHandlerInput, ServiceSetup, ServicesObject, SetupModuleOption, Silgi, SilgiAppPlugin, SilgiCLI, SilgiCLIConfig, SilgiCLIHooks, SilgiCLIOptions, SilgiCommands, SilgiCompatibility, SilgiCompatibilityIssue, SilgiCompatibilityIssues, SilgiConfig, SilgiEvent, SilgiFetchClient, SilgiFetchOptions, SilgiFrameworkInfo, SilgiHooks, SilgiModule, SilgiModuleInput, SilgiModuleOptions, SilgiOptions, SilgiPreset, SilgiPresetMeta, SilgiRoute, SilgiRouterTypes, SilgiRuntimeConfig, SilgiRuntimeContext, SilgiRuntimeDefaultConfig, SilgiRuntimeHooks, SilgiRuntimeMethods, SilgiRuntimeOptions, SilgiRuntimeShareds, SilgiRuntimeSharedsExtend, SilgiSchema, SilgiStorageBase, SilgiTemplate, SilgiURL, StandardHTTPMethod, StorageConfig, StorageKeyGenerator, StorageKeyParams, StorageMounts, TSReference, TrimAfterFourSlashes, WithPathParams };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.41.16",
4
+ "version": "0.41.17",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {