@gadmin2n/schematics 0.0.55

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 (320) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -0
  3. package/dist/collection.json +122 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +18 -0
  6. package/dist/lib/application/application.factory.d.ts +3 -0
  7. package/dist/lib/application/application.factory.js +92 -0
  8. package/dist/lib/application/files/gadmin2-game-angle-demo/.dockerignore +33 -0
  9. package/dist/lib/application/files/gadmin2-game-angle-demo/Dockerfile +14 -0
  10. package/dist/lib/application/files/gadmin2-game-angle-demo/Jenkinsfile +44 -0
  11. package/dist/lib/application/files/gadmin2-game-angle-demo/build.sh +18 -0
  12. package/dist/lib/application/files/gadmin2-game-angle-demo/config/.types.d.ts +143 -0
  13. package/dist/lib/application/files/gadmin2-game-angle-demo/config/prisma/sample.prisma +65 -0
  14. package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/Game.ts +58 -0
  15. package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/Log.ts +56 -0
  16. package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/Role.ts +58 -0
  17. package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/Source.ts +76 -0
  18. package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/Tasklog.ts +76 -0
  19. package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/_common.ts +16 -0
  20. package/dist/lib/application/files/gadmin2-game-angle-demo/readme.md +49 -0
  21. package/dist/lib/application/files/gadmin2-game-angle-demo/server/.env +20 -0
  22. package/dist/lib/application/files/gadmin2-game-angle-demo/server/.eslintrc.js +25 -0
  23. package/dist/lib/application/files/gadmin2-game-angle-demo/server/.prettierrc +4 -0
  24. package/dist/lib/application/files/gadmin2-game-angle-demo/server/README.md +71 -0
  25. package/dist/lib/application/files/gadmin2-game-angle-demo/server/config/ac.config.ts +24 -0
  26. package/dist/lib/application/files/gadmin2-game-angle-demo/server/config/index.ts +60 -0
  27. package/dist/lib/application/files/gadmin2-game-angle-demo/server/gadmin-cli.json +17 -0
  28. package/dist/lib/application/files/gadmin2-game-angle-demo/server/package.json +106 -0
  29. package/dist/lib/application/files/gadmin2-game-angle-demo/server/prisma/.generator.prisma +32 -0
  30. package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/games.ts +71 -0
  31. package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/index.ts +27 -0
  32. package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/roles.ts +4 -0
  33. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/app.controller.spec.ts +22 -0
  34. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/app.controller.ts +52 -0
  35. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/app.module.ts +75 -0
  36. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/app.service.ts +50 -0
  37. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/lib/auth.guard.ts +108 -0
  38. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/lib/roles.guard.ts +47 -0
  39. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/lib/utils.ts +54 -0
  40. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/lib/woaAuth.ts +82 -0
  41. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/lib/yufuid.ts +160 -0
  42. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/main.ts +119 -0
  43. package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/index.ts +3 -0
  44. package/dist/lib/application/files/gadmin2-game-angle-demo/server/test/app.e2e-spec.ts +24 -0
  45. package/dist/lib/application/files/gadmin2-game-angle-demo/server/test/jest-e2e.json +9 -0
  46. package/dist/lib/application/files/gadmin2-game-angle-demo/server/tsconfig.build.json +4 -0
  47. package/dist/lib/application/files/gadmin2-game-angle-demo/server/tsconfig.json +21 -0
  48. package/dist/lib/application/files/gadmin2-game-angle-demo/web/README.MD +48 -0
  49. package/dist/lib/application/files/gadmin2-game-angle-demo/web/craco.config.js +27 -0
  50. package/dist/lib/application/files/gadmin2-game-angle-demo/web/package.json +81 -0
  51. package/dist/lib/application/files/gadmin2-game-angle-demo/web/public/favicon.ico +0 -0
  52. package/dist/lib/application/files/gadmin2-game-angle-demo/web/public/images/flags/en.svg +1 -0
  53. package/dist/lib/application/files/gadmin2-game-angle-demo/web/public/images/flags/zh_CN.svg +11 -0
  54. package/dist/lib/application/files/gadmin2-game-angle-demo/web/public/index.html +53 -0
  55. package/dist/lib/application/files/gadmin2-game-angle-demo/web/public/locales/en/common.json +128 -0
  56. package/dist/lib/application/files/gadmin2-game-angle-demo/web/public/locales/zh_CN/common.json +130 -0
  57. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/App.tsx +185 -0
  58. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/auditLogProvider.ts +87 -0
  59. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/authProvider.ts +124 -0
  60. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/BulkActions.tsx +236 -0
  61. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/ListPageHeader.tsx +56 -0
  62. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/RowActions.tsx +292 -0
  63. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/SearchBar.tsx +294 -0
  64. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/VanillaJSONEditor/index.css +10 -0
  65. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/VanillaJSONEditor/index.js +53 -0
  66. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/agentPanel/AgentContext.tsx +201 -0
  67. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/agentPanel/AgentPanel.tsx +497 -0
  68. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/agentPanel/ElementInspector.tsx +282 -0
  69. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/agentPanel/agentAttributes.ts +61 -0
  70. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/agentPanel/index.ts +18 -0
  71. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/agentPanel/inspectorActions.ts +111 -0
  72. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/agentPanel/promptGenerator.ts +75 -0
  73. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/agentPanel/skills.ts +464 -0
  74. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/auditLog/components/eventList/index.tsx +62 -0
  75. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/auditLog/components/index.ts +4 -0
  76. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/auditLog/components/logButton/index.tsx +96 -0
  77. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/auditLog/components/logList/index.tsx +73 -0
  78. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/auditLog/components/modalDiffViewer/index.tsx +104 -0
  79. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/auditLog/index.tsx +2 -0
  80. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/contexts/business/index.tsx +65 -0
  81. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/contexts/color-mode/index.tsx +60 -0
  82. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/index.ts +4 -0
  83. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/layout/header/index.tsx +130 -0
  84. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/layout/index.ts +2 -0
  85. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/layout/sider.tsx +218 -0
  86. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/layout/styles.ts +10 -0
  87. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/offLayoutArea/index.tsx +5 -0
  88. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/helpers/form.tsx +419 -0
  89. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/helpers/index.tsx +3 -0
  90. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/helpers/list.tsx +465 -0
  91. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/helpers/login.ts +124 -0
  92. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/helpers/show.tsx +182 -0
  93. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/helpers/utils.ts +76 -0
  94. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/hooks/index.ts +7 -0
  95. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/hooks/types.ts +138 -0
  96. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/hooks/useBatchDelete.ts +191 -0
  97. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/hooks/useBatchOperations.ts +152 -0
  98. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/hooks/useBatchOperationsCore.ts +193 -0
  99. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/hooks/useBatchUpdate.ts +182 -0
  100. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/hooks/useListPageState.ts +303 -0
  101. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/hooks/useRowSelection.ts +38 -0
  102. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/i18n.ts +19 -0
  103. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/index.tsx +28 -0
  104. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/meta.json +4 -0
  105. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/react-app-env.d.ts +1 -0
  106. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/reportWebVitals.ts +15 -0
  107. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/setupTests.ts +5 -0
  108. package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/styles/antd.less +79 -0
  109. package/dist/lib/application/files/gadmin2-game-angle-demo/web/tsconfig.json +27 -0
  110. package/dist/lib/application/schema.json +99 -0
  111. package/dist/lib/class/class.factory.d.ts +3 -0
  112. package/dist/lib/class/class.factory.js +42 -0
  113. package/dist/lib/class/files/js/__name__.js +1 -0
  114. package/dist/lib/class/files/js/__name__.spec.js +7 -0
  115. package/dist/lib/class/files/ts/__name__.spec.ts +7 -0
  116. package/dist/lib/class/files/ts/__name__.ts +1 -0
  117. package/dist/lib/class/schema.json +45 -0
  118. package/dist/lib/client-app/angular/angular.factory.d.ts +3 -0
  119. package/dist/lib/client-app/angular/angular.factory.js +98 -0
  120. package/dist/lib/client-app/angular/files/angular.constants.ts +4 -0
  121. package/dist/lib/client-app/angular/files/angular.module.ts +41 -0
  122. package/dist/lib/client-app/angular/files/angular.providers.ts +27 -0
  123. package/dist/lib/client-app/angular/files/angular.utils.ts +19 -0
  124. package/dist/lib/client-app/angular/files/interfaces/angular-options.interface.ts +87 -0
  125. package/dist/lib/client-app/angular/files/loaders/abstract.loader.ts +16 -0
  126. package/dist/lib/client-app/angular/files/loaders/express.loader.ts +25 -0
  127. package/dist/lib/client-app/angular/files/loaders/fastify.loader.ts +34 -0
  128. package/dist/lib/client-app/angular/files/loaders/noop.loader.ts +12 -0
  129. package/dist/lib/client-app/angular/schema.json +24 -0
  130. package/dist/lib/configuration/configuration.factory.d.ts +3 -0
  131. package/dist/lib/configuration/configuration.factory.js +24 -0
  132. package/dist/lib/configuration/files/js/nest-cli.json +6 -0
  133. package/dist/lib/configuration/files/ts/nest-cli.json +5 -0
  134. package/dist/lib/controller/controller.factory.d.ts +3 -0
  135. package/dist/lib/controller/controller.factory.js +118 -0
  136. package/dist/lib/controller/files/js/__name__.controller.js +4 -0
  137. package/dist/lib/controller/files/js/__name__.controller.spec.js +18 -0
  138. package/dist/lib/controller/files/ts/__name__.controller.spec.ts +18 -0
  139. package/dist/lib/controller/files/ts/__name__.controller.ts +137 -0
  140. package/dist/lib/controller/schema.json +51 -0
  141. package/dist/lib/decorator/decorator.factory.d.ts +3 -0
  142. package/dist/lib/decorator/decorator.factory.js +33 -0
  143. package/dist/lib/decorator/files/js/__name__.decorator.js +3 -0
  144. package/dist/lib/decorator/files/ts/__name__.decorator.ts +3 -0
  145. package/dist/lib/decorator/schema.json +36 -0
  146. package/dist/lib/defaults.d.ts +16 -0
  147. package/dist/lib/defaults.js +19 -0
  148. package/dist/lib/filter/files/js/__name__.filter.js +6 -0
  149. package/dist/lib/filter/files/js/__name__.filter.spec.js +7 -0
  150. package/dist/lib/filter/files/ts/__name__.filter.spec.ts +7 -0
  151. package/dist/lib/filter/files/ts/__name__.filter.ts +6 -0
  152. package/dist/lib/filter/filter.factory.d.ts +3 -0
  153. package/dist/lib/filter/filter.factory.js +34 -0
  154. package/dist/lib/filter/schema.json +41 -0
  155. package/dist/lib/gateway/files/js/__name__.gateway.js +9 -0
  156. package/dist/lib/gateway/files/js/__name__.gateway.spec.js +18 -0
  157. package/dist/lib/gateway/files/ts/__name__.gateway.spec.ts +18 -0
  158. package/dist/lib/gateway/files/ts/__name__.gateway.ts +9 -0
  159. package/dist/lib/gateway/gateway.factory.d.ts +3 -0
  160. package/dist/lib/gateway/gateway.factory.js +62 -0
  161. package/dist/lib/gateway/schema.json +41 -0
  162. package/dist/lib/guard/files/js/__name__.guard.js +8 -0
  163. package/dist/lib/guard/files/js/__name__.guard.spec.js +7 -0
  164. package/dist/lib/guard/files/ts/__name__.guard.spec.ts +7 -0
  165. package/dist/lib/guard/files/ts/__name__.guard.ts +11 -0
  166. package/dist/lib/guard/guard.factory.d.ts +3 -0
  167. package/dist/lib/guard/guard.factory.js +34 -0
  168. package/dist/lib/guard/schema.json +41 -0
  169. package/dist/lib/interceptor/files/js/__name__.interceptor.js +8 -0
  170. package/dist/lib/interceptor/files/js/__name__.interceptor.spec.js +7 -0
  171. package/dist/lib/interceptor/files/ts/default/__name__.interceptor.spec.ts +7 -0
  172. package/dist/lib/interceptor/files/ts/default/__name__.interceptor.ts +9 -0
  173. package/dist/lib/interceptor/files/ts/generated/__name__.interceptor.spec.ts +7 -0
  174. package/dist/lib/interceptor/files/ts/generated/__name__.interceptor.ts +13 -0
  175. package/dist/lib/interceptor/interceptor.factory.d.ts +3 -0
  176. package/dist/lib/interceptor/interceptor.factory.js +116 -0
  177. package/dist/lib/interceptor/schema.json +50 -0
  178. package/dist/lib/interface/files/__name__.interface.ts +1 -0
  179. package/dist/lib/interface/interface.factory.d.ts +3 -0
  180. package/dist/lib/interface/interface.factory.js +32 -0
  181. package/dist/lib/interface/schema.json +32 -0
  182. package/dist/lib/library/files/js/.babelrc +4 -0
  183. package/dist/lib/library/files/js/jsconfig.json +9 -0
  184. package/dist/lib/library/files/js/src/__name__.module.js +8 -0
  185. package/dist/lib/library/files/js/src/__name__.service.js +4 -0
  186. package/dist/lib/library/files/js/src/__name__.service.spec.js +18 -0
  187. package/dist/lib/library/files/js/src/index.js +2 -0
  188. package/dist/lib/library/files/ts/src/__name__.module.ts +8 -0
  189. package/dist/lib/library/files/ts/src/__name__.service.spec.ts +18 -0
  190. package/dist/lib/library/files/ts/src/__name__.service.ts +4 -0
  191. package/dist/lib/library/files/ts/src/index.ts +2 -0
  192. package/dist/lib/library/files/ts/tsconfig.lib.json +9 -0
  193. package/dist/lib/library/library.factory.d.ts +3 -0
  194. package/dist/lib/library/library.factory.js +190 -0
  195. package/dist/lib/library/schema.json +37 -0
  196. package/dist/lib/middleware/files/js/__name__.middleware.js +8 -0
  197. package/dist/lib/middleware/files/js/__name__.middleware.spec.js +7 -0
  198. package/dist/lib/middleware/files/ts/__name__.middleware.spec.ts +7 -0
  199. package/dist/lib/middleware/files/ts/__name__.middleware.ts +8 -0
  200. package/dist/lib/middleware/middleware.factory.d.ts +3 -0
  201. package/dist/lib/middleware/middleware.factory.js +34 -0
  202. package/dist/lib/middleware/schema.json +41 -0
  203. package/dist/lib/module/files/js/__name__.module.js +4 -0
  204. package/dist/lib/module/files/ts/__name__.module.ts +4 -0
  205. package/dist/lib/module/module.factory.d.ts +3 -0
  206. package/dist/lib/module/module.factory.js +58 -0
  207. package/dist/lib/module/schema.json +46 -0
  208. package/dist/lib/pipe/files/js/__name__.pipe.js +8 -0
  209. package/dist/lib/pipe/files/js/__name__.pipe.spec.js +7 -0
  210. package/dist/lib/pipe/files/ts/__name__.pipe.spec.ts +7 -0
  211. package/dist/lib/pipe/files/ts/__name__.pipe.ts +8 -0
  212. package/dist/lib/pipe/pipe.factory.d.ts +3 -0
  213. package/dist/lib/pipe/pipe.factory.js +34 -0
  214. package/dist/lib/pipe/schema.json +41 -0
  215. package/dist/lib/prisma-resource/files/ts/__name__.controller.spec.ts +20 -0
  216. package/dist/lib/prisma-resource/files/ts/__name__.controller.ts +63 -0
  217. package/dist/lib/prisma-resource/files/ts/__name__.module.ts +9 -0
  218. package/dist/lib/prisma-resource/files/ts/__name__.service.spec.ts +18 -0
  219. package/dist/lib/prisma-resource/files/ts/__name__.service.ts +28 -0
  220. package/dist/lib/prisma-resource/files/ts/dto/create-__name@singular__.dto.ts +1 -0
  221. package/dist/lib/prisma-resource/files/ts/dto/create-__name@singular__.input.ts +7 -0
  222. package/dist/lib/prisma-resource/files/ts/dto/update-__name@singular__.dto.ts +6 -0
  223. package/dist/lib/prisma-resource/files/ts/dto/update-__name@singular__.input.ts +13 -0
  224. package/dist/lib/prisma-resource/files/ts/entities/__name@singular@ent__.ts +7 -0
  225. package/dist/lib/prisma-resource/prisma-resource.factory.d.ts +3 -0
  226. package/dist/lib/prisma-resource/prisma-resource.factory.js +131 -0
  227. package/dist/lib/prisma-resource/schema.json +91 -0
  228. package/dist/lib/provider/files/js/__name__.js +4 -0
  229. package/dist/lib/provider/files/js/__name__.spec.js +18 -0
  230. package/dist/lib/provider/files/ts/__name__.spec.ts +18 -0
  231. package/dist/lib/provider/files/ts/__name__.ts +4 -0
  232. package/dist/lib/provider/provider.factory.d.ts +3 -0
  233. package/dist/lib/provider/provider.factory.js +67 -0
  234. package/dist/lib/provider/schema.json +45 -0
  235. package/dist/lib/resolver/files/js/__name__.resolver.js +4 -0
  236. package/dist/lib/resolver/files/js/__name__.resolver.spec.js +18 -0
  237. package/dist/lib/resolver/files/ts/__name__.resolver.spec.ts +18 -0
  238. package/dist/lib/resolver/files/ts/__name__.resolver.ts +4 -0
  239. package/dist/lib/resolver/resolver.factory.d.ts +3 -0
  240. package/dist/lib/resolver/resolver.factory.js +62 -0
  241. package/dist/lib/resolver/schema.json +41 -0
  242. package/dist/lib/resource/files/ts/__name__.controller.spec.ts +20 -0
  243. package/dist/lib/resource/files/ts/__name__.controller.ts +63 -0
  244. package/dist/lib/resource/files/ts/__name__.gateway.spec.ts +19 -0
  245. package/dist/lib/resource/files/ts/__name__.gateway.ts +34 -0
  246. package/dist/lib/resource/files/ts/__name__.graphql +24 -0
  247. package/dist/lib/resource/files/ts/__name__.module.ts +9 -0
  248. package/dist/lib/resource/files/ts/__name__.resolver.spec.ts +19 -0
  249. package/dist/lib/resource/files/ts/__name__.resolver.ts +60 -0
  250. package/dist/lib/resource/files/ts/__name__.service.spec.ts +18 -0
  251. package/dist/lib/resource/files/ts/__name__.service.ts +28 -0
  252. package/dist/lib/resource/files/ts/dto/create-__name@singular__.dto.ts +1 -0
  253. package/dist/lib/resource/files/ts/dto/create-__name@singular__.input.ts +7 -0
  254. package/dist/lib/resource/files/ts/dto/update-__name@singular__.dto.ts +6 -0
  255. package/dist/lib/resource/files/ts/dto/update-__name@singular__.input.ts +13 -0
  256. package/dist/lib/resource/files/ts/entities/__name@singular@ent__.ts +7 -0
  257. package/dist/lib/resource/resource.factory.d.ts +3 -0
  258. package/dist/lib/resource/resource.factory.js +131 -0
  259. package/dist/lib/resource/schema.json +90 -0
  260. package/dist/lib/service/files/js/__name__.service.js +4 -0
  261. package/dist/lib/service/files/js/__name__.service.spec.js +18 -0
  262. package/dist/lib/service/files/ts/__name__.service.spec.ts +18 -0
  263. package/dist/lib/service/files/ts/__name__.service.ts +4 -0
  264. package/dist/lib/service/schema.json +41 -0
  265. package/dist/lib/service/service.factory.d.ts +3 -0
  266. package/dist/lib/service/service.factory.js +63 -0
  267. package/dist/lib/sub-app/files/js/.babelrc +4 -0
  268. package/dist/lib/sub-app/files/js/index.js +2 -0
  269. package/dist/lib/sub-app/files/js/jsconfig.json +10 -0
  270. package/dist/lib/sub-app/files/js/src/app.controller.js +15 -0
  271. package/dist/lib/sub-app/files/js/src/app.controller.spec.js +22 -0
  272. package/dist/lib/sub-app/files/js/src/app.module.js +10 -0
  273. package/dist/lib/sub-app/files/js/src/app.service.js +8 -0
  274. package/dist/lib/sub-app/files/js/src/main.js +8 -0
  275. package/dist/lib/sub-app/files/js/test/app.e2e-spec.js +23 -0
  276. package/dist/lib/sub-app/files/js/test/jest-e2e.json +5 -0
  277. package/dist/lib/sub-app/files/ts/src/__name__.controller.spec.ts +22 -0
  278. package/dist/lib/sub-app/files/ts/src/__name__.controller.ts +12 -0
  279. package/dist/lib/sub-app/files/ts/src/__name__.module.ts +10 -0
  280. package/dist/lib/sub-app/files/ts/src/__name__.service.ts +8 -0
  281. package/dist/lib/sub-app/files/ts/src/main.ts +8 -0
  282. package/dist/lib/sub-app/files/ts/test/app.e2e-spec.ts +24 -0
  283. package/dist/lib/sub-app/files/ts/test/jest-e2e.json +9 -0
  284. package/dist/lib/sub-app/files/ts/tsconfig.app.json +9 -0
  285. package/dist/lib/sub-app/schema.json +32 -0
  286. package/dist/lib/sub-app/sub-app.factory.d.ts +3 -0
  287. package/dist/lib/sub-app/sub-app.factory.js +245 -0
  288. package/dist/lib/sub-app/workspace/js/.babelrc +4 -0
  289. package/dist/lib/sub-app/workspace/js/index.js +2 -0
  290. package/dist/lib/sub-app/workspace/js/jsconfig.json +10 -0
  291. package/dist/lib/sub-app/workspace/ts/tsconfig.app.json +9 -0
  292. package/dist/utils/change.d.ts +46 -0
  293. package/dist/utils/change.js +95 -0
  294. package/dist/utils/dependencies.utils.d.ts +15 -0
  295. package/dist/utils/dependencies.utils.js +42 -0
  296. package/dist/utils/export-from.declarator.d.ts +10 -0
  297. package/dist/utils/export-from.declarator.js +39 -0
  298. package/dist/utils/formatting.d.ts +1 -0
  299. package/dist/utils/formatting.js +12 -0
  300. package/dist/utils/index.d.ts +9 -0
  301. package/dist/utils/index.js +25 -0
  302. package/dist/utils/json-file.util.d.ts +15 -0
  303. package/dist/utils/json-file.util.js +68 -0
  304. package/dist/utils/metadata.manager.d.ts +13 -0
  305. package/dist/utils/metadata.manager.js +162 -0
  306. package/dist/utils/module-import.declarator.d.ts +10 -0
  307. package/dist/utils/module-import.declarator.js +39 -0
  308. package/dist/utils/module-metadata.declarator.d.ts +4 -0
  309. package/dist/utils/module-metadata.declarator.js +12 -0
  310. package/dist/utils/module.declarator.d.ts +23 -0
  311. package/dist/utils/module.declarator.js +32 -0
  312. package/dist/utils/module.finder.d.ts +13 -0
  313. package/dist/utils/module.finder.js +24 -0
  314. package/dist/utils/name.parser.d.ts +12 -0
  315. package/dist/utils/name.parser.js +17 -0
  316. package/dist/utils/path.solver.d.ts +4 -0
  317. package/dist/utils/path.solver.js +14 -0
  318. package/dist/utils/source-root.helpers.d.ts +8 -0
  319. package/dist/utils/source-root.helpers.js +35 -0
  320. package/package.json +99 -0
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.main = void 0;
4
+ const core_1 = require("@angular-devkit/core");
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
+ const formatting_1 = require("../../utils/formatting");
7
+ const name_parser_1 = require("../../utils/name.parser");
8
+ const source_root_helpers_1 = require("../../utils/source-root.helpers");
9
+ function main(options) {
10
+ options = transform(options);
11
+ return (0, schematics_1.chain)([(0, source_root_helpers_1.mergeSourceRoot)(options), (0, schematics_1.mergeWith)(generate(options))]);
12
+ }
13
+ exports.main = main;
14
+ function transform(options) {
15
+ const target = Object.assign({}, options);
16
+ if (!target.name) {
17
+ throw new schematics_1.SchematicsException('Option (name) is required.');
18
+ }
19
+ const location = new name_parser_1.NameParser().parse(target);
20
+ target.name = (0, formatting_1.normalizeToKebabOrSnakeCase)(location.name);
21
+ target.path = (0, formatting_1.normalizeToKebabOrSnakeCase)(location.path);
22
+ target.language = target.language !== undefined ? target.language : 'ts';
23
+ target.path = target.flat
24
+ ? target.path
25
+ : (0, core_1.join)(target.path, target.name);
26
+ return target;
27
+ }
28
+ function generate(options) {
29
+ return (context) => (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
30
+ options.spec ? (0, schematics_1.noop)() : (0, schematics_1.filter)((path) => !path.endsWith('.spec.ts')),
31
+ (0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
32
+ (0, schematics_1.move)(options.path),
33
+ ])(context);
34
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "SchematicsNestGuard",
4
+ "title": "Nest Guard Options Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "The name of the guard.",
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
14
+ "x-prompt": "What name would you like to use for the guard?"
15
+ },
16
+ "path": {
17
+ "type": "string",
18
+ "format": "path",
19
+ "description": "The path to create the guard."
20
+ },
21
+ "language": {
22
+ "type": "string",
23
+ "description": "Nest guard language (ts/js)."
24
+ },
25
+ "sourceRoot": {
26
+ "type": "string",
27
+ "description": "Nest guard source root directory."
28
+ },
29
+ "flat": {
30
+ "type": "boolean",
31
+ "default": true,
32
+ "description": "Flag to indicate if a directory is created."
33
+ },
34
+ "spec": {
35
+ "type": "boolean",
36
+ "default": true,
37
+ "description": "Specifies if a spec file is generated."
38
+ }
39
+ },
40
+ "required": ["name"]
41
+ }
@@ -0,0 +1,8 @@
1
+ import { Injectable } from '@nestjs/common';
2
+
3
+ @Injectable()
4
+ export class <%= classify(name) %>Interceptor {
5
+ intercept(context, next) {
6
+ return next.handle();
7
+ }
8
+ }
@@ -0,0 +1,7 @@
1
+ import { <%= classify(name) %>Interceptor } from './<%= name %>.interceptor';
2
+
3
+ describe('<%= classify(name) %>Interceptor', () => {
4
+ it('should be defined', () => {
5
+ expect(new <%= classify(name) %>Interceptor()).toBeDefined();
6
+ });
7
+ });
@@ -0,0 +1,7 @@
1
+ import { <%= classify(name) %>Interceptor } from './<%= name %>.interceptor';
2
+
3
+ describe('<%= classify(name) %>Interceptor', () => {
4
+ it('should be defined', () => {
5
+ expect(new <%= classify(name) %>Interceptor()).toBeDefined();
6
+ });
7
+ });
@@ -0,0 +1,9 @@
1
+ import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
2
+ import { Observable } from 'rxjs';
3
+
4
+ @Injectable()
5
+ export class <%= classify(name) %>Interceptor implements NestInterceptor {
6
+ intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
7
+ return next.handle();
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ import { <%= classify(name) %>Interceptor } from './<%= name %>.interceptor';
2
+
3
+ describe('<%= classify(name) %>Interceptor', () => {
4
+ it('should be defined', () => {
5
+ expect(new <%= classify(name) %>Interceptor()).toBeDefined();
6
+ });
7
+ });
@@ -0,0 +1,13 @@
1
+ import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
2
+ import { Observable } from 'rxjs';
3
+ import { tap } from 'rxjs/operators';
4
+ import { UseInterceptorFor } from '@gadmin2/nest-common';
5
+ import { <%= classify(name) %>Controller } from '../../generated/<%= name %>/<%= name %>.controller';
6
+
7
+ <% if (method) { %>@UseInterceptorFor(<%= classify(name) %>Controller, '<%= method %>')<% } else { %>@UseInterceptorFor(<%= classify(name) %>Controller)<% } %>
8
+ export class <%= classify(name) %><% if (method) { %><%= classify(method) %><% } %>Interceptor implements NestInterceptor {
9
+ intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
10
+ console.log('Before...');
11
+ return next.handle().pipe(tap((val) => console.log(`After...`, val)));
12
+ }
13
+ }
@@ -0,0 +1,3 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { InterceptorOptions } from './interceptor.schema';
3
+ export declare function main(options: InterceptorOptions): Rule;
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.main = void 0;
4
+ const core_1 = require("@angular-devkit/core");
5
+ const strings_1 = require("@angular-devkit/core/src/utils/strings");
6
+ const schematics_1 = require("@angular-devkit/schematics");
7
+ const utils_1 = require("../../utils");
8
+ const formatting_1 = require("../../utils/formatting");
9
+ const name_parser_1 = require("../../utils/name.parser");
10
+ const source_root_helpers_1 = require("../../utils/source-root.helpers");
11
+ const ts = require("ts-morph");
12
+ function main(options) {
13
+ options = transform(options);
14
+ return (tree, context) => {
15
+ if (!(0, source_root_helpers_1.isInSvrRootDirectory)(tree, [])) {
16
+ throw new schematics_1.SchematicsException('This command must run in server root dir.');
17
+ }
18
+ if (isControllerExists(tree, options)) {
19
+ (0, source_root_helpers_1.mergeSourceRoot)(options)(tree, context);
20
+ options.interceptorType = 'generated';
21
+ const interceptorPath = `${options.path}/${options.name}.${options.type}.${options.language}`;
22
+ if (!tree.get(interceptorPath)) {
23
+ return (0, schematics_1.branchAndMerge)((0, schematics_1.chain)([
24
+ (0, schematics_1.mergeWith)(generate(options)),
25
+ addDeclarationToParentIndex(options),
26
+ ]))(tree, context);
27
+ }
28
+ return (0, schematics_1.branchAndMerge)((0, schematics_1.chain)([appendInceptor(options)]))(tree, context);
29
+ }
30
+ options.interceptorType = 'default';
31
+ return (0, schematics_1.branchAndMerge)((0, schematics_1.chain)([(0, source_root_helpers_1.mergeSourceRoot)(options), (0, schematics_1.mergeWith)(generate(options))]));
32
+ };
33
+ }
34
+ exports.main = main;
35
+ function transform(options) {
36
+ const target = Object.assign({}, options);
37
+ if (!target.name) {
38
+ throw new schematics_1.SchematicsException('Option (controller) is required.');
39
+ }
40
+ const location = new name_parser_1.NameParser().parse(target);
41
+ target.name = (0, formatting_1.normalizeToKebabOrSnakeCase)(location.name);
42
+ target.path = (0, formatting_1.normalizeToKebabOrSnakeCase)(location.path);
43
+ target.language = target.language !== undefined ? target.language : 'ts';
44
+ target.type = 'interceptor';
45
+ target.path = !target.flat
46
+ ? target.path
47
+ : (0, core_1.join)('customize', target.path, target.name);
48
+ return target;
49
+ }
50
+ function isControllerExists(tree, options) {
51
+ const controllerPath = `src/generated/${options.name}/${options.name}.controller.${options.language}`;
52
+ if (!tree.get(controllerPath)) {
53
+ return false;
54
+ }
55
+ const tsProject = new ts.Project({
56
+ manipulationSettings: {
57
+ indentationText: ts.IndentationText.TwoSpaces,
58
+ },
59
+ });
60
+ const sourceFile = tsProject.addSourceFileAtPath(controllerPath);
61
+ const controllerClass = sourceFile.getClassOrThrow(`${(0, strings_1.classify)(options.name)}Controller`);
62
+ if (options.method) {
63
+ controllerClass.getInstanceMethodOrThrow(options.method);
64
+ }
65
+ return true;
66
+ }
67
+ function generate(options) {
68
+ return (context) => (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language, options.interceptorType)), [
69
+ options.spec ? (0, schematics_1.noop)() : (0, schematics_1.filter)((path) => !path.endsWith('.spec.ts')),
70
+ (0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
71
+ (0, schematics_1.move)(options.path),
72
+ ])(context);
73
+ }
74
+ function appendInceptor(options) {
75
+ return (tree) => {
76
+ const interceptorPath = `${options.path}/${options.name}.${options.type}.${options.language}`;
77
+ if (!tree.get(interceptorPath)) {
78
+ throw new schematics_1.SchematicsException(`${interceptorPath} is not exist.`);
79
+ }
80
+ const tsProject = new ts.Project({
81
+ manipulationSettings: {
82
+ indentationText: ts.IndentationText.TwoSpaces,
83
+ },
84
+ });
85
+ const sourceFile = tsProject.addSourceFileAtPath(interceptorPath);
86
+ const interceptorName = `${(0, strings_1.classify)(options.name)}${options.method ? (0, strings_1.classify)(options.method) : ''}Interceptor`;
87
+ const interceptorClass = sourceFile.getClass(interceptorName);
88
+ if (interceptorClass) {
89
+ throw new schematics_1.SchematicsException(`Class ${interceptorName} is already exist in ${interceptorPath}.`);
90
+ }
91
+ sourceFile.addStatements(`
92
+ @UseInterceptorFor(${(0, strings_1.classify)(options.name)}Controller${options.method ? ", '" + options.method + "'" : ""})
93
+ export class ${interceptorName} implements NestInterceptor {
94
+ intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
95
+ console.log('Before...');
96
+ return next.handle().pipe(tap((val) => console.log('After...', val)));
97
+ }
98
+ }`);
99
+ tree.overwrite(interceptorPath, sourceFile.getFullText());
100
+ return tree;
101
+ };
102
+ }
103
+ function addDeclarationToParentIndex(options) {
104
+ return (tree) => {
105
+ const filePath = 'src/customize/index.ts';
106
+ const fileRef = tree.get(filePath);
107
+ if (!fileRef) {
108
+ throw new schematics_1.SchematicsException('src/customize/index.ts is not exist.');
109
+ }
110
+ const content = tree.read(filePath).toString();
111
+ const exportFrom = new utils_1.ExportFromDeclarator();
112
+ options.module = ('/' + filePath);
113
+ tree.overwrite(filePath, exportFrom.declare(content, options));
114
+ return tree;
115
+ };
116
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "SchematicsNestControllerInterceptor",
4
+ "title": "Nest Interceptor Options Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "The name of the controller.",
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
14
+ "x-prompt": "Input generated controller name or other name for nestjs default interceptor."
15
+ },
16
+ "method": {
17
+ "type": "string",
18
+ "description": "The name of the generated controller's method.",
19
+ "$default": {
20
+ "$source": "argv",
21
+ "index": 1
22
+ },
23
+ "x-prompt": "which controller's method would you like to intercept? (Optional)"
24
+ },
25
+ "path": {
26
+ "type": "string",
27
+ "format": "path",
28
+ "description": "The path to create the interceptor."
29
+ },
30
+ "language": {
31
+ "type": "string",
32
+ "description": "Nest interceptor language (ts/js)."
33
+ },
34
+ "sourceRoot": {
35
+ "type": "string",
36
+ "description": "Nest interceptor source root directory."
37
+ },
38
+ "flat": {
39
+ "type": "boolean",
40
+ "default": true,
41
+ "description": "Flag to indicate if a directory is created."
42
+ },
43
+ "spec": {
44
+ "type": "boolean",
45
+ "default": true,
46
+ "description": "Specifies if a spec file is generated."
47
+ }
48
+ },
49
+ "required": ["name"]
50
+ }
@@ -0,0 +1 @@
1
+ export interface <%= classify(name) %> {}
@@ -0,0 +1,3 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { InterfaceOptions } from './interface.schema';
3
+ export declare function main(options: InterfaceOptions): Rule;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.main = void 0;
4
+ const core_1 = require("@angular-devkit/core");
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
+ const formatting_1 = require("../../utils/formatting");
7
+ const name_parser_1 = require("../../utils/name.parser");
8
+ const source_root_helpers_1 = require("../../utils/source-root.helpers");
9
+ function main(options) {
10
+ options = transform(options);
11
+ return (0, schematics_1.chain)([(0, source_root_helpers_1.mergeSourceRoot)(options), (0, schematics_1.mergeWith)(generate(options))]);
12
+ }
13
+ exports.main = main;
14
+ function transform(options) {
15
+ const target = Object.assign({}, options);
16
+ if (!target.name) {
17
+ throw new schematics_1.SchematicsException('Option (name) is required.');
18
+ }
19
+ const location = new name_parser_1.NameParser().parse(target);
20
+ target.name = (0, formatting_1.normalizeToKebabOrSnakeCase)(location.name);
21
+ target.path = (0, formatting_1.normalizeToKebabOrSnakeCase)(location.path);
22
+ target.path = target.flat
23
+ ? target.path
24
+ : (0, core_1.join)(target.path, target.name);
25
+ return target;
26
+ }
27
+ function generate(options) {
28
+ return (context) => (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
29
+ (0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
30
+ (0, schematics_1.move)(options.path),
31
+ ])(context);
32
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "SchematicsNestInterface",
4
+ "title": "Nest Interface Options Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "The name of the interface.",
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
14
+ "x-prompt": "What name would you like to use for the interface?"
15
+ },
16
+ "path": {
17
+ "type": "string",
18
+ "format": "path",
19
+ "description": "The path to create the interface."
20
+ },
21
+ "sourceRoot": {
22
+ "type": "string",
23
+ "description": "Nest interface source root directory."
24
+ },
25
+ "flat": {
26
+ "type": "boolean",
27
+ "default": true,
28
+ "description": "Flag to indicate if a directory is created."
29
+ }
30
+ },
31
+ "required": ["name"]
32
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "presets": ["env", "stage-0"],
3
+ "plugins": ["transform-decorators-legacy"]
4
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES6",
4
+ "experimentalDecorators": true
5
+ },
6
+ "exclude": [
7
+ "node_modules"
8
+ ]
9
+ }
@@ -0,0 +1,8 @@
1
+ import { Module } from '@nestjs/common';
2
+ import { <%= classify(name) %>Service } from './<%= name %>.service';
3
+
4
+ @Module({
5
+ providers: [<%= classify(name) %>Service],
6
+ exports: [<%= classify(name) %>Service],
7
+ })
8
+ export class <%= classify(name) %>Module {}
@@ -0,0 +1,4 @@
1
+ import { Injectable } from '@nestjs/common';
2
+
3
+ @Injectable()
4
+ export class <%= classify(name) %>Service {}
@@ -0,0 +1,18 @@
1
+ import { Test } from '@nestjs/testing';
2
+ import { <%= classify(name) %>Service } from './<%= name %>.service';
3
+
4
+ describe('<%= classify(name) %>Service', () => {
5
+ let service;
6
+
7
+ beforeEach(async () => {
8
+ const module = await Test.createTestingModule({
9
+ providers: [<%= classify(name) %>Service],
10
+ }).compile();
11
+
12
+ service = module.get(<%= classify(name) %>Service);
13
+ });
14
+
15
+ it('should be defined', () => {
16
+ expect(service).toBeDefined();
17
+ });
18
+ });
@@ -0,0 +1,2 @@
1
+ export * from './<%= name %>.module';
2
+ export * from './<%= name %>.service';
@@ -0,0 +1,8 @@
1
+ import { Module } from '@nestjs/common';
2
+ import { <%= classify(name) %>Service } from './<%= name %>.service';
3
+
4
+ @Module({
5
+ providers: [<%= classify(name) %>Service],
6
+ exports: [<%= classify(name) %>Service],
7
+ })
8
+ export class <%= classify(name) %>Module {}
@@ -0,0 +1,18 @@
1
+ import { Test, TestingModule } from '@nestjs/testing';
2
+ import { <%= classify(name) %>Service } from './<%= name %>.service';
3
+
4
+ describe('<%= classify(name) %>Service', () => {
5
+ let service: <%= classify(name) %>Service;
6
+
7
+ beforeEach(async () => {
8
+ const module: TestingModule = await Test.createTestingModule({
9
+ providers: [<%= classify(name) %>Service],
10
+ }).compile();
11
+
12
+ service = module.get<<%= classify(name) %>Service>(<%= classify(name) %>Service);
13
+ });
14
+
15
+ it('should be defined', () => {
16
+ expect(service).toBeDefined();
17
+ });
18
+ });
@@ -0,0 +1,4 @@
1
+ import { Injectable } from '@nestjs/common';
2
+
3
+ @Injectable()
4
+ export class <%= classify(name) %>Service {}
@@ -0,0 +1,2 @@
1
+ export * from './<%= name %>.module';
2
+ export * from './<%= name %>.service';
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "outDir": "../../dist/libs/<%= name %>"
6
+ },
7
+ "include": ["src/**/*"],
8
+ "exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
9
+ }
@@ -0,0 +1,3 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { LibraryOptions } from './library.schema';
3
+ export declare function main(options: LibraryOptions): Rule;