@rxap/schematic-nestjs 0.1.0-dev.2 → 0.1.0-dev.3
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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/package.json +21 -21
- package/src/index.js +2 -1
- package/src/schematics/crud/index.js +18 -14
- package/src/schematics/crud/index.js.map +1 -1
- package/src/schematics/crud/schema.js +2 -1
- package/src/schematics/crud-init/index.js +10 -7
- package/src/schematics/crud-init/index.js.map +1 -1
- package/src/schematics/crud-init/schema.js +2 -1
- package/src/schematics/crud-service/add-module-export.js +13 -8
- package/src/schematics/crud-service/add-module-export.js.map +1 -1
- package/src/schematics/crud-service/add-module-provider.js +13 -8
- package/src/schematics/crud-service/add-module-provider.js.map +1 -1
- package/src/schematics/crud-service/coerce-class-method.js +6 -5
- package/src/schematics/crud-service/coerce-class-method.js.map +1 -1
- package/src/schematics/crud-service/coerce-class-property.js +6 -5
- package/src/schematics/crud-service/coerce-class-property.js.map +1 -1
- package/src/schematics/crud-service/coerce-collection-enum.js +13 -7
- package/src/schematics/crud-service/coerce-collection-enum.js.map +1 -1
- package/src/schematics/crud-service/coerce-module-class.js +9 -5
- package/src/schematics/crud-service/coerce-module-class.js.map +1 -1
- package/src/schematics/crud-service/coerce-source-file-rule.js +7 -3
- package/src/schematics/crud-service/coerce-source-file-rule.js.map +1 -1
- package/src/schematics/crud-service/crud-class/create-method.js +14 -10
- package/src/schematics/crud-service/crud-class/create-method.js.map +1 -1
- package/src/schematics/crud-service/crud-class/delete-method.js +13 -9
- package/src/schematics/crud-service/crud-class/delete-method.js.map +1 -1
- package/src/schematics/crud-service/crud-class/exists-method.js +13 -9
- package/src/schematics/crud-service/crud-class/exists-method.js.map +1 -1
- package/src/schematics/crud-service/crud-class/find-in-group-method.js +9 -5
- package/src/schematics/crud-service/crud-class/find-in-group-method.js.map +1 -1
- package/src/schematics/crud-service/crud-class/find-method.js +13 -9
- package/src/schematics/crud-service/crud-class/find-method.js.map +1 -1
- package/src/schematics/crud-service/crud-class/get-method.js +13 -9
- package/src/schematics/crud-service/crud-class/get-method.js.map +1 -1
- package/src/schematics/crud-service/crud-class/update-field-method.js +14 -10
- package/src/schematics/crud-service/crud-class/update-field-method.js.map +1 -1
- package/src/schematics/crud-service/crud-class/update-method.js +14 -10
- package/src/schematics/crud-service/crud-class/update-method.js.map +1 -1
- package/src/schematics/crud-service/crud-class.js +26 -22
- package/src/schematics/crud-service/crud-class.js.map +1 -1
- package/src/schematics/crud-service/dto-class/create-dto-class.js +9 -5
- package/src/schematics/crud-service/dto-class/create-dto-class.js.map +1 -1
- package/src/schematics/crud-service/dto-class/dto-class.js +25 -21
- package/src/schematics/crud-service/dto-class/dto-class.js.map +1 -1
- package/src/schematics/crud-service/dto-class/update-dto-class.js +9 -5
- package/src/schematics/crud-service/dto-class/update-dto-class.js.map +1 -1
- package/src/schematics/crud-service/index.js +70 -65
- package/src/schematics/crud-service/index.js.map +1 -1
- package/src/schematics/crud-service/options.js +2 -1
- package/src/schematics/crud-service/schema.js +2 -1
- package/src/schematics/feature-microservice/index.js +30 -24
- package/src/schematics/feature-microservice/index.js.map +1 -1
- package/src/schematics/frontend-microservice/index.js +29 -23
- package/src/schematics/frontend-microservice/index.js.map +1 -1
- package/src/schematics/health-indicator/add-health-endpoint.js +12 -8
- package/src/schematics/health-indicator/add-health-endpoint.js.map +1 -1
- package/src/schematics/health-indicator/add-health-indicator.js +14 -10
- package/src/schematics/health-indicator/add-health-indicator.js.map +1 -1
- package/src/schematics/health-indicator/add-to-global-health-endpoint.js +14 -9
- package/src/schematics/health-indicator/add-to-global-health-endpoint.js.map +1 -1
- package/src/schematics/health-indicator/coerce-health-controller.js +12 -8
- package/src/schematics/health-indicator/coerce-health-controller.js.map +1 -1
- package/src/schematics/health-indicator/coerce-health-module.js +14 -10
- package/src/schematics/health-indicator/coerce-health-module.js.map +1 -1
- package/src/schematics/health-indicator/index.js +21 -18
- package/src/schematics/health-indicator/index.js.map +1 -1
- package/src/schematics/health-indicator-init/index.js +15 -12
- package/src/schematics/health-indicator-init/index.js.map +1 -1
- package/src/schematics/init/index.js +127 -112
- package/src/schematics/init/index.js.map +1 -1
- package/src/schematics/jwt/index.js +17 -14
- package/src/schematics/jwt/index.js.map +1 -1
- package/src/schematics/microservice/index.js +41 -35
- package/src/schematics/microservice/index.js.map +1 -1
- package/src/schematics/open-api/index.js +15 -12
- package/src/schematics/open-api/index.js.map +1 -1
- package/src/schematics/sentry/index.js +30 -25
- package/src/schematics/sentry/index.js.map +1 -1
- package/src/schematics/validator/index.js +10 -7
- package/src/schematics/validator/index.js.map +1 -1
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddHealthIndicator = void 0;
|
|
4
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
+
const ts_morph_1 = require("ts-morph");
|
|
6
|
+
const core_1 = require("@angular-devkit/core");
|
|
7
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
8
|
+
const { dasherize, classify } = core_1.strings;
|
|
9
|
+
function AddHealthIndicator(project, name) {
|
|
7
10
|
const indicatorSourceFile = project.createSourceFile(`/app/health/${dasherize(name)}.health-indicator.ts`);
|
|
8
|
-
const indicatorClassName = CoerceSuffix(classify(name), 'HealthIndicator');
|
|
11
|
+
const indicatorClassName = (0, schematics_utilities_1.CoerceSuffix)(classify(name), 'HealthIndicator');
|
|
9
12
|
indicatorSourceFile.addClass({
|
|
10
13
|
name: indicatorClassName,
|
|
11
14
|
isExported: true,
|
|
@@ -26,7 +29,7 @@ export function AddHealthIndicator(project, name) {
|
|
|
26
29
|
{
|
|
27
30
|
name: 'isHealthy',
|
|
28
31
|
isAsync: true,
|
|
29
|
-
scope: Scope.Public,
|
|
32
|
+
scope: ts_morph_1.Scope.Public,
|
|
30
33
|
returnType: 'Promise<HealthIndicatorResult>',
|
|
31
34
|
statements: [
|
|
32
35
|
`throw new HealthCheckError('Not yet implemented!', this.getStatus('${dasherize(name)}', false))`,
|
|
@@ -44,9 +47,9 @@ export function AddHealthIndicator(project, name) {
|
|
|
44
47
|
moduleSpecifier: '@nestjs/terminus',
|
|
45
48
|
},
|
|
46
49
|
]);
|
|
47
|
-
const moduleSourceFile = FindNestModuleSourceFile(project, '/app/health');
|
|
50
|
+
const moduleSourceFile = (0, schematics_ts_morph_1.FindNestModuleSourceFile)(project, '/app/health');
|
|
48
51
|
if (moduleSourceFile) {
|
|
49
|
-
AddNestModuleProvider(moduleSourceFile, indicatorClassName, [
|
|
52
|
+
(0, schematics_ts_morph_1.AddNestModuleProvider)(moduleSourceFile, indicatorClassName, [
|
|
50
53
|
{
|
|
51
54
|
namedImports: [indicatorClassName],
|
|
52
55
|
moduleSpecifier: `./${dasherize(name)}.health-indicator`,
|
|
@@ -54,4 +57,5 @@ export function AddHealthIndicator(project, name) {
|
|
|
54
57
|
]);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
60
|
+
exports.AddHealthIndicator = AddHealthIndicator;
|
|
57
61
|
//# sourceMappingURL=add-health-indicator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-health-indicator.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator/add-health-indicator.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"add-health-indicator.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator/add-health-indicator.ts"],"names":[],"mappings":";;;AAAA,qEAA0D;AAC1D,uCAGkB;AAClB,+CAA+C;AAC/C,mEAGmC;AAEnC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,cAAO,CAAC;AAExC,SAAgB,kBAAkB,CAAC,OAAgB,EAAE,IAAY;IAC/D,MAAM,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAgB,SAAS,CAAC,IAAI,CAAE,sBAAsB,CAAC,CAAC;IAE7G,MAAM,kBAAkB,GAAG,IAAA,mCAAY,EAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC,CAAC;IAE3E,mBAAmB,CAAC,QAAQ,CAAC;QAC3B,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,YAAY;gBAClB,SAAS,EAAE,EAAE;aACd;SACF;QACD,OAAO,EAAE,iBAAiB;QAC1B,KAAK,EAAE;YACL;gBACE,UAAU,EAAE,EAAE;gBACd,UAAU,EAAE,UAAU;aACvB;SACF;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,gBAAK,CAAC,MAAM;gBACnB,UAAU,EAAE,gCAAgC;gBAC5C,UAAU,EAAE;oBACV,sEAAuE,SAAS,CAAC,IAAI,CAAE,YAAY;iBACpG;aACF;SACF;KACF,CAAC,CAAC;IAEH,mBAAmB,CAAC,qBAAqB,CAAC;QACxC;YACE,YAAY,EAAE,CAAE,YAAY,CAAE;YAC9B,eAAe,EAAE,gBAAgB;SAClC;QACD;YACE,YAAY,EAAE,CAAE,kBAAkB,EAAE,iBAAiB,EAAE,uBAAuB,CAAE;YAChF,eAAe,EAAE,kBAAkB;SACpC;KACF,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,IAAA,8CAAwB,EAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAE1E,IAAI,gBAAgB,EAAE;QACpB,IAAA,2CAAqB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB;YACE;gBACE,YAAY,EAAE,CAAE,kBAAkB,CAAE;gBACpC,eAAe,EAAE,KAAM,SAAS,CAAC,IAAI,CAAE,mBAAmB;aAC3D;SACF,CACF,CAAC;KACH;AACH,CAAC;AA3DD,gDA2DC"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddToGlobalHealthEndpoint = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const core_1 = require("@angular-devkit/core");
|
|
6
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
7
|
+
const { dasherize, classify, camelize, decamelize } = core_1.strings;
|
|
8
|
+
function AddToGlobalHealthEndpoint(sourceFile, name) {
|
|
9
|
+
var _a, _b;
|
|
6
10
|
const classDeclaration = sourceFile.getClass('HealthController');
|
|
7
11
|
if (!classDeclaration) {
|
|
8
12
|
throw new Error('FATAL: could not find the HealthController class!');
|
|
9
13
|
}
|
|
10
14
|
const healthIndicatorClass = `${classify(name)}HealthIndicator`;
|
|
11
|
-
const methodDeclaration = CoerceClassMethod(classDeclaration, 'healthCheck', {
|
|
12
|
-
scope: Scope.Public,
|
|
15
|
+
const methodDeclaration = (0, schematics_ts_morph_1.CoerceClassMethod)(classDeclaration, 'healthCheck', {
|
|
16
|
+
scope: ts_morph_1.Scope.Public,
|
|
13
17
|
returnType: 'Promise<HealthCheckResult>',
|
|
14
18
|
statements: [
|
|
15
19
|
w => {
|
|
@@ -39,11 +43,12 @@ export function AddToGlobalHealthEndpoint(sourceFile, name) {
|
|
|
39
43
|
},
|
|
40
44
|
]);
|
|
41
45
|
const statement = methodDeclaration.getStatements().find(e => e.getFullText().match(/return this\.health\.check/));
|
|
42
|
-
const array = statement
|
|
43
|
-
if (array instanceof ArrayLiteralExpression) {
|
|
46
|
+
const array = (_b = (_a = statement === null || statement === void 0 ? void 0 : statement.getChildAtIndex(1)) === null || _a === void 0 ? void 0 : _a.getChildAtIndex(2)) === null || _b === void 0 ? void 0 : _b.getFirstChild();
|
|
47
|
+
if (array instanceof ts_morph_1.ArrayLiteralExpression) {
|
|
44
48
|
array.addElement(w => {
|
|
45
49
|
w.write(`async () => this.${camelize(healthIndicatorClass)}.isHealthy()`);
|
|
46
50
|
});
|
|
47
51
|
}
|
|
48
52
|
}
|
|
53
|
+
exports.AddToGlobalHealthEndpoint = AddToGlobalHealthEndpoint;
|
|
49
54
|
//# sourceMappingURL=add-to-global-health-endpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-to-global-health-endpoint.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator/add-to-global-health-endpoint.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"add-to-global-health-endpoint.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator/add-to-global-health-endpoint.ts"],"names":[],"mappings":";;;AAAA,uCAKkB;AAClB,+CAA+C;AAC/C,mEAA8D;AAE9D,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,cAAO,CAAC;AAE9D,SAAgB,yBAAyB,CACvC,UAAsB,EACtB,IAAY;;IAGZ,MAAM,gBAAgB,GAAG,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAEjE,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACtE;IAED,MAAM,oBAAoB,GAAG,GAAI,QAAQ,CAAC,IAAI,CAAE,iBAAiB,CAAC;IAElE,MAAM,iBAAiB,GAAsB,IAAA,uCAAiB,EAC5D,gBAAgB,EAChB,aAAa,EACb;QACE,KAAK,EAAE,gBAAK,CAAC,MAAM;QACnB,UAAU,EAAE,4BAA4B;QACxC,UAAU,EAAE;YACV,CAAC,CAAC,EAAE;gBACF,CAAC,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC;gBAC1C,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;SACF;QACD,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,KAAK;gBACX,SAAS,EAAE,EAAE;aACd;YACD;gBACE,IAAI,EAAE,aAAa;gBACnB,SAAS,EAAE,EAAE;aACd;SACF;KACF,CACF,CAAC;IAEF,UAAU,CAAC,qBAAqB,CAAC;QAC/B;YACE,eAAe,EAAE,kBAAkB;YACnC,YAAY,EAAE,CAAE,aAAa,EAAE,mBAAmB,CAAE;SACrD;QACD;YACE,eAAe,EAAE,gBAAgB;YACjC,YAAY,EAAE,CAAE,KAAK,CAAE;SACxB;KACF,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,iBAAiB,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEnH,MAAM,KAAK,GAAG,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,eAAe,CAAC,CAAC,CAAC,0CAAE,eAAe,CAAC,CAAC,CAAC,0CAAE,aAAa,EAAE,CAAC;IAEjF,IAAI,KAAK,YAAY,iCAAsB,EAAE;QAC3C,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;YACnB,CAAC,CAAC,KAAK,CAAC,oBAAqB,QAAQ,CAAC,oBAAoB,CAAE,cAAc,CAAC,CAAC;QAC9E,CAAC,CAAC,CAAC;KACJ;AAEH,CAAC;AA3DD,8DA2DC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoerceHealthController = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
|
+
function CoerceHealthController(project) {
|
|
7
|
+
const sourceFile = (0, schematics_ts_morph_1.CoerceSourceFile)(project, '/app/health/health.controller.ts');
|
|
8
|
+
(0, schematics_ts_morph_1.AddNestController)(project, 'health', {
|
|
6
9
|
sourceFile,
|
|
7
10
|
});
|
|
8
|
-
AddDependencyInjection(sourceFile, {
|
|
11
|
+
(0, schematics_ts_morph_1.AddDependencyInjection)(sourceFile, {
|
|
9
12
|
injectionToken: 'HealthCheckService',
|
|
10
13
|
parameterName: 'health',
|
|
11
|
-
scope: Scope.Private,
|
|
12
|
-
module: Module.NEST,
|
|
14
|
+
scope: ts_morph_1.Scope.Private,
|
|
15
|
+
module: schematics_ts_morph_1.Module.NEST,
|
|
13
16
|
}, [
|
|
14
17
|
{
|
|
15
18
|
namedImports: ['HealthCheckService'],
|
|
@@ -18,4 +21,5 @@ export function CoerceHealthController(project) {
|
|
|
18
21
|
]);
|
|
19
22
|
return sourceFile;
|
|
20
23
|
}
|
|
24
|
+
exports.CoerceHealthController = CoerceHealthController;
|
|
21
25
|
//# sourceMappingURL=coerce-health-controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-health-controller.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator/coerce-health-controller.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"coerce-health-controller.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator/coerce-health-controller.ts"],"names":[],"mappings":";;;AAAA,uCAIkB;AAClB,mEAKmC;AAEnC,SAAgB,sBAAsB,CAAC,OAAgB;IAErD,MAAM,UAAU,GAAG,IAAA,sCAAgB,EAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;IAEjF,IAAA,uCAAiB,EACf,OAAO,EACP,QAAQ,EACR;QACE,UAAU;KACX,CACF,CAAC;IAEF,IAAA,4CAAsB,EAAC,UAAU,EAAE;QACjC,cAAc,EAAE,oBAAoB;QACpC,aAAa,EAAE,QAAQ;QACvB,KAAK,EAAE,gBAAK,CAAC,OAAO;QACpB,MAAM,EAAE,4BAAM,CAAC,IAAI;KACpB,EAAE;QACD;YACE,YAAY,EAAE,CAAE,oBAAoB,CAAE;YACtC,eAAe,EAAE,kBAAkB;SACpC;KACF,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AAEpB,CAAC;AA1BD,wDA0BC"}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoerceHealthModule = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
6
|
+
function CoerceHealthModule(project) {
|
|
7
|
+
const sourceFile = (0, schematics_ts_morph_1.CoerceSourceFile)(project, '/app/health/health.module.ts');
|
|
8
|
+
(0, schematics_ts_morph_1.CoerceClass)(sourceFile, 'HealthModule', {
|
|
6
9
|
decorators: [
|
|
7
10
|
{
|
|
8
11
|
name: 'Module',
|
|
9
12
|
arguments: [
|
|
10
|
-
Writers.object({}),
|
|
13
|
+
ts_morph_1.Writers.object({}),
|
|
11
14
|
],
|
|
12
15
|
},
|
|
13
16
|
],
|
|
14
17
|
isExported: true,
|
|
15
18
|
});
|
|
16
|
-
AddNestModuleImport(sourceFile, 'TerminusModule', [
|
|
19
|
+
(0, schematics_ts_morph_1.AddNestModuleImport)(sourceFile, 'TerminusModule', [
|
|
17
20
|
{
|
|
18
21
|
moduleSpecifier: '@nestjs/terminus',
|
|
19
22
|
namedImports: ['TerminusModule'],
|
|
20
23
|
},
|
|
21
24
|
]);
|
|
22
|
-
AddNestModuleProvider(sourceFile, 'Logger', [
|
|
25
|
+
(0, schematics_ts_morph_1.AddNestModuleProvider)(sourceFile, 'Logger', [
|
|
23
26
|
{
|
|
24
27
|
moduleSpecifier: '@nestjs/common',
|
|
25
28
|
namedImports: ['Logger'],
|
|
@@ -31,9 +34,9 @@ export function CoerceHealthModule(project) {
|
|
|
31
34
|
namedImports: ['Module'],
|
|
32
35
|
},
|
|
33
36
|
]);
|
|
34
|
-
const appSourceFile = FindNestModuleSourceFile(project, '/app');
|
|
37
|
+
const appSourceFile = (0, schematics_ts_morph_1.FindNestModuleSourceFile)(project, '/app');
|
|
35
38
|
if (appSourceFile) {
|
|
36
|
-
AddNestModuleImport(appSourceFile, 'HealthModule', [
|
|
39
|
+
(0, schematics_ts_morph_1.AddNestModuleImport)(appSourceFile, 'HealthModule', [
|
|
37
40
|
{
|
|
38
41
|
namedImports: ['HealthModule'],
|
|
39
42
|
moduleSpecifier: './health/health.module',
|
|
@@ -41,4 +44,5 @@ export function CoerceHealthModule(project) {
|
|
|
41
44
|
]);
|
|
42
45
|
}
|
|
43
46
|
}
|
|
47
|
+
exports.CoerceHealthModule = CoerceHealthModule;
|
|
44
48
|
//# sourceMappingURL=coerce-health-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-health-module.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator/coerce-health-module.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"coerce-health-module.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator/coerce-health-module.ts"],"names":[],"mappings":";;;AAAA,uCAGkB;AAClB,mEAMmC;AAEnC,SAAgB,kBAAkB,CAAC,OAAgB;IAEjD,MAAM,UAAU,GAAG,IAAA,sCAAgB,EAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;IAE7E,IAAA,iCAAW,EAAC,UAAU,EAAE,cAAc,EAAE;QACtC,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE;oBACT,kBAAO,CAAC,MAAM,CAAC,EAAE,CAAC;iBACnB;aACF;SACF;QACD,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IAEH,IAAA,yCAAmB,EAAC,UAAU,EAAE,gBAAgB,EAAE;QAChD;YACE,eAAe,EAAE,kBAAkB;YACnC,YAAY,EAAE,CAAE,gBAAgB,CAAE;SACnC;KACF,CAAC,CAAC;IAEH,IAAA,2CAAqB,EAAC,UAAU,EAAE,QAAQ,EAAE;QAC1C;YACE,eAAe,EAAE,gBAAgB;YACjC,YAAY,EAAE,CAAE,QAAQ,CAAE;SAC3B;KACF,CAAC,CAAC;IAEH,UAAU,CAAC,qBAAqB,CAAC;QAC/B;YACE,eAAe,EAAE,gBAAgB;YACjC,YAAY,EAAE,CAAE,QAAQ,CAAE;SAC3B;KACF,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,IAAA,8CAAwB,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAEhE,IAAI,aAAa,EAAE;QAEjB,IAAA,yCAAmB,EACjB,aAAa,EACb,cAAc,EACd;YACE;gBACE,YAAY,EAAE,CAAE,cAAc,CAAE;gBAChC,eAAe,EAAE,wBAAwB;aAC1C;SACF,CACF,CAAC;KAEH;AAEH,CAAC;AAtDD,gDAsDC"}
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
4
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
+
const add_health_endpoint_1 = require("./add-health-endpoint");
|
|
7
|
+
const add_health_indicator_1 = require("./add-health-indicator");
|
|
8
|
+
const add_to_global_health_endpoint_1 = require("./add-to-global-health-endpoint");
|
|
9
|
+
const coerce_health_controller_1 = require("./coerce-health-controller");
|
|
10
|
+
const coerce_health_module_1 = require("./coerce-health-module");
|
|
11
|
+
function default_1(options) {
|
|
10
12
|
return () => {
|
|
11
|
-
return chain([
|
|
12
|
-
TsMorphNestProjectTransformRule({
|
|
13
|
+
return (0, schematics_1.chain)([
|
|
14
|
+
(0, schematics_ts_morph_1.TsMorphNestProjectTransformRule)({
|
|
13
15
|
project: options.project,
|
|
14
16
|
}, project => {
|
|
15
|
-
CoerceHealthModule(project);
|
|
16
|
-
const controllerSourceFile = CoerceHealthController(project);
|
|
17
|
-
AddHealthIndicator(project, options.name);
|
|
18
|
-
AddHealthEndpoint(controllerSourceFile, options.name);
|
|
19
|
-
AddToGlobalHealthEndpoint(controllerSourceFile, options.name);
|
|
17
|
+
(0, coerce_health_module_1.CoerceHealthModule)(project);
|
|
18
|
+
const controllerSourceFile = (0, coerce_health_controller_1.CoerceHealthController)(project);
|
|
19
|
+
(0, add_health_indicator_1.AddHealthIndicator)(project, options.name);
|
|
20
|
+
(0, add_health_endpoint_1.AddHealthEndpoint)(controllerSourceFile, options.name);
|
|
21
|
+
(0, add_to_global_health_endpoint_1.AddToGlobalHealthEndpoint)(controllerSourceFile, options.name);
|
|
20
22
|
}),
|
|
21
|
-
AddPackageJsonDependencyRule('@nestjs/terminus', 'latest', { soft: true }),
|
|
22
|
-
InstallNodePackages(),
|
|
23
|
+
(0, schematics_utilities_1.AddPackageJsonDependencyRule)('@nestjs/terminus', 'latest', { soft: true }),
|
|
24
|
+
(0, schematics_utilities_1.InstallNodePackages)(),
|
|
23
25
|
]);
|
|
24
26
|
};
|
|
25
27
|
}
|
|
28
|
+
exports.default = default_1;
|
|
26
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator/index.ts"],"names":[],"mappings":";;AAAA,2DAGoC;AACpC,mEAA4E;AAC5E,qEAGoC;AACpC,+DAA0D;AAC1D,iEAA4D;AAC5D,mFAA4E;AAC5E,yEAAoE;AACpE,iEAA4D;AAI5D,mBAAyB,OAA8B;IAErD,OAAO,GAAG,EAAE;QACV,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,qDAA+B,EAAC;gBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,EAAE,OAAO,CAAC,EAAE;gBACX,IAAA,yCAAkB,EAAC,OAAO,CAAC,CAAC;gBAC5B,MAAM,oBAAoB,GAAG,IAAA,iDAAsB,EAAC,OAAO,CAAC,CAAC;gBAC7D,IAAA,yCAAkB,EAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC1C,IAAA,uCAAiB,EAAC,oBAAoB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;gBACtD,IAAA,yDAAyB,EAAC,oBAAoB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;YAChE,CAAC,CAAC;YACF,IAAA,mDAA4B,EAAC,kBAAkB,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAC1E,IAAA,0CAAmB,GAAE;SACtB,CAAC,CAAC;IACL,CAAC,CAAC;AAEJ,CAAC;AAlBD,4BAkBC"}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
4
|
+
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
+
const coerce_health_controller_1 = require("../health-indicator/coerce-health-controller");
|
|
7
|
+
const coerce_health_module_1 = require("../health-indicator/coerce-health-module");
|
|
8
|
+
function default_1(options) {
|
|
7
9
|
return () => {
|
|
8
|
-
return chain([
|
|
9
|
-
TsMorphNestProjectTransformRule({
|
|
10
|
+
return (0, schematics_1.chain)([
|
|
11
|
+
(0, schematics_ts_morph_1.TsMorphNestProjectTransformRule)({
|
|
10
12
|
project: options.project,
|
|
11
13
|
}, project => {
|
|
12
|
-
CoerceHealthModule(project);
|
|
13
|
-
CoerceHealthController(project);
|
|
14
|
+
(0, coerce_health_module_1.CoerceHealthModule)(project);
|
|
15
|
+
(0, coerce_health_controller_1.CoerceHealthController)(project);
|
|
14
16
|
}),
|
|
15
|
-
AddPackageJsonDependencyRule('@nestjs/terminus', 'latest', { soft: true }),
|
|
16
|
-
InstallNodePackages(),
|
|
17
|
+
(0, schematics_utilities_1.AddPackageJsonDependencyRule)('@nestjs/terminus', 'latest', { soft: true }),
|
|
18
|
+
(0, schematics_utilities_1.InstallNodePackages)(),
|
|
17
19
|
]);
|
|
18
20
|
};
|
|
19
21
|
}
|
|
22
|
+
exports.default = default_1;
|
|
20
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator-init/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/health-indicator-init/index.ts"],"names":[],"mappings":";;AAAA,2DAGoC;AACpC,mEAA4E;AAC5E,qEAGoC;AACpC,2FAAsF;AACtF,mFAA8E;AAI9E,mBAAyB,OAAkC;IAEzD,OAAO,GAAG,EAAE;QACV,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,qDAA+B,EAAC;gBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,EAAE,OAAO,CAAC,EAAE;gBACX,IAAA,yCAAkB,EAAC,OAAO,CAAC,CAAC;gBAC5B,IAAA,iDAAsB,EAAC,OAAO,CAAC,CAAC;YAClC,CAAC,CAAC;YACF,IAAA,mDAA4B,EAAC,kBAAkB,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAC1E,IAAA,0CAAmB,GAAE;SACtB,CAAC,CAAC;IACL,CAAC,CAAC;AAEJ,CAAC;AAfD,4BAeC"}
|