@rxap/schematics-ts-morph 16.0.0-dev.1 → 16.0.0-dev.2
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 +96 -79
- package/README.md +1 -1
- package/package.json +4 -3
- package/src/index.d.ts +4 -55
- package/src/index.js +4 -57
- package/src/index.js.map +1 -1
- package/src/lib/add-component-animations.js +2 -1
- package/src/lib/add-component-animations.js.map +1 -1
- package/src/lib/add-component-input.js +4 -3
- package/src/lib/add-component-input.js.map +1 -1
- package/src/lib/add-component-provider.js +2 -1
- package/src/lib/add-component-provider.js.map +1 -1
- package/src/lib/add-dependency-injection.js +4 -3
- package/src/lib/add-dependency-injection.js.map +1 -1
- package/src/lib/add-fake-provider.js +3 -2
- package/src/lib/add-fake-provider.js.map +1 -1
- package/src/lib/add-method-class.js +3 -2
- package/src/lib/add-method-class.js.map +1 -1
- package/src/lib/add-ng-module-import.js +2 -1
- package/src/lib/add-ng-module-import.js.map +1 -1
- package/src/lib/add-ng-module-provider.js +2 -1
- package/src/lib/add-ng-module-provider.js.map +1 -1
- package/src/lib/add-operation-to-controller.d.ts +33 -0
- package/src/lib/add-operation-to-controller.js +197 -0
- package/src/lib/add-operation-to-controller.js.map +1 -0
- package/src/lib/add-variable-provider.js +3 -2
- package/src/lib/add-variable-provider.js.map +1 -1
- package/src/lib/angular/build-angular-base-path.d.ts +8 -0
- package/src/lib/angular/build-angular-base-path.js +15 -0
- package/src/lib/angular/build-angular-base-path.js.map +1 -0
- package/src/lib/angular/coerce-accordion-component.d.ts +7 -0
- package/src/lib/angular/coerce-accordion-component.js +21 -0
- package/src/lib/angular/coerce-accordion-component.js.map +1 -0
- package/src/lib/angular/coerce-component-class.d.ts +8 -0
- package/src/lib/angular/coerce-component-class.js +39 -0
- package/src/lib/angular/coerce-component-class.js.map +1 -0
- package/src/lib/angular/coerce-component.d.ts +15 -0
- package/src/lib/angular/coerce-component.js +41 -0
- package/src/lib/angular/coerce-component.js.map +1 -0
- package/src/lib/angular/coerce-data-source-class.d.ts +10 -0
- package/src/lib/angular/coerce-data-source-class.js +42 -0
- package/src/lib/angular/coerce-data-source-class.js.map +1 -0
- package/src/lib/angular/coerce-form-builder-provider.d.ts +10 -0
- package/src/lib/angular/coerce-form-builder-provider.js +35 -0
- package/src/lib/angular/coerce-form-builder-provider.js.map +1 -0
- package/src/lib/angular/coerce-form-component-provider.d.ts +10 -0
- package/src/lib/angular/coerce-form-component-provider.js +37 -0
- package/src/lib/angular/coerce-form-component-provider.js.map +1 -0
- package/src/lib/angular/coerce-form-definition.d.ts +19 -0
- package/src/lib/angular/coerce-form-definition.js +94 -0
- package/src/lib/angular/coerce-form-definition.js.map +1 -0
- package/src/lib/angular/coerce-form-provider.d.ts +10 -0
- package/src/lib/angular/coerce-form-provider.js +36 -0
- package/src/lib/angular/coerce-form-provider.js.map +1 -0
- package/src/lib/angular/coerce-form-providers-file.d.ts +7 -0
- package/src/lib/angular/coerce-form-providers-file.js +84 -0
- package/src/lib/angular/coerce-form-providers-file.js.map +1 -0
- package/src/lib/angular/coerce-form-table-action.d.ts +5 -0
- package/src/lib/angular/coerce-form-table-action.js +82 -0
- package/src/lib/angular/coerce-form-table-action.js.map +1 -0
- package/src/lib/angular/coerce-method-class.d.ts +11 -0
- package/src/lib/angular/coerce-method-class.js +52 -0
- package/src/lib/angular/coerce-method-class.js.map +1 -0
- package/src/lib/angular/coerce-navigation-table-action.d.ts +5 -0
- package/src/lib/angular/coerce-navigation-table-action.js +64 -0
- package/src/lib/angular/coerce-navigation-table-action.js.map +1 -0
- package/src/lib/angular/coerce-operation-table-action.d.ts +5 -0
- package/src/lib/angular/coerce-operation-table-action.js +33 -0
- package/src/lib/angular/coerce-operation-table-action.js.map +1 -0
- package/src/lib/angular/coerce-project-feature.d.ts +6 -0
- package/src/lib/angular/coerce-project-feature.js +19 -0
- package/src/lib/angular/coerce-project-feature.js.map +1 -0
- package/src/lib/angular/coerce-proxy-remote-method-class.d.ts +13 -0
- package/src/lib/angular/coerce-proxy-remote-method-class.js +90 -0
- package/src/lib/angular/coerce-proxy-remote-method-class.js.map +1 -0
- package/src/lib/angular/coerce-table-action-index-provider.d.ts +5 -0
- package/src/lib/angular/coerce-table-action-index-provider.js +27 -0
- package/src/lib/angular/coerce-table-action-index-provider.js.map +1 -0
- package/src/lib/angular/coerce-table-action-index.d.ts +4 -0
- package/src/lib/angular/coerce-table-action-index.js +16 -0
- package/src/lib/angular/coerce-table-action-index.js.map +1 -0
- package/src/lib/angular/coerce-table-action-provider.d.ts +8 -0
- package/src/lib/angular/coerce-table-action-provider.js +49 -0
- package/src/lib/angular/coerce-table-action-provider.js.map +1 -0
- package/src/lib/angular/coerce-table-action.d.ts +13 -0
- package/src/lib/angular/coerce-table-action.js +70 -0
- package/src/lib/angular/coerce-table-action.js.map +1 -0
- package/src/lib/angular/coerce-table-parameters-from-route.d.ts +6 -0
- package/src/lib/angular/coerce-table-parameters-from-route.js +48 -0
- package/src/lib/angular/coerce-table-parameters-from-route.js.map +1 -0
- package/src/lib/angular/coerce-tree-table-children-proxy-remote-method-class.d.ts +5 -0
- package/src/lib/angular/coerce-tree-table-children-proxy-remote-method-class.js +31 -0
- package/src/lib/angular/coerce-tree-table-children-proxy-remote-method-class.js.map +1 -0
- package/src/lib/angular/coerce-tree-table-root-proxy-remote-method-class.d.ts +5 -0
- package/src/lib/angular/coerce-tree-table-root-proxy-remote-method-class.js +31 -0
- package/src/lib/angular/coerce-tree-table-root-proxy-remote-method-class.js.map +1 -0
- package/src/lib/angular/has-accordion-component.d.ts +6 -0
- package/src/lib/angular/has-accordion-component.js +20 -0
- package/src/lib/angular/has-accordion-component.js.map +1 -0
- package/src/lib/angular/has-component.d.ts +8 -0
- package/src/lib/angular/has-component.js +26 -0
- package/src/lib/angular/has-component.js.map +1 -0
- package/src/lib/angular/has-project-feature.d.ts +5 -0
- package/src/lib/angular/has-project-feature.js +15 -0
- package/src/lib/angular/has-project-feature.js.map +1 -0
- package/src/lib/angular/has-table-component.d.ts +8 -0
- package/src/lib/angular/has-table-component.js +19 -0
- package/src/lib/angular/has-table-component.js.map +1 -0
- package/src/lib/angular/index.d.ts +26 -0
- package/src/lib/angular/index.js +30 -0
- package/src/lib/angular/index.js.map +1 -0
- package/src/lib/coerce-class-method.d.ts +1 -1
- package/src/lib/coerce-class-method.js +3 -2
- package/src/lib/coerce-class-method.js.map +1 -1
- package/src/lib/create-dto-class.d.ts +10 -0
- package/src/lib/create-dto-class.js +127 -0
- package/src/lib/create-dto-class.js.map +1 -0
- package/src/lib/get-form-providers-source-file.js +2 -1
- package/src/lib/get-form-providers-source-file.js.map +1 -1
- package/src/lib/index.d.ts +48 -0
- package/src/lib/index.js +52 -0
- package/src/lib/index.js.map +1 -0
- package/src/lib/{nestjs → nest}/add-nest-controller.js +2 -1
- package/src/lib/nest/add-nest-controller.js.map +1 -0
- package/src/lib/{nestjs → nest}/add-nest-module-controller.js +2 -1
- package/src/lib/nest/add-nest-module-controller.js.map +1 -0
- package/src/lib/{nestjs → nest}/add-nest-module-import.js +2 -1
- package/src/lib/nest/add-nest-module-import.js.map +1 -0
- package/src/lib/{nestjs → nest}/add-nest-module-provider.js +2 -1
- package/src/lib/nest/add-nest-module-provider.js.map +1 -0
- package/src/lib/nest/add-nest-module-to-app-module.d.ts +8 -0
- package/src/lib/nest/add-nest-module-to-app-module.js +18 -0
- package/src/lib/nest/add-nest-module-to-app-module.js.map +1 -0
- package/src/lib/nest/add-nest-provider-to-array.js.map +1 -0
- package/src/lib/nest/build-nest-base-path.d.ts +8 -0
- package/src/lib/nest/build-nest-base-path.js +17 -0
- package/src/lib/nest/build-nest-base-path.js.map +1 -0
- package/src/lib/nest/build-nest-controller-name.d.ts +9 -0
- package/src/lib/nest/build-nest-controller-name.js +23 -0
- package/src/lib/nest/build-nest-controller-name.js.map +1 -0
- package/src/lib/nest/coerce-dto-class.d.ts +9 -0
- package/src/lib/nest/coerce-dto-class.js +118 -0
- package/src/lib/nest/coerce-dto-class.js.map +1 -0
- package/src/lib/nest/coerce-form-submit-operation.d.ts +6 -0
- package/src/lib/nest/coerce-form-submit-operation.js +22 -0
- package/src/lib/nest/coerce-form-submit-operation.js.map +1 -0
- package/src/lib/nest/coerce-get-by-id-operation.d.ts +17 -0
- package/src/lib/nest/coerce-get-by-id-operation.js +66 -0
- package/src/lib/nest/coerce-get-by-id-operation.js.map +1 -0
- package/src/lib/nest/coerce-get-children-operation.d.ts +4 -0
- package/src/lib/nest/coerce-get-children-operation.js +55 -0
- package/src/lib/nest/coerce-get-children-operation.js.map +1 -0
- package/src/lib/nest/coerce-get-data-grid-operation.d.ts +7 -0
- package/src/lib/nest/coerce-get-data-grid-operation.js +33 -0
- package/src/lib/nest/coerce-get-data-grid-operation.js.map +1 -0
- package/src/lib/nest/coerce-get-page-operation.d.ts +8 -0
- package/src/lib/nest/coerce-get-page-operation.js +117 -0
- package/src/lib/nest/coerce-get-page-operation.js.map +1 -0
- package/src/lib/nest/coerce-get-root-operation.d.ts +4 -0
- package/src/lib/nest/coerce-get-root-operation.js +50 -0
- package/src/lib/nest/coerce-get-root-operation.js.map +1 -0
- package/src/lib/nest/coerce-nest-controller.d.ts +10 -0
- package/src/lib/nest/coerce-nest-controller.js +34 -0
- package/src/lib/nest/coerce-nest-controller.js.map +1 -0
- package/src/lib/nest/coerce-nest-module.d.ts +8 -0
- package/src/lib/nest/coerce-nest-module.js +28 -0
- package/src/lib/nest/coerce-nest-module.js.map +1 -0
- package/src/lib/nest/coerce-nest-service-project.d.ts +7 -0
- package/src/lib/nest/coerce-nest-service-project.js +33 -0
- package/src/lib/nest/coerce-nest-service-project.js.map +1 -0
- package/src/lib/nest/coerce-operation.d.ts +27 -0
- package/src/lib/nest/coerce-operation.js +80 -0
- package/src/lib/nest/coerce-operation.js.map +1 -0
- package/src/lib/nest/coerce-page-dto-class.d.ts +12 -0
- package/src/lib/nest/coerce-page-dto-class.js +29 -0
- package/src/lib/nest/coerce-page-dto-class.js.map +1 -0
- package/src/lib/nest/coerce-row-dto-class.d.ts +10 -0
- package/src/lib/nest/coerce-row-dto-class.js +13 -0
- package/src/lib/nest/coerce-row-dto-class.js.map +1 -0
- package/src/lib/nest/coerce-submit-data-grid-operation.d.ts +5 -0
- package/src/lib/nest/coerce-submit-data-grid-operation.js +23 -0
- package/src/lib/nest/coerce-submit-data-grid-operation.js.map +1 -0
- package/src/lib/nest/find-nest-module-declaration.js.map +1 -0
- package/src/lib/nest/find-nest-module-source-file.js.map +1 -0
- package/src/lib/nest/get-nest-module-metadata.js.map +1 -0
- package/src/lib/nest/has-nest-controller.d.ts +10 -0
- package/src/lib/nest/has-nest-controller.js +17 -0
- package/src/lib/nest/has-nest-controller.js.map +1 -0
- package/src/lib/nest/has-nest-module-class.js.map +1 -0
- package/src/lib/nest/has-nest-module.d.ts +8 -0
- package/src/lib/nest/has-nest-module.js +18 -0
- package/src/lib/nest/has-nest-module.js.map +1 -0
- package/src/lib/nest/index.d.ts +31 -0
- package/src/lib/nest/index.js +35 -0
- package/src/lib/nest/index.js.map +1 -0
- package/src/lib/nest/is-nest-module-class.js.map +1 -0
- package/src/lib/nest/nest-provider-object.js.map +1 -0
- package/src/lib/nest/project-utilities.d.ts +11 -0
- package/src/lib/nest/project-utilities.js +24 -0
- package/src/lib/nest/project-utilities.js.map +1 -0
- package/src/lib/operation-id-utilities.d.ts +14 -0
- package/src/lib/operation-id-utilities.js +59 -0
- package/src/lib/operation-id-utilities.js.map +1 -0
- package/src/lib/{apply-ts-morph-project.d.ts → ts-morph/apply-ts-morph-project.d.ts} +1 -1
- package/src/lib/{apply-ts-morph-project.js → ts-morph/apply-ts-morph-project.js} +5 -11
- package/src/lib/ts-morph/apply-ts-morph-project.js.map +1 -0
- package/src/lib/ts-morph/coerce-class-implementation.d.ts +2 -0
- package/src/lib/ts-morph/coerce-class-implementation.js +10 -0
- package/src/lib/ts-morph/coerce-class-implementation.js.map +1 -0
- package/src/lib/ts-morph/coerce-class-property.d.ts +2 -0
- package/src/lib/ts-morph/coerce-class-property.js +12 -0
- package/src/lib/ts-morph/coerce-class-property.js.map +1 -0
- package/src/lib/ts-morph/coerce-decorator.d.ts +9 -0
- package/src/lib/ts-morph/coerce-decorator.js +22 -0
- package/src/lib/ts-morph/coerce-decorator.js.map +1 -0
- package/src/lib/ts-morph/coerce-function.d.ts +2 -0
- package/src/lib/ts-morph/coerce-function.js +10 -0
- package/src/lib/ts-morph/coerce-function.js.map +1 -0
- package/src/lib/ts-morph/coerce-imports.d.ts +2 -0
- package/src/lib/ts-morph/coerce-imports.js +25 -0
- package/src/lib/ts-morph/coerce-imports.js.map +1 -0
- package/src/lib/ts-morph/coerce-interface.d.ts +2 -0
- package/src/lib/ts-morph/coerce-interface.js +15 -0
- package/src/lib/ts-morph/coerce-interface.js.map +1 -0
- package/src/lib/ts-morph/coerce-parameter-declaration.d.ts +2 -0
- package/src/lib/ts-morph/coerce-parameter-declaration.js +13 -0
- package/src/lib/ts-morph/coerce-parameter-declaration.js.map +1 -0
- package/src/lib/ts-morph/coerce-statements.d.ts +2 -0
- package/src/lib/ts-morph/coerce-statements.js +11 -0
- package/src/lib/ts-morph/coerce-statements.js.map +1 -0
- package/src/lib/ts-morph/find-function.d.ts +6 -0
- package/src/lib/ts-morph/find-function.js +8 -0
- package/src/lib/ts-morph/find-function.js.map +1 -0
- package/src/lib/ts-morph/index.d.ts +10 -0
- package/src/lib/ts-morph/index.js +14 -0
- package/src/lib/ts-morph/index.js.map +1 -0
- package/src/lib/ts-morph-transform.d.ts +15 -0
- package/src/lib/ts-morph-transform.js +46 -0
- package/src/lib/ts-morph-transform.js.map +1 -0
- package/src/lib/apply-ts-morph-project.js.map +0 -1
- package/src/lib/coerce-method-class.d.ts +0 -3
- package/src/lib/coerce-method-class.js +0 -14
- package/src/lib/coerce-method-class.js.map +0 -1
- package/src/lib/nestjs/add-nest-controller.js.map +0 -1
- package/src/lib/nestjs/add-nest-module-controller.js.map +0 -1
- package/src/lib/nestjs/add-nest-module-import.js.map +0 -1
- package/src/lib/nestjs/add-nest-module-provider.js.map +0 -1
- package/src/lib/nestjs/add-nest-provider-to-array.js.map +0 -1
- package/src/lib/nestjs/find-nest-module-declaration.js.map +0 -1
- package/src/lib/nestjs/find-nest-module-source-file.js.map +0 -1
- package/src/lib/nestjs/get-nest-module-metadata.js.map +0 -1
- package/src/lib/nestjs/has-nest-module-class.js.map +0 -1
- package/src/lib/nestjs/is-nest-module-class.js.map +0 -1
- package/src/lib/nestjs/nest-provider-object.js.map +0 -1
- /package/src/lib/{nestjs → nest}/add-nest-controller.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/add-nest-module-controller.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/add-nest-module-import.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/add-nest-module-provider.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/add-nest-provider-to-array.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/add-nest-provider-to-array.js +0 -0
- /package/src/lib/{nestjs → nest}/find-nest-module-declaration.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/find-nest-module-declaration.js +0 -0
- /package/src/lib/{nestjs → nest}/find-nest-module-source-file.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/find-nest-module-source-file.js +0 -0
- /package/src/lib/{nestjs → nest}/get-nest-module-metadata.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/get-nest-module-metadata.js +0 -0
- /package/src/lib/{nestjs → nest}/has-nest-module-class.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/has-nest-module-class.js +0 -0
- /package/src/lib/{nestjs → nest}/is-nest-module-class.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/is-nest-module-class.js +0 -0
- /package/src/lib/{nestjs → nest}/nest-provider-object.d.ts +0 -0
- /package/src/lib/{nestjs → nest}/nest-provider-object.js +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoerceTableActionRule = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const coerce_method_class_1 = require("./coerce-method-class");
|
|
6
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
|
+
const coerce_class_implementation_1 = require("../ts-morph/coerce-class-implementation");
|
|
8
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
9
|
+
const coerce_table_action_index_1 = require("./coerce-table-action-index");
|
|
10
|
+
const coerce_table_action_index_provider_1 = require("./coerce-table-action-index-provider");
|
|
11
|
+
const coerce_table_action_provider_1 = require("./coerce-table-action-provider");
|
|
12
|
+
const coerce_decorator_1 = require("../ts-morph/coerce-decorator");
|
|
13
|
+
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
14
|
+
function CoerceTableActionRule(options) {
|
|
15
|
+
let { tableName, actionType, refresh, confirm, tooltip, errorMessage, successMessage, priority, checkFunction, tsMorphTransform, } = options;
|
|
16
|
+
tsMorphTransform !== null && tsMorphTransform !== void 0 ? tsMorphTransform : (tsMorphTransform = () => ({}));
|
|
17
|
+
refresh !== null && refresh !== void 0 ? refresh : (refresh = false);
|
|
18
|
+
confirm !== null && confirm !== void 0 ? confirm : (confirm = false);
|
|
19
|
+
priority !== null && priority !== void 0 ? priority : (priority = 0);
|
|
20
|
+
return (0, schematics_1.chain)([
|
|
21
|
+
(0, coerce_table_action_index_provider_1.CoerceTableActionIndexProviderRule)(options),
|
|
22
|
+
(0, coerce_table_action_index_1.CoerceTableActionIndexRule)(options),
|
|
23
|
+
(0, coerce_table_action_provider_1.CoerceTableActionProviderRule)(options),
|
|
24
|
+
(0, coerce_method_class_1.CoerceMethodClass)(Object.assign(Object.assign({}, options), { name: (0, schematics_utilities_1.CoerceSuffix)(actionType, '-table-row-action'), tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
25
|
+
const tableInterfaceName = `I${(0, schematics_utilities_1.classify)(tableName)}`;
|
|
26
|
+
const optionsObj = {
|
|
27
|
+
type: w => w.quote(actionType),
|
|
28
|
+
refresh: refresh ? 'true' : 'false',
|
|
29
|
+
confirm: confirm ? 'true' : 'false',
|
|
30
|
+
priority: priority.toFixed(0),
|
|
31
|
+
};
|
|
32
|
+
if (tooltip) {
|
|
33
|
+
optionsObj.tooltip = w => w.quote(tooltip);
|
|
34
|
+
}
|
|
35
|
+
if (errorMessage) {
|
|
36
|
+
optionsObj.errorMessage = w => w.quote(errorMessage);
|
|
37
|
+
}
|
|
38
|
+
if (successMessage) {
|
|
39
|
+
optionsObj.successMessage = w => w.quote(successMessage);
|
|
40
|
+
}
|
|
41
|
+
if (checkFunction) {
|
|
42
|
+
if (checkFunction.match(/^\([^)]+\)\s*=>/)) {
|
|
43
|
+
optionsObj.checkFunction = checkFunction;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
optionsObj.checkFunction =
|
|
47
|
+
`(element: ${tableInterfaceName}, index: number, array: ${tableInterfaceName}[]) => ${checkFunction}`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
(0, coerce_decorator_1.CoerceDecorator)(classDeclaration, 'TableActionMethod', {
|
|
51
|
+
arguments: [ts_morph_1.Writers.object(optionsObj)],
|
|
52
|
+
});
|
|
53
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
54
|
+
moduleSpecifier: '@rxap/material-table-system',
|
|
55
|
+
namedImports: ['TableActionMethod', 'TableRowActionTypeMethod'],
|
|
56
|
+
});
|
|
57
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
58
|
+
moduleSpecifier: `../../${tableName}`,
|
|
59
|
+
namedImports: [tableInterfaceName],
|
|
60
|
+
});
|
|
61
|
+
(0, coerce_class_implementation_1.CoerceClassImplementation)(classDeclaration, `TableRowActionTypeMethod<${tableInterfaceName}>`);
|
|
62
|
+
return Object.assign({ statements: [
|
|
63
|
+
`console.log(\`action row type: ${actionType}\`, parameters);`,
|
|
64
|
+
`return parameters;`,
|
|
65
|
+
], isAsync: true, parameters: [{ name: 'parameters', type: tableInterfaceName, hasQuestionToken: false }], returnType: `Promise<unknown>` }, tsMorphTransform(project, sourceFile, classDeclaration));
|
|
66
|
+
} })),
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
exports.CoerceTableActionRule = CoerceTableActionRule;
|
|
70
|
+
//# sourceMappingURL=coerce-table-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coerce-table-action.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/angular/coerce-table-action.ts"],"names":[],"mappings":";;;AAAA,uCAAiG;AACjG,+DAAoF;AACpF,qEAAoE;AACpE,yFAAoF;AACpF,2DAAmD;AACnD,2EAAyE;AACzE,6FAA0F;AAC1F,iFAA+E;AAC/E,mEAA+D;AAC/D,+DAA2D;AAc3D,SAAgB,qBAAqB,CAAC,OAAiC;IACrE,IAAI,EACE,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EACb,gBAAgB,GACjB,GAAG,OAAO,CAAC;IAChB,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,IAAhB,gBAAgB,GAAK,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAC;IAChC,OAAO,aAAP,OAAO,cAAP,OAAO,IAAP,OAAO,GAAK,KAAK,EAAC;IAClB,OAAO,aAAP,OAAO,cAAP,OAAO,IAAP,OAAO,GAAK,KAAK,EAAC;IAClB,QAAQ,aAAR,QAAQ,cAAR,QAAQ,IAAR,QAAQ,GAAK,CAAC,EAAC;IAEf,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,uEAAkC,EAAC,OAAO,CAAC;QAC3C,IAAA,sDAA0B,EAAC,OAAO,CAAC;QACnC,IAAA,4DAA6B,EAAC,OAAO,CAAC;QACtC,IAAA,uCAAiB,kCACZ,OAAO,KACV,IAAI,EAAE,IAAA,mCAAY,EAA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,MAAM,CAAC,UAAU,CAAC,CAAE;iBAC1C,CAAC,CAAC;gBACH,IAAA,8BAAa,EAAC,UAAU,EAAE;oBACxB,eAAe,EAAE,6BAA6B;oBAC9C,YAAY,EAAE,CAAE,mBAAmB,EAAE,0BAA0B,CAAE;iBAClE,CAAC,CAAC;gBACH,IAAA,8BAAa,EAAC,UAAU,EAAE;oBACxB,eAAe,EAAE,SAAU,SAAU,EAAE;oBACvC,YAAY,EAAE,CAAE,kBAAkB,CAAE;iBACrC,CAAC,CAAC;gBAEH,IAAA,uDAAyB,EAAC,gBAAgB,EAAE,4BAA6B,kBAAmB,GAAG,CAAC,CAAC;gBAEjG,uBACE,UAAU,EAAE;wBACV,kCAAmC,UAAW,kBAAkB;wBAChE,oBAAoB;qBACrB,EACD,OAAO,EAAE,IAAI,EACb,UAAU,EAAE,CAAE,EAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,KAAK,EAAC,CAAE,EACvF,UAAU,EAAE,kBAAkB,IAC3B,gBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAC3D;YACJ,CAAC,IACD;KACH,CAAC,CAAC;AAEL,CAAC;AAlFD,sDAkFC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TsMorphAngularProjectTransformOptions } from '../ts-morph-transform';
|
|
2
|
+
export interface CoerceTableParametersFromRouteRuleOptions extends TsMorphAngularProjectTransformOptions {
|
|
3
|
+
parameterList: string[];
|
|
4
|
+
tableName: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function CoerceTableParametersFromRouteRule(options: CoerceTableParametersFromRouteRuleOptions): import("@angular-devkit/schematics").Rule;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoerceTableParametersFromRouteRule = void 0;
|
|
4
|
+
const ts_morph_transform_1 = require("../ts-morph-transform");
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
+
const coerce_parameter_declaration_1 = require("../ts-morph/coerce-parameter-declaration");
|
|
7
|
+
const coerce_dto_class_1 = require("../nest/coerce-dto-class");
|
|
8
|
+
const ts_morph_1 = require("ts-morph");
|
|
9
|
+
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
10
|
+
const coerce_class_constructor_1 = require("../coerce-class-constructor");
|
|
11
|
+
function CoerceTableParametersFromRouteRule(options) {
|
|
12
|
+
const { parameterList, tableName } = options;
|
|
13
|
+
return (0, ts_morph_transform_1.TsMorphAngularProjectTransform)(options, (project) => {
|
|
14
|
+
const sourceFile = project.getSourceFileOrThrow(`${tableName}.component.ts`);
|
|
15
|
+
const classDeclaration = sourceFile.getClassOrThrow(`${(0, schematics_utilities_1.classify)(tableName)}Component`);
|
|
16
|
+
const [constructorDeclaration] = (0, coerce_class_constructor_1.CoerceClassConstructor)(classDeclaration);
|
|
17
|
+
(0, coerce_parameter_declaration_1.CoerceParameterDeclaration)(constructorDeclaration, 'route', { type: 'ActivatedRoute', isReadonly: true, scope: ts_morph_1.Scope.Private });
|
|
18
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
19
|
+
namedImports: ['ActivatedRoute'],
|
|
20
|
+
moduleSpecifier: '@angular/router',
|
|
21
|
+
});
|
|
22
|
+
(0, coerce_dto_class_1.CoercePropertyDeclaration)(classDeclaration, 'parameters').set({
|
|
23
|
+
type: 'Observable<Record<string, string>>',
|
|
24
|
+
initializer: `this.route.params.map(params => ({${parameterList.map(parameter => `${parameter}: params.${parameter}`)
|
|
25
|
+
.join(', ')}}))`,
|
|
26
|
+
decorators: [
|
|
27
|
+
{
|
|
28
|
+
name: 'Input',
|
|
29
|
+
arguments: [],
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
34
|
+
namedImports: ['Observable'],
|
|
35
|
+
moduleSpecifier: 'rxjs',
|
|
36
|
+
});
|
|
37
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
38
|
+
namedImports: ['map'],
|
|
39
|
+
moduleSpecifier: 'rxjs/operators',
|
|
40
|
+
});
|
|
41
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
42
|
+
namedImports: ['Input'],
|
|
43
|
+
moduleSpecifier: '@angular/core',
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
exports.CoerceTableParametersFromRouteRule = CoerceTableParametersFromRouteRule;
|
|
48
|
+
//# sourceMappingURL=coerce-table-parameters-from-route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coerce-table-parameters-from-route.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/angular/coerce-table-parameters-from-route.ts"],"names":[],"mappings":";;;AAAA,8DAA8G;AAC9G,qEAAsD;AACtD,2FAAsF;AACtF,+DAAqE;AACrE,uCAAiC;AACjC,+DAA2D;AAC3D,0EAAmE;AAOnE,SAAgB,kCAAkC,CAAC,OAAkD;IACnG,MAAM,EAAC,aAAa,EAAE,SAAS,EAAC,GAAG,OAAO,CAAC;IAC3C,OAAO,IAAA,mDAA8B,EAAC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE;QAEzD,MAAM,UAAU,GAAS,OAAO,CAAC,oBAAoB,CAAC,GAAI,SAAU,eAAe,CAAC,CAAC;QACrF,MAAM,gBAAgB,GAAG,UAAU,CAAC,eAAe,CAAC,GAAI,IAAA,+BAAQ,EAAC,SAAS,CAAE,WAAW,CAAC,CAAC;QAEzF,MAAM,CAAE,sBAAsB,CAAE,GAAG,IAAA,iDAAsB,EAAC,gBAAgB,CAAC,CAAC;QAC5E,IAAA,yDAA0B,EAAC,sBAAsB,EAC/C,OAAO,EACP,EAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,gBAAK,CAAC,OAAO,EAAC,CAAC,CAAC;QACpE,IAAA,8BAAa,EAAC,UAAU,EAAE;YACxB,YAAY,EAAE,CAAE,gBAAgB,CAAE;YAClC,eAAe,EAAE,iBAAiB;SACnC,CAAC,CAAC;QACH,IAAA,4CAAyB,EAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC;YAC5D,IAAI,EAAE,oCAAoC;YAC1C,WAAW,EAAE,qCAAsC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,GAAI,SAAU,YAAa,SAAU,EAAE,CAAC;iBACzH,IAAI,CAAC,IAAI,CAAE,KAAK;YACjB,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,OAAO;oBACb,SAAS,EAAE,EAAE;iBACd;aACF;SACF,CAAC,CAAC;QACH,IAAA,8BAAa,EAAC,UAAU,EAAE;YACxB,YAAY,EAAE,CAAE,YAAY,CAAE;YAC9B,eAAe,EAAE,MAAM;SACxB,CAAC,CAAC;QACH,IAAA,8BAAa,EAAC,UAAU,EAAE;YACxB,YAAY,EAAE,CAAE,KAAK,CAAE;YACvB,eAAe,EAAE,gBAAgB;SAClC,CAAC,CAAC;QACH,IAAA,8BAAa,EAAC,UAAU,EAAE;YACxB,YAAY,EAAE,CAAE,OAAO,CAAE;YACzB,eAAe,EAAE,eAAe;SACjC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAvCD,gFAuCC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CoerceProxyRemoteMethodClassOptions } from './coerce-proxy-remote-method-class';
|
|
2
|
+
export interface CoerceTreeTableChildrenProxyRemoteMethodClassOptions extends Omit<Omit<Omit<Omit<CoerceProxyRemoteMethodClassOptions, 'name'>, 'sourceType'>, 'targetType'>, 'proxyMethod'> {
|
|
3
|
+
getChildrenOperationId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function CoerceTreeTableChildrenProxyRemoteMethodClass(options: CoerceTreeTableChildrenProxyRemoteMethodClassOptions): import("@angular-devkit/schematics").Rule;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoerceTreeTableChildrenProxyRemoteMethodClass = void 0;
|
|
4
|
+
const coerce_proxy_remote_method_class_1 = require("./coerce-proxy-remote-method-class");
|
|
5
|
+
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
6
|
+
const operation_id_utilities_1 = require("../operation-id-utilities");
|
|
7
|
+
function CoerceTreeTableChildrenProxyRemoteMethodClass(options) {
|
|
8
|
+
let { tsMorphTransform, getChildrenOperationId } = options;
|
|
9
|
+
tsMorphTransform !== null && tsMorphTransform !== void 0 ? tsMorphTransform : (tsMorphTransform = () => ({}));
|
|
10
|
+
return (0, coerce_proxy_remote_method_class_1.CoerceProxyRemoteMethodClass)(Object.assign(Object.assign({}, options), { name: 'tree-table-children', sourceType: 'Node<unknown>', targetType: `OpenApiRemoteMethodParameter<${(0, operation_id_utilities_1.OperationIdToParameterClassName)(getChildrenOperationId)}>`, proxyMethod: (0, operation_id_utilities_1.OperationIdToClassName)(getChildrenOperationId), tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
11
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
12
|
+
namedImports: [(0, operation_id_utilities_1.OperationIdToClassName)(getChildrenOperationId)],
|
|
13
|
+
moduleSpecifier: (0, operation_id_utilities_1.OperationIdToClassImportPath)(getChildrenOperationId),
|
|
14
|
+
});
|
|
15
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
16
|
+
namedImports: ['Node'],
|
|
17
|
+
moduleSpecifier: '@rxap/utilities/rxjs',
|
|
18
|
+
});
|
|
19
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
20
|
+
namedImports: ['OpenApiRemoteMethodParameter'],
|
|
21
|
+
moduleSpecifier: '@rxap/open-api/remote-method',
|
|
22
|
+
});
|
|
23
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
24
|
+
namedImports: [(0, operation_id_utilities_1.OperationIdToParameterClassName)(getChildrenOperationId)],
|
|
25
|
+
moduleSpecifier: (0, operation_id_utilities_1.OperationIdToParameterClassImportPath)(getChildrenOperationId),
|
|
26
|
+
});
|
|
27
|
+
return tsMorphTransform(project, sourceFile, classDeclaration);
|
|
28
|
+
} }));
|
|
29
|
+
}
|
|
30
|
+
exports.CoerceTreeTableChildrenProxyRemoteMethodClass = CoerceTreeTableChildrenProxyRemoteMethodClass;
|
|
31
|
+
//# sourceMappingURL=coerce-tree-table-children-proxy-remote-method-class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coerce-tree-table-children-proxy-remote-method-class.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/angular/coerce-tree-table-children-proxy-remote-method-class.ts"],"names":[],"mappings":";;;AAAA,yFAAuH;AAEvH,+DAA2D;AAC3D,sEAImC;AAOnC,SAAgB,6CAA6C,CAAC,OAA6D;IACzH,IAAI,EAAC,gBAAgB,EAAE,sBAAsB,EAAC,GAAG,OAAO,CAAC;IACzD,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,IAAhB,gBAAgB,GAAK,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAC;IAChC,OAAO,IAAA,+DAA4B,kCAC9B,OAAO,KACV,IAAI,EAAE,qBAAqB,EAC3B,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,gCAAiC,IAAA,wDAA+B,EAAC,sBAAsB,CAAE,GAAG,EACxG,WAAW,EAAE,IAAA,+CAAsB,EAAC,sBAAsB,CAAC,EAC3D,gBAAgB,EAAE,CAAC,OAAgB,EAAE,UAAsB,EAAE,gBAAkC,EAAE,EAAE;YACjG,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,IAAA,+CAAsB,EAAC,sBAAsB,CAAC,CAAE;gBAChE,eAAe,EAAE,IAAA,qDAA4B,EAAC,sBAAsB,CAAC;aACtE,CAAC,CAAC;YACH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,MAAM,CAAE;gBACxB,eAAe,EAAE,sBAAsB;aACxC,CAAC,CAAC;YACH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,8BAA8B,CAAE;gBAChD,eAAe,EAAE,8BAA8B;aAChD,CAAC,CAAC;YACH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,IAAA,wDAA+B,EAAC,sBAAsB,CAAC,CAAE;gBACzE,eAAe,EAAE,IAAA,8DAAqC,EAAC,sBAAsB,CAAC;aAC/E,CAAC,CAAC;YACH,OAAO,gBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;QAClE,CAAC,IACD,CAAC;AACL,CAAC;AA7BD,sGA6BC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CoerceProxyRemoteMethodClassOptions } from './coerce-proxy-remote-method-class';
|
|
2
|
+
export interface CoerceTreeTableRootProxyRemoteMethodClassOptions extends Omit<Omit<Omit<Omit<CoerceProxyRemoteMethodClassOptions, 'name'>, 'sourceType'>, 'targetType'>, 'proxyMethod'> {
|
|
3
|
+
getRootOperationId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function CoerceTreeTableRootProxyRemoteMethodClass(options: CoerceTreeTableRootProxyRemoteMethodClassOptions): import("@angular-devkit/schematics").Rule;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoerceTreeTableRootProxyRemoteMethodClass = void 0;
|
|
4
|
+
const coerce_proxy_remote_method_class_1 = require("./coerce-proxy-remote-method-class");
|
|
5
|
+
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
6
|
+
const operation_id_utilities_1 = require("../operation-id-utilities");
|
|
7
|
+
function CoerceTreeTableRootProxyRemoteMethodClass(options) {
|
|
8
|
+
let { tsMorphTransform, getRootOperationId } = options;
|
|
9
|
+
tsMorphTransform !== null && tsMorphTransform !== void 0 ? tsMorphTransform : (tsMorphTransform = () => ({}));
|
|
10
|
+
return (0, coerce_proxy_remote_method_class_1.CoerceProxyRemoteMethodClass)(Object.assign(Object.assign({}, options), { name: 'tree-table-root', sourceType: 'Node<unknown>', targetType: `OpenApiRemoteMethodParameter<${(0, operation_id_utilities_1.OperationIdToParameterClassName)(getRootOperationId)}>`, proxyMethod: (0, operation_id_utilities_1.OperationIdToClassName)(getRootOperationId), tsMorphTransform: (project, sourceFile, classDeclaration) => {
|
|
11
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
12
|
+
namedImports: [(0, operation_id_utilities_1.OperationIdToClassName)(getRootOperationId)],
|
|
13
|
+
moduleSpecifier: (0, operation_id_utilities_1.OperationIdToClassImportPath)(getRootOperationId),
|
|
14
|
+
});
|
|
15
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
16
|
+
namedImports: ['Node'],
|
|
17
|
+
moduleSpecifier: '@rxap/utilities/rxjs',
|
|
18
|
+
});
|
|
19
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
20
|
+
namedImports: ['OpenApiRemoteMethodParameter'],
|
|
21
|
+
moduleSpecifier: '@rxap/open-api/remote-method',
|
|
22
|
+
});
|
|
23
|
+
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
24
|
+
namedImports: [(0, operation_id_utilities_1.OperationIdToParameterClassName)(getRootOperationId)],
|
|
25
|
+
moduleSpecifier: (0, operation_id_utilities_1.OperationIdToParameterClassImportPath)(getRootOperationId),
|
|
26
|
+
});
|
|
27
|
+
return tsMorphTransform(project, sourceFile, classDeclaration);
|
|
28
|
+
} }));
|
|
29
|
+
}
|
|
30
|
+
exports.CoerceTreeTableRootProxyRemoteMethodClass = CoerceTreeTableRootProxyRemoteMethodClass;
|
|
31
|
+
//# sourceMappingURL=coerce-tree-table-root-proxy-remote-method-class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coerce-tree-table-root-proxy-remote-method-class.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/angular/coerce-tree-table-root-proxy-remote-method-class.ts"],"names":[],"mappings":";;;AAAA,yFAAuH;AAEvH,+DAA2D;AAC3D,sEAImC;AAOnC,SAAgB,yCAAyC,CAAC,OAAyD;IACjH,IAAI,EAAC,gBAAgB,EAAE,kBAAkB,EAAC,GAAG,OAAO,CAAC;IACrD,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,IAAhB,gBAAgB,GAAK,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAC;IAChC,OAAO,IAAA,+DAA4B,kCAC9B,OAAO,KACV,IAAI,EAAE,iBAAiB,EACvB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,gCAAiC,IAAA,wDAA+B,EAAC,kBAAkB,CAAE,GAAG,EACpG,WAAW,EAAE,IAAA,+CAAsB,EAAC,kBAAkB,CAAC,EACvD,gBAAgB,EAAE,CAAC,OAAgB,EAAE,UAAsB,EAAE,gBAAkC,EAAE,EAAE;YACjG,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,IAAA,+CAAsB,EAAC,kBAAkB,CAAC,CAAE;gBAC5D,eAAe,EAAE,IAAA,qDAA4B,EAAC,kBAAkB,CAAC;aAClE,CAAC,CAAC;YACH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,MAAM,CAAE;gBACxB,eAAe,EAAE,sBAAsB;aACxC,CAAC,CAAC;YACH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,8BAA8B,CAAE;gBAChD,eAAe,EAAE,8BAA8B;aAChD,CAAC,CAAC;YACH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,IAAA,wDAA+B,EAAC,kBAAkB,CAAC,CAAE;gBACrE,eAAe,EAAE,IAAA,8DAAqC,EAAC,kBAAkB,CAAC;aAC3E,CAAC,CAAC;YACH,OAAO,gBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;QAClE,CAAC,IACD,CAAC;AACL,CAAC;AA7BD,8FA6BC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasAccordionComponent = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
+
const has_project_feature_1 = require("./has-project-feature");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
function HasAccordionComponent(host, options) {
|
|
9
|
+
const { accordionName, project, feature } = options;
|
|
10
|
+
if (!(0, schematics_utilities_1.HasProject)(host, project)) {
|
|
11
|
+
throw new schematics_1.SchematicsException(`The accordion component '${accordionName}' does not exists. The project '${project}' does not exists.`);
|
|
12
|
+
}
|
|
13
|
+
if (!(0, has_project_feature_1.HasProjectFeature)(host, options)) {
|
|
14
|
+
throw new schematics_1.SchematicsException(`The accordion component '${accordionName}' does not exists. The project '${project}' has not the feature does not exists.`);
|
|
15
|
+
}
|
|
16
|
+
const projectSourceRoot = (0, schematics_utilities_1.GetProjectSourceRoot)(host, options.project);
|
|
17
|
+
return host.exists((0, path_1.join)(projectSourceRoot, 'feature', feature, accordionName, accordionName + '.component.ts'));
|
|
18
|
+
}
|
|
19
|
+
exports.HasAccordionComponent = HasAccordionComponent;
|
|
20
|
+
//# sourceMappingURL=has-accordion-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-accordion-component.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/angular/has-accordion-component.ts"],"names":[],"mappings":";;;AAAA,2DAAuE;AACvE,qEAA8E;AAC9E,+DAA0D;AAC1D,+BAA4B;AAE5B,SAAgB,qBAAqB,CACnC,IAAU,EACV,OAAoE;IAEpE,MAAM,EAAC,aAAa,EAAE,OAAO,EAAE,OAAO,EAAC,GAAG,OAAO,CAAC;IAClD,IAAI,CAAC,IAAA,iCAAU,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QAC9B,MAAM,IAAI,gCAAmB,CAAC,4BAA6B,aAAc,mCAAoC,OAAQ,oBAAoB,CAAC,CAAC;KAC5I;IACD,IAAI,CAAC,IAAA,uCAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QACrC,MAAM,IAAI,gCAAmB,CAAC,4BAA6B,aAAc,mCAAoC,OAAQ,wCAAwC,CAAC,CAAC;KAChK;IACD,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAA,WAAI,EAAC,iBAAiB,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,GAAG,eAAe,CAAC,CAAC,CAAC;AAClH,CAAC;AAbD,sDAaC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
export interface HasComponentOptions {
|
|
3
|
+
project: string;
|
|
4
|
+
feature: string;
|
|
5
|
+
name: string;
|
|
6
|
+
directory?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function HasComponent(host: Tree, options: Readonly<HasComponentOptions>): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasComponent = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
+
const has_project_feature_1 = require("./has-project-feature");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const build_angular_base_path_1 = require("./build-angular-base-path");
|
|
9
|
+
function HasComponent(host, options) {
|
|
10
|
+
let { project, feature, name } = options;
|
|
11
|
+
if (!(0, schematics_utilities_1.HasProject)(host, project)) {
|
|
12
|
+
throw new schematics_1.SchematicsException(`The component '${name}' does not exists. The project '${project}' does not exists.`);
|
|
13
|
+
}
|
|
14
|
+
const type = (0, schematics_utilities_1.GetProjectType)(host, project);
|
|
15
|
+
if (type !== 'library' && !(0, has_project_feature_1.HasProjectFeature)(host, options)) {
|
|
16
|
+
throw new schematics_1.SchematicsException(`The component '${name}' does not exists. The project '${project}' has not the feature '${feature}'.`);
|
|
17
|
+
}
|
|
18
|
+
let basePath = (0, build_angular_base_path_1.BuildAngularBasePath)(host, options);
|
|
19
|
+
if (!basePath.endsWith(name)) {
|
|
20
|
+
basePath = (0, path_1.join)(basePath, name);
|
|
21
|
+
}
|
|
22
|
+
return host.exists((0, path_1.join)(basePath, name +
|
|
23
|
+
'.component.ts'));
|
|
24
|
+
}
|
|
25
|
+
exports.HasComponent = HasComponent;
|
|
26
|
+
//# sourceMappingURL=has-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-component.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/angular/has-component.ts"],"names":[],"mappings":";;;AAAA,2DAAuE;AACvE,qEAAwE;AACxE,+DAA0D;AAC1D,+BAA4B;AAC5B,uEAAiE;AASjE,SAAgB,YAAY,CAAC,IAAU,EAAE,OAAsC;IAC7E,IAAI,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,GAAG,OAAO,CAAC;IAEvC,IAAI,CAAC,IAAA,iCAAU,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QAC9B,MAAM,IAAI,gCAAmB,CAAC,kBAAmB,IAAK,mCAAoC,OAAQ,oBAAoB,CAAC,CAAC;KACzH;IACD,MAAM,IAAI,GAAkC,IAAA,qCAAc,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1E,IAAK,IAAI,KAAK,SAAS,IAAI,CAAC,IAAA,uCAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QAC5D,MAAM,IAAI,gCAAmB,CAAC,kBAAmB,IAAK,mCAAoC,OAAQ,0BAA2B,OAAQ,IAAI,CAAC,CAAC;KAC5I;IACD,IAAI,QAAQ,GAAG,IAAA,8CAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAC5B,QAAQ,GAAG,IAAA,WAAI,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;KACjC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAA,WAAI,EAAC,QAAQ,EAC9B,IAAI;QACJ,eAAe,CAAC,CAAC,CAAC;AAEtB,CAAC;AAlBD,oCAkBC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasProjectFeature = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
function HasProjectFeature(host, { project, feature }) {
|
|
8
|
+
if (!(0, schematics_utilities_1.HasProject)(host, project)) {
|
|
9
|
+
throw new schematics_1.SchematicsException(`The feature '${feature}' does not exists. The project '${project}' does not exists.`);
|
|
10
|
+
}
|
|
11
|
+
const projectSourceRoot = (0, schematics_utilities_1.GetProjectSourceRoot)(host, project);
|
|
12
|
+
return host.exists((0, path_1.join)(projectSourceRoot, `feature/${feature}/index.ts`));
|
|
13
|
+
}
|
|
14
|
+
exports.HasProjectFeature = HasProjectFeature;
|
|
15
|
+
//# sourceMappingURL=has-project-feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-project-feature.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/angular/has-project-feature.ts"],"names":[],"mappings":";;;AAAA,2DAAuE;AACvE,qEAA8E;AAC9E,+BAA4B;AAE5B,SAAgB,iBAAiB,CAAC,IAAU,EAAE,EAAC,OAAO,EAAE,OAAO,EAAuC;IACpG,IAAI,CAAC,IAAA,iCAAU,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QAC9B,MAAM,IAAI,gCAAmB,CAAC,gBAAiB,OAAQ,mCAAoC,OAAQ,oBAAoB,CAAC,CAAC;KAC1H;IACD,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAA,WAAI,EAAC,iBAAiB,EAAE,WAAY,OAAQ,WAAW,CAAC,CAAC,CAAC;AAC/E,CAAC;AAND,8CAMC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
export interface HasTableComponentOptions {
|
|
3
|
+
project: string;
|
|
4
|
+
feature: string;
|
|
5
|
+
name: string;
|
|
6
|
+
directory?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function HasTableComponent(host: Tree, options: HasTableComponentOptions): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasTableComponent = void 0;
|
|
4
|
+
const has_component_1 = require("./has-component");
|
|
5
|
+
const build_angular_base_path_1 = require("./build-angular-base-path");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
function HasTableComponent(host, options) {
|
|
8
|
+
let { name } = options;
|
|
9
|
+
if (!(0, has_component_1.HasComponent)(host, options)) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
let basePath = (0, build_angular_base_path_1.BuildAngularBasePath)(host, options);
|
|
13
|
+
if (!basePath.endsWith(name)) {
|
|
14
|
+
basePath = (0, path_1.join)(basePath, name);
|
|
15
|
+
}
|
|
16
|
+
return host.exists((0, path_1.join)(basePath, name + '.ts'));
|
|
17
|
+
}
|
|
18
|
+
exports.HasTableComponent = HasTableComponent;
|
|
19
|
+
//# sourceMappingURL=has-table-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-table-component.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/angular/has-table-component.ts"],"names":[],"mappings":";;;AACA,mDAA+C;AAC/C,uEAAiE;AACjE,+BAA4B;AAS5B,SAAgB,iBAAiB,CAAC,IAAU,EAAE,OAAiC;IAC7E,IAAI,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;IACrB,IAAI,CAAC,IAAA,4BAAY,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QAChC,OAAO,KAAK,CAAC;KACd;IAED,IAAI,QAAQ,GAAG,IAAA,8CAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAC5B,QAAQ,GAAG,IAAA,WAAI,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;KACjC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAA,WAAI,EAAC,QAAQ,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;AACnD,CAAC;AAXD,8CAWC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from './build-angular-base-path';
|
|
2
|
+
export * from './coerce-accordion-component';
|
|
3
|
+
export * from './coerce-component-class';
|
|
4
|
+
export * from './coerce-component';
|
|
5
|
+
export * from './coerce-data-source-class';
|
|
6
|
+
export * from './coerce-form-builder-provider';
|
|
7
|
+
export * from './coerce-form-component-provider';
|
|
8
|
+
export * from './coerce-form-definition';
|
|
9
|
+
export * from './coerce-form-provider';
|
|
10
|
+
export * from './coerce-form-providers-file';
|
|
11
|
+
export * from './coerce-form-table-action';
|
|
12
|
+
export * from './coerce-method-class';
|
|
13
|
+
export * from './coerce-navigation-table-action';
|
|
14
|
+
export * from './coerce-operation-table-action';
|
|
15
|
+
export * from './coerce-project-feature';
|
|
16
|
+
export * from './coerce-proxy-remote-method-class';
|
|
17
|
+
export * from './coerce-table-action-index-provider';
|
|
18
|
+
export * from './coerce-table-action-provider';
|
|
19
|
+
export * from './coerce-table-action';
|
|
20
|
+
export * from './coerce-table-parameters-from-route';
|
|
21
|
+
export * from './coerce-tree-table-children-proxy-remote-method-class';
|
|
22
|
+
export * from './coerce-tree-table-root-proxy-remote-method-class';
|
|
23
|
+
export * from './has-accordion-component';
|
|
24
|
+
export * from './has-component';
|
|
25
|
+
export * from './has-project-feature';
|
|
26
|
+
export * from './has-table-component';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./build-angular-base-path"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./coerce-accordion-component"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./coerce-component-class"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./coerce-component"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./coerce-data-source-class"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./coerce-form-builder-provider"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./coerce-form-component-provider"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./coerce-form-definition"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./coerce-form-provider"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./coerce-form-providers-file"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./coerce-form-table-action"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./coerce-method-class"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./coerce-navigation-table-action"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./coerce-operation-table-action"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./coerce-project-feature"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./coerce-proxy-remote-method-class"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./coerce-table-action-index-provider"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./coerce-table-action-provider"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./coerce-table-action"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./coerce-table-parameters-from-route"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./coerce-tree-table-children-proxy-remote-method-class"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./coerce-tree-table-root-proxy-remote-method-class"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./has-accordion-component"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./has-component"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./has-project-feature"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./has-table-component"), exports);
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/ts-morph/src/lib/angular/index.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,uEAA6C;AAC7C,mEAAyC;AACzC,6DAAmC;AACnC,qEAA2C;AAC3C,yEAA+C;AAC/C,2EAAiD;AACjD,mEAAyC;AACzC,iEAAuC;AACvC,uEAA6C;AAC7C,qEAA2C;AAC3C,gEAAsC;AACtC,2EAAiD;AACjD,0EAAgD;AAChD,mEAAyC;AACzC,6EAAmD;AACnD,+EAAqD;AACrD,yEAA+C;AAC/C,gEAAsC;AACtC,+EAAqD;AACrD,iGAAuE;AACvE,6FAAmE;AACnE,oEAA0C;AAC1C,0DAAgC;AAChC,gEAAsC;AACtC,gEAAsC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ClassDeclaration, MethodDeclarationStructure, OptionalKind } from 'ts-morph';
|
|
2
|
-
export declare function CoerceClassMethod(classDeclaration: ClassDeclaration, name: string, structure
|
|
2
|
+
export declare function CoerceClassMethod(classDeclaration: ClassDeclaration, name: string, structure?: Omit<OptionalKind<MethodDeclarationStructure>, 'name'>): import("ts-morph").MethodDeclaration;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceClassMethod = void 0;
|
|
4
|
-
function CoerceClassMethod(classDeclaration, name, structure) {
|
|
4
|
+
function CoerceClassMethod(classDeclaration, name, structure = {}) {
|
|
5
5
|
let methodDeclaration = classDeclaration.getMethod(name);
|
|
6
6
|
if (!methodDeclaration) {
|
|
7
|
-
methodDeclaration = classDeclaration.addMethod(
|
|
7
|
+
methodDeclaration = classDeclaration.addMethod({ name });
|
|
8
|
+
methodDeclaration.set(structure);
|
|
8
9
|
}
|
|
9
10
|
return methodDeclaration;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-class-method.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/coerce-class-method.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAC/B,gBAAkC,EAClC,IAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"coerce-class-method.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/coerce-class-method.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAC/B,gBAAkC,EAClC,IAAY,EACZ,YAAoE,EAAE;IAGtE,IAAI,iBAAiB,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAExD,IAAI,CAAC,iBAAiB,EAAE;QAEtB,iBAAiB,GAAG,gBAAgB,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAEzD,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;KAElC;IAED,OAAO,iBAAiB,CAAC;AAE3B,CAAC;AAlBD,8CAkBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ClassDeclaration, ClassDeclarationStructure, ImportDeclarationStructure, OptionalKind, SourceFile, WriterFunction } from 'ts-morph';
|
|
2
|
+
export interface DtoClassProperty {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string | WriterFunction;
|
|
5
|
+
isArray?: boolean;
|
|
6
|
+
isType?: boolean;
|
|
7
|
+
isOptional?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function CreateDtoClass(sourceFile: SourceFile, className: string, propertyList: DtoClassProperty[], classStructure?: Omit<OptionalKind<ClassDeclarationStructure>, 'name'>, structures?: Array<OptionalKind<ImportDeclarationStructure>>): ClassDeclaration;
|
|
10
|
+
export declare function CreatePageDtoClass(sourceFile: SourceFile, className: string, rowType: string | WriterFunction, classStructure?: Omit<OptionalKind<ClassDeclarationStructure>, 'name'>, structures?: Array<OptionalKind<ImportDeclarationStructure>>): ClassDeclaration;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreatePageDtoClass = exports.CreateDtoClass = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
+
const index_1 = require("./ts-morph/index");
|
|
7
|
+
const coerce_class_1 = require("./coerce-class");
|
|
8
|
+
function CreateDtoClass(sourceFile, className, propertyList, classStructure, structures) {
|
|
9
|
+
var _a;
|
|
10
|
+
className = (0, schematics_utilities_1.CoerceSuffix)(className, 'Dto');
|
|
11
|
+
classStructure !== null && classStructure !== void 0 ? classStructure : (classStructure = {});
|
|
12
|
+
(_a = classStructure.properties) !== null && _a !== void 0 ? _a : (classStructure.properties = []);
|
|
13
|
+
classStructure.isExported = true;
|
|
14
|
+
for (const property of propertyList) {
|
|
15
|
+
const decorators = [
|
|
16
|
+
{ name: 'Expose', arguments: [] },
|
|
17
|
+
];
|
|
18
|
+
(0, index_1.CoerceImports)(sourceFile, { namedImports: ['Expose'], moduleSpecifier: 'class-transformer' });
|
|
19
|
+
if (property.isArray) {
|
|
20
|
+
decorators.push({ name: 'IsArray', arguments: [] });
|
|
21
|
+
(0, index_1.CoerceImports)(sourceFile, { namedImports: ['IsArray'], moduleSpecifier: 'class-validator' });
|
|
22
|
+
}
|
|
23
|
+
if (property.isType) {
|
|
24
|
+
decorators.push({
|
|
25
|
+
name: 'Type', arguments: [w => {
|
|
26
|
+
w.write('() => ');
|
|
27
|
+
if (typeof property.type === 'string') {
|
|
28
|
+
w.write(property.type);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
property.type(w);
|
|
32
|
+
}
|
|
33
|
+
}],
|
|
34
|
+
});
|
|
35
|
+
(0, index_1.CoerceImports)(sourceFile, { namedImports: ['Type'], moduleSpecifier: 'class-transformer' });
|
|
36
|
+
decorators.push({
|
|
37
|
+
name: 'IsInstance', arguments: [
|
|
38
|
+
w => {
|
|
39
|
+
if (typeof property.type === 'string') {
|
|
40
|
+
w.write(property.type);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
property.type(w);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
w => {
|
|
47
|
+
if (property.isArray) {
|
|
48
|
+
ts_morph_1.Writers.object({ each: 'true' })(w);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
(0, index_1.CoerceImports)(sourceFile, { namedImports: ['IsInstance'], moduleSpecifier: 'class-validator' });
|
|
54
|
+
}
|
|
55
|
+
if (property.isOptional) {
|
|
56
|
+
decorators.push({ name: 'IsOptional', arguments: [] });
|
|
57
|
+
(0, index_1.CoerceImports)(sourceFile, { namedImports: ['IsOptional'], moduleSpecifier: 'class-validator' });
|
|
58
|
+
}
|
|
59
|
+
if (property.type === 'string') {
|
|
60
|
+
if (property.name === 'uuid') {
|
|
61
|
+
(0, index_1.CoerceImports)(sourceFile, { namedImports: ['IsUUID'], moduleSpecifier: 'class-validator' });
|
|
62
|
+
decorators.push({ name: 'IsUUID', arguments: [] });
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
(0, index_1.CoerceImports)(sourceFile, { namedImports: ['IsString'], moduleSpecifier: 'class-validator' });
|
|
66
|
+
decorators.push({ name: 'IsString', arguments: [] });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (property.type === 'boolean') {
|
|
70
|
+
(0, index_1.CoerceImports)(sourceFile, { namedImports: ['IsBoolean'], moduleSpecifier: 'class-validator' });
|
|
71
|
+
decorators.push({ name: 'IsBoolean', arguments: [] });
|
|
72
|
+
}
|
|
73
|
+
if (property.type === 'number') {
|
|
74
|
+
(0, index_1.CoerceImports)(sourceFile, { namedImports: ['IsBoolean'], moduleSpecifier: 'class-validator' });
|
|
75
|
+
decorators.push({ name: 'IsBoolean', arguments: [] });
|
|
76
|
+
}
|
|
77
|
+
classStructure.properties.push({
|
|
78
|
+
name: property.name,
|
|
79
|
+
type: !property.isArray ? property.type : w => {
|
|
80
|
+
w.write('Array<');
|
|
81
|
+
if (typeof property.type === 'string') {
|
|
82
|
+
w.write(property.type);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
property.type(w);
|
|
86
|
+
}
|
|
87
|
+
w.write('>');
|
|
88
|
+
},
|
|
89
|
+
hasQuestionToken: property.isOptional,
|
|
90
|
+
hasExclamationToken: !property.isOptional,
|
|
91
|
+
decorators,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
(0, index_1.CoerceImports)(sourceFile, structures !== null && structures !== void 0 ? structures : []);
|
|
95
|
+
return (0, coerce_class_1.CoerceClass)(sourceFile, className, classStructure);
|
|
96
|
+
}
|
|
97
|
+
exports.CreateDtoClass = CreateDtoClass;
|
|
98
|
+
function CreatePageDtoClass(sourceFile, className, rowType, classStructure, structures) {
|
|
99
|
+
className = (0, schematics_utilities_1.CoerceSuffix)(className, 'PageDto');
|
|
100
|
+
const propertyList = [
|
|
101
|
+
{
|
|
102
|
+
name: 'rows',
|
|
103
|
+
type: rowType,
|
|
104
|
+
isArray: true,
|
|
105
|
+
isType: true,
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
classStructure !== null && classStructure !== void 0 ? classStructure : (classStructure = {});
|
|
109
|
+
classStructure.extends = w => {
|
|
110
|
+
w.write('PageDto<');
|
|
111
|
+
if (typeof rowType === 'string') {
|
|
112
|
+
w.write(rowType);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
rowType(w);
|
|
116
|
+
}
|
|
117
|
+
w.write('>');
|
|
118
|
+
};
|
|
119
|
+
structures !== null && structures !== void 0 ? structures : (structures = []);
|
|
120
|
+
structures.push({
|
|
121
|
+
namedImports: ['PageDto'],
|
|
122
|
+
moduleSpecifier: '@eurogard/service-nest-utilities',
|
|
123
|
+
});
|
|
124
|
+
return CreateDtoClass(sourceFile, className, propertyList, classStructure, structures);
|
|
125
|
+
}
|
|
126
|
+
exports.CreatePageDtoClass = CreatePageDtoClass;
|
|
127
|
+
//# sourceMappingURL=create-dto-class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-dto-class.js","sourceRoot":"","sources":["../../../../../libs/ts-morph/src/lib/create-dto-class.ts"],"names":[],"mappings":";;;AAAA,uCASkB;AAClB,qEAA0D;AAC1D,4CAA+C;AAC/C,iDAA2C;AAU3C,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,C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