@rxap/schematics-ts-morph 16.1.0-dev.2 → 16.1.0-dev.21
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 +136 -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 +102 -55
- 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 +148 -119
- 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 +68 -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 +34 -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 +30 -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,64 +1,111 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoerceGetByIdOperation = void 0;
|
|
4
|
-
const
|
|
5
|
-
const ts_morph_1 = require("
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* name = "report-details"
|
|
21
|
-
* module = undefined
|
|
22
|
-
*
|
|
23
|
-
* false:
|
|
24
|
-
* The controller ReportDetailsNotificationController should be extend with getById Operation.
|
|
25
|
-
* And the controller ise used in the module ReportDetailsModule
|
|
26
|
-
*
|
|
27
|
-
* name = "notification"
|
|
28
|
-
* module = "report-details"
|
|
29
|
-
*/
|
|
30
|
-
const isFirstBornSibling = !nestModule || nestModule === controllerName;
|
|
31
|
-
if (isFirstBornSibling && !propertyList.some(param => param.name === idProperty.name)) {
|
|
32
|
-
propertyList.unshift(idProperty);
|
|
3
|
+
exports.CoerceGetByIdOperation = exports.BuiltGetByIdDtoDataMapperImplementation = exports.BuildUpstreamGetByIdParametersImplementation = void 0;
|
|
4
|
+
const utilities_1 = require("@rxap/utilities");
|
|
5
|
+
const ts_morph_1 = require("ts-morph");
|
|
6
|
+
const coerce_get_operation_1 = require("./coerce-get-operation");
|
|
7
|
+
const dto_class_property_1 = require("./dto-class-property");
|
|
8
|
+
function BuildUpstreamGetByIdParametersImplementation(classDeclaration, moduleSourceFile, dto, options) {
|
|
9
|
+
return () => {
|
|
10
|
+
const { idProperty } = options;
|
|
11
|
+
return idProperty ? `{ parameters: { ${idProperty.name} } }` : '';
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.BuildUpstreamGetByIdParametersImplementation = BuildUpstreamGetByIdParametersImplementation;
|
|
15
|
+
function UpstreamMapper(sourceProperty, propertyList, idProperty) {
|
|
16
|
+
var _a;
|
|
17
|
+
const mapper = {};
|
|
18
|
+
if (idProperty) {
|
|
19
|
+
mapper[idProperty.name] = idProperty.name;
|
|
33
20
|
}
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
for (const property of propertyList.filter(p => !idProperty || p.name !== idProperty.name).map(p => (0, dto_class_property_1.NormalizeDataClassProperty)(p))) {
|
|
22
|
+
mapper[property.name] = `${sourceProperty}.${(_a = property.source) !== null && _a !== void 0 ? _a : property.name}`;
|
|
23
|
+
if (property.isType) {
|
|
24
|
+
// property is a complex object
|
|
25
|
+
if (property.isArray) {
|
|
26
|
+
mapper[property.name] = w => {
|
|
27
|
+
var _a;
|
|
28
|
+
w.write(`${sourceProperty}.${(_a = property.source) !== null && _a !== void 0 ? _a : property.name}.map(item => (`);
|
|
29
|
+
ts_morph_1.Writers.object(UpstreamMapper('item', property.memberList))(w);
|
|
30
|
+
w.write('))');
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
mapper[property.name] = ts_morph_1.Writers.object(UpstreamMapper(mapper[property.name], property.memberList));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
return mapper;
|
|
39
|
+
}
|
|
40
|
+
function BuiltGetByIdDtoDataMapperImplementation(classDeclaration, moduleSourceFile, dto, options) {
|
|
41
|
+
const { propertyList = [], upstream, isArray, idProperty, } = options;
|
|
42
|
+
return () => {
|
|
43
|
+
if (upstream) {
|
|
44
|
+
if (isArray) {
|
|
45
|
+
return w => {
|
|
46
|
+
w.write('data.map(item => (');
|
|
47
|
+
ts_morph_1.Writers.object(UpstreamMapper('data', propertyList, idProperty))(w);
|
|
48
|
+
w.write('))');
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return ts_morph_1.Writers.object(UpstreamMapper('data', propertyList, idProperty));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
if (isArray) {
|
|
57
|
+
return '[]';
|
|
58
|
+
}
|
|
59
|
+
if (idProperty) {
|
|
60
|
+
return `{ ${idProperty.name} }`;
|
|
61
|
+
}
|
|
62
|
+
return '{}';
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
exports.BuiltGetByIdDtoDataMapperImplementation = BuiltGetByIdDtoDataMapperImplementation;
|
|
67
|
+
function CoerceGetByIdOperation(options) {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
const { controllerName, paramList = [], propertyList = [], idProperty = { name: 'uuid', type: 'string' }, operationName = 'getById', nestModule, buildUpstreamGetParametersImplementation = BuildUpstreamGetByIdParametersImplementation, builtDtoDataMapperImplementation = BuiltGetByIdDtoDataMapperImplementation, } = options;
|
|
70
|
+
if (idProperty) {
|
|
71
|
+
/**
|
|
72
|
+
* If the module is not specified. This controller has an own module. Else the
|
|
73
|
+
* module is originated by another controller.
|
|
74
|
+
*
|
|
75
|
+
* **Example**
|
|
76
|
+
* true:
|
|
77
|
+
* The controller ReportDetailsController should be extended with getById Operation.
|
|
78
|
+
* And the controller is used in the module ReportDetailsModule
|
|
79
|
+
*
|
|
80
|
+
* name = "report-details"
|
|
81
|
+
* module = undefined
|
|
82
|
+
*
|
|
83
|
+
* false:
|
|
84
|
+
* The controller ReportDetailsNotificationController should be extend with getById Operation.
|
|
85
|
+
* And the controller ise used in the module ReportDetailsModule
|
|
86
|
+
*
|
|
87
|
+
* name = "notification"
|
|
88
|
+
* module = "report-details"
|
|
89
|
+
*/
|
|
90
|
+
const isFirstBornSibling = !nestModule || nestModule === controllerName;
|
|
91
|
+
if (isFirstBornSibling) {
|
|
92
|
+
(0, utilities_1.CoerceArrayItems)(propertyList, [{
|
|
93
|
+
name: idProperty.name,
|
|
94
|
+
type: (_a = idProperty.type) !== null && _a !== void 0 ? _a : 'string',
|
|
95
|
+
isArray: idProperty.isArray,
|
|
96
|
+
}], (a, b) => a.name === b.name, true);
|
|
97
|
+
}
|
|
98
|
+
(0, utilities_1.CoerceArrayItems)(paramList, [{
|
|
99
|
+
name: idProperty.name,
|
|
100
|
+
type: idProperty.type,
|
|
101
|
+
fromParent: (_b = idProperty.fromParent) !== null && _b !== void 0 ? _b : !isFirstBornSibling,
|
|
102
|
+
}], (a, b) => a.name === b.name, true);
|
|
44
103
|
}
|
|
45
|
-
return (0,
|
|
46
|
-
controllerName,
|
|
104
|
+
return (0, coerce_get_operation_1.CoerceGetOperation)(Object.assign(Object.assign({}, options), { operationName,
|
|
47
105
|
paramList,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
name: controllerName,
|
|
52
|
-
propertyList,
|
|
53
|
-
});
|
|
54
|
-
(0, ts_morph_1.CoerceImports)(sourceFile, {
|
|
55
|
-
namedImports: [dtoClassName],
|
|
56
|
-
moduleSpecifier: dtoFilePath,
|
|
57
|
-
});
|
|
58
|
-
return {
|
|
59
|
-
returnType: dtoClassName + (isArray ? '[]' : ''),
|
|
60
|
-
};
|
|
61
|
-
} }));
|
|
106
|
+
propertyList,
|
|
107
|
+
buildUpstreamGetParametersImplementation,
|
|
108
|
+
builtDtoDataMapperImplementation }));
|
|
62
109
|
}
|
|
63
110
|
exports.CoerceGetByIdOperation = CoerceGetByIdOperation;
|
|
64
111
|
//# sourceMappingURL=coerce-get-by-id-operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-get-by-id-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-by-id-operation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"coerce-get-by-id-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-by-id-operation.ts"],"names":[],"mappings":";;;AACA,+CAAmD;AACnD,uCAKkB;AAElB,iEAGgC;AAEhC,6DAG8B;AAM9B,SAAgB,4CAA4C,CAC1D,gBAAkC,EAClC,gBAA4B,EAC5B,GAAgC,EAChC,OAAiD;IAEjD,OAAO,GAAG,EAAE;QACV,MAAM,EAAE,UAAU,EAAC,GAAG,OAAO,CAAC;QAC9B,OAAO,UAAU,CAAC,CAAC,CAAC,mBAAoB,UAAU,CAAC,IAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,CAAC,CAAC;AACJ,CAAC;AAVD,oGAUC;AAED,SAAS,cAAc,CAAC,cAAsB,EAAE,YAAgC,EAAE,UAAsC;;IACtH,MAAM,MAAM,GAA4C,EAAE,CAAC;IAC3D,IAAI,UAAU,EAAE;QACd,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,UAAU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AAE,MAAA,UAAU,CAAC,IAAI,mCAAI,QAAQ;oBACjC,OAAO,EAAE,UAAU,CAAC,OAAO;iBAC5B,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SACxC;QAED,IAAA,4BAAgB,EAAC,SAAS,EAAC,CAAC;gBAC1B,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,UAAU,EAAE,MAAA,UAAU,CAAC,UAAU,mCAAI,CAAC,kBAAkB;aACzD,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KAExC;IAED,OAAO,IAAA,yCAAkB,kCACpB,OAAO,KACV,aAAa;QACb,SAAS;QACT,YAAY;QACZ,wCAAwC;QACxC,gCAAgC,IAChC,CAAC;AAEL,CAAC;AA3DD,wDA2DC"}
|
|
@@ -1,53 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceGetChildrenOperation = void 0;
|
|
4
|
-
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
4
|
const utilities_1 = require("@rxap/utilities");
|
|
6
|
-
const
|
|
7
|
-
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
8
|
-
const coerce_operation_1 = require("./coerce-operation");
|
|
9
|
-
const table_query_list_1 = require("./table-query-list");
|
|
5
|
+
const coerce_get_root_operation_1 = require("./coerce-get-root-operation");
|
|
10
6
|
function CoerceGetChildrenOperation(options) {
|
|
11
|
-
const {
|
|
12
|
-
|
|
13
|
-
(0, utilities_1.CoerceArrayItems)(propertyList, [
|
|
7
|
+
const { paramList = [], operationName = 'get-children', } = options;
|
|
8
|
+
(0, utilities_1.CoerceArrayItems)(paramList, [
|
|
14
9
|
{
|
|
15
|
-
name: '
|
|
16
|
-
type: '
|
|
17
|
-
}
|
|
18
|
-
{
|
|
19
|
-
name: 'children',
|
|
20
|
-
type: '<self>',
|
|
21
|
-
isArray: true,
|
|
22
|
-
isOptional: true,
|
|
23
|
-
isType: true,
|
|
24
|
-
},
|
|
10
|
+
name: 'parentUuid',
|
|
11
|
+
type: 'string',
|
|
12
|
+
}
|
|
25
13
|
], (a, b) => a.name === b.name);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
name: 'parentUuid',
|
|
29
|
-
type: 'string',
|
|
30
|
-
});
|
|
31
|
-
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), {
|
|
32
|
-
// TODO : remove after migration to controllerName
|
|
33
|
-
controllerName, operationName: 'get-children', paramList, tsMorphTransform: (project, sourceFile, classDeclaration, controllerName) => {
|
|
34
|
-
const { className, filePath, } = (0, coerce_dto_class_1.CoerceDtoClass)({
|
|
35
|
-
project,
|
|
36
|
-
name: (0, schematics_utilities_1.CoerceSuffix)(controllerName, '-item'),
|
|
37
|
-
propertyList,
|
|
38
|
-
});
|
|
39
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, [
|
|
40
|
-
{
|
|
41
|
-
namedImports: ['FilterQuery', 'FilterQueryPipe'],
|
|
42
|
-
moduleSpecifier: '@rxap/nest-utilities',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
namedImports: [className],
|
|
46
|
-
moduleSpecifier: filePath,
|
|
47
|
-
},
|
|
48
|
-
]);
|
|
49
|
-
return Object.assign({ queryList: table_query_list_1.TABLE_QUERY_LIST, returnType: className + '[]' }, tsMorphTransform(project, sourceFile, classDeclaration, controllerName));
|
|
50
|
-
} }));
|
|
14
|
+
return (0, coerce_get_root_operation_1.CoerceGetRootOperation)(Object.assign(Object.assign({}, options), { operationName,
|
|
15
|
+
paramList }));
|
|
51
16
|
}
|
|
52
17
|
exports.CoerceGetChildrenOperation = CoerceGetChildrenOperation;
|
|
53
18
|
//# sourceMappingURL=coerce-get-children-operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-get-children-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-children-operation.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"coerce-get-children-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-children-operation.ts"],"names":[],"mappings":";;;AAAA,+CAAmD;AACnD,2EAGqC;AAIrC,SAAgB,0BAA0B,CAAC,OAAoD;IAC7F,MAAM,EACJ,SAAS,GAAG,EAAE,EACd,aAAa,GAAG,cAAc,GAC/B,GAAG,OAAO,CAAC;IACZ,IAAA,4BAAgB,EAAC,SAAS,EAAE;QAC1B;YACA,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;SACb;KACF,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,IAAA,kDAAsB,kCACxB,OAAO,KACV,aAAa;QACb,SAAS,IACT,CAAC;AACL,CAAC;AAhBD,gEAgBC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { CoerceGetByIdControllerOptions } from './coerce-get-by-id-operation';
|
|
2
|
+
export interface CoerceGetDataGridOperationOptions extends CoerceGetByIdControllerOptions {
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated use isArray instead
|
|
5
|
+
*/
|
|
4
6
|
collection?: boolean;
|
|
5
|
-
propertyList?: DtoClassProperty[];
|
|
6
7
|
}
|
|
7
8
|
export declare function CoerceGetDataGridOperation(options: Readonly<CoerceGetDataGridOperationOptions>): import("@angular-devkit/schematics").Rule;
|
|
@@ -1,29 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceGetDataGridOperation = void 0;
|
|
4
|
-
const
|
|
5
|
-
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
6
|
-
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
7
|
-
const coerce_operation_1 = require("./coerce-operation");
|
|
4
|
+
const coerce_get_by_id_operation_1 = require("./coerce-get-by-id-operation");
|
|
8
5
|
function CoerceGetDataGridOperation(options) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), { controllerName, operationName: 'get', tsMorphTransform: (project, sourceFile, classDeclaration, controllerName) => {
|
|
16
|
-
const { className: dtoClassName, filePath: dtoFilePath, } = (0, coerce_dto_class_1.CoerceDtoClass)({
|
|
17
|
-
project,
|
|
18
|
-
name: controllerName,
|
|
19
|
-
propertyList,
|
|
20
|
-
});
|
|
21
|
-
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
22
|
-
namedImports: [dtoClassName],
|
|
23
|
-
moduleSpecifier: dtoFilePath,
|
|
24
|
-
});
|
|
25
|
-
return Object.assign({ returnType: dtoClassName + (collection ? '[]' : '') }, tsMorphTransform(project, sourceFile, classDeclaration, controllerName));
|
|
26
|
-
} }));
|
|
6
|
+
const { collection = false, isArray = collection !== null && collection !== void 0 ? collection : false,
|
|
7
|
+
// if not explicitly defined the idProperty is set to null, as not each data grid operation has an id
|
|
8
|
+
idProperty = null, operationName = idProperty ? 'getById' : 'get', } = options;
|
|
9
|
+
return (0, coerce_get_by_id_operation_1.CoerceGetByIdOperation)(Object.assign(Object.assign({}, options), { operationName,
|
|
10
|
+
idProperty,
|
|
11
|
+
isArray }));
|
|
27
12
|
}
|
|
28
13
|
exports.CoerceGetDataGridOperation = CoerceGetDataGridOperation;
|
|
29
14
|
//# sourceMappingURL=coerce-get-data-grid-operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-get-data-grid-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-data-grid-operation.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"coerce-get-data-grid-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-data-grid-operation.ts"],"names":[],"mappings":";;;AAAA,6EAGsC;AAStC,SAAgB,0BAA0B,CAAC,OAAoD;IAC7F,MAAM,EACJ,UAAU,GAAE,KAAK,EACjB,OAAO,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,KAAK;IAC7B,qGAAqG;IACrG,UAAU,GAAG,IAAI,EACjB,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,GAC/C,GAAG,OAAO,CAAC;IAEZ,OAAO,IAAA,mDAAsB,kCACxB,OAAO,KACV,aAAa;QACb,UAAU;QACV,OAAO,IACP,CAAC;AAEL,CAAC;AAhBD,gEAgBC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CoerceOperationOptions } from './coerce-operation';
|
|
2
|
+
export interface CoerceGetControllerOptions extends Omit<CoerceOperationOptions, 'operationName'> {
|
|
3
|
+
operationName?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function CoerceGetOperation<Options = Record<string, any>>(options: CoerceGetControllerOptions): import("@angular-devkit/schematics").Rule;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoerceGetOperation = void 0;
|
|
4
|
+
const coerce_operation_1 = require("./coerce-operation");
|
|
5
|
+
function CoerceGetOperation(options) {
|
|
6
|
+
const { operationName = 'get', isReturnVoid = false } = options;
|
|
7
|
+
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), { operationName,
|
|
8
|
+
isReturnVoid }));
|
|
9
|
+
}
|
|
10
|
+
exports.CoerceGetOperation = CoerceGetOperation;
|
|
11
|
+
//# sourceMappingURL=coerce-get-operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coerce-get-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/ts-morph/src/lib/nest/coerce-get-operation.ts"],"names":[],"mappings":";;;AAAA,yDAG4B;AAM5B,SAAgB,kBAAkB,CAAgC,OAAmC;IACnG,MAAM,EACJ,aAAa,GAAG,KAAK,EACrB,YAAY,GAAG,KAAK,EACrB,GAAG,OAAO,CAAC;IAEZ,OAAO,IAAA,kCAAe,kCACjB,OAAO,KACV,aAAa;QACb,YAAY,IACZ,CAAC;AAEL,CAAC;AAZD,gDAYC"}
|
|
@@ -1,41 +1,30 @@
|
|
|
1
|
-
import { NormalizedUpstreamOptions, TypeImport } from '@rxap/ts-morph';
|
|
2
|
-
import { ClassDeclaration, Project, SourceFile } from 'ts-morph';
|
|
1
|
+
import { DataProperty, NormalizedUpstreamOptions, TypeImport } from '@rxap/ts-morph';
|
|
2
|
+
import { ClassDeclaration, Project, SourceFile, WriterFunction } from 'ts-morph';
|
|
3
3
|
import { OperationOptions } from './add-operation-to-controller';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* the property name of the source object. if not defined the name will be used
|
|
11
|
-
*/
|
|
12
|
-
source?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface CoerceGetPageOperationOptions extends Omit<Omit<CoerceOperationOptions, 'operationName'>, 'tsMorphTransform'> {
|
|
15
|
-
propertyList: GetPageOperationProperty[];
|
|
16
|
-
tsMorphTransform?: (project: Project, sourceFile: SourceFile, classDeclaration: ClassDeclaration, controllerName: string, pageClassName: string, rowClassName: string) => Partial<OperationOptions>;
|
|
4
|
+
import { CoerceDtoClassOutput } from './coerce-dto-class';
|
|
5
|
+
import { CoerceOperationOptions, TransformOperation } from './coerce-operation';
|
|
6
|
+
import { DtoClassProperty } from './dto-class-property';
|
|
7
|
+
export interface CoerceGetPageOperationOptions extends Omit<CoerceOperationOptions, 'operationName' | 'tsMorphTransform' | 'coerceOperationDtoClass'> {
|
|
8
|
+
tsMorphTransform?: (project: Project, sourceFile: SourceFile, classDeclaration: ClassDeclaration, controllerName: string, moduleSourceFile: SourceFile, pageClassName: string, rowClassName: string) => Partial<OperationOptions>;
|
|
17
9
|
/**
|
|
18
10
|
* the name of the property used as row id value. defaults to the value 'uuid'. If null the __rowId property will be
|
|
19
11
|
* set to the absolute row index absolute row index = page * pageSize + rowIndex
|
|
20
12
|
*/
|
|
21
|
-
rowIdProperty?:
|
|
13
|
+
rowIdProperty?: DataProperty;
|
|
22
14
|
operationName?: string;
|
|
23
|
-
/**
|
|
24
|
-
* true - the suffix '-table' will not be enforced for the controller name
|
|
25
|
-
*/
|
|
26
|
-
skipCoerceTableSuffix?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* The base name of the page and row DTO class name. Defaults to the controller name
|
|
29
|
-
*/
|
|
30
|
-
responseDtoName?: string;
|
|
31
15
|
coerceToRowDtoMethod?: (sourceFile: SourceFile, classDeclaration: ClassDeclaration, rowClassName: string, options: CoerceGetPageOperationOptions) => void;
|
|
32
16
|
coerceToPageDtoMethod?: (sourceFile: SourceFile, classDeclaration: ClassDeclaration, pageClassName: string, rowClassName: string, options: CoerceGetPageOperationOptions) => void;
|
|
33
|
-
coerceGetPageDataMethod?: (sourceFile: SourceFile, classDeclaration: ClassDeclaration, options: CoerceGetPageOperationOptions) => void;
|
|
17
|
+
coerceGetPageDataMethod?: (sourceFile: SourceFile, classDeclaration: ClassDeclaration, moduleSourceFile: SourceFile, options: CoerceGetPageOperationOptions) => void;
|
|
18
|
+
coerceOperationDtoClass?: (classDeclaration: ClassDeclaration, controllerName: string, moduleSourceFile: SourceFile, options: Readonly<CoerceGetPageOperationOptions>) => CoerceDtoClassOutput | null;
|
|
34
19
|
upstream?: NormalizedUpstreamOptions | null;
|
|
35
20
|
}
|
|
36
|
-
export declare function
|
|
37
|
-
export declare function GetPageOperationColumnToCodeText(property: GetPageOperationProperty): string;
|
|
21
|
+
export declare function GetPageOperationColumnToCodeText(property: DtoClassProperty): string;
|
|
38
22
|
export declare function CoerceToRowDtoMethod(sourceFile: SourceFile, classDeclaration: ClassDeclaration, rowClassName: string, options: CoerceGetPageOperationOptions): void;
|
|
39
23
|
export declare function CoerceToPageDtoMethod(sourceFile: SourceFile, classDeclaration: ClassDeclaration, pageClassName: string, rowClassName: string, options: CoerceGetPageOperationOptions): void;
|
|
40
|
-
export declare function CoerceGetPageDataMethod(sourceFile: SourceFile, classDeclaration: ClassDeclaration,
|
|
24
|
+
export declare function CoerceGetPageDataMethod(sourceFile: SourceFile, classDeclaration: ClassDeclaration, moduleSourceFile: SourceFile, options: CoerceGetPageOperationOptions): void;
|
|
25
|
+
export declare function GetResponseTypeFromUpstream(upstream: NormalizedUpstreamOptions): TypeImport;
|
|
26
|
+
export declare function GetRawRowDataType(options: Readonly<CoerceGetPageOperationOptions>): TypeImport;
|
|
27
|
+
export declare function BuildGetPageUpstreamGetDataImplementation(classDeclaration: ClassDeclaration, moduleSourceFile: SourceFile, dto: CoerceDtoClassOutput | null, options: Readonly<CoerceOperationOptions>): TransformOperation;
|
|
28
|
+
export declare function CoerceGetPageOperationDtoClass(classDeclaration: ClassDeclaration, controllerName: string, moduleSourceFile: SourceFile, options: Readonly<CoerceGetPageOperationOptions>): CoerceDtoClassOutput | null;
|
|
29
|
+
export declare function BuiltGetPageDtoDataMapperImplementation(classDeclaration: ClassDeclaration, moduleSourceFile: SourceFile, dto: CoerceDtoClassOutput | null, options: Readonly<CoerceOperationOptions>): TransformOperation<string | WriterFunction>;
|
|
41
30
|
export declare function CoerceGetPageOperation(options: Readonly<CoerceGetPageOperationOptions>): import("@angular-devkit/schematics").Rule;
|