@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,37 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoerceDtoClass =
|
|
3
|
+
exports.CoerceDtoClass = void 0;
|
|
4
4
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
5
6
|
const utilities_1 = require("@rxap/utilities");
|
|
6
7
|
const path_1 = require("path");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const coerce_decorator_1 = require("../ts-morph/coerce-decorator");
|
|
11
|
-
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
12
|
-
const ts_morph_2 = require("@rxap/ts-morph");
|
|
13
|
-
function CoercePropertyDeclaration(node, name, structure = {}) {
|
|
14
|
-
let property = node.getProperty(name);
|
|
15
|
-
if (!property) {
|
|
16
|
-
property = node.addProperty({ name });
|
|
17
|
-
property.set(structure);
|
|
18
|
-
}
|
|
19
|
-
return property;
|
|
20
|
-
}
|
|
21
|
-
exports.CoercePropertyDeclaration = CoercePropertyDeclaration;
|
|
8
|
+
const ts_morph_2 = require("ts-morph");
|
|
9
|
+
const dto_class_property_1 = require("./dto-class-property");
|
|
10
|
+
require("colors");
|
|
22
11
|
function CoerceDtoClass(options) {
|
|
23
|
-
const { project, propertyList = [], tsMorphTransform = utilities_1.noop,
|
|
12
|
+
const { project, propertyList = [], tsMorphTransform = utilities_1.noop, } = options;
|
|
24
13
|
let { name, } = options;
|
|
25
14
|
name = (0, schematics_utilities_1.dasherize)(name);
|
|
26
15
|
const className = (0, schematics_utilities_1.CoerceSuffix)((0, schematics_utilities_1.classify)(name), 'Dto');
|
|
27
16
|
const fileName = (0, schematics_utilities_1.CoerceSuffix)(name, '.dto');
|
|
28
|
-
const sourceFile = (0,
|
|
29
|
-
const classDeclaration = (0,
|
|
17
|
+
const sourceFile = (0, ts_morph_1.CoerceSourceFile)(project, (0, path_1.join)('dtos', fileName + '.ts'));
|
|
18
|
+
const classDeclaration = (0, ts_morph_1.CoerceClass)(sourceFile, className);
|
|
30
19
|
classDeclaration.setIsExported(true);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if
|
|
34
|
-
|
|
20
|
+
for (const property of propertyList.map(dto_class_property_1.NormalizeDataClassProperty)) {
|
|
21
|
+
// create a clone of the property type to avoid modifying the original type
|
|
22
|
+
// if the property type is a self reference we need to replace the self reference with the class name
|
|
23
|
+
// if the property type is a deferred reference we need to replace the deferred reference with the class name
|
|
24
|
+
const propertyType = Object.assign({}, property.type);
|
|
25
|
+
let subTypeOutput;
|
|
26
|
+
switch (propertyType.name) {
|
|
27
|
+
case ts_morph_1.TypeNames.Self:
|
|
28
|
+
propertyType.name = className;
|
|
29
|
+
propertyType.isTypeOnly = false;
|
|
30
|
+
propertyType.moduleSpecifier = null;
|
|
31
|
+
propertyType.namedImport = null;
|
|
32
|
+
propertyType.namespaceImport = null;
|
|
33
|
+
propertyType.defaultImport = null;
|
|
34
|
+
property.isType = true;
|
|
35
|
+
break;
|
|
36
|
+
case ts_morph_1.TypeNames.Deferred:
|
|
37
|
+
subTypeOutput = CoerceDtoClass({
|
|
38
|
+
project,
|
|
39
|
+
name: [name, (0, schematics_utilities_1.dasherize)(property.name)].join('-'),
|
|
40
|
+
propertyList: property.memberList,
|
|
41
|
+
});
|
|
42
|
+
propertyType.name = subTypeOutput.className;
|
|
43
|
+
propertyType.moduleSpecifier = './' + (0, schematics_utilities_1.dasherize)(subTypeOutput.className.replace(/Dto$/, '')) + '.dto';
|
|
44
|
+
propertyType.isTypeOnly = false;
|
|
45
|
+
propertyType.namedImport = null;
|
|
46
|
+
propertyType.namespaceImport = null;
|
|
47
|
+
propertyType.defaultImport = null;
|
|
48
|
+
property.isType = true;
|
|
49
|
+
break;
|
|
35
50
|
}
|
|
36
51
|
let propertyName = (0, schematics_utilities_1.camelize)(property.name);
|
|
37
52
|
const prefixMatch = property.name.match(/^(_+)/);
|
|
@@ -39,153 +54,175 @@ function CoerceDtoClass(options) {
|
|
|
39
54
|
propertyName = (0, schematics_utilities_1.camelize)(property.name.replace(/^_+/, ''));
|
|
40
55
|
propertyName = prefixMatch[0] + propertyName;
|
|
41
56
|
}
|
|
42
|
-
const propertyDeclaration = CoercePropertyDeclaration(classDeclaration, propertyName).set({
|
|
43
|
-
type: (0,
|
|
44
|
-
|
|
57
|
+
const propertyDeclaration = (0, ts_morph_1.CoercePropertyDeclaration)(classDeclaration, propertyName).set({
|
|
58
|
+
type: (0, ts_morph_1.WriteType)({
|
|
59
|
+
isArray: property.isArray,
|
|
60
|
+
type: propertyType,
|
|
61
|
+
}, sourceFile),
|
|
62
|
+
hasQuestionToken: property.isOptional,
|
|
45
63
|
hasExclamationToken: !property.isOptional,
|
|
46
64
|
});
|
|
47
|
-
(
|
|
48
|
-
arguments: [],
|
|
49
|
-
});
|
|
50
|
-
importStructureList.push({
|
|
51
|
-
namedImports: ['Expose'],
|
|
52
|
-
moduleSpecifier: 'class-transformer',
|
|
53
|
-
});
|
|
65
|
+
addExposeDecorator(propertyDeclaration);
|
|
54
66
|
if (property.isArray) {
|
|
55
|
-
(
|
|
56
|
-
arguments: [],
|
|
57
|
-
});
|
|
58
|
-
importStructureList.push({
|
|
59
|
-
namedImports: ['IsArray'],
|
|
60
|
-
moduleSpecifier: 'class-validator',
|
|
61
|
-
});
|
|
67
|
+
addClassValidatorDecoratorForIsArray(propertyDeclaration);
|
|
62
68
|
}
|
|
63
69
|
if (property.isType) {
|
|
64
|
-
(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
addClassValidatorDecoratorForNestedDto(propertyDeclaration, propertyType, property.isArray);
|
|
71
|
+
}
|
|
72
|
+
if (property.isOptional) {
|
|
73
|
+
addIsOptionalDecorator(propertyDeclaration);
|
|
74
|
+
}
|
|
75
|
+
addClassValidatorDecoratorForType(propertyDeclaration, propertyType);
|
|
76
|
+
if (propertyType.name !== 'unknown') {
|
|
77
|
+
cleanupUnknownApiPropertyDecorator(propertyDeclaration);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
tsMorphTransform(project, sourceFile, classDeclaration);
|
|
81
|
+
return {
|
|
82
|
+
className,
|
|
83
|
+
filePath: '.' + (0, path_1.join)(sourceFile.getDirectoryPath(), sourceFile.getBaseNameWithoutExtension()),
|
|
84
|
+
sourceFile,
|
|
85
|
+
classDeclaration,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
exports.CoerceDtoClass = CoerceDtoClass;
|
|
89
|
+
function addIsOptionalDecorator(propertyDeclaration) {
|
|
90
|
+
const sourceFile = propertyDeclaration.getSourceFile();
|
|
91
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'IsOptional', {
|
|
92
|
+
arguments: [],
|
|
93
|
+
});
|
|
94
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
95
|
+
namedImports: ['IsOptional'],
|
|
96
|
+
moduleSpecifier: 'class-validator',
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function addExposeDecorator(propertyDeclaration) {
|
|
100
|
+
const sourceFile = propertyDeclaration.getSourceFile();
|
|
101
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'Expose', {
|
|
102
|
+
arguments: [],
|
|
103
|
+
});
|
|
104
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
105
|
+
namedImports: ['Expose'],
|
|
106
|
+
moduleSpecifier: 'class-transformer',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function addClassValidatorDecoratorForIsArray(propertyDeclaration) {
|
|
110
|
+
const sourceFile = propertyDeclaration.getSourceFile();
|
|
111
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'IsArray', {
|
|
112
|
+
arguments: [],
|
|
113
|
+
});
|
|
114
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
115
|
+
namedImports: ['IsArray'],
|
|
116
|
+
moduleSpecifier: 'class-validator',
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function addClassValidatorDecoratorForNestedDto(propertyDeclaration, propertyType, isArray) {
|
|
120
|
+
const sourceFile = propertyDeclaration.getSourceFile();
|
|
121
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'Type', {
|
|
122
|
+
arguments: [
|
|
123
|
+
w => {
|
|
124
|
+
w.write('() => ');
|
|
125
|
+
(0, ts_morph_1.WriteType)({
|
|
126
|
+
type: propertyType,
|
|
127
|
+
isArray: false,
|
|
128
|
+
}, sourceFile)(w);
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
});
|
|
132
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
133
|
+
namedImports: ['Type'],
|
|
134
|
+
moduleSpecifier: 'class-transformer',
|
|
135
|
+
});
|
|
136
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'IsInstance', {
|
|
137
|
+
arguments: [
|
|
138
|
+
(0, ts_morph_1.WriteType)({
|
|
139
|
+
type: propertyType,
|
|
140
|
+
isArray: false,
|
|
141
|
+
}, sourceFile),
|
|
142
|
+
w => {
|
|
143
|
+
if (isArray) {
|
|
144
|
+
ts_morph_2.Writers.object({ each: 'true' })(w);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
});
|
|
149
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
150
|
+
namedImports: ['IsInstance'],
|
|
151
|
+
moduleSpecifier: 'class-validator',
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function addClassValidatorDecoratorForType(propertyDeclaration, propertyType) {
|
|
155
|
+
var _a;
|
|
156
|
+
const sourceFile = propertyDeclaration.getSourceFile();
|
|
157
|
+
switch (propertyType.name) {
|
|
158
|
+
case 'date':
|
|
159
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'IsDate', {
|
|
160
|
+
arguments: [],
|
|
91
161
|
});
|
|
92
|
-
|
|
93
|
-
namedImports: ['
|
|
162
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
163
|
+
namedImports: ['IsDate'],
|
|
94
164
|
moduleSpecifier: 'class-validator',
|
|
95
165
|
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
(0,
|
|
166
|
+
break;
|
|
167
|
+
case 'number':
|
|
168
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'IsNumber', {
|
|
99
169
|
arguments: [],
|
|
100
170
|
});
|
|
101
|
-
|
|
102
|
-
namedImports: ['
|
|
171
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
172
|
+
namedImports: ['IsNumber'],
|
|
103
173
|
moduleSpecifier: 'class-validator',
|
|
104
174
|
});
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
else if (typeof property.type === 'object') {
|
|
111
|
-
autoType = property.type.name;
|
|
112
|
-
}
|
|
113
|
-
switch (autoType) {
|
|
114
|
-
case 'date':
|
|
115
|
-
(0, coerce_decorator_1.CoerceDecorator)(propertyDeclaration, 'IsDate', {
|
|
116
|
-
arguments: [],
|
|
117
|
-
});
|
|
118
|
-
importStructureList.push({
|
|
119
|
-
namedImports: ['IsDate'],
|
|
120
|
-
moduleSpecifier: 'class-validator',
|
|
121
|
-
});
|
|
122
|
-
break;
|
|
123
|
-
case 'number':
|
|
124
|
-
(0, coerce_decorator_1.CoerceDecorator)(propertyDeclaration, 'IsNumber', {
|
|
125
|
-
arguments: [],
|
|
126
|
-
});
|
|
127
|
-
importStructureList.push({
|
|
128
|
-
namedImports: ['IsNumber'],
|
|
129
|
-
moduleSpecifier: 'class-validator',
|
|
130
|
-
});
|
|
131
|
-
break;
|
|
132
|
-
case 'string':
|
|
133
|
-
if (property.name === 'uuid') {
|
|
134
|
-
importStructureList.push({
|
|
135
|
-
namedImports: ['IsUUID'],
|
|
136
|
-
moduleSpecifier: 'class-validator',
|
|
137
|
-
});
|
|
138
|
-
(0, coerce_decorator_1.CoerceDecorator)(propertyDeclaration, 'IsUUID', {
|
|
139
|
-
arguments: [],
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
importStructureList.push({
|
|
144
|
-
namedImports: ['IsString'],
|
|
145
|
-
moduleSpecifier: 'class-validator',
|
|
146
|
-
});
|
|
147
|
-
(0, coerce_decorator_1.CoerceDecorator)(propertyDeclaration, 'IsString', {
|
|
148
|
-
arguments: [],
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
break;
|
|
152
|
-
case 'uuid':
|
|
153
|
-
(0, coerce_decorator_1.CoerceDecorator)(propertyDeclaration, 'IsUUID', {
|
|
154
|
-
arguments: [],
|
|
155
|
-
});
|
|
156
|
-
importStructureList.push({
|
|
175
|
+
break;
|
|
176
|
+
case 'string':
|
|
177
|
+
if ((_a = propertyDeclaration.getName()) === null || _a === void 0 ? void 0 : _a.match(/^uuid|Uuid$/)) {
|
|
178
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
157
179
|
namedImports: ['IsUUID'],
|
|
158
180
|
moduleSpecifier: 'class-validator',
|
|
159
181
|
});
|
|
160
|
-
|
|
161
|
-
case 'boolean':
|
|
162
|
-
(0, coerce_decorator_1.CoerceDecorator)(propertyDeclaration, 'IsBoolean', {
|
|
182
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'IsUUID', {
|
|
163
183
|
arguments: [],
|
|
164
184
|
});
|
|
165
|
-
|
|
166
|
-
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
188
|
+
namedImports: ['IsString'],
|
|
167
189
|
moduleSpecifier: 'class-validator',
|
|
168
190
|
});
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
(0, coerce_decorator_1.CoerceDecorator)(propertyDeclaration, 'ApiProperty', {
|
|
172
|
-
arguments: [ts_morph_1.Writers.object({ type: w => w.quote('unknown') })],
|
|
173
|
-
});
|
|
174
|
-
importStructureList.push({
|
|
175
|
-
namedImports: ['ApiProperty'],
|
|
176
|
-
moduleSpecifier: '@nestjs/swagger',
|
|
191
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'IsString', {
|
|
192
|
+
arguments: [],
|
|
177
193
|
});
|
|
178
|
-
|
|
194
|
+
}
|
|
195
|
+
break;
|
|
196
|
+
case 'boolean':
|
|
197
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'IsBoolean', {
|
|
198
|
+
arguments: [],
|
|
199
|
+
});
|
|
200
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
201
|
+
namedImports: ['IsBoolean'],
|
|
202
|
+
moduleSpecifier: 'class-validator',
|
|
203
|
+
});
|
|
204
|
+
break;
|
|
205
|
+
case 'unknown':
|
|
206
|
+
(0, ts_morph_1.CoerceDecorator)(propertyDeclaration, 'ApiProperty', {
|
|
207
|
+
arguments: [ts_morph_2.Writers.object({ type: w => w.quote('unknown') })],
|
|
208
|
+
});
|
|
209
|
+
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
210
|
+
namedImports: ['ApiProperty'],
|
|
211
|
+
moduleSpecifier: '@nestjs/swagger',
|
|
212
|
+
});
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function cleanupUnknownApiPropertyDecorator(propertyDeclaration) {
|
|
217
|
+
var _a;
|
|
218
|
+
const apiProperty = propertyDeclaration.getDecorators().find(d => d.getName() === 'ApiProperty');
|
|
219
|
+
if (apiProperty) {
|
|
220
|
+
const args = apiProperty.getArguments()[0];
|
|
221
|
+
if (args instanceof ts_morph_2.ObjectLiteralExpression) {
|
|
222
|
+
if ((_a = args.getProperty('type')) === null || _a === void 0 ? void 0 : _a.getText().includes('unknown')) {
|
|
223
|
+
apiProperty.remove();
|
|
224
|
+
}
|
|
179
225
|
}
|
|
180
226
|
}
|
|
181
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, importStructureList);
|
|
182
|
-
tsMorphTransform(project, sourceFile, classDeclaration);
|
|
183
|
-
return {
|
|
184
|
-
className,
|
|
185
|
-
filePath: '.' + (0, path_1.join)(sourceFile.getDirectoryPath(), sourceFile.getBaseNameWithoutExtension()),
|
|
186
|
-
sourceFile,
|
|
187
|
-
classDeclaration,
|
|
188
|
-
};
|
|
189
227
|
}
|
|
190
|
-
exports.CoerceDtoClass = CoerceDtoClass;
|
|
191
228
|
//# sourceMappingURL=coerce-dto-class.js.map
|
|
@@ -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,+CAAuC;AACvC,+BAA4B;AAC5B,
|
|
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,6CASwB;AACxB,+CAAuC;AACvC,+BAA4B;AAC5B,uCAOkB;AAClB,6DAG8B;AAC9B,kBAAgB;AAgBhB,SAAgB,cAAc,CAAC,OAA8B;IAC3D,MAAM,EACJ,OAAO,EACP,YAAY,GAAG,EAAE,EACjB,gBAAgB,GAAG,gBAAI,GACxB,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,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE5C,MAAM,UAAU,GAAG,IAAA,2BAAgB,EAAC,OAAO,EAAE,IAAA,WAAI,EAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC;IAC7E,MAAM,gBAAgB,GAAG,IAAA,sBAAW,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC5D,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAErC,KAAK,MAAM,QAAQ,IAAI,YAAY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AAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAE;aACjE,CACF,CAAC;YACF,IAAA,wBAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,aAAa,CAAE;gBAC/B,eAAe,EAAE,iBAAiB;aACnC,CAAC,CAAC;YACH,MAAM;KACT;AAEH,CAAC;AAED,SAAS,kCAAkC,CAAC,mBAAwC;;IAClF,MAAM,WAAW,GAAG,mBAAmB,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,aAAa,CAAC,CAAC;IACjG,IAAI,WAAW,EAAE;QACf,MAAM,IAAI,GAAG,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,IAAI,YAAY,kCAAuB,EAAE;YAC3C,IAAI,MAAA,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,0CAAE,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,EAAE;gBAC3D,WAAW,CAAC,MAAM,EAAE,CAAC;aACtB;SACF;KACF;AACH,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface CoerceFormSubmitOperationOptions extends Omit<CoerceOperationOptions, 'operationName'> {
|
|
4
|
-
propertyList?: DtoClassProperty[];
|
|
1
|
+
import { CoerceGetByIdControllerOptions } from './coerce-get-by-id-operation';
|
|
2
|
+
export interface CoerceFormSubmitOperationOptions extends CoerceGetByIdControllerOptions {
|
|
5
3
|
bodyDtoName?: string;
|
|
6
4
|
}
|
|
7
5
|
export declare function CoerceFormSubmitOperation(options: CoerceFormSubmitOperationOptions): import("@angular-devkit/schematics").Rule;
|
|
@@ -2,22 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceFormSubmitOperation = void 0;
|
|
4
4
|
const utilities_1 = require("@rxap/utilities");
|
|
5
|
-
const
|
|
6
|
-
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
7
|
-
const coerce_operation_1 = require("./coerce-operation");
|
|
5
|
+
const coerce_get_by_id_operation_1 = require("./coerce-get-by-id-operation");
|
|
8
6
|
function CoerceFormSubmitOperation(options) {
|
|
9
|
-
const { tsMorphTransform = utilities_1.noop,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(0,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
const { tsMorphTransform = utilities_1.noop, bodyDtoName, isReturnVoid = true,
|
|
8
|
+
// if not explicitly defined the idProperty is set to null, as not each data grid operation has an id
|
|
9
|
+
idProperty = null, operationName = idProperty ? 'submitById' : 'submit', dtoClassNameSuffix = '-submit', } = options;
|
|
10
|
+
return (0, coerce_get_by_id_operation_1.CoerceGetByIdOperation)(Object.assign(Object.assign({}, options), { operationName,
|
|
11
|
+
isReturnVoid,
|
|
12
|
+
idProperty,
|
|
13
|
+
dtoClassNameSuffix, buildOperationDtoClassName: (controllerName, { dtoClassName, dtoClassNameSuffix = '-submit' }) => {
|
|
14
|
+
return dtoClassName !== null && dtoClassName !== void 0 ? dtoClassName : (0, utilities_1.CoerceSuffix)(bodyDtoName !== null && bodyDtoName !== void 0 ? bodyDtoName : controllerName, dtoClassNameSuffix);
|
|
15
|
+
}, tsMorphTransform: (project, sourceFile, classDeclaration, controllerName, moduleSourceFile, dto) => {
|
|
16
|
+
if (!dto) {
|
|
17
|
+
throw new Error('The dto must be created for an submit operation');
|
|
18
|
+
}
|
|
19
|
+
return Object.assign({ body: dto.className, method: 'post' }, tsMorphTransform(project, sourceFile, classDeclaration, controllerName, moduleSourceFile, dto));
|
|
21
20
|
} }));
|
|
22
21
|
}
|
|
23
22
|
exports.CoerceFormSubmitOperation = CoerceFormSubmitOperation;
|
|
@@ -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,+CAGyB;AACzB
|
|
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,6EAGsC;AAMtC,SAAgB,yBAAyB,CAAC,OAAyC;IACjF,MAAM,EACJ,gBAAgB,GAAG,gBAAI,EACvB,WAAW,EACX,YAAY,GAAG,IAAI;IACnB,qGAAqG;IACrG,UAAU,GAAG,IAAI,EACjB,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EACpD,kBAAkB,GAAG,SAAS,GAC/B,GAAG,OAAO,CAAC;IAEZ,OAAO,IAAA,mDAAsB,kCACxB,OAAO,KACV,aAAa;QACb,YAAY;QACZ,UAAU;QACV,kBAAkB,EAClB,0BAA0B,EAAE,CAAC,cAAc,EAAE,EAAE,YAAY,EAAE,kBAAkB,GAAG,SAAS,EAAE,EAAE,EAAE;YAC/F,OAAO,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,IAAA,wBAAY,EAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,cAAc,EAAE,kBAAkB,CAAC,CAAC;QACzF,CAAC,EACD,gBAAgB,EAAE,CAChB,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,GAAG,EACH,EAAE;YAEF,IAAI,CAAC,GAAG,EAAE;gBACR,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;aACpE;YAED,uBACE,IAAI,EAAE,GAAG,CAAC,SAAS,EACnB,MAAM,EAAE,MAAM,IACX,gBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,GAAG,CAAC,EAClG;QAEJ,CAAC,IACD,CAAC;AAEL,CAAC;AA1CD,8DA0CC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { OperationParameter } from '@rxap/ts-morph';
|
|
2
|
+
import { ClassDeclaration, SourceFile, WriterFunction } from 'ts-morph';
|
|
3
|
+
import { CoerceDtoClassOutput } from './coerce-dto-class';
|
|
4
|
+
import { CoerceGetControllerOptions } from './coerce-get-operation';
|
|
5
|
+
import { TransformOperation } from './coerce-operation';
|
|
6
|
+
export interface CoerceGetByIdControllerOptions extends CoerceGetControllerOptions {
|
|
7
|
+
idProperty?: OperationParameter | null;
|
|
8
8
|
}
|
|
9
|
+
export declare function BuildUpstreamGetByIdParametersImplementation(classDeclaration: ClassDeclaration, moduleSourceFile: SourceFile, dto: CoerceDtoClassOutput | null, options: Readonly<CoerceGetByIdControllerOptions>): TransformOperation<string | WriterFunction>;
|
|
10
|
+
export declare function BuiltGetByIdDtoDataMapperImplementation(classDeclaration: ClassDeclaration, moduleSourceFile: SourceFile, dto: CoerceDtoClassOutput | null, options: Readonly<CoerceGetByIdControllerOptions>): TransformOperation<string | WriterFunction>;
|
|
9
11
|
export declare function CoerceGetByIdOperation(options: CoerceGetByIdControllerOptions): import("@angular-devkit/schematics").Rule;
|