@tsed/common 7.0.0-beta.4 → 7.0.0-beta.7
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/cjs/index.js +0 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/utils/createHttpServer.js +0 -6
- package/lib/cjs/utils/createHttpServer.js.map +1 -1
- package/lib/cjs/utils/createHttpsServer.js +0 -6
- package/lib/cjs/utils/createHttpsServer.js.map +1 -1
- package/lib/esm/index.js +0 -2
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/utils/createHttpServer.js +0 -6
- package/lib/esm/utils/createHttpServer.js.map +1 -1
- package/lib/esm/utils/createHttpsServer.js +0 -6
- package/lib/esm/utils/createHttpsServer.js.map +1 -1
- package/lib/types/index.d.ts +0 -2
- package/package.json +15 -15
- package/lib/cjs/decorators/httpServer.js +0 -32
- package/lib/cjs/decorators/httpServer.js.map +0 -1
- package/lib/cjs/decorators/httpsServer.js +0 -32
- package/lib/cjs/decorators/httpsServer.js.map +0 -1
- package/lib/esm/decorators/httpServer.js +0 -28
- package/lib/esm/decorators/httpServer.js.map +0 -1
- package/lib/esm/decorators/httpsServer.js +0 -28
- package/lib/esm/decorators/httpsServer.js.map +0 -1
- package/lib/types/decorators/httpServer.d.ts +0 -28
- package/lib/types/decorators/httpsServer.d.ts +0 -28
package/lib/cjs/index.js
CHANGED
|
@@ -14,8 +14,6 @@ tslib_1.__exportStar(require("./config/interfaces/PlatformMulterSettings"), expo
|
|
|
14
14
|
tslib_1.__exportStar(require("./config/interfaces/PlatformStaticsSettings"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./config/services/PlatformConfiguration"), exports);
|
|
16
16
|
tslib_1.__exportStar(require("./constants/routerOptions"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./decorators/httpServer"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./decorators/httpsServer"), exports);
|
|
19
17
|
tslib_1.__exportStar(require("./decorators/multer/multerFileSize"), exports);
|
|
20
18
|
tslib_1.__exportStar(require("./decorators/multer/multerOptions"), exports);
|
|
21
19
|
tslib_1.__exportStar(require("./decorators/multer/multipartFile"), exports);
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oDAA0B;AAC1B,oEAA0C;AAC1C,8EAAoD;AACpD,gFAAsD;AACtD,0FAAgE;AAChE,qFAA2D;AAC3D,qFAA2D;AAC3D,sFAA4D;AAC5D,kFAAwD;AACxD,oEAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oDAA0B;AAC1B,oEAA0C;AAC1C,8EAAoD;AACpD,gFAAsD;AACtD,0FAAgE;AAChE,qFAA2D;AAC3D,qFAA2D;AAC3D,sFAA4D;AAC5D,kFAAwD;AACxD,oEAA0C;AAC1C,6EAAmD;AACnD,4EAAkD;AAClD,4EAAkD;AAClD,oEAA0C;AAC1C,mEAAyC;AACzC,sEAA4C;AAC5C,uEAA6C;AAC7C,uEAA6C;AAC7C,sEAA4C;AAC5C,oEAA0C;AAC1C,mEAAyC;AACzC,mEAAyC;AACzC,wEAA8C;AAC9C,iEAAuC;AACvC,mEAAyC;AACzC,uEAA6C;AAC7C,kEAAwC;AACxC,oEAA0C;AAC1C,wEAA8C;AAC9C,mEAAyC;AACzC,qEAA2C;AAC3C,+DAAqC;AACrC,iEAAuC;AACvC,kEAAwC;AACxC,oEAA0C;AAC1C,4EAAkD;AAClD,2EAAiD;AACjD,6DAAmC;AACnC,sFAA4D;AAC5D,iFAAuD;AACvD,+EAAqD;AACrD,iEAAuC;AACvC,8DAAoC;AACpC,qEAA2C;AAC3C,yEAA+C;AAC/C,qEAA2C;AAC3C,8EAAoD;AACpD,qEAA2C;AAC3C,sEAA4C;AAC5C,oEAA0C;AAC1C,kEAAwC;AACxC,gEAAsC;AACtC,wEAA8C;AAC9C,mEAAyC;AACzC,oEAA0C;AAC1C,iEAAuC;AACvC,oEAA0C;AAC1C,kEAAwC;AACxC,+DAAqC;AACrC,sEAA4C;AAC5C,8DAAoC;AACpC,qEAA2C;AAC3C,gEAAsC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./exports\";\nexport * from \"./builder/PlatformBuilder\";\nexport * from \"./builder/PlatformControllerBuilder\";\nexport * from \"./config/interfaces/ConverterSettings\";\nexport * from \"./config/interfaces/EndpointDirectoriesSettings\";\nexport * from \"./config/interfaces/PlatformLoggerSettings\";\nexport * from \"./config/interfaces/PlatformMulterSettings\";\nexport * from \"./config/interfaces/PlatformStaticsSettings\";\nexport * from \"./config/services/PlatformConfiguration\";\nexport * from \"./constants/routerOptions\";\nexport * from \"./decorators/multer/multerFileSize\";\nexport * from \"./decorators/multer/multerOptions\";\nexport * from \"./decorators/multer/multipartFile\";\nexport * from \"./decorators/params/error\";\nexport * from \"./decorators/params/next\";\nexport * from \"./decorators/params/request\";\nexport * from \"./decorators/params/response\";\nexport * from \"./domain/AnyToPromiseWithCtx\";\nexport * from \"./domain/ControllerProvider\";\nexport * from \"./domain/EndpointMetadata\";\nexport * from \"./domain/HandlerMetadata\";\nexport * from \"./domain/PlatformContext\";\nexport * from \"./domain/PlatformRouteDetails\";\nexport * from \"./interfaces/AfterInit\";\nexport * from \"./interfaces/AfterListen\";\nexport * from \"./interfaces/AfterRoutesInit\";\nexport * from \"./interfaces/BeforeInit\";\nexport * from \"./interfaces/BeforeListen\";\nexport * from \"./interfaces/BeforeRoutesInit\";\nexport * from \"./interfaces/HandlerType\";\nexport * from \"./interfaces/IncomingEvent\";\nexport * from \"./interfaces/OnReady\";\nexport * from \"./interfaces/OnRequest\";\nexport * from \"./interfaces/OnResponse\";\nexport * from \"./interfaces/OnRoutesInit\";\nexport * from \"./interfaces/PlatformRouteOptions\";\nexport * from \"./interfaces/ResponseErrorObject\";\nexport * from \"./interfaces/Route\";\nexport * from \"./middlewares/PlatformAcceptMimesMiddleware\";\nexport * from \"./middlewares/PlatformMulterMiddleware\";\nexport * from \"./middlewares/bindEndpointMiddleware\";\nexport * from \"./services/FakeAdapter\";\nexport * from \"./services/Platform\";\nexport * from \"./services/PlatformAdapter\";\nexport * from \"./services/PlatformApplication\";\nexport * from \"./services/PlatformHandler\";\nexport * from \"./services/PlatformMiddlewaresChain\";\nexport * from \"./services/PlatformRequest\";\nexport * from \"./services/PlatformResponse\";\nexport * from \"./services/PlatformRouter\";\nexport * from \"./services/PlatformTest\";\nexport * from \"./utils/createContext\";\nexport * from \"./utils/createHandlerMetadata\";\nexport * from \"./utils/createHttpServer\";\nexport * from \"./utils/createHttpsServer\";\nexport * from \"./utils/createInjector\";\nexport * from \"./utils/getStaticsOptions\";\nexport * from \"./utils/importProviders\";\nexport * from \"./utils/listenServer\";\nexport * from \"./utils/mapReturnedResponse\";\nexport * from \"./utils/printRoutes\";\nexport * from \"./utils/setResponseHeaders\";\nexport * from \"./utils/useCtxHandler\";\n"]}
|
|
@@ -5,22 +5,16 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const di_1 = require("@tsed/di");
|
|
6
6
|
const core_1 = require("@tsed/core");
|
|
7
7
|
const http_1 = tslib_1.__importDefault(require("http"));
|
|
8
|
-
const httpServer_1 = require("../decorators/httpServer");
|
|
9
8
|
const listenServer_1 = require("./listenServer");
|
|
10
9
|
function createHttpServer(injector, requestListener) {
|
|
11
10
|
const { settings } = injector;
|
|
12
11
|
const httpPort = settings.getRaw("httpPort");
|
|
13
12
|
const httpOptions = settings.getRaw("httpOptions");
|
|
14
13
|
const server = httpPort !== false ? http_1.default.createServer(httpOptions, requestListener) : null;
|
|
15
|
-
injector.addProvider(httpServer_1.HttpServer, {
|
|
16
|
-
scope: di_1.ProviderScope.SINGLETON,
|
|
17
|
-
useValue: server
|
|
18
|
-
});
|
|
19
14
|
injector.addProvider(http_1.default.Server, {
|
|
20
15
|
scope: di_1.ProviderScope.SINGLETON,
|
|
21
16
|
useValue: server
|
|
22
17
|
});
|
|
23
|
-
injector.invoke(httpServer_1.HttpServer);
|
|
24
18
|
injector.invoke(http_1.default.Server);
|
|
25
19
|
if (server) {
|
|
26
20
|
const hostInfo = (0, core_1.getHostInfoFromPort)("http", httpPort);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHttpServer.js","sourceRoot":"","sources":["../../../src/utils/createHttpServer.ts"],"names":[],"mappings":";;;;AAAA,iCAAwD;AACxD,qCAA+C;AAC/C,wDAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"createHttpServer.js","sourceRoot":"","sources":["../../../src/utils/createHttpServer.ts"],"names":[],"mappings":";;;;AAAA,iCAAwD;AACxD,qCAA+C;AAC/C,wDAAwB;AACxB,iDAA4C;AAE5C,SAAgB,gBAAgB,CAAC,QAAyB,EAAE,eAAqC;IAC/F,MAAM,EAAC,QAAQ,EAAC,GAAG,QAAQ,CAAC;IAC5B,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAEnD,MAAM,MAAM,GAAG,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,cAAI,CAAC,YAAY,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE3F,QAAQ,CAAC,WAAW,CAAC,cAAI,CAAC,MAAM,EAAE;QAChC,KAAK,EAAE,kBAAa,CAAC,SAAS;QAC9B,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,CAAC,cAAI,CAAC,MAAM,CAAC,CAAC;IAE7B,IAAI,MAAM,EAAE;QACV,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEvD,OAAO,KAAK,IAAI,EAAE;YAChB,MAAM,gBAAgB,GAAG,MAAM,IAAA,2BAAY,EAAC,QAAQ,EAAE,MAAqB,EAAE,QAAQ,CAAC,CAAC;YACvF,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,gBAAgB,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;YACpF,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;KACH;AACH,CAAC;AAvBD,4CAuBC","sourcesContent":["import {InjectorService, ProviderScope} from \"@tsed/di\";\nimport {getHostInfoFromPort} from \"@tsed/core\";\nimport Http from \"http\";\nimport {listenServer} from \"./listenServer\";\n\nexport function createHttpServer(injector: InjectorService, requestListener: Http.RequestListener) {\n const {settings} = injector;\n const httpPort = settings.getRaw(\"httpPort\");\n const httpOptions = settings.getRaw(\"httpOptions\");\n\n const server = httpPort !== false ? Http.createServer(httpOptions, requestListener) : null;\n\n injector.addProvider(Http.Server, {\n scope: ProviderScope.SINGLETON,\n useValue: server\n });\n\n injector.invoke(Http.Server);\n\n if (server) {\n const hostInfo = getHostInfoFromPort(\"http\", httpPort);\n\n return async () => {\n const resolvedHostInfo = await listenServer(injector, server as Http.Server, hostInfo);\n settings.setRaw(\"httpPort\", `${resolvedHostInfo.address}:${resolvedHostInfo.port}`);\n return server;\n };\n }\n}\n"]}
|
|
@@ -5,22 +5,16 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const di_1 = require("@tsed/di");
|
|
6
6
|
const core_1 = require("@tsed/core");
|
|
7
7
|
const https_1 = tslib_1.__importDefault(require("https"));
|
|
8
|
-
const httpsServer_1 = require("../decorators/httpsServer");
|
|
9
8
|
const listenServer_1 = require("./listenServer");
|
|
10
9
|
function createHttpsServer(injector, requestListener) {
|
|
11
10
|
const { settings } = injector;
|
|
12
11
|
const httpsPort = settings.getRaw("httpsPort");
|
|
13
12
|
const httpsOptions = settings.getRaw("httpsOptions");
|
|
14
13
|
const server = httpsPort !== false ? https_1.default.createServer(httpsOptions, requestListener) : null;
|
|
15
|
-
injector.addProvider(httpsServer_1.HttpsServer, {
|
|
16
|
-
scope: di_1.ProviderScope.SINGLETON,
|
|
17
|
-
useValue: server
|
|
18
|
-
});
|
|
19
14
|
injector.addProvider(https_1.default.Server, {
|
|
20
15
|
scope: di_1.ProviderScope.SINGLETON,
|
|
21
16
|
useValue: server
|
|
22
17
|
});
|
|
23
|
-
injector.invoke(httpsServer_1.HttpsServer);
|
|
24
18
|
injector.invoke(https_1.default.Server);
|
|
25
19
|
if (server) {
|
|
26
20
|
const hostInfo = (0, core_1.getHostInfoFromPort)("https", httpsPort);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHttpsServer.js","sourceRoot":"","sources":["../../../src/utils/createHttpsServer.ts"],"names":[],"mappings":";;;;AAAA,iCAAwD;AACxD,qCAA+C;AAC/C,0DAA0B;AAE1B,
|
|
1
|
+
{"version":3,"file":"createHttpsServer.js","sourceRoot":"","sources":["../../../src/utils/createHttpsServer.ts"],"names":[],"mappings":";;;;AAAA,iCAAwD;AACxD,qCAA+C;AAC/C,0DAA0B;AAE1B,iDAA4C;AAE5C,SAAgB,iBAAiB,CAAC,QAAyB,EAAE,eAAsC;IACjG,MAAM,EAAC,QAAQ,EAAC,GAAG,QAAQ,CAAC;IAC5B,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC/C,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAErD,MAAM,MAAM,GAAG,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,eAAK,CAAC,YAAY,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE9F,QAAQ,CAAC,WAAW,CAAC,eAAK,CAAC,MAAM,EAAE;QACjC,KAAK,EAAE,kBAAa,CAAC,SAAS;QAC9B,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,CAAC,eAAK,CAAC,MAAM,CAAC,CAAC;IAE9B,IAAI,MAAM,EAAE;QACV,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAEzD,OAAO,KAAK,IAAI,EAAE;YAChB,MAAM,gBAAgB,GAAG,MAAM,IAAA,2BAAY,EAAC,QAAQ,EAAE,MAAsB,EAAE,QAAQ,CAAC,CAAC;YACxF,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,gBAAgB,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;YACrF,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;KACH;AACH,CAAC;AAvBD,8CAuBC","sourcesContent":["import {InjectorService, ProviderScope} from \"@tsed/di\";\nimport {getHostInfoFromPort} from \"@tsed/core\";\nimport Https from \"https\";\nimport Http from \"http\";\nimport {listenServer} from \"./listenServer\";\n\nexport function createHttpsServer(injector: InjectorService, requestListener?: Http.RequestListener) {\n const {settings} = injector;\n const httpsPort = settings.getRaw(\"httpsPort\");\n const httpsOptions = settings.getRaw(\"httpsOptions\");\n\n const server = httpsPort !== false ? Https.createServer(httpsOptions, requestListener) : null;\n\n injector.addProvider(Https.Server, {\n scope: ProviderScope.SINGLETON,\n useValue: server\n });\n\n injector.invoke(Https.Server);\n\n if (server) {\n const hostInfo = getHostInfoFromPort(\"https\", httpsPort);\n\n return async () => {\n const resolvedHostInfo = await listenServer(injector, server as Https.Server, hostInfo);\n settings.setRaw(\"httpsPort\", `${resolvedHostInfo.address}:${resolvedHostInfo.port}`);\n return server;\n };\n }\n}\n"]}
|
package/lib/esm/index.js
CHANGED
|
@@ -11,8 +11,6 @@ export * from "./config/interfaces/PlatformMulterSettings.js";
|
|
|
11
11
|
export * from "./config/interfaces/PlatformStaticsSettings.js";
|
|
12
12
|
export * from "./config/services/PlatformConfiguration.js";
|
|
13
13
|
export * from "./constants/routerOptions.js";
|
|
14
|
-
export * from "./decorators/httpServer.js";
|
|
15
|
-
export * from "./decorators/httpsServer.js";
|
|
16
14
|
export * from "./decorators/multer/multerFileSize.js";
|
|
17
15
|
export * from "./decorators/multer/multerOptions.js";
|
|
18
16
|
export * from "./decorators/multer/multipartFile.js";
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AACxD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AACxD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./exports\";\nexport * from \"./builder/PlatformBuilder\";\nexport * from \"./builder/PlatformControllerBuilder\";\nexport * from \"./config/interfaces/ConverterSettings\";\nexport * from \"./config/interfaces/EndpointDirectoriesSettings\";\nexport * from \"./config/interfaces/PlatformLoggerSettings\";\nexport * from \"./config/interfaces/PlatformMulterSettings\";\nexport * from \"./config/interfaces/PlatformStaticsSettings\";\nexport * from \"./config/services/PlatformConfiguration\";\nexport * from \"./constants/routerOptions\";\nexport * from \"./decorators/multer/multerFileSize\";\nexport * from \"./decorators/multer/multerOptions\";\nexport * from \"./decorators/multer/multipartFile\";\nexport * from \"./decorators/params/error\";\nexport * from \"./decorators/params/next\";\nexport * from \"./decorators/params/request\";\nexport * from \"./decorators/params/response\";\nexport * from \"./domain/AnyToPromiseWithCtx\";\nexport * from \"./domain/ControllerProvider\";\nexport * from \"./domain/EndpointMetadata\";\nexport * from \"./domain/HandlerMetadata\";\nexport * from \"./domain/PlatformContext\";\nexport * from \"./domain/PlatformRouteDetails\";\nexport * from \"./interfaces/AfterInit\";\nexport * from \"./interfaces/AfterListen\";\nexport * from \"./interfaces/AfterRoutesInit\";\nexport * from \"./interfaces/BeforeInit\";\nexport * from \"./interfaces/BeforeListen\";\nexport * from \"./interfaces/BeforeRoutesInit\";\nexport * from \"./interfaces/HandlerType\";\nexport * from \"./interfaces/IncomingEvent\";\nexport * from \"./interfaces/OnReady\";\nexport * from \"./interfaces/OnRequest\";\nexport * from \"./interfaces/OnResponse\";\nexport * from \"./interfaces/OnRoutesInit\";\nexport * from \"./interfaces/PlatformRouteOptions\";\nexport * from \"./interfaces/ResponseErrorObject\";\nexport * from \"./interfaces/Route\";\nexport * from \"./middlewares/PlatformAcceptMimesMiddleware\";\nexport * from \"./middlewares/PlatformMulterMiddleware\";\nexport * from \"./middlewares/bindEndpointMiddleware\";\nexport * from \"./services/FakeAdapter\";\nexport * from \"./services/Platform\";\nexport * from \"./services/PlatformAdapter\";\nexport * from \"./services/PlatformApplication\";\nexport * from \"./services/PlatformHandler\";\nexport * from \"./services/PlatformMiddlewaresChain\";\nexport * from \"./services/PlatformRequest\";\nexport * from \"./services/PlatformResponse\";\nexport * from \"./services/PlatformRouter\";\nexport * from \"./services/PlatformTest\";\nexport * from \"./utils/createContext\";\nexport * from \"./utils/createHandlerMetadata\";\nexport * from \"./utils/createHttpServer\";\nexport * from \"./utils/createHttpsServer\";\nexport * from \"./utils/createInjector\";\nexport * from \"./utils/getStaticsOptions\";\nexport * from \"./utils/importProviders\";\nexport * from \"./utils/listenServer\";\nexport * from \"./utils/mapReturnedResponse\";\nexport * from \"./utils/printRoutes\";\nexport * from \"./utils/setResponseHeaders\";\nexport * from \"./utils/useCtxHandler\";\n"]}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import { ProviderScope } from "@tsed/di";
|
|
2
2
|
import { getHostInfoFromPort } from "@tsed/core";
|
|
3
3
|
import Http from "http";
|
|
4
|
-
import { HttpServer } from "../decorators/httpServer.js";
|
|
5
4
|
import { listenServer } from "./listenServer.js";
|
|
6
5
|
export function createHttpServer(injector, requestListener) {
|
|
7
6
|
const { settings } = injector;
|
|
8
7
|
const httpPort = settings.getRaw("httpPort");
|
|
9
8
|
const httpOptions = settings.getRaw("httpOptions");
|
|
10
9
|
const server = httpPort !== false ? Http.createServer(httpOptions, requestListener) : null;
|
|
11
|
-
injector.addProvider(HttpServer, {
|
|
12
|
-
scope: ProviderScope.SINGLETON,
|
|
13
|
-
useValue: server
|
|
14
|
-
});
|
|
15
10
|
injector.addProvider(Http.Server, {
|
|
16
11
|
scope: ProviderScope.SINGLETON,
|
|
17
12
|
useValue: server
|
|
18
13
|
});
|
|
19
|
-
injector.invoke(HttpServer);
|
|
20
14
|
injector.invoke(Http.Server);
|
|
21
15
|
if (server) {
|
|
22
16
|
const hostInfo = getHostInfoFromPort("http", httpPort);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHttpServer.js","sourceRoot":"","sources":["../../../src/utils/createHttpServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAC,MAAM,UAAU,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,YAAY,CAAC;AAC/C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"createHttpServer.js","sourceRoot":"","sources":["../../../src/utils/createHttpServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAC,MAAM,UAAU,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,YAAY,CAAC;AAC/C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,gBAAgB,CAAC,QAAyB,EAAE,eAAqC;IAC/F,MAAM,EAAC,QAAQ,EAAC,GAAG,QAAQ,CAAC;IAC5B,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAEnD,MAAM,MAAM,GAAG,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE3F,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE;QAChC,KAAK,EAAE,aAAa,CAAC,SAAS;QAC9B,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE7B,IAAI,MAAM,EAAE;QACV,MAAM,QAAQ,GAAG,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEvD,OAAO,KAAK,IAAI,EAAE;YAChB,MAAM,gBAAgB,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,MAAqB,EAAE,QAAQ,CAAC,CAAC;YACvF,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,gBAAgB,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;YACpF,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;KACH;AACH,CAAC","sourcesContent":["import {InjectorService, ProviderScope} from \"@tsed/di\";\nimport {getHostInfoFromPort} from \"@tsed/core\";\nimport Http from \"http\";\nimport {listenServer} from \"./listenServer\";\n\nexport function createHttpServer(injector: InjectorService, requestListener: Http.RequestListener) {\n const {settings} = injector;\n const httpPort = settings.getRaw(\"httpPort\");\n const httpOptions = settings.getRaw(\"httpOptions\");\n\n const server = httpPort !== false ? Http.createServer(httpOptions, requestListener) : null;\n\n injector.addProvider(Http.Server, {\n scope: ProviderScope.SINGLETON,\n useValue: server\n });\n\n injector.invoke(Http.Server);\n\n if (server) {\n const hostInfo = getHostInfoFromPort(\"http\", httpPort);\n\n return async () => {\n const resolvedHostInfo = await listenServer(injector, server as Http.Server, hostInfo);\n settings.setRaw(\"httpPort\", `${resolvedHostInfo.address}:${resolvedHostInfo.port}`);\n return server;\n };\n }\n}\n"]}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import { ProviderScope } from "@tsed/di";
|
|
2
2
|
import { getHostInfoFromPort } from "@tsed/core";
|
|
3
3
|
import Https from "https";
|
|
4
|
-
import { HttpsServer } from "../decorators/httpsServer.js";
|
|
5
4
|
import { listenServer } from "./listenServer.js";
|
|
6
5
|
export function createHttpsServer(injector, requestListener) {
|
|
7
6
|
const { settings } = injector;
|
|
8
7
|
const httpsPort = settings.getRaw("httpsPort");
|
|
9
8
|
const httpsOptions = settings.getRaw("httpsOptions");
|
|
10
9
|
const server = httpsPort !== false ? Https.createServer(httpsOptions, requestListener) : null;
|
|
11
|
-
injector.addProvider(HttpsServer, {
|
|
12
|
-
scope: ProviderScope.SINGLETON,
|
|
13
|
-
useValue: server
|
|
14
|
-
});
|
|
15
10
|
injector.addProvider(Https.Server, {
|
|
16
11
|
scope: ProviderScope.SINGLETON,
|
|
17
12
|
useValue: server
|
|
18
13
|
});
|
|
19
|
-
injector.invoke(HttpsServer);
|
|
20
14
|
injector.invoke(Https.Server);
|
|
21
15
|
if (server) {
|
|
22
16
|
const hostInfo = getHostInfoFromPort("https", httpsPort);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHttpsServer.js","sourceRoot":"","sources":["../../../src/utils/createHttpsServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAC,MAAM,UAAU,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"createHttpsServer.js","sourceRoot":"","sources":["../../../src/utils/createHttpsServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAC,MAAM,UAAU,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,iBAAiB,CAAC,QAAyB,EAAE,eAAsC;IACjG,MAAM,EAAC,QAAQ,EAAC,GAAG,QAAQ,CAAC;IAC5B,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC/C,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAErD,MAAM,MAAM,GAAG,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE9F,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE;QACjC,KAAK,EAAE,aAAa,CAAC,SAAS;QAC9B,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE9B,IAAI,MAAM,EAAE;QACV,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAEzD,OAAO,KAAK,IAAI,EAAE;YAChB,MAAM,gBAAgB,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,MAAsB,EAAE,QAAQ,CAAC,CAAC;YACxF,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,gBAAgB,CAAC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;YACrF,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;KACH;AACH,CAAC","sourcesContent":["import {InjectorService, ProviderScope} from \"@tsed/di\";\nimport {getHostInfoFromPort} from \"@tsed/core\";\nimport Https from \"https\";\nimport Http from \"http\";\nimport {listenServer} from \"./listenServer\";\n\nexport function createHttpsServer(injector: InjectorService, requestListener?: Http.RequestListener) {\n const {settings} = injector;\n const httpsPort = settings.getRaw(\"httpsPort\");\n const httpsOptions = settings.getRaw(\"httpsOptions\");\n\n const server = httpsPort !== false ? Https.createServer(httpsOptions, requestListener) : null;\n\n injector.addProvider(Https.Server, {\n scope: ProviderScope.SINGLETON,\n useValue: server\n });\n\n injector.invoke(Https.Server);\n\n if (server) {\n const hostInfo = getHostInfoFromPort(\"https\", httpsPort);\n\n return async () => {\n const resolvedHostInfo = await listenServer(injector, server as Https.Server, hostInfo);\n settings.setRaw(\"httpsPort\", `${resolvedHostInfo.address}:${resolvedHostInfo.port}`);\n return server;\n };\n }\n}\n"]}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -11,8 +11,6 @@ export * from "./config/interfaces/PlatformMulterSettings";
|
|
|
11
11
|
export * from "./config/interfaces/PlatformStaticsSettings";
|
|
12
12
|
export * from "./config/services/PlatformConfiguration";
|
|
13
13
|
export * from "./constants/routerOptions";
|
|
14
|
-
export * from "./decorators/httpServer";
|
|
15
|
-
export * from "./decorators/httpsServer";
|
|
16
14
|
export * from "./decorators/multer/multerFileSize";
|
|
17
15
|
export * from "./decorators/multer/multerOptions";
|
|
18
16
|
export * from "./decorators/multer/multipartFile";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/common",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.7",
|
|
4
4
|
"description": "A TypeScript Framework on top of Express",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -61,22 +61,22 @@
|
|
|
61
61
|
}
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@tsed/components-scan": "7.0.0-beta.
|
|
65
|
-
"@tsed/core": "7.0.0-beta.
|
|
66
|
-
"@tsed/di": "7.0.0-beta.
|
|
67
|
-
"@tsed/exceptions": "7.0.0-beta.
|
|
68
|
-
"@tsed/json-mapper": "7.0.0-beta.
|
|
64
|
+
"@tsed/components-scan": "7.0.0-beta.7",
|
|
65
|
+
"@tsed/core": "7.0.0-beta.7",
|
|
66
|
+
"@tsed/di": "7.0.0-beta.7",
|
|
67
|
+
"@tsed/exceptions": "7.0.0-beta.7",
|
|
68
|
+
"@tsed/json-mapper": "7.0.0-beta.7",
|
|
69
69
|
"@tsed/logger": ">=6.1.1",
|
|
70
70
|
"@tsed/logger-file": ">=6.1.0",
|
|
71
|
-
"@tsed/perf": "7.0.0-beta.
|
|
72
|
-
"@tsed/platform-cache": "7.0.0-beta.
|
|
73
|
-
"@tsed/platform-exceptions": "7.0.0-beta.
|
|
74
|
-
"@tsed/platform-log-middleware": "7.0.0-beta.
|
|
75
|
-
"@tsed/platform-middlewares": "7.0.0-beta.
|
|
76
|
-
"@tsed/platform-params": "7.0.0-beta.
|
|
77
|
-
"@tsed/platform-response-filter": "7.0.0-beta.
|
|
78
|
-
"@tsed/platform-views": "7.0.0-beta.
|
|
79
|
-
"@tsed/schema": "7.0.0-beta.
|
|
71
|
+
"@tsed/perf": "7.0.0-beta.7",
|
|
72
|
+
"@tsed/platform-cache": "7.0.0-beta.7",
|
|
73
|
+
"@tsed/platform-exceptions": "7.0.0-beta.7",
|
|
74
|
+
"@tsed/platform-log-middleware": "7.0.0-beta.7",
|
|
75
|
+
"@tsed/platform-middlewares": "7.0.0-beta.7",
|
|
76
|
+
"@tsed/platform-params": "7.0.0-beta.7",
|
|
77
|
+
"@tsed/platform-response-filter": "7.0.0-beta.7",
|
|
78
|
+
"@tsed/platform-views": "7.0.0-beta.7",
|
|
79
|
+
"@tsed/schema": "7.0.0-beta.7",
|
|
80
80
|
"@types/json-schema": "7.0.11",
|
|
81
81
|
"@types/on-finished": "2.3.1",
|
|
82
82
|
"on-finished": "2.4.1",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpServer = void 0;
|
|
4
|
-
const di_1 = require("@tsed/di");
|
|
5
|
-
/**
|
|
6
|
-
* Inject the Http.Server instance.
|
|
7
|
-
*
|
|
8
|
-
* ### Example
|
|
9
|
-
*
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import {HttpServer, Service} from "@tsed/common";
|
|
12
|
-
*
|
|
13
|
-
* @Service()
|
|
14
|
-
* export default class OtherService {
|
|
15
|
-
* constructor(@HttpServer httpServer: HttpServer) {}
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* > Note: TypeScript transform and store `HttpServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
|
|
20
|
-
*
|
|
21
|
-
* @param {Type<any>} target
|
|
22
|
-
* @param {string} targetKey
|
|
23
|
-
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
24
|
-
* @returns {any}
|
|
25
|
-
* @decorator
|
|
26
|
-
* @deprecated Use Https.Server from "http"
|
|
27
|
-
*/
|
|
28
|
-
function HttpServer(target, targetKey, descriptor) {
|
|
29
|
-
return (0, di_1.Inject)(HttpServer)(target, targetKey, descriptor);
|
|
30
|
-
}
|
|
31
|
-
exports.HttpServer = HttpServer;
|
|
32
|
-
//# sourceMappingURL=httpServer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"httpServer.js","sourceRoot":"","sources":["../../../src/decorators/httpServer.ts"],"names":[],"mappings":";;;AACA,iCAAgC;AAGhC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,UAAU,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAsD;IACrH,OAAO,IAAA,WAAM,EAAC,UAAU,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC3D,CAAC;AAFD,gCAEC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {Inject} from \"@tsed/di\";\nimport Http from \"http\";\n\n/**\n * Inject the Http.Server instance.\n *\n * ### Example\n *\n * ```typescript\n * import {HttpServer, Service} from \"@tsed/common\";\n *\n * @Service()\n * export default class OtherService {\n * constructor(@HttpServer httpServer: HttpServer) {}\n * }\n * ```\n *\n * > Note: TypeScript transform and store `HttpServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.\n *\n * @param {Type<any>} target\n * @param {string} targetKey\n * @param {TypedPropertyDescriptor<Function> | number} descriptor\n * @returns {any}\n * @decorator\n * @deprecated Use Https.Server from \"http\"\n */\nexport function HttpServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number) {\n return Inject(HttpServer)(target, targetKey, descriptor);\n}\n\nexport type HttpServer = Http.Server;\n"]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpsServer = void 0;
|
|
4
|
-
const di_1 = require("@tsed/di");
|
|
5
|
-
/**
|
|
6
|
-
* Inject the Https.Server instance.
|
|
7
|
-
*
|
|
8
|
-
* ### Example
|
|
9
|
-
*
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import {HttpsServer, Service} from "@tsed/common";
|
|
12
|
-
*
|
|
13
|
-
* @Service()
|
|
14
|
-
* export default class OtherService {
|
|
15
|
-
* constructor(@HttpsServer httpServer: HttpServer) {}
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* > Note: TypeScript transform and store `HttpsServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
|
|
20
|
-
*
|
|
21
|
-
* @param {Type<any>} target
|
|
22
|
-
* @param {string} targetKey
|
|
23
|
-
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
24
|
-
* @returns {any}
|
|
25
|
-
* @decorator
|
|
26
|
-
* @deprecated Use Https.Server from "https"
|
|
27
|
-
*/
|
|
28
|
-
function HttpsServer(target, targetKey, descriptor) {
|
|
29
|
-
return (0, di_1.Inject)(HttpsServer)(target, targetKey, descriptor);
|
|
30
|
-
}
|
|
31
|
-
exports.HttpsServer = HttpsServer;
|
|
32
|
-
//# sourceMappingURL=httpsServer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"httpsServer.js","sourceRoot":"","sources":["../../../src/decorators/httpsServer.ts"],"names":[],"mappings":";;;AACA,iCAAgC;AAGhC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,WAAW,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAsD;IACtH,OAAO,IAAA,WAAM,EAAC,WAAW,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC5D,CAAC;AAFD,kCAEC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {Inject} from \"@tsed/di\";\nimport Https from \"https\";\n\n/**\n * Inject the Https.Server instance.\n *\n * ### Example\n *\n * ```typescript\n * import {HttpsServer, Service} from \"@tsed/common\";\n *\n * @Service()\n * export default class OtherService {\n * constructor(@HttpsServer httpServer: HttpServer) {}\n * }\n * ```\n *\n * > Note: TypeScript transform and store `HttpsServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.\n *\n * @param {Type<any>} target\n * @param {string} targetKey\n * @param {TypedPropertyDescriptor<Function> | number} descriptor\n * @returns {any}\n * @decorator\n * @deprecated Use Https.Server from \"https\"\n */\nexport function HttpsServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number) {\n return Inject(HttpsServer)(target, targetKey, descriptor);\n}\n\nexport type HttpsServer = Https.Server;\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Inject } from "@tsed/di";
|
|
2
|
-
/**
|
|
3
|
-
* Inject the Http.Server instance.
|
|
4
|
-
*
|
|
5
|
-
* ### Example
|
|
6
|
-
*
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import {HttpServer, Service} from "@tsed/common";
|
|
9
|
-
*
|
|
10
|
-
* @Service()
|
|
11
|
-
* export default class OtherService {
|
|
12
|
-
* constructor(@HttpServer httpServer: HttpServer) {}
|
|
13
|
-
* }
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* > Note: TypeScript transform and store `HttpServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
|
|
17
|
-
*
|
|
18
|
-
* @param {Type<any>} target
|
|
19
|
-
* @param {string} targetKey
|
|
20
|
-
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
21
|
-
* @returns {any}
|
|
22
|
-
* @decorator
|
|
23
|
-
* @deprecated Use Https.Server from "http"
|
|
24
|
-
*/
|
|
25
|
-
export function HttpServer(target, targetKey, descriptor) {
|
|
26
|
-
return Inject(HttpServer)(target, targetKey, descriptor);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=httpServer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"httpServer.js","sourceRoot":"","sources":["../../../src/decorators/httpServer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAGhC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,UAAU,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAsD;IACrH,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {Inject} from \"@tsed/di\";\nimport Http from \"http\";\n\n/**\n * Inject the Http.Server instance.\n *\n * ### Example\n *\n * ```typescript\n * import {HttpServer, Service} from \"@tsed/common\";\n *\n * @Service()\n * export default class OtherService {\n * constructor(@HttpServer httpServer: HttpServer) {}\n * }\n * ```\n *\n * > Note: TypeScript transform and store `HttpServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.\n *\n * @param {Type<any>} target\n * @param {string} targetKey\n * @param {TypedPropertyDescriptor<Function> | number} descriptor\n * @returns {any}\n * @decorator\n * @deprecated Use Https.Server from \"http\"\n */\nexport function HttpServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number) {\n return Inject(HttpServer)(target, targetKey, descriptor);\n}\n\nexport type HttpServer = Http.Server;\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Inject } from "@tsed/di";
|
|
2
|
-
/**
|
|
3
|
-
* Inject the Https.Server instance.
|
|
4
|
-
*
|
|
5
|
-
* ### Example
|
|
6
|
-
*
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import {HttpsServer, Service} from "@tsed/common";
|
|
9
|
-
*
|
|
10
|
-
* @Service()
|
|
11
|
-
* export default class OtherService {
|
|
12
|
-
* constructor(@HttpsServer httpServer: HttpServer) {}
|
|
13
|
-
* }
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* > Note: TypeScript transform and store `HttpsServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
|
|
17
|
-
*
|
|
18
|
-
* @param {Type<any>} target
|
|
19
|
-
* @param {string} targetKey
|
|
20
|
-
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
21
|
-
* @returns {any}
|
|
22
|
-
* @decorator
|
|
23
|
-
* @deprecated Use Https.Server from "https"
|
|
24
|
-
*/
|
|
25
|
-
export function HttpsServer(target, targetKey, descriptor) {
|
|
26
|
-
return Inject(HttpsServer)(target, targetKey, descriptor);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=httpsServer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"httpsServer.js","sourceRoot":"","sources":["../../../src/decorators/httpsServer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAGhC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,WAAW,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAsD;IACtH,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {Inject} from \"@tsed/di\";\nimport Https from \"https\";\n\n/**\n * Inject the Https.Server instance.\n *\n * ### Example\n *\n * ```typescript\n * import {HttpsServer, Service} from \"@tsed/common\";\n *\n * @Service()\n * export default class OtherService {\n * constructor(@HttpsServer httpServer: HttpServer) {}\n * }\n * ```\n *\n * > Note: TypeScript transform and store `HttpsServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.\n *\n * @param {Type<any>} target\n * @param {string} targetKey\n * @param {TypedPropertyDescriptor<Function> | number} descriptor\n * @returns {any}\n * @decorator\n * @deprecated Use Https.Server from \"https\"\n */\nexport function HttpsServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number) {\n return Inject(HttpsServer)(target, targetKey, descriptor);\n}\n\nexport type HttpsServer = Https.Server;\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Type } from "@tsed/core";
|
|
3
|
-
import Http from "http";
|
|
4
|
-
/**
|
|
5
|
-
* Inject the Http.Server instance.
|
|
6
|
-
*
|
|
7
|
-
* ### Example
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import {HttpServer, Service} from "@tsed/common";
|
|
11
|
-
*
|
|
12
|
-
* @Service()
|
|
13
|
-
* export default class OtherService {
|
|
14
|
-
* constructor(@HttpServer httpServer: HttpServer) {}
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* > Note: TypeScript transform and store `HttpServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
|
|
19
|
-
*
|
|
20
|
-
* @param {Type<any>} target
|
|
21
|
-
* @param {string} targetKey
|
|
22
|
-
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
23
|
-
* @returns {any}
|
|
24
|
-
* @decorator
|
|
25
|
-
* @deprecated Use Https.Server from "http"
|
|
26
|
-
*/
|
|
27
|
-
export declare function HttpServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
|
|
28
|
-
export declare type HttpServer = Http.Server;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Type } from "@tsed/core";
|
|
3
|
-
import Https from "https";
|
|
4
|
-
/**
|
|
5
|
-
* Inject the Https.Server instance.
|
|
6
|
-
*
|
|
7
|
-
* ### Example
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import {HttpsServer, Service} from "@tsed/common";
|
|
11
|
-
*
|
|
12
|
-
* @Service()
|
|
13
|
-
* export default class OtherService {
|
|
14
|
-
* constructor(@HttpsServer httpServer: HttpServer) {}
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* > Note: TypeScript transform and store `HttpsServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
|
|
19
|
-
*
|
|
20
|
-
* @param {Type<any>} target
|
|
21
|
-
* @param {string} targetKey
|
|
22
|
-
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
23
|
-
* @returns {any}
|
|
24
|
-
* @decorator
|
|
25
|
-
* @deprecated Use Https.Server from "https"
|
|
26
|
-
*/
|
|
27
|
-
export declare function HttpsServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
|
|
28
|
-
export declare type HttpsServer = Https.Server;
|