taon 18.0.20 → 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 (298) 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-class.mjs +2 -2
  10. package/browser/esm2022/lib/base-classes/base-controller.mjs +3 -2
  11. package/browser/esm2022/lib/base-classes/base-migration.mjs +23 -0
  12. package/browser/esm2022/lib/base-classes/base-subscriber-for-entity.mjs +20 -20
  13. package/browser/esm2022/lib/base-classes/base.mjs +3 -1
  14. package/browser/esm2022/lib/context-db-migrations.mjs +410 -0
  15. package/browser/esm2022/lib/create-context.mjs +17 -4
  16. package/browser/esm2022/lib/decorators/classes/controller-decorator.mjs +4 -1
  17. package/browser/esm2022/lib/decorators/classes/entity-decorator.mjs +4 -1
  18. package/browser/esm2022/lib/decorators/classes/migration-decorator.mjs +18 -0
  19. package/browser/esm2022/lib/decorators/classes/provider-decorator.mjs +4 -1
  20. package/browser/esm2022/lib/decorators/classes/repository-decorator.mjs +4 -1
  21. package/browser/esm2022/lib/decorators/classes/subscriber-decorator.mjs +5 -2
  22. package/browser/esm2022/lib/endpoint-context.mjs +83 -49
  23. package/browser/esm2022/lib/index.mjs +4 -1
  24. package/browser/esm2022/lib/inject.mjs +1 -1
  25. package/browser/esm2022/lib/models.mjs +30 -1
  26. package/browser/esm2022/lib/symbols.mjs +2 -1
  27. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/index.mjs +1 -3
  28. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.mjs +55 -37
  29. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin.service.mjs +17 -21
  30. package/browser/esm2022/lib/ui/taon-notifications/taon-notifications.module.mjs +1 -1
  31. package/browser/esm2022/lib/ui/taon-progress-bar/taon-progress-bar.component.mjs +1 -1
  32. package/browser/esm2022/lib/ui/taon-table/taon-table.component.mjs +1 -2
  33. package/browser/fesm2022/taon.mjs +673 -420
  34. package/browser/fesm2022/taon.mjs.map +1 -1
  35. package/browser/lib/base-classes/base-class.d.ts +1 -1
  36. package/browser/lib/base-classes/base-context.d.ts +3 -0
  37. package/browser/lib/base-classes/base-controller.d.ts +2 -1
  38. package/browser/lib/base-classes/base-migration.d.ts +12 -0
  39. package/browser/lib/base-classes/base.d.ts +5 -0
  40. package/browser/lib/context-db-migrations.d.ts +17 -0
  41. package/browser/lib/create-context.d.ts +4 -1
  42. package/browser/lib/decorators/classes/controller-decorator.d.ts +3 -0
  43. package/browser/lib/decorators/classes/entity-decorator.d.ts +3 -0
  44. package/browser/lib/decorators/classes/migration-decorator.d.ts +8 -0
  45. package/browser/lib/decorators/classes/provider-decorator.d.ts +3 -0
  46. package/browser/lib/decorators/classes/repository-decorator.d.ts +3 -0
  47. package/browser/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  48. package/browser/lib/endpoint-context.d.ts +12 -5
  49. package/browser/lib/index.d.ts +14 -1
  50. package/browser/lib/models.d.ts +44 -19
  51. package/browser/lib/symbols.d.ts +1 -0
  52. package/browser/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  53. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +5 -8
  54. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +8 -8
  55. package/client/README.md +24 -24
  56. package/client/esm2022/lib/base-classes/base-class.mjs +2 -2
  57. package/client/esm2022/lib/base-classes/base-controller.mjs +3 -2
  58. package/client/esm2022/lib/base-classes/base-migration.mjs +23 -0
  59. package/client/esm2022/lib/base-classes/base-subscriber-for-entity.mjs +20 -20
  60. package/client/esm2022/lib/base-classes/base.mjs +3 -1
  61. package/client/esm2022/lib/context-db-migrations.mjs +410 -0
  62. package/client/esm2022/lib/create-context.mjs +17 -4
  63. package/client/esm2022/lib/decorators/classes/controller-decorator.mjs +4 -1
  64. package/client/esm2022/lib/decorators/classes/entity-decorator.mjs +4 -1
  65. package/client/esm2022/lib/decorators/classes/migration-decorator.mjs +18 -0
  66. package/client/esm2022/lib/decorators/classes/provider-decorator.mjs +4 -1
  67. package/client/esm2022/lib/decorators/classes/repository-decorator.mjs +4 -1
  68. package/client/esm2022/lib/decorators/classes/subscriber-decorator.mjs +5 -2
  69. package/client/esm2022/lib/endpoint-context.mjs +83 -49
  70. package/client/esm2022/lib/index.mjs +4 -1
  71. package/client/esm2022/lib/inject.mjs +1 -1
  72. package/client/esm2022/lib/models.mjs +30 -1
  73. package/client/esm2022/lib/symbols.mjs +2 -1
  74. package/client/esm2022/lib/ui/taon-admin-mode-configuration/index.mjs +1 -3
  75. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.mjs +55 -37
  76. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin.service.mjs +17 -21
  77. package/client/esm2022/lib/ui/taon-notifications/taon-notifications.module.mjs +1 -1
  78. package/client/esm2022/lib/ui/taon-progress-bar/taon-progress-bar.component.mjs +1 -1
  79. package/client/esm2022/lib/ui/taon-table/taon-table.component.mjs +1 -2
  80. package/client/fesm2022/taon.mjs +673 -420
  81. package/client/fesm2022/taon.mjs.map +1 -1
  82. package/client/lib/base-classes/base-class.d.ts +1 -1
  83. package/client/lib/base-classes/base-context.d.ts +3 -0
  84. package/client/lib/base-classes/base-controller.d.ts +2 -1
  85. package/client/lib/base-classes/base-migration.d.ts +12 -0
  86. package/client/lib/base-classes/base.d.ts +5 -0
  87. package/client/lib/context-db-migrations.d.ts +17 -0
  88. package/client/lib/create-context.d.ts +4 -1
  89. package/client/lib/decorators/classes/controller-decorator.d.ts +3 -0
  90. package/client/lib/decorators/classes/entity-decorator.d.ts +3 -0
  91. package/client/lib/decorators/classes/migration-decorator.d.ts +8 -0
  92. package/client/lib/decorators/classes/provider-decorator.d.ts +3 -0
  93. package/client/lib/decorators/classes/repository-decorator.d.ts +3 -0
  94. package/client/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  95. package/client/lib/endpoint-context.d.ts +12 -5
  96. package/client/lib/index.d.ts +14 -1
  97. package/client/lib/models.d.ts +44 -19
  98. package/client/lib/symbols.d.ts +1 -0
  99. package/client/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  100. package/client/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +5 -8
  101. package/client/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +8 -8
  102. package/lib/base-classes/base-class.d.ts +1 -1
  103. package/lib/base-classes/base-class.js +1 -1
  104. package/lib/base-classes/base-context.d.ts +3 -0
  105. package/lib/base-classes/base-controller.d.ts +2 -1
  106. package/lib/base-classes/base-controller.js +2 -1
  107. package/lib/base-classes/base-controller.js.map +1 -1
  108. package/lib/base-classes/base-migration.d.ts +11 -0
  109. package/lib/base-classes/base-migration.js +41 -0
  110. package/lib/base-classes/base-migration.js.map +1 -0
  111. package/lib/base-classes/base-repository.js +4 -4
  112. package/lib/base-classes/base-repository.js.map +1 -1
  113. package/lib/base-classes/base-subscriber-for-entity.js +19 -19
  114. package/lib/base-classes/base-subscriber-for-entity.js.map +1 -1
  115. package/lib/base-classes/base.d.ts +5 -0
  116. package/lib/base-classes/base.js +2 -0
  117. package/lib/base-classes/base.js.map +1 -1
  118. package/lib/context-db-migrations.d.ts +16 -0
  119. package/lib/context-db-migrations.js +585 -0
  120. package/lib/context-db-migrations.js.map +1 -0
  121. package/lib/create-context.d.ts +4 -1
  122. package/lib/create-context.js +30 -21
  123. package/lib/create-context.js.map +1 -1
  124. package/lib/decorators/classes/controller-decorator.d.ts +3 -0
  125. package/lib/decorators/classes/controller-decorator.js +3 -0
  126. package/lib/decorators/classes/controller-decorator.js.map +1 -1
  127. package/lib/decorators/classes/entity-decorator.d.ts +3 -0
  128. package/lib/decorators/classes/entity-decorator.js +3 -0
  129. package/lib/decorators/classes/entity-decorator.js.map +1 -1
  130. package/lib/decorators/classes/migration-decorator.d.ts +7 -0
  131. package/lib/decorators/classes/migration-decorator.js +27 -0
  132. package/lib/decorators/classes/migration-decorator.js.map +1 -0
  133. package/lib/decorators/classes/provider-decorator.d.ts +3 -0
  134. package/lib/decorators/classes/provider-decorator.js +3 -0
  135. package/lib/decorators/classes/provider-decorator.js.map +1 -1
  136. package/lib/decorators/classes/repository-decorator.d.ts +3 -0
  137. package/lib/decorators/classes/repository-decorator.js +3 -0
  138. package/lib/decorators/classes/repository-decorator.js.map +1 -1
  139. package/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  140. package/lib/decorators/classes/subscriber-decorator.js +4 -1
  141. package/lib/decorators/classes/subscriber-decorator.js.map +1 -1
  142. package/lib/endpoint-context.d.ts +12 -5
  143. package/lib/endpoint-context.js +234 -189
  144. package/lib/endpoint-context.js.map +1 -1
  145. package/lib/index.d.ts +14 -1
  146. package/lib/index.js +5 -1
  147. package/lib/index.js.map +1 -1
  148. package/lib/inject.js +0 -2
  149. package/lib/inject.js.map +1 -1
  150. package/lib/models.d.ts +44 -19
  151. package/lib/models.js +45 -0
  152. package/lib/models.js.map +1 -1
  153. package/lib/symbols.d.ts +1 -0
  154. package/lib/symbols.js +1 -0
  155. package/lib/symbols.js.map +1 -1
  156. package/lib/ui/directives/index.js +2 -2
  157. package/lib/ui/index.js +2 -2
  158. package/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  159. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  160. package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +4 -7
  161. package/lib/ui/taon-admin-mode-configuration/{models/taon-admin-mode-tabs.js → taon-admin.models.js} +1 -1
  162. package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js.map +1 -0
  163. package/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +6 -6
  164. package/lib/ui/taon-github-fork-me-corner/index.js +2 -2
  165. package/lib/ui/taon-github-fork-me-ribbon/index.js +2 -2
  166. package/lib/ui/taon-notifications/taon-notifications.models.js +2 -2
  167. package/lib/ui/taon-progress-bar/index.js +2 -2
  168. package/lib/ui/taon-session-passcode/index.js +2 -2
  169. package/lib/ui/taon-table/index.js +2 -2
  170. package/migrations/index.d.ts +1 -0
  171. package/migrations/index.js +6 -0
  172. package/migrations/index.js.map +1 -0
  173. package/migrations/migrations_index._auto-generated_.d.ts +0 -0
  174. package/migrations/migrations_index._auto-generated_.js +4 -0
  175. package/migrations/migrations_index._auto-generated_.js.map +1 -0
  176. package/package.json +7 -7
  177. package/taon.jsonc +47 -47
  178. package/tmp-environment.json +32 -29
  179. package/websql/README.md +24 -24
  180. package/websql/esm2022/lib/base-classes/base-class.mjs +2 -2
  181. package/websql/esm2022/lib/base-classes/base-controller.mjs +3 -2
  182. package/websql/esm2022/lib/base-classes/base-migration.mjs +23 -0
  183. package/websql/esm2022/lib/base-classes/base-repository.mjs +5 -5
  184. package/websql/esm2022/lib/base-classes/base-subscriber-for-entity.mjs +20 -20
  185. package/websql/esm2022/lib/base-classes/base.mjs +3 -1
  186. package/websql/esm2022/lib/context-db-migrations.mjs +269 -0
  187. package/websql/esm2022/lib/create-context.mjs +17 -4
  188. package/websql/esm2022/lib/decorators/classes/controller-decorator.mjs +4 -1
  189. package/websql/esm2022/lib/decorators/classes/entity-decorator.mjs +4 -1
  190. package/websql/esm2022/lib/decorators/classes/migration-decorator.mjs +18 -0
  191. package/websql/esm2022/lib/decorators/classes/provider-decorator.mjs +4 -1
  192. package/websql/esm2022/lib/decorators/classes/repository-decorator.mjs +4 -1
  193. package/websql/esm2022/lib/decorators/classes/subscriber-decorator.mjs +5 -2
  194. package/websql/esm2022/lib/endpoint-context.mjs +117 -85
  195. package/websql/esm2022/lib/index.mjs +4 -1
  196. package/websql/esm2022/lib/inject.mjs +1 -1
  197. package/websql/esm2022/lib/models.mjs +28 -1
  198. package/websql/esm2022/lib/symbols.mjs +2 -1
  199. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/index.mjs +1 -3
  200. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.mjs +55 -37
  201. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin.service.mjs +17 -21
  202. package/websql/esm2022/lib/ui/taon-notifications/taon-notifications.module.mjs +1 -1
  203. package/websql/esm2022/lib/ui/taon-progress-bar/taon-progress-bar.component.mjs +1 -1
  204. package/websql/esm2022/lib/ui/taon-table/taon-table.component.mjs +1 -2
  205. package/websql/fesm2022/taon.mjs +564 -460
  206. package/websql/fesm2022/taon.mjs.map +1 -1
  207. package/websql/lib/base-classes/base-class.d.ts +1 -1
  208. package/websql/lib/base-classes/base-context.d.ts +3 -0
  209. package/websql/lib/base-classes/base-controller.d.ts +2 -1
  210. package/websql/lib/base-classes/base-migration.d.ts +12 -0
  211. package/websql/lib/base-classes/base.d.ts +5 -0
  212. package/websql/lib/context-db-migrations.d.ts +17 -0
  213. package/websql/lib/create-context.d.ts +4 -1
  214. package/websql/lib/decorators/classes/controller-decorator.d.ts +3 -0
  215. package/websql/lib/decorators/classes/entity-decorator.d.ts +3 -0
  216. package/websql/lib/decorators/classes/migration-decorator.d.ts +8 -0
  217. package/websql/lib/decorators/classes/provider-decorator.d.ts +3 -0
  218. package/websql/lib/decorators/classes/repository-decorator.d.ts +3 -0
  219. package/websql/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  220. package/websql/lib/endpoint-context.d.ts +12 -5
  221. package/websql/lib/index.d.ts +14 -1
  222. package/websql/lib/models.d.ts +44 -19
  223. package/websql/lib/symbols.d.ts +1 -0
  224. package/websql/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  225. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +5 -8
  226. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +8 -8
  227. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.mjs +0 -5
  228. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.mjs +0 -115
  229. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.mjs +0 -50
  230. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.mjs +0 -5
  231. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.mjs +0 -61
  232. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.mjs +0 -21
  233. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.mjs +0 -4
  234. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.mjs +0 -32
  235. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.mjs +0 -54
  236. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -3
  237. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -33
  238. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -16
  239. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -3
  240. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -17
  241. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -10
  242. package/browser/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +0 -6
  243. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -18
  244. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -17
  245. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.mjs +0 -5
  246. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.mjs +0 -115
  247. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.mjs +0 -50
  248. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.mjs +0 -5
  249. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.mjs +0 -61
  250. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.mjs +0 -21
  251. package/client/esm2022/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.mjs +0 -4
  252. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.mjs +0 -32
  253. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.mjs +0 -54
  254. package/client/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -3
  255. package/client/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -33
  256. package/client/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -16
  257. package/client/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -3
  258. package/client/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -17
  259. package/client/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -10
  260. package/client/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +0 -6
  261. package/client/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -18
  262. package/client/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -17
  263. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -2
  264. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js +0 -5
  265. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js.map +0 -1
  266. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -29
  267. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -2
  268. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.d.ts +0 -1
  269. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js +0 -5
  270. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js.map +0 -1
  271. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/taon-db-admin.component.d.ts +0 -8
  272. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -2
  273. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js +0 -5
  274. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js.map +0 -1
  275. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -13
  276. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -2
  277. package/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.js.map +0 -1
  278. package/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -14
  279. package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -2
  280. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.mjs +0 -5
  281. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.mjs +0 -115
  282. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.mjs +0 -50
  283. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.mjs +0 -5
  284. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.mjs +0 -61
  285. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.mjs +0 -21
  286. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.mjs +0 -4
  287. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.mjs +0 -32
  288. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.mjs +0 -54
  289. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -3
  290. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -33
  291. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -16
  292. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -3
  293. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -17
  294. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -10
  295. package/websql/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +0 -6
  296. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -18
  297. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -17
  298. /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,6 +89,7 @@ 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), [
@@ -95,6 +99,10 @@ var EndpointContext = /** @class */ (function () {
95
99
  //#region fields / express app
96
100
  this.expressApp = {};
97
101
  //#endregion
102
+ //#region fields / only migration start
103
+ this.onlyMigrationRun = false;
104
+ this.onlyMigrationRevertToTimestamp = undefined;
105
+ //#endregion
98
106
  //#region fields / entities triggers
99
107
  this.entitiesTriggers = {};
100
108
  //#endregion
@@ -192,7 +200,7 @@ var EndpointContext = /** @class */ (function () {
192
200
  var key = _d.value;
193
201
  var BaseClass_1 = classesInput[key];
194
202
  if (!BaseClass_1) {
195
- 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 "));
196
204
  }
197
205
  var className = Reflect.getMetadata(symbols_1.Symbols.metadata.className, BaseClass_1);
198
206
  // console.log('Metadata className', className, BaseClass);
@@ -228,6 +236,13 @@ var EndpointContext = /** @class */ (function () {
228
236
  /* */
229
237
  /* */
230
238
  };
239
+ Object.defineProperty(EndpointContext.prototype, "isRunOrRevertOnlyMigrationAppStart", {
240
+ get: function () {
241
+ return !!(this.onlyMigrationRun || this.onlyMigrationRevertToTimestamp);
242
+ },
243
+ enumerable: false,
244
+ configurable: true
245
+ });
231
246
  Object.defineProperty(EndpointContext.prototype, "realtimeClient", {
232
247
  get: function () {
233
248
  return this.realtime.client;
@@ -247,7 +262,7 @@ var EndpointContext = /** @class */ (function () {
247
262
  //#region fields / logs
248
263
  get: function () {
249
264
  var _a, _b;
250
- 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)) {
251
266
  return !!this.config.logs.http;
252
267
  }
253
268
  return ((_b = this.config) === null || _b === void 0 ? void 0 : _b.logs) === true;
@@ -258,7 +273,7 @@ var EndpointContext = /** @class */ (function () {
258
273
  Object.defineProperty(EndpointContext.prototype, "logRealtime", {
259
274
  get: function () {
260
275
  var _a, _b;
261
- 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)) {
262
277
  return !!this.config.logs.realtime;
263
278
  }
264
279
  return ((_b = this.config) === null || _b === void 0 ? void 0 : _b.logs) === true;
@@ -269,7 +284,7 @@ var EndpointContext = /** @class */ (function () {
269
284
  Object.defineProperty(EndpointContext.prototype, "logFramework", {
270
285
  get: function () {
271
286
  var _a, _b;
272
- 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)) {
273
288
  return !!this.config.logs.framework;
274
289
  }
275
290
  return ((_b = this.config) === null || _b === void 0 ? void 0 : _b.logs) === true;
@@ -280,7 +295,7 @@ var EndpointContext = /** @class */ (function () {
280
295
  Object.defineProperty(EndpointContext.prototype, "logDb", {
281
296
  get: function () {
282
297
  var _a, _b;
283
- 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)) {
284
299
  return !!this.config.logs.db;
285
300
  }
286
301
  return ((_b = this.config) === null || _b === void 0 ? void 0 : _b.logs) === true;
@@ -288,27 +303,45 @@ var EndpointContext = /** @class */ (function () {
288
303
  enumerable: false,
289
304
  configurable: true
290
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
+ });
291
317
  //#endregion
292
318
  //#region methods & getters / init
293
319
  EndpointContext.prototype.init = function (options) {
294
320
  return tslib_1.__awaiter(this, void 0, void 0, function () {
295
- 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;
296
- 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;
297
323
  var _this = this;
298
- var _t, _u;
299
- return tslib_1.__generator(this, function (_v) {
300
- switch (_v.label) {
324
+ var _v, _w;
325
+ return tslib_1.__generator(this, function (_x) {
326
+ switch (_x.label) {
301
327
  case 0:
302
- _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;
303
329
  this.inited = true;
330
+ // @ts-ignore
331
+ this.onlyMigrationRun = onlyMigrationRun;
332
+ // @ts-ignore
333
+ this.onlyMigrationRevertToTimestamp = onlyMigrationRevertToTimestamp;
304
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
+ }
305
338
  if (overrideHost && overrideRemoteHost) {
306
- tnp_core_2.Helpers.throw("[taon-config] You can't have overrideHost and overrideRemoteHost at the same time");
339
+ tnp_core_3.Helpers.throw("[taon-config] You can't have overrideHost and overrideRemoteHost at the same time");
307
340
  }
308
- this.config.host = !tnp_core_2._.isUndefined(overrideHost)
341
+ this.config.host = !tnp_core_3._.isUndefined(overrideHost)
309
342
  ? overrideHost
310
343
  : this.config.host;
311
- this.config.remoteHost = !tnp_core_2._.isUndefined(overrideRemoteHost)
344
+ this.config.remoteHost = !tnp_core_3._.isUndefined(overrideRemoteHost)
312
345
  ? overrideRemoteHost
313
346
  : this.config.remoteHost;
314
347
  this.config.host = this.host === null ? void 0 : this.host;
@@ -317,12 +350,12 @@ var EndpointContext = /** @class */ (function () {
317
350
  if (this.config.host &&
318
351
  !this.config.host.startsWith('http://') &&
319
352
  !this.config.host.startsWith('https://')) {
320
- tnp_core_2.Helpers.throw("[taon-config] Your 'host' must start with http:// or https://");
353
+ tnp_core_3.Helpers.throw("[taon-config] Your 'host' must start with http:// or https://");
321
354
  }
322
355
  if (this.config.remoteHost &&
323
356
  !this.config.remoteHost.startsWith('http://') &&
324
357
  !this.config.remoteHost.startsWith('https://')) {
325
- tnp_core_2.Helpers.throw("[taon-config] Your 'remoteHost' must start with http:// or https://");
358
+ tnp_core_3.Helpers.throw("[taon-config] Your 'remoteHost' must start with http:// or https://");
326
359
  }
327
360
  //#region resolve mode
328
361
  if (this.config.host) {
@@ -332,12 +365,12 @@ var EndpointContext = /** @class */ (function () {
332
365
  }
333
366
  if (this.config.remoteHost) {
334
367
  if (this.config.host) {
335
- tnp_core_2.Helpers.throw("[taon] You can't have remoteHost and host at the same time");
368
+ tnp_core_3.Helpers.throw("[taon] You can't have remoteHost and host at the same time");
336
369
  }
337
370
  this.mode = 'remote-backend(tcp+udp)';
338
371
  }
339
- if (this.config.useIpcWhenElectron && tnp_core_2.Helpers.isElectron) {
340
- if (tnp_core_2.Helpers.isWebSQL) {
372
+ if (this.config.useIpcWhenElectron && tnp_core_3.Helpers.isElectron) {
373
+ if (tnp_core_3.Helpers.isWebSQL) {
341
374
  this.mode = 'backend-frontend(websql-electron)';
342
375
  }
343
376
  else {
@@ -345,7 +378,7 @@ var EndpointContext = /** @class */ (function () {
345
378
  }
346
379
  }
347
380
  if (!this.mode && !this.config.abstract) {
348
- 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);
349
382
  //#region @backend
350
383
  process.exit(1);
351
384
  //#endregion
@@ -355,13 +388,13 @@ var EndpointContext = /** @class */ (function () {
355
388
  if (this.config.database === true) {
356
389
  this.databaseConfig = this.getAutoGeneratedConfig();
357
390
  }
358
- else if (tnp_core_2._.isObject(this.config.database)) {
359
- this.databaseConfig = tnp_core_2._.merge(this.getAutoGeneratedConfig(), 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));
360
393
  }
361
394
  //#endregion
362
395
  //#region resolve session
363
396
  if (this.config.session) {
364
- this.session = tnp_core_2._.cloneDeep(this.config.session);
397
+ this.session = tnp_core_3._.cloneDeep(this.config.session);
365
398
  oneHour = 1000 * 60 * 60 * 1;
366
399
  if (!this.session.cookieMaxAge) {
367
400
  this.session.cookieMaxAge = oneHour;
@@ -377,35 +410,41 @@ var EndpointContext = /** @class */ (function () {
377
410
  this.config.repositories = this.config.repositories || {};
378
411
  this.config.providers = this.config.providers || {};
379
412
  this.config.subscribers = this.config.subscribers || {};
413
+ this.config.migrations = this.config.migrations || {};
380
414
  _b = this.config;
381
415
  _c = [{}];
382
416
  return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.ENTITY)];
383
417
  case 1:
384
- _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]);
385
419
  _d = this.config;
386
420
  _e = [{}];
387
421
  return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.CONTROLLER)];
388
422
  case 2:
389
- _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]);
390
424
  _f = this.config;
391
425
  _g = [{}];
392
426
  return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.PROVIDER)];
393
427
  case 3:
394
- _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]);
395
429
  _h = this.config;
396
430
  _j = [{}];
397
431
  return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.SUBSCRIBER)];
398
432
  case 4:
399
- _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]);
400
434
  _k = this.config;
401
435
  _l = [{}];
402
436
  return [4 /*yield*/, this.getRecrusiveClassesfromContextsObj(models_1.Models.ClassType.REPOSITORY)];
403
437
  case 5:
404
- _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]);
405
444
  // console.log(this.config);
406
445
  // debugger;
407
446
  //#endregion
408
- //#region prepare classes instances/funcitons clones
447
+ //#region prepare classes instances/functions clones
409
448
  this.config.controllers = this.cloneClassesObjWithNewMetadata({
410
449
  classesInput: this.config.controllers,
411
450
  config: this.config,
@@ -430,11 +469,17 @@ var EndpointContext = /** @class */ (function () {
430
469
  ctx: this,
431
470
  classType: models_1.Models.ClassType.SUBSCRIBER,
432
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
+ });
433
478
  try {
434
479
  //#endregion
435
480
  //#region prepare instances
436
- for (_m = tslib_1.__values(this.injectableTypesfromContexts), _o = _m.next(); !_o.done; _o = _m.next()) {
437
- classTypeName = _o.value;
481
+ for (_p = tslib_1.__values(this.injectableTypesfromContexts), _q = _p.next(); !_q.done; _q = _p.next()) {
482
+ classTypeName = _q.value;
438
483
  this.classInstancesByNameObj[classTypeName] = {};
439
484
  this.objWithClassesInstancesArr[classTypeName] = [];
440
485
  }
@@ -442,81 +487,83 @@ var EndpointContext = /** @class */ (function () {
442
487
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
443
488
  finally {
444
489
  try {
445
- if (_o && !_o.done && (_r = _m.return)) _r.call(_m);
490
+ if (_q && !_q.done && (_t = _p.return)) _t.call(_p);
446
491
  }
447
492
  finally { if (e_3) throw e_3.error; }
448
493
  }
449
- _v.label = 6;
450
- case 6:
451
- _v.trys.push([6, 11, 12, 13]);
452
- _p = tslib_1.__values(this.injectableTypesfromContexts), _q = _p.next();
453
- _v.label = 7;
494
+ _x.label = 7;
454
495
  case 7:
455
- if (!!_q.done) return [3 /*break*/, 10];
456
- classTypeName = _q.value;
457
- 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;
458
499
  case 8:
459
- _v.sent();
460
- _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)];
461
503
  case 9:
462
- _q = _p.next();
463
- return [3 /*break*/, 7];
464
- case 10: return [3 /*break*/, 13];
465
- case 11:
466
- e_2_1 = _v.sent();
467
- e_2 = { error: e_2_1 };
468
- 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];
469
510
  case 12:
511
+ e_2_1 = _x.sent();
512
+ e_2 = { error: e_2_1 };
513
+ return [3 /*break*/, 14];
514
+ case 13:
470
515
  try {
471
- if (_q && !_q.done && (_s = _p.return)) _s.call(_p);
516
+ if (_s && !_s.done && (_u = _r.return)) _u.call(_r);
472
517
  }
473
518
  finally { if (e_2) throw e_2.error; }
474
519
  return [7 /*endfinally*/];
475
- case 13:
520
+ case 14:
476
521
  //#endregion
477
- //#region prepares server
478
- if (this.mode === 'backend-frontend(tcp+udp)' && !this.config.abstract) {
479
- //#region @backend
480
- this.expressApp = express();
481
- this.initMiddlewares();
482
- this.serverTcpUdp = this.isHttpServer
483
- ? new tnp_core_1.https.Server({
484
- key: (_t = this.config.https) === null || _t === void 0 ? void 0 : _t.key,
485
- cert: (_u = this.config.https) === null || _u === void 0 ? void 0 : _u.cert,
486
- }, this.expressApp)
487
- : new tnp_core_1.http.Server(this.expressApp);
488
- this.publicAssets.forEach(function (asset) {
489
- _this.expressApp.use(asset.serverPath, express.static(asset.locationOnDisk));
490
- });
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
+ }
491
539
  //#endregion
492
- }
493
- //#endregion
494
- //#region prepare relatime
495
- if (!this.config.abstract) {
496
- this.disabledRealtime = !!this.config.disabledRealtime;
497
- //#region @backend
498
- if (tnp_core_2.Helpers.isRunningIn.cliMode()) {
499
- // TODO for now...
500
- 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);
501
550
  }
502
551
  //#endregion
503
- this.realtime = new realtime_core_1.RealtimeCore(this);
504
552
  }
505
- //#endregion
506
553
  //#region show context info
507
554
  // console.log({ ref })
508
555
  if (this.config.abstract) {
509
556
  this.logFramework &&
510
- 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));
511
558
  }
512
559
  else {
513
560
  if (this.config.remoteHost) {
514
561
  this.logFramework &&
515
- 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));
516
563
  }
517
564
  else {
518
565
  this.logFramework &&
519
- 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));
520
567
  }
521
568
  }
522
569
  //#endregion
@@ -533,81 +580,67 @@ var EndpointContext = /** @class */ (function () {
533
580
  //#region methods & getters / get auto generated config
534
581
  EndpointContext.prototype.getAutoGeneratedConfig = function () {
535
582
  //#region @websqlFunc
536
- var databaseConfig;
537
- if (tnp_core_2.Helpers.isRunningInDocker()) {
538
- 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');
539
586
  // TODO auto resolve database config in docker
540
- databaseConfig = {
541
- 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"),
542
589
  type: 'mysql',
543
- autoSave: true,
544
- synchronize: true,
545
- dropSchema: true,
590
+ recreateMode: 'PRESERVE_DATA+MIGRATIONS',
546
591
  logging: this.logDb,
547
592
  databasePort: 3306,
548
593
  databaseHost: 'localhost',
549
594
  databaseUsername: 'root',
550
595
  databasePassword: 'admin',
551
- };
596
+ });
552
597
  }
553
598
  else {
554
599
  this.logFramework &&
555
- 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));
556
601
  switch (this.mode) {
557
602
  //#region resolve database config for mode backend-frontend(tcp+udp)
558
603
  case 'backend-frontend(ipc-electron)':
559
- return {
560
- 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"),
561
606
  type: 'sqljs',
562
- autoSave: true,
563
- synchronize: true,
564
- dropSchema: true,
607
+ recreateMode: 'DROP_DB+MIGRATIONS',
565
608
  logging: this.logDb,
566
- };
609
+ });
567
610
  break;
568
611
  //#endregion
569
612
  //#region resolve database config for mode backend-frontend(websql)
570
613
  case 'backend-frontend(websql-electron)':
571
614
  case 'backend-frontend(websql)':
572
- databaseConfig = {
573
- location: "tmp-db-".concat(tnp_core_2._.kebabCase(this.contextName), ".sqljs"),
574
- type: 'sqljs',
575
- useLocalForage: true, // !!window['localforage'], // TODO this need to be checked in runtime
576
- autoSave: true,
577
- synchronize: true,
578
- dropSchema: true,
579
- logging: this.logDb,
580
- };
581
615
  var keepWebsqlDbDataAfterReload = false;
582
616
  /* */
583
617
  /* */
584
618
  /* */
585
- if (keepWebsqlDbDataAfterReload) {
586
- databaseConfig.dropSchema = false;
587
- delete databaseConfig.synchronize; // false is not auto synchonize - from what I understand
588
- }
589
- else {
590
- databaseConfig.dropSchema = true;
591
- databaseConfig.synchronize = true;
592
- }
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
+ });
593
628
  break;
594
629
  //#endregion
595
630
  //#region resolve database config for mode backend-frontend(tcp+udp)
596
631
  case 'backend-frontend(tcp+udp)':
597
- databaseConfig = {
598
- database: "context-db-".concat(tnp_core_2._.kebabCase(this.contextName)),
599
- 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"),
600
635
  type: 'sqljs',
601
- autoSave: true,
602
- synchronize: true,
603
- dropSchema: true,
636
+ recreateMode: 'DROP_DB+MIGRATIONS',
604
637
  logging: this.logDb,
605
- };
638
+ });
606
639
  break;
607
640
  //#endregion
608
641
  }
609
642
  }
610
- return databaseConfig;
643
+ return databaseConfig.databaseConfigTypeORM;
611
644
  //#endregion
612
645
  };
613
646
  Object.defineProperty(EndpointContext.prototype, "ngZone", {
@@ -626,18 +659,18 @@ var EndpointContext = /** @class */ (function () {
626
659
  EndpointContext.prototype.startServer = function () {
627
660
  var _this = this;
628
661
  //#region @backendFunc
629
- if (this.remoteHost) {
662
+ if (this.remoteHost || this.isRunOrRevertOnlyMigrationAppStart) {
630
663
  return;
631
664
  }
632
665
  if (this.mode === 'backend-frontend(tcp+udp)') {
633
666
  // this.displayRoutes(this.expressApp);
634
667
  this.serverTcpUdp.listen(Number(this.uri.port), function () {
635
- 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 "));
636
669
  });
637
670
  }
638
671
  else {
639
672
  this.logFramework &&
640
- tnp_core_2.Helpers.info('Ipc communication enable instead tcp/upd');
673
+ tnp_core_3.Helpers.info('Ipc communication enable instead tcp/upd');
641
674
  }
642
675
  //#endregion
643
676
  };
@@ -831,7 +864,7 @@ var EndpointContext = /** @class */ (function () {
831
864
  //#endregion
832
865
  //#region methods & getters / check if context initialized
833
866
  EndpointContext.prototype.checkIfContextInitialized = function () {
834
- if (tnp_core_2._.isUndefined(this.config)) {
867
+ if (tnp_core_3._.isUndefined(this.config)) {
835
868
  throw new Error("Please check if your context has been initialized.\n\n // ...\n await Context.initialize();\n // ...\n\n\n ");
836
869
  }
837
870
  };
@@ -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') {