@rxap/schematics-ts-morph 16.0.0-dev.3 → 16.0.0-dev.30
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 +208 -0
- package/LICENSE.md +621 -0
- package/README.md +1 -1
- package/package.json +48 -28
- package/src/index.d.ts +141 -4
- package/src/index.js +151 -4
- package/src/index.js.map +1 -1
- package/src/lib/add-dir.js.map +1 -1
- package/src/lib/add-fake-provider.js +3 -3
- package/src/lib/add-fake-provider.js.map +1 -1
- package/src/lib/add-method-class.d.ts +1 -0
- package/src/lib/add-method-class.js +12 -4
- package/src/lib/add-method-class.js.map +1 -1
- package/src/lib/add-provider-to-array.d.ts +5 -2
- package/src/lib/add-provider-to-array.js +34 -8
- package/src/lib/add-provider-to-array.js.map +1 -1
- package/src/lib/add-to-array.d.ts +1 -1
- package/src/lib/add-to-array.js +4 -3
- package/src/lib/add-to-array.js.map +1 -1
- package/src/lib/add-variable-provider.js +3 -3
- package/src/lib/add-variable-provider.js.map +1 -1
- package/src/lib/{add-component-animations.js → angular/add-component-animations.js} +4 -4
- package/src/lib/angular/add-component-animations.js.map +1 -0
- package/src/lib/{add-component-fake-provider.d.ts → angular/add-component-fake-provider.d.ts} +1 -1
- package/src/lib/{add-component-fake-provider.js → angular/add-component-fake-provider.js} +1 -1
- package/src/lib/angular/add-component-fake-provider.js.map +1 -0
- package/src/lib/angular/add-component-import.d.ts +2 -0
- package/src/lib/angular/add-component-import.js +21 -0
- package/src/lib/angular/add-component-import.js.map +1 -0
- package/src/lib/{add-component-input.js → angular/add-component-input.js} +4 -4
- package/src/lib/angular/add-component-input.js.map +1 -0
- package/src/lib/{add-component-provider.d.ts → angular/add-component-provider.d.ts} +1 -1
- package/src/lib/{add-component-provider.js → angular/add-component-provider.js} +4 -4
- package/src/lib/angular/add-component-provider.js.map +1 -0
- package/src/lib/angular/add-control-validator.js.map +1 -0
- package/src/lib/{add-dependency-injection.d.ts → angular/add-dependency-injection.d.ts} +9 -0
- package/src/lib/{add-dependency-injection.js → angular/add-dependency-injection.js} +11 -5
- package/src/lib/angular/add-dependency-injection.js.map +1 -0
- package/src/lib/angular/add-ng-module-export.d.ts +2 -0
- package/src/lib/angular/add-ng-module-export.js +21 -0
- package/src/lib/angular/add-ng-module-export.js.map +1 -0
- package/src/lib/{add-ng-module-import.js → angular/add-ng-module-import.js} +4 -4
- package/src/lib/angular/add-ng-module-import.js.map +1 -0
- package/src/lib/{add-ng-module-provider.d.ts → angular/add-ng-module-provider.d.ts} +1 -1
- package/src/lib/{add-ng-module-provider.js → angular/add-ng-module-provider.js} +4 -4
- package/src/lib/angular/add-ng-module-provider.js.map +1 -0
- package/src/lib/angular/build-angular-base-path.d.ts +2 -2
- package/src/lib/angular/build-angular-base-path.js +6 -1
- package/src/lib/angular/build-angular-base-path.js.map +1 -1
- package/src/lib/angular/coerce-accordion-component.d.ts +1 -1
- package/src/lib/angular/coerce-accordion-component.js +3 -3
- package/src/lib/angular/coerce-accordion-component.js.map +1 -1
- package/src/lib/angular/coerce-component-class.d.ts +1 -1
- package/src/lib/angular/coerce-component-class.js +7 -8
- package/src/lib/angular/coerce-component-class.js.map +1 -1
- package/src/lib/angular/coerce-component.d.ts +10 -10
- package/src/lib/angular/coerce-component.js +57 -18
- package/src/lib/angular/coerce-component.js.map +1 -1
- package/src/lib/angular/coerce-data-source-class.d.ts +17 -6
- package/src/lib/angular/coerce-data-source-class.js +51 -15
- package/src/lib/angular/coerce-data-source-class.js.map +1 -1
- package/src/lib/angular/coerce-dialog-component.d.ts +11 -0
- package/src/lib/angular/coerce-dialog-component.js +85 -0
- package/src/lib/angular/coerce-dialog-component.js.map +1 -0
- package/src/lib/angular/coerce-dialog-table-action-component.d.ts +8 -0
- package/src/lib/angular/coerce-dialog-table-action-component.js +102 -0
- package/src/lib/angular/coerce-dialog-table-action-component.js.map +1 -0
- package/src/lib/angular/coerce-dialog-table-action.d.ts +3 -0
- package/src/lib/angular/coerce-dialog-table-action.js +39 -0
- package/src/lib/angular/coerce-dialog-table-action.js.map +1 -0
- package/src/lib/angular/coerce-form-builder-provider.d.ts +2 -2
- package/src/lib/angular/coerce-form-builder-provider.js +4 -4
- package/src/lib/angular/coerce-form-builder-provider.js.map +1 -1
- package/src/lib/angular/coerce-form-component-provider.d.ts +2 -2
- package/src/lib/angular/coerce-form-component-provider.js +4 -4
- package/src/lib/angular/coerce-form-component-provider.js.map +1 -1
- package/src/lib/angular/coerce-form-definition-control.d.ts +20 -0
- package/src/lib/angular/coerce-form-definition-control.js +149 -0
- package/src/lib/angular/coerce-form-definition-control.js.map +1 -0
- package/src/lib/angular/coerce-form-definition-type.d.ts +10 -0
- package/src/lib/angular/coerce-form-definition-type.js +30 -0
- package/src/lib/angular/coerce-form-definition-type.js.map +1 -0
- package/src/lib/angular/coerce-form-definition.d.ts +4 -10
- package/src/lib/angular/coerce-form-definition.js +58 -76
- package/src/lib/angular/coerce-form-definition.js.map +1 -1
- package/src/lib/angular/coerce-form-provider.d.ts +2 -2
- package/src/lib/angular/coerce-form-provider.js +4 -4
- package/src/lib/angular/coerce-form-provider.js.map +1 -1
- package/src/lib/angular/coerce-form-providers-file.d.ts +2 -2
- package/src/lib/angular/coerce-form-providers-file.js +7 -7
- package/src/lib/angular/coerce-form-providers-file.js.map +1 -1
- package/src/lib/angular/coerce-form-table-action.d.ts +1 -0
- package/src/lib/angular/coerce-form-table-action.js +11 -11
- package/src/lib/angular/coerce-form-table-action.js.map +1 -1
- package/src/lib/angular/coerce-method-class.d.ts +4 -6
- package/src/lib/angular/coerce-method-class.js +12 -17
- package/src/lib/angular/coerce-method-class.js.map +1 -1
- package/src/lib/angular/coerce-navigation-table-action.d.ts +1 -1
- package/src/lib/angular/coerce-navigation-table-action.js +4 -4
- package/src/lib/angular/coerce-navigation-table-action.js.map +1 -1
- package/src/lib/angular/coerce-operation-table-action.d.ts +1 -0
- package/src/lib/angular/coerce-operation-table-action.js +8 -8
- package/src/lib/angular/coerce-operation-table-action.js.map +1 -1
- package/src/lib/angular/coerce-options-data-source.d.ts +6 -0
- package/src/lib/angular/coerce-options-data-source.js +47 -0
- package/src/lib/angular/coerce-options-data-source.js.map +1 -0
- package/src/lib/angular/coerce-project-feature.d.ts +2 -4
- package/src/lib/angular/coerce-project-feature.js +20 -6
- package/src/lib/angular/coerce-project-feature.js.map +1 -1
- package/src/lib/angular/coerce-proxy-remote-method-class.d.ts +3 -5
- package/src/lib/angular/coerce-proxy-remote-method-class.js +10 -7
- package/src/lib/angular/coerce-proxy-remote-method-class.js.map +1 -1
- package/src/lib/angular/coerce-table-action-index-provider.js +4 -6
- package/src/lib/angular/coerce-table-action-index-provider.js.map +1 -1
- package/src/lib/angular/coerce-table-action-index.js +2 -2
- package/src/lib/angular/coerce-table-action-index.js.map +1 -1
- package/src/lib/angular/coerce-table-action-provider.d.ts +3 -3
- package/src/lib/angular/coerce-table-action-provider.js +9 -9
- package/src/lib/angular/coerce-table-action-provider.js.map +1 -1
- package/src/lib/angular/coerce-table-action.d.ts +6 -6
- package/src/lib/angular/coerce-table-action.js +8 -7
- package/src/lib/angular/coerce-table-action.js.map +1 -1
- package/src/lib/angular/coerce-table-data-source.d.ts +9 -0
- package/src/lib/angular/coerce-table-data-source.js +50 -0
- package/src/lib/angular/coerce-table-data-source.js.map +1 -0
- package/src/lib/angular/coerce-table-header-button-method.d.ts +13 -0
- package/src/lib/angular/coerce-table-header-button-method.js +80 -0
- package/src/lib/angular/coerce-table-header-button-method.js.map +1 -0
- package/src/lib/angular/coerce-table-parameters-from-route.js +5 -5
- package/src/lib/angular/coerce-table-parameters-from-route.js.map +1 -1
- package/src/lib/angular/coerce-table-select-resolve-value-method.d.ts +6 -0
- package/src/lib/angular/coerce-table-select-resolve-value-method.js +31 -0
- package/src/lib/angular/coerce-table-select-resolve-value-method.js.map +1 -0
- package/src/lib/angular/coerce-tree-table-children-proxy-remote-method-class.d.ts +1 -0
- package/src/lib/angular/coerce-tree-table-children-proxy-remote-method-class.js +6 -6
- 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 +6 -6
- package/src/lib/angular/coerce-tree-table-root-proxy-remote-method-class.js.map +1 -1
- package/src/lib/angular/enforce-use-form-control-order.d.ts +5 -0
- package/src/lib/angular/enforce-use-form-control-order.js +33 -0
- package/src/lib/angular/enforce-use-form-control-order.js.map +1 -0
- package/src/lib/angular/find-component-module-source-file.js.map +1 -0
- package/src/lib/angular/find-component-source-file.js.map +1 -0
- package/src/lib/angular/find-routing-module.js.map +1 -0
- package/src/lib/angular/form-definition-utilities.d.ts +13 -0
- package/src/lib/angular/form-definition-utilities.js +29 -0
- package/src/lib/angular/form-definition-utilities.js.map +1 -0
- package/src/lib/angular/get-component-class.js.map +1 -0
- package/src/lib/angular/get-component-options-object.js.map +1 -0
- package/src/lib/angular/get-ng-module-options-object.js.map +1 -0
- package/src/lib/{handle-component-module.d.ts → angular/handle-component-module.d.ts} +1 -1
- package/src/lib/angular/handle-component-module.js.map +1 -0
- package/src/lib/{handle-component.d.ts → angular/handle-component.d.ts} +1 -1
- package/src/lib/angular/handle-component.js.map +1 -0
- package/src/lib/angular/has-accordion-component.d.ts +4 -3
- package/src/lib/angular/has-accordion-component.js +6 -1
- package/src/lib/angular/has-accordion-component.js.map +1 -1
- package/src/lib/angular/has-component.d.ts +2 -2
- package/src/lib/angular/has-component.js +2 -2
- package/src/lib/angular/has-component.js.map +1 -1
- package/src/lib/angular/has-dialog-component.d.ts +5 -0
- package/src/lib/angular/has-dialog-component.js +17 -0
- package/src/lib/angular/has-dialog-component.js.map +1 -0
- package/src/lib/angular/has-project-feature.d.ts +4 -3
- package/src/lib/angular/has-project-feature.js +5 -1
- package/src/lib/angular/has-project-feature.js.map +1 -1
- package/src/lib/angular/has-table-component.d.ts +2 -5
- package/src/lib/angular/has-table-component.js +5 -2
- package/src/lib/angular/has-table-component.js.map +1 -1
- package/src/lib/auto-import.js +2 -9
- package/src/lib/auto-import.js.map +1 -1
- package/src/lib/coerce-class-constructor.d.ts +3 -0
- package/src/lib/coerce-class-constructor.js +3 -0
- package/src/lib/coerce-class-constructor.js.map +1 -1
- package/src/lib/coerce-class-method.d.ts +3 -0
- package/src/lib/coerce-class-method.js +3 -0
- package/src/lib/coerce-class-method.js.map +1 -1
- package/src/lib/coerce-class.d.ts +3 -0
- package/src/lib/coerce-class.js +3 -0
- package/src/lib/coerce-class.js.map +1 -1
- package/src/lib/coerce-source-file.d.ts +3 -0
- package/src/lib/coerce-source-file.js +3 -0
- package/src/lib/coerce-source-file.js.map +1 -1
- package/src/lib/coerce-variable-declaration.d.ts +5 -2
- package/src/lib/coerce-variable-declaration.js +9 -3
- package/src/lib/coerce-variable-declaration.js.map +1 -1
- package/src/lib/fix-missing-imports.js +2 -9
- package/src/lib/fix-missing-imports.js.map +1 -1
- package/src/lib/get-class-decorator-arguments.d.ts +3 -0
- package/src/lib/get-class-decorator-arguments.js.map +1 -1
- package/src/lib/get-coerce-array-literal-form-object-literal.d.ts +3 -0
- package/src/lib/get-coerce-array-literal-form-object-literal.js +3 -0
- package/src/lib/get-coerce-array-literal-form-object-literal.js.map +1 -1
- package/src/lib/get-form-providers-source-file.js +2 -2
- package/src/lib/get-form-providers-source-file.js.map +1 -1
- package/src/lib/nest/add-nest-controller.js +2 -2
- package/src/lib/nest/add-nest-controller.js.map +1 -1
- package/src/lib/nest/add-nest-module-controller.js +2 -2
- package/src/lib/nest/add-nest-module-controller.js.map +1 -1
- package/src/lib/nest/add-nest-module-import.d.ts +3 -0
- package/src/lib/nest/add-nest-module-import.js +7 -4
- package/src/lib/nest/add-nest-module-import.js.map +1 -1
- package/src/lib/nest/add-nest-module-provider.d.ts +3 -0
- package/src/lib/nest/add-nest-module-provider.js +6 -3
- package/src/lib/nest/add-nest-module-provider.js.map +1 -1
- package/src/lib/nest/add-nest-module-to-app-module.d.ts +3 -4
- package/src/lib/nest/add-nest-module-to-app-module.js +15 -5
- package/src/lib/nest/add-nest-module-to-app-module.js.map +1 -1
- package/src/lib/nest/add-nest-provider-to-array.d.ts +5 -2
- package/src/lib/nest/add-nest-provider-to-array.js +10 -6
- package/src/lib/nest/add-nest-provider-to-array.js.map +1 -1
- package/src/lib/{add-operation-to-controller.d.ts → nest/add-operation-to-controller.d.ts} +7 -2
- package/src/lib/{add-operation-to-controller.js → nest/add-operation-to-controller.js} +33 -16
- package/src/lib/nest/add-operation-to-controller.js.map +1 -0
- package/src/lib/nest/assert-nest-project.d.ts +7 -0
- package/src/lib/nest/assert-nest-project.js +15 -0
- package/src/lib/nest/assert-nest-project.js.map +1 -0
- package/src/lib/nest/build-nest-base-path.d.ts +2 -2
- package/src/lib/nest/build-nest-controller-name.d.ts +0 -3
- package/src/lib/nest/build-nest-controller-name.js +12 -8
- package/src/lib/nest/build-nest-controller-name.js.map +1 -1
- package/src/lib/nest/coerce-dto-class.d.ts +17 -3
- package/src/lib/nest/coerce-dto-class.js +72 -77
- package/src/lib/nest/coerce-dto-class.js.map +1 -1
- package/src/lib/nest/coerce-form-submit-operation.d.ts +2 -1
- package/src/lib/nest/coerce-form-submit-operation.js +11 -6
- package/src/lib/nest/coerce-form-submit-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-by-id-operation.d.ts +3 -13
- package/src/lib/nest/coerce-get-by-id-operation.js +10 -14
- package/src/lib/nest/coerce-get-by-id-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-children-operation.js +27 -32
- package/src/lib/nest/coerce-get-children-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-data-grid-operation.d.ts +1 -1
- package/src/lib/nest/coerce-get-data-grid-operation.js +10 -14
- package/src/lib/nest/coerce-get-data-grid-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-page-operation.d.ts +36 -5
- package/src/lib/nest/coerce-get-page-operation.js +192 -56
- package/src/lib/nest/coerce-get-page-operation.js.map +1 -1
- package/src/lib/nest/coerce-get-root-operation.js +27 -31
- package/src/lib/nest/coerce-get-root-operation.js.map +1 -1
- package/src/lib/nest/coerce-nest-controller.d.ts +8 -5
- package/src/lib/nest/coerce-nest-controller.js +64 -22
- package/src/lib/nest/coerce-nest-controller.js.map +1 -1
- package/src/lib/nest/coerce-nest-module.d.ts +4 -4
- package/src/lib/nest/coerce-nest-module.js +44 -18
- package/src/lib/nest/coerce-nest-module.js.map +1 -1
- package/src/lib/nest/coerce-nest-service-project.d.ts +4 -1
- package/src/lib/nest/coerce-nest-service-project.js +8 -5
- package/src/lib/nest/coerce-nest-service-project.js.map +1 -1
- package/src/lib/nest/coerce-operation.d.ts +14 -15
- package/src/lib/nest/coerce-operation.js +51 -33
- package/src/lib/nest/coerce-operation.js.map +1 -1
- package/src/lib/nest/coerce-options-operation.d.ts +8 -0
- package/src/lib/nest/coerce-options-operation.js +52 -0
- package/src/lib/nest/coerce-options-operation.js.map +1 -0
- package/src/lib/nest/coerce-page-dto-class.d.ts +1 -1
- package/src/lib/nest/coerce-page-dto-class.js +9 -3
- package/src/lib/nest/coerce-page-dto-class.js.map +1 -1
- package/src/lib/nest/coerce-row-dto-class.d.ts +7 -8
- package/src/lib/nest/coerce-row-dto-class.js +11 -12
- package/src/lib/nest/coerce-row-dto-class.js.map +1 -1
- package/src/lib/nest/coerce-submit-data-grid-operation.js +2 -10
- package/src/lib/nest/coerce-submit-data-grid-operation.js.map +1 -1
- package/src/lib/nest/coerce-table-select-operation.d.ts +6 -0
- package/src/lib/nest/coerce-table-select-operation.js +24 -0
- package/src/lib/nest/coerce-table-select-operation.js.map +1 -0
- package/src/lib/nest/coerce-table-select-value-resolve-operation.d.ts +8 -0
- package/src/lib/nest/coerce-table-select-value-resolve-operation.js +40 -0
- package/src/lib/nest/coerce-table-select-value-resolve-operation.js.map +1 -0
- package/src/lib/nest/coerce-tree-operation.d.ts +6 -0
- package/src/lib/nest/coerce-tree-operation.js +56 -0
- package/src/lib/nest/coerce-tree-operation.js.map +1 -0
- package/src/lib/{create-dto-class.d.ts → nest/create-dto-class.d.ts} +9 -0
- package/src/lib/{create-dto-class.js → nest/create-dto-class.js} +18 -14
- package/src/lib/nest/create-dto-class.js.map +1 -0
- package/src/lib/nest/find-nest-module-source-file.d.ts +3 -0
- package/src/lib/nest/find-nest-module-source-file.js +3 -0
- package/src/lib/nest/find-nest-module-source-file.js.map +1 -1
- package/src/lib/nest/get-nest-module-metadata.d.ts +3 -0
- package/src/lib/nest/get-nest-module-metadata.js +4 -1
- package/src/lib/nest/get-nest-module-metadata.js.map +1 -1
- package/src/lib/nest/has-nest-controller.d.ts +2 -3
- package/src/lib/nest/has-nest-controller.js +1 -2
- package/src/lib/nest/has-nest-controller.js.map +1 -1
- package/src/lib/nest/has-nest-module-class.d.ts +3 -0
- package/src/lib/nest/has-nest-module-class.js +3 -0
- package/src/lib/nest/has-nest-module-class.js.map +1 -1
- package/src/lib/nest/has-nest-module.d.ts +1 -1
- package/src/lib/nest/is-nest-module-class.d.ts +3 -0
- package/src/lib/nest/is-nest-module-class.js +3 -0
- package/src/lib/nest/is-nest-module-class.js.map +1 -1
- package/src/lib/nest/nest-provider-object.d.ts +3 -0
- package/src/lib/{operation-id-utilities.d.ts → nest/operation-id-utilities.d.ts} +8 -6
- package/src/lib/nest/operation-id-utilities.js +104 -0
- package/src/lib/nest/operation-id-utilities.js.map +1 -0
- package/src/lib/nest/project-utilities.d.ts +20 -6
- package/src/lib/nest/project-utilities.js +7 -1
- package/src/lib/nest/project-utilities.js.map +1 -1
- package/src/lib/nest/remove-nest-module-provider.d.ts +6 -0
- package/src/lib/nest/remove-nest-module-provider.js +16 -0
- package/src/lib/nest/remove-nest-module-provider.js.map +1 -0
- package/src/lib/nest/remove-nest-provider-to-array.d.ts +6 -0
- package/src/lib/nest/remove-nest-provider-to-array.js +32 -0
- package/src/lib/nest/remove-nest-provider-to-array.js.map +1 -0
- package/src/lib/organize-imports.js +2 -9
- package/src/lib/organize-imports.js.map +1 -1
- package/src/lib/provider-object.d.ts +3 -0
- package/src/lib/ts-morph/apply-ts-morph-project.d.ts +1 -1
- package/src/lib/ts-morph/apply-ts-morph-project.js +5 -67
- package/src/lib/ts-morph/apply-ts-morph-project.js.map +1 -1
- package/src/lib/ts-morph/coerce-class-property.d.ts +3 -0
- package/src/lib/ts-morph/coerce-class-property.js +4 -1
- package/src/lib/ts-morph/coerce-class-property.js.map +1 -1
- package/src/lib/ts-morph/coerce-decorator.d.ts +3 -0
- package/src/lib/ts-morph/coerce-decorator.js +3 -0
- package/src/lib/ts-morph/coerce-decorator.js.map +1 -1
- package/src/lib/ts-morph/coerce-imports.d.ts +3 -0
- package/src/lib/ts-morph/coerce-imports.js +3 -0
- package/src/lib/ts-morph/coerce-imports.js.map +1 -1
- package/src/lib/ts-morph/coerce-interface.d.ts +9 -2
- package/src/lib/ts-morph/coerce-interface.js +20 -5
- package/src/lib/ts-morph/coerce-interface.js.map +1 -1
- package/src/lib/ts-morph/coerce-statements.d.ts +3 -0
- package/src/lib/ts-morph/coerce-statements.js +3 -0
- package/src/lib/ts-morph/coerce-statements.js.map +1 -1
- package/src/lib/ts-morph/coerce-type-alias.d.ts +4 -0
- package/src/lib/ts-morph/coerce-type-alias.js +12 -0
- package/src/lib/ts-morph/coerce-type-alias.js.map +1 -0
- package/src/lib/ts-morph/find-function.d.ts +6 -0
- package/src/lib/ts-morph/find-function.js +3 -0
- package/src/lib/ts-morph/find-function.js.map +1 -1
- package/src/lib/ts-morph/write-type.d.ts +6 -0
- package/src/lib/ts-morph/write-type.js +34 -0
- package/src/lib/ts-morph/write-type.js.map +1 -0
- package/src/lib/ts-morph-transform.d.ts +27 -14
- package/src/lib/ts-morph-transform.js +11 -40
- package/src/lib/ts-morph-transform.js.map +1 -1
- package/src/lib/types/form-definition-control.d.ts +9 -0
- package/src/lib/types/form-definition-control.js +3 -0
- package/src/lib/types/form-definition-control.js.map +1 -0
- package/src/lib/add-component-animations.js.map +0 -1
- package/src/lib/add-component-fake-provider.js.map +0 -1
- package/src/lib/add-component-input.js.map +0 -1
- package/src/lib/add-component-provider.js.map +0 -1
- package/src/lib/add-control-validator.js.map +0 -1
- package/src/lib/add-dependency-injection.js.map +0 -1
- package/src/lib/add-ng-module-import.js.map +0 -1
- package/src/lib/add-ng-module-provider.js.map +0 -1
- package/src/lib/add-operation-to-controller.js.map +0 -1
- package/src/lib/create-dto-class.js.map +0 -1
- package/src/lib/find-component-module-source-file.js.map +0 -1
- package/src/lib/find-component-source-file.js.map +0 -1
- package/src/lib/find-routing-module.js.map +0 -1
- package/src/lib/get-component-class.js.map +0 -1
- package/src/lib/get-component-options-object.js.map +0 -1
- package/src/lib/get-ng-module-options-object.js.map +0 -1
- package/src/lib/handle-component-module.js.map +0 -1
- package/src/lib/handle-component.js.map +0 -1
- package/src/lib/index.d.ts +0 -48
- package/src/lib/index.js +0 -52
- package/src/lib/index.js.map +0 -1
- package/src/lib/nest/index.d.ts +0 -31
- package/src/lib/nest/index.js +0 -35
- package/src/lib/nest/index.js.map +0 -1
- package/src/lib/operation-id-utilities.js +0 -59
- package/src/lib/operation-id-utilities.js.map +0 -1
- package/src/lib/ts-morph/index.d.ts +0 -10
- package/src/lib/ts-morph/index.js +0 -14
- package/src/lib/ts-morph/index.js.map +0 -1
- /package/src/lib/{add-component-animations.d.ts → angular/add-component-animations.d.ts} +0 -0
- /package/src/lib/{add-component-input.d.ts → angular/add-component-input.d.ts} +0 -0
- /package/src/lib/{add-control-validator.d.ts → angular/add-control-validator.d.ts} +0 -0
- /package/src/lib/{add-control-validator.js → angular/add-control-validator.js} +0 -0
- /package/src/lib/{add-ng-module-import.d.ts → angular/add-ng-module-import.d.ts} +0 -0
- /package/src/lib/{find-component-module-source-file.d.ts → angular/find-component-module-source-file.d.ts} +0 -0
- /package/src/lib/{find-component-module-source-file.js → angular/find-component-module-source-file.js} +0 -0
- /package/src/lib/{find-component-source-file.d.ts → angular/find-component-source-file.d.ts} +0 -0
- /package/src/lib/{find-component-source-file.js → angular/find-component-source-file.js} +0 -0
- /package/src/lib/{find-routing-module.d.ts → angular/find-routing-module.d.ts} +0 -0
- /package/src/lib/{find-routing-module.js → angular/find-routing-module.js} +0 -0
- /package/src/lib/{get-component-class.d.ts → angular/get-component-class.d.ts} +0 -0
- /package/src/lib/{get-component-class.js → angular/get-component-class.js} +0 -0
- /package/src/lib/{get-component-options-object.d.ts → angular/get-component-options-object.d.ts} +0 -0
- /package/src/lib/{get-component-options-object.js → angular/get-component-options-object.js} +0 -0
- /package/src/lib/{get-ng-module-options-object.d.ts → angular/get-ng-module-options-object.d.ts} +0 -0
- /package/src/lib/{get-ng-module-options-object.js → angular/get-ng-module-options-object.js} +0 -0
- /package/src/lib/{handle-component-module.js → angular/handle-component-module.js} +0 -0
- /package/src/lib/{handle-component.js → angular/handle-component.js} +0 -0
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceFormSubmitOperation = void 0;
|
|
4
|
+
const utilities_1 = require("@rxap/utilities");
|
|
5
|
+
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
4
6
|
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
5
7
|
const coerce_operation_1 = require("./coerce-operation");
|
|
6
|
-
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
7
8
|
function CoerceFormSubmitOperation(options) {
|
|
8
|
-
let { tsMorphTransform,
|
|
9
|
+
let { tsMorphTransform, controllerName, propertyList, bodyDtoName, context, } = options;
|
|
9
10
|
tsMorphTransform !== null && tsMorphTransform !== void 0 ? tsMorphTransform : (tsMorphTransform = () => ({}));
|
|
10
|
-
paramList !== null && paramList !== void 0 ? paramList : (paramList = []);
|
|
11
11
|
propertyList !== null && propertyList !== void 0 ? propertyList : (propertyList = []);
|
|
12
|
+
bodyDtoName !== null && bodyDtoName !== void 0 ? bodyDtoName : (bodyDtoName = (0, utilities_1.joinWithDash)([context, controllerName]));
|
|
12
13
|
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), { operationName: 'submit', tsMorphTransform: (project, sourceFile, classDeclaration, controllerName) => {
|
|
13
|
-
const { className: dtoClassName, filePath: dtoFilePath, } = (0, coerce_dto_class_1.CoerceDtoClass)(
|
|
14
|
+
const { className: dtoClassName, filePath: dtoFilePath, } = (0, coerce_dto_class_1.CoerceDtoClass)({
|
|
15
|
+
project,
|
|
16
|
+
name: bodyDtoName,
|
|
17
|
+
propertyList,
|
|
18
|
+
});
|
|
14
19
|
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
15
20
|
namedImports: [dtoClassName],
|
|
16
|
-
moduleSpecifier:
|
|
21
|
+
moduleSpecifier: dtoFilePath,
|
|
17
22
|
});
|
|
18
|
-
return Object.assign({ body: dtoClassName, method: 'post'
|
|
23
|
+
return Object.assign({ body: dtoClassName, method: 'post' }, tsMorphTransform(project, sourceFile, classDeclaration, controllerName));
|
|
19
24
|
} }));
|
|
20
25
|
}
|
|
21
26
|
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,yDAAoD;AACpD,yDAG4B;
|
|
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,+CAA+C;AAC/C,+DAA2D;AAC3D,yDAAoD;AACpD,yDAG4B;AAQ5B,SAAgB,yBAAyB,CAAC,OAAyC;IACjF,IAAI,EACF,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,WAAW,EACX,OAAO,GACR,GAAG,OAAO,CAAC;IACZ,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,IAAhB,gBAAgB,GAAK,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAC;IAEhC,YAAY,aAAZ,YAAY,cAAZ,YAAY,IAAZ,YAAY,GAAK,EAAE,EAAC;IACpB,WAAW,aAAX,WAAW,cAAX,WAAW,IAAX,WAAW,GAAK,IAAA,wBAAY,EAAC,CAAE,OAAO,EAAE,cAAc,CAAE,CAAC,EAAC;IAE1D,OAAO,IAAA,kCAAe,kCACjB,OAAO,KACV,aAAa,EAAE,QAAQ,EACvB,gBAAgB,EAAE,CAChB,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,EAAE;YAEF,MAAM,EACJ,SAAS,EAAE,YAAY,EACvB,QAAQ,EAAE,WAAW,GACtB,GAAG,IAAA,iCAAc,EAAC;gBACjB,OAAO;gBACP,IAAI,EAAE,WAAY;gBAClB,YAAY;aACb,CAAC,CAAC;YAEH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,YAAY,CAAE;gBAC9B,eAAe,EAAE,WAAW;aAC7B,CAAC,CAAC;YAEH,uBACE,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,IACX,gBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,CAAC,EAC3E;QAEJ,CAAC,IACD,CAAC;AAEL,CAAC;AA9CD,8DA8CC"}
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DtoClassProperty } from '
|
|
3
|
-
export interface CoerceGetByIdControllerOptions {
|
|
4
|
-
name?: string;
|
|
5
|
-
controllerName?: string;
|
|
6
|
-
nestController?: string;
|
|
7
|
-
project: string;
|
|
8
|
-
feature: string;
|
|
9
|
-
shared: boolean;
|
|
10
|
-
module?: string;
|
|
11
|
-
nestModule?: string;
|
|
12
|
-
paramList?: OperationParameter[];
|
|
1
|
+
import { CoerceOperationOptions } from './coerce-operation';
|
|
2
|
+
import { DtoClassProperty } from './create-dto-class';
|
|
3
|
+
export interface CoerceGetByIdControllerOptions extends Omit<CoerceOperationOptions, 'operationName'> {
|
|
13
4
|
propertyList?: DtoClassProperty[];
|
|
14
|
-
skipCoerce?: boolean;
|
|
15
5
|
isArray?: boolean;
|
|
16
6
|
}
|
|
17
7
|
export declare function CoerceGetByIdOperation(options: CoerceGetByIdControllerOptions): import("@angular-devkit/schematics").Rule;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceGetByIdOperation = void 0;
|
|
4
|
-
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
5
|
-
const coerce_operation_1 = require("./coerce-operation");
|
|
6
4
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
5
|
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
8
|
-
const
|
|
6
|
+
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
7
|
+
const coerce_operation_1 = require("./coerce-operation");
|
|
9
8
|
function CoerceGetByIdOperation(options) {
|
|
10
|
-
let {
|
|
11
|
-
nestModule !== null && nestModule !== void 0 ? nestModule : (nestModule = module);
|
|
9
|
+
let { controllerName, isArray, nestModule, paramList, propertyList, } = options;
|
|
12
10
|
propertyList !== null && propertyList !== void 0 ? propertyList : (propertyList = []);
|
|
13
11
|
paramList !== null && paramList !== void 0 ? paramList : (paramList = []);
|
|
14
|
-
controllerName !== null && controllerName !== void 0 ? controllerName : (controllerName = name);
|
|
15
|
-
controllerName !== null && controllerName !== void 0 ? controllerName : (controllerName = nestController);
|
|
16
12
|
/**
|
|
17
13
|
* If the module is not specified. This controller has an own module. Else the
|
|
18
14
|
* module is originated by another controller.
|
|
@@ -43,9 +39,6 @@ function CoerceGetByIdOperation(options) {
|
|
|
43
39
|
nestModule = controllerName;
|
|
44
40
|
}
|
|
45
41
|
if (!paramList.some(param => param.name === 'uuid')) {
|
|
46
|
-
if (!nestModule) {
|
|
47
|
-
throw new schematics_1.SchematicsException('Could not determine the nest module name');
|
|
48
|
-
}
|
|
49
42
|
paramList.push({
|
|
50
43
|
name: 'uuid',
|
|
51
44
|
type: 'string',
|
|
@@ -53,12 +46,15 @@ function CoerceGetByIdOperation(options) {
|
|
|
53
46
|
fromParent: !isFirstBornSibling,
|
|
54
47
|
});
|
|
55
48
|
}
|
|
56
|
-
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), {
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), { nestModule, controllerName: controllerName, paramList, operationName: 'getById', tsMorphTransform: (project, sourceFile, classDeclaration, controllerName) => {
|
|
50
|
+
const { className: dtoClassName, filePath: dtoFilePath, } = (0, coerce_dto_class_1.CoerceDtoClass)({
|
|
51
|
+
project,
|
|
52
|
+
name: controllerName,
|
|
53
|
+
propertyList,
|
|
54
|
+
});
|
|
59
55
|
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
60
56
|
namedImports: [dtoClassName],
|
|
61
|
-
moduleSpecifier:
|
|
57
|
+
moduleSpecifier: dtoFilePath,
|
|
62
58
|
});
|
|
63
59
|
return {
|
|
64
60
|
returnType: dtoClassName + (isArray ? '[]' : ''),
|
|
@@ -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":";;;AAAA,
|
|
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":";;;AAAA,qEAA0D;AAC1D,+DAA2D;AAC3D,yDAAoD;AACpD,yDAG4B;AAQ5B,SAAgB,sBAAsB,CAAC,OAAuC;IAC5E,IAAI,EACF,cAAc,EACd,OAAO,EACP,UAAU,EACV,SAAS,EACT,YAAY,GACb,GAAG,OAAO,CAAC;IAEZ,YAAY,aAAZ,YAAY,cAAZ,YAAY,IAAZ,YAAY,GAAK,EAAE,EAAC;IACpB,SAAS,aAAT,SAAS,cAAT,SAAS,IAAT,SAAS,GAAK,EAAE,EAAC;IAEjB;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,kBAAkB,GAAG,CAAC,UAAU,IAAI,UAAU,KAAK,cAAc,CAAC;IAExE,IAAI,kBAAkB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,EAAE;QAC5E,YAAY,CAAC,OAAO,CAAC;YACnB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC;KACJ;IAED,IAAI,kBAAkB,EAAE;QACtB,UAAU,GAAG,cAAc,CAAC;KAC7B;IAED,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,EAAE;QACnD,SAAS,CAAC,IAAI,CAAC;YACb,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,mCAAY,EAAC,UAAW,EAAE,OAAO,CAAC;YAC1E,UAAU,EAAE,CAAC,kBAAkB;SAChC,CAAC,CAAC;KACJ;IAED,OAAO,IAAA,kCAAe,kCACjB,OAAO,KACV,UAAU,EACV,cAAc,EAAE,cAAe,EAC/B,SAAS,EACT,aAAa,EAAE,SAAS,EACxB,gBAAgB,EAAE,CAChB,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,EAAE;YAEF,MAAM,EACJ,SAAS,EAAE,YAAY,EACvB,QAAQ,EAAE,WAAW,GACtB,GAAG,IAAA,iCAAc,EAAC;gBACjB,OAAO;gBACP,IAAI,EAAE,cAAc;gBACpB,YAAY;aACb,CAAC,CAAC;YAEH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,YAAY,CAAE;gBAC9B,eAAe,EAAE,WAAW;aAC7B,CAAC,CAAC;YAEH,OAAO;gBACL,UAAU,EAAE,YAAY,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;aACjD,CAAC;QAEJ,CAAC,IACD,CAAC;AAEL,CAAC;AAvFD,wDAuFC"}
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceGetChildrenOperation = void 0;
|
|
4
|
-
const coerce_operation_1 = require("./coerce-operation");
|
|
5
|
-
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
6
4
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
5
|
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
8
|
-
const
|
|
6
|
+
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
7
|
+
const coerce_operation_1 = require("./coerce-operation");
|
|
9
8
|
function CoerceGetChildrenOperation(options) {
|
|
10
|
-
let { tsMorphTransform,
|
|
9
|
+
let { tsMorphTransform, controllerName, paramList, } = options;
|
|
11
10
|
tsMorphTransform !== null && tsMorphTransform !== void 0 ? tsMorphTransform : (tsMorphTransform = () => ({}));
|
|
12
|
-
controllerName !== null && controllerName !== void 0 ? controllerName : (controllerName = nestController);
|
|
13
|
-
controllerName !== null && controllerName !== void 0 ? controllerName : (controllerName = name);
|
|
14
|
-
if (!controllerName) {
|
|
15
|
-
throw new schematics_1.SchematicsException('No controller name provided!');
|
|
16
|
-
}
|
|
17
|
-
if (!name) {
|
|
18
|
-
throw new schematics_1.SchematicsException('No name provided!');
|
|
19
|
-
}
|
|
20
11
|
controllerName = (0, schematics_utilities_1.CoerceSuffix)(controllerName, '-tree-table');
|
|
21
12
|
paramList !== null && paramList !== void 0 ? paramList : (paramList = []);
|
|
22
13
|
paramList.push({
|
|
@@ -25,24 +16,28 @@ function CoerceGetChildrenOperation(options) {
|
|
|
25
16
|
});
|
|
26
17
|
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), {
|
|
27
18
|
// TODO : remove after migration to controllerName
|
|
28
|
-
|
|
29
|
-
const { className, filePath, } = (0, coerce_dto_class_1.CoerceDtoClass)(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
19
|
+
controllerName, operationName: 'get-children', paramList, tsMorphTransform: (project, sourceFile, classDeclaration, controllerName) => {
|
|
20
|
+
const { className, filePath, } = (0, coerce_dto_class_1.CoerceDtoClass)({
|
|
21
|
+
project,
|
|
22
|
+
name: (0, schematics_utilities_1.CoerceSuffix)(controllerName, '-item'),
|
|
23
|
+
propertyList: [
|
|
24
|
+
{
|
|
25
|
+
name: 'uuid',
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'hasChildren',
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'children',
|
|
34
|
+
type: (0, schematics_utilities_1.classify)((0, schematics_utilities_1.CoerceSuffix)(controllerName, '-item-dto')),
|
|
35
|
+
isArray: true,
|
|
36
|
+
isOptional: true,
|
|
37
|
+
isType: true,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
});
|
|
46
41
|
(0, coerce_imports_1.CoerceImports)(sourceFile, [
|
|
47
42
|
{
|
|
48
43
|
namedImports: ['plainToInstance'],
|
|
@@ -50,11 +45,11 @@ function CoerceGetChildrenOperation(options) {
|
|
|
50
45
|
},
|
|
51
46
|
{
|
|
52
47
|
namedImports: ['classTransformOptions'],
|
|
53
|
-
moduleSpecifier: '@rxap/nest
|
|
48
|
+
moduleSpecifier: '@rxap/nest-utilities',
|
|
54
49
|
},
|
|
55
50
|
{
|
|
56
51
|
namedImports: [className],
|
|
57
|
-
moduleSpecifier:
|
|
52
|
+
moduleSpecifier: filePath,
|
|
58
53
|
},
|
|
59
54
|
]);
|
|
60
55
|
return Object.assign({ returnType: className + '[]' }, tsMorphTransform(project, sourceFile, classDeclaration, controllerName));
|
|
@@ -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,qEAGoC;AACpC,+DAA2D;AAC3D,yDAAoD;AACpD,yDAG4B;AAI5B,SAAgB,0BAA0B,CAAC,OAAoD;IAC7F,IAAI,EACF,gBAAgB,EAChB,cAAc,EACd,SAAS,GACV,GAAG,OAAO,CAAC;IACZ,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,IAAhB,gBAAgB,GAAK,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAC;IAChC,cAAc,GAAG,IAAA,mCAAY,EAAC,cAAc,EAAE,aAAa,CAAC,CAAC;IAC7D,SAAS,aAAT,SAAS,cAAT,SAAS,IAAT,SAAS,GAAK,EAAE,EAAC;IACjB,SAAS,CAAC,IAAI,CAAC;QACb,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IACH,OAAO,IAAA,kCAAe,kCACjB,OAAO;QACV,kDAAkD;QAClD,cAAc,EACd,aAAa,EAAE,cAAc,EAC7B,SAAS,EACT,gBAAgB,EAAE,CAChB,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,EAAE;YAEF,MAAM,EACJ,SAAS,EACT,QAAQ,GACT,GAAG,IAAA,iCAAc,EAAC;gBACjB,OAAO;gBACP,IAAI,EAAE,IAAA,mCAAY,EAAC,cAAc,EAAE,OAAO,CAAC;gBAC3C,YAAY,EAAE;oBACZ;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,QAAQ;qBACf;oBACD;wBACE,IAAI,EAAE,aAAa;wBACnB,IAAI,EAAE,SAAS;qBAChB;oBACD;wBACE,IAAI,EAAE,UAAU;wBAChB,IAAI,EAAE,IAAA,+BAAQ,EAAC,IAAA,mCAAY,EAAC,cAAc,EAAE,WAAW,CAAC,CAAC;wBACzD,OAAO,EAAE,IAAI;wBACb,UAAU,EAAE,IAAI;wBAChB,MAAM,EAAE,IAAI;qBACb;iBACF;aACF,CAAC,CAAC;YAEH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB;oBACE,YAAY,EAAE,CAAE,iBAAiB,CAAE;oBACnC,eAAe,EAAE,mBAAmB;iBACrC;gBACD;oBACE,YAAY,EAAE,CAAE,uBAAuB,CAAE;oBACzC,eAAe,EAAE,sBAAsB;iBACxC;gBACD;oBACE,YAAY,EAAE,CAAE,SAAS,CAAE;oBAC3B,eAAe,EAAE,QAAQ;iBAC1B;aACF,CAAC,CAAC;YAEH,uBACE,UAAU,EAAE,SAAS,GAAG,IAAI,IACzB,gBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,CAAC,EAC3E;QACJ,CAAC,IACD,CAAC;AACL,CAAC;AAxED,gEAwEC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CoerceOperationOptions } from './coerce-operation';
|
|
2
|
-
import { DtoClassProperty } from '
|
|
2
|
+
import { DtoClassProperty } from './create-dto-class';
|
|
3
3
|
export interface CoerceGetDataGridOperationOptions extends Omit<CoerceOperationOptions, 'operationName'> {
|
|
4
4
|
collection?: boolean;
|
|
5
5
|
propertyList?: DtoClassProperty[];
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoerceGetDataGridOperation = void 0;
|
|
4
|
-
const coerce_operation_1 = require("./coerce-operation");
|
|
5
|
-
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
6
4
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
5
|
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
8
|
-
const
|
|
6
|
+
const coerce_dto_class_1 = require("./coerce-dto-class");
|
|
7
|
+
const coerce_operation_1 = require("./coerce-operation");
|
|
9
8
|
function CoerceGetDataGridOperation(options) {
|
|
10
|
-
let { tsMorphTransform, collection, propertyList, controllerName,
|
|
9
|
+
let { tsMorphTransform, collection, propertyList, controllerName, } = options;
|
|
11
10
|
collection !== null && collection !== void 0 ? collection : (collection = false);
|
|
12
11
|
tsMorphTransform !== null && tsMorphTransform !== void 0 ? tsMorphTransform : (tsMorphTransform = () => ({}));
|
|
13
12
|
propertyList !== null && propertyList !== void 0 ? propertyList : (propertyList = []);
|
|
14
|
-
controllerName !== null && controllerName !== void 0 ? controllerName : (controllerName = nestController);
|
|
15
|
-
controllerName !== null && controllerName !== void 0 ? controllerName : (controllerName = name);
|
|
16
|
-
if (!controllerName) {
|
|
17
|
-
throw new schematics_1.SchematicsException('No controller name provided!');
|
|
18
|
-
}
|
|
19
13
|
controllerName =
|
|
20
14
|
(0, schematics_utilities_1.CoerceSuffix)(controllerName, '-data-grid');
|
|
21
|
-
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
+
});
|
|
25
21
|
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
26
22
|
namedImports: [dtoClassName],
|
|
27
|
-
moduleSpecifier:
|
|
23
|
+
moduleSpecifier: dtoFilePath,
|
|
28
24
|
});
|
|
29
25
|
return Object.assign({ returnType: dtoClassName + (collection ? '[]' : '') }, tsMorphTransform(project, sourceFile, classDeclaration, controllerName));
|
|
30
26
|
} }));
|
|
@@ -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,qEAA0D;AAC1D,+DAA2D;AAC3D,yDAAoD;AACpD,yDAG4B;AAQ5B,SAAgB,0BAA0B,CAAC,OAAoD;IAC7F,IAAI,EACF,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,cAAc,GACf,GAAG,OAAO,CAAC;IACZ,UAAU,aAAV,UAAU,cAAV,UAAU,IAAV,UAAU,GAAK,KAAK,EAAC;IACrB,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,IAAhB,gBAAgB,GAAK,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAC;IAChC,YAAY,aAAZ,YAAY,cAAZ,YAAY,IAAZ,YAAY,GAAK,EAAE,EAAC;IACpB,cAAc;QACZ,IAAA,mCAAY,EAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAE7C,OAAO,IAAA,kCAAe,kCACjB,OAAO,KACV,cAAc,EACd,aAAa,EAAE,KAAK,EACpB,gBAAgB,EAAE,CAChB,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,EAAE;YAEF,MAAM,EACJ,SAAS,EAAE,YAAY,EACvB,QAAQ,EAAE,WAAW,GACtB,GAAG,IAAA,iCAAc,EAAC;gBACjB,OAAO;gBACP,IAAI,EAAE,cAAc;gBACpB,YAAY;aACb,CAAC,CAAC;YAEH,IAAA,8BAAa,EAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,YAAY,CAAE;gBAC9B,eAAe,EAAE,WAAW;aAC7B,CAAC,CAAC;YAEH,uBACE,UAAU,EAAE,YAAY,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAChD,gBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,CAAC,EAC3E;QAEJ,CAAC,IACD,CAAC;AAEL,CAAC;AA9CD,gEA8CC"}
|
|
@@ -1,8 +1,39 @@
|
|
|
1
|
+
import { ClassDeclaration, Project, SourceFile } from 'ts-morph';
|
|
2
|
+
import { OperationOptions } from './add-operation-to-controller';
|
|
1
3
|
import { CoerceOperationOptions } from './coerce-operation';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { DtoClassProperty } from './create-dto-class';
|
|
5
|
+
export interface GetPageOperationColumn {
|
|
6
|
+
name: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
/**
|
|
9
|
+
* the property name of the source object. if not defined the name will be used
|
|
10
|
+
*/
|
|
11
|
+
source?: string;
|
|
7
12
|
}
|
|
13
|
+
export interface CoerceGetPageOperationOptions extends Omit<Omit<CoerceOperationOptions, 'operationName'>, 'tsMorphTransform'> {
|
|
14
|
+
columnList: GetPageOperationColumn[];
|
|
15
|
+
tsMorphTransform?: (project: Project, sourceFile: SourceFile, classDeclaration: ClassDeclaration, controllerName: string, pageClassName: string, rowClassName: string) => Partial<OperationOptions>;
|
|
16
|
+
/**
|
|
17
|
+
* the name of the property used as row id value. defaults to the value 'uuid'. If null the __rowId property will be
|
|
18
|
+
* set to the absolute row index absolute row index = page * pageSize + rowIndex
|
|
19
|
+
*/
|
|
20
|
+
rowIdProperty?: string | null;
|
|
21
|
+
operationName?: string;
|
|
22
|
+
/**
|
|
23
|
+
* true - the suffix '-table' will not be enforced for the controller name
|
|
24
|
+
*/
|
|
25
|
+
skipCoerceTableSuffix?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The base name of the page and row DTO class name. Defaults to the controller name
|
|
28
|
+
*/
|
|
29
|
+
responseDtoName?: string;
|
|
30
|
+
coerceToRowDtoMethod?: (sourceFile: SourceFile, classDeclaration: ClassDeclaration, rowClassName: string, options: CoerceGetPageOperationOptions) => void;
|
|
31
|
+
coerceToPageDtoMethod?: (sourceFile: SourceFile, classDeclaration: ClassDeclaration, pageClassName: string, rowClassName: string, options: CoerceGetPageOperationOptions) => void;
|
|
32
|
+
coerceGetPageDataMethod?: (sourceFile: SourceFile, classDeclaration: ClassDeclaration, options: CoerceGetPageOperationOptions) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function GetPageOperationColumnToDtoClassProperty(column: GetPageOperationColumn): DtoClassProperty;
|
|
35
|
+
export declare function GetPageOperationColumnToCodeText(column: GetPageOperationColumn): string;
|
|
36
|
+
export declare function CoerceToRowDtoMethod(sourceFile: SourceFile, classDeclaration: ClassDeclaration, rowClassName: string, options: CoerceGetPageOperationOptions): void;
|
|
37
|
+
export declare function CoerceToPageDtoMethod(sourceFile: SourceFile, classDeclaration: ClassDeclaration, pageClassName: string, rowClassName: string, options: CoerceGetPageOperationOptions): void;
|
|
38
|
+
export declare function CoerceGetPageDataMethod(sourceFile: SourceFile, classDeclaration: ClassDeclaration, options: CoerceGetPageOperationOptions): void;
|
|
8
39
|
export declare function CoerceGetPageOperation(options: Readonly<CoerceGetPageOperationOptions>): import("@angular-devkit/schematics").Rule;
|
|
@@ -1,45 +1,194 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoerceGetPageOperation = void 0;
|
|
4
|
-
const coerce_operation_1 = require("./coerce-operation");
|
|
3
|
+
exports.CoerceGetPageOperation = exports.CoerceGetPageDataMethod = exports.CoerceToPageDtoMethod = exports.CoerceToRowDtoMethod = exports.GetPageOperationColumnToCodeText = exports.GetPageOperationColumnToDtoClassProperty = void 0;
|
|
5
4
|
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
+
const utilities_1 = require("@rxap/utilities");
|
|
6
|
+
const ts_morph_1 = require("ts-morph");
|
|
7
|
+
const coerce_class_method_1 = require("../coerce-class-method");
|
|
8
|
+
const coerce_imports_1 = require("../ts-morph/coerce-imports");
|
|
9
|
+
const coerce_type_alias_1 = require("../ts-morph/coerce-type-alias");
|
|
10
|
+
const coerce_operation_1 = require("./coerce-operation");
|
|
6
11
|
const coerce_page_dto_class_1 = require("./coerce-page-dto-class");
|
|
7
12
|
const coerce_row_dto_class_1 = require("./coerce-row-dto-class");
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
function GetPageOperationColumnToDtoClassProperty(column) {
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
|
+
return {
|
|
16
|
+
name: column.name,
|
|
17
|
+
type: (_b = (_a = column.type) === null || _a === void 0 ? void 0 : _a.replace(/\[]$/, '').replace(/^Array<(.+)>/, '$1')) !== null && _b !== void 0 ? _b : 'unknown',
|
|
18
|
+
isArray: ((_c = column.type) === null || _c === void 0 ? void 0 : _c.endsWith('[]')) || ((_d = column.type) === null || _d === void 0 ? void 0 : _d.startsWith('Array<')),
|
|
19
|
+
isOptional: false,
|
|
20
|
+
isType: false,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
exports.GetPageOperationColumnToDtoClassProperty = GetPageOperationColumnToDtoClassProperty;
|
|
24
|
+
function GetPageOperationColumnToCodeText(column) {
|
|
25
|
+
var _a;
|
|
26
|
+
let propertyName = (0, schematics_utilities_1.camelize)(column.name);
|
|
27
|
+
const prefixMatch = column.name.match(/^(_+)/);
|
|
28
|
+
if (prefixMatch) {
|
|
29
|
+
propertyName = (0, schematics_utilities_1.camelize)(column.name.replace(/^_+/, ''));
|
|
30
|
+
propertyName = prefixMatch[0] + propertyName;
|
|
31
|
+
}
|
|
32
|
+
return `${propertyName}: item.${(_a = column.source) !== null && _a !== void 0 ? _a : (0, schematics_utilities_1.camelize)(column.name)}`;
|
|
33
|
+
}
|
|
34
|
+
exports.GetPageOperationColumnToCodeText = GetPageOperationColumnToCodeText;
|
|
35
|
+
function CoerceToRowDtoMethod(sourceFile, classDeclaration, rowClassName, options) {
|
|
36
|
+
var _a;
|
|
37
|
+
(0, coerce_class_method_1.CoerceClassMethod)(classDeclaration, 'toRowDto', {
|
|
38
|
+
scope: ts_morph_1.Scope.Private,
|
|
39
|
+
returnType: rowClassName,
|
|
40
|
+
parameters: [
|
|
41
|
+
{
|
|
42
|
+
name: 'item',
|
|
43
|
+
type: 'RawRowData',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'index',
|
|
47
|
+
type: 'number',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'pageIndex',
|
|
51
|
+
type: 'number',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'pageSize',
|
|
55
|
+
type: 'number',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'list',
|
|
59
|
+
type: 'RawRowData[]',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
statements: [
|
|
63
|
+
'return {',
|
|
64
|
+
' __rowId: ' +
|
|
65
|
+
(options.rowIdProperty === null ?
|
|
66
|
+
'(pageIndex * pageSize + index).toFixed(0)' :
|
|
67
|
+
`item.${(_a = options.rowIdProperty) !== null && _a !== void 0 ? _a : 'uuid'}`) + ',\n ',
|
|
68
|
+
options.columnList.map(GetPageOperationColumnToCodeText).join(',\n '),
|
|
69
|
+
'};',
|
|
70
|
+
],
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
exports.CoerceToRowDtoMethod = CoerceToRowDtoMethod;
|
|
74
|
+
function CoerceToPageDtoMethod(sourceFile, classDeclaration, pageClassName, rowClassName, options) {
|
|
75
|
+
(0, coerce_class_method_1.CoerceClassMethod)(classDeclaration, 'toPageDto', {
|
|
76
|
+
scope: ts_morph_1.Scope.Private,
|
|
77
|
+
returnType: pageClassName,
|
|
78
|
+
parameters: [
|
|
79
|
+
{
|
|
80
|
+
name: 'list',
|
|
81
|
+
type: 'RawRowData[]',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'total',
|
|
85
|
+
type: 'number',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'pageIndex',
|
|
89
|
+
type: 'number',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'pageSize',
|
|
93
|
+
type: 'number',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'sortBy',
|
|
97
|
+
type: 'string',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'sortDirection',
|
|
101
|
+
type: 'string',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'filter',
|
|
105
|
+
type: 'FilterQuery[]',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
statements: [
|
|
109
|
+
'return {',
|
|
110
|
+
' total, pageIndex, pageSize, sortBy, sortDirection, filter,',
|
|
111
|
+
` rows: list.map((item, index) => this.toRowDto(item, index, pageIndex, pageSize, list))`,
|
|
112
|
+
'};',
|
|
113
|
+
],
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
exports.CoerceToPageDtoMethod = CoerceToPageDtoMethod;
|
|
117
|
+
function CoerceGetPageDataMethod(sourceFile, classDeclaration, options) {
|
|
118
|
+
(0, coerce_class_method_1.CoerceClassMethod)(classDeclaration, 'getPageData', {
|
|
119
|
+
scope: ts_morph_1.Scope.Public,
|
|
120
|
+
returnType: 'Promise<{ list: RawRowData[], total: number }>',
|
|
121
|
+
isAsync: true,
|
|
122
|
+
parameters: [
|
|
123
|
+
{
|
|
124
|
+
name: 'sortBy',
|
|
125
|
+
type: 'string',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'sortDirection',
|
|
129
|
+
type: 'string',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'pageSize',
|
|
133
|
+
type: 'number',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'pageIndex',
|
|
137
|
+
type: 'number',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'filter',
|
|
141
|
+
type: 'FilterQuery[]',
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
statements: [
|
|
145
|
+
`const response = await ((() => { throw new NotImplementedException() })() as any).execute({
|
|
146
|
+
parameters: {
|
|
147
|
+
page: pageIndex,
|
|
148
|
+
size: pageSize,
|
|
149
|
+
sort: sortBy,
|
|
150
|
+
order: sortDirection,
|
|
151
|
+
filter: filter.map((item) => \`\${ item.column }:\${ item.filter }\`).join(';'),
|
|
152
|
+
},
|
|
153
|
+
});`,
|
|
154
|
+
'return {',
|
|
155
|
+
' list: response.entities ?? [],',
|
|
156
|
+
' total: response.maxCount ?? 0,',
|
|
157
|
+
'};',
|
|
158
|
+
],
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
exports.CoerceGetPageDataMethod = CoerceGetPageDataMethod;
|
|
10
162
|
function CoerceGetPageOperation(options) {
|
|
11
|
-
let {
|
|
163
|
+
let { skipCoerceTableSuffix, operationName, rowIdProperty, tsMorphTransform, columnList, controllerName, responseDtoName, context, coerceToRowDtoMethod, coerceToPageDtoMethod, coerceGetPageDataMethod, } = options;
|
|
12
164
|
tsMorphTransform !== null && tsMorphTransform !== void 0 ? tsMorphTransform : (tsMorphTransform = () => ({}));
|
|
13
|
-
controllerName
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), {
|
|
20
|
-
|
|
21
|
-
name: controllerName, nestController: controllerName, controllerName, operationName: 'get-page', tsMorphTransform: (project, sourceFile, classDeclaration, controllerName) => {
|
|
165
|
+
controllerName = skipCoerceTableSuffix ? controllerName : (0, schematics_utilities_1.CoerceSuffix)(controllerName, '-table');
|
|
166
|
+
operationName !== null && operationName !== void 0 ? operationName : (operationName = 'get-page');
|
|
167
|
+
responseDtoName !== null && responseDtoName !== void 0 ? responseDtoName : (responseDtoName = (0, utilities_1.joinWithDash)([context, controllerName]));
|
|
168
|
+
coerceToRowDtoMethod !== null && coerceToRowDtoMethod !== void 0 ? coerceToRowDtoMethod : (coerceToRowDtoMethod = CoerceToRowDtoMethod);
|
|
169
|
+
coerceToPageDtoMethod !== null && coerceToPageDtoMethod !== void 0 ? coerceToPageDtoMethod : (coerceToPageDtoMethod = CoerceToPageDtoMethod);
|
|
170
|
+
coerceGetPageDataMethod !== null && coerceGetPageDataMethod !== void 0 ? coerceGetPageDataMethod : (coerceGetPageDataMethod = CoerceGetPageDataMethod);
|
|
171
|
+
return (0, coerce_operation_1.CoerceOperation)(Object.assign(Object.assign({}, options), { controllerName,
|
|
172
|
+
operationName, tsMorphTransform: (project, sourceFile, classDeclaration, controllerName) => {
|
|
22
173
|
const { className: rowClassName, filePath: rowFilePath, } = (0, coerce_row_dto_class_1.CoerceRowDtoClass)({
|
|
23
174
|
project,
|
|
24
|
-
name:
|
|
25
|
-
propertyList: columnList.map(
|
|
26
|
-
|
|
27
|
-
return ({
|
|
28
|
-
name: column.name,
|
|
29
|
-
type: (_a = column.type) !== null && _a !== void 0 ? _a : 'unknown',
|
|
30
|
-
});
|
|
31
|
-
}),
|
|
175
|
+
name: responseDtoName,
|
|
176
|
+
propertyList: columnList.map(GetPageOperationColumnToDtoClassProperty),
|
|
177
|
+
rowIdType: rowIdProperty === null ? null : undefined,
|
|
32
178
|
});
|
|
33
179
|
const { className: pageClassName, filePath: pageFilePath, } = (0, coerce_page_dto_class_1.CoercePageDtoClass)({
|
|
34
180
|
project,
|
|
35
|
-
name:
|
|
181
|
+
name: responseDtoName,
|
|
36
182
|
rowClassName,
|
|
37
183
|
rowFilePath,
|
|
38
184
|
});
|
|
185
|
+
coerceGetPageDataMethod(sourceFile, classDeclaration, options);
|
|
186
|
+
coerceToRowDtoMethod(sourceFile, classDeclaration, rowClassName, options);
|
|
187
|
+
coerceToPageDtoMethod(sourceFile, classDeclaration, pageClassName, rowClassName, options);
|
|
39
188
|
(0, coerce_imports_1.CoerceImports)(sourceFile, [
|
|
40
189
|
{
|
|
41
190
|
namedImports: ['FilterQuery', 'FilterQueryPipe'],
|
|
42
|
-
moduleSpecifier: '@
|
|
191
|
+
moduleSpecifier: '@rxap/nest-utilities',
|
|
43
192
|
},
|
|
44
193
|
{
|
|
45
194
|
namedImports: ['plainToInstance'],
|
|
@@ -47,13 +196,21 @@ function CoerceGetPageOperation(options) {
|
|
|
47
196
|
},
|
|
48
197
|
{
|
|
49
198
|
namedImports: ['classTransformOptions'],
|
|
50
|
-
moduleSpecifier: '@rxap/nest
|
|
199
|
+
moduleSpecifier: '@rxap/nest-utilities',
|
|
51
200
|
},
|
|
52
201
|
{
|
|
53
202
|
namedImports: [pageClassName],
|
|
54
|
-
moduleSpecifier:
|
|
203
|
+
moduleSpecifier: pageFilePath,
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
namedImports: [rowClassName],
|
|
207
|
+
moduleSpecifier: rowFilePath,
|
|
55
208
|
},
|
|
56
209
|
]);
|
|
210
|
+
(0, coerce_type_alias_1.CoerceTypeAlias)(sourceFile, 'RawRowData', {
|
|
211
|
+
isExported: false,
|
|
212
|
+
type: 'any',
|
|
213
|
+
});
|
|
57
214
|
return Object.assign({ queryList: [
|
|
58
215
|
{
|
|
59
216
|
name: 'pageIndex',
|
|
@@ -79,38 +236,17 @@ function CoerceGetPageOperation(options) {
|
|
|
79
236
|
name: 'filter',
|
|
80
237
|
type: 'FilterQuery[]',
|
|
81
238
|
pipeList: ['new FilterQueryPipe()'],
|
|
239
|
+
// the FilterQueryPipe will set the default value to an empty array
|
|
240
|
+
hasQuestionToken: false,
|
|
82
241
|
},
|
|
83
242
|
], returnType: pageClassName, statements: [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
});`,
|
|
93
|
-
`return plainToInstance(
|
|
94
|
-
${pageClassName},
|
|
95
|
-
{
|
|
96
|
-
total: response.maxCount ?? 0,
|
|
97
|
-
pageIndex,
|
|
98
|
-
pageSize,
|
|
99
|
-
sortBy,
|
|
100
|
-
sortDirection,
|
|
101
|
-
filter,
|
|
102
|
-
rows:
|
|
103
|
-
response.entities?.map((item) => ({
|
|
104
|
-
__rowId: item.uuid,
|
|
105
|
-
__archived: item.__archived,
|
|
106
|
-
__removedAt: item.__removedAt,
|
|
107
|
-
${columnList.map(column => `${(0, schematics_utilities_1.camelize)(column.name)}: item.${(0, schematics_utilities_1.camelize)(column.name)}`)
|
|
108
|
-
.join(',\n ')}
|
|
109
|
-
})) ?? [],
|
|
110
|
-
},
|
|
111
|
-
classTransformOptions,
|
|
112
|
-
);`,
|
|
113
|
-
] }, tsMorphTransform(project, sourceFile, classDeclaration, controllerName));
|
|
243
|
+
'const data = await this.getPageData(sortBy, sortDirection, pageSize, pageIndex, filter);',
|
|
244
|
+
'return plainToInstance(',
|
|
245
|
+
' ' + pageClassName + ',',
|
|
246
|
+
` this.toPageDto(data.list, data.total, pageIndex, pageSize, sortBy, sortDirection, filter),`,
|
|
247
|
+
' classTransformOptions',
|
|
248
|
+
');',
|
|
249
|
+
] }, tsMorphTransform(project, sourceFile, classDeclaration, controllerName, pageClassName, rowClassName));
|
|
114
250
|
} }));
|
|
115
251
|
}
|
|
116
252
|
exports.CoerceGetPageOperation = CoerceGetPageOperation;
|