@orion-js/http 4.3.2 → 4.4.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Orionjs Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ import express from 'express';
2
+ type onErrorFunction = (req: express.Request, res: express.Response, error: any) => Promise<void>;
3
+ export declare const onError: onErrorFunction;
4
+ export declare const setOnError: (onErrorFunc: onErrorFunction) => void;
5
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,110 +1,10 @@
1
1
  import express, { RequestHandler } from 'express';
2
- export { default as express } from 'express';
3
- import { OptionsJson, OptionsText, OptionsUrlencoded } from 'body-parser';
4
- import { Schema, InferSchemaType, SchemaFieldType } from '@orion-js/schema';
5
-
6
- type onErrorFunction = (req: express.Request, res: express.Response, error: any) => Promise<void>;
7
- declare const onError: onErrorFunction;
8
- declare const setOnError: (onErrorFunc: onErrorFunction) => void;
9
-
10
- interface RouteResponseObject<TReturnsSchema extends SchemaFieldType | undefined = undefined> {
11
- statusCode?: number;
12
- headers?: {
13
- [key: string]: string;
14
- };
15
- body: TReturnsSchema extends undefined ? string | object : InferSchemaType<TReturnsSchema>;
16
- }
17
- type RouteResponse<TReturnsSchema extends SchemaFieldType = any> = Promise<RouteResponseObject<TReturnsSchema> | void>;
18
- type OrionRequest<TPath extends string = string, TQueryParamsSchema extends Schema | undefined = any, TBodyParamsSchema extends Schema | undefined = any> = express.Request<InferPathParams<TPath>, any, InferSchemaType<TBodyParamsSchema>, InferSchemaType<TQueryParamsSchema>>;
19
- type RouteResolve<TPath extends string, TQueryParamsSchema extends Schema | undefined, TBodyParamsSchema extends Schema | undefined, TReturnsSchema extends SchemaFieldType | undefined> = (req?: OrionRequest<TPath, TQueryParamsSchema, TBodyParamsSchema>, res?: express.Response, viewer?: any) => RouteResponse<TReturnsSchema>;
20
- type InferPathParam<Path, NextPart> = Path extends `:${infer OptionalParam}?` ? {
21
- [K in OptionalParam]?: string;
22
- } & NextPart : Path extends `:${infer Param}` ? {
23
- [K in Param]: string;
24
- } & NextPart : NextPart;
25
- type InternalPathParams<Path> = Path extends `${infer Segment}/${infer Rest}` ? InferPathParam<Segment, InferPathParams<Rest>> : InferPathParam<Path, {}>;
26
- type InferPathParams<Path> = InternalPathParams<Path>;
27
- interface OrionRouteOptions<TPath extends string, TQueryParamsSchema extends Schema | undefined, TBodyParamsSchema extends Schema | undefined, TReturnsSchema extends SchemaFieldType | undefined> {
28
- /**
29
- * The path of the requests to match.
30
- */
31
- path: TPath;
32
- /**
33
- * The schema of the path params. If not provided, the path params will be undefined.
34
- * Path params will be cleaned and validated using the schema.
35
- */
36
- /**
37
- * The schema of the body params. If not provided, the body params will be undefined.
38
- * Body params will be cleaned and validated using the schema.
39
- */
40
- bodyParams?: TBodyParamsSchema;
41
- /**
42
- * The schema of the query params. If not provided, the query params will be undefined.
43
- * Query params will be cleaned and validated using the schema.
44
- */
45
- queryParams?: TQueryParamsSchema;
46
- /**
47
- * The schema of the return body. If provided, the body will be only cleaned agains this schema, not validated.
48
- */
49
- returns?: TReturnsSchema;
50
- /**
51
- * The http method of the requests to match.
52
- */
53
- method: 'get' | 'post' | 'put' | 'delete' | 'all';
54
- /**
55
- * Select the body parser to use for this route.
56
- */
57
- bodyParser?: 'json' | 'text' | 'urlencoded';
58
- /**
59
- * Selected body parser options.
60
- */
61
- bodyParserOptions?: OptionsJson | OptionsText | OptionsUrlencoded;
62
- /**
63
- * Add a middleware to the route.
64
- * See https://expressjs.com/en/4x/api.html#middleware
65
- * for more information.
66
- */
67
- middlewares?: Array<express.RequestHandler>;
68
- resolve: RouteResolve<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>;
69
- /**
70
- * Pass another express app
71
- */
72
- app?: express.Application;
73
- }
74
- type RouteType<TPath extends string = string, TQueryParamsSchema extends Schema | undefined = any, TBodyParamsSchema extends Schema | undefined = any, TReturnsSchema extends SchemaFieldType | undefined = any> = OrionRouteOptions<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>;
75
- interface RoutesMap {
76
- [key: string]: RouteType<any, any, any, any>;
77
- }
78
- type Request = express.Request;
79
- type Response = express.Response;
80
-
81
- declare function registerRoute(route: RouteType): void;
82
-
83
- declare function registerRoutes(routesMap: RoutesMap): void;
84
-
85
- interface StartOrionOptions {
86
- keepAliveTimeout?: number;
87
- }
88
- declare const startServer: (port?: number, otherOptions?: StartOrionOptions) => express.Express;
89
- declare const getApp: () => express.Express;
90
- declare const getServer: () => any;
91
-
92
- declare const getViewer: (req: express.Request) => Promise<any>;
93
- declare const setGetViewer: (getViewerFunc: (req: express.Request) => any) => void;
94
-
95
- declare function createRoute<TPath extends string, TQueryParamsSchema extends Schema | undefined, TBodyParamsSchema extends Schema | undefined, TReturnsSchema extends SchemaFieldType | undefined>(options: OrionRouteOptions<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>): RouteType<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>;
96
- /**
97
- * @deprecated Use createRoute instead
98
- */
99
- declare const route: typeof createRoute;
100
-
101
- declare function registerReplEndpoint(): void;
102
-
103
- declare function Routes(): (target: any, context: ClassDecoratorContext<any>) => void;
104
- declare function Route(): (method: any, context: ClassFieldDecoratorContext) => any;
105
- declare function Route(options?: Omit<OrionRouteOptions<any, any, any, any>, 'resolve'>): (method: any, context: ClassMethodDecoratorContext) => any;
106
- declare function getServiceRoutes(target: any): RoutesMap;
107
-
2
+ import { onError, setOnError } from './errors';
3
+ import registerRoute from './routes/registerRoute';
4
+ import registerRoutes from './routes/registerRoutes';
5
+ import { getApp, getServer, startServer } from './start';
6
+ import { getViewer, setGetViewer } from './viewer';
7
+ export * from './routes/route';
108
8
  declare const bodyParser: {
109
9
  json: () => RequestHandler;
110
10
  raw: () => RequestHandler;
@@ -113,5 +13,7 @@ declare const bodyParser: {
113
13
  extended: boolean;
114
14
  }) => RequestHandler;
115
15
  };
116
-
117
- export { type InferPathParams, type OrionRequest, type OrionRouteOptions, type Request, type Response, Route, type RouteResolve, type RouteResponse, type RouteResponseObject, type RouteType, Routes, type RoutesMap, bodyParser, createRoute, getApp, getServer, getServiceRoutes, getViewer, onError, registerReplEndpoint, registerRoute, registerRoutes, route, setGetViewer, setOnError, startServer };
16
+ export { express, startServer, getApp, getServer, getViewer, setGetViewer, setOnError, onError, registerRoute, registerRoutes, bodyParser, };
17
+ export { registerReplEndpoint } from './repl';
18
+ export * from './service';
19
+ export * from './types';
package/dist/repl.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function registerReplEndpoint(): void;
@@ -0,0 +1,3 @@
1
+ import express from 'express';
2
+ import { OrionRequest, RouteType } from './../types';
3
+ export declare function executeRequest(route: RouteType<any>, req: OrionRequest, res: express.Response): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { RouteType } from '../types';
2
+ export default function registerRoute(route: RouteType): void;
@@ -0,0 +1,2 @@
1
+ import { RoutesMap } from '../types';
2
+ export default function registerRoutes(routesMap: RoutesMap): void;
@@ -0,0 +1,7 @@
1
+ import { Schema, SchemaFieldType } from '@orion-js/schema';
2
+ import { RouteType, OrionRouteOptions } from '../types';
3
+ export declare function createRoute<TPath extends string, TQueryParamsSchema extends Schema | undefined, TBodyParamsSchema extends Schema | undefined, TReturnsSchema extends SchemaFieldType | undefined>(options: OrionRouteOptions<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>): RouteType<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>;
4
+ /**
5
+ * @deprecated Use createRoute instead
6
+ */
7
+ export declare const route: typeof createRoute;
@@ -0,0 +1,5 @@
1
+ import { OrionRouteOptions, RoutesMap } from '../types';
2
+ export declare function Routes(): (target: any, context: ClassDecoratorContext<any>) => void;
3
+ export declare function Route(): (method: any, context: ClassFieldDecoratorContext) => any;
4
+ export declare function Route(options?: Omit<OrionRouteOptions<any, any, any, any>, 'resolve'>): (method: any, context: ClassMethodDecoratorContext) => any;
5
+ export declare function getServiceRoutes(target: any): RoutesMap;
@@ -0,0 +1,7 @@
1
+ import express from 'express';
2
+ export interface StartOrionOptions {
3
+ keepAliveTimeout?: number;
4
+ }
5
+ export declare const startServer: (port?: number, otherOptions?: StartOrionOptions) => express.Express;
6
+ export declare const getApp: () => express.Express;
7
+ export declare const getServer: () => any;
@@ -0,0 +1,74 @@
1
+ import express from 'express';
2
+ import { OptionsJson, OptionsText, OptionsUrlencoded } from 'body-parser';
3
+ import { InferSchemaType, Schema, SchemaFieldType } from '@orion-js/schema';
4
+ export interface RouteResponseObject<TReturnsSchema extends SchemaFieldType | undefined = undefined> {
5
+ statusCode?: number;
6
+ headers?: {
7
+ [key: string]: string;
8
+ };
9
+ body: TReturnsSchema extends undefined ? string | object : InferSchemaType<TReturnsSchema>;
10
+ }
11
+ export type RouteResponse<TReturnsSchema extends SchemaFieldType = any> = Promise<RouteResponseObject<TReturnsSchema> | void>;
12
+ export type OrionRequest<TPath extends string = string, TQueryParamsSchema extends Schema | undefined = any, TBodyParamsSchema extends Schema | undefined = any> = express.Request<InferPathParams<TPath>, any, InferSchemaType<TBodyParamsSchema>, InferSchemaType<TQueryParamsSchema>>;
13
+ export type RouteResolve<TPath extends string, TQueryParamsSchema extends Schema | undefined, TBodyParamsSchema extends Schema | undefined, TReturnsSchema extends SchemaFieldType | undefined> = (req?: OrionRequest<TPath, TQueryParamsSchema, TBodyParamsSchema>, res?: express.Response, viewer?: any) => RouteResponse<TReturnsSchema>;
14
+ type InferPathParam<Path, NextPart> = Path extends `:${infer OptionalParam}?` ? {
15
+ [K in OptionalParam]?: string;
16
+ } & NextPart : Path extends `:${infer Param}` ? {
17
+ [K in Param]: string;
18
+ } & NextPart : NextPart;
19
+ type InternalPathParams<Path> = Path extends `${infer Segment}/${infer Rest}` ? InferPathParam<Segment, InferPathParams<Rest>> : InferPathParam<Path, {}>;
20
+ export type InferPathParams<Path> = InternalPathParams<Path>;
21
+ export interface OrionRouteOptions<TPath extends string, TQueryParamsSchema extends Schema | undefined, TBodyParamsSchema extends Schema | undefined, TReturnsSchema extends SchemaFieldType | undefined> {
22
+ /**
23
+ * The path of the requests to match.
24
+ */
25
+ path: TPath;
26
+ /**
27
+ * The schema of the path params. If not provided, the path params will be undefined.
28
+ * Path params will be cleaned and validated using the schema.
29
+ */
30
+ /**
31
+ * The schema of the body params. If not provided, the body params will be undefined.
32
+ * Body params will be cleaned and validated using the schema.
33
+ */
34
+ bodyParams?: TBodyParamsSchema;
35
+ /**
36
+ * The schema of the query params. If not provided, the query params will be undefined.
37
+ * Query params will be cleaned and validated using the schema.
38
+ */
39
+ queryParams?: TQueryParamsSchema;
40
+ /**
41
+ * The schema of the return body. If provided, the body will be only cleaned agains this schema, not validated.
42
+ */
43
+ returns?: TReturnsSchema;
44
+ /**
45
+ * The http method of the requests to match.
46
+ */
47
+ method: 'get' | 'post' | 'put' | 'delete' | 'all';
48
+ /**
49
+ * Select the body parser to use for this route.
50
+ */
51
+ bodyParser?: 'json' | 'text' | 'urlencoded';
52
+ /**
53
+ * Selected body parser options.
54
+ */
55
+ bodyParserOptions?: OptionsJson | OptionsText | OptionsUrlencoded;
56
+ /**
57
+ * Add a middleware to the route.
58
+ * See https://expressjs.com/en/4x/api.html#middleware
59
+ * for more information.
60
+ */
61
+ middlewares?: Array<express.RequestHandler>;
62
+ resolve: RouteResolve<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>;
63
+ /**
64
+ * Pass another express app
65
+ */
66
+ app?: express.Application;
67
+ }
68
+ export type RouteType<TPath extends string = string, TQueryParamsSchema extends Schema | undefined = any, TBodyParamsSchema extends Schema | undefined = any, TReturnsSchema extends SchemaFieldType | undefined = any> = OrionRouteOptions<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>;
69
+ export interface RoutesMap {
70
+ [key: string]: RouteType<any, any, any, any>;
71
+ }
72
+ export type Request = express.Request;
73
+ export type Response = express.Response;
74
+ export {};
@@ -0,0 +1,3 @@
1
+ import express from 'express';
2
+ export declare const getViewer: (req: express.Request) => Promise<any>;
3
+ export declare const setGetViewer: (getViewerFunc: (req: express.Request) => any) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-js/http",
3
- "version": "4.3.2",
3
+ "version": "4.4.0",
4
4
  "main": "./dist/index.cjs",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -8,24 +8,17 @@
8
8
  ],
9
9
  "author": "nicolaslopezj",
10
10
  "license": "MIT",
11
- "scripts": {
12
- "test": "bun test",
13
- "prepare": "bun run build",
14
- "clean": "rm -rf ./dist",
15
- "build": "tsup",
16
- "dev": "tsup --watch"
17
- },
18
11
  "dependencies": {
19
- "@orion-js/env": "4.3.1",
20
- "@orion-js/helpers": "4.3.1",
21
- "@orion-js/resolvers": "4.3.1",
22
- "@orion-js/schema": "4.3.1",
23
- "@orion-js/services": "4.3.1",
12
+ "@orion-js/env": "4.4.0",
13
+ "@orion-js/helpers": "4.4.0",
14
+ "@orion-js/resolvers": "4.4.0",
15
+ "@orion-js/schema": "4.4.0",
16
+ "@orion-js/services": "4.4.0",
24
17
  "body-parser": "1.20.3",
25
18
  "express": "4.21.2"
26
19
  },
27
20
  "peerDependencies": {
28
- "@orion-js/logger": "4.3.1"
21
+ "@orion-js/logger": "4.4.0"
29
22
  },
30
23
  "devDependencies": {
31
24
  "@types/body-parser": "^1.19.1",
@@ -35,7 +28,7 @@
35
28
  "superagent": "^10.2.0",
36
29
  "supertest": "^7.0.0",
37
30
  "tsup": "^8.0.1",
38
- "typescript": "^5.4.5"
31
+ "typescript": "^7.0.2"
39
32
  },
40
33
  "publishConfig": {
41
34
  "access": "public"
@@ -47,5 +40,11 @@
47
40
  "types": "./dist/index.d.ts",
48
41
  "import": "./dist/index.js",
49
42
  "require": "./dist/index.cjs"
43
+ },
44
+ "scripts": {
45
+ "test": "bun test",
46
+ "clean": "rm -rf ./dist",
47
+ "build": "tsup && bun run ../../scripts/emit-declarations.ts",
48
+ "dev": "tsup --watch"
50
49
  }
51
- }
50
+ }
package/dist/index.d.cts DELETED
@@ -1,117 +0,0 @@
1
- import express, { RequestHandler } from 'express';
2
- export { default as express } from 'express';
3
- import { OptionsJson, OptionsText, OptionsUrlencoded } from 'body-parser';
4
- import { Schema, InferSchemaType, SchemaFieldType } from '@orion-js/schema';
5
-
6
- type onErrorFunction = (req: express.Request, res: express.Response, error: any) => Promise<void>;
7
- declare const onError: onErrorFunction;
8
- declare const setOnError: (onErrorFunc: onErrorFunction) => void;
9
-
10
- interface RouteResponseObject<TReturnsSchema extends SchemaFieldType | undefined = undefined> {
11
- statusCode?: number;
12
- headers?: {
13
- [key: string]: string;
14
- };
15
- body: TReturnsSchema extends undefined ? string | object : InferSchemaType<TReturnsSchema>;
16
- }
17
- type RouteResponse<TReturnsSchema extends SchemaFieldType = any> = Promise<RouteResponseObject<TReturnsSchema> | void>;
18
- type OrionRequest<TPath extends string = string, TQueryParamsSchema extends Schema | undefined = any, TBodyParamsSchema extends Schema | undefined = any> = express.Request<InferPathParams<TPath>, any, InferSchemaType<TBodyParamsSchema>, InferSchemaType<TQueryParamsSchema>>;
19
- type RouteResolve<TPath extends string, TQueryParamsSchema extends Schema | undefined, TBodyParamsSchema extends Schema | undefined, TReturnsSchema extends SchemaFieldType | undefined> = (req?: OrionRequest<TPath, TQueryParamsSchema, TBodyParamsSchema>, res?: express.Response, viewer?: any) => RouteResponse<TReturnsSchema>;
20
- type InferPathParam<Path, NextPart> = Path extends `:${infer OptionalParam}?` ? {
21
- [K in OptionalParam]?: string;
22
- } & NextPart : Path extends `:${infer Param}` ? {
23
- [K in Param]: string;
24
- } & NextPart : NextPart;
25
- type InternalPathParams<Path> = Path extends `${infer Segment}/${infer Rest}` ? InferPathParam<Segment, InferPathParams<Rest>> : InferPathParam<Path, {}>;
26
- type InferPathParams<Path> = InternalPathParams<Path>;
27
- interface OrionRouteOptions<TPath extends string, TQueryParamsSchema extends Schema | undefined, TBodyParamsSchema extends Schema | undefined, TReturnsSchema extends SchemaFieldType | undefined> {
28
- /**
29
- * The path of the requests to match.
30
- */
31
- path: TPath;
32
- /**
33
- * The schema of the path params. If not provided, the path params will be undefined.
34
- * Path params will be cleaned and validated using the schema.
35
- */
36
- /**
37
- * The schema of the body params. If not provided, the body params will be undefined.
38
- * Body params will be cleaned and validated using the schema.
39
- */
40
- bodyParams?: TBodyParamsSchema;
41
- /**
42
- * The schema of the query params. If not provided, the query params will be undefined.
43
- * Query params will be cleaned and validated using the schema.
44
- */
45
- queryParams?: TQueryParamsSchema;
46
- /**
47
- * The schema of the return body. If provided, the body will be only cleaned agains this schema, not validated.
48
- */
49
- returns?: TReturnsSchema;
50
- /**
51
- * The http method of the requests to match.
52
- */
53
- method: 'get' | 'post' | 'put' | 'delete' | 'all';
54
- /**
55
- * Select the body parser to use for this route.
56
- */
57
- bodyParser?: 'json' | 'text' | 'urlencoded';
58
- /**
59
- * Selected body parser options.
60
- */
61
- bodyParserOptions?: OptionsJson | OptionsText | OptionsUrlencoded;
62
- /**
63
- * Add a middleware to the route.
64
- * See https://expressjs.com/en/4x/api.html#middleware
65
- * for more information.
66
- */
67
- middlewares?: Array<express.RequestHandler>;
68
- resolve: RouteResolve<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>;
69
- /**
70
- * Pass another express app
71
- */
72
- app?: express.Application;
73
- }
74
- type RouteType<TPath extends string = string, TQueryParamsSchema extends Schema | undefined = any, TBodyParamsSchema extends Schema | undefined = any, TReturnsSchema extends SchemaFieldType | undefined = any> = OrionRouteOptions<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>;
75
- interface RoutesMap {
76
- [key: string]: RouteType<any, any, any, any>;
77
- }
78
- type Request = express.Request;
79
- type Response = express.Response;
80
-
81
- declare function registerRoute(route: RouteType): void;
82
-
83
- declare function registerRoutes(routesMap: RoutesMap): void;
84
-
85
- interface StartOrionOptions {
86
- keepAliveTimeout?: number;
87
- }
88
- declare const startServer: (port?: number, otherOptions?: StartOrionOptions) => express.Express;
89
- declare const getApp: () => express.Express;
90
- declare const getServer: () => any;
91
-
92
- declare const getViewer: (req: express.Request) => Promise<any>;
93
- declare const setGetViewer: (getViewerFunc: (req: express.Request) => any) => void;
94
-
95
- declare function createRoute<TPath extends string, TQueryParamsSchema extends Schema | undefined, TBodyParamsSchema extends Schema | undefined, TReturnsSchema extends SchemaFieldType | undefined>(options: OrionRouteOptions<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>): RouteType<TPath, TQueryParamsSchema, TBodyParamsSchema, TReturnsSchema>;
96
- /**
97
- * @deprecated Use createRoute instead
98
- */
99
- declare const route: typeof createRoute;
100
-
101
- declare function registerReplEndpoint(): void;
102
-
103
- declare function Routes(): (target: any, context: ClassDecoratorContext<any>) => void;
104
- declare function Route(): (method: any, context: ClassFieldDecoratorContext) => any;
105
- declare function Route(options?: Omit<OrionRouteOptions<any, any, any, any>, 'resolve'>): (method: any, context: ClassMethodDecoratorContext) => any;
106
- declare function getServiceRoutes(target: any): RoutesMap;
107
-
108
- declare const bodyParser: {
109
- json: () => RequestHandler;
110
- raw: () => RequestHandler;
111
- text: () => RequestHandler;
112
- urlencoded: (options?: {
113
- extended: boolean;
114
- }) => RequestHandler;
115
- };
116
-
117
- export { type InferPathParams, type OrionRequest, type OrionRouteOptions, type Request, type Response, Route, type RouteResolve, type RouteResponse, type RouteResponseObject, type RouteType, Routes, type RoutesMap, bodyParser, createRoute, getApp, getServer, getServiceRoutes, getViewer, onError, registerReplEndpoint, registerRoute, registerRoutes, route, setGetViewer, setOnError, startServer };