taon 18.0.20 → 18.0.22

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 (290) hide show
  1. package/README.md +3 -7
  2. package/assets/shared/logo-header-admin-mode.png +0 -0
  3. package/assets/shared/shared_folder_info.txt +1 -1
  4. package/browser/esm2022/lib/base-classes/base-class.mjs +2 -2
  5. package/browser/esm2022/lib/base-classes/base-controller.mjs +3 -2
  6. package/browser/esm2022/lib/base-classes/base-migration.mjs +23 -0
  7. package/browser/esm2022/lib/base-classes/base-subscriber-for-entity.mjs +20 -20
  8. package/browser/esm2022/lib/base-classes/base.mjs +3 -1
  9. package/browser/esm2022/lib/context-db-migrations.mjs +425 -0
  10. package/browser/esm2022/lib/create-context.mjs +17 -4
  11. package/browser/esm2022/lib/decorators/classes/controller-decorator.mjs +4 -1
  12. package/browser/esm2022/lib/decorators/classes/entity-decorator.mjs +4 -1
  13. package/browser/esm2022/lib/decorators/classes/migration-decorator.mjs +18 -0
  14. package/browser/esm2022/lib/decorators/classes/provider-decorator.mjs +4 -1
  15. package/browser/esm2022/lib/decorators/classes/repository-decorator.mjs +4 -1
  16. package/browser/esm2022/lib/decorators/classes/subscriber-decorator.mjs +5 -2
  17. package/browser/esm2022/lib/endpoint-context.mjs +83 -49
  18. package/browser/esm2022/lib/index.mjs +4 -1
  19. package/browser/esm2022/lib/inject.mjs +1 -1
  20. package/browser/esm2022/lib/models.mjs +30 -1
  21. package/browser/esm2022/lib/symbols.mjs +2 -1
  22. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/index.mjs +1 -3
  23. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.mjs +55 -37
  24. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin.service.mjs +17 -21
  25. package/browser/esm2022/lib/ui/taon-notifications/taon-notifications.module.mjs +1 -1
  26. package/browser/esm2022/lib/ui/taon-progress-bar/taon-progress-bar.component.mjs +1 -1
  27. package/browser/esm2022/lib/ui/taon-table/taon-table.component.mjs +1 -2
  28. package/browser/fesm2022/taon.mjs +688 -420
  29. package/browser/fesm2022/taon.mjs.map +1 -1
  30. package/browser/lib/base-classes/base-class.d.ts +1 -1
  31. package/browser/lib/base-classes/base-context.d.ts +3 -0
  32. package/browser/lib/base-classes/base-controller.d.ts +2 -1
  33. package/browser/lib/base-classes/base-migration.d.ts +12 -0
  34. package/browser/lib/base-classes/base.d.ts +5 -0
  35. package/browser/lib/context-db-migrations.d.ts +18 -0
  36. package/browser/lib/create-context.d.ts +4 -1
  37. package/browser/lib/decorators/classes/controller-decorator.d.ts +3 -0
  38. package/browser/lib/decorators/classes/entity-decorator.d.ts +3 -0
  39. package/browser/lib/decorators/classes/migration-decorator.d.ts +8 -0
  40. package/browser/lib/decorators/classes/provider-decorator.d.ts +3 -0
  41. package/browser/lib/decorators/classes/repository-decorator.d.ts +3 -0
  42. package/browser/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  43. package/browser/lib/endpoint-context.d.ts +12 -5
  44. package/browser/lib/index.d.ts +14 -1
  45. package/browser/lib/models.d.ts +44 -19
  46. package/browser/lib/symbols.d.ts +1 -0
  47. package/browser/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  48. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +5 -8
  49. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +8 -8
  50. package/client/esm2022/lib/base-classes/base-class.mjs +2 -2
  51. package/client/esm2022/lib/base-classes/base-controller.mjs +3 -2
  52. package/client/esm2022/lib/base-classes/base-migration.mjs +23 -0
  53. package/client/esm2022/lib/base-classes/base-subscriber-for-entity.mjs +20 -20
  54. package/client/esm2022/lib/base-classes/base.mjs +3 -1
  55. package/client/esm2022/lib/context-db-migrations.mjs +425 -0
  56. package/client/esm2022/lib/create-context.mjs +17 -4
  57. package/client/esm2022/lib/decorators/classes/controller-decorator.mjs +4 -1
  58. package/client/esm2022/lib/decorators/classes/entity-decorator.mjs +4 -1
  59. package/client/esm2022/lib/decorators/classes/migration-decorator.mjs +18 -0
  60. package/client/esm2022/lib/decorators/classes/provider-decorator.mjs +4 -1
  61. package/client/esm2022/lib/decorators/classes/repository-decorator.mjs +4 -1
  62. package/client/esm2022/lib/decorators/classes/subscriber-decorator.mjs +5 -2
  63. package/client/esm2022/lib/endpoint-context.mjs +83 -49
  64. package/client/esm2022/lib/index.mjs +4 -1
  65. package/client/esm2022/lib/inject.mjs +1 -1
  66. package/client/esm2022/lib/models.mjs +30 -1
  67. package/client/esm2022/lib/symbols.mjs +2 -1
  68. package/client/esm2022/lib/ui/taon-admin-mode-configuration/index.mjs +1 -3
  69. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.mjs +55 -37
  70. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin.service.mjs +17 -21
  71. package/client/esm2022/lib/ui/taon-notifications/taon-notifications.module.mjs +1 -1
  72. package/client/esm2022/lib/ui/taon-progress-bar/taon-progress-bar.component.mjs +1 -1
  73. package/client/esm2022/lib/ui/taon-table/taon-table.component.mjs +1 -2
  74. package/client/fesm2022/taon.mjs +688 -420
  75. package/client/fesm2022/taon.mjs.map +1 -1
  76. package/client/lib/base-classes/base-class.d.ts +1 -1
  77. package/client/lib/base-classes/base-context.d.ts +3 -0
  78. package/client/lib/base-classes/base-controller.d.ts +2 -1
  79. package/client/lib/base-classes/base-migration.d.ts +12 -0
  80. package/client/lib/base-classes/base.d.ts +5 -0
  81. package/client/lib/context-db-migrations.d.ts +18 -0
  82. package/client/lib/create-context.d.ts +4 -1
  83. package/client/lib/decorators/classes/controller-decorator.d.ts +3 -0
  84. package/client/lib/decorators/classes/entity-decorator.d.ts +3 -0
  85. package/client/lib/decorators/classes/migration-decorator.d.ts +8 -0
  86. package/client/lib/decorators/classes/provider-decorator.d.ts +3 -0
  87. package/client/lib/decorators/classes/repository-decorator.d.ts +3 -0
  88. package/client/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  89. package/client/lib/endpoint-context.d.ts +12 -5
  90. package/client/lib/index.d.ts +14 -1
  91. package/client/lib/models.d.ts +44 -19
  92. package/client/lib/symbols.d.ts +1 -0
  93. package/client/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  94. package/client/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +5 -8
  95. package/client/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +8 -8
  96. package/lib/base-classes/base-class.d.ts +1 -1
  97. package/lib/base-classes/base-class.js +1 -1
  98. package/lib/base-classes/base-context.d.ts +3 -0
  99. package/lib/base-classes/base-controller.d.ts +2 -1
  100. package/lib/base-classes/base-controller.js +2 -1
  101. package/lib/base-classes/base-controller.js.map +1 -1
  102. package/lib/base-classes/base-migration.d.ts +11 -0
  103. package/lib/base-classes/base-migration.js +41 -0
  104. package/lib/base-classes/base-migration.js.map +1 -0
  105. package/lib/base-classes/base-repository.js +4 -4
  106. package/lib/base-classes/base-repository.js.map +1 -1
  107. package/lib/base-classes/base-subscriber-for-entity.js +19 -19
  108. package/lib/base-classes/base-subscriber-for-entity.js.map +1 -1
  109. package/lib/base-classes/base.d.ts +5 -0
  110. package/lib/base-classes/base.js +2 -0
  111. package/lib/base-classes/base.js.map +1 -1
  112. package/lib/context-db-migrations.d.ts +17 -0
  113. package/lib/context-db-migrations.js +605 -0
  114. package/lib/context-db-migrations.js.map +1 -0
  115. package/lib/create-context.d.ts +4 -1
  116. package/lib/create-context.js +30 -21
  117. package/lib/create-context.js.map +1 -1
  118. package/lib/decorators/classes/controller-decorator.d.ts +3 -0
  119. package/lib/decorators/classes/controller-decorator.js +3 -0
  120. package/lib/decorators/classes/controller-decorator.js.map +1 -1
  121. package/lib/decorators/classes/entity-decorator.d.ts +3 -0
  122. package/lib/decorators/classes/entity-decorator.js +3 -0
  123. package/lib/decorators/classes/entity-decorator.js.map +1 -1
  124. package/lib/decorators/classes/migration-decorator.d.ts +7 -0
  125. package/lib/decorators/classes/migration-decorator.js +27 -0
  126. package/lib/decorators/classes/migration-decorator.js.map +1 -0
  127. package/lib/decorators/classes/provider-decorator.d.ts +3 -0
  128. package/lib/decorators/classes/provider-decorator.js +3 -0
  129. package/lib/decorators/classes/provider-decorator.js.map +1 -1
  130. package/lib/decorators/classes/repository-decorator.d.ts +3 -0
  131. package/lib/decorators/classes/repository-decorator.js +3 -0
  132. package/lib/decorators/classes/repository-decorator.js.map +1 -1
  133. package/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  134. package/lib/decorators/classes/subscriber-decorator.js +4 -1
  135. package/lib/decorators/classes/subscriber-decorator.js.map +1 -1
  136. package/lib/endpoint-context.d.ts +12 -5
  137. package/lib/endpoint-context.js +234 -189
  138. package/lib/endpoint-context.js.map +1 -1
  139. package/lib/index.d.ts +14 -1
  140. package/lib/index.js +5 -1
  141. package/lib/index.js.map +1 -1
  142. package/lib/inject.js +0 -2
  143. package/lib/inject.js.map +1 -1
  144. package/lib/models.d.ts +44 -19
  145. package/lib/models.js +45 -0
  146. package/lib/models.js.map +1 -1
  147. package/lib/symbols.d.ts +1 -0
  148. package/lib/symbols.js +1 -0
  149. package/lib/symbols.js.map +1 -1
  150. package/lib/ui/directives/index.js +2 -2
  151. package/lib/ui/index.js +2 -2
  152. package/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  153. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  154. package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +4 -7
  155. package/lib/ui/taon-admin-mode-configuration/{models/taon-admin-mode-tabs.js → taon-admin.models.js} +1 -1
  156. package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js.map +1 -0
  157. package/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +6 -6
  158. package/lib/ui/taon-github-fork-me-corner/index.js +2 -2
  159. package/lib/ui/taon-github-fork-me-ribbon/index.js +2 -2
  160. package/lib/ui/taon-notifications/taon-notifications.models.js +2 -2
  161. package/lib/ui/taon-progress-bar/index.js +2 -2
  162. package/lib/ui/taon-session-passcode/index.js +2 -2
  163. package/lib/ui/taon-table/index.js +2 -2
  164. package/migrations/index.d.ts +1 -0
  165. package/migrations/index.js +6 -0
  166. package/migrations/index.js.map +1 -0
  167. package/migrations/migrations_index._auto-generated_.d.ts +0 -0
  168. package/migrations/migrations_index._auto-generated_.js +4 -0
  169. package/migrations/migrations_index._auto-generated_.js.map +1 -0
  170. package/package.json +7 -7
  171. package/tmp-environment.json +32 -29
  172. package/websql/esm2022/lib/base-classes/base-class.mjs +2 -2
  173. package/websql/esm2022/lib/base-classes/base-controller.mjs +3 -2
  174. package/websql/esm2022/lib/base-classes/base-migration.mjs +23 -0
  175. package/websql/esm2022/lib/base-classes/base-repository.mjs +5 -5
  176. package/websql/esm2022/lib/base-classes/base-subscriber-for-entity.mjs +20 -20
  177. package/websql/esm2022/lib/base-classes/base.mjs +3 -1
  178. package/websql/esm2022/lib/context-db-migrations.mjs +274 -0
  179. package/websql/esm2022/lib/create-context.mjs +17 -4
  180. package/websql/esm2022/lib/decorators/classes/controller-decorator.mjs +4 -1
  181. package/websql/esm2022/lib/decorators/classes/entity-decorator.mjs +4 -1
  182. package/websql/esm2022/lib/decorators/classes/migration-decorator.mjs +18 -0
  183. package/websql/esm2022/lib/decorators/classes/provider-decorator.mjs +4 -1
  184. package/websql/esm2022/lib/decorators/classes/repository-decorator.mjs +4 -1
  185. package/websql/esm2022/lib/decorators/classes/subscriber-decorator.mjs +5 -2
  186. package/websql/esm2022/lib/endpoint-context.mjs +117 -85
  187. package/websql/esm2022/lib/index.mjs +4 -1
  188. package/websql/esm2022/lib/inject.mjs +1 -1
  189. package/websql/esm2022/lib/models.mjs +28 -1
  190. package/websql/esm2022/lib/symbols.mjs +2 -1
  191. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/index.mjs +1 -3
  192. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.mjs +55 -37
  193. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin.service.mjs +17 -21
  194. package/websql/esm2022/lib/ui/taon-notifications/taon-notifications.module.mjs +1 -1
  195. package/websql/esm2022/lib/ui/taon-progress-bar/taon-progress-bar.component.mjs +1 -1
  196. package/websql/esm2022/lib/ui/taon-table/taon-table.component.mjs +1 -2
  197. package/websql/fesm2022/taon.mjs +569 -460
  198. package/websql/fesm2022/taon.mjs.map +1 -1
  199. package/websql/lib/base-classes/base-class.d.ts +1 -1
  200. package/websql/lib/base-classes/base-context.d.ts +3 -0
  201. package/websql/lib/base-classes/base-controller.d.ts +2 -1
  202. package/websql/lib/base-classes/base-migration.d.ts +12 -0
  203. package/websql/lib/base-classes/base.d.ts +5 -0
  204. package/websql/lib/context-db-migrations.d.ts +18 -0
  205. package/websql/lib/create-context.d.ts +4 -1
  206. package/websql/lib/decorators/classes/controller-decorator.d.ts +3 -0
  207. package/websql/lib/decorators/classes/entity-decorator.d.ts +3 -0
  208. package/websql/lib/decorators/classes/migration-decorator.d.ts +8 -0
  209. package/websql/lib/decorators/classes/provider-decorator.d.ts +3 -0
  210. package/websql/lib/decorators/classes/repository-decorator.d.ts +3 -0
  211. package/websql/lib/decorators/classes/subscriber-decorator.d.ts +3 -0
  212. package/websql/lib/endpoint-context.d.ts +12 -5
  213. package/websql/lib/index.d.ts +14 -1
  214. package/websql/lib/models.d.ts +44 -19
  215. package/websql/lib/symbols.d.ts +1 -0
  216. package/websql/lib/ui/taon-admin-mode-configuration/index.d.ts +1 -3
  217. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +5 -8
  218. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +8 -8
  219. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.mjs +0 -5
  220. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.mjs +0 -115
  221. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.mjs +0 -50
  222. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.mjs +0 -5
  223. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.mjs +0 -61
  224. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.mjs +0 -21
  225. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.mjs +0 -4
  226. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.mjs +0 -32
  227. package/browser/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.mjs +0 -54
  228. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -3
  229. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -33
  230. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -16
  231. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -3
  232. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -17
  233. package/browser/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -10
  234. package/browser/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +0 -6
  235. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -18
  236. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -17
  237. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.mjs +0 -5
  238. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.mjs +0 -115
  239. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.mjs +0 -50
  240. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.mjs +0 -5
  241. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.mjs +0 -61
  242. package/client/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.mjs +0 -21
  243. package/client/esm2022/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.mjs +0 -4
  244. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.mjs +0 -32
  245. package/client/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.mjs +0 -54
  246. package/client/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -3
  247. package/client/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -33
  248. package/client/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -16
  249. package/client/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -3
  250. package/client/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -17
  251. package/client/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -10
  252. package/client/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +0 -6
  253. package/client/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -18
  254. package/client/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -17
  255. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -2
  256. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js +0 -5
  257. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js.map +0 -1
  258. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -29
  259. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -2
  260. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.d.ts +0 -1
  261. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js +0 -5
  262. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js.map +0 -1
  263. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/taon-db-admin.component.d.ts +0 -8
  264. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -2
  265. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js +0 -5
  266. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js.map +0 -1
  267. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -13
  268. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -2
  269. package/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.js.map +0 -1
  270. package/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -14
  271. package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -2
  272. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.mjs +0 -5
  273. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.mjs +0 -115
  274. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.mjs +0 -50
  275. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.mjs +0 -5
  276. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.mjs +0 -61
  277. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.mjs +0 -21
  278. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.mjs +0 -4
  279. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.mjs +0 -32
  280. package/websql/esm2022/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.mjs +0 -54
  281. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -3
  282. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -33
  283. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -16
  284. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -3
  285. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -17
  286. package/websql/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -10
  287. package/websql/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +0 -6
  288. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -18
  289. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -17
  290. /package/lib/ui/taon-admin-mode-configuration/{models/taon-admin-mode-tabs.d.ts → taon-admin.models.d.ts} +0 -0
@@ -0,0 +1,605 @@
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*/, 6];
94
+ this.ctx.logMigrations &&
95
+ console.log("Table ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, " already exists."));
96
+ return [4 /*yield*/, queryRunner.commitTransaction()];
97
+ case 4:
98
+ _a.sent();
99
+ return [4 /*yield*/, queryRunner.release()];
100
+ case 5:
101
+ _a.sent();
102
+ return [2 /*return*/]; // Exit early if the table exists
103
+ case 6:
104
+ _a.trys.push([6, 10, 12, 14]);
105
+ return [4 /*yield*/, queryRunner.createTable(this.table)];
106
+ case 7:
107
+ _a.sent();
108
+ return [4 /*yield*/, queryRunner.createIndex(this.DEFAULT_MIGRATION_TABLE_NAME, new taon_typeorm_1.TableIndex({
109
+ name: 'IDX_NAME',
110
+ columnNames: ['name'],
111
+ }))];
112
+ case 8:
113
+ _a.sent();
114
+ return [4 /*yield*/, queryRunner.commitTransaction()];
115
+ case 9:
116
+ _a.sent();
117
+ return [3 /*break*/, 14];
118
+ case 10:
119
+ error_1 = _a.sent();
120
+ this.ctx.logMigrations &&
121
+ console.error("Transaction failed [ensureMigrationTableExists]" + ", rolling back:", error_1);
122
+ return [4 /*yield*/, queryRunner.rollbackTransaction()];
123
+ case 11:
124
+ _a.sent();
125
+ return [3 /*break*/, 14];
126
+ case 12: return [4 /*yield*/, queryRunner.release()];
127
+ case 13:
128
+ _a.sent();
129
+ return [7 /*endfinally*/];
130
+ case 14: return [2 /*return*/];
131
+ }
132
+ });
133
+ });
134
+ };
135
+ //#endregion
136
+ //#region methods & getters / revert migration to timestamp
137
+ ContextDbMigrations.prototype.logSelectALl = function (name, queryRunner) {
138
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
139
+ var _a, _b, _c;
140
+ return tslib_1.__generator(this, function (_d) {
141
+ switch (_d.label) {
142
+ case 0:
143
+ _b = (_a = console).log;
144
+ _c = [name];
145
+ return [4 /*yield*/, queryRunner.query("SELECT * FROM ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, " WHERE context = $1"), [this.ctx.contextName])];
146
+ case 1:
147
+ _b.apply(_a, _c.concat([(_d.sent()).map(function (m) { return m.name; })]));
148
+ return [2 /*return*/];
149
+ }
150
+ });
151
+ });
152
+ };
153
+ ContextDbMigrations.prototype.revertMigrationToTimestamp = function (timestamp) {
154
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
155
+ var migrationsClassFns, migrationClassesInstancesToRevert, queryRunner, appliedMigrationsForContext, appliedMigrationsForContextNames, migrationClassesInstancesToRevert_1, migrationClassesInstancesToRevert_1_1, migrationClassInstance, migrationName, e_1_1, error_2;
156
+ var e_1, _a;
157
+ var _this = this;
158
+ return tslib_1.__generator(this, function (_b) {
159
+ switch (_b.label) {
160
+ case 0:
161
+ //#region @websqlFunc
162
+ if (this.ctx.remoteHost) {
163
+ return [2 /*return*/];
164
+ }
165
+ if (!tnp_core_1.UtilsMigrations.isValidTimestamp(timestamp)) {
166
+ tnp_core_1.Helpers.throw("Invalid timestamp provided for migration revert: ".concat(timestamp));
167
+ }
168
+ migrationsClassFns = this.ctx
169
+ .getClassFunByArr(models_1.Models.ClassType.MIGRATION)
170
+ .reverse();
171
+ migrationClassesInstancesToRevert = migrationsClassFns
172
+ .map(function (classFn) {
173
+ var timestampFromClassName = Number(tnp_core_1.UtilsMigrations.getTimestampFromClassName(class_helpers_1.ClassHelpers.getName(classFn)));
174
+ if (timestampFromClassName <= timestamp) {
175
+ // this.ctx.logMigrations &&
176
+ // console.log(
177
+ // `Stopping migration filter at: ${ClassHelpers.getName(classFn)} ` +
178
+ // `with timestamp ${timestampFromClassName}`,
179
+ // );
180
+ return null;
181
+ }
182
+ return _this.ctx.getInstanceBy(classFn);
183
+ })
184
+ .filter(function (f) { return !!f; })
185
+ .map(function (f) { return f; })
186
+ .filter(function (migrationInstance) { return migrationInstance.isReadyToRun(); });
187
+ queryRunner = this.ctx.connection.createQueryRunner();
188
+ return [4 /*yield*/, queryRunner.connect()];
189
+ case 1:
190
+ _b.sent();
191
+ _b.label = 2;
192
+ case 2:
193
+ _b.trys.push([2, 15, 17, 19]);
194
+ return [4 /*yield*/, queryRunner.startTransaction()];
195
+ case 3:
196
+ _b.sent();
197
+ 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])];
198
+ case 4:
199
+ appliedMigrationsForContext = _b.sent();
200
+ appliedMigrationsForContextNames = appliedMigrationsForContext.map(function (m) { return m.name; });
201
+ _b.label = 5;
202
+ case 5:
203
+ _b.trys.push([5, 11, 12, 13]);
204
+ migrationClassesInstancesToRevert_1 = tslib_1.__values(migrationClassesInstancesToRevert), migrationClassesInstancesToRevert_1_1 = migrationClassesInstancesToRevert_1.next();
205
+ _b.label = 6;
206
+ case 6:
207
+ if (!!migrationClassesInstancesToRevert_1_1.done) return [3 /*break*/, 10];
208
+ migrationClassInstance = migrationClassesInstancesToRevert_1_1.value;
209
+ migrationName = class_helpers_1.ClassHelpers.getName(migrationClassInstance);
210
+ if (!appliedMigrationsForContextNames.includes(migrationName)) {
211
+ this.ctx.logMigrations &&
212
+ console.warn("Skipping migration not marked as applied: ".concat(migrationName));
213
+ return [3 /*break*/, 9];
214
+ }
215
+ this.ctx.logMigrations &&
216
+ console.log("Reverting migration: ".concat(migrationName, " , context: ").concat(this.ctx.contextName));
217
+ return [4 /*yield*/, migrationClassInstance.down(queryRunner)];
218
+ case 7:
219
+ _b.sent();
220
+ // Remove the reverted migration from the tracking table
221
+ return [4 /*yield*/, queryRunner.query("DELETE FROM ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, " WHERE name = $1"), [migrationName])];
222
+ case 8:
223
+ // Remove the reverted migration from the tracking table
224
+ _b.sent();
225
+ _b.label = 9;
226
+ case 9:
227
+ migrationClassesInstancesToRevert_1_1 = migrationClassesInstancesToRevert_1.next();
228
+ return [3 /*break*/, 6];
229
+ case 10: return [3 /*break*/, 13];
230
+ case 11:
231
+ e_1_1 = _b.sent();
232
+ e_1 = { error: e_1_1 };
233
+ return [3 /*break*/, 13];
234
+ case 12:
235
+ try {
236
+ if (migrationClassesInstancesToRevert_1_1 && !migrationClassesInstancesToRevert_1_1.done && (_a = migrationClassesInstancesToRevert_1.return)) _a.call(migrationClassesInstancesToRevert_1);
237
+ }
238
+ finally { if (e_1) throw e_1.error; }
239
+ return [7 /*endfinally*/];
240
+ case 13: return [4 /*yield*/, queryRunner.commitTransaction()];
241
+ case 14:
242
+ _b.sent();
243
+ this.ctx.logMigrations &&
244
+ console.log("Migrations successfully reverted " +
245
+ "to the specified timestamp ".concat(timestamp, " ."));
246
+ return [3 /*break*/, 19];
247
+ case 15:
248
+ error_2 = _b.sent();
249
+ this.ctx.logMigrations &&
250
+ console.error('Transaction failed, rolling back:', error_2);
251
+ return [4 /*yield*/, queryRunner.rollbackTransaction()];
252
+ case 16:
253
+ _b.sent();
254
+ return [3 /*break*/, 19];
255
+ case 17: return [4 /*yield*/, queryRunner.release()];
256
+ case 18:
257
+ _b.sent();
258
+ return [7 /*endfinally*/];
259
+ case 19: return [2 /*return*/];
260
+ }
261
+ });
262
+ });
263
+ };
264
+ //#endregion
265
+ //#region methods & getters / clear migration table
266
+ ContextDbMigrations.prototype.clearMigrationTable = function () {
267
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
268
+ var queryRunner, error_3;
269
+ return tslib_1.__generator(this, function (_a) {
270
+ switch (_a.label) {
271
+ case 0:
272
+ //#region @websqlFunc
273
+ if (this.ctx.remoteHost) {
274
+ return [2 /*return*/];
275
+ }
276
+ queryRunner = this.ctx.connection.createQueryRunner();
277
+ return [4 /*yield*/, queryRunner.connect()];
278
+ case 1:
279
+ _a.sent();
280
+ return [4 /*yield*/, queryRunner.startTransaction()];
281
+ case 2:
282
+ _a.sent();
283
+ _a.label = 3;
284
+ case 3:
285
+ _a.trys.push([3, 6, 8, 10]);
286
+ return [4 /*yield*/, queryRunner.clearTable(this.DEFAULT_MIGRATION_TABLE_NAME)];
287
+ case 4:
288
+ _a.sent();
289
+ return [4 /*yield*/, queryRunner.commitTransaction()];
290
+ case 5:
291
+ _a.sent();
292
+ return [3 /*break*/, 10];
293
+ case 6:
294
+ error_3 = _a.sent();
295
+ this.ctx.logMigrations &&
296
+ console.error('Transaction failed, rolling back:', error_3);
297
+ return [4 /*yield*/, queryRunner.rollbackTransaction()];
298
+ case 7:
299
+ _a.sent();
300
+ return [3 /*break*/, 10];
301
+ case 8: return [4 /*yield*/, queryRunner.release()];
302
+ case 9:
303
+ _a.sent();
304
+ return [7 /*endfinally*/];
305
+ case 10: return [2 /*return*/];
306
+ }
307
+ });
308
+ });
309
+ };
310
+ //#endregion
311
+ //#region methods & getters / mark all migrations as applied
312
+ ContextDbMigrations.prototype.markAllMigrationsAsApplied = function () {
313
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
314
+ var migrationsClassFns, migrationClassesInstances, queryRunner, allMigrationsInDb, allMigrationInDBNames, migrationClassesInstances_1, migrationClassesInstances_1_1, instance, migrationName, e_2_1, error_4;
315
+ var e_2, _a;
316
+ var _this = this;
317
+ return tslib_1.__generator(this, function (_b) {
318
+ switch (_b.label) {
319
+ case 0:
320
+ //#region @websqlFunc
321
+ if (this.ctx.remoteHost) {
322
+ return [2 /*return*/];
323
+ }
324
+ migrationsClassFns = this.ctx.getClassFunByArr(models_1.Models.ClassType.MIGRATION);
325
+ migrationClassesInstances = migrationsClassFns
326
+ .map(function (classFn) { return _this.ctx.getInstanceBy(classFn); })
327
+ .map(function (f) { return f; })
328
+ .filter(function (migrationInstance) { return migrationInstance.isReadyToRun(); });
329
+ queryRunner = this.ctx.connection.createQueryRunner();
330
+ return [4 /*yield*/, queryRunner.connect()];
331
+ case 1:
332
+ _b.sent();
333
+ _b.label = 2;
334
+ case 2:
335
+ _b.trys.push([2, 15, 17, 19]);
336
+ return [4 /*yield*/, queryRunner.startTransaction()];
337
+ case 3:
338
+ _b.sent();
339
+ return [4 /*yield*/, queryRunner.query("SELECT name FROM ".concat(this.DEFAULT_MIGRATION_TABLE_NAME))];
340
+ case 4:
341
+ allMigrationsInDb = _b.sent();
342
+ allMigrationInDBNames = allMigrationsInDb.map(function (m) { return m.name; });
343
+ _b.label = 5;
344
+ case 5:
345
+ _b.trys.push([5, 10, 11, 12]);
346
+ migrationClassesInstances_1 = tslib_1.__values(migrationClassesInstances), migrationClassesInstances_1_1 = migrationClassesInstances_1.next();
347
+ _b.label = 6;
348
+ case 6:
349
+ if (!!migrationClassesInstances_1_1.done) return [3 /*break*/, 9];
350
+ instance = migrationClassesInstances_1_1.value;
351
+ migrationName = class_helpers_1.ClassHelpers.getName(instance);
352
+ if (allMigrationInDBNames.includes(migrationName)) {
353
+ this.ctx.logMigrations &&
354
+ console.log("Skipping already applied migration: ".concat(migrationName));
355
+ return [3 /*break*/, 8];
356
+ }
357
+ this.ctx.logMigrations &&
358
+ console.log("Marking migration as applied: ".concat(migrationName));
359
+ // Insert migration as 'complete' without running
360
+ return [4 /*yield*/, queryRunner.query("INSERT INTO ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, " (name, status, context, applied_at) ") +
361
+ "VALUES ($1, $2, $3, CURRENT_TIMESTAMP)", [
362
+ migrationName,
363
+ this.MIGRATION_STATUS_COMPLETED,
364
+ instance.ctx.contextName,
365
+ ])];
366
+ case 7:
367
+ // Insert migration as 'complete' without running
368
+ _b.sent();
369
+ _b.label = 8;
370
+ case 8:
371
+ migrationClassesInstances_1_1 = migrationClassesInstances_1.next();
372
+ return [3 /*break*/, 6];
373
+ case 9: return [3 /*break*/, 12];
374
+ case 10:
375
+ e_2_1 = _b.sent();
376
+ e_2 = { error: e_2_1 };
377
+ return [3 /*break*/, 12];
378
+ case 11:
379
+ try {
380
+ if (migrationClassesInstances_1_1 && !migrationClassesInstances_1_1.done && (_a = migrationClassesInstances_1.return)) _a.call(migrationClassesInstances_1);
381
+ }
382
+ finally { if (e_2) throw e_2.error; }
383
+ return [7 /*endfinally*/];
384
+ case 12:
385
+ // update all pending migrations to completed
386
+ 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])];
387
+ case 13:
388
+ // update all pending migrations to completed
389
+ _b.sent();
390
+ return [4 /*yield*/, queryRunner.commitTransaction()];
391
+ case 14:
392
+ _b.sent();
393
+ this.ctx.logMigrations &&
394
+ console.log('All migrations marked as applied.');
395
+ return [3 /*break*/, 19];
396
+ case 15:
397
+ error_4 = _b.sent();
398
+ this.ctx.logMigrations &&
399
+ console.error('Failed to mark all migrations as applied, rolling back:', error_4);
400
+ return [4 /*yield*/, queryRunner.rollbackTransaction()];
401
+ case 16:
402
+ _b.sent();
403
+ return [3 /*break*/, 19];
404
+ case 17: return [4 /*yield*/, queryRunner.release()];
405
+ case 18:
406
+ _b.sent();
407
+ return [7 /*endfinally*/];
408
+ case 19: return [2 /*return*/];
409
+ }
410
+ });
411
+ });
412
+ };
413
+ //#endregion
414
+ //#region methods & getters / run all migrations
415
+ ContextDbMigrations.prototype.runAllNotCompletedMigrations = function () {
416
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
417
+ 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;
418
+ var e_3, _a, e_4, _b;
419
+ var _this = this;
420
+ return tslib_1.__generator(this, function (_c) {
421
+ switch (_c.label) {
422
+ case 0:
423
+ //#region @websqlFunc
424
+ if (this.ctx.remoteHost) {
425
+ return [2 /*return*/];
426
+ }
427
+ migrationsClassFns = this.ctx.getClassFunByArr(models_1.Models.ClassType.MIGRATION);
428
+ migrationClassesInstances = migrationsClassFns
429
+ .map(function (classFn) { return _this.ctx.getInstanceBy(classFn); })
430
+ .map(function (f) { return f; })
431
+ .filter(function (migrationInstance) { return migrationInstance.isReadyToRun(); });
432
+ queryRunner = this.ctx.connection.createQueryRunner();
433
+ return [4 /*yield*/, queryRunner.connect()];
434
+ case 1:
435
+ _c.sent();
436
+ _c.label = 2;
437
+ case 2:
438
+ _c.trys.push([2, 22, 24, 26]);
439
+ return [4 /*yield*/, queryRunner.startTransaction()];
440
+ case 3:
441
+ _c.sent();
442
+ return [4 /*yield*/, queryRunner.query("SELECT name, status FROM ".concat(this.DEFAULT_MIGRATION_TABLE_NAME, " ") +
443
+ "WHERE context = $1", [this.ctx.contextName])];
444
+ case 4:
445
+ appliedMigrationsForContext = _c.sent();
446
+ pendingMigrationsForContext = appliedMigrationsForContext.filter(function (m) { return m.status === _this.MIGRATION_STATUS_PENDING; });
447
+ _loop_1 = function (pendingContextMigration) {
448
+ var migrationInstance;
449
+ return tslib_1.__generator(this, function (_d) {
450
+ switch (_d.label) {
451
+ case 0:
452
+ migrationInstance = migrationClassesInstances.find(function (instance) {
453
+ return class_helpers_1.ClassHelpers.getName(instance) === pendingContextMigration.name;
454
+ });
455
+ if (!migrationInstance) {
456
+ this_1.ctx.logMigrations &&
457
+ console.warn("Pending migration ".concat(pendingContextMigration.name, " not found in loaded migrations."));
458
+ return [2 /*return*/, "continue"];
459
+ }
460
+ this_1.ctx.logMigrations &&
461
+ console.log("Completing pending migration: ".concat(pendingContextMigration.name));
462
+ return [4 /*yield*/, migrationInstance.up(queryRunner)];
463
+ case 1:
464
+ _d.sent();
465
+ // Update migration status to 'complete'
466
+ 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])];
467
+ case 2:
468
+ // Update migration status to 'complete'
469
+ _d.sent();
470
+ return [2 /*return*/];
471
+ }
472
+ });
473
+ };
474
+ this_1 = this;
475
+ _c.label = 5;
476
+ case 5:
477
+ _c.trys.push([5, 10, 11, 12]);
478
+ pendingMigrationsForContext_1 = tslib_1.__values(pendingMigrationsForContext), pendingMigrationsForContext_1_1 = pendingMigrationsForContext_1.next();
479
+ _c.label = 6;
480
+ case 6:
481
+ if (!!pendingMigrationsForContext_1_1.done) return [3 /*break*/, 9];
482
+ pendingContextMigration = pendingMigrationsForContext_1_1.value;
483
+ return [5 /*yield**/, _loop_1(pendingContextMigration)];
484
+ case 7:
485
+ _c.sent();
486
+ _c.label = 8;
487
+ case 8:
488
+ pendingMigrationsForContext_1_1 = pendingMigrationsForContext_1.next();
489
+ return [3 /*break*/, 6];
490
+ case 9: return [3 /*break*/, 12];
491
+ case 10:
492
+ e_3_1 = _c.sent();
493
+ e_3 = { error: e_3_1 };
494
+ return [3 /*break*/, 12];
495
+ case 11:
496
+ try {
497
+ if (pendingMigrationsForContext_1_1 && !pendingMigrationsForContext_1_1.done && (_a = pendingMigrationsForContext_1.return)) _a.call(pendingMigrationsForContext_1);
498
+ }
499
+ finally { if (e_3) throw e_3.error; }
500
+ return [7 /*endfinally*/];
501
+ case 12:
502
+ _loop_2 = function (instance) {
503
+ var migrationName, error_6;
504
+ return tslib_1.__generator(this, function (_e) {
505
+ switch (_e.label) {
506
+ case 0:
507
+ migrationName = class_helpers_1.ClassHelpers.getName(instance);
508
+ if (appliedMigrationsForContext.some(function (m) { return m.name === migrationName; })) {
509
+ this_2.ctx.logMigrations &&
510
+ console.log("Skipping already applied migration: ".concat(migrationName));
511
+ return [2 /*return*/, "continue"];
512
+ }
513
+ this_2.ctx.logMigrations &&
514
+ console.log("Applying new migration: ".concat(migrationName));
515
+ // Insert migration as 'pending' before execution
516
+ return [4 /*yield*/, queryRunner.query("INSERT INTO ".concat(this_2.DEFAULT_MIGRATION_TABLE_NAME, " (name, status, context, applied_at) ") +
517
+ "VALUES ($1, $2, $3, NULL)", [migrationName, this_2.MIGRATION_STATUS_PENDING, this_2.ctx.contextName])];
518
+ case 1:
519
+ // Insert migration as 'pending' before execution
520
+ _e.sent();
521
+ _e.label = 2;
522
+ case 2:
523
+ _e.trys.push([2, 5, , 7]);
524
+ // Apply migration
525
+ return [4 /*yield*/, instance.up(queryRunner)];
526
+ case 3:
527
+ // Apply migration
528
+ _e.sent();
529
+ // Update migration to 'complete' after successful execution
530
+ return [4 /*yield*/, queryRunner.query("UPDATE ".concat(this_2.DEFAULT_MIGRATION_TABLE_NAME, " ") +
531
+ "SET status = '".concat(this_2.MIGRATION_STATUS_COMPLETED, "', applied_at = CURRENT_TIMESTAMP ") +
532
+ "WHERE name = $1", [migrationName])];
533
+ case 4:
534
+ // Update migration to 'complete' after successful execution
535
+ _e.sent();
536
+ return [3 /*break*/, 7];
537
+ case 5:
538
+ error_6 = _e.sent();
539
+ this_2.ctx.logMigrations &&
540
+ console.error("Failed to apply migration: ".concat(migrationName), error_6);
541
+ // Rollback pending migration entry
542
+ return [4 /*yield*/, queryRunner.query("DELETE FROM ".concat(this_2.DEFAULT_MIGRATION_TABLE_NAME, " WHERE name = $1"), [migrationName])];
543
+ case 6:
544
+ // Rollback pending migration entry
545
+ _e.sent();
546
+ throw error_6; // Rethrow to ensure the transaction is rolled back
547
+ case 7: return [2 /*return*/];
548
+ }
549
+ });
550
+ };
551
+ this_2 = this;
552
+ _c.label = 13;
553
+ case 13:
554
+ _c.trys.push([13, 18, 19, 20]);
555
+ migrationClassesInstances_2 = tslib_1.__values(migrationClassesInstances), migrationClassesInstances_2_1 = migrationClassesInstances_2.next();
556
+ _c.label = 14;
557
+ case 14:
558
+ if (!!migrationClassesInstances_2_1.done) return [3 /*break*/, 17];
559
+ instance = migrationClassesInstances_2_1.value;
560
+ return [5 /*yield**/, _loop_2(instance)];
561
+ case 15:
562
+ _c.sent();
563
+ _c.label = 16;
564
+ case 16:
565
+ migrationClassesInstances_2_1 = migrationClassesInstances_2.next();
566
+ return [3 /*break*/, 14];
567
+ case 17: return [3 /*break*/, 20];
568
+ case 18:
569
+ e_4_1 = _c.sent();
570
+ e_4 = { error: e_4_1 };
571
+ return [3 /*break*/, 20];
572
+ case 19:
573
+ try {
574
+ if (migrationClassesInstances_2_1 && !migrationClassesInstances_2_1.done && (_b = migrationClassesInstances_2.return)) _b.call(migrationClassesInstances_2);
575
+ }
576
+ finally { if (e_4) throw e_4.error; }
577
+ return [7 /*endfinally*/];
578
+ case 20:
579
+ //#endregion
580
+ return [4 /*yield*/, queryRunner.commitTransaction()];
581
+ case 21:
582
+ //#endregion
583
+ _c.sent();
584
+ return [3 /*break*/, 26];
585
+ case 22:
586
+ error_5 = _c.sent();
587
+ this.ctx.logMigrations &&
588
+ console.error('Transaction failed, rolling back:', error_5);
589
+ return [4 /*yield*/, queryRunner.rollbackTransaction()];
590
+ case 23:
591
+ _c.sent();
592
+ return [3 /*break*/, 26];
593
+ case 24: return [4 /*yield*/, queryRunner.release()];
594
+ case 25:
595
+ _c.sent();
596
+ return [7 /*endfinally*/];
597
+ case 26: return [2 /*return*/];
598
+ }
599
+ });
600
+ });
601
+ };
602
+ return ContextDbMigrations;
603
+ }());
604
+ exports.ContextDbMigrations = ContextDbMigrations;
605
+ //# sourceMappingURL=context-db-migrations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-db-migrations.js","s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M,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,AAhdD,IAgdC;AAhdY,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;
@@ -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