@rxap/schematics-ts-morph 16.1.0-dev.0 → 16.1.0-dev.1
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 +6 -6
- package/src/lib/nest/coerce-dto-class.d.ts +1 -1
- package/src/lib/nest/coerce-dto-class.js +6 -7
- package/src/lib/nest/coerce-dto-class.js.map +1 -1
- package/src/lib/nest/coerce-form-submit-operation.d.ts +1 -1
- package/src/lib/nest/coerce-form-submit-operation.js +1 -4
- package/src/lib/nest/coerce-form-submit-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-children-operation.d.ts +2 -2
- package/src/lib/nest/coerce-get-children-operation.js +17 -20
- package/src/lib/nest/coerce-get-children-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-page-operation.d.ts +1 -1
- package/src/lib/nest/coerce-get-root-operation.d.ts +4 -1
- package/src/lib/nest/coerce-get-root-operation.js +17 -19
- package/src/lib/nest/coerce-get-root-operation.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [16.1.0-dev.1](https://gitlab.com/rxap/packages/compare/@rxap/schematics-ts-morph@16.1.0-dev.0...@rxap/schematics-ts-morph@16.1.0-dev.1) (2024-02-22)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- generate tree table column dto types ([93e3675](https://gitlab.com/rxap/packages/commit/93e36759b298806217b9b602d36dd975d46a62a8))
|
|
11
|
+
|
|
6
12
|
# [16.1.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/schematics-ts-morph@16.0.1-dev.1...@rxap/schematics-ts-morph@16.1.0-dev.0) (2024-02-22)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -17,5 +17,5 @@ yarn add @rxap/schematics-ts-morph
|
|
|
17
17
|
```
|
|
18
18
|
**Install peer dependencies:**
|
|
19
19
|
```bash
|
|
20
|
-
yarn add @angular-devkit/core@^16.1.4 @angular-devkit/schematics@^16.1.4 @rxap/schematics-utilities@^16.0.1-dev.0 @rxap/ts-morph@^1.1.0-dev.
|
|
20
|
+
yarn add @angular-devkit/core@^16.1.4 @angular-devkit/schematics@^16.1.4 @rxap/schematics-utilities@^16.0.1-dev.0 @rxap/ts-morph@^1.1.0-dev.1 @rxap/utilities@^16.1.0-dev.0 @rxap/workspace-ts-morph@^16.0.1 ts-morph@^18.0.0 tslib@2.6.2
|
|
21
21
|
```
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "16.1.0-dev.
|
|
2
|
+
"version": "16.1.0-dev.1",
|
|
3
3
|
"name": "@rxap/schematics-ts-morph",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"@angular-devkit/core": "^16.1.4",
|
|
14
14
|
"@angular-devkit/schematics": "^16.1.4",
|
|
15
15
|
"@rxap/schematics-utilities": "^16.0.1-dev.0",
|
|
16
|
-
"@rxap/ts-morph": "^1.1.0-dev.
|
|
17
|
-
"@rxap/utilities": "^16.0.0",
|
|
16
|
+
"@rxap/ts-morph": "^1.1.0-dev.1",
|
|
17
|
+
"@rxap/utilities": "^16.1.0-dev.0",
|
|
18
18
|
"@rxap/workspace-ts-morph": "^16.0.1",
|
|
19
19
|
"ts-morph": "^18.0.0",
|
|
20
20
|
"tslib": "2.6.2",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"package": "@rxap/ts-morph",
|
|
49
|
-
"version": "1.1.0-dev.
|
|
49
|
+
"version": "1.1.0-dev.1"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"package": "@rxap/utilities",
|
|
53
|
-
"version": "16.0.0"
|
|
53
|
+
"version": "16.1.0-dev.0"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
"package": "@rxap/workspace-ts-morph",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"directory": "packages/schematic/ts-morph"
|
|
69
69
|
},
|
|
70
70
|
"type": "commonjs",
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "b95f3218318078028fb23e1ada5a286ff28da861",
|
|
72
72
|
"main": "./src/index.js",
|
|
73
73
|
"types": "./src/index.d.ts"
|
|
74
74
|
}
|
|
@@ -14,7 +14,7 @@ export declare function CoercePropertyDeclaration(classLikeDeclarationBase: Clas
|
|
|
14
14
|
export interface CoerceDtoClassOptions {
|
|
15
15
|
project: Project;
|
|
16
16
|
name: string;
|
|
17
|
-
propertyList?: DtoClassProperty[]
|
|
17
|
+
propertyList?: DtoClassProperty[];
|
|
18
18
|
/**
|
|
19
19
|
* @deprecated use the tsMorphTransform to adapt the class
|
|
20
20
|
*/
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceDtoClass = exports.CoercePropertyDeclaration = void 0;
|
|
4
4
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
+
const utilities_1 = require("@rxap/utilities");
|
|
5
6
|
const path_1 = require("path");
|
|
6
7
|
const ts_morph_1 = require("ts-morph");
|
|
7
8
|
const coerce_class_1 = require("../coerce-class");
|
|
@@ -19,13 +20,8 @@ function CoercePropertyDeclaration(node, name, structure = {}) {
|
|
|
19
20
|
}
|
|
20
21
|
exports.CoercePropertyDeclaration = CoercePropertyDeclaration;
|
|
21
22
|
function CoerceDtoClass(options) {
|
|
22
|
-
const { project, } = options;
|
|
23
|
-
let {
|
|
24
|
-
propertyList !== null && propertyList !== void 0 ? propertyList : (propertyList = []);
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
26
|
-
tsMorphTransform !== null && tsMorphTransform !== void 0 ? tsMorphTransform : (tsMorphTransform = () => { });
|
|
27
|
-
classStructure !== null && classStructure !== void 0 ? classStructure : (classStructure = {});
|
|
28
|
-
importStructureList !== null && importStructureList !== void 0 ? importStructureList : (importStructureList = []);
|
|
23
|
+
const { project, propertyList = [], tsMorphTransform = utilities_1.noop, classStructure = {}, importStructureList = [], } = options;
|
|
24
|
+
let { name, } = options;
|
|
29
25
|
name = (0, schematics_utilities_1.dasherize)(name);
|
|
30
26
|
const className = (0, schematics_utilities_1.CoerceSuffix)((0, schematics_utilities_1.classify)(name), 'Dto');
|
|
31
27
|
const fileName = (0, schematics_utilities_1.CoerceSuffix)(name, '.dto');
|
|
@@ -34,6 +30,9 @@ function CoerceDtoClass(options) {
|
|
|
34
30
|
classDeclaration.setIsExported(true);
|
|
35
31
|
classDeclaration.set(classStructure);
|
|
36
32
|
for (const property of propertyList) {
|
|
33
|
+
if (property.type === '<self>') {
|
|
34
|
+
property.type = className;
|
|
35
|
+
}
|
|
37
36
|
let propertyName = (0, schematics_utilities_1.camelize)(property.name);
|
|
38
37
|
const prefixMatch = property.name.match(/^(_+)/);
|
|
39
38
|
if (prefixMatch) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-dto-class.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-dto-class.ts"],"names":[],"mappings":";;;AAAA,qEAKoC;AACpC,+BAA4B;AAC5B,uCAckB;AAClB,kDAA8C;AAC9C,8DAAyD;AACzD,mEAA+D;AAC/D,+DAA2D;AAC3D,6CAA2C;AAuB3C,SAAgB,yBAAyB,CACvC,IAAwD,EACxD,IAAY,EACZ,YAA+H,EAAE;IAEjI,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACtC,QAAQ,CAAC,GAAG,CAAC,SAAgB,CAAC,CAAC;KAChC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAXD,8DAWC;AAiBD,SAAgB,cAAc,CAAC,OAA8B;IAC3D,MAAM,EACJ,OAAO,
|
|
1
|
+
{"version":3,"file":"coerce-dto-class.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-dto-class.ts"],"names":[],"mappings":";;;AAAA,qEAKoC;AACpC,+CAAuC;AACvC,+BAA4B;AAC5B,uCAckB;AAClB,kDAA8C;AAC9C,8DAAyD;AACzD,mEAA+D;AAC/D,+DAA2D;AAC3D,6CAA2C;AAuB3C,SAAgB,yBAAyB,CACvC,IAAwD,EACxD,IAAY,EACZ,YAA+H,EAAE;IAEjI,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACtC,QAAQ,CAAC,GAAG,CAAC,SAAgB,CAAC,CAAC;KAChC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAXD,8DAWC;AAiBD,SAAgB,cAAc,CAAC,OAA8B;IAC3D,MAAM,EACJ,OAAO,EACP,YAAY,GAAG,EAAE,EACjB,gBAAgB,GAAG,gBAAI,EACvB,cAAc,GAAG,EAAE,EACnB,mBAAmB,GAAG,EAAE,GACzB,GAAG,OAAO,CAAC;IACZ,IAAI,EACF,IAAI,GACL,GAAG,OAAO,CAAC;IAEZ,IAAI,GAAG,IAAA,gCAAS,EAAC,IAAI,CAAC,CAAC;IAEvB,MAAM,SAAS,GAAG,IAAA,mCAAY,EAAC,IAAA,+BAAQ,EAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,IAAA,mCAAY,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,8BAAa,EAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;IAE/C,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAExD,OAAO;QACL,SAAS;QACT,QAAQ,EAAE,GAAG,GAAG,IAAA,WAAI,EAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,UAAU,CAAC,2BAA2B,EAAE,CAAC;QAC7F,UAAU;QACV,gBAAgB;KACjB,CAAC;AAEJ,CAAC;AAvOD,wCAuOC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CoerceOperationOptions } from './coerce-operation';
|
|
2
2
|
import { DtoClassProperty } from './create-dto-class';
|
|
3
3
|
export interface CoerceFormSubmitOperationOptions extends Omit<CoerceOperationOptions, 'operationName'> {
|
|
4
|
-
propertyList?: DtoClassProperty[]
|
|
4
|
+
propertyList?: DtoClassProperty[];
|
|
5
5
|
bodyDtoName?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function CoerceFormSubmitOperation(options: CoerceFormSubmitOperationOptions): import("@angular-devkit/schematics").Rule;
|
|
@@ -6,10 +6,7 @@ const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
|
6
6
|
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
7
7
|
const coerce_operation_1 = require("./coerce-operation");
|
|
8
8
|
function CoerceFormSubmitOperation(options) {
|
|
9
|
-
|
|
10
|
-
tsMorphTransform !== null && tsMorphTransform !== void 0 ? tsMorphTransform : (tsMorphTransform = () => ({}));
|
|
11
|
-
propertyList !== null && propertyList !== void 0 ? propertyList : (propertyList = []);
|
|
12
|
-
bodyDtoName !== null && bodyDtoName !== void 0 ? bodyDtoName : (bodyDtoName = (0, utilities_1.joinWithDash)([context, controllerName]));
|
|
9
|
+
const { tsMorphTransform = utilities_1.noop, controllerName, propertyList = [], context, bodyDtoName = (0, utilities_1.joinWithDash)([context, controllerName]), } = options;
|
|
13
10
|
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), { operationName: 'submit', tsMorphTransform: (project, sourceFile, classDeclaration, controllerName) => {
|
|
14
11
|
const { className: dtoClassName, filePath: dtoFilePath, } = (0, coerce_dto_class_1.CoerceDtoClass)({
|
|
15
12
|
project,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-form-submit-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-form-submit-operation.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"coerce-form-submit-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-form-submit-operation.ts"],"names":[],"mappings":";;;AAAA,+CAGyB;AACzB,+DAA2D;AAC3D,yDAAoD;AACpD,yDAG4B;AAQ5B,SAAgB,yBAAyB,CAAC,OAAyC;IACjF,MAAM,EACJ,gBAAgB,GAAG,gBAAI,EACvB,cAAc,EACd,YAAY,GAAE,EAAE,EAChB,OAAO,EACP,WAAW,GAAE,IAAA,wBAAY,EAAC,CAAE,OAAO,EAAE,cAAc,CAAE,CAAC,GACvD,GAAG,OAAO,CAAC;IAEZ,OAAO,IAAA,kCAAe,kCACjB,OAAO,KACV,aAAa,EAAE,QAAQ,EACvB,gBAAgB,EAAE,CAChB,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,EAAE;YAEF,MAAM,EACJ,SAAS,EAAE,YAAY,EACvB,QAAQ,EAAE,WAAW,GACtB,GAAG,IAAA,iCAAc,EAAC;gBACjB,OAAO;gBACP,IAAI,EAAE,WAAY;gBAClB,YAAY;aACb,CAAC,CAAC;YAEH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,YAAY,CAAE;gBAC9B,eAAe,EAAE,WAAW;aAC7B,CAAC,CAAC;YAEH,uBACE,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,IACX,gBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,CAAC,EAC3E;QAEJ,CAAC,IACD,CAAC;AAEL,CAAC;AA1CD,8DA0CC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type CoerceGetChildrenOperationOptions =
|
|
1
|
+
import { CoerceGetRootOperationOptions } from './coerce-get-root-operation';
|
|
2
|
+
export type CoerceGetChildrenOperationOptions = CoerceGetRootOperationOptions;
|
|
3
3
|
export declare function CoerceGetChildrenOperation(options: Readonly<CoerceGetChildrenOperationOptions>): import("@angular-devkit/schematics").Rule;
|
|
@@ -2,14 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceGetChildrenOperation = void 0;
|
|
4
4
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
+
const utilities_1 = require("@rxap/utilities");
|
|
5
6
|
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
6
7
|
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
7
8
|
const coerce_operation_1 = require("./coerce-operation");
|
|
8
9
|
function CoerceGetChildrenOperation(options) {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const { tsMorphTransform = utilities_1.noop, paramList = [], propertyList = [], } = options;
|
|
11
|
+
let { controllerName } = options;
|
|
12
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, [
|
|
13
|
+
{
|
|
14
|
+
name: 'hasChildren',
|
|
15
|
+
type: 'boolean',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'children',
|
|
19
|
+
type: '<self>',
|
|
20
|
+
isArray: true,
|
|
21
|
+
isOptional: true,
|
|
22
|
+
isType: true,
|
|
23
|
+
},
|
|
24
|
+
], (a, b) => a.name === b.name);
|
|
11
25
|
controllerName = (0, schematics_utilities_1.CoerceSuffix)(controllerName, '-tree-table');
|
|
12
|
-
paramList !== null && paramList !== void 0 ? paramList : (paramList = []);
|
|
13
26
|
paramList.push({
|
|
14
27
|
name: 'parentUuid',
|
|
15
28
|
type: 'string',
|
|
@@ -20,23 +33,7 @@ function CoerceGetChildrenOperation(options) {
|
|
|
20
33
|
const { className, filePath, } = (0, coerce_dto_class_1.CoerceDtoClass)({
|
|
21
34
|
project,
|
|
22
35
|
name: (0, schematics_utilities_1.CoerceSuffix)(controllerName, '-item'),
|
|
23
|
-
propertyList
|
|
24
|
-
{
|
|
25
|
-
name: 'uuid',
|
|
26
|
-
type: 'string',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'hasChildren',
|
|
30
|
-
type: 'boolean',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'children',
|
|
34
|
-
type: (0, schematics_utilities_1.classify)((0, schematics_utilities_1.CoerceSuffix)(controllerName, '-item-dto')),
|
|
35
|
-
isArray: true,
|
|
36
|
-
isOptional: true,
|
|
37
|
-
isType: true,
|
|
38
|
-
},
|
|
39
|
-
],
|
|
36
|
+
propertyList,
|
|
40
37
|
});
|
|
41
38
|
(0, coerce_imports_1.CoerceImports)(sourceFile, [
|
|
42
39
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-get-children-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-children-operation.ts"],"names":[],"mappings":";;;AAAA,qEAGoC;AACpC,+DAA2D;AAC3D,yDAAoD;
|
|
1
|
+
{"version":3,"file":"coerce-get-children-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-children-operation.ts"],"names":[],"mappings":";;;AAAA,qEAGoC;AACpC,+CAGyB;AACzB,+DAA2D;AAC3D,yDAAoD;AAEpD,yDAG4B;AAI5B,SAAgB,0BAA0B,CAAC,OAAoD;IAC7F,MAAM,EACJ,gBAAgB,GAAG,gBAAI,EACvB,SAAS,GAAG,EAAE,EACd,YAAY,GAAG,EAAE,GAClB,GAAG,OAAO,CAAC;IACZ,IAAI,E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AC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,CAAC,EAC3E;QACJ,CAAC,IACD,CAAC;AACL,CAAC;AApED,gEAoEC"}
|
|
@@ -5,7 +5,7 @@ import { CoerceOperationOptions } from './coerce-operation';
|
|
|
5
5
|
import { DtoClassProperty } from './create-dto-class';
|
|
6
6
|
export interface GetPageOperationProperty {
|
|
7
7
|
name: string;
|
|
8
|
-
type
|
|
8
|
+
type: TypeImport;
|
|
9
9
|
/**
|
|
10
10
|
* the property name of the source object. if not defined the name will be used
|
|
11
11
|
*/
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { CoerceOperationOptions } from './coerce-operation';
|
|
2
|
-
|
|
2
|
+
import { DtoClassProperty } from './create-dto-class';
|
|
3
|
+
export interface CoerceGetRootOperationOptions extends Omit<CoerceOperationOptions, 'operationName'> {
|
|
4
|
+
propertyList?: DtoClassProperty[];
|
|
5
|
+
}
|
|
3
6
|
export declare function CoerceGetRootOperation(options: Readonly<CoerceGetRootOperationOptions>): import("@angular-devkit/schematics").Rule;
|
|
@@ -2,34 +2,32 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceGetRootOperation = void 0;
|
|
4
4
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
+
const utilities_1 = require("@rxap/utilities");
|
|
5
6
|
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
6
7
|
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
7
8
|
const coerce_operation_1 = require("./coerce-operation");
|
|
8
9
|
function CoerceGetRootOperation(options) {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const { tsMorphTransform = utilities_1.noop, propertyList = [], } = options;
|
|
11
|
+
let { controllerName } = options;
|
|
12
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, [
|
|
13
|
+
{
|
|
14
|
+
name: 'hasChildren',
|
|
15
|
+
type: 'boolean',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'children',
|
|
19
|
+
type: '<self>',
|
|
20
|
+
isArray: true,
|
|
21
|
+
isOptional: true,
|
|
22
|
+
isType: true,
|
|
23
|
+
},
|
|
24
|
+
], (a, b) => a.name === b.name);
|
|
11
25
|
controllerName = (0, schematics_utilities_1.CoerceSuffix)(controllerName, '-tree-table');
|
|
12
26
|
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), { controllerName, operationName: 'get-root', tsMorphTransform: (project, sourceFile, classDeclaration, controllerName) => {
|
|
13
27
|
const { className, filePath, } = (0, coerce_dto_class_1.CoerceDtoClass)({
|
|
14
28
|
project,
|
|
15
29
|
name: (0, schematics_utilities_1.CoerceSuffix)(controllerName, '-item'),
|
|
16
|
-
propertyList
|
|
17
|
-
{
|
|
18
|
-
name: 'uuid',
|
|
19
|
-
type: 'string',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'hasChildren',
|
|
23
|
-
type: 'boolean',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'children',
|
|
27
|
-
type: (0, schematics_utilities_1.classify)((0, schematics_utilities_1.CoerceSuffix)(controllerName, '-item-dto')),
|
|
28
|
-
isArray: true,
|
|
29
|
-
isOptional: true,
|
|
30
|
-
isType: true,
|
|
31
|
-
},
|
|
32
|
-
],
|
|
30
|
+
propertyList,
|
|
33
31
|
});
|
|
34
32
|
(0, coerce_imports_1.CoerceImports)(sourceFile, [
|
|
35
33
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-get-root-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-root-operation.ts"],"names":[],"mappings":";;;AAAA,qEAGoC;AACpC,+DAA2D;AAC3D,yDAAoD;AACpD,yDAG4B;
|
|
1
|
+
{"version":3,"file":"coerce-get-root-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-root-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