taon 18.0.19 → 18.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/README.md +114 -118
  2. package/assets/shared/logo-header-admin-mode.png +0 -0
  3. package/assets/shared/shared_folder_info.txt +1 -1
  4. package/bin/start.js +279 -279
  5. package/bin/taon +6 -6
  6. package/bin/taon-debug +5 -5
  7. package/bin/taon-debug-brk +5 -5
  8. package/browser/README.md +24 -24
  9. package/browser/esm2022/lib/base-classes/base-abstract-entity.mjs +1 -1
  10. package/browser/esm2022/lib/base-classes/base-class.mjs +2 -2
  11. package/browser/esm2022/lib/base-classes/base-controller.mjs +3 -2
  12. package/browser/esm2022/lib/base-classes/base-crud-controller.mjs +1 -1
  13. package/browser/esm2022/lib/base-classes/base-migration.mjs +23 -0
  14. package/browser/esm2022/lib/base-classes/base-subscriber-for-entity.mjs +20 -20
  15. package/browser/esm2022/lib/base-classes/base.mjs +5 -3
  16. package/browser/esm2022/lib/context-db-migrations.mjs +410 -0
  17. package/browser/esm2022/lib/create-context.mjs +22 -8
  18. package/browser/esm2022/lib/decorators/classes/controller-decorator.mjs +4 -1
  19. package/browser/esm2022/lib/decorators/classes/entity-decorator.mjs +4 -1
  20. package/browser/esm2022/lib/decorators/classes/migration-decorator.mjs +18 -0
  21. package/browser/esm2022/lib/decorators/classes/provider-decorator.mjs +4 -1
  22. package/browser/esm2022/lib/decorators/classes/repository-decorator.mjs +4 -1
  23. package/browser/esm2022/lib/decorators/classes/subscriber-decorator.mjs +5 -2
  24. package/browser/esm2022/lib/decorators/http/http-methods-decorators.mjs +1 -1
  25. package/browser/esm2022/lib/endpoint-context.mjs +105 -59
  26. package/browser/esm2022/lib/entity-process.mjs +1 -10
  27. package/browser/esm2022/lib/get-response-value.mjs +1 -15
  28. package/browser/esm2022/lib/index.mjs +4 -1
  29. package/browser/esm2022/lib/inject.mjs +1 -1
  30. package/browser/esm2022/lib/models.mjs +30 -1
  31. package/browser/esm2022/lib/symbols.mjs +2 -1
  32. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/index.mjs +1 -3
  33. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.mjs +55 -37
  34. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin.service.mjs +17 -21
  35. package/browser/esm2022/lib/ui/taon-notifications/taon-notifications.module.mjs +1 -1
  36. package/browser/esm2022/lib/ui/taon-progress-bar/taon-progress-bar.component.mjs +1 -1
  37. package/browser/esm2022/lib/ui/taon-table/taon-table.component.mjs +1 -2
  38. package/browser/fesm2022/taon.mjs +701 -449
  39. package/browser/fesm2022/taon.mjs.map +1 -1
  40. package/browser/lib/base-classes/base-abstract-entity.d.ts +2 -1
  41. package/browser/lib/base-classes/base-class.d.ts +1 -1
  42. package/browser/lib/base-classes/base-context.d.ts +3 -0
  43. package/browser/lib/base-classes/base-controller.d.ts +2 -1
  44. package/browser/lib/base-classes/base-crud-controller.d.ts +1 -1
  45. package/browser/lib/base-classes/base-migration.d.ts +12 -0
  46. package/browser/lib/base-classes/base.d.ts +8 -2
  47. package/browser/lib/context-db-migrations.d.ts +17 -0
  48. package/browser/lib/create-context.d.ts +7 -4
  49. package/browser/lib/decorators/classes/controller-decorator.d.ts +3 -0
  50. package/browser/lib/decorators/classes/entity-decorator.d.ts +3 -0
  51. package/browser/lib/decorators/classes/migration-decorator.d.ts +8 -0
  52. package/browser/lib/decorators/classes/provider-decorator.d.ts +3 -0
  53. package/browser/lib/decorators/classes/repository-decorator.d.ts +3 -0
  54. package/browser/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  55. package/browser/lib/decorators/http/http-methods-decorators.d.ts +9 -0
  56. package/browser/lib/endpoint-context.d.ts +14 -7
  57. package/browser/lib/index.d.ts +14 -1
  58. package/browser/lib/models.d.ts +45 -22
  59. package/browser/lib/symbols.d.ts +1 -0
  60. package/browser/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  61. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +5 -8
  62. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +8 -8
  63. package/client/README.md +24 -24
  64. package/client/esm2022/lib/base-classes/base-abstract-entity.mjs +1 -1
  65. package/client/esm2022/lib/base-classes/base-class.mjs +2 -2
  66. package/client/esm2022/lib/base-classes/base-controller.mjs +3 -2
  67. package/client/esm2022/lib/base-classes/base-crud-controller.mjs +1 -1
  68. package/client/esm2022/lib/base-classes/base-migration.mjs +23 -0
  69. package/client/esm2022/lib/base-classes/base-subscriber-for-entity.mjs +20 -20
  70. package/client/esm2022/lib/base-classes/base.mjs +5 -3
  71. package/client/esm2022/lib/context-db-migrations.mjs +410 -0
  72. package/client/esm2022/lib/create-context.mjs +22 -8
  73. package/client/esm2022/lib/decorators/classes/controller-decorator.mjs +4 -1
  74. package/client/esm2022/lib/decorators/classes/entity-decorator.mjs +4 -1
  75. package/client/esm2022/lib/decorators/classes/migration-decorator.mjs +18 -0
  76. package/client/esm2022/lib/decorators/classes/provider-decorator.mjs +4 -1
  77. package/client/esm2022/lib/decorators/classes/repository-decorator.mjs +4 -1
  78. package/client/esm2022/lib/decorators/classes/subscriber-decorator.mjs +5 -2
  79. package/client/esm2022/lib/decorators/http/http-methods-decorators.mjs +1 -1
  80. package/client/esm2022/lib/endpoint-context.mjs +105 -59
  81. package/client/esm2022/lib/entity-process.mjs +1 -10
  82. package/client/esm2022/lib/get-response-value.mjs +1 -15
  83. package/client/esm2022/lib/index.mjs +4 -1
  84. package/client/esm2022/lib/inject.mjs +1 -1
  85. package/client/esm2022/lib/models.mjs +30 -1
  86. package/client/esm2022/lib/symbols.mjs +2 -1
  87. package/client/esm2022/lib/ui/taon-admin-mode-configuration/index.mjs +1 -3
  88. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.mjs +55 -37
  89. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin.service.mjs +17 -21
  90. package/client/esm2022/lib/ui/taon-notifications/taon-notifications.module.mjs +1 -1
  91. package/client/esm2022/lib/ui/taon-progress-bar/taon-progress-bar.component.mjs +1 -1
  92. package/client/esm2022/lib/ui/taon-table/taon-table.component.mjs +1 -2
  93. package/client/fesm2022/taon.mjs +701 -449
  94. package/client/fesm2022/taon.mjs.map +1 -1
  95. package/client/lib/base-classes/base-abstract-entity.d.ts +2 -1
  96. package/client/lib/base-classes/base-class.d.ts +1 -1
  97. package/client/lib/base-classes/base-context.d.ts +3 -0
  98. package/client/lib/base-classes/base-controller.d.ts +2 -1
  99. package/client/lib/base-classes/base-crud-controller.d.ts +1 -1
  100. package/client/lib/base-classes/base-migration.d.ts +12 -0
  101. package/client/lib/base-classes/base.d.ts +8 -2
  102. package/client/lib/context-db-migrations.d.ts +17 -0
  103. package/client/lib/create-context.d.ts +7 -4
  104. package/client/lib/decorators/classes/controller-decorator.d.ts +3 -0
  105. package/client/lib/decorators/classes/entity-decorator.d.ts +3 -0
  106. package/client/lib/decorators/classes/migration-decorator.d.ts +8 -0
  107. package/client/lib/decorators/classes/provider-decorator.d.ts +3 -0
  108. package/client/lib/decorators/classes/repository-decorator.d.ts +3 -0
  109. package/client/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  110. package/client/lib/decorators/http/http-methods-decorators.d.ts +9 -0
  111. package/client/lib/endpoint-context.d.ts +14 -7
  112. package/client/lib/index.d.ts +14 -1
  113. package/client/lib/models.d.ts +45 -22
  114. package/client/lib/symbols.d.ts +1 -0
  115. package/client/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  116. package/client/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +5 -8
  117. package/client/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +8 -8
  118. package/lib/base-classes/base-abstract-entity.d.ts +1 -0
  119. package/lib/base-classes/base-class.d.ts +1 -1
  120. package/lib/base-classes/base-class.js +1 -1
  121. package/lib/base-classes/base-context.d.ts +3 -0
  122. package/lib/base-classes/base-controller.d.ts +2 -1
  123. package/lib/base-classes/base-controller.js +2 -1
  124. package/lib/base-classes/base-controller.js.map +1 -1
  125. package/lib/base-classes/base-crud-controller.d.ts +1 -1
  126. package/lib/base-classes/base-migration.d.ts +11 -0
  127. package/lib/base-classes/base-migration.js +41 -0
  128. package/lib/base-classes/base-migration.js.map +1 -0
  129. package/lib/base-classes/base-repository.js +4 -4
  130. package/lib/base-classes/base-repository.js.map +1 -1
  131. package/lib/base-classes/base-subscriber-for-entity.js +19 -19
  132. package/lib/base-classes/base-subscriber-for-entity.js.map +1 -1
  133. package/lib/base-classes/base.d.ts +8 -2
  134. package/lib/base-classes/base.js +4 -2
  135. package/lib/base-classes/base.js.map +1 -1
  136. package/lib/context-db-migrations.d.ts +16 -0
  137. package/lib/context-db-migrations.js +585 -0
  138. package/lib/context-db-migrations.js.map +1 -0
  139. package/lib/create-context.d.ts +7 -4
  140. package/lib/create-context.js +34 -12
  141. package/lib/create-context.js.map +1 -1
  142. package/lib/decorators/classes/controller-decorator.d.ts +3 -0
  143. package/lib/decorators/classes/controller-decorator.js +3 -0
  144. package/lib/decorators/classes/controller-decorator.js.map +1 -1
  145. package/lib/decorators/classes/entity-decorator.d.ts +3 -0
  146. package/lib/decorators/classes/entity-decorator.js +3 -0
  147. package/lib/decorators/classes/entity-decorator.js.map +1 -1
  148. package/lib/decorators/classes/migration-decorator.d.ts +7 -0
  149. package/lib/decorators/classes/migration-decorator.js +27 -0
  150. package/lib/decorators/classes/migration-decorator.js.map +1 -0
  151. package/lib/decorators/classes/provider-decorator.d.ts +3 -0
  152. package/lib/decorators/classes/provider-decorator.js +3 -0
  153. package/lib/decorators/classes/provider-decorator.js.map +1 -1
  154. package/lib/decorators/classes/repository-decorator.d.ts +3 -0
  155. package/lib/decorators/classes/repository-decorator.js +3 -0
  156. package/lib/decorators/classes/repository-decorator.js.map +1 -1
  157. package/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  158. package/lib/decorators/classes/subscriber-decorator.js +4 -1
  159. package/lib/decorators/classes/subscriber-decorator.js.map +1 -1
  160. package/lib/decorators/http/http-methods-decorators.d.ts +9 -0
  161. package/lib/decorators/http/http-methods-decorators.js.map +1 -1
  162. package/lib/endpoint-context.d.ts +14 -7
  163. package/lib/endpoint-context.js +265 -220
  164. package/lib/endpoint-context.js.map +1 -1
  165. package/lib/entity-process.js +0 -9
  166. package/lib/entity-process.js.map +1 -1
  167. package/lib/get-response-value.js +14 -37
  168. package/lib/get-response-value.js.map +1 -1
  169. package/lib/index.d.ts +14 -1
  170. package/lib/index.js +5 -1
  171. package/lib/index.js.map +1 -1
  172. package/lib/inject.js +0 -2
  173. package/lib/inject.js.map +1 -1
  174. package/lib/models.d.ts +45 -23
  175. package/lib/models.js +45 -0
  176. package/lib/models.js.map +1 -1
  177. package/lib/symbols.d.ts +1 -0
  178. package/lib/symbols.js +1 -0
  179. package/lib/symbols.js.map +1 -1
  180. package/lib/ui/directives/index.js +2 -2
  181. package/lib/ui/index.js +2 -2
  182. package/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  183. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  184. package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +4 -7
  185. package/lib/ui/taon-admin-mode-configuration/{models/taon-admin-mode-tabs.js → taon-admin.models.js} +1 -1
  186. package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js.map +1 -0
  187. package/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +6 -6
  188. package/lib/ui/taon-github-fork-me-corner/index.js +2 -2
  189. package/lib/ui/taon-github-fork-me-ribbon/index.js +2 -2
  190. package/lib/ui/taon-notifications/taon-notifications.models.js +2 -2
  191. package/lib/ui/taon-progress-bar/index.js +2 -2
  192. package/lib/ui/taon-session-passcode/index.js +2 -2
  193. package/lib/ui/taon-table/index.js +2 -2
  194. package/migrations/index.d.ts +1 -0
  195. package/migrations/index.js +6 -0
  196. package/migrations/index.js.map +1 -0
  197. package/migrations/migrations_index._auto-generated_.d.ts +0 -0
  198. package/migrations/migrations_index._auto-generated_.js +4 -0
  199. package/migrations/migrations_index._auto-generated_.js.map +1 -0
  200. package/package.json +7 -7
  201. package/taon.jsonc +47 -47
  202. package/tmp-environment.json +39 -31
  203. package/websql/README.md +24 -24
  204. package/websql/esm2022/lib/base-classes/base-abstract-entity.mjs +1 -1
  205. package/websql/esm2022/lib/base-classes/base-class.mjs +2 -2
  206. package/websql/esm2022/lib/base-classes/base-controller.mjs +3 -2
  207. package/websql/esm2022/lib/base-classes/base-crud-controller.mjs +1 -1
  208. package/websql/esm2022/lib/base-classes/base-migration.mjs +23 -0
  209. package/websql/esm2022/lib/base-classes/base-repository.mjs +5 -5
  210. package/websql/esm2022/lib/base-classes/base-subscriber-for-entity.mjs +20 -20
  211. package/websql/esm2022/lib/base-classes/base.mjs +5 -3
  212. package/websql/esm2022/lib/context-db-migrations.mjs +269 -0
  213. package/websql/esm2022/lib/create-context.mjs +22 -8
  214. package/websql/esm2022/lib/decorators/classes/controller-decorator.mjs +4 -1
  215. package/websql/esm2022/lib/decorators/classes/entity-decorator.mjs +4 -1
  216. package/websql/esm2022/lib/decorators/classes/migration-decorator.mjs +18 -0
  217. package/websql/esm2022/lib/decorators/classes/provider-decorator.mjs +4 -1
  218. package/websql/esm2022/lib/decorators/classes/repository-decorator.mjs +4 -1
  219. package/websql/esm2022/lib/decorators/classes/subscriber-decorator.mjs +5 -2
  220. package/websql/esm2022/lib/decorators/http/http-methods-decorators.mjs +1 -1
  221. package/websql/esm2022/lib/endpoint-context.mjs +139 -95
  222. package/websql/esm2022/lib/entity-process.mjs +1 -10
  223. package/websql/esm2022/lib/get-response-value.mjs +4 -24
  224. package/websql/esm2022/lib/index.mjs +4 -1
  225. package/websql/esm2022/lib/inject.mjs +1 -1
  226. package/websql/esm2022/lib/models.mjs +28 -1
  227. package/websql/esm2022/lib/symbols.mjs +2 -1
  228. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/index.mjs +1 -3
  229. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.mjs +55 -37
  230. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin.service.mjs +17 -21
  231. package/websql/esm2022/lib/ui/taon-notifications/taon-notifications.module.mjs +1 -1
  232. package/websql/esm2022/lib/ui/taon-progress-bar/taon-progress-bar.component.mjs +1 -1
  233. package/websql/esm2022/lib/ui/taon-table/taon-table.component.mjs +1 -2
  234. package/websql/fesm2022/taon.mjs +594 -497
  235. package/websql/fesm2022/taon.mjs.map +1 -1
  236. package/websql/lib/base-classes/base-abstract-entity.d.ts +2 -1
  237. package/websql/lib/base-classes/base-class.d.ts +1 -1
  238. package/websql/lib/base-classes/base-context.d.ts +3 -0
  239. package/websql/lib/base-classes/base-controller.d.ts +2 -1
  240. package/websql/lib/base-classes/base-crud-controller.d.ts +1 -1
  241. package/websql/lib/base-classes/base-migration.d.ts +12 -0
  242. package/websql/lib/base-classes/base.d.ts +8 -2
  243. package/websql/lib/context-db-migrations.d.ts +17 -0
  244. package/websql/lib/create-context.d.ts +7 -4
  245. package/websql/lib/decorators/classes/controller-decorator.d.ts +3 -0
  246. package/websql/lib/decorators/classes/entity-decorator.d.ts +3 -0
  247. package/websql/lib/decorators/classes/migration-decorator.d.ts +8 -0
  248. package/websql/lib/decorators/classes/provider-decorator.d.ts +3 -0
  249. package/websql/lib/decorators/classes/repository-decorator.d.ts +3 -0
  250. package/websql/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  251. package/websql/lib/decorators/http/http-methods-decorators.d.ts +9 -0
  252. package/websql/lib/endpoint-context.d.ts +14 -7
  253. package/websql/lib/index.d.ts +14 -1
  254. package/websql/lib/models.d.ts +45 -23
  255. package/websql/lib/symbols.d.ts +1 -0
  256. package/websql/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  257. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +5 -8
  258. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +8 -8
  259. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.mjs +0 -5
  260. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.mjs +0 -115
  261. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.mjs +0 -50
  262. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.mjs +0 -5
  263. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.mjs +0 -61
  264. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.mjs +0 -21
  265. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.mjs +0 -4
  266. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.mjs +0 -32
  267. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.mjs +0 -54
  268. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -3
  269. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -33
  270. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -16
  271. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -3
  272. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -17
  273. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -10
  274. package/browser/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +0 -6
  275. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -18
  276. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -17
  277. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.mjs +0 -5
  278. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.mjs +0 -115
  279. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.mjs +0 -50
  280. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.mjs +0 -5
  281. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.mjs +0 -61
  282. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.mjs +0 -21
  283. package/client/esm2022/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.mjs +0 -4
  284. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.mjs +0 -32
  285. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.mjs +0 -54
  286. package/client/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -3
  287. package/client/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -33
  288. package/client/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -16
  289. package/client/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -3
  290. package/client/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -17
  291. package/client/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -10
  292. package/client/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +0 -6
  293. package/client/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -18
  294. package/client/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -17
  295. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -2
  296. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js +0 -5
  297. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js.map +0 -1
  298. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -29
  299. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -2
  300. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.d.ts +0 -1
  301. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js +0 -5
  302. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js.map +0 -1
  303. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/taon-db-admin.component.d.ts +0 -8
  304. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -2
  305. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js +0 -5
  306. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js.map +0 -1
  307. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -13
  308. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -2
  309. package/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.js.map +0 -1
  310. package/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -14
  311. package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -2
  312. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.mjs +0 -5
  313. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.mjs +0 -115
  314. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.mjs +0 -50
  315. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.mjs +0 -5
  316. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.mjs +0 -61
  317. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.mjs +0 -21
  318. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.mjs +0 -4
  319. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.mjs +0 -32
  320. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.mjs +0 -54
  321. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -3
  322. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -33
  323. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -16
  324. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -3
  325. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -17
  326. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -10
  327. package/websql/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +0 -6
  328. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -18
  329. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -17
  330. /package/lib/ui/taon-admin-mode-configuration/{models/taon-admin-mode-tabs.d.ts → taon-admin.models.d.ts} +0 -0
@@ -21,15 +21,16 @@ var tnp_core_1 = require("tnp-core");
21
21
  //#endregion
22
22
  /* */
23
23
  /* */
24
+ var tnp_core_2 = require("tnp-core");
24
25
  var models_1 = require("./models");
25
26
  var class_helpers_1 = require("./helpers/class-helpers");
26
27
  var symbols_1 = require("./symbols");
27
- var tnp_core_2 = require("tnp-core");
28
+ var tnp_core_3 = require("tnp-core");
28
29
  var di_container_1 = require("./dependency-injection/di-container");
29
30
  var taon_helpers_1 = require("./helpers/taon-helpers");
30
31
  var ng2_rest_1 = require("ng2-rest");
31
32
  var json10_1 = require("json10");
32
- var tnp_core_3 = require("tnp-core");
33
+ var tnp_core_4 = require("tnp-core");
33
34
  var rxjs_1 = require("rxjs");
34
35
  var entity_process_1 = require("./entity-process");
35
36
  var get_response_value_1 = require("./get-response-value");
@@ -37,6 +38,7 @@ var axios_1 = require("axios");
37
38
  var taon_typeorm_3 = require("taon-typeorm");
38
39
  var env_1 = require("./env");
39
40
  var realtime_core_1 = require("./realtime/realtime-core");
41
+ var context_db_migrations_1 = require("./context-db-migrations");
40
42
  //#endregion
41
43
  var EndpointContext = /** @class */ (function () {
42
44
  //#endregion
@@ -63,6 +65,7 @@ var EndpointContext = /** @class */ (function () {
63
65
  */
64
66
  this.inited = false;
65
67
  //#endregion
68
+ this.dbMigrations = new context_db_migrations_1.ContextDbMigrations(this);
66
69
  this.localInstaceObjSymbol = Symbol('localInstaceObjSymbol');
67
70
  //#region fields / all instances of classes from context
68
71
  /**
@@ -86,14 +89,20 @@ var EndpointContext = /** @class */ (function () {
86
89
  models_1.Models.ClassType.PROVIDER,
87
90
  models_1.Models.ClassType.REPOSITORY,
88
91
  models_1.Models.ClassType.SUBSCRIBER,
92
+ models_1.Models.ClassType.MIGRATION,
89
93
  ];
90
94
  //#endregion
91
95
  this.allTypesfromContexts = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(this.injectableTypesfromContexts), false), [
92
96
  models_1.Models.ClassType.ENTITY,
93
97
  ], false);
98
+ // public __contextForControllerInstanceAccess?: EndpointContext;
94
99
  //#region fields / express app
95
100
  this.expressApp = {};
96
101
  //#endregion
102
+ //#region fields / only migration start
103
+ this.onlyMigrationRun = false;
104
+ this.onlyMigrationRevertToTimestamp = undefined;
105
+ //#endregion
97
106
  //#region fields / entities triggers
98
107
  this.entitiesTriggers = {};
99
108
  //#endregion
@@ -191,7 +200,7 @@ var EndpointContext = /** @class */ (function () {
191
200
  var key = _d.value;
192
201
  var BaseClass_1 = classesInput[key];
193
202
  if (!BaseClass_1) {
194
- tnp_core_2.Helpers.error("Class ".concat(key, " is not defined in context ").concat(ctx.contextName, "\n\n Please check if you have correct import in context file\n\n "));
203
+ tnp_core_3.Helpers.error("Class ".concat(key, " is not defined in context ").concat(ctx.contextName, "\n\n Please check if you have correct import in context file\n\n "));
195
204
  }
196
205
  var className = Reflect.getMetadata(symbols_1.Symbols.metadata.className, BaseClass_1);
197
206
  // console.log('Metadata className', className, BaseClass);
@@ -227,6 +236,13 @@ var EndpointContext = /** @class */ (function () {
227
236
  /* */
228
237
  /* */
229
238
  };
239
+ Object.defineProperty(EndpointContext.prototype, "isRunOrRevertOnlyMigrationAppStart", {
240
+ get: function () {
241
+ return !!(this.onlyMigrationRun || this.onlyMigrationRevertToTimestamp);
242
+ },
243
+ enumerable: false,
244
+ configurable: true
245
+ });
230
246
  Object.defineProperty(EndpointContext.prototype, "realtimeClient", {
231
247
  get: function () {
232
248
  return this.realtime.client;
@@ -246,7 +262,7 @@ var EndpointContext = /** @class */ (function () {
246
262
  //#region fields / logs
247
263
  get: function () {
248
264
  var _a, _b;
249
- if (tnp_core_2._.isObject((_a = this.config) === null || _a === void 0 ? void 0 : _a.logs)) {
265
+ if (tnp_core_3._.isObject((_a = this.config) === null || _a === void 0 ? void 0 : _a.logs)) {
250
266
  return !!this.config.logs.http;
251
267
  }
252
268
  return ((_b = this.config) === null || _b === void 0 ? void 0 : _b.logs) === true;
@@ -257,7 +273,7 @@ var EndpointContext = /** @class */ (function () {
257
273
  Object.defineProperty(EndpointContext.prototype, "logRealtime", {
258
274
  get: function () {
259
275
  var _a, _b;
260
- if (tnp_core_2._.isObject((_a = this.config) === null || _a === void 0 ? void 0 : _a.logs)) {
276
+ if (tnp_core_3._.isObject((_a = this.config) === null || _a === void 0 ? void 0 : _a.logs)) {
261
277
  return !!this.config.logs.realtime;
262
278
  }
263
279
  return ((_b = this.config) === null || _b === void 0 ? void 0 : _b.logs) === true;
@@ -268,7 +284,7 @@ var EndpointContext = /** @class */ (function () {
268
284
  Object.defineProperty(EndpointContext.prototype, "logFramework", {
269
285
  get: function () {
270
286
  var _a, _b;
271
- if (tnp_core_2._.isObject((_a = this.config) === null || _a === void 0 ? void 0 : _a.logs)) {
287
+ if (tnp_core_3._.isObject((_a = this.config) === null || _a === void 0 ? void 0 : _a.logs)) {
272
288
  return !!this.config.logs.framework;
273
289
  }
274
290
  return ((_b = this.config) === null || _b === void 0 ? void 0 : _b.logs) === true;
@@ -279,7 +295,7 @@ var EndpointContext = /** @class */ (function () {
279
295
  Object.defineProperty(EndpointContext.prototype, "logDb", {
280
296
  get: function () {
281
297
  var _a, _b;
282
- if (tnp_core_2._.isObject((_a = this.config) === null || _a === void 0 ? void 0 : _a.logs)) {
298
+ if (tnp_core_3._.isObject((_a = this.config) === null || _a === void 0 ? void 0 : _a.logs)) {
283
299
  return !!this.config.logs.db;
284
300
  }
285
301
  return ((_b = this.config) === null || _b === void 0 ? void 0 : _b.logs) === true;
@@ -287,58 +303,60 @@ var EndpointContext = /** @class */ (function () {
287
303
  enumerable: false,
288
304
  configurable: true
289
305
  });
306
+ Object.defineProperty(EndpointContext.prototype, "logMigrations", {
307
+ get: function () {
308
+ var _a, _b;
309
+ if (tnp_core_3._.isObject((_a = this.config) === null || _a === void 0 ? void 0 : _a.logs)) {
310
+ return !!this.config.logs.migrations;
311
+ }
312
+ return ((_b = this.config) === null || _b === void 0 ? void 0 : _b.logs) === true;
313
+ },
314
+ enumerable: false,
315
+ configurable: true
316
+ });
290
317
  //#endregion
291
318
  //#region methods & getters / init
292
319
  EndpointContext.prototype.init = function (options) {
293
320
  return tslib_1.__awaiter(this, void 0, void 0, function () {
294
- var _a, initFromRecrusiveContextResovle, overrideHost, overrideRemoteHost, oneHour, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, classTypeName, _p, _q, classTypeName, e_2_1;
295
- var e_3, _r, e_2, _s;
321
+ var _a, initFromRecrusiveContextResovle, overrideHost, overrideRemoteHost, onlyMigrationRun, onlyMigrationRevertToTimestamp, oneHour, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, classTypeName, _r, _s, classTypeName, e_2_1;
322
+ var e_3, _t, e_2, _u;
296
323
  var _this = this;
297
- var _t, _u;
298
- return tslib_1.__generator(this, function (_v) {
299
- switch (_v.label) {
324
+ var _v, _w;
325
+ return tslib_1.__generator(this, function (_x) {
326
+ switch (_x.label) {
300
327
  case 0:
301
- _a = options || {}, initFromRecrusiveContextResovle = _a.initFromRecrusiveContextResovle, overrideHost = _a.overrideHost, overrideRemoteHost = _a.overrideRemoteHost;
328
+ _a = options || {}, initFromRecrusiveContextResovle = _a.initFromRecrusiveContextResovle, overrideHost = _a.overrideHost, overrideRemoteHost = _a.overrideRemoteHost, onlyMigrationRun = _a.onlyMigrationRun, onlyMigrationRevertToTimestamp = _a.onlyMigrationRevertToTimestamp;
302
329
  this.inited = true;
330
+ // @ts-ignore
331
+ this.onlyMigrationRun = onlyMigrationRun;
332
+ // @ts-ignore
333
+ this.onlyMigrationRevertToTimestamp = onlyMigrationRevertToTimestamp;
303
334
  this.config = this.configFn(env_1.ENV);
335
+ if (tnp_core_3._.isObject(this.config.database)) {
336
+ this.config.database = models_1.Models.DatabaseConfig.from(this.config.database).databaseConfigTypeORM;
337
+ }
304
338
  if (overrideHost && overrideRemoteHost) {
305
- if (tnp_core_2.Helpers.isWebSQL) {
306
- throw new Error("You can't have overrideHost and overrideRemoteHost at the same time");
307
- }
308
- tnp_core_2.Helpers.error("You can't have overrideHost and overrideRemoteHost at the same time", false, true);
309
- //#region @backend
310
- process.exit(0);
311
- //#endregion
339
+ tnp_core_3.Helpers.throw("[taon-config] You can't have overrideHost and overrideRemoteHost at the same time");
340
+ }
341
+ this.config.host = !tnp_core_3._.isUndefined(overrideHost)
342
+ ? overrideHost
343
+ : this.config.host;
344
+ this.config.remoteHost = !tnp_core_3._.isUndefined(overrideRemoteHost)
345
+ ? overrideRemoteHost
346
+ : this.config.remoteHost;
347
+ this.config.host = this.host === null ? void 0 : this.host;
348
+ this.config.remoteHost =
349
+ this.remoteHost === null ? void 0 : this.remoteHost;
350
+ if (this.config.host &&
351
+ !this.config.host.startsWith('http://') &&
352
+ !this.config.host.startsWith('https://')) {
353
+ tnp_core_3.Helpers.throw("[taon-config] Your 'host' must start with http:// or https://");
354
+ }
355
+ if (this.config.remoteHost &&
356
+ !this.config.remoteHost.startsWith('http://') &&
357
+ !this.config.remoteHost.startsWith('https://')) {
358
+ tnp_core_3.Helpers.throw("[taon-config] Your 'remoteHost' must start with http:// or https://");
312
359
  }
313
- this.config.host = overrideHost ? overrideHost : this.config.host;
314
- this.config.remoteHost = overrideRemoteHost ? overrideRemoteHost : this.config.remoteHost;
315
- // console.log(
316
- // `[${
317
- // this.contextName
318
- // }] init context... from resolve: ${!!initFromRecrusiveContextResovle}`,
319
- // );
320
- //#region debug config
321
- // console.log(
322
- // `[taon][${this.config.contextName}] - resolve config from fn`,
323
- // {
324
- // config: this.config,
325
- // },
326
- // );
327
- // for (const ctrlName of Object.keys(config.controllers || {})) {
328
- // console.log(`${ctrlName} = ${!!config.controllers[ctrlName]}`);
329
- // }
330
- // for (const entityName of Object.keys(config.entities || {})) {
331
- // console.log(`${entityName} = ${!!config.entities[entityName]}`);
332
- // }
333
- // for (const providersName of Object.keys(config.providers || {})) {
334
- // console.log(`${providersName} = ${!!config.providers[providersName]}`);
335
- // }
336
- // for (const repositoryName of Object.keys(config.repositories || {})) {
337
- // console.log(
338
- // `${repositoryName} = ${!!config.repositories[repositoryName]}`,
339
- // );
340
- // }
341
- //#endregion
342
360
  //#region resolve mode
343
361
  if (this.config.host) {
344
362
  this.mode = 'backend-frontend(tcp+udp)';
@@ -347,12 +365,12 @@ var EndpointContext = /** @class */ (function () {
347
365
  }
348
366
  if (this.config.remoteHost) {
349
367
  if (this.config.host) {
350
- tnp_core_2.Helpers.error("[taon] You can't have remoteHost and host at the same time", false, true);
368
+ tnp_core_3.Helpers.throw("[taon] You can't have remoteHost and host at the same time");
351
369
  }
352
370
  this.mode = 'remote-backend(tcp+udp)';
353
371
  }
354
- if (this.config.useIpcWhenElectron && tnp_core_2.Helpers.isElectron) {
355
- if (tnp_core_2.Helpers.isWebSQL) {
372
+ if (this.config.useIpcWhenElectron && tnp_core_3.Helpers.isElectron) {
373
+ if (tnp_core_3.Helpers.isWebSQL) {
356
374
  this.mode = 'backend-frontend(websql-electron)';
357
375
  }
358
376
  else {
@@ -360,7 +378,7 @@ var EndpointContext = /** @class */ (function () {
360
378
  }
361
379
  }
362
380
  if (!this.mode && !this.config.abstract) {
363
- tnp_core_2.Helpers.error("[taon] Context \"".concat(this.contextName, "\": You need to provide host or remoteHost or useIpcWhenElectron"), false, true);
381
+ tnp_core_3.Helpers.error("[taon] Context \"".concat(this.contextName, "\": You need to provide host or remoteHost or useIpcWhenElectron"), false, true);
364
382
  //#region @backend
365
383
  process.exit(1);
366
384
  //#endregion
@@ -370,13 +388,13 @@ var EndpointContext = /** @class */ (function () {
370
388
  if (this.config.database === true) {
371
389
  this.databaseConfig = this.getAutoGeneratedConfig();
372
390
  }
373
- else if (tnp_core_2._.isObject(this.config.database)) {
374
- this.databaseConfig = tnp_core_2._.cloneDeep(this.config.database);
391
+ else if (tnp_core_3._.isObject(this.config.database)) {
392
+ this.databaseConfig = tnp_core_3._.merge(this.getAutoGeneratedConfig(), tnp_core_3._.cloneDeep(this.config.database));
375
393
  }
376
394
  //#endregion
377
395
  //#region resolve session
378
396
  if (this.config.session) {
379
- this.session = tnp_core_2._.cloneDeep(this.config.session);
397
+ this.session = tnp_core_3._.cloneDeep(this.config.session);
380
398
  oneHour = 1000 * 60 * 60 * 1;
381
399
  if (!this.session.cookieMaxAge) {
382
400
  this.session.cookieMaxAge = oneHour;
@@ -392,35 +410,41 @@ var EndpointContext = /** @class */ (function () {
392
410
  this.config.repositories = this.config.repositories || {};
393
411
  this.config.providers = this.config.providers || {};
394
412
  this.config.subscribers = this.config.subscribers || {};
413
+ this.config.migrations = this.config.migrations || {};
395
414
  _b = this.config;
396
415
  _c = [{}];
397
416
  return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.ENTITY)];
398
417
  case 1:
399
- _b.entities = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _c.concat([(_v.sent())])), this.config.entities]);
418
+ _b.entities = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _c.concat([(_x.sent())])), this.config.entities]);
400
419
  _d = this.config;
401
420
  _e = [{}];
402
421
  return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.CONTROLLER)];
403
422
  case 2:
404
- _d.controllers = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _e.concat([(_v.sent())])), this.config.controllers]);
423
+ _d.controllers = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _e.concat([(_x.sent())])), this.config.controllers]);
405
424
  _f = this.config;
406
425
  _g = [{}];
407
426
  return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.PROVIDER)];
408
427
  case 3:
409
- _f.providers = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _g.concat([(_v.sent())])), this.config.providers]);
428
+ _f.providers = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _g.concat([(_x.sent())])), this.config.providers]);
410
429
  _h = this.config;
411
430
  _j = [{}];
412
431
  return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.SUBSCRIBER)];
413
432
  case 4:
414
- _h.subscribers = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _j.concat([(_v.sent())])), this.config.subscribers]);
433
+ _h.subscribers = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _j.concat([(_x.sent())])), this.config.subscribers]);
415
434
  _k = this.config;
416
435
  _l = [{}];
417
436
  return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.REPOSITORY)];
418
437
  case 5:
419
- _k.repositories = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _l.concat([(_v.sent())])), this.config.repositories]);
438
+ _k.repositories = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _l.concat([(_x.sent())])), this.config.repositories]);
439
+ _m = this.config;
440
+ _o = [{}];
441
+ return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.MIGRATION)];
442
+ case 6:
443
+ _m.migrations = tslib_1.__assign.apply(void 0, [tslib_1.__assign.apply(void 0, _o.concat([(_x.sent())])), this.config.migrations]);
420
444
  // console.log(this.config);
421
445
  // debugger;
422
446
  //#endregion
423
- //#region prepare classes instances/funcitons clones
447
+ //#region prepare classes instances/functions clones
424
448
  this.config.controllers = this.cloneClassesObjWithNewMetadata({
425
449
  classesInput: this.config.controllers,
426
450
  config: this.config,
@@ -445,11 +469,17 @@ var EndpointContext = /** @class */ (function () {
445
469
  ctx: this,
446
470
  classType: models_1.Models.ClassType.SUBSCRIBER,
447
471
  });
472
+ this.config.migrations = this.cloneClassesObjWithNewMetadata({
473
+ classesInput: this.config.migrations,
474
+ config: this.config,
475
+ ctx: this,
476
+ classType: models_1.Models.ClassType.MIGRATION,
477
+ });
448
478
  try {
449
479
  //#endregion
450
480
  //#region prepare instances
451
- for (_m = tslib_1.__values(this.injectableTypesfromContexts), _o = _m.next(); !_o.done; _o = _m.next()) {
452
- classTypeName = _o.value;
481
+ for (_p = tslib_1.__values(this.injectableTypesfromContexts), _q = _p.next(); !_q.done; _q = _p.next()) {
482
+ classTypeName = _q.value;
453
483
  this.classInstancesByNameObj[classTypeName] = {};
454
484
  this.objWithClassesInstancesArr[classTypeName] = [];
455
485
  }
@@ -457,81 +487,83 @@ var EndpointContext = /** @class */ (function () {
457
487
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
458
488
  finally {
459
489
  try {
460
- if (_o && !_o.done && (_r = _m.return)) _r.call(_m);
490
+ if (_q && !_q.done && (_t = _p.return)) _t.call(_p);
461
491
  }
462
492
  finally { if (e_3) throw e_3.error; }
463
493
  }
464
- _v.label = 6;
465
- case 6:
466
- _v.trys.push([6, 11, 12, 13]);
467
- _p = tslib_1.__values(this.injectableTypesfromContexts), _q = _p.next();
468
- _v.label = 7;
494
+ _x.label = 7;
469
495
  case 7:
470
- if (!!_q.done) return [3 /*break*/, 10];
471
- classTypeName = _q.value;
472
- return [4 /*yield*/, this.createInstances(this.config[models_1.Models.ClassTypeKey[classTypeName]], classTypeName)];
496
+ _x.trys.push([7, 12, 13, 14]);
497
+ _r = tslib_1.__values(this.injectableTypesfromContexts), _s = _r.next();
498
+ _x.label = 8;
473
499
  case 8:
474
- _v.sent();
475
- _v.label = 9;
500
+ if (!!_s.done) return [3 /*break*/, 11];
501
+ classTypeName = _s.value;
502
+ return [4 /*yield*/, this.createInstances(this.config[models_1.Models.ClassTypeKey[classTypeName]], classTypeName)];
476
503
  case 9:
477
- _q = _p.next();
478
- return [3 /*break*/, 7];
479
- case 10: return [3 /*break*/, 13];
480
- case 11:
481
- e_2_1 = _v.sent();
482
- e_2 = { error: e_2_1 };
483
- return [3 /*break*/, 13];
504
+ _x.sent();
505
+ _x.label = 10;
506
+ case 10:
507
+ _s = _r.next();
508
+ return [3 /*break*/, 8];
509
+ case 11: return [3 /*break*/, 14];
484
510
  case 12:
511
+ e_2_1 = _x.sent();
512
+ e_2 = { error: e_2_1 };
513
+ return [3 /*break*/, 14];
514
+ case 13:
485
515
  try {
486
- if (_q && !_q.done && (_s = _p.return)) _s.call(_p);
516
+ if (_s && !_s.done && (_u = _r.return)) _u.call(_r);
487
517
  }
488
518
  finally { if (e_2) throw e_2.error; }
489
519
  return [7 /*endfinally*/];
490
- case 13:
520
+ case 14:
491
521
  //#endregion
492
- //#region prepares server
493
- if (this.mode === 'backend-frontend(tcp+udp)' && !this.config.abstract) {
494
- //#region @backend
495
- this.expressApp = express();
496
- this.initMiddlewares();
497
- this.serverTcpUdp = this.isHttpServer
498
- ? new tnp_core_1.https.Server({
499
- key: (_t = this.config.https) === null || _t === void 0 ? void 0 : _t.key,
500
- cert: (_u = this.config.https) === null || _u === void 0 ? void 0 : _u.cert,
501
- }, this.expressApp)
502
- : new tnp_core_1.http.Server(this.expressApp);
503
- this.publicAssets.forEach(function (asset) {
504
- _this.expressApp.use(asset.serverPath, express.static(asset.locationOnDisk));
505
- });
522
+ if (!this.isRunOrRevertOnlyMigrationAppStart) {
523
+ //#region prepares server
524
+ if (this.mode === 'backend-frontend(tcp+udp)' && !this.config.abstract) {
525
+ //#region @backend
526
+ this.expressApp = express();
527
+ this.initMiddlewares();
528
+ this.serverTcpUdp = this.isHttpServer
529
+ ? new tnp_core_1.https.Server({
530
+ key: (_v = this.config.https) === null || _v === void 0 ? void 0 : _v.key,
531
+ cert: (_w = this.config.https) === null || _w === void 0 ? void 0 : _w.cert,
532
+ }, this.expressApp)
533
+ : new tnp_core_1.http.Server(this.expressApp);
534
+ this.publicAssets.forEach(function (asset) {
535
+ _this.expressApp.use(asset.serverPath, express.static(asset.locationOnDisk));
536
+ });
537
+ //#endregion
538
+ }
506
539
  //#endregion
507
- }
508
- //#endregion
509
- //#region prepare relatime
510
- if (!this.config.abstract) {
511
- this.disabledRealtime = !!this.config.disabledRealtime;
512
- //#region @backend
513
- if (tnp_core_2.Helpers.isRunningIn.cliMode()) {
514
- // TODO for now...
515
- this.disabledRealtime = true;
540
+ //#region prepare realtime
541
+ if (!this.config.abstract) {
542
+ this.disabledRealtime = !!this.config.disabledRealtime;
543
+ //#region @backend
544
+ if (tnp_core_3.Helpers.isRunningIn.cliMode()) {
545
+ // TODO for now...
546
+ this.disabledRealtime = true;
547
+ }
548
+ //#endregion
549
+ this.realtime = new realtime_core_1.RealtimeCore(this);
516
550
  }
517
551
  //#endregion
518
- this.realtime = new realtime_core_1.RealtimeCore(this);
519
552
  }
520
- //#endregion
521
553
  //#region show context info
522
554
  // console.log({ ref })
523
555
  if (this.config.abstract) {
524
556
  this.logFramework &&
525
- tnp_core_2.Helpers.info("[taon] Create abstract context: ".concat(this.config.contextName));
557
+ tnp_core_3.Helpers.info("[taon] Create abstract context: ".concat(this.config.contextName));
526
558
  }
527
559
  else {
528
560
  if (this.config.remoteHost) {
529
561
  this.logFramework &&
530
- tnp_core_2.Helpers.info("[taon] Create context for remote host: ".concat(this.config.remoteHost));
562
+ tnp_core_3.Helpers.info("[taon] Create context for remote host: ".concat(this.config.remoteHost));
531
563
  }
532
564
  else {
533
565
  this.logFramework &&
534
- tnp_core_2.Helpers.info("[taon] Create context for host: ".concat(this.config.host));
566
+ tnp_core_3.Helpers.info("[taon] Create context for host: ".concat(this.config.host));
535
567
  }
536
568
  }
537
569
  //#endregion
@@ -548,81 +580,67 @@ var EndpointContext = /** @class */ (function () {
548
580
  //#region methods & getters / get auto generated config
549
581
  EndpointContext.prototype.getAutoGeneratedConfig = function () {
550
582
  //#region @websqlFunc
551
- var databaseConfig;
552
- if (tnp_core_2.Helpers.isRunningInDocker()) {
553
- tnp_core_2.Helpers.info('Running in docker, using in mysql database');
583
+ var databaseConfig = models_1.Models.DatabaseConfig.from({});
584
+ if (tnp_core_2.UtilsOs.isRunningInDocker()) {
585
+ tnp_core_3.Helpers.info('Running in docker, using in mysql database');
554
586
  // TODO auto resolve database config in docker
555
- databaseConfig = {
556
- database: "tmp-db-".concat(tnp_core_2._.kebabCase(this.contextName), ".sqljs.db"),
587
+ databaseConfig = models_1.Models.DatabaseConfig.from({
588
+ database: "db-".concat(this.contextName, ".sqlite"),
557
589
  type: 'mysql',
558
- autoSave: true,
559
- synchronize: true,
560
- dropSchema: true,
590
+ recreateMode: 'PRESERVE_DATA+MIGRATIONS',
561
591
  logging: this.logDb,
562
592
  databasePort: 3306,
563
593
  databaseHost: 'localhost',
564
594
  databaseUsername: 'root',
565
595
  databasePassword: 'admin',
566
- };
596
+ });
567
597
  }
568
598
  else {
569
599
  this.logFramework &&
570
- tnp_core_2.Helpers.info("[taon][database] Automatically resolving database config for mode ".concat(this.mode));
600
+ tnp_core_3.Helpers.info("[taon][database] Automatically resolving database config for mode ".concat(this.mode));
571
601
  switch (this.mode) {
572
602
  //#region resolve database config for mode backend-frontend(tcp+udp)
573
603
  case 'backend-frontend(ipc-electron)':
574
- return {
575
- location: "tmp-db-".concat(tnp_core_2._.kebabCase(this.contextName), ".sqljs"),
604
+ databaseConfig = models_1.Models.DatabaseConfig.from({
605
+ location: "db-".concat(this.contextName, ".sqlite"),
576
606
  type: 'sqljs',
577
- autoSave: true,
578
- synchronize: true,
579
- dropSchema: true,
607
+ recreateMode: 'DROP_DB+MIGRATIONS',
580
608
  logging: this.logDb,
581
- };
609
+ });
582
610
  break;
583
611
  //#endregion
584
612
  //#region resolve database config for mode backend-frontend(websql)
585
613
  case 'backend-frontend(websql-electron)':
586
614
  case 'backend-frontend(websql)':
587
- databaseConfig = {
588
- location: "tmp-db-".concat(tnp_core_2._.kebabCase(this.contextName), ".sqljs"),
589
- type: 'sqljs',
590
- useLocalForage: true, // !!window['localforage'], // TODO this need to be checked in runtime
591
- autoSave: true,
592
- synchronize: true,
593
- dropSchema: true,
594
- logging: this.logDb,
595
- };
596
615
  var keepWebsqlDbDataAfterReload = false;
597
616
  /* */
598
617
  /* */
599
618
  /* */
600
- if (keepWebsqlDbDataAfterReload) {
601
- databaseConfig.dropSchema = false;
602
- delete databaseConfig.synchronize; // false is not auto synchonize - from what I understand
603
- }
604
- else {
605
- databaseConfig.dropSchema = true;
606
- databaseConfig.synchronize = true;
607
- }
619
+ databaseConfig = databaseConfig = models_1.Models.DatabaseConfig.from({
620
+ location: "db-".concat(this.contextName, ".sqlite"),
621
+ type: 'sqljs',
622
+ useLocalForage: true, // !!window['localforage'], // TODO this need to be checked in runtime
623
+ recreateMode: keepWebsqlDbDataAfterReload
624
+ ? 'PRESERVE_DATA+MIGRATIONS'
625
+ : 'DROP_DB+MIGRATIONS',
626
+ logging: this.logDb,
627
+ });
608
628
  break;
609
629
  //#endregion
610
630
  //#region resolve database config for mode backend-frontend(tcp+udp)
611
631
  case 'backend-frontend(tcp+udp)':
612
- databaseConfig = {
613
- database: "context-db-".concat(tnp_core_2._.kebabCase(this.contextName)),
614
- location: "tmp-db-".concat(tnp_core_2._.kebabCase(this.contextName), ".sqlite"),
632
+ databaseConfig = models_1.Models.DatabaseConfig.from({
633
+ database: "context-db-".concat(this.contextName),
634
+ location: "db-".concat(this.contextName, ".sqlite"),
615
635
  type: 'sqljs',
616
- autoSave: true,
617
- synchronize: true,
618
- dropSchema: true,
636
+ recreateMode: 'DROP_DB+MIGRATIONS',
619
637
  logging: this.logDb,
620
- };
638
+ });
621
639
  break;
622
640
  //#endregion
623
641
  }
624
642
  }
625
- return databaseConfig;
643
+ return databaseConfig.databaseConfigTypeORM;
626
644
  //#endregion
627
645
  };
628
646
  Object.defineProperty(EndpointContext.prototype, "ngZone", {
@@ -641,18 +659,18 @@ var EndpointContext = /** @class */ (function () {
641
659
  EndpointContext.prototype.startServer = function () {
642
660
  var _this = this;
643
661
  //#region @backendFunc
644
- if (this.remoteHost) {
662
+ if (this.remoteHost || this.isRunOrRevertOnlyMigrationAppStart) {
645
663
  return;
646
664
  }
647
665
  if (this.mode === 'backend-frontend(tcp+udp)') {
648
666
  // this.displayRoutes(this.expressApp);
649
667
  this.serverTcpUdp.listen(Number(this.uri.port), function () {
650
- tnp_core_2.Helpers.log("[taon][express-server]listening on port: ".concat(_this.uri.port, ", hostname: ").concat(_this.uri.pathname, ",\n address: ").concat(_this.uri.protocol, "//localhost:").concat(_this.uri.port).concat(_this.uri.pathname, "\n env: ").concat(_this.expressApp.settings.env, "\n "));
668
+ tnp_core_3.Helpers.log("[taon][express-server]listening on port: ".concat(_this.uri.port, ", hostname: ").concat(_this.uri.pathname, ",\n address: ").concat(_this.uri.protocol, "//localhost:").concat(_this.uri.port).concat(_this.uri.pathname, "\n env: ").concat(_this.expressApp.settings.env, "\n "));
651
669
  });
652
670
  }
653
671
  else {
654
672
  this.logFramework &&
655
- tnp_core_2.Helpers.info('Ipc communication enable instead tcp/upd');
673
+ tnp_core_3.Helpers.info('Ipc communication enable instead tcp/upd');
656
674
  }
657
675
  //#endregion
658
676
  };
@@ -828,14 +846,29 @@ var EndpointContext = /** @class */ (function () {
828
846
  * alias for inject
829
847
  */
830
848
  EndpointContext.prototype.getInstanceBy = function (ctor) {
849
+ // if (!!this.__contextForControllerInstanceAccess) {
850
+ // const className = ClassHelpers.getName(ctor);
851
+ // const allControllers = this.getClassFunByArr(Models.ClassType.CONTROLLER);
852
+ // // TODO QUICK_FIX cache controllers
853
+ // for (const ctrl of allControllers) {
854
+ // if (ClassHelpers.getName(ctrl) === className) {
855
+ // // console.log('injecting from contextForControllerInstanceAcesss', className);
856
+ // return this.__contextForControllerInstanceAccess.inject(ctor, {
857
+ // localInstance: false,
858
+ // });
859
+ // }
860
+ // }
861
+ // }
831
862
  return this.inject(ctor, { localInstance: false });
832
863
  };
833
864
  //#endregion
865
+ //#region methods & getters / check if context initialized
834
866
  EndpointContext.prototype.checkIfContextInitialized = function () {
835
- if (tnp_core_2._.isUndefined(this.config)) {
867
+ if (tnp_core_3._.isUndefined(this.config)) {
836
868
  throw new Error("Please check if your context has been initialized.\n\n // ...\n await Context.initialize();\n // ...\n\n\n ");
837
869
  }
838
870
  };
871
+ //#endregion
839
872
  //#region methods & getters / get class function by class type name
840
873
  EndpointContext.prototype.getClassFunBy = function (classType) {
841
874
  this.checkIfContextInitialized();
@@ -850,6 +883,8 @@ var EndpointContext = /** @class */ (function () {
850
883
  return this.config.repositories;
851
884
  case models_1.Models.ClassType.SUBSCRIBER:
852
885
  return this.config.subscribers;
886
+ case models_1.Models.ClassType.MIGRATION:
887
+ return this.config.migrations;
853
888
  }
854
889
  };
855
890
  EndpointContext.prototype.isCLassType = function (classType, classFn) {
@@ -930,7 +965,7 @@ var EndpointContext = /** @class */ (function () {
930
965
  return tslib_1.__generator(this, function (_b) {
931
966
  switch (_b.label) {
932
967
  case 0:
933
- if (this.remoteHost) {
968
+ if (this.remoteHost || Object.keys(this.config.migrations).length > 0) {
934
969
  return [2 /*return*/];
935
970
  }
936
971
  controllers = this.getClassesInstancesArrBy(models_1.Models.ClassType.CONTROLLER);
@@ -942,8 +977,8 @@ var EndpointContext = /** @class */ (function () {
942
977
  case 2:
943
978
  if (!!controllers_1_1.done) return [3 /*break*/, 5];
944
979
  ctrl = controllers_1_1.value;
945
- if (!tnp_core_2._.isFunction(ctrl.initExampleDbData)) return [3 /*break*/, 4];
946
- return [4 /*yield*/, tnp_core_2.Helpers.runSyncOrAsync({
980
+ if (!tnp_core_3._.isFunction(ctrl.initExampleDbData)) return [3 /*break*/, 4];
981
+ return [4 /*yield*/, tnp_core_3.Helpers.runSyncOrAsync({
947
982
  functionFn: ctrl.initExampleDbData,
948
983
  context: ctrl,
949
984
  })];
@@ -987,6 +1022,7 @@ var EndpointContext = /** @class */ (function () {
987
1022
  models_1.Models.ClassType.REPOSITORY,
988
1023
  models_1.Models.ClassType.CONTROLLER,
989
1024
  models_1.Models.ClassType.ENTITY,
1025
+ models_1.Models.ClassType.MIGRATION,
990
1026
  ]), _b = _a.next();
991
1027
  _o.label = 2;
992
1028
  case 2:
@@ -1000,8 +1036,8 @@ var EndpointContext = /** @class */ (function () {
1000
1036
  case 4:
1001
1037
  if (!!_d.done) return [3 /*break*/, 7];
1002
1038
  classFun = _d.value;
1003
- if (!tnp_core_2._.isFunction(classFun._)) return [3 /*break*/, 6];
1004
- return [4 /*yield*/, tnp_core_2.Helpers.runSyncOrAsync({
1039
+ if (!tnp_core_3._.isFunction(classFun._)) return [3 /*break*/, 6];
1040
+ return [4 /*yield*/, tnp_core_3.Helpers.runSyncOrAsync({
1005
1041
  functionFn: classFun._,
1006
1042
  context: classFun,
1007
1043
  })];
@@ -1042,6 +1078,7 @@ var EndpointContext = /** @class */ (function () {
1042
1078
  models_1.Models.ClassType.PROVIDER,
1043
1079
  models_1.Models.ClassType.REPOSITORY,
1044
1080
  models_1.Models.ClassType.CONTROLLER,
1081
+ models_1.Models.ClassType.MIGRATION,
1045
1082
  ]), _f = _e.next();
1046
1083
  _o.label = 15;
1047
1084
  case 15:
@@ -1055,8 +1092,8 @@ var EndpointContext = /** @class */ (function () {
1055
1092
  case 17:
1056
1093
  if (!!_h.done) return [3 /*break*/, 20];
1057
1094
  ctrl = _h.value;
1058
- if (!tnp_core_2._.isFunction(ctrl._)) return [3 /*break*/, 19];
1059
- return [4 /*yield*/, tnp_core_2.Helpers.runSyncOrAsync({
1095
+ if (!tnp_core_3._.isFunction(ctrl._)) return [3 /*break*/, 19];
1096
+ return [4 /*yield*/, tnp_core_3.Helpers.runSyncOrAsync({
1060
1097
  functionFn: ctrl._,
1061
1098
  context: ctrl,
1062
1099
  })];
@@ -1232,11 +1269,11 @@ var EndpointContext = /** @class */ (function () {
1232
1269
  for (entities_1 = tslib_1.__values(entities), entities_1_1 = entities_1.next(); !entities_1_1.done; entities_1_1 = entities_1.next()) {
1233
1270
  entity = entities_1_1.value;
1234
1271
  options = Reflect.getMetadata(symbols_1.Symbols.metadata.options.entity, entity);
1235
- createTable = tnp_core_2._.isUndefined(options.createTable)
1272
+ createTable = tnp_core_3._.isUndefined(options.createTable)
1236
1273
  ? true
1237
1274
  : options.createTable;
1238
1275
  nameForEntity = class_helpers_1.ClassHelpers.getName(entity);
1239
- if (tnp_core_2._.isUndefined(options.createTable) ? true : options.createTable) {
1276
+ if (tnp_core_3._.isUndefined(options.createTable) ? true : options.createTable) {
1240
1277
  this.logDb &&
1241
1278
  console.info("[taon][typeorm] create table for entity \"".concat(nameForEntity, "\" ? '").concat(createTable, "'"));
1242
1279
  // console.log('TypeormEntity', { TypeormEntity });
@@ -1264,23 +1301,19 @@ var EndpointContext = /** @class */ (function () {
1264
1301
  EndpointContext.prototype.initDatabaseConnection = function () {
1265
1302
  return tslib_1.__awaiter(this, void 0, void 0, function () {
1266
1303
  var entities, subscribers, dataSourceDbConfig, connection, error_1;
1267
- var _a, _b, _c, _d;
1268
- return tslib_1.__generator(this, function (_e) {
1269
- switch (_e.label) {
1304
+ var _a, _b;
1305
+ return tslib_1.__generator(this, function (_c) {
1306
+ switch (_c.label) {
1270
1307
  case 0:
1271
1308
  //#region @websqlFunc
1272
1309
  if (this.remoteHost) {
1273
1310
  return [2 /*return*/];
1274
1311
  }
1275
- entities = (((_a = this.config.override) === null || _a === void 0 ? void 0 : _a.entities)
1276
- ? this.config.override.entities
1277
- : this.getClassFunByArr(models_1.Models.ClassType.ENTITY)).map(function (entityFn) {
1312
+ entities = this.getClassFunByArr(models_1.Models.ClassType.ENTITY).map(function (entityFn) {
1278
1313
  return class_helpers_1.ClassHelpers.getOrginalClass(entityFn);
1279
1314
  });
1280
- subscribers = ((_b = this.config.override) === null || _b === void 0 ? void 0 : _b.subscribers)
1281
- ? this.config.override.subscribers
1282
- : this.getClassFunByArr(models_1.Models.ClassType.SUBSCRIBER);
1283
- dataSourceDbConfig = tnp_core_2._.isObject(this.databaseConfig)
1315
+ subscribers = this.getClassFunByArr(models_1.Models.ClassType.SUBSCRIBER);
1316
+ dataSourceDbConfig = tnp_core_3._.isObject(this.databaseConfig)
1284
1317
  ? {
1285
1318
  type: this.databaseConfig.type,
1286
1319
  port: this.databaseConfig.databasePort,
@@ -1289,11 +1322,18 @@ var EndpointContext = /** @class */ (function () {
1289
1322
  username: this.databaseConfig.databaseUsername,
1290
1323
  password: this.databaseConfig.databasePassword,
1291
1324
  useLocalForage: this.databaseConfig.useLocalForage,
1325
+ // I am not using typeorm migration system
1292
1326
  entities: entities,
1293
1327
  subscribers: subscribers,
1294
- synchronize: this.databaseConfig.synchronize,
1295
- autoSave: this.databaseConfig.autoSave,
1296
- dropSchema: this.databaseConfig.dropSchema,
1328
+ synchronize: this.isRunOrRevertOnlyMigrationAppStart
1329
+ ? false
1330
+ : this.databaseConfig.synchronize,
1331
+ autoSave: !tnp_core_3._.isNil(this.databaseConfig.autoSave)
1332
+ ? this.databaseConfig.autoSave
1333
+ : !tnp_core_2.UtilsOs.isRunningInDocker(), // in docker I am using mysql or posgress
1334
+ dropSchema: this.isRunOrRevertOnlyMigrationAppStart
1335
+ ? false
1336
+ : this.databaseConfig.dropSchema,
1297
1337
  logging: !!this.databaseConfig.logging,
1298
1338
  location: this.databaseConfig.location,
1299
1339
  }
@@ -1304,34 +1344,36 @@ var EndpointContext = /** @class */ (function () {
1304
1344
  if (!(this.modeAllowsDatabaseCreation && this.databaseConfig)) return [3 /*break*/, 5];
1305
1345
  this.logDb &&
1306
1346
  this.logFramework &&
1307
- tnp_core_2.Helpers.info('[taon][database] prepare typeorm connection...');
1308
- _e.label = 1;
1347
+ tnp_core_3.Helpers.info('[taon][database] prepare typeorm connection...');
1348
+ _c.label = 1;
1309
1349
  case 1:
1310
- _e.trys.push([1, 3, , 4]);
1350
+ _c.trys.push([1, 3, , 4]);
1311
1351
  connection = new taon_typeorm_3.DataSource(dataSourceDbConfig);
1312
1352
  this.connection = connection;
1313
1353
  return [4 /*yield*/, this.connection.initialize()];
1314
1354
  case 2:
1315
- _e.sent();
1355
+ _c.sent();
1316
1356
  return [3 /*break*/, 4];
1317
1357
  case 3:
1318
- error_1 = _e.sent();
1358
+ error_1 = _c.sent();
1319
1359
  console.error((error_1 === null || error_1 === void 0 ? void 0 : error_1.message) || error_1);
1320
1360
  return [3 /*break*/, 4];
1321
1361
  case 4:
1322
- if (!((_c = this.connection) === null || _c === void 0 ? void 0 : _c.isInitialized)) {
1362
+ if (!((_a = this.connection) === null || _a === void 0 ? void 0 : _a.isInitialized)) {
1323
1363
  console.log('WRONG CONFIG', dataSourceDbConfig);
1324
1364
  throw new Error("Something wrong with connection init in ".concat(this.mode));
1325
1365
  //#region @backend
1326
1366
  process.exit(1);
1327
1367
  //#endregion
1328
1368
  }
1329
- (this.logDb || this.logFramework) &&
1330
- console.info("\n\n CONTECTION OK for ".concat(this.contextName, " - ").concat(this.mode, "\n\n [taon][typeorm] db prepration done.. db initialize=").concat((_d = this.connection) === null || _d === void 0 ? void 0 : _d.isInitialized, "\n\n\n "), dataSourceDbConfig);
1369
+ if (this.logDb || this.logFramework) {
1370
+ console.info("\n\n CONTECTION OK for ".concat(this.contextName, " - ").concat(this.mode, "\n\n [taon][typeorm] db prepration done.. db initialize=").concat((_b = this.connection) === null || _b === void 0 ? void 0 : _b.isInitialized, "\n\n\n "), dataSourceDbConfig, { 'this.connection': !!this.connection });
1371
+ console.log("Database file location: ".concat(this.connection.options.database));
1372
+ }
1331
1373
  return [3 /*break*/, 6];
1332
1374
  case 5:
1333
- tnp_core_2.Helpers.info("[taon][typeorm] Not initing db for mode ".concat(this.mode));
1334
- _e.label = 6;
1375
+ tnp_core_3.Helpers.info("[taon][typeorm] Not initing db for mode ".concat(this.mode));
1376
+ _c.label = 6;
1335
1377
  case 6: return [2 /*return*/];
1336
1378
  }
1337
1379
  });
@@ -1339,9 +1381,12 @@ var EndpointContext = /** @class */ (function () {
1339
1381
  };
1340
1382
  //#endregion
1341
1383
  //#region methods & getters / initialize metadata
1342
- EndpointContext.prototype.initMetadata = function () {
1384
+ EndpointContext.prototype.initControllers = function () {
1343
1385
  var e_14, _a;
1344
1386
  var _this = this;
1387
+ if (this.isRunOrRevertOnlyMigrationAppStart) {
1388
+ return;
1389
+ }
1345
1390
  var allControllers = this.getClassFunByArr(models_1.Models.ClassType.CONTROLLER);
1346
1391
  var _loop_1 = function (controllerClassFn) {
1347
1392
  controllerClassFn[symbols_1.Symbols.classMethodsNames] =
@@ -1349,7 +1394,7 @@ var EndpointContext = /** @class */ (function () {
1349
1394
  var configs = class_helpers_1.ClassHelpers.getControllerConfigs(controllerClassFn);
1350
1395
  // console.log(`Class config for ${ClassHelpers.getName(controllerClassFn)}`, configs)
1351
1396
  var classConfig = configs[0];
1352
- var parentscalculatedPath = tnp_core_2._.slice(configs, 1)
1397
+ var parentscalculatedPath = tnp_core_3._.slice(configs, 1)
1353
1398
  .reverse()
1354
1399
  .map(function (bc) {
1355
1400
  if (taon_helpers_1.TaonHelpers.isGoodPath(bc.path)) {
@@ -1367,13 +1412,13 @@ var EndpointContext = /** @class */ (function () {
1367
1412
  .replace(/\/\//g, '/')
1368
1413
  .split('/')
1369
1414
  .reduce(function (acc, bc) {
1370
- return tnp_core_2._.last(acc) === bc ? acc : tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(acc), false), [bc], false);
1415
+ return tnp_core_3._.last(acc) === bc ? acc : tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(acc), false), [bc], false);
1371
1416
  }, [])
1372
1417
  .join('/');
1373
1418
  }
1374
- tnp_core_2._.slice(configs, 1).forEach(function (bc) {
1419
+ tnp_core_3._.slice(configs, 1).forEach(function (bc) {
1375
1420
  var alreadyIs = classConfig.methods;
1376
- var toMerge = tnp_core_2._.cloneDeep(bc.methods);
1421
+ var toMerge = tnp_core_3._.cloneDeep(bc.methods);
1377
1422
  for (var key in toMerge) {
1378
1423
  if (toMerge.hasOwnProperty(key) && !alreadyIs[key]) {
1379
1424
  var element = toMerge[key];
@@ -1382,7 +1427,7 @@ var EndpointContext = /** @class */ (function () {
1382
1427
  }
1383
1428
  });
1384
1429
  //#region @backend
1385
- if (!tnp_core_2.Helpers.isRunningIn.cliMode()) {
1430
+ if (!tnp_core_3.Helpers.isRunningIn.cliMode()) {
1386
1431
  //#endregion
1387
1432
  this_1.logHttp &&
1388
1433
  console.groupCollapsed("[taon][express-server] routes [".concat(classConfig.className, "]"));
@@ -1399,7 +1444,7 @@ var EndpointContext = /** @class */ (function () {
1399
1444
  ? "/".concat((_a = methodConfig.path) === null || _a === void 0 ? void 0 : _a.replace(/\//, ''))
1400
1445
  : taon_helpers_1.TaonHelpers.getExpressPath(classConfig, methodConfig);
1401
1446
  // console.log({ expressPath })
1402
- if (tnp_core_2.Helpers.isNode || tnp_core_2.Helpers.isWebSQL) {
1447
+ if (tnp_core_3.Helpers.isNode || tnp_core_3.Helpers.isWebSQL) {
1403
1448
  //#region @websql
1404
1449
  var _b = _this.initServer(type, methodConfig, classConfig, expressPath, controllerClassFn), routePath = _b.routePath, method = _b.method;
1405
1450
  _this.activeRoutes.push({
@@ -1408,7 +1453,7 @@ var EndpointContext = /** @class */ (function () {
1408
1453
  });
1409
1454
  //#endregion
1410
1455
  }
1411
- var shouldInitClient = tnp_core_2.Helpers.isBrowser || _this.remoteHost || tnp_core_2.Helpers.isWebSQL;
1456
+ var shouldInitClient = tnp_core_3.Helpers.isBrowser || _this.remoteHost || tnp_core_3.Helpers.isWebSQL;
1412
1457
  // console.log('shouldInitClient', shouldInitClient);
1413
1458
  if (shouldInitClient) {
1414
1459
  // console.log(
@@ -1422,7 +1467,7 @@ var EndpointContext = /** @class */ (function () {
1422
1467
  }
1423
1468
  });
1424
1469
  //#region @backend
1425
- if (!tnp_core_2.Helpers.isRunningIn.cliMode()) {
1470
+ if (!tnp_core_3.Helpers.isRunningIn.cliMode()) {
1426
1471
  //#endregion
1427
1472
  this_1.logHttp && console.groupEnd();
1428
1473
  //#region @backend
@@ -1448,7 +1493,7 @@ var EndpointContext = /** @class */ (function () {
1448
1493
  //#region methods & getters / write active routes
1449
1494
  EndpointContext.prototype.writeActiveRoutes = function () {
1450
1495
  var _this = this;
1451
- if (this.remoteHost) {
1496
+ if (this.remoteHost || this.isRunOrRevertOnlyMigrationAppStart) {
1452
1497
  return;
1453
1498
  }
1454
1499
  var contexts = [this];
@@ -1462,11 +1507,11 @@ var EndpointContext = /** @class */ (function () {
1462
1507
  // .fillUpTo(10)}${context.uri.href.replace(/\/$/, '')}${routePath}`
1463
1508
  });
1464
1509
  var routes = tslib_1.__spreadArray(tslib_1.__spreadArray([], ['', "---------- FOR HOST ".concat(this.uri.href, " ----------")], false), tslib_1.__read(troutes), false);
1465
- var fileName = tnp_core_3.path.join(
1510
+ var fileName = tnp_core_4.path.join(
1466
1511
  //#region @backend
1467
1512
  process.cwd(),
1468
1513
  //#endregion
1469
- "tmp-routes-".concat(tnp_core_2._.kebabCase(this.config.contextName), ".json"));
1514
+ "tmp-routes-".concat(tnp_core_3._.kebabCase(this.config.contextName), ".json"));
1470
1515
  this.logFramework && console.log("[taon] routes file: ".concat(fileName, " "));
1471
1516
  // Helpers.log(JSON.stringify(routes, null, 4))
1472
1517
  //#region @backend
@@ -1509,7 +1554,7 @@ var EndpointContext = /** @class */ (function () {
1509
1554
  app.use(methodOverride());
1510
1555
  app.use(cookieParser());
1511
1556
  if (this.session) {
1512
- tnp_core_2.Helpers.info('[taon][express-server] session enabled for this context ' +
1557
+ tnp_core_3.Helpers.info('[taon][express-server] session enabled for this context ' +
1513
1558
  this.contextName);
1514
1559
  var cookieMaxAge = this.session.cookieMaxAge;
1515
1560
  var frontendHost = this.config.frontendHost;
@@ -1531,7 +1576,7 @@ var EndpointContext = /** @class */ (function () {
1531
1576
  else {
1532
1577
  // if(this.config?.serverLogs) {
1533
1578
  this.logHttp &&
1534
- tnp_core_2.Helpers.info("[taon][express-server] session not enabled for this context '".concat(this.contextName, "'"));
1579
+ tnp_core_3.Helpers.info("[taon][express-server] session not enabled for this context '".concat(this.contextName, "'"));
1535
1580
  // }
1536
1581
  app.use(cors({
1537
1582
  // origin: "http://localhost:5555",
@@ -1617,10 +1662,10 @@ var EndpointContext = /** @class */ (function () {
1617
1662
  expressPath = expressPath.replace(/\/\//g, '/');
1618
1663
  // console.log(`BACKEND: expressPath: ${ expressPath } `)
1619
1664
  //#endregion
1620
- if (tnp_core_2.Helpers.isElectron) {
1665
+ if (tnp_core_3.Helpers.isElectron) {
1621
1666
  //#region @backend
1622
1667
  var ipcKeyName = taon_helpers_1.TaonHelpers.ipcKeyNameRequest(target, methodConfig, expressPath);
1623
- tnp_core_2.Helpers.ipcMain.on(ipcKeyName, function (event, paramsFromBrowser) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
1668
+ tnp_core_3.Helpers.ipcMain.on(ipcKeyName, function (event, paramsFromBrowser) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
1624
1669
  var responseJsonData;
1625
1670
  return tslib_1.__generator(this, function (_a) {
1626
1671
  switch (_a.label) {
@@ -1641,7 +1686,7 @@ var EndpointContext = /** @class */ (function () {
1641
1686
  if (!this.remoteHost) {
1642
1687
  //#region apply dummy websql express routers
1643
1688
  //#region @websql
1644
- if (tnp_core_2.Helpers.isWebSQL) {
1689
+ if (tnp_core_3.Helpers.isWebSQL) {
1645
1690
  if (!this.expressApp[type.toLowerCase()]) {
1646
1691
  this.expressApp[type.toLowerCase()] = function () { };
1647
1692
  }
@@ -1703,7 +1748,7 @@ var EndpointContext = /** @class */ (function () {
1703
1748
  try {
1704
1749
  var entityForParam = JSON.parse(req.headers["".concat(symbols_1.Symbols.old.MAPPING_CONFIG_HEADER_QUERY_PARAMS).concat(queryParamName, " ")]);
1705
1750
  var beforeTransofrm = tQuery[queryParamName];
1706
- if (tnp_core_2._.isString(beforeTransofrm)) {
1751
+ if (tnp_core_3._.isString(beforeTransofrm)) {
1707
1752
  try {
1708
1753
  var paresed = taon_helpers_1.TaonHelpers.tryTransformParam(beforeTransofrm);
1709
1754
  beforeTransofrm = paresed;
@@ -1769,7 +1814,7 @@ var EndpointContext = /** @class */ (function () {
1769
1814
  res.end(file);
1770
1815
  return [3 /*break*/, 7];
1771
1816
  case 4:
1772
- if (!(tnp_core_2._.isString(result) &&
1817
+ if (!(tnp_core_3._.isString(result) &&
1773
1818
  methodConfig.responseType ===
1774
1819
  'blob')) return [3 /*break*/, 5];
1775
1820
  img_base64 = result;
@@ -1796,27 +1841,27 @@ var EndpointContext = /** @class */ (function () {
1796
1841
  case 8:
1797
1842
  error_2 = _d.sent();
1798
1843
  //#region process error
1799
- if (tnp_core_2._.isString(error_2)) {
1844
+ if (tnp_core_3._.isString(error_2)) {
1800
1845
  res.status(400).send(json10_1.JSON10.stringify({
1801
1846
  message: "\n Error inside: ".concat(req.path, "\n\n ").concat(error_2, "\n\n"),
1802
1847
  }));
1803
1848
  }
1804
1849
  else if (error_2 instanceof models_1.Models.Http.Errors) {
1805
- tnp_core_2.Helpers.error(error_2, true, false);
1850
+ tnp_core_3.Helpers.error(error_2, true, false);
1806
1851
  err = error_2;
1807
1852
  res.status(400).send(json10_1.JSON10.stringify(err));
1808
1853
  }
1809
1854
  else if (error_2 instanceof Error) {
1810
1855
  err = error_2;
1811
- tnp_core_2.Helpers.error(error_2, true, false);
1856
+ tnp_core_3.Helpers.error(error_2, true, false);
1812
1857
  res.status(400).send(json10_1.JSON10.stringify({
1813
1858
  stack: err.stack,
1814
1859
  message: err.message,
1815
1860
  }));
1816
1861
  }
1817
1862
  else {
1818
- tnp_core_2.Helpers.log(error_2);
1819
- tnp_core_2.Helpers.error("[Taon] Bad result isomorphic method: ".concat(error_2, " "), true, false);
1863
+ tnp_core_3.Helpers.log(error_2);
1864
+ tnp_core_3.Helpers.error("[Taon] Bad result isomorphic method: ".concat(error_2, " "), true, false);
1820
1865
  res.status(400).send(json10_1.JSON10.stringify(error_2));
1821
1866
  }
1822
1867
  return [3 /*break*/, 9];
@@ -1845,18 +1890,18 @@ var EndpointContext = /** @class */ (function () {
1845
1890
  // console.log('INITING', methodConfig); // TODO inject in static
1846
1891
  //#region resolve storage
1847
1892
  var storage;
1848
- if (tnp_core_2.Helpers.isBrowser) {
1893
+ if (tnp_core_3.Helpers.isBrowser) {
1849
1894
  storage = window;
1850
1895
  }
1851
1896
  //#region @backend
1852
- if (tnp_core_2.Helpers.isNode) {
1897
+ if (tnp_core_3.Helpers.isNode) {
1853
1898
  storage = global;
1854
1899
  }
1855
1900
  //#endregion
1856
1901
  //#endregion
1857
1902
  var orgMethods = target.prototype[methodConfig.methodName];
1858
1903
  //#region handle electron ipc request
1859
- if (tnp_core_2.Helpers.isElectron) {
1904
+ if (tnp_core_3.Helpers.isElectron) {
1860
1905
  target.prototype[methodConfig.methodName] = function () {
1861
1906
  var _this = this;
1862
1907
  var args = [];
@@ -1868,7 +1913,7 @@ var EndpointContext = /** @class */ (function () {
1868
1913
  return tslib_1.__generator(this, function (_b) {
1869
1914
  headers = {};
1870
1915
  _a = taon_helpers_1.TaonHelpers.websqlMocks(headers), request = _a.request, response = _a.response;
1871
- tnp_core_2.Helpers.ipcRenderer.once(taon_helpers_1.TaonHelpers.ipcKeyNameResponse(target, methodConfig, expressPath), function (event, responseData) {
1916
+ tnp_core_3.Helpers.ipcRenderer.once(taon_helpers_1.TaonHelpers.ipcKeyNameResponse(target, methodConfig, expressPath), function (event, responseData) {
1872
1917
  var res = responseData;
1873
1918
  console.log({ responseData: responseData });
1874
1919
  try {
@@ -1879,7 +1924,7 @@ var EndpointContext = /** @class */ (function () {
1879
1924
  method: methodConfig.type,
1880
1925
  url: "".concat(ctx.uri.origin).concat('' // TODO express path
1881
1926
  ).concat(methodConfig.path, " "),
1882
- }, tnp_core_2.Helpers.isBlob(body_1) || tnp_core_2._.isString(body_1)
1927
+ }, tnp_core_3.Helpers.isBlob(body_1) || tnp_core_3._.isString(body_1)
1883
1928
  ? body_1
1884
1929
  : JSON.stringify(body_1), ng2_rest_1.RestHeaders.from(headers), void 0, function () { return body_1; });
1885
1930
  resolve(res);
@@ -1889,7 +1934,7 @@ var EndpointContext = /** @class */ (function () {
1889
1934
  reject(error);
1890
1935
  }
1891
1936
  });
1892
- tnp_core_2.Helpers.ipcRenderer.send(taon_helpers_1.TaonHelpers.ipcKeyNameRequest(target, methodConfig, expressPath), args);
1937
+ tnp_core_3.Helpers.ipcRenderer.send(taon_helpers_1.TaonHelpers.ipcKeyNameRequest(target, methodConfig, expressPath), args);
1893
1938
  return [2 /*return*/];
1894
1939
  });
1895
1940
  }); });
@@ -2118,7 +2163,7 @@ var EndpointContext = /** @class */ (function () {
2118
2163
  if (mapping) {
2119
2164
  rest.headers.set(symbols_1.Symbols.old.MAPPING_CONFIG_HEADER_QUERY_PARAMS, JSON.stringify(mapping));
2120
2165
  }
2121
- queryParams = tnp_core_2._.cloneDeep(param);
2166
+ queryParams = tnp_core_3._.cloneDeep(param);
2122
2167
  }
2123
2168
  }
2124
2169
  if (currentParam.paramType === 'Header') {