@tsed/common 7.0.0-beta.10 → 7.0.0-beta.11
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/builder/PlatformBuilder.js +13 -18
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -1
- package/lib/cjs/config/services/PlatformConfiguration.js +6 -0
- package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -1
- package/lib/cjs/index.js +0 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/services/PlatformTest.js +7 -1
- package/lib/cjs/services/PlatformTest.js.map +1 -1
- package/lib/cjs/utils/__mock__/controllers/rest/TestCtrl.js +12 -0
- package/lib/cjs/utils/__mock__/controllers/rest/TestCtrl.js.map +1 -0
- package/lib/cjs/utils/__mock__/module1/Module1.js +19 -0
- package/lib/cjs/utils/__mock__/module1/Module1.js.map +1 -0
- package/lib/cjs/utils/__mock__/module1/controllers/M1Ctrl1.js +17 -0
- package/lib/cjs/utils/__mock__/module1/controllers/M1Ctrl1.js.map +1 -0
- package/lib/cjs/utils/__mock__/module1/services/M1Service.js +17 -0
- package/lib/cjs/utils/__mock__/module1/services/M1Service.js.map +1 -0
- package/lib/cjs/utils/__mock__/module1/submodule/SubModule.js +15 -0
- package/lib/cjs/utils/__mock__/module1/submodule/SubModule.js.map +1 -0
- package/lib/cjs/utils/__mock__/module1/submodule/SubService.js +12 -0
- package/lib/cjs/utils/__mock__/module1/submodule/SubService.js.map +1 -0
- package/lib/cjs/utils/__mock__/module2/Module2.js +18 -0
- package/lib/cjs/utils/__mock__/module2/Module2.js.map +1 -0
- package/lib/cjs/utils/__mock__/module2/controllers/M2Ctrl.js +12 -0
- package/lib/cjs/utils/__mock__/module2/controllers/M2Ctrl.js.map +1 -0
- package/lib/cjs/utils/getConfiguration.js +4 -0
- package/lib/cjs/utils/getConfiguration.js.map +1 -1
- package/lib/esm/builder/PlatformBuilder.js +14 -19
- package/lib/esm/builder/PlatformBuilder.js.map +1 -1
- package/lib/esm/config/services/PlatformConfiguration.js +6 -0
- package/lib/esm/config/services/PlatformConfiguration.js.map +1 -1
- package/lib/esm/index.js +0 -2
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/services/PlatformTest.js +7 -1
- package/lib/esm/services/PlatformTest.js.map +1 -1
- package/lib/esm/utils/__mock__/controllers/rest/TestCtrl.js +9 -0
- package/lib/esm/utils/__mock__/controllers/rest/TestCtrl.js.map +1 -0
- package/lib/esm/utils/__mock__/module1/Module1.js +16 -0
- package/lib/esm/utils/__mock__/module1/Module1.js.map +1 -0
- package/lib/esm/utils/__mock__/module1/controllers/M1Ctrl1.js +14 -0
- package/lib/esm/utils/__mock__/module1/controllers/M1Ctrl1.js.map +1 -0
- package/lib/esm/utils/__mock__/module1/services/M1Service.js +14 -0
- package/lib/esm/utils/__mock__/module1/services/M1Service.js.map +1 -0
- package/lib/esm/utils/__mock__/module1/submodule/SubModule.js +12 -0
- package/lib/esm/utils/__mock__/module1/submodule/SubModule.js.map +1 -0
- package/lib/esm/utils/__mock__/module1/submodule/SubService.js +9 -0
- package/lib/esm/utils/__mock__/module1/submodule/SubService.js.map +1 -0
- package/lib/esm/utils/__mock__/module2/Module2.js +15 -0
- package/lib/esm/utils/__mock__/module2/Module2.js.map +1 -0
- package/lib/esm/utils/__mock__/module2/controllers/M2Ctrl.js +9 -0
- package/lib/esm/utils/__mock__/module2/controllers/M2Ctrl.js.map +1 -0
- package/lib/esm/utils/getConfiguration.js +4 -0
- package/lib/esm/utils/getConfiguration.js.map +1 -1
- package/lib/types/builder/PlatformBuilder.d.ts +3 -3
- package/lib/types/config/services/PlatformConfiguration.d.ts +11 -6
- package/lib/types/index.d.ts +0 -2
- package/lib/types/utils/__mock__/controllers/rest/TestCtrl.d.ts +2 -0
- package/lib/types/utils/__mock__/module1/Module1.d.ts +2 -0
- package/lib/types/utils/__mock__/module1/controllers/M1Ctrl1.d.ts +5 -0
- package/lib/types/utils/__mock__/module1/services/M1Service.d.ts +5 -0
- package/lib/types/utils/__mock__/module1/submodule/SubModule.d.ts +2 -0
- package/lib/types/utils/__mock__/module1/submodule/SubService.d.ts +2 -0
- package/lib/types/utils/__mock__/module2/Module2.d.ts +2 -0
- package/lib/types/utils/__mock__/module2/controllers/M2Ctrl.d.ts +2 -0
- package/package.json +15 -15
- package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js +0 -3
- package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js.map +0 -1
- package/lib/cjs/utils/importProviders.js +0 -29
- package/lib/cjs/utils/importProviders.js.map +0 -1
- package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js +0 -2
- package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js.map +0 -1
- package/lib/esm/utils/importProviders.js +0 -25
- package/lib/esm/utils/importProviders.js.map +0 -1
- package/lib/types/config/interfaces/EndpointDirectoriesSettings.d.ts +0 -3
- package/lib/types/utils/importProviders.d.ts +0 -10
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Env, getHostInfoFromPort } from "@tsed/core";
|
|
3
|
-
import { DIConfiguration } from "@tsed/di";
|
|
3
|
+
import { DIConfiguration, TokenProvider } from "@tsed/di";
|
|
4
4
|
import Https from "https";
|
|
5
5
|
import { ConverterSettings } from "../interfaces/ConverterSettings";
|
|
6
|
-
import { EndpointDirectoriesSettings } from "../interfaces/EndpointDirectoriesSettings";
|
|
7
6
|
import { PlatformLoggerSettings } from "../interfaces/PlatformLoggerSettings";
|
|
8
7
|
/**
|
|
9
8
|
* `PlatformConfiguration` contains all information about your Server configuration.
|
|
@@ -24,12 +23,18 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
24
23
|
set httpsPort(value: string | number | false);
|
|
25
24
|
get env(): Env;
|
|
26
25
|
set env(value: Env);
|
|
27
|
-
get mount():
|
|
28
|
-
set mount(value:
|
|
26
|
+
get mount(): Record<string, TokenProvider[]>;
|
|
27
|
+
set mount(value: Record<string, TokenProvider[]>);
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated
|
|
30
|
+
*/
|
|
29
31
|
get componentsScan(): string[];
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
*/
|
|
30
35
|
set componentsScan(value: string[]);
|
|
31
|
-
get statics():
|
|
32
|
-
set statics(value:
|
|
36
|
+
get statics(): Record<string, (any | string)[]>;
|
|
37
|
+
set statics(value: Record<string, (any | string)[]>);
|
|
33
38
|
get acceptMimes(): string[];
|
|
34
39
|
set acceptMimes(value: string[]);
|
|
35
40
|
get debug(): boolean;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from "./exports";
|
|
|
5
5
|
export * from "./builder/PlatformBuilder";
|
|
6
6
|
export * from "./builder/PlatformControllerBuilder";
|
|
7
7
|
export * from "./config/interfaces/ConverterSettings";
|
|
8
|
-
export * from "./config/interfaces/EndpointDirectoriesSettings";
|
|
9
8
|
export * from "./config/interfaces/PlatformLoggerSettings";
|
|
10
9
|
export * from "./config/interfaces/PlatformMulterSettings";
|
|
11
10
|
export * from "./config/interfaces/PlatformStaticsSettings";
|
|
@@ -58,7 +57,6 @@ export * from "./utils/createHttpServer";
|
|
|
58
57
|
export * from "./utils/createHttpsServer";
|
|
59
58
|
export * from "./utils/createInjector";
|
|
60
59
|
export * from "./utils/getStaticsOptions";
|
|
61
|
-
export * from "./utils/importProviders";
|
|
62
60
|
export * from "./utils/listenServer";
|
|
63
61
|
export * from "./utils/mapReturnedResponse";
|
|
64
62
|
export * from "./utils/printRoutes";
|
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.11",
|
|
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.11",
|
|
65
|
+
"@tsed/core": "7.0.0-beta.11",
|
|
66
|
+
"@tsed/di": "7.0.0-beta.11",
|
|
67
|
+
"@tsed/exceptions": "7.0.0-beta.11",
|
|
68
|
+
"@tsed/json-mapper": "7.0.0-beta.11",
|
|
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.11",
|
|
72
|
+
"@tsed/platform-cache": "7.0.0-beta.11",
|
|
73
|
+
"@tsed/platform-exceptions": "7.0.0-beta.11",
|
|
74
|
+
"@tsed/platform-log-middleware": "7.0.0-beta.11",
|
|
75
|
+
"@tsed/platform-middlewares": "7.0.0-beta.11",
|
|
76
|
+
"@tsed/platform-params": "7.0.0-beta.11",
|
|
77
|
+
"@tsed/platform-response-filter": "7.0.0-beta.11",
|
|
78
|
+
"@tsed/platform-views": "7.0.0-beta.11",
|
|
79
|
+
"@tsed/schema": "7.0.0-beta.11",
|
|
80
80
|
"@types/json-schema": "7.0.11",
|
|
81
81
|
"@types/on-finished": "2.3.1",
|
|
82
82
|
"on-finished": "2.4.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EndpointDirectoriesSettings.js","sourceRoot":"","sources":["../../../../src/config/interfaces/EndpointDirectoriesSettings.ts"],"names":[],"mappings":"","sourcesContent":["export interface EndpointDirectoriesSettings {\n [endpoint: string]: any | string | (any | string)[];\n}\n"]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.importProviders = void 0;
|
|
4
|
-
const di_1 = require("@tsed/di");
|
|
5
|
-
const components_scan_1 = require("@tsed/components-scan");
|
|
6
|
-
async function recursiveImports(providers, settings, properties) {
|
|
7
|
-
const { exclude = [] } = settings;
|
|
8
|
-
const promises = providers
|
|
9
|
-
.map(({ token }) => di_1.GlobalProviders.get(token))
|
|
10
|
-
.filter((provider) => (provider === null || provider === void 0 ? void 0 : provider.type) === di_1.ProviderType.MODULE && provider.configuration)
|
|
11
|
-
.map((provider) => importProviders({ exclude, ...provider.configuration }, properties));
|
|
12
|
-
return (await Promise.all(promises)).flat();
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Import providers from given patterns.
|
|
16
|
-
*
|
|
17
|
-
* @param settings
|
|
18
|
-
* @param properties
|
|
19
|
-
*/
|
|
20
|
-
async function importProviders(settings, properties = ["imports"]) {
|
|
21
|
-
const { exclude = [] } = settings;
|
|
22
|
-
const disableComponentsScan = settings.disableComponentsScan || !!process.env.WEBPACK;
|
|
23
|
-
const promises = properties.map((key) => (0, components_scan_1.importComponents)(settings[key], exclude, disableComponentsScan));
|
|
24
|
-
const providers = (await Promise.all(promises)).flat();
|
|
25
|
-
const children = await recursiveImports(providers, settings, properties);
|
|
26
|
-
return [...children, ...providers];
|
|
27
|
-
}
|
|
28
|
-
exports.importProviders = importProviders;
|
|
29
|
-
//# sourceMappingURL=importProviders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"importProviders.js","sourceRoot":"","sources":["../../../src/utils/importProviders.ts"],"names":[],"mappings":";;;AAAA,iCAAiE;AACjE,2DAAuD;AAEvD,KAAK,UAAU,gBAAgB,CAAC,SAA4C,EAAE,QAAqC,EAAE,UAAoB;IACvI,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,QAAQ,CAAC;IAEhC,MAAM,QAAQ,GAAG,SAAS;SACvB,GAAG,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,oBAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC5C,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,iBAAY,CAAC,MAAM,IAAI,QAAQ,CAAC,aAAa,CAAC;SACtF,GAAG,CAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,eAAe,CAAC,EAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,aAAa,EAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IAElG,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,eAAe,CACnC,QAAqC,EACrC,aAAuB,CAAC,SAAS,CAAC;IAElC,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,QAAQ,CAAC;IAChC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,qBAAqB,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAEtF,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,kCAAgB,EAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC1G,MAAM,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEzE,OAAO,CAAC,GAAG,QAAQ,EAAE,GAAG,SAAS,CAAC,CAAC;AACrC,CAAC;AAZD,0CAYC","sourcesContent":["import {GlobalProviders, Provider, ProviderType} from \"@tsed/di\";\nimport {importComponents} from \"@tsed/components-scan\";\n\nasync function recursiveImports(providers: {token: string; route?: string}[], settings: Partial<TsED.Configuration>, properties: string[]) {\n const {exclude = []} = settings;\n\n const promises = providers\n .map(({token}) => GlobalProviders.get(token))\n .filter((provider) => provider?.type === ProviderType.MODULE && provider.configuration)\n .map((provider: Provider) => importProviders({exclude, ...provider.configuration}, properties));\n\n return (await Promise.all(promises)).flat();\n}\n\n/**\n * Import providers from given patterns.\n *\n * @param settings\n * @param properties\n */\nexport async function importProviders(\n settings: Partial<TsED.Configuration>,\n properties: string[] = [\"imports\"]\n): Promise<{token: string; route?: string}[]> {\n const {exclude = []} = settings;\n const disableComponentsScan = settings.disableComponentsScan || !!process.env.WEBPACK;\n\n const promises = properties.map((key) => importComponents(settings[key], exclude, disableComponentsScan));\n const providers = (await Promise.all(promises)).flat();\n const children = await recursiveImports(providers, settings, properties);\n\n return [...children, ...providers];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EndpointDirectoriesSettings.js","sourceRoot":"","sources":["../../../../src/config/interfaces/EndpointDirectoriesSettings.ts"],"names":[],"mappings":"","sourcesContent":["export interface EndpointDirectoriesSettings {\n [endpoint: string]: any | string | (any | string)[];\n}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { GlobalProviders, ProviderType } from "@tsed/di";
|
|
2
|
-
import { importComponents } from "@tsed/components-scan";
|
|
3
|
-
async function recursiveImports(providers, settings, properties) {
|
|
4
|
-
const { exclude = [] } = settings;
|
|
5
|
-
const promises = providers
|
|
6
|
-
.map(({ token }) => GlobalProviders.get(token))
|
|
7
|
-
.filter((provider) => (provider === null || provider === void 0 ? void 0 : provider.type) === ProviderType.MODULE && provider.configuration)
|
|
8
|
-
.map((provider) => importProviders({ exclude, ...provider.configuration }, properties));
|
|
9
|
-
return (await Promise.all(promises)).flat();
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Import providers from given patterns.
|
|
13
|
-
*
|
|
14
|
-
* @param settings
|
|
15
|
-
* @param properties
|
|
16
|
-
*/
|
|
17
|
-
export async function importProviders(settings, properties = ["imports"]) {
|
|
18
|
-
const { exclude = [] } = settings;
|
|
19
|
-
const disableComponentsScan = settings.disableComponentsScan || !!process.env.WEBPACK;
|
|
20
|
-
const promises = properties.map((key) => importComponents(settings[key], exclude, disableComponentsScan));
|
|
21
|
-
const providers = (await Promise.all(promises)).flat();
|
|
22
|
-
const children = await recursiveImports(providers, settings, properties);
|
|
23
|
-
return [...children, ...providers];
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=importProviders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"importProviders.js","sourceRoot":"","sources":["../../../src/utils/importProviders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAY,YAAY,EAAC,MAAM,UAAU,CAAC;AACjE,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAEvD,KAAK,UAAU,gBAAgB,CAAC,SAA4C,EAAE,QAAqC,EAAE,UAAoB;IACvI,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,QAAQ,CAAC;IAEhC,MAAM,QAAQ,GAAG,SAAS;SACvB,GAAG,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC5C,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,YAAY,CAAC,MAAM,IAAI,QAAQ,CAAC,aAAa,CAAC;SACtF,GAAG,CAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,eAAe,CAAC,EAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,aAAa,EAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IAElG,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAAqC,EACrC,aAAuB,CAAC,SAAS,CAAC;IAElC,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,QAAQ,CAAC;IAChC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,qBAAqB,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAEtF,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC1G,MAAM,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEzE,OAAO,CAAC,GAAG,QAAQ,EAAE,GAAG,SAAS,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import {GlobalProviders, Provider, ProviderType} from \"@tsed/di\";\nimport {importComponents} from \"@tsed/components-scan\";\n\nasync function recursiveImports(providers: {token: string; route?: string}[], settings: Partial<TsED.Configuration>, properties: string[]) {\n const {exclude = []} = settings;\n\n const promises = providers\n .map(({token}) => GlobalProviders.get(token))\n .filter((provider) => provider?.type === ProviderType.MODULE && provider.configuration)\n .map((provider: Provider) => importProviders({exclude, ...provider.configuration}, properties));\n\n return (await Promise.all(promises)).flat();\n}\n\n/**\n * Import providers from given patterns.\n *\n * @param settings\n * @param properties\n */\nexport async function importProviders(\n settings: Partial<TsED.Configuration>,\n properties: string[] = [\"imports\"]\n): Promise<{token: string; route?: string}[]> {\n const {exclude = []} = settings;\n const disableComponentsScan = settings.disableComponentsScan || !!process.env.WEBPACK;\n\n const promises = properties.map((key) => importComponents(settings[key], exclude, disableComponentsScan));\n const providers = (await Promise.all(promises)).flat();\n const children = await recursiveImports(providers, settings, properties);\n\n return [...children, ...providers];\n}\n"]}
|