@kaito-http/core 2.3.8 → 2.3.9

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.
@@ -26,7 +26,6 @@ export declare class Router<Context, Routes extends RoutesInit<Context>> {
26
26
  readonly 'mkcol': <Result, Path extends `/${string}`, Input extends z.ZodType<any, z.ZodTypeDef, any> = never>(path: Path, route: Omit<Route<Result, Path, "MKCOL", Context, Input>, "method">) => Router<Context, Path extends keyof Routes ? NoEmpty<Pick<Routes, Path>> | { [key in Path]: Route<Result, Path, "MKCOL", Context, Input>; } : Routes & { [key_1 in Path]: Route<Result, Path, "MKCOL", Context, Input>; }>;
27
27
  readonly 'move': <Result, Path extends `/${string}`, Input extends z.ZodType<any, z.ZodTypeDef, any> = never>(path: Path, route: Omit<Route<Result, Path, "MOVE", Context, Input>, "method">) => Router<Context, Path extends keyof Routes ? NoEmpty<Pick<Routes, Path>> | { [key in Path]: Route<Result, Path, "MOVE", Context, Input>; } : Routes & { [key_1 in Path]: Route<Result, Path, "MOVE", Context, Input>; }>;
28
28
  readonly 'notify': <Result, Path extends `/${string}`, Input extends z.ZodType<any, z.ZodTypeDef, any> = never>(path: Path, route: Omit<Route<Result, Path, "NOTIFY", Context, Input>, "method">) => Router<Context, Path extends keyof Routes ? NoEmpty<Pick<Routes, Path>> | { [key in Path]: Route<Result, Path, "NOTIFY", Context, Input>; } : Routes & { [key_1 in Path]: Route<Result, Path, "NOTIFY", Context, Input>; }>;
29
- readonly 'options': <Result, Path extends `/${string}`, Input extends z.ZodType<any, z.ZodTypeDef, any> = never>(path: Path, route: Omit<Route<Result, Path, "OPTIONS", Context, Input>, "method">) => Router<Context, Path extends keyof Routes ? NoEmpty<Pick<Routes, Path>> | { [key in Path]: Route<Result, Path, "OPTIONS", Context, Input>; } : Routes & { [key_1 in Path]: Route<Result, Path, "OPTIONS", Context, Input>; }>;
30
29
  readonly 'patch': <Result, Path extends `/${string}`, Input extends z.ZodType<any, z.ZodTypeDef, any> = never>(path: Path, route: Omit<Route<Result, Path, "PATCH", Context, Input>, "method">) => Router<Context, Path extends keyof Routes ? NoEmpty<Pick<Routes, Path>> | { [key in Path]: Route<Result, Path, "PATCH", Context, Input>; } : Routes & { [key_1 in Path]: Route<Result, Path, "PATCH", Context, Input>; }>;
31
30
  readonly 'post': <Result, Path extends `/${string}`, Input extends z.ZodType<any, z.ZodTypeDef, any> = never>(path: Path, route: Omit<Route<Result, Path, "POST", Context, Input>, "method">) => Router<Context, Path extends keyof Routes ? NoEmpty<Pick<Routes, Path>> | { [key in Path]: Route<Result, Path, "POST", Context, Input>; } : Routes & { [key_1 in Path]: Route<Result, Path, "POST", Context, Input>; }>;
32
31
  readonly 'propfind': <Result, Path extends `/${string}`, Input extends z.ZodType<any, z.ZodTypeDef, any> = never>(path: Path, route: Omit<Route<Result, Path, "PROPFIND", Context, Input>, "method">) => Router<Context, Path extends keyof Routes ? NoEmpty<Pick<Routes, Path>> | { [key in Path]: Route<Result, Path, "PROPFIND", Context, Input>; } : Routes & { [key_1 in Path]: Route<Result, Path, "PROPFIND", Context, Input>; }>;
@@ -80,6 +80,10 @@ function createFMWServer(config) {
80
80
  yield fn(req, res);
81
81
  }
82
82
 
83
+ if (req.method === 'OPTIONS') {
84
+ return;
85
+ }
86
+
83
87
  fmw.lookup(req, res);
84
88
  });
85
89
 
@@ -388,8 +392,6 @@ class Router {
388
392
 
389
393
  _defineProperty(this, 'notify', this.make('NOTIFY'));
390
394
 
391
- _defineProperty(this, 'options', this.make('OPTIONS'));
392
-
393
395
  _defineProperty(this, 'patch', this.make('PATCH'));
394
396
 
395
397
  _defineProperty(this, 'post', this.make('POST'));
@@ -80,6 +80,10 @@ function createFMWServer(config) {
80
80
  yield fn(req, res);
81
81
  }
82
82
 
83
+ if (req.method === 'OPTIONS') {
84
+ return;
85
+ }
86
+
83
87
  fmw.lookup(req, res);
84
88
  });
85
89
 
@@ -388,8 +392,6 @@ class Router {
388
392
 
389
393
  _defineProperty(this, 'notify', this.make('NOTIFY'));
390
394
 
391
- _defineProperty(this, 'options', this.make('OPTIONS'));
392
-
393
395
  _defineProperty(this, 'patch', this.make('PATCH'));
394
396
 
395
397
  _defineProperty(this, 'post', this.make('POST'));
@@ -52,6 +52,10 @@ function createFMWServer(config) {
52
52
  yield fn(req, res);
53
53
  }
54
54
 
55
+ if (req.method === 'OPTIONS') {
56
+ return;
57
+ }
58
+
55
59
  fmw.lookup(req, res);
56
60
  });
57
61
 
@@ -360,8 +364,6 @@ class Router {
360
364
 
361
365
  _defineProperty(this, 'notify', this.make('NOTIFY'));
362
366
 
363
- _defineProperty(this, 'options', this.make('OPTIONS'));
364
-
365
367
  _defineProperty(this, 'patch', this.make('PATCH'));
366
368
 
367
369
  _defineProperty(this, 'post', this.make('POST'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaito-http/core",
3
- "version": "2.3.8",
3
+ "version": "2.3.9",
4
4
  "description": "Functional HTTP Framework for TypeScript",
5
5
  "repository": "https://github.com/kaito-http/kaito",
6
6
  "author": "Alistair Smith <hi@alistair.sh>",