@rxap/schematics-ts-morph 16.1.0-dev.2 → 16.1.0-dev.20
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 +129 -0
- package/README.md +1 -1
- package/package.json +14 -12
- package/src/index.d.ts +8 -2
- package/src/index.js +8 -2
- package/src/index.js.map +1 -1
- package/src/lib/angular/coerce-component.d.ts +4 -1
- package/src/lib/angular/coerce-component.js +15 -7
- package/src/lib/angular/coerce-component.js.map +1 -1
- package/src/lib/angular/coerce-dialog-table-action-component.js +2 -2
- package/src/lib/angular/coerce-dialog-table-action-component.js.map +1 -1
- package/src/lib/angular/coerce-form-definition-array.d.ts +14 -0
- package/src/lib/angular/coerce-form-definition-array.js +87 -0
- package/src/lib/angular/coerce-form-definition-array.js.map +1 -0
- package/src/lib/angular/coerce-form-definition-control.d.ts +9 -12
- package/src/lib/angular/coerce-form-definition-control.js +68 -125
- package/src/lib/angular/coerce-form-definition-control.js.map +1 -1
- package/src/lib/angular/coerce-form-definition-form-control.d.ts +11 -0
- package/src/lib/angular/coerce-form-definition-form-control.js +66 -0
- package/src/lib/angular/coerce-form-definition-form-control.js.map +1 -0
- package/src/lib/angular/coerce-form-definition-group.d.ts +14 -0
- package/src/lib/angular/coerce-form-definition-group.js +80 -0
- package/src/lib/angular/coerce-form-definition-group.js.map +1 -0
- package/src/lib/angular/coerce-form-definition-type.d.ts +2 -2
- package/src/lib/angular/coerce-form-definition-type.js +16 -2
- package/src/lib/angular/coerce-form-definition-type.js.map +1 -1
- package/src/lib/angular/coerce-form-definition.d.ts +4 -4
- package/src/lib/angular/coerce-form-definition.js +24 -13
- package/src/lib/angular/coerce-form-definition.js.map +1 -1
- package/src/lib/angular/coerce-options-data-source.d.ts +3 -1
- package/src/lib/angular/coerce-options-data-source.js +35 -6
- package/src/lib/angular/coerce-options-data-source.js.map +1 -1
- package/src/lib/angular/coerce-proxy-remote-method-class.d.ts +4 -2
- package/src/lib/angular/coerce-proxy-remote-method-class.js +54 -35
- package/src/lib/angular/coerce-proxy-remote-method-class.js.map +1 -1
- package/src/lib/angular/coerce-table-parameters-from-route.js +4 -4
- package/src/lib/angular/coerce-table-parameters-from-route.js.map +1 -1
- package/src/lib/angular/coerce-table-select-resolve-value-method.js +2 -2
- package/src/lib/angular/coerce-table-select-resolve-value-method.js.map +1 -1
- package/src/lib/angular/coerce-tree-table-children-proxy-remote-method-class.js +2 -2
- package/src/lib/angular/coerce-tree-table-children-proxy-remote-method-class.js.map +1 -1
- package/src/lib/angular/coerce-tree-table-root-proxy-remote-method-class.d.ts +1 -0
- package/src/lib/angular/coerce-tree-table-root-proxy-remote-method-class.js +10 -3
- package/src/lib/angular/coerce-tree-table-root-proxy-remote-method-class.js.map +1 -1
- package/src/lib/angular/form-definition-utilities.d.ts +1 -0
- package/src/lib/angular/form-definition-utilities.js +7 -3
- package/src/lib/angular/form-definition-utilities.js.map +1 -1
- package/src/lib/nest/add-operation-to-controller.d.ts +1 -1
- package/src/lib/nest/add-operation-to-controller.js +59 -55
- package/src/lib/nest/add-operation-to-controller.js.map +1 -1
- package/src/lib/nest/build-nest-controller-name.js +10 -0
- package/src/lib/nest/build-nest-controller-name.js.map +1 -1
- package/src/lib/nest/coerce-autocomplete-options-operation.d.ts +12 -0
- package/src/lib/nest/coerce-autocomplete-options-operation.js +65 -0
- package/src/lib/nest/coerce-autocomplete-options-operation.js.map +1 -0
- package/src/lib/nest/coerce-autocomplete-table-select-value-resolve-operation.d.ts +7 -0
- package/src/lib/nest/coerce-autocomplete-table-select-value-resolve-operation.js +16 -0
- package/src/lib/nest/coerce-autocomplete-table-select-value-resolve-operation.js.map +1 -0
- package/src/lib/nest/coerce-dto-class.d.ts +3 -15
- package/src/lib/nest/coerce-dto-class.js +186 -149
- package/src/lib/nest/coerce-dto-class.js.map +1 -1
- package/src/lib/nest/coerce-form-submit-operation.d.ts +2 -4
- package/src/lib/nest/coerce-form-submit-operation.js +14 -15
- package/src/lib/nest/coerce-form-submit-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-by-id-operation.d.ts +9 -7
- package/src/lib/nest/coerce-get-by-id-operation.js +85 -56
- package/src/lib/nest/coerce-get-by-id-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-children-operation.js +8 -43
- package/src/lib/nest/coerce-get-children-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-data-grid-operation.d.ts +5 -4
- package/src/lib/nest/coerce-get-data-grid-operation.js +7 -22
- package/src/lib/nest/coerce-get-data-grid-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-operation.d.ts +5 -0
- package/src/lib/nest/coerce-get-operation.js +11 -0
- package/src/lib/nest/coerce-get-operation.js.map +1 -0
- package/src/lib/nest/coerce-get-page-operation.d.ts +17 -28
- package/src/lib/nest/coerce-get-page-operation.js +118 -112
- package/src/lib/nest/coerce-get-page-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-root-operation.d.ts +6 -4
- package/src/lib/nest/coerce-get-root-operation.js +19 -26
- package/src/lib/nest/coerce-get-root-operation.js.map +1 -1
- package/src/lib/nest/coerce-operation.d.ts +32 -9
- package/src/lib/nest/coerce-operation.js +197 -29
- package/src/lib/nest/coerce-operation.js.map +1 -1
- package/src/lib/nest/coerce-options-operation.d.ts +6 -3
- package/src/lib/nest/coerce-options-operation.js +24 -43
- package/src/lib/nest/coerce-options-operation.js.map +1 -1
- package/src/lib/nest/coerce-page-dto-class.d.ts +3 -8
- package/src/lib/nest/coerce-page-dto-class.js +21 -20
- package/src/lib/nest/coerce-page-dto-class.js.map +1 -1
- package/src/lib/nest/coerce-row-dto-class.d.ts +3 -1
- package/src/lib/nest/coerce-row-dto-class.js +12 -10
- package/src/lib/nest/coerce-row-dto-class.js.map +1 -1
- package/src/lib/nest/coerce-submit-data-grid-operation.js +3 -7
- package/src/lib/nest/coerce-submit-data-grid-operation.js.map +1 -1
- package/src/lib/nest/coerce-table-select-operation.d.ts +4 -2
- package/src/lib/nest/coerce-table-select-operation.js +7 -14
- package/src/lib/nest/coerce-table-select-operation.js.map +1 -1
- package/src/lib/nest/coerce-table-select-value-resolve-operation.d.ts +9 -6
- package/src/lib/nest/coerce-table-select-value-resolve-operation.js +26 -33
- package/src/lib/nest/coerce-table-select-value-resolve-operation.js.map +1 -1
- package/src/lib/nest/coerce-tree-operation.js +36 -44
- package/src/lib/nest/coerce-tree-operation.js.map +1 -1
- package/src/lib/nest/dto-class-property.d.ts +11 -0
- package/src/lib/nest/dto-class-property.js +27 -0
- package/src/lib/nest/dto-class-property.js.map +1 -0
- package/src/lib/nest/table-query-list.js +10 -2
- package/src/lib/nest/table-query-list.js.map +1 -1
- package/src/lib/ts-morph/coerce-imports.js +1 -1
- package/src/lib/ts-morph/coerce-imports.js.map +1 -1
- package/src/lib/types/abstract-control.d.ts +8 -0
- package/src/lib/types/{form-definition-control.js → abstract-control.js} +1 -1
- package/src/lib/types/abstract-control.js.map +1 -0
- package/src/lib/nest/create-dto-class.d.ts +0 -24
- package/src/lib/nest/create-dto-class.js +0 -169
- package/src/lib/nest/create-dto-class.js.map +0 -1
- package/src/lib/types/form-definition-control.d.ts +0 -10
- package/src/lib/types/form-definition-control.js.map +0 -1
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceTableSelectOperationRule = void 0;
|
|
4
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
5
|
+
const utilities_1 = require("@rxap/utilities");
|
|
4
6
|
const coerce_get_page_operation_1 = require("./coerce-get-page-operation");
|
|
5
7
|
function CoerceTableSelectOperationRule(options) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
name: '__display',
|
|
12
|
-
type: { name: 'string' },
|
|
13
|
-
source: rowDisplayProperty,
|
|
14
|
-
});
|
|
15
|
-
propertyList.unshift({
|
|
16
|
-
name: '__value',
|
|
17
|
-
type: { name: 'string' },
|
|
18
|
-
source: rowValueProperty,
|
|
19
|
-
});
|
|
8
|
+
const { propertyList = [], rowIdProperty, rowDisplayProperty, rowValueProperty = (0, ts_morph_1.NormalizeDataProperty)(rowIdProperty), } = options;
|
|
9
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, [
|
|
10
|
+
Object.assign(Object.assign({}, rowValueProperty), { name: '__value', source: rowValueProperty.name }),
|
|
11
|
+
Object.assign(Object.assign({}, rowDisplayProperty), { name: '__display', source: rowDisplayProperty.name })
|
|
12
|
+
], { compareTo: (a, b) => a.name === b.name, unshift: true });
|
|
20
13
|
return (0, coerce_get_page_operation_1.CoerceGetPageOperation)(Object.assign(Object.assign({}, options), { propertyList: propertyList, rowIdProperty }));
|
|
21
14
|
}
|
|
22
15
|
exports.CoerceTableSelectOperationRule = CoerceTableSelectOperationRule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-table-select-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-table-select-operation.ts"],"names":[],"mappings":";;;AAAA,2EAGqC;
|
|
1
|
+
{"version":3,"file":"coerce-table-select-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-table-select-operation.ts"],"names":[],"mappings":";;;AAAA,6CAIwB;AACxB,+CAAmD;AACnD,2EAGqC;AAQrC,SAAgB,8BAA8B,CAAC,OAA0C;IACvF,MAAM,EACJ,YAAY,GAAG,EAAE,EACjB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,GAAG,IAAA,gCAAqB,EAAC,aAAa,CAAC,GACxD,GAAG,OAAO,CAAC;IAEZ,IAAA,4BAAgB,EAAC,YAAY,EAAE;wCAExB,gBAAgB,KACnB,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,gBAAgB,CAAC,IAAI;wCAG1B,kBAAkB,KACrB,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,kBAAkB,CAAC,IAAI;KAElC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAE9D,OAAO,IAAA,kDAAsB,kCACxB,OAAO,KACV,YAAY,EAAE,YAAY,EAC1B,aAAa,IACb,CAAC;AAEL,CAAC;AA3BD,wEA2BC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { DataProperty, NormalizedDataProperty } from '@rxap/ts-morph';
|
|
2
|
+
import { ClassDeclaration, SourceFile, WriterFunction } from 'ts-morph';
|
|
3
|
+
import { CoerceDtoClassOutput } from './coerce-dto-class';
|
|
4
|
+
import { CoerceOperationOptions, TransformOperation } from './coerce-operation';
|
|
5
|
+
export interface CoerceTableSelectValueResolveOperationOptions extends CoerceOperationOptions {
|
|
6
|
+
rowIdProperty: DataProperty;
|
|
7
|
+
rowDisplayProperty: NormalizedDataProperty;
|
|
8
|
+
rowValueProperty?: NormalizedDataProperty;
|
|
7
9
|
}
|
|
10
|
+
export declare function BuildTableSelectValueResolveUpstreamGetParametersImplementation(classDeclaration: ClassDeclaration, moduleSourceFile: SourceFile, dto: CoerceDtoClassOutput | null, options: Readonly<Pick<CoerceTableSelectValueResolveOperationOptions, 'upstream'>>): TransformOperation<string | WriterFunction>;
|
|
8
11
|
export declare function CoerceTableSelectValueResolveOperationRule(options: CoerceTableSelectValueResolveOperationOptions): import("@angular-devkit/schematics").Rule;
|
|
@@ -1,40 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoerceTableSelectValueResolveOperationRule = void 0;
|
|
4
|
-
const
|
|
3
|
+
exports.CoerceTableSelectValueResolveOperationRule = exports.BuildTableSelectValueResolveUpstreamGetParametersImplementation = void 0;
|
|
4
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
5
|
+
const utilities_1 = require("@rxap/utilities");
|
|
5
6
|
const coerce_operation_1 = require("./coerce-operation");
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
function BuildTableSelectValueResolveUpstreamGetParametersImplementation(classDeclaration, moduleSourceFile, dto, options) {
|
|
8
|
+
return () => {
|
|
9
|
+
var _a;
|
|
10
|
+
const { upstream } = options;
|
|
11
|
+
if (upstream) {
|
|
12
|
+
if ((0, ts_morph_1.IsNormalizedOpenApiUpstreamOptions)(upstream)) {
|
|
13
|
+
if ((_a = upstream.mapper) === null || _a === void 0 ? void 0 : _a.value) {
|
|
14
|
+
return `{ parameters: { ${upstream.mapper.value}: value } }`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return '{ value }';
|
|
18
|
+
}
|
|
19
|
+
return '';
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.BuildTableSelectValueResolveUpstreamGetParametersImplementation = BuildTableSelectValueResolveUpstreamGetParametersImplementation;
|
|
8
23
|
function CoerceTableSelectValueResolveOperationRule(options) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const { className: pageClassName, filePath: pageFilePath, } = (0, coerce_page_dto_class_1.CoercePageDtoClass)({
|
|
17
|
-
project,
|
|
18
|
-
name: responseDtoName,
|
|
19
|
-
rowClassName,
|
|
20
|
-
rowFilePath,
|
|
21
|
-
});
|
|
22
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
23
|
-
moduleSpecifier: rowFilePath,
|
|
24
|
-
namedImports: [rowClassName],
|
|
25
|
-
});
|
|
26
|
-
return {
|
|
27
|
-
returnType: rowClassName,
|
|
28
|
-
statements: [
|
|
29
|
-
'const item = {} as any',
|
|
30
|
-
'return plainToInstance(',
|
|
31
|
-
rowClassName + ',',
|
|
32
|
-
`this.to${rowClassName}(item),`,
|
|
33
|
-
'classTransformOptions',
|
|
34
|
-
')',
|
|
35
|
-
],
|
|
36
|
-
};
|
|
37
|
-
} }));
|
|
24
|
+
const { buildUpstreamGetParametersImplementation = BuildTableSelectValueResolveUpstreamGetParametersImplementation, propertyList = [], rowIdProperty, rowDisplayProperty, rowValueProperty = (0, ts_morph_1.NormalizeDataProperty)(rowIdProperty), } = options;
|
|
25
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, [
|
|
26
|
+
Object.assign(Object.assign({}, rowValueProperty), { name: '__value', source: rowValueProperty.name }),
|
|
27
|
+
Object.assign(Object.assign({}, rowDisplayProperty), { name: '__display', source: rowDisplayProperty.name }),
|
|
28
|
+
(0, ts_morph_1.NormalizeDataProperty)(Object.assign(Object.assign({}, rowIdProperty), { name: '__rowId', source: rowIdProperty.name }), 'number')
|
|
29
|
+
], { compareTo: (a, b) => a.name === b.name, unshift: true });
|
|
30
|
+
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), { buildUpstreamGetParametersImplementation }));
|
|
38
31
|
}
|
|
39
32
|
exports.CoerceTableSelectValueResolveOperationRule = CoerceTableSelectValueResolveOperationRule;
|
|
40
33
|
//# sourceMappingURL=coerce-table-select-value-resolve-operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-table-select-value-resolve-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-table-select-value-resolve-operation.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"coerce-table-select-value-resolve-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-table-select-value-resolve-operation.ts"],"names":[],"mappings":";;;AAAA,6CAKwB;AACxB,+CAAmD;AAOnD,yDAI4B;AAS5B,SAAgB,+DAA+D,CAClB,gBAAkC,EAClC,gBAA4B,EAC5B,GAAgC,EAChC,OAAkF;IAE7I,OAAO,G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exports.CoerceTreeOperationRule = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
5
|
+
const utilities_1 = require("@rxap/utilities");
|
|
6
6
|
const coerce_operation_1 = require("./coerce-operation");
|
|
7
7
|
function CoerceTreeOperationRule(options) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const { operationName = 'tree', fullTree = false, path = 'true', propertyList = [], dtoClassNameSuffix = '-tree-node', isArray = true, } = options;
|
|
9
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, [
|
|
10
|
+
{
|
|
11
|
+
name: 'id',
|
|
12
|
+
type: 'string',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'name',
|
|
16
|
+
type: 'string',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'type',
|
|
20
|
+
type: 'string',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'icon',
|
|
24
|
+
type: {
|
|
25
|
+
name: 'IconDto',
|
|
26
|
+
moduleSpecifier: '@rxap/nest-dto'
|
|
27
|
+
},
|
|
28
|
+
isType: true,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'children',
|
|
32
|
+
isOptional: true,
|
|
33
|
+
isArray: true,
|
|
34
|
+
isType: true,
|
|
35
|
+
type: ts_morph_1.TypeNames.Self,
|
|
36
|
+
},
|
|
37
|
+
], (a, b) => a.name === b.name);
|
|
13
38
|
if (!fullTree) {
|
|
14
39
|
throw new Error('non full tree not implemented yet');
|
|
15
40
|
}
|
|
16
41
|
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), { path,
|
|
17
|
-
operationName,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
propertyList: [
|
|
22
|
-
{
|
|
23
|
-
name: 'id',
|
|
24
|
-
type: 'string',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'name',
|
|
28
|
-
type: 'string',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'type',
|
|
32
|
-
type: 'string',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'icon',
|
|
36
|
-
type: 'IconConfigDto',
|
|
37
|
-
isType: true,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'children',
|
|
41
|
-
isOptional: true,
|
|
42
|
-
isArray: true,
|
|
43
|
-
isType: true,
|
|
44
|
-
type: '<self>',
|
|
45
|
-
},
|
|
46
|
-
]
|
|
47
|
-
});
|
|
48
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
49
|
-
namedImports: [className],
|
|
50
|
-
moduleSpecifier: filePath,
|
|
51
|
-
});
|
|
52
|
-
return Object.assign({ returnType: className + '[]' }, tsMorphTransform(project, sourceFile, classDeclaration, controllerName));
|
|
53
|
-
} }));
|
|
42
|
+
operationName,
|
|
43
|
+
dtoClassNameSuffix,
|
|
44
|
+
propertyList,
|
|
45
|
+
isArray }));
|
|
54
46
|
}
|
|
55
47
|
exports.CoerceTreeOperationRule = CoerceTreeOperationRule;
|
|
56
48
|
//# sourceMappingURL=coerce-tree-operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-tree-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-tree-operation.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"coerce-tree-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-tree-operation.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,+CAAmD;AACnD,yDAG4B;AAO5B,SAAgB,uBAAuB,CAAC,OAAmC;IACzE,MAAM,EACJ,aAAa,GAAG,MAAM,EACtB,QAAQ,GAAE,KAAK,EACf,IAAI,GAAE,MAAM,EACZ,YAAY,GAAG,EAAE,EACjB,kBAAkB,GAAG,YAAY,EACjC,OAAO,GAAG,IAAI,GACf,GAAG,OAAO,CAAC;IAEZ,IAAA,4BAAgB,EAAC,YAAY,EAAE;QAC7B;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,QAAQ;SACf;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;SACf;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;SACf;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,eAAe,EAAE,gBAAgB;aAClC;YACD,MAAM,EAAE,IAAI;SACb;QACD;YACE,IAAI,EAAE,UAAU;YAChB,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,oBAAS,CAAC,IAAI;SACrB;KACF,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;IAEhC,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;KACtD;IAED,OAAO,IAAA,kCAAe,kCACjB,OAAO,KACV,IAAI;QACJ,aAAa;QACb,kBAAkB;QAClB,YAAY;QACZ,OAAO,IACP,CAAC;AACL,CAAC;AApDD,0DAoDC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataProperty, NormalizedDataProperty } from '@rxap/ts-morph';
|
|
2
|
+
import { Normalized } from '@rxap/utilities';
|
|
3
|
+
export interface DtoClassProperty extends DataProperty {
|
|
4
|
+
/**
|
|
5
|
+
* indicates that the @Type decorator should be used as the type of the property is another dto class
|
|
6
|
+
*/
|
|
7
|
+
isType?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface NormalizedDtoClassProperty extends Normalized<Pick<DtoClassProperty, 'isType'>>, NormalizedDataProperty {
|
|
10
|
+
}
|
|
11
|
+
export declare function NormalizeDataClassProperty(property: DtoClassProperty): NormalizedDtoClassProperty;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NormalizeDataClassProperty = void 0;
|
|
4
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
5
|
+
function NormalizeDataClassProperty(property) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const { name, type, isArray, memberList, source, isOptional, } = (0, ts_morph_1.NormalizeDataProperty)(property);
|
|
8
|
+
let isType = (_b = (_a = property.isType) !== null && _a !== void 0 ? _a : [ts_morph_1.TypeNames.Self, ts_morph_1.TypeNames.Deferred].includes(type.name)) !== null && _b !== void 0 ? _b : false;
|
|
9
|
+
switch (type.name) {
|
|
10
|
+
case 'IconConfig':
|
|
11
|
+
type.name = 'IconDto';
|
|
12
|
+
type.moduleSpecifier = '@rxap/nest-dto';
|
|
13
|
+
isType = true;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
source,
|
|
18
|
+
memberList,
|
|
19
|
+
name,
|
|
20
|
+
type,
|
|
21
|
+
isArray,
|
|
22
|
+
isType,
|
|
23
|
+
isOptional,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.NormalizeDataClassProperty = NormalizeDataClassProperty;
|
|
27
|
+
//# sourceMappingURL=dto-class-property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dto-class-property.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/dto-class-property.ts"],"names":[],"mappings":";;;AAAA,6CAKwB;AAcxB,SAAgB,0BAA0B,CAAC,QAA0B;;IACnE,MAAM,EACJ,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,EACN,UAAU,GACX,GAAG,IAAA,gCAAqB,EAAC,QAAQ,CAAC,CAAC;IACpC,IAAI,MAAM,GAAG,MAAA,MAAA,QAAQ,CAAC,MAAM,mCAAK,CAAE,oBAAS,CAAC,IAAI,EAAE,oBAAS,CAAC,QAAQ,CAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAI,KAAK,CAAC;IAClH,QAAQ,IAAI,CAAC,IAAI,EAAE;QACjB,KAAK,YAAY;YACf,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;YACtB,IAAI,CAAC,eAAe,GAAG,gBAAgB,CAAC;YACxC,MAAM,GAAG,IAAI,CAAC;YACd,MAAM;KACT;IACD,OAAO;QACL,MAAM;QACN,UAAU;QACV,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,MAAM;QACN,UAAU;KACX,CAAC;AACJ,CAAC;AA1BD,gEA0BC"}
|
|
@@ -24,8 +24,16 @@ exports.TABLE_QUERY_LIST = [
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
name: 'filter',
|
|
27
|
-
type:
|
|
28
|
-
|
|
27
|
+
type: {
|
|
28
|
+
name: 'FilterQuery',
|
|
29
|
+
moduleSpecifier: '@rxap/nest-utilities',
|
|
30
|
+
},
|
|
31
|
+
isArray: true,
|
|
32
|
+
pipeList: [{
|
|
33
|
+
name: 'new FilterQueryPipe()',
|
|
34
|
+
namedImport: 'FilterQueryPipe',
|
|
35
|
+
moduleSpecifier: '@rxap/nest-utilities',
|
|
36
|
+
}],
|
|
29
37
|
// the FilterQueryPipe will set the default value to an empty array
|
|
30
38
|
hasQuestionToken: false,
|
|
31
39
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-query-list.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/table-query-list.ts"],"names":[],"mappings":";;;AAEa,QAAA,gBAAgB,GAAyB;IACpD;QACE,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,GAAG;KAClB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,GAAG;KAClB;IACD;QACE,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;KACnC;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,eAAe;
|
|
1
|
+
{"version":3,"file":"table-query-list.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/table-query-list.ts"],"names":[],"mappings":";;;AAEa,QAAA,gBAAgB,GAAyB;IACpD;QACE,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,GAAG;KAClB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,GAAG;KAClB;IACD;QACE,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;KACnC;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,aAAa;YACnB,eAAe,EAAE,sBAAsB;SACxC;QACD,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,CAAE;gBACV,IAAI,EAAE,uBAAuB;gBAC7B,WAAW,EAAE,iBAAiB;gBAC9B,eAAe,EAAE,sBAAsB;aACxC,CAAE;QACH,mEAAmE;QACnE,gBAAgB,EAAE,KAAK;KACxB;CACF,CAAC"}
|
|
@@ -6,7 +6,7 @@ exports.CoerceImports = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
function CoerceImports(sourceFile, structures) {
|
|
8
8
|
for (const structure of Array.isArray(structures) ? structures : [structures]) {
|
|
9
|
-
const moduleSpecifier = structure.moduleSpecifier;
|
|
9
|
+
const moduleSpecifier = structure.moduleSpecifier.endsWith('.ts') ? structure.moduleSpecifier.replace(/\.ts$/, '') : structure.moduleSpecifier;
|
|
10
10
|
const namedImports = structure.namedImports;
|
|
11
11
|
if (!moduleSpecifier ||
|
|
12
12
|
!(Array.isArray(namedImports) && namedImports.every((named) => typeof named === 'string')) ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-imports.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/ts-morph/coerce-imports.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,SAAgB,aAAa,CAC3B,UAAsB,EACtB,UAA8G;IAG9G,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAE,UAAU,CAAE,EAAE;QAE/E,MAAM,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"coerce-imports.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/ts-morph/coerce-imports.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,SAAgB,aAAa,CAC3B,UAAsB,EACtB,UAA8G;IAG9G,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAE,UAAU,CAAE,EAAE;QAE/E,MAAM,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;QAC/I,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;QAE5C,IAAI,CAAC,eAAe;YAClB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;YAC1F,CAAC,UAAU,CAAC,oBAAoB,CAAC,eAAe,CAAC,EAAE;YACnD,UAAU,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;SAC5C;aAAM;YACL,MAAM,iBAAiB,GAAG,UAAU,CAAC,oBAAoB,CAAC,eAAe,CAAE,CAAC;YAC5E,MAAM,eAAe,GAAG,iBAAiB,CAAC,eAAe,EAAE,CAAC;YAC5D,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE;gBAChC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,KAAK,CAAC,EAAE;oBACrE,iBAAiB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;iBACzC;aACF;SACF;KAEF;AAEH,CAAC;AA1BD,sCA0BC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DataProperty } from '@rxap/ts-morph';
|
|
2
|
+
import { WriterFunction } from 'ts-morph';
|
|
3
|
+
export interface AbstractControl extends DataProperty {
|
|
4
|
+
state: string | WriterFunction | null;
|
|
5
|
+
isRequired: boolean;
|
|
6
|
+
validatorList: string[];
|
|
7
|
+
role: 'control' | 'group' | 'array';
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract-control.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/types/abstract-control.ts"],"names":[],"mappings":""}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { TypeImport } from '@rxap/ts-morph';
|
|
2
|
-
import { ClassDeclaration, ClassDeclarationStructure, ImportDeclarationStructure, OptionalKind, SourceFile, WriterFunction } from 'ts-morph';
|
|
3
|
-
export interface DtoClassProperty {
|
|
4
|
-
name: string;
|
|
5
|
-
/**
|
|
6
|
-
* The type of the property
|
|
7
|
-
*
|
|
8
|
-
* if type = '<self>' the type will be the name of the class
|
|
9
|
-
*/
|
|
10
|
-
type: string | WriterFunction | TypeImport | '<self>';
|
|
11
|
-
isArray?: boolean | null;
|
|
12
|
-
/**
|
|
13
|
-
* indicates that the @Type decorator should be used as the type of the property is another dto class
|
|
14
|
-
*/
|
|
15
|
-
isType?: boolean | null;
|
|
16
|
-
isOptional?: boolean | null;
|
|
17
|
-
/**
|
|
18
|
-
* Use to import the type
|
|
19
|
-
* @deprecated use the type property with a TypeImport object
|
|
20
|
-
*/
|
|
21
|
-
moduleSpecifier?: string | null;
|
|
22
|
-
}
|
|
23
|
-
export declare function CreateDtoClass(sourceFile: SourceFile, className: string, propertyList: DtoClassProperty[], classStructure?: Omit<OptionalKind<ClassDeclarationStructure>, 'name'>, structures?: Array<OptionalKind<ImportDeclarationStructure>>): ClassDeclaration;
|
|
24
|
-
export declare function CreatePageDtoClass(sourceFile: SourceFile, className: string, rowType: string | WriterFunction, classStructure?: Omit<OptionalKind<ClassDeclarationStructure>, 'name'>, structures?: Array<OptionalKind<ImportDeclarationStructure>>): ClassDeclaration;
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreatePageDtoClass = exports.CreateDtoClass = void 0;
|
|
4
|
-
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
-
const ts_morph_1 = require("ts-morph");
|
|
6
|
-
const coerce_class_1 = require("../coerce-class");
|
|
7
|
-
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
8
|
-
const ts_morph_2 = require("@rxap/ts-morph");
|
|
9
|
-
function CreateDtoClass(sourceFile, className, propertyList, classStructure, structures) {
|
|
10
|
-
var _a;
|
|
11
|
-
className = (0, schematics_utilities_1.CoerceSuffix)(className, 'Dto');
|
|
12
|
-
classStructure !== null && classStructure !== void 0 ? classStructure : (classStructure = {});
|
|
13
|
-
(_a = classStructure.properties) !== null && _a !== void 0 ? _a : (classStructure.properties = []);
|
|
14
|
-
classStructure.isExported = true;
|
|
15
|
-
for (const property of propertyList) {
|
|
16
|
-
const decorators = [
|
|
17
|
-
{
|
|
18
|
-
name: 'Expose',
|
|
19
|
-
arguments: [],
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
23
|
-
namedImports: ['Expose'],
|
|
24
|
-
moduleSpecifier: 'class-transformer',
|
|
25
|
-
});
|
|
26
|
-
if (property.isArray) {
|
|
27
|
-
decorators.push({
|
|
28
|
-
name: 'IsArray',
|
|
29
|
-
arguments: [],
|
|
30
|
-
});
|
|
31
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
32
|
-
namedImports: ['IsArray'],
|
|
33
|
-
moduleSpecifier: 'class-validator',
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
if (property.type === '<self>') {
|
|
37
|
-
property.type = className;
|
|
38
|
-
property.isType = true;
|
|
39
|
-
}
|
|
40
|
-
if (property.isType) {
|
|
41
|
-
decorators.push({
|
|
42
|
-
name: 'Type',
|
|
43
|
-
arguments: [
|
|
44
|
-
w => {
|
|
45
|
-
w.write('() => ');
|
|
46
|
-
(0, ts_morph_2.WriteType)({
|
|
47
|
-
type: property.type,
|
|
48
|
-
isArray: false
|
|
49
|
-
}, sourceFile)(w);
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
});
|
|
53
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
54
|
-
namedImports: ['Type'],
|
|
55
|
-
moduleSpecifier: 'class-transformer',
|
|
56
|
-
});
|
|
57
|
-
decorators.push({
|
|
58
|
-
name: 'IsInstance',
|
|
59
|
-
arguments: [
|
|
60
|
-
(0, ts_morph_2.WriteType)({
|
|
61
|
-
type: property.type,
|
|
62
|
-
isArray: false
|
|
63
|
-
}, sourceFile),
|
|
64
|
-
w => {
|
|
65
|
-
if (property.isArray) {
|
|
66
|
-
ts_morph_1.Writers.object({ each: 'true' })(w);
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
});
|
|
71
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
72
|
-
namedImports: ['IsInstance'],
|
|
73
|
-
moduleSpecifier: 'class-validator',
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
if (property.isOptional) {
|
|
77
|
-
decorators.push({
|
|
78
|
-
name: 'IsOptional',
|
|
79
|
-
arguments: [],
|
|
80
|
-
});
|
|
81
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
82
|
-
namedImports: ['IsOptional'],
|
|
83
|
-
moduleSpecifier: 'class-validator',
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
if (property.type === 'string') {
|
|
87
|
-
if (property.name === 'uuid') {
|
|
88
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
89
|
-
namedImports: ['IsUUID'],
|
|
90
|
-
moduleSpecifier: 'class-validator',
|
|
91
|
-
});
|
|
92
|
-
decorators.push({
|
|
93
|
-
name: 'IsUUID',
|
|
94
|
-
arguments: [],
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
99
|
-
namedImports: ['IsString'],
|
|
100
|
-
moduleSpecifier: 'class-validator',
|
|
101
|
-
});
|
|
102
|
-
decorators.push({
|
|
103
|
-
name: 'IsString',
|
|
104
|
-
arguments: [],
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (property.type === 'boolean') {
|
|
109
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
110
|
-
namedImports: ['IsBoolean'],
|
|
111
|
-
moduleSpecifier: 'class-validator',
|
|
112
|
-
});
|
|
113
|
-
decorators.push({
|
|
114
|
-
name: 'IsBoolean',
|
|
115
|
-
arguments: [],
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
if (property.type === 'number') {
|
|
119
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
120
|
-
namedImports: ['IsBoolean'],
|
|
121
|
-
moduleSpecifier: 'class-validator',
|
|
122
|
-
});
|
|
123
|
-
decorators.push({
|
|
124
|
-
name: 'IsBoolean',
|
|
125
|
-
arguments: [],
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
classStructure.properties.push({
|
|
129
|
-
name: property.name,
|
|
130
|
-
type: (0, ts_morph_2.WriteType)(property, sourceFile),
|
|
131
|
-
hasQuestionToken: !!property.isOptional,
|
|
132
|
-
hasExclamationToken: !property.isOptional,
|
|
133
|
-
decorators,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, structures !== null && structures !== void 0 ? structures : []);
|
|
137
|
-
return (0, coerce_class_1.CoerceClass)(sourceFile, className, classStructure);
|
|
138
|
-
}
|
|
139
|
-
exports.CreateDtoClass = CreateDtoClass;
|
|
140
|
-
function CreatePageDtoClass(sourceFile, className, rowType, classStructure, structures) {
|
|
141
|
-
className = (0, schematics_utilities_1.CoerceSuffix)(className, 'PageDto');
|
|
142
|
-
const propertyList = [
|
|
143
|
-
{
|
|
144
|
-
name: 'rows',
|
|
145
|
-
type: rowType,
|
|
146
|
-
isArray: true,
|
|
147
|
-
isType: true,
|
|
148
|
-
},
|
|
149
|
-
];
|
|
150
|
-
classStructure !== null && classStructure !== void 0 ? classStructure : (classStructure = {});
|
|
151
|
-
classStructure.extends = w => {
|
|
152
|
-
w.write('PageDto<');
|
|
153
|
-
if (typeof rowType === 'string') {
|
|
154
|
-
w.write(rowType);
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
rowType(w);
|
|
158
|
-
}
|
|
159
|
-
w.write('>');
|
|
160
|
-
};
|
|
161
|
-
structures !== null && structures !== void 0 ? structures : (structures = []);
|
|
162
|
-
structures.push({
|
|
163
|
-
namedImports: ['PageDto'],
|
|
164
|
-
moduleSpecifier: '@rxap/nest-dto',
|
|
165
|
-
});
|
|
166
|
-
return CreateDtoClass(sourceFile, className, propertyList, classStructure, structures);
|
|
167
|
-
}
|
|
168
|
-
exports.CreatePageDtoClass = CreatePageDtoClass;
|
|
169
|
-
//# sourceMappingURL=create-dto-class.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-dto-class.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/create-dto-class.ts"],"names":[],"mappings":";;;AAAA,qEAA0D;AAE1D,uCAUkB;AAClB,kDAA8C;AAC9C,+DAA2D;AAC3D,6CAGwB;AAuBxB,SAAgB,cAAc,CAC5B,UAAsB,EACtB,SAAiB,EACjB,YAAgC,EAChC,cAAsE,EACtE,UAA4D;;IAG5D,SAAS,GAAG,IAAA,mCAAY,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3C,cAAc,aAAd,cAAc,cAAd,cAAc,IAAd,cAAc,GAAK,EAAE,EAAC;IACtB,MAAA,cAAc,CAAC,UAAU,oCAAzB,cAAc,CAAC,UAAU,GAAK,EAAE,EAAC;IACjC,cAAc,CAAC,UAAU,GAAG,IAAI,CAAC;IACjC,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;QACnC,MAAM,UAAU,GAA4C;YAC1D;gBACE,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,EAAE;aACd;SACF,CAAC;QACF,IAAA,8BAAa,EACX,UAAU,EACV;YACE,YAAY,EAAE,CAAE,QAAQ,CAAE;YAC1B,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OAAO,KAAK,QAAQ,EAAE;YAC/B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAClB;aAAM;YACL,OAAO,CAAC,CAAC,CAAC,CAAC;SACZ;QACD,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACf,CAAC,CAAC;IACF,UAAU,aAAV,UAAU,cAAV,UAAU,IAAV,UAAU,GAAK,EAAE,EAAC;IAClB,UAAU,CAAC,IAAI,CAAC;QACd,YAAY,EAAE,CAAE,SAAS,CAAE;QAC3B,eAAe,EAAE,gBAAgB;KAClC,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;AAEzF,CAAC;AArCD,gDAqCC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TypeImport } from '@rxap/ts-morph';
|
|
2
|
-
import { WriterFunction } from 'ts-morph';
|
|
3
|
-
export interface FormDefinitionControl {
|
|
4
|
-
name: string;
|
|
5
|
-
type?: string | TypeImport | WriterFunction;
|
|
6
|
-
isArray?: boolean;
|
|
7
|
-
state?: string | WriterFunction | null;
|
|
8
|
-
isRequired?: boolean;
|
|
9
|
-
validatorList?: string[];
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form-definition-control.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/types/form-definition-control.ts"],"names":[],"mappings":""}
|