generator-jhipster 8.4.0 → 8.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/generators/angular/resources/package.json +10 -10
  2. package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.spec.ts.ejs +2 -2
  3. package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.ts.ejs +3 -6
  4. package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/init/password-reset-init.component.spec.ts.ejs +2 -2
  5. package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts.ejs +3 -6
  6. package/dist/generators/angular/templates/src/main/webapp/app/account/register/register.component.ts.ejs +3 -6
  7. package/dist/generators/angular/templates/src/main/webapp/app/admin/metrics/blocks/metrics-modal-threads/metrics-modal-threads.component.html.ejs +11 -11
  8. package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/delete/user-management-delete-dialog.component.html.ejs +0 -2
  9. package/dist/generators/angular/templates/src/main/webapp/app/core/auth/user-route-access.service.ts.ejs +1 -1
  10. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/delete/_entityFile_-delete-dialog.component.html.ejs +0 -3
  11. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/detail/_entityFile_-detail.component.spec.ts.ejs +2 -2
  12. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/route/_entityFile_-routing-resolve.service.spec.ts.ejs +2 -2
  13. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/update/_entityFile_-update.component.spec.ts.ejs +3 -3
  14. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/update/_entityFile_-update.component.ts.ejs +11 -17
  15. package/dist/generators/angular/templates/src/main/webapp/app/layouts/navbar/active-menu.directive.ts.ejs +3 -3
  16. package/dist/generators/angular/templates/src/main/webapp/app/login/login.component.spec.ts.ejs +2 -2
  17. package/dist/generators/angular/templates/src/main/webapp/app/login/login.component.ts.ejs +3 -4
  18. package/dist/generators/angular/templates/src/main/webapp/app/shared/alert/alert-error.component.spec.ts.ejs +2 -2
  19. package/dist/generators/angular/templates/src/main/webapp/app/shared/auth/has-any-authority.directive.spec.ts.ejs +10 -8
  20. package/dist/generators/angular/templates/src/main/webapp/app/shared/auth/has-any-authority.directive.ts.ejs +3 -8
  21. package/dist/generators/angular/templates/src/main/webapp/app/shared/filter/filter.component.html.ejs +6 -2
  22. package/dist/generators/app/generator.js +4 -13
  23. package/dist/generators/base/generator.js +15 -16
  24. package/dist/generators/base/priorities.js +12 -1
  25. package/dist/generators/base-application/generator.js +14 -2
  26. package/dist/generators/base-application/priorities.js +1 -0
  27. package/dist/generators/base-application/support/prepare-entity.js +7 -8
  28. package/dist/generators/base-application/support/prepare-relationship.js +3 -2
  29. package/dist/generators/base-core/generator.js +40 -9
  30. package/dist/generators/bootstrap-application-base/generator.js +7 -3
  31. package/dist/generators/bootstrap-application-server/generator.js +1 -0
  32. package/dist/generators/client/command.js +2 -2
  33. package/dist/generators/client/generators/common/command.js +5 -0
  34. package/dist/generators/client/generators/common/generator.js +79 -0
  35. package/dist/generators/client/generators/common/index.js +20 -0
  36. package/dist/generators/client/generators/common/templates/src/main/webapp/app/shared/jhipster/headers.ts.ejs +57 -0
  37. package/dist/generators/client/generators/common/templates/src/main/webapp/app/shared/jhipster/problem-details.ts.ejs +51 -0
  38. package/dist/generators/client/resources/package.json +4 -4
  39. package/dist/generators/common/generator.js +5 -0
  40. package/dist/generators/common/resources/package.json +2 -2
  41. package/dist/generators/cypress/templates/src/test/javascript/cypress/e2e/account/login-page.cy.ts.ejs +4 -4
  42. package/dist/generators/cypress/templates/src/test/javascript/cypress/e2e/account/password-page.cy.ts.ejs +2 -2
  43. package/dist/generators/cypress/templates/src/test/javascript/cypress/e2e/account/register-page.cy.ts.ejs +1 -1
  44. package/dist/generators/cypress/templates/src/test/javascript/cypress/e2e/account/reset-password-page.cy.ts.ejs +1 -1
  45. package/dist/generators/cypress/templates/src/test/javascript/cypress/e2e/entity/_entity_.cy.ts.ejs +10 -10
  46. package/dist/generators/docker/templates/docker/mysql.yml.ejs +1 -1
  47. package/dist/generators/docker/templates/docker/realm-config/jhipster-realm.json.ejs +14 -3
  48. package/dist/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs +14 -3
  49. package/dist/generators/entity/generator.js +2 -10
  50. package/dist/generators/entity/prompts.js +6 -11
  51. package/dist/generators/gatling/README.md +15 -0
  52. package/dist/generators/gatling/templates/src/test/java/gatling/simulations/_entityClass_GatlingTest.java.ejs +2 -10
  53. package/dist/generators/generate-blueprint/command.js +16 -0
  54. package/dist/generators/generate-blueprint/files.js +8 -0
  55. package/dist/generators/generate-blueprint/generator.js +17 -10
  56. package/dist/generators/generate-blueprint/resources/package.json +1 -1
  57. package/dist/generators/generate-blueprint/templates/.blueprint/cli/commands.mjs.ejs +6 -0
  58. package/dist/generators/generate-blueprint/templates/.blueprint/generate-sample/command.mjs.ejs +20 -0
  59. package/dist/generators/generate-blueprint/templates/.blueprint/generate-sample/generator.mjs.ejs +9 -13
  60. package/dist/generators/generate-blueprint/templates/.blueprint/github-build-matrix/build-matrix.mjs.ejs +22 -0
  61. package/dist/generators/generate-blueprint/templates/.blueprint/github-build-matrix/generator.mjs.ejs +24 -0
  62. package/dist/generators/generate-blueprint/templates/.blueprint/github-build-matrix/index.mjs.ejs +1 -0
  63. package/dist/generators/generate-blueprint/templates/.eslintrc.json.ejs +2 -2
  64. package/dist/generators/generate-blueprint/templates/README.md.ejs +16 -8
  65. package/dist/generators/generate-blueprint/templates/vitest.config.ts.ejs +1 -0
  66. package/dist/generators/generator-constants.js +1 -1
  67. package/dist/generators/info/generator.js +1 -3
  68. package/dist/generators/init/generator.js +2 -2
  69. package/dist/generators/init/resources/.node-version +1 -1
  70. package/dist/generators/java/generators/build-tool/command.js +4 -1
  71. package/dist/generators/java/generators/domain/templates/src/main/java/_package_/_entityPackage_/domain/_persistClass_.java.jhi.ejs +1 -5
  72. package/dist/generators/java/generators/domain/templates/src/test/java/_package_/_entityPackage_/domain/_persistClass_Asserts.java.ejs +3 -3
  73. package/dist/generators/java/generators/domain/templates/src/test/java/_package_/_entityPackage_/domain/_persistClass_Test.java.ejs +3 -3
  74. package/dist/generators/java/support/add-java-annotation.js +28 -7
  75. package/dist/generators/java/support/generated-annotation-transform.js +1 -1
  76. package/dist/generators/java/support/index.js +1 -1
  77. package/dist/generators/jdl/generator.js +1 -1
  78. package/dist/generators/kubernetes/files.js +1 -1
  79. package/dist/generators/kubernetes/templates/db/mysql.yml.ejs +0 -1
  80. package/dist/generators/kubernetes/templates/keycloak/keycloak-configmap.yml.ejs +14 -3
  81. package/dist/generators/languages/generator.js +4 -2
  82. package/dist/generators/maven/templates/.mvn/wrapper/maven-wrapper.properties +2 -2
  83. package/dist/generators/maven/templates/mvnw +185 -243
  84. package/dist/generators/maven/templates/mvnw.cmd +121 -180
  85. package/dist/generators/react/generator.js +10 -0
  86. package/dist/generators/react/resources/package.json +24 -24
  87. package/dist/generators/react/templates/src/main/webapp/app/config/axios-interceptor.spec.ts.ejs +1 -1
  88. package/dist/generators/react/templates/src/main/webapp/app/config/axios-interceptor.ts.ejs +1 -1
  89. package/dist/generators/react/templates/src/main/webapp/app/config/notification-middleware.spec.ts.ejs +1 -1
  90. package/dist/generators/react/templates/src/main/webapp/app/config/notification-middleware.ts.ejs +80 -87
  91. package/dist/generators/react/templates/src/main/webapp/app/config/store.ts.ejs +1 -1
  92. package/dist/generators/react/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_-update.tsx.ejs +3 -3
  93. package/dist/generators/react/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.reducer.ts.ejs +12 -7
  94. package/dist/generators/react/templates/src/main/webapp/app/shared/reducers/reducer.utils.ts.ejs +2 -3
  95. package/dist/generators/server/command.js +0 -11
  96. package/dist/generators/server/generator.js +9 -70
  97. package/dist/generators/server/jdl/application-definition.js +3 -1
  98. package/dist/generators/server/resources/Dockerfile +12 -12
  99. package/dist/generators/server/resources/gradle/libs.versions.toml +7 -5
  100. package/dist/generators/server/resources/pom.xml +7 -7
  101. package/dist/generators/server/support/config.js +4 -8
  102. package/dist/generators/server/support/prepare-entity.js +5 -6
  103. package/dist/generators/server/support/relationship.js +5 -2
  104. package/dist/generators/server/templates/build.gradle.ejs +5 -3
  105. package/dist/generators/server/templates/gradle/profile_dev.gradle.ejs +1 -0
  106. package/dist/generators/server/templates/gradle/profile_prod.gradle.ejs +1 -0
  107. package/dist/generators/server/templates/gradle.properties.ejs +1 -1
  108. package/dist/generators/server/templates/pom.xml.ejs +7 -5
  109. package/dist/generators/server/templates/src/main/java/_package_/_entityPackage_/service/dto/_dtoClass_.java.ejs +1 -1
  110. package/dist/generators/server/templates/src/main/java/_package_/config/Constants.java.ejs +0 -2
  111. package/dist/generators/server/templates/src/main/java/_package_/config/SecurityConfiguration_imperative.java.ejs +1 -18
  112. package/dist/generators/server/templates/src/main/java/_package_/config/SecurityConfiguration_reactive.java.ejs +1 -15
  113. package/dist/generators/server/templates/src/main/java/_package_/config/SecurityJwtConfiguration.java.ejs +0 -20
  114. package/dist/generators/server/templates/src/main/java/_package_/security/SecurityUtils.java.ejs +65 -5
  115. package/dist/generators/server/templates/src/main/java/_package_/service/dto/UserDTO.java.ejs +23 -0
  116. package/dist/generators/server/templates/src/main/java/_package_/service/mapper/UserMapper.java.ejs +8 -4
  117. package/dist/generators/server/templates/src/main/java/_package_/web/rest/AccountResource_skipUserManagement.java.ejs +43 -9
  118. package/dist/generators/server/templates/src/main/resources/config/application.yml.ejs +59 -21
  119. package/dist/generators/server/templates/src/main/resources/swagger/api.yml.ejs +1 -1
  120. package/dist/generators/server/templates/src/test/java/_package_/security/DomainUserDetailsServiceIT.java.ejs +31 -13
  121. package/dist/generators/server/templates/src/test/java/_package_/service/mapper/UserMapperTest.java.ejs +84 -17
  122. package/dist/generators/server/templates/src/test/java/_package_/web/rest/AccountResourceIT.java.ejs +62 -6
  123. package/dist/generators/server/templates/src/test/java/_package_/web/rest/AccountResourceIT_oauth2.java.ejs +22 -0
  124. package/dist/generators/server/templates/src/test/resources/config/application.yml.ejs +20 -10
  125. package/dist/generators/spring-boot/command.js +117 -6
  126. package/dist/generators/spring-boot/files.js +0 -5
  127. package/dist/generators/spring-boot/generator.js +40 -7
  128. package/dist/generators/spring-boot/prompts.js +6 -70
  129. package/dist/generators/spring-boot/resources/spring-boot-dependencies.pom +368 -576
  130. package/dist/generators/spring-boot/templates/src/test/java/_package_/_entityPackage_/service/UserServiceIT.java.ejs +47 -11
  131. package/dist/generators/spring-boot/templates/src/test/java/_package_/_entityPackage_/web/rest/PublicUserResourceIT.java.ejs +60 -24
  132. package/dist/generators/spring-boot/templates/src/test/java/_package_/_entityPackage_/web/rest/UserResourceIT.java.ejs +195 -318
  133. package/dist/generators/spring-boot/templates/src/test/java/_package_/_entityPackage_/web/rest/_entityClass_ResourceIT.java.ejs +58 -51
  134. package/dist/generators/spring-cache/internal/dependencies.js +2 -2
  135. package/dist/generators/spring-cache/resources/gradle/libs.versions.toml +1 -1
  136. package/dist/generators/spring-cloud/generators/gateway/command.js +5 -1
  137. package/dist/generators/spring-cloud/generators/gateway/generator.js +13 -0
  138. package/dist/generators/spring-cloud/generators/gateway/jdl/jdl-routes-option.js +6 -0
  139. package/dist/generators/spring-data-cassandra/generator.js +2 -2
  140. package/dist/generators/spring-data-relational/templates/src/test/java/_package_/config/SqlTestContainersSpringContextCustomizerFactory.java.ejs +3 -1
  141. package/dist/generators/vue/resources/package.json +15 -15
  142. package/dist/generators/vue/templates/src/main/webapp/app/admin/tracker/tracker.service.spec.ts.ejs +1 -1
  143. package/dist/generators/vue/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_-details.vue.ejs +1 -1
  144. package/dist/generators/vue/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_-update.vue.ejs +1 -1
  145. package/dist/generators/vue/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.vue.ejs +1 -1
  146. package/dist/generators/vue/templates/src/main/webapp/app/shared/alert/alert.service.spec.ts.ejs +8 -8
  147. package/dist/generators/vue/templates/src/main/webapp/app/shared/data/data-utils.service.spec.ts.ejs +1 -1
  148. package/dist/generators/vue/templates/tsconfig.app.json.ejs +1 -1
  149. package/dist/generators/vue/templates/vite.config.mts.ejs +5 -4
  150. package/dist/jdl/converters/jdl-to-json/jdl-to-json-basic-entity-converter.js +1 -1
  151. package/dist/jdl/converters/jdl-to-json/jdl-to-json-field-converter.js +4 -4
  152. package/dist/jdl/converters/jdl-to-json/jdl-with-applications-to-json-converter.js +9 -9
  153. package/dist/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.js +2 -2
  154. package/dist/jdl/converters/json-to-jdl-application-converter.js +1 -1
  155. package/dist/jdl/converters/json-to-jdl-converter.js +6 -5
  156. package/dist/jdl/converters/json-to-jdl-entity-converter.js +14 -14
  157. package/dist/jdl/converters/json-to-jdl-option-converter.js +1 -2
  158. package/dist/jdl/converters/parsed-jdl-to-jdl-object/application-converter.js +1 -1
  159. package/dist/jdl/converters/parsed-jdl-to-jdl-object/option-converter.js +2 -2
  160. package/dist/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.js +7 -6
  161. package/dist/jdl/converters/parsed-jdl-to-jdl-object/validation-converter.js +1 -1
  162. package/dist/jdl/exporters/applications/jhipster-application-formatter.js +16 -23
  163. package/dist/jdl/exporters/config.js +1 -0
  164. package/dist/jdl/exporters/jhipster-deployment-exporter.js +5 -5
  165. package/dist/jdl/exporters/jhipster-entity-exporter.js +1 -1
  166. package/dist/jdl/jdl-importer.js +22 -20
  167. package/dist/jdl/jhipster/binary-options.js +12 -8
  168. package/dist/jdl/jhipster/json-entity.js +1 -1
  169. package/dist/jdl/models/abstract-jdl-option.js +2 -2
  170. package/dist/jdl/models/jdl-application-configuration-factory.js +2 -0
  171. package/dist/jdl/models/jdl-binary-option.js +2 -2
  172. package/dist/jdl/models/jdl-deployment.js +11 -0
  173. package/dist/jdl/models/jdl-entity.js +1 -1
  174. package/dist/jdl/models/jdl-enum.js +1 -1
  175. package/dist/jdl/models/jdl-enums.js +0 -18
  176. package/dist/jdl/models/jdl-field.js +2 -2
  177. package/dist/jdl/models/jdl-object-wrapper.js +1 -0
  178. package/dist/jdl/models/jdl-object.js +23 -45
  179. package/dist/jdl/models/jdl-options.js +0 -18
  180. package/dist/jdl/models/jdl-relationships.js +8 -16
  181. package/dist/jdl/models/jdl-unary-option.js +1 -1
  182. package/dist/jdl/models/list-jdl-application-configuration-option.js +5 -2
  183. package/dist/jdl/parsing/jdl-ast-builder-visitor.js +12 -0
  184. package/dist/jdl/parsing/jdl-parser.js +14 -0
  185. package/dist/jdl/parsing/lexer/lexer.js +17 -11
  186. package/dist/jdl/parsing/validator.js +16 -2
  187. package/dist/jdl/readers/json-reader.js +1 -1
  188. package/dist/jdl/utils/array-utils.js +6 -0
  189. package/dist/jdl/utils/set-utils.js +3 -2
  190. package/dist/jdl/validators/jdl-without-application-validator.js +2 -2
  191. package/dist/testing/helpers.js +4 -0
  192. package/dist/types/generators/base/api.d.ts +5 -1
  193. package/dist/types/generators/base/generator.d.ts +10 -4
  194. package/dist/types/generators/base/priorities.d.ts +4 -0
  195. package/dist/types/generators/base/shared-data.d.ts +1 -1
  196. package/dist/types/generators/base-application/priorities.d.ts +2 -0
  197. package/dist/types/generators/base-application/support/entity.d.ts +2 -2
  198. package/dist/types/generators/base-application/support/prepare-entity.d.ts +3 -3
  199. package/dist/types/generators/base-application/support/relationship.d.ts +5 -5
  200. package/dist/types/generators/base-core/generator.d.ts +16 -1
  201. package/dist/types/generators/generator-constants.d.ts +1 -1
  202. package/dist/types/generators/java/support/add-java-annotation.d.ts +10 -20
  203. package/dist/types/generators/java/support/doc.d.ts +1 -1
  204. package/dist/types/generators/java/support/index.d.ts +1 -1
  205. package/dist/types/generators/server/support/relationship.d.ts +2 -2
  206. package/dist/types/generators/server/types.d.ts +5 -0
  207. package/dist/types/generators/spring-cloud/generators/gateway/jdl/jdl-routes-option.d.ts +2 -0
  208. package/dist/types/generators/spring-cloud/generators/gateway/types.d.ts +4 -0
  209. package/dist/types/jdl/converters/jdl-to-json/jdl-to-json-field-converter.d.ts +2 -2
  210. package/dist/types/jdl/converters/jdl-to-json/jdl-with-applications-to-json-converter.d.ts +2 -1
  211. package/dist/types/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.d.ts +3 -1
  212. package/dist/types/jdl/converters/json-to-jdl-application-converter.d.ts +9 -2
  213. package/dist/types/jdl/converters/json-to-jdl-converter.d.ts +3 -3
  214. package/dist/types/jdl/converters/json-to-jdl-entity-converter.d.ts +2 -4
  215. package/dist/types/jdl/converters/parsed-jdl-to-jdl-object/application-converter.d.ts +3 -1
  216. package/dist/types/jdl/converters/parsed-jdl-to-jdl-object/deployment-converter.d.ts +2 -1
  217. package/dist/types/jdl/converters/parsed-jdl-to-jdl-object/entity-converter.d.ts +3 -1
  218. package/dist/types/jdl/converters/parsed-jdl-to-jdl-object/enum-converter.d.ts +2 -1
  219. package/dist/types/jdl/converters/parsed-jdl-to-jdl-object/field-converter.d.ts +2 -1
  220. package/dist/types/jdl/converters/parsed-jdl-to-jdl-object/option-converter.d.ts +3 -3
  221. package/dist/types/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.d.ts +2 -1
  222. package/dist/types/jdl/converters/parsed-jdl-to-jdl-object/relationship-converter.d.ts +2 -1
  223. package/dist/types/jdl/converters/parsed-jdl-to-jdl-object/types.d.ts +110 -0
  224. package/dist/types/jdl/converters/parsed-jdl-to-jdl-object/validation-converter.d.ts +2 -1
  225. package/dist/types/jdl/converters/types.d.ts +102 -14
  226. package/dist/types/jdl/exporters/applications/jhipster-application-formatter.d.ts +4 -4
  227. package/dist/types/jdl/exporters/config.d.ts +2 -1
  228. package/dist/types/jdl/exporters/export-utils.d.ts +2 -1
  229. package/dist/types/jdl/exporters/jdl-exporter.d.ts +2 -1
  230. package/dist/types/jdl/exporters/jhipster-deployment-exporter.d.ts +3 -1
  231. package/dist/types/jdl/exporters/jhipster-entity-exporter.d.ts +3 -1
  232. package/dist/types/jdl/exporters/types.d.ts +61 -0
  233. package/dist/types/jdl/jhipster/binary-options.d.ts +8 -26
  234. package/dist/types/jdl/jhipster/field-types.d.ts +2 -2
  235. package/dist/types/jdl/jhipster/json-entity.d.ts +2 -2
  236. package/dist/types/jdl/models/abstract-jdl-option.d.ts +14 -9
  237. package/dist/types/jdl/models/boolean-jdl-application-configuration-option.d.ts +1 -1
  238. package/dist/types/jdl/models/integer-jdl-application-configuration-option.d.ts +1 -1
  239. package/dist/types/jdl/models/jdl-application-configuration-factory.d.ts +1 -1
  240. package/dist/types/jdl/models/jdl-application-configuration-option.d.ts +4 -4
  241. package/dist/types/jdl/models/jdl-application-configuration.d.ts +4 -4
  242. package/dist/types/jdl/models/jdl-application-definition.d.ts +4 -4
  243. package/dist/types/jdl/models/jdl-application-entities.d.ts +4 -4
  244. package/dist/types/jdl/models/jdl-application.d.ts +16 -13
  245. package/dist/types/jdl/models/jdl-binary-option.d.ts +5 -3
  246. package/dist/types/jdl/models/jdl-deployment.d.ts +13 -1
  247. package/dist/types/jdl/models/jdl-entity.d.ts +5 -5
  248. package/dist/types/jdl/models/jdl-enum-value.d.ts +4 -4
  249. package/dist/types/jdl/models/jdl-enum.d.ts +9 -5
  250. package/dist/types/jdl/models/jdl-enums.d.ts +6 -5
  251. package/dist/types/jdl/models/jdl-field.d.ts +10 -8
  252. package/dist/types/jdl/models/jdl-object-wrapper.d.ts +25 -0
  253. package/dist/types/jdl/models/jdl-object.d.ts +23 -19
  254. package/dist/types/jdl/models/jdl-options.d.ts +7 -24
  255. package/dist/types/jdl/models/jdl-relationship.d.ts +16 -10
  256. package/dist/types/jdl/models/jdl-relationships.d.ts +5 -5
  257. package/dist/types/jdl/models/jdl-validation.d.ts +3 -3
  258. package/dist/types/jdl/models/list-jdl-application-configuration-option.d.ts +4 -3
  259. package/dist/types/jdl/models/string-jdl-application-configuration-option.d.ts +2 -2
  260. package/dist/types/jdl/parsing/jdl-ast-builder-visitor.d.ts +1 -0
  261. package/dist/types/jdl/parsing/jdl-parser.d.ts +1 -0
  262. package/dist/types/jdl/parsing/jdl-parsing-types.d.ts +23 -0
  263. package/dist/types/jdl/parsing/lexer/lexer.d.ts +6 -2
  264. package/dist/types/jdl/parsing/validator.d.ts +1 -1
  265. package/dist/types/jdl/utils/array-utils.d.ts +1 -0
  266. package/dist/types/jdl/utils/set-utils.d.ts +1 -19
  267. package/dist/types/jdl/validators/deployment-validator.d.ts +2 -1
  268. package/dist/types/testing/helpers.d.ts +13 -3
  269. package/package.json +24 -23
  270. /package/dist/jdl/converters/{types.js → parsed-jdl-to-jdl-object/types.js} +0 -0
@@ -132,13 +132,32 @@ spring:
132
132
  allow-bean-definition-overriding: true
133
133
  messages:
134
134
  basename: i18n/messages
135
- <%_ if (generateInMemoryUserCredentials) { _%>
135
+ <%_ if (generateInMemoryUserCredentials || authenticationTypeOauth2 || authenticationTypeJwt) { _%>
136
136
  security:
137
+ <%_ if (generateInMemoryUserCredentials) { _%>
137
138
  user:
138
139
  name: test
139
140
  password: test
140
141
  roles:
141
142
  - USER
143
+ <%_ } _%>
144
+ <%_ if (authenticationTypeOauth2) { _%>
145
+ oauth2:
146
+ client:
147
+ provider:
148
+ oidc:
149
+ issuer-uri: http://DO_NOT_CALL:9080/realms/jhipster
150
+ resourceserver:
151
+ jwt:
152
+ principal-claim-name: preferred_username
153
+ <%_ } _%>
154
+ <%_ if (authenticationTypeJwt) { _%>
155
+ oauth2:
156
+ resourceserver:
157
+ jwt:
158
+ authority-prefix: ''
159
+ authorities-claim-name: auth
160
+ <%_ } _%>
142
161
  <%_ } _%>
143
162
  task:
144
163
  execution:
@@ -153,15 +172,6 @@ spring:
153
172
  size: 20
154
173
  thymeleaf:
155
174
  mode: HTML
156
- <%_ if (authenticationTypeOauth2) { _%>
157
- # Allow SecurityConfiguration to initialize w/o specifying an empty issuer-uri is OK
158
- security:
159
- oauth2:
160
- client:
161
- provider:
162
- oidc:
163
- issuer-uri: http://DO_NOT_CALL:9080/realms/jhipster
164
- <%_ } _%>
165
175
 
166
176
  server:
167
177
  port: 10344
@@ -1,5 +1,27 @@
1
+ /**
2
+ * Copyright 2013-2024 the original author or authors from the JHipster project.
3
+ *
4
+ * This file is part of the JHipster project, see https://www.jhipster.tech/
5
+ * for more information.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * https://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ import chalk from 'chalk';
1
20
  import { GENERATOR_JAVA, GENERATOR_LIQUIBASE, GENERATOR_SPRING_DATA_RELATIONAL } from '../generator-list.js';
2
- import { APPLICATION_TYPE_MICROSERVICE } from '../../jdl/index.js';
21
+ import { createBase64Secret, createSecret } from '../base/support/secret.js';
22
+ import { authenticationTypes, applicationTypes } from '../../jdl/index.js';
23
+ const { OAUTH2, SESSION, JWT } = authenticationTypes;
24
+ const { GATEWAY, MICROSERVICE } = applicationTypes;
3
25
  const command = {
4
26
  options: {
5
27
  fakeKeytool: {
@@ -11,18 +33,92 @@ const command = {
11
33
  },
12
34
  },
13
35
  configs: {
36
+ reactive: {
37
+ cli: {
38
+ description: 'Generate a reactive backend',
39
+ type: Boolean,
40
+ },
41
+ prompt: gen => ({
42
+ when: () => ['monolith', 'microservice'].includes(gen.jhipsterConfigWithDefaults.applicationType),
43
+ type: 'confirm',
44
+ message: 'Do you want to make it reactive with Spring WebFlux?',
45
+ }),
46
+ },
47
+ serverPort: {
48
+ prompt: gen => ({
49
+ when: () => ['gateway', 'microservice'].includes(gen.jhipsterConfigWithDefaults.applicationType),
50
+ type: 'input',
51
+ validate: input => (/^([0-9]*)$/.test(input) ? true : 'This is not a valid port number.'),
52
+ message: 'As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts.',
53
+ default: () => gen.jhipsterConfigWithDefaults.serverPort,
54
+ }),
55
+ configure: gen => {
56
+ if (gen.jhipsterConfig.serverPort === undefined && gen.jhipsterConfig.applicationIndex !== undefined) {
57
+ gen.jhipsterConfig.serverPort = 8080 + gen.jhipsterConfig.applicationIndex;
58
+ }
59
+ },
60
+ },
61
+ serviceDiscoveryType: {
62
+ cli: {
63
+ description: 'Service discovery type',
64
+ type: String,
65
+ },
66
+ prompt: gen => ({
67
+ when: () => ['gateway', 'microservice'].includes(gen.jhipsterConfigWithDefaults.applicationType),
68
+ type: 'list',
69
+ message: 'Which service discovery server do you want to use?',
70
+ default: 'consul',
71
+ }),
72
+ choices: [
73
+ { value: 'consul', name: 'Consul (recommended)' },
74
+ { value: 'eureka', name: 'JHipster Registry (legacy, uses Eureka, provides Spring Cloud Config support)' },
75
+ { value: 'no', name: 'No service discovery' },
76
+ ],
77
+ },
78
+ authenticationType: {
79
+ cli: {
80
+ name: 'auth',
81
+ description: 'Provide authentication type for the application when skipping server side generation',
82
+ type: String,
83
+ },
84
+ prompt: (gen, config) => ({
85
+ type: 'list',
86
+ message: `Which ${chalk.yellow('*type*')} of authentication would you like to use?`,
87
+ choices: () => gen.jhipsterConfigWithDefaults.applicationType !== 'monolith'
88
+ ? config.choices.filter(({ value }) => value !== 'session')
89
+ : config.choices,
90
+ default: () => gen.jhipsterConfigWithDefaults.authenticationType,
91
+ }),
92
+ choices: [
93
+ { value: 'jwt', name: 'JWT authentication (stateless, with a token)' },
94
+ { value: 'oauth2', name: 'OAuth 2.0 / OIDC Authentication (stateful, works with Keycloak and Okta)' },
95
+ { value: 'session', name: 'HTTP Session Authentication (stateful, default Spring Security mechanism)' },
96
+ ],
97
+ configure: gen => {
98
+ const { jwtSecretKey, rememberMeKey, authenticationType, applicationType } = gen.jhipsterConfigWithDefaults;
99
+ if (authenticationType === SESSION && !rememberMeKey) {
100
+ gen.jhipsterConfig.rememberMeKey = createSecret();
101
+ }
102
+ else if (authenticationType === OAUTH2 && gen.jhipsterConfig.skipUserManagement === undefined) {
103
+ gen.jhipsterConfig.skipUserManagement = true;
104
+ }
105
+ else if (jwtSecretKey === undefined &&
106
+ (authenticationType === JWT || applicationType === MICROSERVICE || applicationType === GATEWAY)) {
107
+ gen.jhipsterConfig.jwtSecretKey = createBase64Secret(64, gen.options.reproducibleTests);
108
+ }
109
+ },
110
+ },
14
111
  feignClient: {
15
112
  description: 'Generate a feign client',
16
113
  cli: {
17
114
  type: Boolean,
18
115
  },
19
- prompt: {
116
+ prompt: gen => ({
20
117
  type: 'confirm',
21
118
  message: 'Do you want to generate a feign client?',
22
- when: currentAnswer => currentAnswer.applicationType === APPLICATION_TYPE_MICROSERVICE &&
23
- currentAnswer.reactive !== undefined &&
24
- !currentAnswer.reactive,
25
- },
119
+ when: ({ reactive }) => [MICROSERVICE].includes(gen.jhipsterConfigWithDefaults.applicationType) &&
120
+ (reactive ?? gen.jhipsterConfigWithDefaults.reactive) === false,
121
+ }),
26
122
  default: false,
27
123
  },
28
124
  syncUserWithIdp: {
@@ -35,6 +131,16 @@ const command = {
35
131
  message: 'Do you want to allow relationships with User entity?',
36
132
  when: ({ authenticationType }) => (authenticationType ?? gen.jhipsterConfigWithDefaults.authenticationType) === 'oauth2',
37
133
  }),
134
+ configure: gen => {
135
+ if (gen.jhipsterConfig.syncUserWithIdp === undefined && gen.jhipsterConfigWithDefaults.authenticationType === 'oauth2') {
136
+ if (gen.isJhipsterVersionLessThan('8.1.1')) {
137
+ gen.jhipsterConfig.syncUserWithIdp = true;
138
+ }
139
+ }
140
+ else if (gen.jhipsterConfig.syncUserWithIdp && gen.jhipsterConfig.authenticationType !== OAUTH2) {
141
+ throw new Error('syncUserWithIdp is only supported with authenticationType oauth2');
142
+ }
143
+ },
38
144
  },
39
145
  defaultPackaging: {
40
146
  description: 'Default packaging for the application',
@@ -45,6 +151,11 @@ const command = {
45
151
  choices: ['jar', 'war'],
46
152
  default: 'jar',
47
153
  scope: 'storage',
154
+ configure: gen => {
155
+ if (process.env.JHI_WAR === '1') {
156
+ gen.jhipsterConfig.defaultPackaging = 'war';
157
+ }
158
+ },
48
159
  },
49
160
  },
50
161
  import: [GENERATOR_JAVA, GENERATOR_LIQUIBASE, GENERATOR_SPRING_DATA_RELATIONAL],
@@ -401,11 +401,6 @@ export const baseServerFiles = {
401
401
  ],
402
402
  },
403
403
  {
404
- condition: generator => generator.generateUserManagement ||
405
- generator.authenticationTypeOauth2 ||
406
- generator.databaseTypeSql ||
407
- generator.databaseTypeMongodb ||
408
- generator.databaseTypeCouchbase,
409
404
  path: `${SERVER_MAIN_SRC_DIR}_package_/`,
410
405
  renameTo: moveToJavaPackageSrcDir,
411
406
  templates: ['config/Constants.java'],
@@ -78,6 +78,9 @@ export default class SpringBootGenerator extends BaseApplicationGenerator {
78
78
  }
79
79
  get configuring() {
80
80
  return this.asConfiguringTaskGroup({
81
+ async configureCommand() {
82
+ await this.configureCurrentJHipsterCommandConfig();
83
+ },
81
84
  checks() {
82
85
  const config = this.jhipsterConfigWithDefaults;
83
86
  if (config.enableHibernateCache && [NO_CACHE, MEMCACHED].includes(config.cacheProvider)) {
@@ -110,7 +113,7 @@ export default class SpringBootGenerator extends BaseApplicationGenerator {
110
113
  get composing() {
111
114
  return this.asComposingTaskGroup({
112
115
  async composing() {
113
- const { applicationType, databaseType, messageBroker, searchEngine, websocket, cacheProvider, skipClient, clientFramework, enableTranslation, testFrameworks, feignClient, } = this.jhipsterConfigWithDefaults;
116
+ const { applicationType, databaseType, messageBroker, searchEngine, websocket, cacheProvider, skipClient, clientFramework, testFrameworks, feignClient, } = this.jhipsterConfigWithDefaults;
114
117
  await this.composeWithJHipster(GENERATOR_DOCKER);
115
118
  await this.composeWithJHipster('jhipster:java:jib');
116
119
  await this.composeWithJHipster('jhipster:java:code-quality');
@@ -120,9 +123,6 @@ export default class SpringBootGenerator extends BaseApplicationGenerator {
120
123
  if (applicationType === GATEWAY) {
121
124
  await this.composeWithJHipster('jhipster:spring-cloud:gateway');
122
125
  }
123
- if (enableTranslation) {
124
- await this.composeWithJHipster(GENERATOR_LANGUAGES);
125
- }
126
126
  if (testFrameworks?.includes(CUCUMBER)) {
127
127
  await this.composeWithJHipster(GENERATOR_CUCUMBER);
128
128
  }
@@ -165,11 +165,30 @@ export default class SpringBootGenerator extends BaseApplicationGenerator {
165
165
  get [BaseApplicationGenerator.COMPOSING]() {
166
166
  return this.delegateTasksToBlueprint(() => this.composing);
167
167
  }
168
- get preparing() {
169
- return this.asPreparingTaskGroup({
168
+ get composingComponent() {
169
+ return this.asComposingComponentTaskGroup({
170
+ async composeLanguages() {
171
+ if (this.jhipsterConfigWithDefaults.enableTranslation) {
172
+ await this.composeWithJHipster(GENERATOR_LANGUAGES);
173
+ }
174
+ },
175
+ });
176
+ }
177
+ get [BaseApplicationGenerator.COMPOSING_COMPONENT]() {
178
+ return this.delegateTasksToBlueprint(() => this.composingComponent);
179
+ }
180
+ get loading() {
181
+ return this.asLoadingTaskGroup({
170
182
  async loadCommand({ application }) {
171
183
  await this.loadCurrentJHipsterCommandConfig(application);
172
184
  },
185
+ });
186
+ }
187
+ get [BaseApplicationGenerator.LOADING]() {
188
+ return this.delegateTasksToBlueprint(() => this.loading);
189
+ }
190
+ get preparing() {
191
+ return this.asPreparingTaskGroup({
173
192
  checksWebsocket({ application }) {
174
193
  const { websocket } = application;
175
194
  if (websocket && websocket !== NO_WEBSOCKET) {
@@ -201,6 +220,20 @@ export default class SpringBootGenerator extends BaseApplicationGenerator {
201
220
  (application.backendType ?? 'Java') === 'Java' &&
202
221
  (ADD_SPRING_MILESTONE_REPOSITORY || SPRING_BOOT_VERSION.includes('M') || SPRING_BOOT_VERSION.includes('RC'));
203
222
  },
223
+ prepare({ application, applicationDefaults }) {
224
+ const { reactive } = application;
225
+ applicationDefaults({
226
+ __override__: false,
227
+ requiresDeleteAllUsers: data => (data.anyEntityHasRelationshipWithUser && data.authenticationTypeOauth2) ||
228
+ data.authenticationTypeOauth2 ||
229
+ data.databaseTypeNeo4j ||
230
+ (reactive && data.databaseTypeSql) ||
231
+ (!reactive && data.databaseTypeMongodb) ||
232
+ (!reactive && data.databaseTypeCassandra),
233
+ reactorBlock: reactive ? '.block()' : '',
234
+ reactorBlockOptional: reactive ? '.blockOptional()' : '',
235
+ });
236
+ },
204
237
  registerSpringFactory({ source, application }) {
205
238
  source.addTestSpringFactory = ({ key, value }) => {
206
239
  const springFactoriesFile = `${application.srcTestResources}META-INF/spring.factories`;
@@ -297,7 +330,7 @@ public void set${javaBeanCase(propertyName)}(${propertyType} ${propertyName}) {
297
330
  }
298
331
  },
299
332
  checkDtoRelationships({ entity, entityName, relationship }) {
300
- if (entity.dto !== relationship.otherEntity.dto) {
333
+ if (entity.dto !== relationship.otherEntity.dto && !relationship.otherEntity.builtIn) {
301
334
  this.log.warn(`Relationship between entities with different DTO configurations can cause unexpected results. Check ${relationship.relationshipName} in the ${entityName} entity.`);
302
335
  }
303
336
  },
@@ -18,17 +18,15 @@
18
18
  */
19
19
  import chalk from 'chalk';
20
20
  import { includes, intersection } from 'lodash-es';
21
- import { applicationOptions, applicationTypes, authenticationTypes, databaseTypes, cacheTypes, serviceDiscoveryTypes, testFrameworkTypes, } from '../../jdl/jhipster/index.js';
21
+ import { applicationOptions, applicationTypes, authenticationTypes, databaseTypes, cacheTypes, testFrameworkTypes, } from '../../jdl/jhipster/index.js';
22
22
  import { MESSAGE_BROKER } from '../server/options/index.js';
23
23
  import { R2DBC_DB_OPTIONS, SQL_DB_OPTIONS } from '../server/support/database.js';
24
24
  const { OptionNames } = applicationOptions;
25
- const { GATEWAY, MICROSERVICE, MONOLITH } = applicationTypes;
25
+ const { GATEWAY, MONOLITH } = applicationTypes;
26
26
  const { CAFFEINE, EHCACHE, HAZELCAST, INFINISPAN, MEMCACHED, REDIS } = cacheTypes;
27
- const { JWT, OAUTH2, SESSION } = authenticationTypes;
27
+ const { OAUTH2 } = authenticationTypes;
28
28
  const { CASSANDRA, H2_DISK, H2_MEMORY, MONGODB, NEO4J, SQL, COUCHBASE } = databaseTypes;
29
- const { CONSUL, EUREKA } = serviceDiscoveryTypes;
30
- const { AUTHENTICATION_TYPE, CACHE_PROVIDER, DATABASE_TYPE, DEV_DATABASE_TYPE, PROD_DATABASE_TYPE, REACTIVE, SERVER_PORT, SERVICE_DISCOVERY_TYPE, WEBSOCKET, SEARCH_ENGINE, ENABLE_SWAGGER_CODEGEN, } = OptionNames;
31
- const NO_SERVICE_DISCOVERY = serviceDiscoveryTypes.NO;
29
+ const { CACHE_PROVIDER, DATABASE_TYPE, DEV_DATABASE_TYPE, PROD_DATABASE_TYPE, SERVICE_DISCOVERY_TYPE, WEBSOCKET, SEARCH_ENGINE, ENABLE_SWAGGER_CODEGEN, } = OptionNames;
32
30
  const NO_DATABASE = databaseTypes.NO;
33
31
  const NO_CACHE_PROVIDER = cacheTypes.NO;
34
32
  const { GATLING, CUCUMBER } = testFrameworkTypes;
@@ -52,70 +50,8 @@ const getOptionFromArray = (array, option) => {
52
50
  export async function askForServerSideOpts({ control }) {
53
51
  if (control.existingProject && !this.options.askAnswered)
54
52
  return;
55
- const { applicationType, serverPort: defaultServerPort, reactive } = this.jhipsterConfigWithDefaults;
53
+ const { applicationType } = this.jhipsterConfigWithDefaults;
56
54
  const prompts = [
57
- {
58
- when: () => [MONOLITH, MICROSERVICE].includes(applicationType),
59
- type: 'confirm',
60
- name: REACTIVE,
61
- message: 'Do you want to make it reactive with Spring WebFlux?',
62
- default: reactive,
63
- },
64
- {
65
- when: () => applicationType === GATEWAY || applicationType === MICROSERVICE,
66
- type: 'input',
67
- name: SERVER_PORT,
68
- validate: input => (/^([0-9]*)$/.test(input) ? true : 'This is not a valid port number.'),
69
- message: 'As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts.',
70
- default: defaultServerPort,
71
- },
72
- {
73
- when: () => applicationType === 'gateway' || applicationType === 'microservice',
74
- type: 'list',
75
- name: SERVICE_DISCOVERY_TYPE,
76
- message: 'Which service discovery server do you want to use?',
77
- choices: [
78
- {
79
- value: CONSUL,
80
- name: 'Consul (recommended)',
81
- },
82
- {
83
- value: EUREKA,
84
- name: 'JHipster Registry (legacy, uses Eureka, provides Spring Cloud Config support)',
85
- },
86
- {
87
- value: NO_SERVICE_DISCOVERY,
88
- name: 'No service discovery',
89
- },
90
- ],
91
- default: CONSUL,
92
- },
93
- {
94
- when: answers => (applicationType === MONOLITH && answers.serviceDiscoveryType !== EUREKA) || [GATEWAY, MICROSERVICE].includes(applicationType),
95
- type: 'list',
96
- name: AUTHENTICATION_TYPE,
97
- message: `Which ${chalk.yellow('*type*')} of authentication would you like to use?`,
98
- choices: answers => {
99
- const opts = [
100
- {
101
- value: JWT,
102
- name: 'JWT authentication (stateless, with a token)',
103
- },
104
- ];
105
- opts.push({
106
- value: OAUTH2,
107
- name: 'OAuth 2.0 / OIDC Authentication (stateful, works with Keycloak and Okta)',
108
- });
109
- if (applicationType === MONOLITH && answers.serviceDiscoveryType !== EUREKA) {
110
- opts.push({
111
- value: SESSION,
112
- name: 'HTTP Session Authentication (stateful, default Spring Security mechanism)',
113
- });
114
- }
115
- return opts;
116
- },
117
- default: this.jhipsterConfigWithDefaults.authenticationType,
118
- },
119
55
  {
120
56
  type: 'list',
121
57
  name: DATABASE_TYPE,
@@ -300,7 +236,7 @@ export async function askForServerTestOpts({ control }) {
300
236
  {
301
237
  type: 'checkbox',
302
238
  name: 'serverTestFrameworks',
303
- message: 'Besides Junit, which testing frameworks would you like to use?',
239
+ message: 'Besides JUnit, which testing frameworks would you like to use?',
304
240
  choices: [
305
241
  { name: 'Gatling', value: GATLING },
306
242
  { name: 'Cucumber', value: CUCUMBER },