@rxap/schematics-ts-morph 16.1.0-dev.9 → 16.1.0
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 +120 -0
- package/README.md +1 -1
- package/package.json +22 -18
- package/src/index.d.ts +7 -1
- package/src/index.js +7 -1
- package/src/index.js.map +1 -1
- package/src/lib/angular/coerce-component.d.ts +3 -1
- package/src/lib/angular/coerce-component.js +13 -6
- package/src/lib/angular/coerce-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 -124
- 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 +20 -9
- 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-pipe.d.ts +10 -0
- package/src/lib/angular/coerce-pipe.js +63 -0
- package/src/lib/angular/coerce-pipe.js.map +1 -0
- package/src/lib/angular/coerce-proxy-remote-method-class.d.ts +2 -0
- package/src/lib/angular/coerce-proxy-remote-method-class.js +41 -19
- package/src/lib/angular/coerce-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 +2 -0
- package/src/lib/nest/add-operation-to-controller.js +9 -2
- package/src/lib/nest/add-operation-to-controller.js.map +1 -1
- package/src/lib/nest/assert-nest-project.d.ts +1 -0
- package/src/lib/nest/assert-nest-project.js +7 -3
- package/src/lib/nest/assert-nest-project.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.js +169 -125
- package/src/lib/nest/coerce-dto-class.js.map +1 -1
- package/src/lib/nest/coerce-form-submit-operation.js +4 -3
- package/src/lib/nest/coerce-form-submit-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-by-id-operation.js +28 -10
- package/src/lib/nest/coerce-get-by-id-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-page-operation.d.ts +4 -3
- package/src/lib/nest/coerce-get-page-operation.js +90 -33
- package/src/lib/nest/coerce-get-page-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-root-operation.d.ts +4 -0
- package/src/lib/nest/coerce-get-root-operation.js +14 -4
- package/src/lib/nest/coerce-get-root-operation.js.map +1 -1
- package/src/lib/nest/coerce-operation.d.ts +6 -3
- package/src/lib/nest/coerce-operation.js +14 -5
- 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 +59 -5
- package/src/lib/nest/coerce-options-operation.js.map +1 -1
- package/src/lib/nest/coerce-row-dto-class.d.ts +2 -1
- package/src/lib/nest/coerce-row-dto-class.js +2 -2
- package/src/lib/nest/coerce-row-dto-class.js.map +1 -1
- package/src/lib/nest/coerce-table-select-operation.d.ts +3 -2
- package/src/lib/nest/coerce-table-select-operation.js +10 -15
- package/src/lib/nest/coerce-table-select-operation.js.map +1 -1
- package/src/lib/nest/coerce-table-select-value-resolve-operation.d.ts +5 -3
- package/src/lib/nest/coerce-table-select-value-resolve-operation.js +17 -15
- package/src/lib/nest/coerce-table-select-value-resolve-operation.js.map +1 -1
- package/src/lib/nest/coerce-tree-operation.js +2 -1
- package/src/lib/nest/coerce-tree-operation.js.map +1 -1
- package/src/lib/nest/dto-class-property.d.ts +2 -9
- package/src/lib/nest/dto-class-property.js +8 -4
- package/src/lib/nest/dto-class-property.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/ts-morph/write-type.js +1 -1
- package/src/lib/ts-morph/write-type.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/types/form-definition-control.d.ts +0 -10
- package/src/lib/types/form-definition-control.js.map +0 -1
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceTableSelectOperationRule = void 0;
|
|
4
|
-
const
|
|
4
|
+
const utilities_1 = require("@rxap/utilities");
|
|
5
5
|
const coerce_get_page_operation_1 = require("./coerce-get-page-operation");
|
|
6
6
|
function CoerceTableSelectOperationRule(options) {
|
|
7
|
-
const { propertyList = [],
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
source:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type: (0, ts_morph_1.NormalizeTypeImport)('string'),
|
|
17
|
-
isArray: false,
|
|
18
|
-
source: rowValueProperty,
|
|
19
|
-
});
|
|
20
|
-
return (0, coerce_get_page_operation_1.CoerceGetPageOperation)(Object.assign(Object.assign({}, options), { propertyList: propertyList, rowIdProperty }));
|
|
7
|
+
const { propertyList = [], idProperty, rowDisplayProperty, rowValueProperty = idProperty, } = options;
|
|
8
|
+
if (!rowValueProperty) {
|
|
9
|
+
throw new Error('The row value property is required');
|
|
10
|
+
}
|
|
11
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, [
|
|
12
|
+
Object.assign(Object.assign({}, rowValueProperty), { name: '__value', source: rowValueProperty.name }),
|
|
13
|
+
Object.assign(Object.assign({}, rowDisplayProperty), { name: '__display', source: rowDisplayProperty.name })
|
|
14
|
+
], { compareTo: (a, b) => a.name === b.name, unshift: true });
|
|
15
|
+
return (0, coerce_get_page_operation_1.CoerceGetPageOperation)(Object.assign(Object.assign({}, options), { propertyList: propertyList, idProperty }));
|
|
21
16
|
}
|
|
22
17
|
exports.CoerceTableSelectOperationRule = CoerceTableSelectOperationRule;
|
|
23
18
|
//# sourceMappingURL=coerce-table-select-operation.js.map
|
|
@@ -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":";;;
|
|
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":";;;AACA,+CAAmD;AACnD,2EAGqC;AAOrC,SAAgB,8BAA8B,CAAC,OAA0C;IACvF,MAAM,EACJ,YAAY,GAAG,EAAE,EACjB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,GAAG,UAAU,GAC9B,GAAG,OAAO,CAAC;IAEZ,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACvD;IAED,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,UAAU,IACV,CAAC;AAEL,CAAC;AA/BD,wEA+BC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { DataProperty, NormalizedDataProperty } from '@rxap/ts-morph';
|
|
1
2
|
import { ClassDeclaration, SourceFile, WriterFunction } from 'ts-morph';
|
|
2
3
|
import { CoerceDtoClassOutput } from './coerce-dto-class';
|
|
3
4
|
import { CoerceOperationOptions, TransformOperation } from './coerce-operation';
|
|
4
5
|
export interface CoerceTableSelectValueResolveOperationOptions extends CoerceOperationOptions {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
rowIdProperty: DataProperty;
|
|
7
|
+
rowDisplayProperty: NormalizedDataProperty;
|
|
8
|
+
rowValueProperty?: NormalizedDataProperty;
|
|
7
9
|
}
|
|
8
|
-
export declare function BuildTableSelectValueResolveUpstreamGetParametersImplementation(classDeclaration: ClassDeclaration, moduleSourceFile: SourceFile, dto: CoerceDtoClassOutput | null, options: Readonly<CoerceTableSelectValueResolveOperationOptions
|
|
10
|
+
export declare function BuildTableSelectValueResolveUpstreamGetParametersImplementation(classDeclaration: ClassDeclaration, moduleSourceFile: SourceFile, dto: CoerceDtoClassOutput | null, options: Readonly<Pick<CoerceTableSelectValueResolveOperationOptions, 'upstream'>>): TransformOperation<string | WriterFunction>;
|
|
9
11
|
export declare function CoerceTableSelectValueResolveOperationRule(options: CoerceTableSelectValueResolveOperationOptions): import("@angular-devkit/schematics").Rule;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceTableSelectValueResolveOperationRule = exports.BuildTableSelectValueResolveUpstreamGetParametersImplementation = void 0;
|
|
4
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
|
function BuildTableSelectValueResolveUpstreamGetParametersImplementation(classDeclaration, moduleSourceFile, dto, options) {
|
|
7
8
|
return () => {
|
|
@@ -9,8 +10,16 @@ function BuildTableSelectValueResolveUpstreamGetParametersImplementation(classDe
|
|
|
9
10
|
const { upstream } = options;
|
|
10
11
|
if (upstream) {
|
|
11
12
|
if ((0, ts_morph_1.IsNormalizedOpenApiUpstreamOptions)(upstream)) {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
const { mapper } = upstream;
|
|
14
|
+
let value = null;
|
|
15
|
+
if (mapper && (0, ts_morph_1.IsNormalizedResolveRequestMapper)(mapper)) {
|
|
16
|
+
value = (_a = mapper.value) !== null && _a !== void 0 ? _a : value;
|
|
17
|
+
}
|
|
18
|
+
if (value) {
|
|
19
|
+
return `{ parameters: { ${value}: value } }`;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return '{ parameters: { value } }';
|
|
14
23
|
}
|
|
15
24
|
}
|
|
16
25
|
return '{ value }';
|
|
@@ -20,19 +29,12 @@ function BuildTableSelectValueResolveUpstreamGetParametersImplementation(classDe
|
|
|
20
29
|
}
|
|
21
30
|
exports.BuildTableSelectValueResolveUpstreamGetParametersImplementation = BuildTableSelectValueResolveUpstreamGetParametersImplementation;
|
|
22
31
|
function CoerceTableSelectValueResolveOperationRule(options) {
|
|
23
|
-
const { buildUpstreamGetParametersImplementation = BuildTableSelectValueResolveUpstreamGetParametersImplementation, propertyList = [], rowDisplayProperty
|
|
24
|
-
|
|
25
|
-
name: '
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
propertyList.unshift({
|
|
31
|
-
name: '__value',
|
|
32
|
-
type: (0, ts_morph_1.NormalizeTypeImport)('string'),
|
|
33
|
-
isArray: false,
|
|
34
|
-
source: rowValueProperty,
|
|
35
|
-
});
|
|
32
|
+
const { buildUpstreamGetParametersImplementation = BuildTableSelectValueResolveUpstreamGetParametersImplementation, propertyList = [], rowIdProperty, rowDisplayProperty, rowValueProperty = (0, ts_morph_1.NormalizeDataProperty)(rowIdProperty), } = options;
|
|
33
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, [
|
|
34
|
+
Object.assign(Object.assign({}, rowValueProperty), { name: '__value', source: rowValueProperty.name }),
|
|
35
|
+
Object.assign(Object.assign({}, rowDisplayProperty), { name: '__display', source: rowDisplayProperty.name }),
|
|
36
|
+
(0, ts_morph_1.NormalizeDataProperty)(Object.assign(Object.assign({}, rowIdProperty), { name: '__rowId', source: rowIdProperty.name }), 'number')
|
|
37
|
+
], { compareTo: (a, b) => a.name === b.name, unshift: true });
|
|
36
38
|
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), { buildUpstreamGetParametersImplementation }));
|
|
37
39
|
}
|
|
38
40
|
exports.CoerceTableSelectValueResolveOperationRule = CoerceTableSelectValueResolveOperationRule;
|
|
@@ -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,6CAMwB;AACxB,+CAAmD;AAOnD,yDAI4B;AAS5B,SAAgB,+DAA+D,CAClB,gBAAkC,EAClC,gBAA4B,EAC5B,GAAgC,EAChC,OAAkF;IAE7I,OAAO,GAAG,EAAE;;QACV,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QAC7B,IAAI,QAAQ,EAAE;YACZ,IAAI,IAAA,6CAAkC,EAAC,QAAQ,CAAC,EAAE;gBAChD,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;gBAC5B,IAAI,KAAK,GAAkB,IAAI,CAAC;gBAChC,IAAI,MAAM,IAAI,IAAA,2CAAgC,EAAC,MAAM,CAAC,EAAE;oBACtD,KAAK,GAAG,MAAA,MAAM,CAAC,KAAK,mCAAI,KAAK,CAAC;iBAC/B;gBACD,IAAI,KAAK,EAAE;oBACT,OAAO,mBAAoB,KAAM,aAAa,CAAC;iBAChD;qBAAM;oBACL,OAAO,2BAA2B,CAAC;iBACpC;aACF;YACD,OAAO,WAAW,CAAC;SACpB;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC;AAzBD,0IAyBC;AAED,SAAgB,0CAA0C,CAAC,OAAsD;IAC/G,MAAM,EACJ,wCAAwC,GAAG,+DAA+D,EAC1G,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;QAEjC,IAAA,gCAAqB,kCAChB,aAAa,KAChB,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,aAAa,CAAC,IAAI,KACzB,QAAQ,CAAC;KACb,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,kCAAe,kCACjB,OAAO,KACV,wCAAwC,IACxC,CAAC;AACL,CAAC;AA/BD,gGA+BC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceTreeOperationRule = void 0;
|
|
4
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
4
5
|
const utilities_1 = require("@rxap/utilities");
|
|
5
6
|
const coerce_operation_1 = require("./coerce-operation");
|
|
6
7
|
function CoerceTreeOperationRule(options) {
|
|
@@ -31,7 +32,7 @@ function CoerceTreeOperationRule(options) {
|
|
|
31
32
|
isOptional: true,
|
|
32
33
|
isArray: true,
|
|
33
34
|
isType: true,
|
|
34
|
-
type:
|
|
35
|
+
type: ts_morph_1.TypeNames.Self,
|
|
35
36
|
},
|
|
36
37
|
], (a, b) => a.name === b.name);
|
|
37
38
|
if (!fullTree) {
|
|
@@ -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,+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,
|
|
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"}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { DataProperty,
|
|
1
|
+
import { DataProperty, NormalizedDataProperty } from '@rxap/ts-morph';
|
|
2
2
|
import { Normalized } from '@rxap/utilities';
|
|
3
3
|
export interface DtoClassProperty extends DataProperty {
|
|
4
|
-
/**
|
|
5
|
-
* The type of the property
|
|
6
|
-
*
|
|
7
|
-
* if type = '<self>' the type will be the name of the class
|
|
8
|
-
*/
|
|
9
|
-
type: string | TypeImport | '<self>';
|
|
10
4
|
/**
|
|
11
5
|
* indicates that the @Type decorator should be used as the type of the property is another dto class
|
|
12
6
|
*/
|
|
13
7
|
isType?: boolean;
|
|
14
8
|
}
|
|
15
|
-
export interface NormalizedDtoClassProperty extends Normalized<
|
|
16
|
-
type: NormalizedTypeImport;
|
|
9
|
+
export interface NormalizedDtoClassProperty extends Normalized<Pick<DtoClassProperty, 'isType'>>, NormalizedDataProperty {
|
|
17
10
|
}
|
|
18
11
|
export declare function NormalizeDataClassProperty(property: DtoClassProperty): NormalizedDtoClassProperty;
|
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NormalizeDataClassProperty = void 0;
|
|
4
4
|
const ts_morph_1 = require("@rxap/ts-morph");
|
|
5
5
|
function NormalizeDataClassProperty(property) {
|
|
6
|
-
var _a
|
|
7
|
-
const { name, type, isArray } = (0, ts_morph_1.NormalizeDataProperty)(property);
|
|
8
|
-
let isType = (
|
|
9
|
-
|
|
6
|
+
var _a;
|
|
7
|
+
const { name, type, isArray, memberList, source, isOptional, } = (0, ts_morph_1.NormalizeDataProperty)(property);
|
|
8
|
+
let isType = (_a = property.isType) !== null && _a !== void 0 ? _a : false;
|
|
9
|
+
if ([ts_morph_1.TypeNames.Self, ts_morph_1.TypeNames.Deferred].includes(type.name)) {
|
|
10
|
+
isType = true;
|
|
11
|
+
}
|
|
10
12
|
switch (type.name) {
|
|
11
13
|
case 'IconConfig':
|
|
12
14
|
type.name = 'IconDto';
|
|
@@ -15,6 +17,8 @@ function NormalizeDataClassProperty(property) {
|
|
|
15
17
|
break;
|
|
16
18
|
}
|
|
17
19
|
return {
|
|
20
|
+
source,
|
|
21
|
+
memberList,
|
|
18
22
|
name,
|
|
19
23
|
type,
|
|
20
24
|
isArray,
|
|
@@ -1 +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;
|
|
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,QAAQ,CAAC,MAAM,mCAAI,KAAK,CAAC;IACtC,IAAK,CAAE,oBAAS,CAAC,IAAI,EAAE,oBAAS,CAAC,QAAQ,CAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC5E,MAAM,GAAG,IAAI,CAAC;KACf;IACD,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;AA7BD,gEA6BC"}
|
|
@@ -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"}
|
|
@@ -38,7 +38,7 @@ function WriteType(propertyOrType, sourceFile) {
|
|
|
38
38
|
else {
|
|
39
39
|
type = propertyOrType;
|
|
40
40
|
}
|
|
41
|
-
if ((0, ts_morph_1.IsTypeImport)(type)) {
|
|
41
|
+
if ((0, ts_morph_1.IsTypeImport)(type) && (0, ts_morph_1.RequiresTypeImport)(type)) {
|
|
42
42
|
if (sourceFile) {
|
|
43
43
|
(0, ts_morph_1.CoerceImports)(sourceFile, (0, ts_morph_1.TypeImportToImportStructure)(type));
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-type.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/ts-morph/write-type.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"write-type.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/ts-morph/write-type.ts"],"names":[],"mappings":";;;AAAA,6CAMwB;AAcxB,SAAgB,kBAAkB,CAAC,KAAU;IAC3C,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;AAC1D,CAAC;AAFD,gDAEC;AAED;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,IAAY,EAAE,CAAkB;IAC9D,QAAQ,IAAI,EAAE;QACZ,KAAK,MAAM;YACT,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAChB,MAAM;QACR,KAAK,MAAM;YACT,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAClB,MAAM;QACR;YACE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACd,MAAM;KACT;AACH,CAAC;AAZD,0CAYC;AAID,SAAgB,SAAS,CAAC,cAA4C,EAAE,UAAsB;;IAC5F,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,IAAe,CAAC;IACpB,IAAI,kBAAkB,CAAC,cAAc,CAAC,EAAE;QACtC,OAAO,GAAG,MAAA,cAAc,CAAC,OAAO,mCAAI,OAAO,CAAC;QAC5C,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;KAC5B;SAAM;QACL,IAAI,GAAG,cAAc,CAAC;KACvB;IACD,IAAI,IAAA,uBAAY,EAAC,IAAI,CAAC,IAAI,IAAA,6BAAkB,EAAC,IAAI,CAAC,EAAE;QAClD,IAAI,UAAU,EAAE;YACd,IAAA,wBAAa,EAAC,UAAU,EAAE,IAAA,sCAA2B,EAAC,IAAI,CAAC,CAAC,CAAC;SAC9D;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;SACxE;KACF;IACD,OAAO,CAAC,CAAkB,EAAE,EAAE;QAC5B,IAAI,OAAO,EAAE;YACX,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SACnB;QACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SAC1B;aAAM,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;YACrC,IAAI,CAAC,CAAC,CAAC,CAAC;SACT;aAAM,IAAI,IAAA,uBAAY,EAAC,IAAI,CAAC,EAAE;YAC7B,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SAC/B;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;SACjC;QACD,IAAI,OAAO,EAAE;YACX,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACd;IACH,CAAC,CAAC;AACJ,CAAC;AAjCD,8BAiCC"}
|
|
@@ -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,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":""}
|