@expressots/adapter-express 1.1.0 → 1.2.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/lib/CHANGELOG.md +21 -0
- package/lib/cjs/adapter-express/application-express.js +80 -21
- package/lib/cjs/types/adapter-express/application-base.d.ts +0 -1
- package/lib/cjs/types/adapter-express/application-express.d.ts +36 -2
- package/lib/cjs/types/adapter-express/application-express.interface.d.ts +0 -1
- package/lib/cjs/types/adapter-express/express-utils/base-middleware.d.ts +0 -1
- package/lib/cjs/types/adapter-express/express-utils/constants.d.ts +0 -1
- package/lib/cjs/types/adapter-express/express-utils/content/httpContent.d.ts +0 -1
- package/lib/cjs/types/adapter-express/express-utils/decorators.d.ts +0 -1
- package/lib/cjs/types/adapter-express/express-utils/httpResponseMessage.d.ts +0 -1
- package/lib/cjs/types/adapter-express/express-utils/index.d.ts +0 -1
- package/lib/cjs/types/adapter-express/express-utils/interfaces.d.ts +0 -1
- package/lib/cjs/types/adapter-express/express-utils/inversify-express-server.d.ts +0 -1
- package/lib/cjs/types/adapter-express/express-utils/utils.d.ts +0 -1
- package/lib/cjs/types/adapter-express/index.d.ts +0 -1
- package/lib/cjs/types/index.d.ts +0 -1
- package/lib/package.json +5 -10
- package/package.json +5 -10
- package/lib/cjs/types/adapter-express/application-base.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/application-express.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/application-express.interface.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/express-utils/base-middleware.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/express-utils/constants.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/express-utils/content/httpContent.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/express-utils/decorators.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/express-utils/httpResponseMessage.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/express-utils/index.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/express-utils/interfaces.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/express-utils/inversify-express-server.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/express-utils/utils.d.ts.map +0 -1
- package/lib/cjs/types/adapter-express/index.d.ts.map +0 -1
- package/lib/cjs/types/index.d.ts.map +0 -1
- package/lib/esm/adapter-express/application-base.js +0 -36
- package/lib/esm/adapter-express/application-express.interface.js +0 -2
- package/lib/esm/adapter-express/application-express.js +0 -152
- package/lib/esm/adapter-express/express-utils/base-middleware.js +0 -22
- package/lib/esm/adapter-express/express-utils/constants.js +0 -46
- package/lib/esm/adapter-express/express-utils/content/httpContent.js +0 -10
- package/lib/esm/adapter-express/express-utils/decorators.js +0 -110
- package/lib/esm/adapter-express/express-utils/httpResponseMessage.js +0 -33
- package/lib/esm/adapter-express/express-utils/index.js +0 -17
- package/lib/esm/adapter-express/express-utils/interfaces.js +0 -2
- package/lib/esm/adapter-express/express-utils/inversify-express-server.js +0 -293
- package/lib/esm/adapter-express/express-utils/utils.js +0 -58
- package/lib/esm/adapter-express/index.js +0 -21
- package/lib/esm/index.mjs +0 -17
- package/lib/esm/types/adapter-express/application-base.d.ts +0 -55
- package/lib/esm/types/adapter-express/application-base.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/application-express.d.ts +0 -71
- package/lib/esm/types/adapter-express/application-express.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/application-express.interface.d.ts +0 -29
- package/lib/esm/types/adapter-express/application-express.interface.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/express-utils/base-middleware.d.ts +0 -9
- package/lib/esm/types/adapter-express/express-utils/base-middleware.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/express-utils/constants.d.ts +0 -39
- package/lib/esm/types/adapter-express/express-utils/constants.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/express-utils/content/httpContent.d.ts +0 -8
- package/lib/esm/types/adapter-express/express-utils/content/httpContent.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/express-utils/decorators.d.ts +0 -24
- package/lib/esm/types/adapter-express/express-utils/decorators.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/express-utils/httpResponseMessage.d.ts +0 -16
- package/lib/esm/types/adapter-express/express-utils/httpResponseMessage.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/express-utils/index.d.ts +0 -3
- package/lib/esm/types/adapter-express/express-utils/index.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/express-utils/interfaces.d.ts +0 -76
- package/lib/esm/types/adapter-express/express-utils/interfaces.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/express-utils/inversify-express-server.d.ts +0 -60
- package/lib/esm/types/adapter-express/express-utils/inversify-express-server.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/express-utils/utils.d.ts +0 -10
- package/lib/esm/types/adapter-express/express-utils/utils.d.ts.map +0 -1
- package/lib/esm/types/adapter-express/index.d.ts +0 -4
- package/lib/esm/types/adapter-express/index.d.ts.map +0 -1
- package/lib/esm/types/index.d.ts +0 -2
- package/lib/esm/types/index.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../../../src/adapter-express/express-utils/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAsB,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EACV,UAAU,EAKV,gBAAgB,EAChB,UAAU,EAEX,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,iBAAiB,+LAA2B,CAAC;AAE1D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,YACvD,eAAe,KAAG,IAAI,CAiBvC;AAED,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAEpF;A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AAO,MAAM,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,kBAE9C,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAAM,kBAA+D,CAAC;AAEzF,eAAO,MAAM,SAAS,EAAE,MAAM,kBAAoE,CAAC;AAQnG,wBAAgB,MAAM,CAAC,IAAI,EAAE,cAAc,EAAE,aAAa,CAAC,EAAE,MAAM,YACjD,OAAO,GAAG,UAAU,cAAc,MAAM,GAAG,MAAM,SAAS,MAAM,KAAG,IAAI,CA8BxF"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { OutgoingHttpHeaders } from "node:http";
|
|
3
|
-
import { HttpContent } from "./content/httpContent";
|
|
4
|
-
export declare class HttpResponseMessage {
|
|
5
|
-
private _content;
|
|
6
|
-
private _headers;
|
|
7
|
-
get headers(): OutgoingHttpHeaders;
|
|
8
|
-
set headers(headers: OutgoingHttpHeaders);
|
|
9
|
-
get content(): HttpContent;
|
|
10
|
-
set content(value: HttpContent);
|
|
11
|
-
private _statusCode;
|
|
12
|
-
get statusCode(): number;
|
|
13
|
-
set statusCode(code: number);
|
|
14
|
-
constructor(statusCode?: number);
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=httpResponseMessage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"httpResponseMessage.d.ts","sourceRoot":"","sources":["../../../../../src/adapter-express/express-utils/httpResponseMessage.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAe;IAE/B,OAAO,CAAC,QAAQ,CAA2B;IAE3C,IAAW,OAAO,IAAI,mBAAmB,CAExC;IAED,IAAW,OAAO,CAAC,OAAO,EAAE,mBAAmB,EAE9C;IAED,IAAW,OAAO,IAAI,WAAW,CAEhC;IAED,IAAW,OAAO,CAAC,KAAK,EAAE,WAAW,EAEpC;IAED,OAAO,CAAC,WAAW,CAAU;IAE7B,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED,IAAW,UAAU,CAAC,IAAI,EAAE,MAAM,EAMjC;gBAEW,UAAU,SAAM;CAG7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/adapter-express/express-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { Application, NextFunction, Request, RequestHandler, Response } from "express";
|
|
2
|
-
import { interfaces as inversifyInterfaces } from "inversify";
|
|
3
|
-
import { HTTP_VERBS_ENUM, PARAMETER_TYPE } from "./constants";
|
|
4
|
-
import { HttpResponseMessage } from "./httpResponseMessage";
|
|
5
|
-
type Prototype<T> = {
|
|
6
|
-
[P in keyof T]: T[P] extends NewableFunction ? T[P] : T[P] | undefined;
|
|
7
|
-
} & {
|
|
8
|
-
constructor: NewableFunction;
|
|
9
|
-
};
|
|
10
|
-
interface ConstructorFunction<T = Record<string, unknown>> {
|
|
11
|
-
new (...args: Array<unknown>): T;
|
|
12
|
-
prototype: Prototype<T>;
|
|
13
|
-
}
|
|
14
|
-
export type DecoratorTarget<T = unknown> = ConstructorFunction<T> | Prototype<T>;
|
|
15
|
-
export type Middleware = string | symbol | RequestHandler;
|
|
16
|
-
export type ControllerHandler = (...params: Array<unknown>) => unknown;
|
|
17
|
-
export type BaseController = Record<string, ControllerHandler>;
|
|
18
|
-
export interface Controller {
|
|
19
|
-
}
|
|
20
|
-
export interface ControllerMetadata {
|
|
21
|
-
middleware: Array<Middleware>;
|
|
22
|
-
path: string;
|
|
23
|
-
target: DecoratorTarget;
|
|
24
|
-
}
|
|
25
|
-
export interface ControllerMethodMetadata extends ControllerMetadata {
|
|
26
|
-
key: string;
|
|
27
|
-
method: keyof typeof HTTP_VERBS_ENUM;
|
|
28
|
-
}
|
|
29
|
-
export interface ControllerParameterMetadata {
|
|
30
|
-
[methodName: string]: Array<ParameterMetadata>;
|
|
31
|
-
}
|
|
32
|
-
export interface ParameterMetadata {
|
|
33
|
-
index: number;
|
|
34
|
-
injectRoot: boolean;
|
|
35
|
-
parameterName?: string | undefined;
|
|
36
|
-
type: PARAMETER_TYPE;
|
|
37
|
-
}
|
|
38
|
-
export type ExtractedParameters = Array<ParameterMetadata> | [Request, Response, NextFunction] | Array<unknown>;
|
|
39
|
-
export type HandlerDecorator = (target: DecoratorTarget, key: string, value: unknown) => void;
|
|
40
|
-
export type ConfigFunction = (app: Application) => void;
|
|
41
|
-
export interface RoutingConfig {
|
|
42
|
-
rootPath: string;
|
|
43
|
-
}
|
|
44
|
-
export interface Principal<T = unknown> {
|
|
45
|
-
details: T;
|
|
46
|
-
isAuthenticated(): Promise<boolean>;
|
|
47
|
-
isInRole(role: string): Promise<boolean>;
|
|
48
|
-
isResourceOwner(resourceId: unknown): Promise<boolean>;
|
|
49
|
-
}
|
|
50
|
-
export interface AuthProvider {
|
|
51
|
-
getUser(req: Request, res: Response, next: NextFunction): Promise<Principal>;
|
|
52
|
-
}
|
|
53
|
-
export interface HttpContext<T = unknown> {
|
|
54
|
-
container: inversifyInterfaces.Container;
|
|
55
|
-
request: Request;
|
|
56
|
-
response: Response;
|
|
57
|
-
user: Principal<T>;
|
|
58
|
-
}
|
|
59
|
-
export interface IHttpActionResult {
|
|
60
|
-
executeAsync(): Promise<HttpResponseMessage>;
|
|
61
|
-
}
|
|
62
|
-
export interface RouteDetails {
|
|
63
|
-
args?: Array<string>;
|
|
64
|
-
route: string;
|
|
65
|
-
}
|
|
66
|
-
export interface RouteInfo {
|
|
67
|
-
controller: string;
|
|
68
|
-
endpoints: Array<RouteDetails>;
|
|
69
|
-
}
|
|
70
|
-
export interface RawMetadata {
|
|
71
|
-
controllerMetadata: ControllerMetadata;
|
|
72
|
-
methodMetadata: Array<ControllerMethodMetadata>;
|
|
73
|
-
parameterMetadata: ControllerParameterMetadata;
|
|
74
|
-
}
|
|
75
|
-
export {};
|
|
76
|
-
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/adapter-express/express-utils/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,KAAK,SAAS,CAAC,CAAC,IAAI;KACjB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;CACvE,GAAG;IACF,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AAEF,UAAU,mBAAmB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACvD,KAAK,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;CACzB;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,OAAO,IAAI,mBAAmB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAEjF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,cAAc,CAAC;AAE1D,MAAM,MAAM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O,CAAC,CAAC;IAEpC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzC,eAAe,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxD;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAC9E;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,SAAS,EAAE,mBAAmB,CAAC,SAAS,CAAC;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,cAAc,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAChD,iBAAiB,EAAE,2BAA2B,CAAC;CAChD"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import express, { Application, Router } from "express";
|
|
2
|
-
import { interfaces } from "inversify";
|
|
3
|
-
import type { AuthProvider, ConfigFunction, RoutingConfig } from "./interfaces";
|
|
4
|
-
export declare class InversifyExpressServer {
|
|
5
|
-
private _router;
|
|
6
|
-
private _container;
|
|
7
|
-
private _app;
|
|
8
|
-
private _configFn;
|
|
9
|
-
private _errorConfigFn;
|
|
10
|
-
private _routingConfig;
|
|
11
|
-
private _AuthProvider;
|
|
12
|
-
private _forceControllers;
|
|
13
|
-
/**
|
|
14
|
-
* Wrapper for the express server.
|
|
15
|
-
*
|
|
16
|
-
* @param container Container loaded with all controllers and their dependencies.
|
|
17
|
-
* @param customRouter optional express.Router custom router
|
|
18
|
-
* @param routingConfig optional interfaces.RoutingConfig routing config
|
|
19
|
-
* @param customApp optional express.Application custom app
|
|
20
|
-
* @param authProvider optional interfaces.AuthProvider auth provider
|
|
21
|
-
* @param forceControllers optional boolean setting to force controllers (defaults do true)
|
|
22
|
-
*/
|
|
23
|
-
constructor(container: interfaces.Container, customRouter?: Router | null, routingConfig?: RoutingConfig | null, customApp?: Application | null, authProvider?: (new () => AuthProvider) | null, forceControllers?: boolean);
|
|
24
|
-
/**
|
|
25
|
-
* Sets the configuration function to be applied to the application.
|
|
26
|
-
* Note that the config function is not actually executed until a call to
|
|
27
|
-
* InversifyExpresServer.build().
|
|
28
|
-
*
|
|
29
|
-
* This method is chainable.
|
|
30
|
-
*
|
|
31
|
-
* @param fn Function in which app-level middleware can be registered.
|
|
32
|
-
*/
|
|
33
|
-
setConfig(fn: ConfigFunction): InversifyExpressServer;
|
|
34
|
-
/**
|
|
35
|
-
* Sets the error handler configuration function to be applied to the application.
|
|
36
|
-
* Note that the error config function is not actually executed until a call to
|
|
37
|
-
* InversifyExpressServer.build().
|
|
38
|
-
*
|
|
39
|
-
* This method is chainable.
|
|
40
|
-
*
|
|
41
|
-
* @param fn Function in which app-level error handlers can be registered.
|
|
42
|
-
*/
|
|
43
|
-
setErrorConfig(fn: ConfigFunction): InversifyExpressServer;
|
|
44
|
-
/**
|
|
45
|
-
* Applies all routes and configuration to the server, returning the express application.
|
|
46
|
-
*/
|
|
47
|
-
build(): express.Application;
|
|
48
|
-
private registerControllers;
|
|
49
|
-
private resolveMidleware;
|
|
50
|
-
private copyHeadersTo;
|
|
51
|
-
private handleHttpResponseMessage;
|
|
52
|
-
private handlerFactory;
|
|
53
|
-
private _getHttpContext;
|
|
54
|
-
private _createHttpContext;
|
|
55
|
-
private _getCurrentUser;
|
|
56
|
-
private extractParameters;
|
|
57
|
-
private getParam;
|
|
58
|
-
private _getPrincipal;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=inversify-express-server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inversify-express-server.d.ts","sourceRoot":"","sources":["../../../../../src/adapter-express/express-utils/inversify-express-server.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,EAAE,EACd,WAAW,EAKX,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAmBvC,OAAO,KAAK,EACV,YAAY,EAEZ,cAAc,EAQd,aAAa,EACd,MAAM,cAAc,CAAC;AAGtB,qBAAa,sBAAsB;IACjC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,aAAa,CAA0B;IAC/C,OAAO,CAAC,iBAAiB,CAAU;IAEnC;;;;;;;;;OASG;gBAED,SAAS,EAAE,UAAU,CAAC,SAAS,EAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,EAC5B,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,EACpC,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,EAC9B,YAAY,CAAC,EAAE,CAAC,UAAU,YAAY,CAAC,GAAG,IAAI,EAC9C,gBAAgB,UAAO;IAezB;;;;;;;;OAQG;IACI,SAAS,CAAC,EAAE,EAAE,cAAc,GAAG,sBAAsB;IAK5D;;;;;;;;OAQG;IACI,cAAc,CAAC,EAAE,EAAE,cAAc,GAAG,sBAAsB;IAKjE;;OAEG;IACI,KAAK,IAAI,OAAO,CAAC,WAAW;IA2BnC,OAAO,CAAC,mBAAmB;IAqD3B,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,aAAa;YAQP,yBAAyB;IAmBvC,OAAO,CAAC,cAAc;IAqCtB,OAAO,CAAC,eAAe;YAIT,kBAAkB;YAgBlB,eAAe;IAiB7B,OAAO,CAAC,iBAAiB;IA+CzB,OAAO,CAAC,QAAQ;IAgBhB,OAAO,CAAC,aAAa;CAGtB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { interfaces } from "inversify";
|
|
2
|
-
import type { BaseController, ControllerMetadata, ControllerMethodMetadata, ControllerParameterMetadata, DecoratorTarget, IHttpActionResult } from "./interfaces";
|
|
3
|
-
export declare function getControllersFromContainer(container: interfaces.Container, forceControllers: boolean): Array<BaseController>;
|
|
4
|
-
export declare function getControllersFromMetadata(): Array<DecoratorTarget>;
|
|
5
|
-
export declare function getControllerMetadata(constructor: NewableFunction): ControllerMetadata;
|
|
6
|
-
export declare function getControllerMethodMetadata(constructor: NewableFunction): Array<ControllerMethodMetadata>;
|
|
7
|
-
export declare function getControllerParameterMetadata(constructor: NewableFunction): ControllerParameterMetadata;
|
|
8
|
-
export declare function cleanUpMetadata(): void;
|
|
9
|
-
export declare function instanceOfIHttpActionResult(value: unknown): value is IHttpActionResult;
|
|
10
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/adapter-express/express-utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,2BAA2B,EAC3B,eAAe,EACf,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,UAAU,CAAC,SAAS,EAC/B,gBAAgB,EAAE,OAAO,GACxB,KAAK,CAAC,cAAc,CAAC,CASvB;AAED,wBAAgB,0BAA0B,IAAI,KAAK,CAAC,eAAe,CAAC,CAInE;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,eAAe,GAAG,kBAAkB,CAMtF;AAED,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,eAAe,GAC3B,KAAK,CAAC,wBAAwB,CAAC,CAkBjC;AAED,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,eAAe,GAC3B,2BAA2B,CAkB7B;AAED,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAEtF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter-express/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/lib/esm/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|