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
@@ -0,0 +1,585 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContextDbMigrations = void 0;
4
+ var tslib_1 = require("tslib");
5
+ //#region imports
6
+ var tnp_core_1 = require("tnp-core");
7
+ var models_1 = require("./models");
8
+ var class_helpers_1 = require("./helpers/class-helpers");
9
+ var taon_typeorm_1 = require("taon-typeorm");
10
+ var ContextDbMigrations = /** @class */ (function () {
11
+ //#endregion
12
+ //#endregion
13
+ //#region constructor
14
+ function ContextDbMigrations(ctx) {
15
+ this.ctx = ctx;
16
+ //#region fields
17
+ //#region fields / migration table name
18
+ this.DEFAULT_MIGRATION_TABLE_NAME = 'TAON_MIGRATION_META';
19
+ //#endregion
20
+ //#region fields / migration statuses
21
+ this.MIGRATION_STATUS_COMPLETED = 'completed';
22
+ this.MIGRATION_STATUS_PENDING = 'pending';
23
+ //#endregion
24
+ //#region fields / migration table schema
25
+ this.table = new taon_typeorm_1.Table({
26
+ name: this.DEFAULT_MIGRATION_TABLE_NAME,
27
+ columns: [
28
+ {
29
+ name: 'id',
30
+ type: 'integer',
31
+ isPrimary: true, // Mark it as the primary key
32
+ isGenerated: true, // Enable auto-generation
33
+ generationStrategy: 'increment', // Use auto-increment strategy
34
+ },
35
+ {
36
+ name: 'name',
37
+ type: 'varchar',
38
+ length: '255',
39
+ isUnique: true, // Ensure the name is unique
40
+ isNullable: false, // Ensure this field is required
41
+ },
42
+ {
43
+ // context is a part of name
44
+ name: 'context',
45
+ type: 'varchar',
46
+ length: '255',
47
+ isNullable: false, // Optional context for migrations (e.g., tenant or module name)
48
+ },
49
+ {
50
+ name: 'applied_at',
51
+ type: 'timestamp',
52
+ default: 'CURRENT_TIMESTAMP', // Automatically set the timestamp
53
+ isNullable: true,
54
+ },
55
+ {
56
+ name: 'status',
57
+ type: 'varchar',
58
+ length: '50',
59
+ default: "'".concat(this.MIGRATION_STATUS_COMPLETED, "'"),
60
+ isNullable: false,
61
+ },
62
+ // { // TODO not needed for now
63
+ // name: 'checksum',
64
+ // type: 'varchar',
65
+ // length: '64',
66
+ // isNullable: true, // Optional field to store a hash/checksum of migration file
67
+ // },
68
+ ],
69
+ });
70
+ }
71
+ //#endregion
72
+ //#region methods & getters / make sure migration table exists
73
+ ContextDbMigrations.prototype.ensureMigrationTableExists = function () {
74
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
75
+ var queryRunner, hasTable, error_1;
76
+ return tslib_1.__generator(this, function (_a) {
77
+ switch (_a.label) {
78
+ case 0:
79
+ //#region @websqlFunc
80
+ if (this.ctx.remoteHost) {
81
+ return [2 /*return*/];
82
+ }
83
+ queryRunner = this.ctx.connection.createQueryRunner();
84
+ return [4 /*yield*/, queryRunner.connect()];
85
+ case 1:
86
+ _a.sent();
87
+ return [4 /*yield*/, queryRunner.startTransaction()];
88
+ case 2:
89
+ _a.sent();
90
+ return [4 /*yield*/, queryRunner.hasTable(this.DEFAULT_MIGRATION_TABLE_NAME)];
91
+ case 3:
92
+ hasTable = _a.sent();
93
+ if (!hasTable) return [3 /*break*/, 5];
94
+ this.ctx.logMigrations &&
95
+ console.log("Table ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, " already exists."));
96
+ return [4 /*yield*/, queryRunner.release()];
97
+ case 4:
98
+ _a.sent();
99
+ return [2 /*return*/]; // Exit early if the table exists
100
+ case 5:
101
+ _a.trys.push([5, 9, 11, 13]);
102
+ return [4 /*yield*/, queryRunner.createTable(this.table)];
103
+ case 6:
104
+ _a.sent();
105
+ return [4 /*yield*/, queryRunner.createIndex(this.DEFAULT_MIGRATION_TABLE_NAME, new taon_typeorm_1.TableIndex({
106
+ name: 'IDX_NAME',
107
+ columnNames: ['name'],
108
+ }))];
109
+ case 7:
110
+ _a.sent();
111
+ return [4 /*yield*/, queryRunner.commitTransaction()];
112
+ case 8:
113
+ _a.sent();
114
+ return [3 /*break*/, 13];
115
+ case 9:
116
+ error_1 = _a.sent();
117
+ this.ctx.logMigrations &&
118
+ console.error("Transaction failed [ensureMigrationTableExists]" + ", rolling back:", error_1);
119
+ return [4 /*yield*/, queryRunner.rollbackTransaction()];
120
+ case 10:
121
+ _a.sent();
122
+ return [3 /*break*/, 13];
123
+ case 11: return [4 /*yield*/, queryRunner.release()];
124
+ case 12:
125
+ _a.sent();
126
+ return [7 /*endfinally*/];
127
+ case 13: return [2 /*return*/];
128
+ }
129
+ });
130
+ });
131
+ };
132
+ //#endregion
133
+ //#region methods & getters / revert migration to timestamp
134
+ ContextDbMigrations.prototype.revertMigrationToTimestamp = function (timestamp) {
135
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
136
+ var migrationsClassFns, migrationClassesInstancesToRevert, queryRunner, appliedMigrationsForContext, appliedMigrationsForContextNames, migrationClassesInstancesToRevert_1, migrationClassesInstancesToRevert_1_1, migrationClassInstance, migrationName, e_1_1, error_2;
137
+ var e_1, _a;
138
+ var _this = this;
139
+ return tslib_1.__generator(this, function (_b) {
140
+ switch (_b.label) {
141
+ case 0:
142
+ //#region @websqlFunc
143
+ if (this.ctx.remoteHost) {
144
+ return [2 /*return*/];
145
+ }
146
+ if (!tnp_core_1.UtilsMigrations.isValidTimestamp(timestamp)) {
147
+ tnp_core_1.Helpers.throw("Invalid timestamp provided for migration revert: ".concat(timestamp));
148
+ }
149
+ migrationsClassFns = this.ctx
150
+ .getClassFunByArr(models_1.Models.ClassType.MIGRATION)
151
+ .reverse();
152
+ migrationClassesInstancesToRevert = migrationsClassFns
153
+ .map(function (classFn) {
154
+ var timestampFromClassName = Number(tnp_core_1.UtilsMigrations.getTimestampFromClassName(class_helpers_1.ClassHelpers.getName(classFn)));
155
+ if (timestampFromClassName <= timestamp) {
156
+ // this.ctx.logMigrations &&
157
+ // console.log(
158
+ // `Stopping migration filter at: ${ClassHelpers.getName(classFn)} ` +
159
+ // `with timestamp ${timestampFromClassName}`,
160
+ // );
161
+ return null;
162
+ }
163
+ return _this.ctx.getInstanceBy(classFn);
164
+ })
165
+ .filter(function (f) { return !!f; })
166
+ .map(function (f) { return f; })
167
+ .filter(function (migrationInstance) { return migrationInstance.isReadyToRun(); });
168
+ queryRunner = this.ctx.connection.createQueryRunner();
169
+ return [4 /*yield*/, queryRunner.connect()];
170
+ case 1:
171
+ _b.sent();
172
+ _b.label = 2;
173
+ case 2:
174
+ _b.trys.push([2, 15, 17, 19]);
175
+ return [4 /*yield*/, queryRunner.startTransaction()];
176
+ case 3:
177
+ _b.sent();
178
+ return [4 /*yield*/, queryRunner.query("SELECT name FROM ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, "\n WHERE status = $1 AND context = $2"), [this.MIGRATION_STATUS_COMPLETED, this.ctx.contextName])];
179
+ case 4:
180
+ appliedMigrationsForContext = _b.sent();
181
+ appliedMigrationsForContextNames = appliedMigrationsForContext.map(function (m) { return m.name; });
182
+ _b.label = 5;
183
+ case 5:
184
+ _b.trys.push([5, 11, 12, 13]);
185
+ migrationClassesInstancesToRevert_1 = tslib_1.__values(migrationClassesInstancesToRevert), migrationClassesInstancesToRevert_1_1 = migrationClassesInstancesToRevert_1.next();
186
+ _b.label = 6;
187
+ case 6:
188
+ if (!!migrationClassesInstancesToRevert_1_1.done) return [3 /*break*/, 10];
189
+ migrationClassInstance = migrationClassesInstancesToRevert_1_1.value;
190
+ migrationName = class_helpers_1.ClassHelpers.getName(migrationClassInstance);
191
+ if (!appliedMigrationsForContextNames.includes(migrationName)) {
192
+ this.ctx.logMigrations &&
193
+ console.warn("Skipping migration not marked as applied: ".concat(migrationName));
194
+ return [3 /*break*/, 9];
195
+ }
196
+ this.ctx.logMigrations &&
197
+ console.log("Reverting migration: ".concat(migrationName, " , context: ").concat(this.ctx.contextName));
198
+ return [4 /*yield*/, migrationClassInstance.down(queryRunner)];
199
+ case 7:
200
+ _b.sent();
201
+ // Remove the reverted migration from the tracking table
202
+ return [4 /*yield*/, queryRunner.query("DELETE FROM ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, " WHERE name = $1"), [migrationName])];
203
+ case 8:
204
+ // Remove the reverted migration from the tracking table
205
+ _b.sent();
206
+ _b.label = 9;
207
+ case 9:
208
+ migrationClassesInstancesToRevert_1_1 = migrationClassesInstancesToRevert_1.next();
209
+ return [3 /*break*/, 6];
210
+ case 10: return [3 /*break*/, 13];
211
+ case 11:
212
+ e_1_1 = _b.sent();
213
+ e_1 = { error: e_1_1 };
214
+ return [3 /*break*/, 13];
215
+ case 12:
216
+ try {
217
+ if (migrationClassesInstancesToRevert_1_1 && !migrationClassesInstancesToRevert_1_1.done && (_a = migrationClassesInstancesToRevert_1.return)) _a.call(migrationClassesInstancesToRevert_1);
218
+ }
219
+ finally { if (e_1) throw e_1.error; }
220
+ return [7 /*endfinally*/];
221
+ case 13: return [4 /*yield*/, queryRunner.commitTransaction()];
222
+ case 14:
223
+ _b.sent();
224
+ this.ctx.logMigrations &&
225
+ console.log('Migrations successfully reverted to the specified timestamp.');
226
+ return [3 /*break*/, 19];
227
+ case 15:
228
+ error_2 = _b.sent();
229
+ this.ctx.logMigrations &&
230
+ console.error('Transaction failed, rolling back:', error_2);
231
+ return [4 /*yield*/, queryRunner.rollbackTransaction()];
232
+ case 16:
233
+ _b.sent();
234
+ return [3 /*break*/, 19];
235
+ case 17: return [4 /*yield*/, queryRunner.release()];
236
+ case 18:
237
+ _b.sent();
238
+ return [7 /*endfinally*/];
239
+ case 19: return [2 /*return*/];
240
+ }
241
+ });
242
+ });
243
+ };
244
+ //#endregion
245
+ //#region methods & getters / clear migration table
246
+ ContextDbMigrations.prototype.clearMigrationTable = function () {
247
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
248
+ var queryRunner, error_3;
249
+ return tslib_1.__generator(this, function (_a) {
250
+ switch (_a.label) {
251
+ case 0:
252
+ //#region @websqlFunc
253
+ if (this.ctx.remoteHost) {
254
+ return [2 /*return*/];
255
+ }
256
+ queryRunner = this.ctx.connection.createQueryRunner();
257
+ return [4 /*yield*/, queryRunner.connect()];
258
+ case 1:
259
+ _a.sent();
260
+ return [4 /*yield*/, queryRunner.startTransaction()];
261
+ case 2:
262
+ _a.sent();
263
+ _a.label = 3;
264
+ case 3:
265
+ _a.trys.push([3, 6, 8, 10]);
266
+ return [4 /*yield*/, queryRunner.clearTable(this.DEFAULT_MIGRATION_TABLE_NAME)];
267
+ case 4:
268
+ _a.sent();
269
+ return [4 /*yield*/, queryRunner.commitTransaction()];
270
+ case 5:
271
+ _a.sent();
272
+ return [3 /*break*/, 10];
273
+ case 6:
274
+ error_3 = _a.sent();
275
+ this.ctx.logMigrations &&
276
+ console.error('Transaction failed, rolling back:', error_3);
277
+ return [4 /*yield*/, queryRunner.rollbackTransaction()];
278
+ case 7:
279
+ _a.sent();
280
+ return [3 /*break*/, 10];
281
+ case 8: return [4 /*yield*/, queryRunner.release()];
282
+ case 9:
283
+ _a.sent();
284
+ return [7 /*endfinally*/];
285
+ case 10: return [2 /*return*/];
286
+ }
287
+ });
288
+ });
289
+ };
290
+ //#endregion
291
+ //#region methods & getters / mark all migrations as applied
292
+ ContextDbMigrations.prototype.markAllMigrationsAsApplied = function () {
293
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
294
+ var migrationsClassFns, migrationClassesInstances, queryRunner, allMigrationsInDb, allMigrationInDBNames, migrationClassesInstances_1, migrationClassesInstances_1_1, instance, migrationName, e_2_1, error_4;
295
+ var e_2, _a;
296
+ var _this = this;
297
+ return tslib_1.__generator(this, function (_b) {
298
+ switch (_b.label) {
299
+ case 0:
300
+ //#region @websqlFunc
301
+ if (this.ctx.remoteHost) {
302
+ return [2 /*return*/];
303
+ }
304
+ migrationsClassFns = this.ctx.getClassFunByArr(models_1.Models.ClassType.MIGRATION);
305
+ migrationClassesInstances = migrationsClassFns
306
+ .map(function (classFn) { return _this.ctx.getInstanceBy(classFn); })
307
+ .map(function (f) { return f; })
308
+ .filter(function (migrationInstance) { return migrationInstance.isReadyToRun(); });
309
+ queryRunner = this.ctx.connection.createQueryRunner();
310
+ return [4 /*yield*/, queryRunner.connect()];
311
+ case 1:
312
+ _b.sent();
313
+ _b.label = 2;
314
+ case 2:
315
+ _b.trys.push([2, 15, 17, 19]);
316
+ return [4 /*yield*/, queryRunner.startTransaction()];
317
+ case 3:
318
+ _b.sent();
319
+ return [4 /*yield*/, queryRunner.query("SELECT name FROM ".concat(this.DEFAULT_MIGRATION_TABLE_NAME))];
320
+ case 4:
321
+ allMigrationsInDb = _b.sent();
322
+ allMigrationInDBNames = allMigrationsInDb.map(function (m) { return m.name; });
323
+ _b.label = 5;
324
+ case 5:
325
+ _b.trys.push([5, 10, 11, 12]);
326
+ migrationClassesInstances_1 = tslib_1.__values(migrationClassesInstances), migrationClassesInstances_1_1 = migrationClassesInstances_1.next();
327
+ _b.label = 6;
328
+ case 6:
329
+ if (!!migrationClassesInstances_1_1.done) return [3 /*break*/, 9];
330
+ instance = migrationClassesInstances_1_1.value;
331
+ migrationName = class_helpers_1.ClassHelpers.getName(instance);
332
+ if (allMigrationInDBNames.includes(migrationName)) {
333
+ this.ctx.logMigrations &&
334
+ console.log("Skipping already applied migration: ".concat(migrationName));
335
+ return [3 /*break*/, 8];
336
+ }
337
+ this.ctx.logMigrations &&
338
+ console.log("Marking migration as applied: ".concat(migrationName));
339
+ // Insert migration as 'complete' without running
340
+ return [4 /*yield*/, queryRunner.query("INSERT INTO ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, " (name, status, context, applied_at) ") +
341
+ "VALUES ($1, $2, $3, CURRENT_TIMESTAMP)", [
342
+ migrationName,
343
+ this.MIGRATION_STATUS_COMPLETED,
344
+ instance.ctx.contextName,
345
+ ])];
346
+ case 7:
347
+ // Insert migration as 'complete' without running
348
+ _b.sent();
349
+ _b.label = 8;
350
+ case 8:
351
+ migrationClassesInstances_1_1 = migrationClassesInstances_1.next();
352
+ return [3 /*break*/, 6];
353
+ case 9: return [3 /*break*/, 12];
354
+ case 10:
355
+ e_2_1 = _b.sent();
356
+ e_2 = { error: e_2_1 };
357
+ return [3 /*break*/, 12];
358
+ case 11:
359
+ try {
360
+ if (migrationClassesInstances_1_1 && !migrationClassesInstances_1_1.done && (_a = migrationClassesInstances_1.return)) _a.call(migrationClassesInstances_1);
361
+ }
362
+ finally { if (e_2) throw e_2.error; }
363
+ return [7 /*endfinally*/];
364
+ case 12:
365
+ // update all pending migrations to completed
366
+ return [4 /*yield*/, queryRunner.query("UPDATE ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, "\n SET status = $1, applied_at = CURRENT_TIMESTAMP\n WHERE status = $2"), [this.MIGRATION_STATUS_COMPLETED, this.MIGRATION_STATUS_PENDING])];
367
+ case 13:
368
+ // update all pending migrations to completed
369
+ _b.sent();
370
+ return [4 /*yield*/, queryRunner.commitTransaction()];
371
+ case 14:
372
+ _b.sent();
373
+ this.ctx.logMigrations &&
374
+ console.log('All migrations marked as applied.');
375
+ return [3 /*break*/, 19];
376
+ case 15:
377
+ error_4 = _b.sent();
378
+ this.ctx.logMigrations &&
379
+ console.error('Failed to mark all migrations as applied, rolling back:', error_4);
380
+ return [4 /*yield*/, queryRunner.rollbackTransaction()];
381
+ case 16:
382
+ _b.sent();
383
+ return [3 /*break*/, 19];
384
+ case 17: return [4 /*yield*/, queryRunner.release()];
385
+ case 18:
386
+ _b.sent();
387
+ return [7 /*endfinally*/];
388
+ case 19: return [2 /*return*/];
389
+ }
390
+ });
391
+ });
392
+ };
393
+ //#endregion
394
+ //#region methods & getters / run all migrations
395
+ ContextDbMigrations.prototype.runAllNotCompletedMigrations = function () {
396
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
397
+ var migrationsClassFns, migrationClassesInstances, queryRunner, appliedMigrationsForContext, pendingMigrationsForContext, _loop_1, this_1, pendingMigrationsForContext_1, pendingMigrationsForContext_1_1, pendingContextMigration, e_3_1, _loop_2, this_2, migrationClassesInstances_2, migrationClassesInstances_2_1, instance, e_4_1, error_5;
398
+ var e_3, _a, e_4, _b;
399
+ var _this = this;
400
+ return tslib_1.__generator(this, function (_c) {
401
+ switch (_c.label) {
402
+ case 0:
403
+ //#region @websqlFunc
404
+ if (this.ctx.remoteHost) {
405
+ return [2 /*return*/];
406
+ }
407
+ migrationsClassFns = this.ctx.getClassFunByArr(models_1.Models.ClassType.MIGRATION);
408
+ migrationClassesInstances = migrationsClassFns
409
+ .map(function (classFn) { return _this.ctx.getInstanceBy(classFn); })
410
+ .map(function (f) { return f; })
411
+ .filter(function (migrationInstance) { return migrationInstance.isReadyToRun(); });
412
+ queryRunner = this.ctx.connection.createQueryRunner();
413
+ return [4 /*yield*/, queryRunner.connect()];
414
+ case 1:
415
+ _c.sent();
416
+ _c.label = 2;
417
+ case 2:
418
+ _c.trys.push([2, 22, 24, 26]);
419
+ return [4 /*yield*/, queryRunner.startTransaction()];
420
+ case 3:
421
+ _c.sent();
422
+ return [4 /*yield*/, queryRunner.query("SELECT name, status FROM ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, " ") +
423
+ "WHERE context = $1", [this.ctx.contextName])];
424
+ case 4:
425
+ appliedMigrationsForContext = _c.sent();
426
+ pendingMigrationsForContext = appliedMigrationsForContext.filter(function (m) { return m.status === _this.MIGRATION_STATUS_PENDING; });
427
+ _loop_1 = function (pendingContextMigration) {
428
+ var migrationInstance;
429
+ return tslib_1.__generator(this, function (_d) {
430
+ switch (_d.label) {
431
+ case 0:
432
+ migrationInstance = migrationClassesInstances.find(function (instance) {
433
+ return class_helpers_1.ClassHelpers.getName(instance) === pendingContextMigration.name;
434
+ });
435
+ if (!migrationInstance) {
436
+ this_1.ctx.logMigrations &&
437
+ console.warn("Pending migration ".concat(pendingContextMigration.name, " not found in loaded migrations."));
438
+ return [2 /*return*/, "continue"];
439
+ }
440
+ this_1.ctx.logMigrations &&
441
+ console.log("Completing pending migration: ".concat(pendingContextMigration.name));
442
+ return [4 /*yield*/, migrationInstance.up(queryRunner)];
443
+ case 1:
444
+ _d.sent();
445
+ // Update migration status to 'complete'
446
+ return [4 /*yield*/, queryRunner.query("UPDATE ".concat(this_1.DEFAULT_MIGRATION_TABLE_NAME, "\n SET status = $1, applied_at = CURRENT_TIMESTAMP\n WHERE name = $2"), [this_1.MIGRATION_STATUS_COMPLETED, pendingContextMigration.name])];
447
+ case 2:
448
+ // Update migration status to 'complete'
449
+ _d.sent();
450
+ return [2 /*return*/];
451
+ }
452
+ });
453
+ };
454
+ this_1 = this;
455
+ _c.label = 5;
456
+ case 5:
457
+ _c.trys.push([5, 10, 11, 12]);
458
+ pendingMigrationsForContext_1 = tslib_1.__values(pendingMigrationsForContext), pendingMigrationsForContext_1_1 = pendingMigrationsForContext_1.next();
459
+ _c.label = 6;
460
+ case 6:
461
+ if (!!pendingMigrationsForContext_1_1.done) return [3 /*break*/, 9];
462
+ pendingContextMigration = pendingMigrationsForContext_1_1.value;
463
+ return [5 /*yield**/, _loop_1(pendingContextMigration)];
464
+ case 7:
465
+ _c.sent();
466
+ _c.label = 8;
467
+ case 8:
468
+ pendingMigrationsForContext_1_1 = pendingMigrationsForContext_1.next();
469
+ return [3 /*break*/, 6];
470
+ case 9: return [3 /*break*/, 12];
471
+ case 10:
472
+ e_3_1 = _c.sent();
473
+ e_3 = { error: e_3_1 };
474
+ return [3 /*break*/, 12];
475
+ case 11:
476
+ try {
477
+ if (pendingMigrationsForContext_1_1 && !pendingMigrationsForContext_1_1.done && (_a = pendingMigrationsForContext_1.return)) _a.call(pendingMigrationsForContext_1);
478
+ }
479
+ finally { if (e_3) throw e_3.error; }
480
+ return [7 /*endfinally*/];
481
+ case 12:
482
+ _loop_2 = function (instance) {
483
+ var migrationName, error_6;
484
+ return tslib_1.__generator(this, function (_e) {
485
+ switch (_e.label) {
486
+ case 0:
487
+ migrationName = class_helpers_1.ClassHelpers.getName(instance);
488
+ if (appliedMigrationsForContext.some(function (m) { return m.name === migrationName; })) {
489
+ this_2.ctx.logMigrations &&
490
+ console.log("Skipping already applied migration: ".concat(migrationName));
491
+ return [2 /*return*/, "continue"];
492
+ }
493
+ this_2.ctx.logMigrations &&
494
+ console.log("Applying new migration: ".concat(migrationName));
495
+ // Insert migration as 'pending' before execution
496
+ return [4 /*yield*/, queryRunner.query("INSERT INTO ".concat(this_2.DEFAULT_MIGRATION_TABLE_NAME, " (name, status, context, applied_at) ") +
497
+ "VALUES ($1, $2, $3, NULL)", [migrationName, this_2.MIGRATION_STATUS_PENDING, this_2.ctx.contextName])];
498
+ case 1:
499
+ // Insert migration as 'pending' before execution
500
+ _e.sent();
501
+ _e.label = 2;
502
+ case 2:
503
+ _e.trys.push([2, 5, , 7]);
504
+ // Apply migration
505
+ return [4 /*yield*/, instance.up(queryRunner)];
506
+ case 3:
507
+ // Apply migration
508
+ _e.sent();
509
+ // Update migration to 'complete' after successful execution
510
+ return [4 /*yield*/, queryRunner.query("UPDATE ".concat(this_2.DEFAULT_MIGRATION_TABLE_NAME, " ") +
511
+ "SET status = '".concat(this_2.MIGRATION_STATUS_COMPLETED, "', applied_at = CURRENT_TIMESTAMP ") +
512
+ "WHERE name = $1", [migrationName])];
513
+ case 4:
514
+ // Update migration to 'complete' after successful execution
515
+ _e.sent();
516
+ return [3 /*break*/, 7];
517
+ case 5:
518
+ error_6 = _e.sent();
519
+ this_2.ctx.logMigrations &&
520
+ console.error("Failed to apply migration: ".concat(migrationName), error_6);
521
+ // Rollback pending migration entry
522
+ return [4 /*yield*/, queryRunner.query("DELETE FROM ".concat(this_2.DEFAULT_MIGRATION_TABLE_NAME, " WHERE name = $1"), [migrationName])];
523
+ case 6:
524
+ // Rollback pending migration entry
525
+ _e.sent();
526
+ throw error_6; // Rethrow to ensure the transaction is rolled back
527
+ case 7: return [2 /*return*/];
528
+ }
529
+ });
530
+ };
531
+ this_2 = this;
532
+ _c.label = 13;
533
+ case 13:
534
+ _c.trys.push([13, 18, 19, 20]);
535
+ migrationClassesInstances_2 = tslib_1.__values(migrationClassesInstances), migrationClassesInstances_2_1 = migrationClassesInstances_2.next();
536
+ _c.label = 14;
537
+ case 14:
538
+ if (!!migrationClassesInstances_2_1.done) return [3 /*break*/, 17];
539
+ instance = migrationClassesInstances_2_1.value;
540
+ return [5 /*yield**/, _loop_2(instance)];
541
+ case 15:
542
+ _c.sent();
543
+ _c.label = 16;
544
+ case 16:
545
+ migrationClassesInstances_2_1 = migrationClassesInstances_2.next();
546
+ return [3 /*break*/, 14];
547
+ case 17: return [3 /*break*/, 20];
548
+ case 18:
549
+ e_4_1 = _c.sent();
550
+ e_4 = { error: e_4_1 };
551
+ return [3 /*break*/, 20];
552
+ case 19:
553
+ try {
554
+ if (migrationClassesInstances_2_1 && !migrationClassesInstances_2_1.done && (_b = migrationClassesInstances_2.return)) _b.call(migrationClassesInstances_2);
555
+ }
556
+ finally { if (e_4) throw e_4.error; }
557
+ return [7 /*endfinally*/];
558
+ case 20:
559
+ //#endregion
560
+ return [4 /*yield*/, queryRunner.commitTransaction()];
561
+ case 21:
562
+ //#endregion
563
+ _c.sent();
564
+ return [3 /*break*/, 26];
565
+ case 22:
566
+ error_5 = _c.sent();
567
+ this.ctx.logMigrations &&
568
+ console.error('Transaction failed, rolling back:', error_5);
569
+ return [4 /*yield*/, queryRunner.rollbackTransaction()];
570
+ case 23:
571
+ _c.sent();
572
+ return [3 /*break*/, 26];
573
+ case 24: return [4 /*yield*/, queryRunner.release()];
574
+ case 25:
575
+ _c.sent();
576
+ return [7 /*endfinally*/];
577
+ case 26: return [2 /*return*/];
578
+ }
579
+ });
580
+ });
581
+ };
582
+ return ContextDbMigrations;
583
+ }());
584
+ exports.ContextDbMigrations = ContextDbMigrations;
585
+ //# sourceMappingURL=context-db-migrations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-db-migrations.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;;AAAA,iBAAiB;AACjB,qCAAuD;AAGvD,mCAAkC;AAClC,yDAAuD;AACvD,6CAWsB;AAMtB;IA0DE,YAAY;IAEZ,YAAY;IAEZ,qBAAqB;IACrB,6BAAoB,GAAoB;QAApB,QAAG,GAAH,GAAG,CAAiB;QA9DxC,gBAAgB;QAEhB,uCAAuC;QAC9B,iCAA4B,GAAG,qBAAqB,CAAC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5D,qBAAM,WAAW,CAAC,KAAK,CACrB,iBAAU,OAAK,4BAA4B,MAAG;gDAC5C,wBAAiB,OAAK,0BAA0B,uCAAoC;gDACpF,iBAAiB,EACnB,CAAC,aAAa,CAAC,CAChB,EAAA;;wCAND,4DAA4D;wCAC5D,SAKC,CAAC;;;;wCAEF,OAAK,GAAG,CAAC,aAAa;4CACpB,OAAO,CAAC,KAAK,CAAC,qCAA8B,aAAa,CAAE,EAAE,OAAK,CAAC,CAAC;wCAEtE,mCAAmC;wCACnC,qBAAM,WAAW,CAAC,KAAK,CACrB,sBAAe,OAAK,4BAA4B,qBAAkB,EAClE,CAAC,aAAa,CAAC,CAChB,EAAA;;wCAJD,mCAAmC;wCACnC,SAGC,CAAC;wCAEF,MAAM,OAAK,CAAC,CAAC,mDAAmD;;;;;;;;;wBAvC7C,8BAAA,iBAAA,yBAAyB,CAAA;;;;wBAArC,QAAQ;sDAAR,QAAQ;;;;;;;;;;;;;;;;;;;oBA2CnB,YAAY;oBAEZ,qBAAM,WAAW,CAAC,iBAAiB,EAAE,EAAA;;wBAFrC,YAAY;wBAEZ,SAAqC,CAAC;;;;wBAEtC,IAAI,CAAC,GAAG,CAAC,aAAa;4BACpB,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,OAAK,CAAC,CAAC;wBAC5D,qBAAM,WAAW,CAAC,mBAAmB,EAAE,EAAA;;wBAAvC,SAAuC,CAAC;;6BAExC,qBAAM,WAAW,CAAC,OAAO,EAAE,EAAA;;wBAA3B,SAA2B,CAAC;;;;;;KAG/B;IAEH,0BAAC;AAAD,CAAC,AAxbD,IAwbC;AAxbY,kDAAmB"}
@@ -1,11 +1,12 @@
1
1
  import { EndpointContext } from './endpoint-context';
2
2
  import { Models } from './models';
3
- export declare const createContext: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER>) => {
3
+ export declare const createContext: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION>) => {
4
4
  types: {
5
5
  readonly controllers: CTRL;
6
6
  readonly repositories: REPO;
7
7
  readonly providers: PROVIDER;
8
8
  readonly subscribers: SUBSCRIBER;
9
+ readonly migrations: MIGRATION;
9
10
  };
10
11
  readonly contexts: CTX;
11
12
  readonly contextName: string;
@@ -15,9 +16,9 @@ export declare const createContext: <CTX extends Record<string, object>, CTRL ex
15
16
  */
16
17
  __ref(): Promise<EndpointContext>;
17
18
  /**
18
- * only for internal use
19
- * @deprecated
20
- */
19
+ * only for internal use
20
+ * @deprecated
21
+ */
21
22
  readonly __refSync: EndpointContext;
22
23
  getClassInstance<T>(ctor: new (...args: any[]) => T): T;
23
24
  getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
@@ -28,6 +29,8 @@ export declare const createContext: <CTX extends Record<string, object>, CTRL ex
28
29
  initialize: (overrideOptions?: {
29
30
  overrideHost?: string;
30
31
  overrideRemoteHost?: string;
32
+ onlyMigrationRun?: boolean;
33
+ onlyMigrationRevertToTimestamp?: number;
31
34
  }) => Promise<EndpointContext>;
32
35
  /**
33
36
  * realtime communication with server