taon 21.0.18 → 21.0.29

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 (412) hide show
  1. package/README.md +11 -2
  2. package/browser/fesm2022/taon-browser.mjs +1167 -1011
  3. package/browser/fesm2022/taon-browser.mjs.map +1 -1
  4. package/browser/package.json +1 -1
  5. package/browser/types/taon-browser.d.ts +7 -3
  6. package/browser-prod/README.md +24 -0
  7. package/browser-prod/fesm2022/taon-browser.mjs +8367 -0
  8. package/browser-prod/fesm2022/taon-browser.mjs.map +1 -0
  9. package/browser-prod/types/taon-browser.d.ts +2178 -0
  10. package/lib/base-classes/base-context.js +4 -0
  11. package/lib/base-classes/base-context.js.map +1 -1
  12. package/lib/build-info._auto-generated_.d.ts +5 -1
  13. package/lib/build-info._auto-generated_.js +6 -2
  14. package/lib/build-info._auto-generated_.js.map +1 -1
  15. package/lib/decorators/classes/middleware-decorator.d.ts +1 -0
  16. package/lib/decorators/classes/middleware-decorator.js +1 -0
  17. package/lib/decorators/classes/middleware-decorator.js.map +1 -1
  18. package/lib/decorators/classes/subscriber-decorator.d.ts +1 -1
  19. package/lib/decorators/classes/subscriber-decorator.js.map +1 -1
  20. package/lib/env/env.angular-node-app.d.ts +30 -28
  21. package/lib/env/env.angular-node-app.js +32 -30
  22. package/lib/env/env.angular-node-app.js.map +1 -1
  23. package/lib/env/env.docs-webapp.d.ts +30 -28
  24. package/lib/env/env.docs-webapp.js +32 -30
  25. package/lib/env/env.docs-webapp.js.map +1 -1
  26. package/lib/env/env.electron-app.d.ts +30 -28
  27. package/lib/env/env.electron-app.js +32 -30
  28. package/lib/env/env.electron-app.js.map +1 -1
  29. package/lib/env/env.mobile-app.d.ts +30 -28
  30. package/lib/env/env.mobile-app.js +32 -30
  31. package/lib/env/env.mobile-app.js.map +1 -1
  32. package/lib/env/env.npm-lib-and-cli-tool.d.ts +30 -28
  33. package/lib/env/env.npm-lib-and-cli-tool.js +32 -30
  34. package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
  35. package/lib/env/env.vscode-plugin.d.ts +30 -28
  36. package/lib/env/env.vscode-plugin.js +32 -30
  37. package/lib/env/env.vscode-plugin.js.map +1 -1
  38. package/lib/formly/type-from-entity.js +9 -9
  39. package/lib/formly/type-from-entity.js.map +1 -1
  40. package/lib/global-state/taon-global-state/index.d.ts +6 -0
  41. package/lib/global-state/taon-global-state/index.js +23 -0
  42. package/lib/global-state/taon-global-state/index.js.map +1 -0
  43. package/lib/global-state/taon-global-state/taon-global-state-api.service.d.ts +7 -0
  44. package/lib/global-state/taon-global-state/taon-global-state.abstract.context.d.ts +19 -0
  45. package/lib/global-state/taon-global-state/taon-global-state.abstract.context.js +23 -0
  46. package/lib/global-state/taon-global-state/taon-global-state.abstract.context.js.map +1 -0
  47. package/lib/global-state/taon-global-state/taon-global-state.constants.d.ts +2 -0
  48. package/lib/global-state/taon-global-state/taon-global-state.constants.js +11 -0
  49. package/lib/global-state/taon-global-state/taon-global-state.constants.js.map +1 -0
  50. package/lib/global-state/taon-global-state/taon-global-state.controller.d.ts +11 -0
  51. package/lib/global-state/taon-global-state/taon-global-state.controller.js +62 -0
  52. package/lib/global-state/taon-global-state/taon-global-state.controller.js.map +1 -0
  53. package/lib/global-state/taon-global-state/taon-global-state.entity.d.ts +7 -0
  54. package/lib/global-state/taon-global-state/taon-global-state.entity.js +64 -0
  55. package/lib/global-state/taon-global-state/taon-global-state.entity.js.map +1 -0
  56. package/lib/global-state/taon-global-state/taon-global-state.middleware.d.ts +3 -0
  57. package/lib/global-state/taon-global-state/taon-global-state.middleware.js +22 -0
  58. package/lib/global-state/taon-global-state/taon-global-state.middleware.js.map +1 -0
  59. package/lib/global-state/taon-global-state/taon-global-state.models.d.ts +28 -0
  60. package/lib/global-state/taon-global-state/taon-global-state.models.js +48 -0
  61. package/lib/global-state/taon-global-state/taon-global-state.models.js.map +1 -0
  62. package/lib/global-state/taon-global-state/taon-global-state.provider.d.ts +3 -0
  63. package/lib/global-state/taon-global-state/taon-global-state.provider.js +22 -0
  64. package/lib/global-state/taon-global-state/taon-global-state.provider.js.map +1 -0
  65. package/lib/global-state/taon-global-state/taon-global-state.repository.d.ts +9 -0
  66. package/lib/global-state/taon-global-state/taon-global-state.repository.js +53 -0
  67. package/lib/global-state/taon-global-state/taon-global-state.repository.js.map +1 -0
  68. package/lib/global-state/taon-global-state/taon-global-state.subscriber.d.ts +7 -0
  69. package/lib/global-state/taon-global-state/taon-global-state.subscriber.js +29 -0
  70. package/lib/global-state/taon-global-state/taon-global-state.subscriber.js.map +1 -0
  71. package/lib/global-state/taon-global-state/taon-global-state.utils.d.ts +4 -0
  72. package/lib/global-state/taon-global-state/taon-global-state.utils.js +16 -0
  73. package/lib/global-state/taon-global-state/taon-global-state.utils.js.map +1 -0
  74. package/lib/global-state/taon-transaction-registry/index.d.ts +11 -0
  75. package/lib/global-state/taon-transaction-registry/index.js +28 -0
  76. package/lib/global-state/taon-transaction-registry/index.js.map +1 -0
  77. package/lib/global-state/taon-transaction-registry/taon-transaction-registry-api.service.d.ts +7 -0
  78. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.d.ts +19 -0
  79. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.js +25 -0
  80. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.js.map +1 -0
  81. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.constants.d.ts +2 -0
  82. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.constants.js +9 -0
  83. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.constants.js.map +1 -0
  84. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.controller.d.ts +9 -0
  85. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.controller.js +52 -0
  86. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.controller.js.map +1 -0
  87. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.entity.d.ts +12 -0
  88. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.entity.js +77 -0
  89. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.entity.js.map +1 -0
  90. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.middleware.d.ts +3 -0
  91. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.middleware.js +22 -0
  92. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.middleware.js.map +1 -0
  93. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.models.d.ts +6 -0
  94. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.models.js +11 -0
  95. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.models.js.map +1 -0
  96. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.provider.d.ts +3 -0
  97. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.provider.js +22 -0
  98. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.provider.js.map +1 -0
  99. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.repository.d.ts +9 -0
  100. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.repository.js +38 -0
  101. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.repository.js.map +1 -0
  102. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.subscriber.d.ts +7 -0
  103. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.subscriber.js +29 -0
  104. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.subscriber.js.map +1 -0
  105. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.utils.d.ts +4 -0
  106. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.utils.js +11 -0
  107. package/lib/global-state/taon-transaction-registry/taon-transaction-registry.utils.js.map +1 -0
  108. package/lib/orm/columns.d.ts +5 -1
  109. package/lib/orm/columns.js +12 -2
  110. package/lib/orm/columns.js.map +1 -1
  111. package/lib/ui/index.js +2 -2
  112. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  113. package/lib-prod/base-classes/base-abstract-entity.d.ts +7 -0
  114. package/lib-prod/base-classes/base-abstract-entity.js +42 -0
  115. package/lib-prod/base-classes/base-abstract-entity.js.map +1 -0
  116. package/lib-prod/base-classes/base-angular-service.d.ts +27 -0
  117. package/lib-prod/base-classes/base-angular-service.js +89 -0
  118. package/lib-prod/base-classes/base-angular-service.js.map +1 -0
  119. package/lib-prod/base-classes/base-class.d.ts +15 -0
  120. package/lib-prod/base-classes/base-class.js +40 -0
  121. package/lib-prod/base-classes/base-class.js.map +1 -0
  122. package/lib-prod/base-classes/base-context.d.ts +20 -0
  123. package/lib-prod/base-classes/base-context.js +23 -0
  124. package/lib-prod/base-classes/base-context.js.map +1 -0
  125. package/lib-prod/base-classes/base-controller.d.ts +83 -0
  126. package/lib-prod/base-classes/base-controller.js +173 -0
  127. package/lib-prod/base-classes/base-controller.js.map +1 -0
  128. package/lib-prod/base-classes/base-crud-controller.d.ts +28 -0
  129. package/lib-prod/base-classes/base-crud-controller.js +319 -0
  130. package/lib-prod/base-classes/base-crud-controller.js.map +1 -0
  131. package/lib-prod/base-classes/base-custom-repository.d.ts +3 -0
  132. package/lib-prod/base-classes/base-custom-repository.js +19 -0
  133. package/lib-prod/base-classes/base-custom-repository.js.map +1 -0
  134. package/lib-prod/base-classes/base-electron-service.d.ts +0 -0
  135. package/lib-prod/base-classes/base-electron-service.js +50 -0
  136. package/lib-prod/base-classes/base-electron-service.js.map +1 -0
  137. package/lib-prod/base-classes/base-entity.d.ts +16 -0
  138. package/lib-prod/base-classes/base-entity.js +32 -0
  139. package/lib-prod/base-classes/base-entity.js.map +1 -0
  140. package/lib-prod/base-classes/base-file-upload.middleware.d.ts +14 -0
  141. package/lib-prod/base-classes/base-file-upload.middleware.js +85 -0
  142. package/lib-prod/base-classes/base-file-upload.middleware.js.map +1 -0
  143. package/lib-prod/base-classes/base-injector.d.ts +67 -0
  144. package/lib-prod/base-classes/base-injector.js +198 -0
  145. package/lib-prod/base-classes/base-injector.js.map +1 -0
  146. package/lib-prod/base-classes/base-middleware.d.ts +38 -0
  147. package/lib-prod/base-classes/base-middleware.js +14 -0
  148. package/lib-prod/base-classes/base-middleware.js.map +1 -0
  149. package/lib-prod/base-classes/base-migration.d.ts +11 -0
  150. package/lib-prod/base-classes/base-migration.js +25 -0
  151. package/lib-prod/base-classes/base-migration.js.map +1 -0
  152. package/lib-prod/base-classes/base-provider.d.ts +8 -0
  153. package/lib-prod/base-classes/base-provider.js +13 -0
  154. package/lib-prod/base-classes/base-provider.js.map +1 -0
  155. package/lib-prod/base-classes/base-repository.d.ts +272 -0
  156. package/lib-prod/base-classes/base-repository.js +634 -0
  157. package/lib-prod/base-classes/base-repository.js.map +1 -0
  158. package/lib-prod/base-classes/base-subscriber-for-entity.d.ts +81 -0
  159. package/lib-prod/base-classes/base-subscriber-for-entity.js +155 -0
  160. package/lib-prod/base-classes/base-subscriber-for-entity.js.map +1 -0
  161. package/lib-prod/base-classes/base.d.ts +1 -0
  162. package/lib-prod/base-classes/base.js +20 -0
  163. package/lib-prod/base-classes/base.js.map +1 -0
  164. package/lib-prod/build-info._auto-generated_.d.ts +24 -0
  165. package/lib-prod/build-info._auto-generated_.js +30 -0
  166. package/lib-prod/build-info._auto-generated_.js.map +1 -0
  167. package/lib-prod/config/controller-config.d.ts +21 -0
  168. package/lib-prod/config/controller-config.js +34 -0
  169. package/lib-prod/config/controller-config.js.map +1 -0
  170. package/lib-prod/config/controller-options.d.ts +16 -0
  171. package/lib-prod/config/controller-options.js +8 -0
  172. package/lib-prod/config/controller-options.js.map +1 -0
  173. package/lib-prod/config/method-config.d.ts +39 -0
  174. package/lib-prod/config/method-config.js +12 -0
  175. package/lib-prod/config/method-config.js.map +1 -0
  176. package/lib-prod/config/param-config.d.ts +8 -0
  177. package/lib-prod/config/param-config.js +8 -0
  178. package/lib-prod/config/param-config.js.map +1 -0
  179. package/lib-prod/constants.d.ts +9 -0
  180. package/lib-prod/constants.js +32 -0
  181. package/lib-prod/constants.js.map +1 -0
  182. package/lib-prod/context-db-migrations.d.ts +17 -0
  183. package/lib-prod/context-db-migrations.js +349 -0
  184. package/lib-prod/context-db-migrations.js.map +1 -0
  185. package/lib-prod/create-context.d.ts +78 -0
  186. package/lib-prod/create-context.js +223 -0
  187. package/lib-prod/create-context.js.map +1 -0
  188. package/lib-prod/decorators/classes/controller-decorator.d.ts +5 -0
  189. package/lib-prod/decorators/classes/controller-decorator.js +21 -0
  190. package/lib-prod/decorators/classes/controller-decorator.js.map +1 -0
  191. package/lib-prod/decorators/classes/entity-decorator.d.ts +19 -0
  192. package/lib-prod/decorators/classes/entity-decorator.js +43 -0
  193. package/lib-prod/decorators/classes/entity-decorator.js.map +1 -0
  194. package/lib-prod/decorators/classes/middleware-decorator.d.ts +8 -0
  195. package/lib-prod/decorators/classes/middleware-decorator.js +22 -0
  196. package/lib-prod/decorators/classes/middleware-decorator.js.map +1 -0
  197. package/lib-prod/decorators/classes/migration-decorator.d.ts +7 -0
  198. package/lib-prod/decorators/classes/migration-decorator.js +21 -0
  199. package/lib-prod/decorators/classes/migration-decorator.js.map +1 -0
  200. package/lib-prod/decorators/classes/provider-decorator.d.ts +7 -0
  201. package/lib-prod/decorators/classes/provider-decorator.js +21 -0
  202. package/lib-prod/decorators/classes/provider-decorator.js.map +1 -0
  203. package/lib-prod/decorators/classes/repository-decorator.d.ts +7 -0
  204. package/lib-prod/decorators/classes/repository-decorator.js +21 -0
  205. package/lib-prod/decorators/classes/repository-decorator.js.map +1 -0
  206. package/lib-prod/decorators/classes/subscriber-decorator.d.ts +8 -0
  207. package/lib-prod/decorators/classes/subscriber-decorator.js +22 -0
  208. package/lib-prod/decorators/classes/subscriber-decorator.js.map +1 -0
  209. package/lib-prod/decorators/decorator-abstract-opt.d.ts +3 -0
  210. package/lib-prod/decorators/decorator-abstract-opt.js +7 -0
  211. package/lib-prod/decorators/decorator-abstract-opt.js.map +1 -0
  212. package/lib-prod/decorators/http/http-decorators.d.ts +2 -0
  213. package/lib-prod/decorators/http/http-decorators.js +24 -0
  214. package/lib-prod/decorators/http/http-decorators.js.map +1 -0
  215. package/lib-prod/decorators/http/http-methods-decorators.d.ts +70 -0
  216. package/lib-prod/decorators/http/http-methods-decorators.js +112 -0
  217. package/lib-prod/decorators/http/http-methods-decorators.js.map +1 -0
  218. package/lib-prod/decorators/http/http-params-decorators.d.ts +8 -0
  219. package/lib-prod/decorators/http/http-params-decorators.js +50 -0
  220. package/lib-prod/decorators/http/http-params-decorators.js.map +1 -0
  221. package/lib-prod/dependency-injection/di-container.d.ts +5 -0
  222. package/lib-prod/dependency-injection/di-container.js +35 -0
  223. package/lib-prod/dependency-injection/di-container.js.map +1 -0
  224. package/lib-prod/endpoint-context-storage.d.ts +11 -0
  225. package/lib-prod/endpoint-context-storage.js +38 -0
  226. package/lib-prod/endpoint-context-storage.js.map +1 -0
  227. package/lib-prod/endpoint-context.d.ts +196 -0
  228. package/lib-prod/endpoint-context.js +2416 -0
  229. package/lib-prod/endpoint-context.js.map +1 -0
  230. package/lib-prod/entity-process.d.ts +39 -0
  231. package/lib-prod/entity-process.js +242 -0
  232. package/lib-prod/entity-process.js.map +1 -0
  233. package/lib-prod/env/env.angular-node-app.d.ts +64 -0
  234. package/lib-prod/env/env.angular-node-app.js +71 -0
  235. package/lib-prod/env/env.angular-node-app.js.map +1 -0
  236. package/lib-prod/env/env.docs-webapp.d.ts +64 -0
  237. package/lib-prod/env/env.docs-webapp.js +71 -0
  238. package/lib-prod/env/env.docs-webapp.js.map +1 -0
  239. package/lib-prod/env/env.electron-app.d.ts +64 -0
  240. package/lib-prod/env/env.electron-app.js +71 -0
  241. package/lib-prod/env/env.electron-app.js.map +1 -0
  242. package/lib-prod/env/env.mobile-app.d.ts +64 -0
  243. package/lib-prod/env/env.mobile-app.js +71 -0
  244. package/lib-prod/env/env.mobile-app.js.map +1 -0
  245. package/lib-prod/env/env.npm-lib-and-cli-tool.d.ts +64 -0
  246. package/lib-prod/env/env.npm-lib-and-cli-tool.js +71 -0
  247. package/lib-prod/env/env.npm-lib-and-cli-tool.js.map +1 -0
  248. package/lib-prod/env/env.vscode-plugin.d.ts +64 -0
  249. package/lib-prod/env/env.vscode-plugin.js +71 -0
  250. package/lib-prod/env/env.vscode-plugin.js.map +1 -0
  251. package/lib-prod/env/index.d.ts +6 -0
  252. package/lib-prod/env/index.js +23 -0
  253. package/lib-prod/env/index.js.map +1 -0
  254. package/lib-prod/express-types.d.ts +1 -0
  255. package/lib-prod/express-types.js +3 -0
  256. package/lib-prod/express-types.js.map +1 -0
  257. package/lib-prod/formly/formly.models.d.ts +1 -0
  258. package/lib-prod/formly/formly.models.js +3 -0
  259. package/lib-prod/formly/formly.models.js.map +1 -0
  260. package/lib-prod/formly/fromly.d.ts +16 -0
  261. package/lib-prod/formly/fromly.js +209 -0
  262. package/lib-prod/formly/fromly.js.map +1 -0
  263. package/lib-prod/formly/type-from-entity.d.ts +20 -0
  264. package/lib-prod/formly/type-from-entity.js +60 -0
  265. package/lib-prod/formly/type-from-entity.js.map +1 -0
  266. package/lib-prod/get-response-value.d.ts +6 -0
  267. package/lib-prod/get-response-value.js +27 -0
  268. package/lib-prod/get-response-value.js.map +1 -0
  269. package/lib-prod/global-state/taon-global-state/index.d.ts +5 -0
  270. package/lib-prod/global-state/taon-global-state/index.js +23 -0
  271. package/lib-prod/global-state/taon-global-state/index.js.map +1 -0
  272. package/lib-prod/global-state/taon-global-state/taon-global-state.abstract.context.d.ts +19 -0
  273. package/lib-prod/global-state/taon-global-state/taon-global-state.abstract.context.js +23 -0
  274. package/lib-prod/global-state/taon-global-state/taon-global-state.abstract.context.js.map +1 -0
  275. package/lib-prod/global-state/taon-global-state/taon-global-state.constants.d.ts +2 -0
  276. package/lib-prod/global-state/taon-global-state/taon-global-state.constants.js +11 -0
  277. package/lib-prod/global-state/taon-global-state/taon-global-state.constants.js.map +1 -0
  278. package/lib-prod/global-state/taon-global-state/taon-global-state.controller.d.ts +11 -0
  279. package/lib-prod/global-state/taon-global-state/taon-global-state.controller.js +62 -0
  280. package/lib-prod/global-state/taon-global-state/taon-global-state.controller.js.map +1 -0
  281. package/lib-prod/global-state/taon-global-state/taon-global-state.entity.d.ts +7 -0
  282. package/lib-prod/global-state/taon-global-state/taon-global-state.entity.js +64 -0
  283. package/lib-prod/global-state/taon-global-state/taon-global-state.entity.js.map +1 -0
  284. package/lib-prod/global-state/taon-global-state/taon-global-state.middleware.d.ts +3 -0
  285. package/lib-prod/global-state/taon-global-state/taon-global-state.middleware.js +22 -0
  286. package/lib-prod/global-state/taon-global-state/taon-global-state.middleware.js.map +1 -0
  287. package/lib-prod/global-state/taon-global-state/taon-global-state.models.d.ts +28 -0
  288. package/lib-prod/global-state/taon-global-state/taon-global-state.models.js +48 -0
  289. package/lib-prod/global-state/taon-global-state/taon-global-state.models.js.map +1 -0
  290. package/lib-prod/global-state/taon-global-state/taon-global-state.provider.d.ts +3 -0
  291. package/lib-prod/global-state/taon-global-state/taon-global-state.provider.js +22 -0
  292. package/lib-prod/global-state/taon-global-state/taon-global-state.provider.js.map +1 -0
  293. package/lib-prod/global-state/taon-global-state/taon-global-state.repository.d.ts +9 -0
  294. package/lib-prod/global-state/taon-global-state/taon-global-state.repository.js +53 -0
  295. package/lib-prod/global-state/taon-global-state/taon-global-state.repository.js.map +1 -0
  296. package/lib-prod/global-state/taon-global-state/taon-global-state.subscriber.d.ts +7 -0
  297. package/lib-prod/global-state/taon-global-state/taon-global-state.subscriber.js +29 -0
  298. package/lib-prod/global-state/taon-global-state/taon-global-state.subscriber.js.map +1 -0
  299. package/lib-prod/global-state/taon-global-state/taon-global-state.utils.d.ts +4 -0
  300. package/lib-prod/global-state/taon-global-state/taon-global-state.utils.js +16 -0
  301. package/lib-prod/global-state/taon-global-state/taon-global-state.utils.js.map +1 -0
  302. package/lib-prod/global-state/taon-transaction-registry/index.d.ts +10 -0
  303. package/lib-prod/global-state/taon-transaction-registry/index.js +28 -0
  304. package/lib-prod/global-state/taon-transaction-registry/index.js.map +1 -0
  305. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.d.ts +19 -0
  306. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.js +25 -0
  307. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.js.map +1 -0
  308. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.constants.d.ts +2 -0
  309. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.constants.js +9 -0
  310. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.constants.js.map +1 -0
  311. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.controller.d.ts +9 -0
  312. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.controller.js +52 -0
  313. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.controller.js.map +1 -0
  314. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.entity.d.ts +12 -0
  315. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.entity.js +77 -0
  316. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.entity.js.map +1 -0
  317. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.middleware.d.ts +3 -0
  318. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.middleware.js +22 -0
  319. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.middleware.js.map +1 -0
  320. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.models.d.ts +6 -0
  321. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.models.js +11 -0
  322. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.models.js.map +1 -0
  323. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.provider.d.ts +3 -0
  324. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.provider.js +22 -0
  325. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.provider.js.map +1 -0
  326. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.repository.d.ts +9 -0
  327. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.repository.js +38 -0
  328. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.repository.js.map +1 -0
  329. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.subscriber.d.ts +7 -0
  330. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.subscriber.js +29 -0
  331. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.subscriber.js.map +1 -0
  332. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.utils.d.ts +4 -0
  333. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.utils.js +11 -0
  334. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.utils.js.map +1 -0
  335. package/lib-prod/helpers/class-helpers.d.ts +24 -0
  336. package/lib-prod/helpers/class-helpers.js +233 -0
  337. package/lib-prod/helpers/class-helpers.js.map +1 -0
  338. package/lib-prod/helpers/clone-obj.d.ts +1 -0
  339. package/lib-prod/helpers/clone-obj.js +22 -0
  340. package/lib-prod/helpers/clone-obj.js.map +1 -0
  341. package/lib-prod/helpers/taon-helpers.d.ts +18 -0
  342. package/lib-prod/helpers/taon-helpers.js +152 -0
  343. package/lib-prod/helpers/taon-helpers.js.map +1 -0
  344. package/lib-prod/index._auto-generated_.d.ts +0 -0
  345. package/lib-prod/index._auto-generated_.js +6 -0
  346. package/lib-prod/index._auto-generated_.js.map +1 -0
  347. package/lib-prod/index.d.ts +234 -0
  348. package/lib-prod/index.js +272 -0
  349. package/lib-prod/index.js.map +1 -0
  350. package/lib-prod/inject.d.ts +4 -0
  351. package/lib-prod/inject.js +94 -0
  352. package/lib-prod/inject.js.map +1 -0
  353. package/lib-prod/models.d.ts +260 -0
  354. package/lib-prod/models.js +125 -0
  355. package/lib-prod/models.js.map +1 -0
  356. package/lib-prod/orm/columns.d.ts +32 -0
  357. package/lib-prod/orm/columns.js +112 -0
  358. package/lib-prod/orm/columns.js.map +1 -0
  359. package/lib-prod/orm/index.d.ts +1 -0
  360. package/lib-prod/orm/index.js +73 -0
  361. package/lib-prod/orm/index.js.map +1 -0
  362. package/lib-prod/realtime/realtime-client.d.ts +41 -0
  363. package/lib-prod/realtime/realtime-client.js +204 -0
  364. package/lib-prod/realtime/realtime-client.js.map +1 -0
  365. package/lib-prod/realtime/realtime-core.d.ts +40 -0
  366. package/lib-prod/realtime/realtime-core.js +106 -0
  367. package/lib-prod/realtime/realtime-core.js.map +1 -0
  368. package/lib-prod/realtime/realtime-server.d.ts +43 -0
  369. package/lib-prod/realtime/realtime-server.js +243 -0
  370. package/lib-prod/realtime/realtime-server.js.map +1 -0
  371. package/lib-prod/realtime/realtime-strategy/index.d.ts +4 -0
  372. package/lib-prod/realtime/realtime-strategy/index.js +21 -0
  373. package/lib-prod/realtime/realtime-strategy/index.js.map +1 -0
  374. package/lib-prod/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +80 -0
  375. package/lib-prod/realtime/realtime-strategy/realtime-strategy-ipc.js +297 -0
  376. package/lib-prod/realtime/realtime-strategy/realtime-strategy-ipc.js.map +1 -0
  377. package/lib-prod/realtime/realtime-strategy/realtime-strategy-mock.d.ts +14 -0
  378. package/lib-prod/realtime/realtime-strategy/realtime-strategy-mock.js +303 -0
  379. package/lib-prod/realtime/realtime-strategy/realtime-strategy-mock.js.map +1 -0
  380. package/lib-prod/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +16 -0
  381. package/lib-prod/realtime/realtime-strategy/realtime-strategy-socket-io.js +33 -0
  382. package/lib-prod/realtime/realtime-strategy/realtime-strategy-socket-io.js.map +1 -0
  383. package/lib-prod/realtime/realtime-strategy/realtime-strategy.d.ts +11 -0
  384. package/lib-prod/realtime/realtime-strategy/realtime-strategy.js +17 -0
  385. package/lib-prod/realtime/realtime-strategy/realtime-strategy.js.map +1 -0
  386. package/lib-prod/realtime/realtime-subs-manager.d.ts +14 -0
  387. package/lib-prod/realtime/realtime-subs-manager.js +94 -0
  388. package/lib-prod/realtime/realtime-subs-manager.js.map +1 -0
  389. package/lib-prod/realtime/realtime.models.d.ts +27 -0
  390. package/lib-prod/realtime/realtime.models.js +3 -0
  391. package/lib-prod/realtime/realtime.models.js.map +1 -0
  392. package/lib-prod/symbols.d.ts +65 -0
  393. package/lib-prod/symbols.js +110 -0
  394. package/lib-prod/symbols.js.map +1 -0
  395. package/lib-prod/ui/index.d.ts +1 -0
  396. package/lib-prod/ui/index.js +5 -0
  397. package/lib-prod/ui/index.js.map +1 -0
  398. package/lib-prod/ui/taon-admin-mode-configuration/index.d.ts +1 -0
  399. package/lib-prod/ui/taon-admin-mode-configuration/index.js +5 -0
  400. package/lib-prod/ui/taon-admin-mode-configuration/index.js.map +1 -0
  401. package/lib-prod/validators.d.ts +7 -0
  402. package/lib-prod/validators.js +85 -0
  403. package/lib-prod/validators.js.map +1 -0
  404. package/package.json +5 -5
  405. package/websql/fesm2022/taon-websql.mjs +1387 -1141
  406. package/websql/fesm2022/taon-websql.mjs.map +1 -1
  407. package/websql/package.json +1 -1
  408. package/websql/types/taon-websql.d.ts +7 -3
  409. package/websql-prod/README.md +24 -0
  410. package/websql-prod/fesm2022/taon-websql.mjs +8198 -0
  411. package/websql-prod/fesm2022/taon-websql.mjs.map +1 -0
  412. package/websql-prod/types/taon-websql.d.ts +2187 -0
@@ -0,0 +1,2178 @@
1
+ // @ts-nocheck
2
+ import * as taon_browser from 'taon/browser';
3
+ import * as express from 'express';
4
+ import express__default, { Request, Response, Application } from 'express';
5
+ import { Models as Models$1, RestResponseWrapper, TaonServerMiddlewareInterceptOptions, TaonClientMiddlewareInterceptOptions, HttpResponseError, RestErrorResponseWrapper, Mapping } from 'ng2-rest/browser-prod';
6
+ export { TaonClientMiddlewareInterceptOptions, TaonServerMiddlewareInterceptOptions } from 'ng2-rest/browser-prod';
7
+ import { Server } from 'http';
8
+ import { DataSource, Repository, SaveOptions, DeepPartial, QueryDeepPartialEntity, InsertResult, UpsertOptions, FindOptionsWhere, UpdateResult, FindManyOptions, FindOneOptions, QueryRunner, SelectQueryBuilder, Table, RelationPath, MigrationInterface, EntitySubscriberInterface, InsertEvent, UpdateEvent, RemoveEvent, SoftRemoveEvent, RecoverEvent, TransactionStartEvent, TransactionCommitEvent, TransactionRollbackEvent } from 'taon-typeorm/browser-prod';
9
+ export { AfterInsert, AfterLoad, AfterRecover, AfterRemove, AfterSoftRemove, AfterUpdate, BeforeInsert, BeforeRecover, BeforeRemove, BeforeSoftRemove, BeforeUpdate, Column, Connection, CreateDateColumn, Column as CustomColumn, DeleteDateColumn, Generated, Generated as GeneratedColumn, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryColumn, PrimaryGeneratedColumn, Repository, TreeChildren, TreeParent, UpdateDateColumn, VersionColumn, VirtualColumn } from 'taon-typeorm/browser-prod';
10
+ import { MySqlQuerySource } from 'taon-type-sql/browser-prod';
11
+ import { CoreModels } from 'tnp-core/browser-prod';
12
+ import * as i0 from '@angular/core';
13
+ import { InjectionToken, ViewContainerRef } from '@angular/core';
14
+ import { AxiosResponse } from 'axios';
15
+ import * as rxjs from 'rxjs';
16
+ import { Observable, Subscriber } from 'rxjs';
17
+ import * as multer from 'multer';
18
+ import * as _ngx_formly_core from '@ngx-formly/core';
19
+ import { FieldWrapper, FieldArrayType, FormlyFormBuilder, FormlyFieldConfig } from '@ngx-formly/core';
20
+ import { ServerOptions, Server as Server$1, DefaultEventsMap } from 'socket.io';
21
+ import { io, Socket } from 'socket.io-client';
22
+ import * as Electron from 'electron';
23
+ import { ipcRenderer } from 'electron';
24
+
25
+ declare abstract class TaonBaseCustomRepository extends TaonBaseInjector {
26
+ }
27
+
28
+ declare abstract class TaonBaseRepository<Entity extends {
29
+ id?: any;
30
+ }> extends TaonBaseCustomRepository {
31
+ private REPOS_CACHE_KEY;
32
+ abstract entityClassResolveFn: () => any;
33
+ constructor(__entityClassResolveFn: () => any);
34
+ private __dbQuery;
35
+ get dbQuery(): MySqlQuerySource;
36
+ get connection(): DataSource;
37
+ protected get repository(): Repository<Entity>;
38
+ /**
39
+ * target for repository
40
+ */
41
+ get target(): Function;
42
+ /**
43
+ * alias to repository
44
+ */
45
+ protected get repo(): Repository<Entity>;
46
+ get repositoryExists(): boolean;
47
+ /**
48
+ * Checks if entity has an id.
49
+ * If entity composite compose ids, it will check them all.
50
+ */
51
+ hasId(entity: Entity): boolean;
52
+ /**
53
+ * Gets entity mixed id.
54
+ */
55
+ getId(entity: Entity): any;
56
+ /**
57
+ Saves a given entity in the database.
58
+ * If entity does not exist in the database then inserts, otherwise updates.
59
+ */
60
+ save(item: Entity, options?: SaveOptions & {
61
+ reload: false;
62
+ }): Promise<Entity>;
63
+ /**
64
+ * alias to save
65
+ * -> it will actuall create new entity in db
66
+ * in oposite to typeorm create method
67
+ */
68
+ /**
69
+ * Creates a new entity instance.
70
+ */
71
+ create(): Entity;
72
+ /**
73
+ * Creates new entities and copies all entity properties from given objects into their new entities.
74
+ * Note that it copies only properties that are present in entity schema.
75
+ */
76
+ create(entityLikeArray: DeepPartial<Entity>[]): Entity[];
77
+ /**
78
+ * Creates a new entity instance and copies all entity properties from this object into a new entity.
79
+ * Note that it copies only properties that are present in entity schema.
80
+ */
81
+ create(entityLike: DeepPartial<Entity>): Entity;
82
+ bulkSave(items: Entity[], options?: SaveOptions & {
83
+ reload: false;
84
+ }): Promise<Entity[]>;
85
+ /**
86
+ * @deprecated use bulkSave instead
87
+ */
88
+ bulkCreate(items: Entity[], options?: SaveOptions & {
89
+ reload: false;
90
+ }): Promise<Entity[]>;
91
+ /**
92
+ * Saves all given entities in the database.
93
+ * If entities do not exist in the database then inserts, otherwise updates.
94
+ */
95
+ /**
96
+ * Merges multiple entities (or entity-like objects) into a given entity.
97
+ */
98
+ merge(mergeIntoEntity: Entity, ...entityLikes: Entity[]): Entity;
99
+ /**
100
+ * Creates a new entity from the given plain javascript object. If entity already exist in the database, then
101
+ * it loads it (and everything related to it), replaces all values with the new ones from the given object
102
+ * and returns this new entity. This new entity is actually a loaded from the db entity with all properties
103
+ * replaced from the new object.
104
+ *
105
+ * Note that given entity-like object must have an entity id / primary key to find entity by.
106
+ * Returns undefined if entity with given id was not found.
107
+ */
108
+ preload(entityLike: Entity): Promise<Entity | undefined>;
109
+ /**
110
+ * Removes a given entities from the database.
111
+ */
112
+ remove(idOrEntity: number | string | Entity): Promise<Entity>;
113
+ /**
114
+ * alias to remove
115
+ */
116
+ delete(idOrEntity: number | string | Partial<Entity>): Promise<Entity>;
117
+ /**
118
+ * alias to removeById
119
+ */
120
+ deleteById(id: number | string): Promise<Entity>;
121
+ bulkRemove(idsOrEntities: (number | string | Entity)[]): Promise<Entity[]>;
122
+ bulkDelete(ids: (number | string | Entity)[]): Promise<Entity[]>;
123
+ /**
124
+ * Records the delete date of all given entities.
125
+ */
126
+ softRemove<T extends Entity>(entities: T[], options: SaveOptions & {
127
+ reload: false;
128
+ }): Promise<T[]>;
129
+ /**
130
+ * Records the delete date of all given entities.
131
+ */
132
+ softRemove<T extends Entity>(entities: T[], options?: SaveOptions): Promise<(T & Entity)[]>;
133
+ /**
134
+ * Records the delete date of a given entity.
135
+ */
136
+ softRemove<T extends Entity>(entity: T, options: SaveOptions & {
137
+ reload: false;
138
+ }): Promise<T>;
139
+ /**
140
+ * Recovers all given entities in the database.
141
+ */
142
+ recover<T extends Entity>(entities: T[], options: SaveOptions & {
143
+ reload: false;
144
+ }): Promise<T[]>;
145
+ /**
146
+ * Recovers all given entities in the database.
147
+ */
148
+ recover<T extends Entity>(entities: T[], options?: SaveOptions): Promise<(T & Entity)[]>;
149
+ /**
150
+ * Recovers a given entity in the database.
151
+ */
152
+ recover<T extends Entity>(entity: T, options: SaveOptions & {
153
+ reload: false;
154
+ }): Promise<T>;
155
+ /**
156
+ * Inserts a given entity into the database.
157
+ * Unlike save method executes a primitive operation without cascades, relations and other operations included.
158
+ * Executes fast and efficient INSERT query.
159
+ * Does not check if entity exist in the database, so query will fail if duplicate entity is being inserted.
160
+ */
161
+ insert(entity: QueryDeepPartialEntity<Entity> | QueryDeepPartialEntity<Entity>[]): Promise<InsertResult>;
162
+ update(item: Entity): Promise<any>;
163
+ private allowedTypesToUpdate;
164
+ updateById<ENTITY = Entity>(id: number | string, item: Entity): Promise<ENTITY>;
165
+ bulkUpdate(items: Entity[]): Promise<any>;
166
+ /**
167
+ * Inserts a given entity into the database, unless a unique constraint conflicts then updates the entity
168
+ * Unlike save method executes a primitive operation without cascades, relations and other operations included.
169
+ * Executes fast and efficient INSERT ... ON CONFLICT DO UPDATE/ON DUPLICATE KEY UPDATE query.
170
+ */
171
+ upsert(entityOrEntities: QueryDeepPartialEntity<Entity> | QueryDeepPartialEntity<Entity>[], conflictPathsOrOptions: string[] | UpsertOptions<Entity>): Promise<InsertResult>;
172
+ /**
173
+ * Records the delete date of entities by a given criteria.
174
+ * Unlike save method executes a primitive operation without cascades, relations and other operations included.
175
+ * Executes fast and efficient SOFT-DELETE query.
176
+ * Does not check if entity exist in the database.
177
+ */
178
+ softDelete(criteria: string | string[] | number | number[] | Date | Date[] | FindOptionsWhere<Entity>): Promise<UpdateResult>;
179
+ /**
180
+ * Restores entities by a given criteria.
181
+ * Unlike save method executes a primitive operation without cascades, relations and other operations included.
182
+ * Executes fast and efficient SOFT-DELETE query.
183
+ * Does not check if entity exist in the database.
184
+ */
185
+ restore(criteria: string | string[] | number | number[] | Date | Date[] | FindOptionsWhere<Entity>): Promise<UpdateResult>;
186
+ /**
187
+ * Counts entities that match given options.
188
+ * Useful for pagination.
189
+ */
190
+ count(options?: FindManyOptions<Entity>): Promise<number>;
191
+ /**
192
+ * Counts entities that match given conditions.
193
+ * Useful for pagination.
194
+ */
195
+ countBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<number>;
196
+ /**
197
+ * Finds entities that match given find options.
198
+ */
199
+ find(options?: FindManyOptions<Entity>): Promise<Entity[]>;
200
+ /**
201
+ * Finds entities that match given find options.
202
+ */
203
+ findBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<Entity[]>;
204
+ /**
205
+ * Finds entities that match given find options.
206
+ * Also counts all entities that match given conditions,
207
+ * but ignores pagination settings (from and take options).
208
+ */
209
+ findAndCount(options?: FindManyOptions<Entity>): Promise<[Entity[], number]>;
210
+ /**
211
+ * Finds entities that match given WHERE conditions.
212
+ * Also counts all entities that match given conditions,
213
+ * but ignores pagination settings (from and take options).
214
+ */
215
+ findAndCountBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<[Entity[], number]>;
216
+ /**
217
+ * Finds entities with ids.
218
+ * Optionally find options or conditions can be applied.
219
+ *
220
+ * @deprecated use `findBy` method instead in conjunction with `In` operator, for example:
221
+ *
222
+ * .findBy({
223
+ * id: In([1, 2, 3])
224
+ * })
225
+ */
226
+ findByIds(ids: any[]): Promise<Entity[]>;
227
+ /**
228
+ * Finds first entity by a given find options.
229
+ * If entity was not found in the database - returns null.
230
+ */
231
+ findOne(options: FindOneOptions<Entity>): Promise<Entity | null>;
232
+ /**
233
+ * Finds first entity that matches given where condition.
234
+ * If entity was not found in the database - returns null.
235
+ */
236
+ findOneBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<Entity | null>;
237
+ /**
238
+ * Finds first entity that matches given id.
239
+ * If entity was not found in the database - returns null.
240
+ *
241
+ * @deprecated use `findOneBy` method instead in conjunction with `In` operator, for example:
242
+ *
243
+ * .findOneBy({
244
+ * id: 1 // where "id" is your primary column name
245
+ * })
246
+ */
247
+ findOneById(id: number | string | Date): Promise<Entity | null>;
248
+ /**
249
+ * Finds first entity by a given find options.
250
+ * If entity was not found in the database - rejects with error.
251
+ */
252
+ findOneOrFail(options: FindOneOptions<Entity>): Promise<Entity>;
253
+ /**
254
+ * Finds first entity that matches given where condition.
255
+ * If entity was not found in the database - rejects with error.
256
+ */
257
+ findOneByOrFail(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<Entity>;
258
+ /**
259
+ * Executes a raw SQL query and returns a raw database results.
260
+ * Raw query execution is supported only by relational databases (MongoDB is not supported).
261
+ */
262
+ query(query: string, parameters?: any[]): Promise<any>;
263
+ /**
264
+ * Executes a raw SQL query and returns a raw database results.
265
+ * Raw query execution is supported only by relational databases (MongoDB is not supported).
266
+ */
267
+ createQueryBuilder(alias?: string, queryRunner?: QueryRunner): SelectQueryBuilder<Entity>;
268
+ /**
269
+ * Clears all the data from the given table/collection (truncates/drops it).
270
+ *
271
+ * Note: this method uses TRUNCATE and may not work as you expect in transactions on some platforms.
272
+ * @see https://stackoverflow.com/a/5972738/925151
273
+ */
274
+ clear(): Promise<void>;
275
+ /**
276
+ * Increments some column by provided value of the entities matched given conditions.
277
+ */
278
+ increment(conditions: FindOptionsWhere<Entity>, propertyPath: string, value: number | string): Promise<UpdateResult>;
279
+ /**
280
+ * Decrements some column by provided value of the entities matched given conditions.
281
+ */
282
+ decrement(conditions: FindOptionsWhere<Entity>, propertyPath: string, value: number | string): Promise<UpdateResult>;
283
+ /**
284
+ * @deprecated use findAndCount instead
285
+ */
286
+ getAll(): Promise<any>;
287
+ getBy(id: number | string): Promise<Entity>;
288
+ }
289
+
290
+ declare class TaonBaseInjector {
291
+ /**
292
+ * for proxy purposes
293
+ */
294
+ getOriginalPrototype: () => any;
295
+ /**
296
+ * for proxy purposes
297
+ */
298
+ getOriginalConstructor: () => any;
299
+ /**
300
+ * class initialization hook
301
+ * taon after class instace creation
302
+ */
303
+ _(): Promise<void>;
304
+ /**
305
+ * @deprecated use ctx instead
306
+ * Current endpoint context
307
+ */
308
+ get __endpoint_context__(): EndpointContext;
309
+ /**
310
+ * get current endpoint context
311
+ */
312
+ get ctx(): EndpointContext;
313
+ /**
314
+ * inject crud repo for entity
315
+ */
316
+ injectRepo<T>(entityForCrud: new (...args: any[]) => T): TaonBaseRepository<T>;
317
+ injectCustomRepository<T extends TaonBaseCustomRepository>(cutomRepositoryClass: new (...args: any[]) => T): T;
318
+ /**
319
+ * aliast to this.injectRepository()
320
+ */
321
+ injectCustomRepo<T extends TaonBaseCustomRepository>(cutomRepositoryClass: new (...args: any[]) => T): T;
322
+ /**
323
+ * example usage:
324
+ * ...
325
+ * exampleController = this.injectController(ExampleController);
326
+ * ...
327
+ */
328
+ injectController<T>(ctor: new (...args: any[]) => T): T;
329
+ /**
330
+ * example usage:
331
+ * ...
332
+ * exampleSubscriber = this.injectSubscriber(ExampleSubscriber)
333
+ * ...
334
+ */
335
+ injectSubscriber<T>(ctor: new (...args: any[]) => T): T;
336
+ /**
337
+ * aliast to .injectController()
338
+ */
339
+ injectCtrl<T>(ctor: new (...args: any[]) => T): T;
340
+ /**
341
+ * inject middleware for context
342
+ */
343
+ injectMiddleware<T>(ctor: new (...args: any[]) => T): T;
344
+ /**
345
+ * inject provider for context
346
+ */
347
+ injectProvider<T>(ctor: new (...args: any[]) => T): T;
348
+ /**
349
+ * Inject: Controllers, Providers, Repositories, Services, etc.
350
+ * TODO addd nest js injecting
351
+ */
352
+ private __inject;
353
+ }
354
+
355
+ type MigrationStatus = 'completed' | 'pending';
356
+ declare class ContextDbMigrations {
357
+ private ctx;
358
+ readonly DEFAULT_MIGRATION_TABLE_NAME = "TAON_MIGRATION_META";
359
+ readonly MIGRATION_STATUS_COMPLETED: MigrationStatus;
360
+ readonly MIGRATION_STATUS_PENDING: MigrationStatus;
361
+ readonly table: Table;
362
+ constructor(ctx: EndpointContext);
363
+ ensureMigrationTableExists(): Promise<void>;
364
+ private logSelectALl;
365
+ revertMigrationToTimestamp(timestamp: number): Promise<any>;
366
+ clearMigrationTable(): Promise<any>;
367
+ markAllMigrationsAsApplied(): Promise<any>;
368
+ runAllNotCompletedMigrations(): Promise<any>;
369
+ }
370
+
371
+ declare class ContextsEndpointStorage {
372
+ SPECIAL_APP_READY_MESSAGE: string;
373
+ private taonEndpointContexts;
374
+ private static instance;
375
+ private constructor();
376
+ static get Instance(): ContextsEndpointStorage;
377
+ set(context: EndpointContext): void;
378
+ get arr(): EndpointContext[];
379
+ getBy(context: Partial<EndpointContext> | string): EndpointContext | undefined;
380
+ }
381
+
382
+ declare class TaonRestResponseWrapper extends RestResponseWrapper {
383
+ }
384
+ declare const BaseTaonClassesNames: readonly ["BaseCrudController", "BaseController", "BaseAbstractEntity", "BaseEntity", "BaseContext", "BaseCustomRepository", "BaseFileUploadMiddleware", "BaseMiddleware", "BaseClass", "BaseInjector", "BaseMigration", "BaseProvider", "BaseRepository", "BaseSubscriberForEntity", "BaseCliWorkerController", "PortsController", "PortsContext"];
385
+ declare const TaonTempDatabasesFolder = "databases";
386
+ declare const TaonTempRoutesFolder = "routes";
387
+ declare namespace Models {
388
+ const DatabasesFolder = "databases";
389
+ type FrameworkMode = 'backend-frontend(tcp+udp)' | 'remote-backend(tcp+udp)' | 'backend-frontend(ipc-electron)' | 'backend-frontend(websql-electron)' | 'backend-frontend(websql)';
390
+ enum ClassType {
391
+ ENTITY = "ENTITY",
392
+ CONTROLLER = "CONTROLLER",
393
+ REPOSITORY = "REPOSITORY",
394
+ PROVIDER = "PROVIDER",
395
+ SUBSCRIBER = "SUBSCRIBER",
396
+ MIGRATION = "MIGRATION",
397
+ MIDDLEWARE = "MIDDLEWARE"
398
+ }
399
+ const ClassTypeKey: { [key in ClassType]: keyof ContextOptions<any, any, any, any, any, any, any, any>; };
400
+ type MiddlewareType = [Function, any[]];
401
+ /**
402
+ * DROP_DB+MIGRATIONS (default for development)
403
+ * Drop all tables + recreate them + run migrations
404
+ * synchronize: true , dropSchema: true
405
+ * use migrations: true
406
+ *
407
+ * MIGRATIONS (default for production)
408
+ * Do not drop tables, only run migrations
409
+ * synchronize: false, dropSchema: false
410
+ * use migrations: true
411
+ */
412
+ type DBRecreateMode = 'DROP_DB+MIGRATIONS' | 'PRESERVE_DATA+MIGRATIONS';
413
+ class DatabaseConfigTypeOrm {
414
+ /**
415
+ * database name
416
+ */
417
+ database?: string;
418
+ /**
419
+ * only for file base db: sqlite, sqljs
420
+ */
421
+ location?: string;
422
+ synchronize: boolean;
423
+ dropSchema: boolean;
424
+ type?: CoreModels.DatabaseType;
425
+ /**
426
+ * Persists db on disk/local-storage if serverless db
427
+ */
428
+ autoSave?: boolean;
429
+ /**
430
+ * for websql db mode
431
+ * true by default
432
+ */
433
+ useLocalForage?: boolean;
434
+ logging: boolean;
435
+ databasePort?: number;
436
+ databaseHost?: string;
437
+ databaseUsername?: string;
438
+ databasePassword?: string;
439
+ }
440
+ class DatabaseConfig extends DatabaseConfigTypeOrm {
441
+ /**
442
+ * Default value 'DROP_ALL'.
443
+ *
444
+ * Tell framework what is happening with db
445
+ * when context is starting.
446
+ */
447
+ recreateMode?: DBRecreateMode;
448
+ static from(databasePartialConfig: Partial<Omit<DatabaseConfig, 'synchronize' | 'dropSchema' | 'databaseConfigTypeORM'>>): DatabaseConfig;
449
+ get databaseConfigTypeORM(): DatabaseConfigTypeOrm;
450
+ }
451
+ type ISession = {
452
+ secret?: string;
453
+ saveUninitialized?: boolean;
454
+ /**
455
+ * max age of session
456
+ */
457
+ cookieMaxAge?: number;
458
+ secure?: boolean;
459
+ resave?: boolean;
460
+ };
461
+ type ConnectionOptionsLogs = {
462
+ http?: boolean;
463
+ realtime?: boolean;
464
+ framework?: boolean;
465
+ db?: boolean;
466
+ migrations?: boolean;
467
+ routes?: boolean;
468
+ };
469
+ interface ContextOptions<CONTEXTS, CONTROLLERS, ENTITIES, REPOSITORIES, PROVIDERS, SUBSCRIBERS, MIGRATIONS, MIDDLEWARES> {
470
+ appId?: string;
471
+ contextName: string;
472
+ /**
473
+ * if defined and different from contextName
474
+ * - context will NOT be initialized
475
+ */
476
+ activeContext?: string | null;
477
+ /**
478
+ * IMPORTANT! provide full url that starts with http:// or https://
479
+ * host/port for initing backend server
480
+ */
481
+ host?: string;
482
+ /**
483
+ * Needs to be specified in docker environment only
484
+ */
485
+ hostPortNumber?: number;
486
+ /**
487
+ * IMPORTANT! provide full url that starts with http:// or https://
488
+ * frontend host only needed when we are
489
+ * using withCredentials for axios
490
+ * and session cookie
491
+ * or realtime communication
492
+ */
493
+ frontendHost?: string;
494
+ /**
495
+ * Needs to be specified in docker environment only
496
+ */
497
+ frontendHostPortNumber?: number;
498
+ /**
499
+ * User ipc for communication between BE/FE
500
+ * when electron is used as a platform
501
+ * Default: true
502
+ */
503
+ useIpcWhenElectron?: boolean;
504
+ /**
505
+ * taon contexts here
506
+ * (module like structure)
507
+ */
508
+ contexts?: CONTEXTS;
509
+ /**
510
+ * taon controller here
511
+ * (glue between frontend and backend)
512
+ */
513
+ controllers?: CONTROLLERS;
514
+ /**
515
+ * taon entities
516
+ * (entities are used to create tables in db)
517
+ */
518
+ entities?: ENTITIES;
519
+ /**
520
+ * taon repositories
521
+ * (repositories are used to access data from db)
522
+ */
523
+ repositories?: REPOSITORIES;
524
+ /**
525
+ * taon providers
526
+ * (context singletons)
527
+ */
528
+ providers?: PROVIDERS;
529
+ /**
530
+ * taon subscribers
531
+ * (subscribers are used to listen to db events)
532
+ */
533
+ subscribers?: SUBSCRIBERS;
534
+ /**
535
+ * taon migrations
536
+ * (migrations are used to update db schema and achieve proper CI/CD)
537
+ */
538
+ migrations?: MIGRATIONS;
539
+ /**
540
+ * taon middlewares
541
+ * middlewares are used to intercept requests
542
+ * and responses in the context
543
+ */
544
+ middlewares?: MIDDLEWARES;
545
+ /**
546
+ * Config for express session
547
+ */
548
+ session?: ISession;
549
+ /**
550
+ * taon is not going to write .rest files to cwd()
551
+ */
552
+ skipWritingServerRoutes?: boolean;
553
+ /**
554
+ * TODO - this is still in progress
555
+ * @deprecated
556
+ */
557
+ productionMode?: boolean;
558
+ /**
559
+ * If you want your context to never be started as separated server
560
+ * use abstract: true
561
+ * @default: false
562
+ */
563
+ abstract?: boolean;
564
+ logs?: boolean | ConnectionOptionsLogs;
565
+ database?: boolean | Partial<DatabaseConfig>;
566
+ /**
567
+ * disable default realtime communication through TCP upgrade sockets
568
+ */
569
+ disabledRealtime?: boolean;
570
+ /**
571
+ * Will be removed soon - cloud will handle certs and https
572
+ * @deprecated
573
+ */
574
+ https?: {
575
+ key: string;
576
+ cert: string;
577
+ };
578
+ /**
579
+ * TODO - will be removed soon
580
+ * @deprecated
581
+ */
582
+ publicAssets?: {
583
+ serverPath: string;
584
+ locationOnDisk: string;
585
+ }[];
586
+ /**
587
+ * by default cwd === process.cwd()
588
+ */
589
+ cwd?: string;
590
+ }
591
+ namespace Http {
592
+ export import Rest = Models$1;
593
+ type ContextENDPOINT = {
594
+ target: Function;
595
+ initFN: Function;
596
+ };
597
+ type FormlyFromType = 'material' | 'bootstrap';
598
+ type ExpressContext<T> = (req: Request<any>, res: Response<any>) => T;
599
+ type SyncResponse<T> = string | T;
600
+ type ResponseFuncOpt<T> = {
601
+ limitSize?: (enties: Function | Function[], include: string[], exclude: string[]) => void;
602
+ };
603
+ type SyncResponseFunc<T> = (options?: ResponseFuncOpt<T>) => SyncResponse<T>;
604
+ type MixResponse<T> = SyncResponse<T> | ExpressContext<T>;
605
+ interface ClientAction<T> {
606
+ /**
607
+ * @deprecated use request() mehods instead
608
+ */
609
+ readonly received?: Rest.PromiseObservableMix<Rest.HttpResponse<T>>;
610
+ request?(axiosConfig?: Models$1.Ng2RestAxiosRequestConfig): Rest.PromiseObservableMix<Rest.HttpResponse<T>>;
611
+ }
612
+ interface AsyncResponse<T> {
613
+ (req?: Request<any>, res?: Response<any>): Promise<SyncResponse<T> | SyncResponseFunc<T>>;
614
+ }
615
+ type Response<T = string> = AsyncResponse<T> & ClientAction<T>;
616
+ }
617
+ interface StartParams {
618
+ port: number;
619
+ args: string[];
620
+ onlyMigrationRun?: boolean;
621
+ onlyMigrationRevertToTimestamp?: number;
622
+ }
623
+ interface TaonInitializeParams {
624
+ onlyMigrationRun?: boolean;
625
+ onlyMigrationRevertToTimestamp?: number;
626
+ }
627
+ interface TaonCtxCloneParams {
628
+ useAsRemoteContext?: boolean;
629
+ overrideRemoteHost?: string;
630
+ overrideHost?: string;
631
+ sourceContext?: EndpointContext;
632
+ }
633
+ }
634
+
635
+ declare class EndpointContext {
636
+ private originalConfig;
637
+ private configFn;
638
+ /**
639
+ * (@default: false)
640
+ * If TRUE context is NOT going to create db/express server/http endpoints
641
+ * PURPOSE OF THIS PROPERTY
642
+ * -> ONLY remote access from backend or frontend to specific backend
643
+ */
644
+ private readonly cloneOptions;
645
+ /**
646
+ * JUST FOR TESTING PURPOSES
647
+ */
648
+ readonly USE_MARIADB_MYSQL_IN_DOCKER: boolean;
649
+ disabledRealtime: boolean;
650
+ /**
651
+ * check whether context is inited
652
+ * (with init() function )
653
+ */
654
+ inited: boolean;
655
+ readonly dbMigrations: ContextDbMigrations;
656
+ private readonly localInstaceObjSymbol;
657
+ /**
658
+ * all instances of classes from context
659
+ * key is class name
660
+ */
661
+ readonly allClassesInstances: {};
662
+ private readonly classInstancesByNameObj;
663
+ private readonly objWithClassesInstancesArr;
664
+ readonly activeRoutes: {
665
+ expressPath: string;
666
+ method: Models.Http.Rest.HttpMethod;
667
+ }[];
668
+ get sourceContext(): EndpointContext | undefined;
669
+ readonly skipWritingServerRoutes: boolean;
670
+ private injectableTypesfromContexts;
671
+ private allTypesfromContexts;
672
+ expressApp: Application;
673
+ serverTcpUdp: Server;
674
+ databaseConfig?: Models.DatabaseConfigTypeOrm;
675
+ mode: Models.FrameworkMode;
676
+ readonly onlyMigrationRun?: boolean;
677
+ readonly onlyMigrationRevertToTimestamp?: number;
678
+ get isRunOrRevertOnlyMigrationAppStart(): boolean;
679
+ session?: Models.ISession;
680
+ connection: DataSource;
681
+ private entitiesTriggers;
682
+ private realtime;
683
+ get realtimeClient(): taon_browser.RealtimeClient;
684
+ get realtimeServer(): taon_browser.RealtimeServer;
685
+ /**
686
+ * available after init()
687
+ */
688
+ config: Models.ContextOptions<any, any, any, any, any, any, any, any>;
689
+ get logHttp(): boolean;
690
+ get logRealtime(): boolean;
691
+ get logFramework(): boolean;
692
+ get logRoutes(): boolean;
693
+ get logDb(): boolean;
694
+ get logMigrations(): boolean;
695
+ /**
696
+ * Inside docker there is not need for https secure server
697
+ */
698
+ readonly isRunningInsideDocker: boolean;
699
+ constructor(originalConfig: Models.ContextOptions<any, any, any, any, any, any, any, any>, configFn: (env: any) => Models.ContextOptions<any, any, any, any, any, any, any, any>,
700
+ /**
701
+ * (@default: false)
702
+ * If TRUE context is NOT going to create db/express server/http endpoints
703
+ * PURPOSE OF THIS PROPERTY
704
+ * -> ONLY remote access from backend or frontend to specific backend
705
+ */
706
+ cloneOptions: Models.TaonCtxCloneParams);
707
+ init(options?: {
708
+ initFromRecrusiveContextResovle?: boolean;
709
+ onlyMigrationRun?: boolean;
710
+ onlyMigrationRevertToTimestamp?: number;
711
+ }): Promise<void>;
712
+ private getAutoGeneratedConfig;
713
+ startServer(): Promise<void>;
714
+ displayRoutes(app: any): void;
715
+ get modeAllowsDatabaseCreation(): boolean;
716
+ private cloneClassWithNewMetadata;
717
+ private cloneClassesObjWithNewMetadata;
718
+ private getRecrusiveClassesfromContextsObj;
719
+ private getRecrusiveClassesfromContexts;
720
+ getClassInstanceObjBy(classType: Models.ClassType): any;
721
+ private getClassesInstancesArrBy;
722
+ inject<T>(ctor: new (...args: any[]) => T, options: {
723
+ localInstance?: boolean;
724
+ contextClassInstance?: TaonBaseInjector;
725
+ locaInstanceConstructorArgs?: ConstructorParameters<typeof ctor>;
726
+ parentInstanceThatWillGetInjectedStuff: object;
727
+ }): T;
728
+ /**
729
+ * alias for inject
730
+ */
731
+ getInstanceBy<T>(ctor: new (...args: any[]) => T): T;
732
+ checkIfContextInitialized(): void;
733
+ getClassFunBy(classType: Models.ClassType): any;
734
+ isCLassType(classType: Models.ClassType, classFn: Function): boolean;
735
+ /**
736
+ * Only for injectable types
737
+ * Only for classType: CONTROLLER, REPOSITORY, PROVIDER, MIDDLEWARES
738
+ */
739
+ getClassFunByClassName(className: string): Function;
740
+ getClassFunByClass(classFunction: Function): Function;
741
+ getClassFunByArr(classType: Models.ClassType): Function[];
742
+ private createInstances;
743
+ initClasses(): Promise<void>;
744
+ isActiveOn(classInstance: object): boolean;
745
+ get frontendHostUri(): URL;
746
+ get uri(): URL | undefined;
747
+ get uriProtocol(): string | undefined;
748
+ /**
749
+ * Examples
750
+ * http://localhost:3000
751
+ * https://localhost (from localhost:80) *
752
+ */
753
+ get uriOrigin(): string | undefined;
754
+ /**
755
+ * Exampels
756
+ * http://localhost:3000/path/to/somewhere
757
+ * https://localhost/path/to/somewhere (from localhost:80)
758
+ */
759
+ get uriPathname(): string | undefined;
760
+ /**
761
+ * Examples
762
+ * http://localhost:3000/path/to/somewhere -> '/path/to/somewhere'
763
+ * http://localhost:3000 -> '' #
764
+ * https://localhost/path/to/ -> '/path/to/somewhere' # remove last slash
765
+ */
766
+ get uriPathnameOrNothingIfRoot(): string;
767
+ get uriPort(): string | undefined;
768
+ /**
769
+ * Port from uri as number
770
+ * @returns {Number | undefined}
771
+ */
772
+ get port(): Number | undefined;
773
+ get isHttpServer(): boolean;
774
+ /**
775
+ * Check if context is for remote only
776
+ */
777
+ get isRemoteHost(): boolean;
778
+ /**
779
+ * ipc/udp needs this
780
+ */
781
+ get contextName(): string;
782
+ /**
783
+ * ipc/udp needs this
784
+ */
785
+ get contextNameForCommunication(): string;
786
+ /**
787
+ * Check context type
788
+ */
789
+ get contextType(): 'normal' | 'remote' | 'abstract' | 'invalid';
790
+ get cwd(): string;
791
+ get activeContext(): string | null;
792
+ get appId(): string;
793
+ get publicAssets(): {
794
+ serverPath: string;
795
+ locationOnDisk: string;
796
+ }[];
797
+ get isProductionMode(): boolean;
798
+ get host(): string | undefined;
799
+ get origin(): string | undefined;
800
+ initSubscribers(): Promise<any>;
801
+ initEntities(): Promise<void>;
802
+ destroy(): Promise<void>;
803
+ initDatabaseConnection(): Promise<void>;
804
+ private updateCalculatedPathsForControllers;
805
+ private mergeControllerMethodsConfigs;
806
+ initControllersHook(ctxStorage: ContextsEndpointStorage): Promise<void>;
807
+ initControllers(): Promise<void>;
808
+ writeActiveRoutes(): void;
809
+ get middlewares(): Models.MiddlewareType[];
810
+ private initCustomClientMiddlewares;
811
+ private initCustomBackendMiddlewares;
812
+ private initBackendMiddlewares;
813
+ private initServer;
814
+ protected sendError(res: express.Response, error: unknown, req: express.Request, expressPath: string): void;
815
+ /**
816
+ * client can be browser or nodejs (when remote host)
817
+ */
818
+ private initClient;
819
+ }
820
+
821
+ /**
822
+ * for backendSocket.in(ROOM_NAME).emit(EVENT)
823
+ *
824
+ * Room names are uniqe..
825
+ * here I am limiting number of event for clients.
826
+ */
827
+ declare class Realtime {
828
+ NAMESPACE(contextName: string): string;
829
+ TABLE_CHANGE(contextName: string, tableName: string): string;
830
+ readonly KEYroomSubscribe = "roomSubscribe";
831
+ readonly KEYroomUnsubscribe = "roomUnsubscribe";
832
+ ROOM_NAME_CUSTOM(contextName: string, customEvent: string): string;
833
+ ROOM_SUBSCRIBE_CUSTOM(contextName: string): string;
834
+ ROOM_UNSUBSCRIBE_CUSTOM(contextName: string): string;
835
+ ROOM_NAME_UPDATE_ENTITY(contextName: string, className: string, entityId: number | string): string;
836
+ ROOM_SUBSCRIBE_ENTITY_UPDATE_EVENTS(contextName: string): string;
837
+ ROOM_UNSUBSCRIBE_ENTITY_UPDATE_EVENTS(contextName: string): string;
838
+ ROOM_NAME_UPDATE_ENTITY_PROPERTY(contextName: string, className: string, property: string, entityId: number | string): string;
839
+ ROOM_SUBSCRIBE_ENTITY_PROPERTY_UPDATE_EVENTS(contextName: string): string;
840
+ ROOM_UNSUBSCRIBE_ENTITY_PROPERTY_UPDATE_EVENTS(contextName: string): string;
841
+ }
842
+ declare namespace Symbols {
843
+ const ctxInClassOrClassObj: unique symbol;
844
+ const classNameStaticProperty: string;
845
+ const fullClassNameStaticProperty: string;
846
+ const orignalClass: string;
847
+ const orignalClassClonesObj: string;
848
+ const classMethodsNames: string;
849
+ const REALTIME: Realtime;
850
+ const metadata: {
851
+ className: string;
852
+ options: {
853
+ controller: string;
854
+ entity: string;
855
+ repository: string;
856
+ provider: string;
857
+ subscriber: string;
858
+ migration: string;
859
+ };
860
+ };
861
+ const old: {
862
+ HAS_TABLE_IN_DB: symbol;
863
+ MDC_KEY: string;
864
+ WEBSQL_REST_PROGRESS_FUN: symbol;
865
+ WEBSQL_REST_PROGRESS_FUN_START: symbol;
866
+ WEBSQL_REST_PROGRESS_FUN_DONE: symbol;
867
+ WEBSQL_REST_PROGRESS_TIMEOUT: symbol;
868
+ X_TOTAL_COUNT: string;
869
+ CIRCURAL_OBJECTS_MAP_BODY: string;
870
+ CIRCURAL_OBJECTS_MAP_QUERY_PARAM: string;
871
+ MAPPING_CONFIG_HEADER: string;
872
+ MAPPING_CONFIG_HEADER_BODY_PARAMS: string;
873
+ MAPPING_CONFIG_HEADER_QUERY_PARAMS: string;
874
+ ENDPOINT_META_CONFIG: string;
875
+ CLASS_DECORATOR_CONTEXT: string;
876
+ SOCKET_MSG: string;
877
+ ANGULAR: {
878
+ INPUT_NAMES: symbol;
879
+ };
880
+ ERROR_MESSAGES: {
881
+ CLASS_NAME_MATCH: string;
882
+ };
883
+ };
884
+ }
885
+
886
+ /**
887
+ * @returns function that returns context function.
888
+ * Context function can be used to dynamically
889
+ * create context with specific configuration.
890
+ */
891
+ declare const createContextTemplate: <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>, MIDDLEWARE extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARE>) => () => {
892
+ readonly contextName: string;
893
+ readonly appId: string;
894
+ cloneAsRemote: (cloneOpt?: {
895
+ overrideRemoteHost?: string;
896
+ }) => /*elided*/ any;
897
+ cloneAsNormal: (cloneOpt?: {
898
+ overrideHost?: string;
899
+ }) => /*elided*/ any;
900
+ /**
901
+ * @deprecated
902
+ * - get reference to internal context
903
+ */
904
+ __ref(): Promise<EndpointContext>;
905
+ /**
906
+ * only for internal use
907
+ * @deprecated
908
+ */
909
+ readonly __refSync: EndpointContext;
910
+ getClassInstance<T>(ctor: new (...args: any[]) => T): T;
911
+ getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
912
+ /**
913
+ * - create controller instances for context
914
+ * - init database (if enable) + migation scripts
915
+ */
916
+ initialize: (overrideOptions?: Models.TaonInitializeParams) => Promise<EndpointContext>;
917
+ /**
918
+ * realtime communication with server
919
+ * TCP(upgrade) socket.io (or ipc) based.
920
+ */
921
+ readonly realtime: {
922
+ readonly client: taon_browser.RealtimeClient;
923
+ readonly server: taon_browser.RealtimeServer;
924
+ };
925
+ };
926
+ 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>, MIDDLEWARES extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARES>) => {
927
+ readonly contextName: string;
928
+ readonly appId: string;
929
+ cloneAsRemote: (cloneOpt?: {
930
+ overrideRemoteHost?: string;
931
+ }) => /*elided*/ any;
932
+ cloneAsNormal: (cloneOpt?: {
933
+ overrideHost?: string;
934
+ }) => /*elided*/ any;
935
+ /**
936
+ * @deprecated
937
+ * - get reference to internal context
938
+ */
939
+ __ref(): Promise<EndpointContext>;
940
+ /**
941
+ * only for internal use
942
+ * @deprecated
943
+ */
944
+ readonly __refSync: EndpointContext;
945
+ getClassInstance<T>(ctor: new (...args: any[]) => T): T;
946
+ getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
947
+ /**
948
+ * - create controller instances for context
949
+ * - init database (if enable) + migation scripts
950
+ */
951
+ initialize: (overrideOptions?: Models.TaonInitializeParams) => Promise<EndpointContext>;
952
+ /**
953
+ * realtime communication with server
954
+ * TCP(upgrade) socket.io (or ipc) based.
955
+ */
956
+ readonly realtime: {
957
+ readonly client: taon_browser.RealtimeClient;
958
+ readonly server: taon_browser.RealtimeServer;
959
+ };
960
+ };
961
+ type TaonContext = ReturnType<typeof createContext>;
962
+
963
+ type TaonEntityKeysToOmit = 'ctrl' | 'clone' | '__endpoint_context__' | 'ctx' | 'inject' | '_' | 'relation' | 'relations' | 'inject' | 'injectRepo' | 'injectCustomRepository' | 'injectCustomRepo' | 'injectController' | 'injectCtrl' | 'injectProvider' | 'injectMiddleware';
964
+ declare const TaonEntityKeysToOmitArr: TaonEntityKeysToOmit[];
965
+
966
+ declare let TAON_CONTEXT: InjectionToken<TaonContext>;
967
+ declare let CURRENT_HOST_BACKEND_PORT: InjectionToken<number>;
968
+ declare let CURRENT_HOST_URL: InjectionToken<string>;
969
+
970
+ declare const apiPrefix = "api";
971
+
972
+ /**
973
+ * @deprecated
974
+ */
975
+ declare const getTransformFunction: (target: Function) => (entity: any) => any;
976
+ /**
977
+ * @deprecated
978
+ */
979
+ declare const singleTransform: (json: any) => any;
980
+ declare class EntityProcess {
981
+ /**
982
+ * Data from backend
983
+ */
984
+ private result;
985
+ private response;
986
+ static init(result: any, response: Response): Promise<void>;
987
+ /**
988
+ * Data to send
989
+ */
990
+ data: any;
991
+ /**
992
+ * Say yes to:
993
+ * - circural object
994
+ * - transform browser fn in decorator
995
+ */
996
+ private advancedManipulation;
997
+ private entityMapping;
998
+ private circural;
999
+ constructor(
1000
+ /**
1001
+ * Data from backend
1002
+ */
1003
+ result: any, response: Response);
1004
+ private checkAdvancedManiupulation;
1005
+ run(): Promise<void>;
1006
+ applayTransformFn(): void;
1007
+ setHeaders(): void;
1008
+ send(): void;
1009
+ }
1010
+
1011
+ declare const getResponseValue: <T>(response: Models.Http.Response<T>, options?: {
1012
+ req: Request<any>;
1013
+ res: Response<any>;
1014
+ }) => Promise<T>;
1015
+
1016
+ declare const inject: <T>(entity: () => new (...args: any[]) => T) => T;
1017
+
1018
+ interface TaonAdditionalMiddlewareMethodInfo {
1019
+ methodName: string;
1020
+ expressPath: string;
1021
+ httpRequestType: CoreModels.HttpMethod;
1022
+ }
1023
+ /**
1024
+ * TODO
1025
+ * - global provider available in all contexts
1026
+ * - provider available in own context
1027
+ */
1028
+ declare abstract class TaonBaseMiddleware extends TaonBaseInjector {
1029
+ }
1030
+ interface TaonBaseMiddleware {
1031
+ /**
1032
+ * Global interceptor for whole context
1033
+ * backend request
1034
+ */
1035
+ interceptServer({ req, res, next, }: TaonServerMiddlewareInterceptOptions): Promise<void> | void;
1036
+ /**
1037
+ * Global interceptor for whole context
1038
+ * client requests
1039
+ */
1040
+ interceptClient({ req, next, }: TaonClientMiddlewareInterceptOptions): Observable<AxiosResponse<any>>;
1041
+ /**
1042
+ * Specyfic controller method interceptor
1043
+ */
1044
+ interceptServerMethod({ req, res, next }: TaonServerMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType, }: TaonAdditionalMiddlewareMethodInfo): Promise<void> | void;
1045
+ /**
1046
+ * Controller method frontned interceptor
1047
+ * TODO not needed ?
1048
+ */
1049
+ interceptClientMethod({ req, next }: TaonClientMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType, }: TaonAdditionalMiddlewareMethodInfo): Observable<AxiosResponse<any>>;
1050
+ }
1051
+
1052
+ type TaonMiddlewareInheritanceObj = {
1053
+ [parentMiddlewaresName: string]: typeof TaonBaseMiddleware;
1054
+ };
1055
+ type TaonMiddlewareFunction = (options: {
1056
+ /**
1057
+ * middlewares inherited from parent class
1058
+ */
1059
+ parentMiddlewares: TaonMiddlewareInheritanceObj;
1060
+ /**
1061
+ * Get real class name - needed when code is minified
1062
+ */
1063
+ className: (middlewareClass: Function) => string;
1064
+ }) => TaonMiddlewareInheritanceObj;
1065
+ interface TaonHttpDecoratorOptions {
1066
+ /**
1067
+ * @deprecated don't use in production - keep stuff encapsulated
1068
+ * normally path is generated from method name and its params
1069
+ */
1070
+ path?: string;
1071
+ /**
1072
+ * If true, the path will be global
1073
+ *
1074
+ * ! BE CAREFUL ! global path IS NOT GLOBAL inside dockerized app
1075
+ * (/api/contextName is automatically added to global path in docker)
1076
+ *
1077
+ * @deprecated don't use in production - keep stuff encapsulated
1078
+ */
1079
+ pathIsGlobal?: boolean;
1080
+ overrideContentType?: CoreModels.ContentType;
1081
+ overrideResponseType?: Models$1.ResponseTypeAxios;
1082
+ /**
1083
+ * Express will send response as HTML string with proper headers
1084
+ */
1085
+ overrideExpressSendAsHtml?: boolean;
1086
+ middlewares?: TaonMiddlewareFunction;
1087
+ }
1088
+ declare function GET(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
1089
+ /**
1090
+ * Method for sending html website from text
1091
+ * Example
1092
+ *
1093
+ * ```ts
1094
+ * ...
1095
+ * // in your taon controller
1096
+ * ..Taon.Http.HTML()
1097
+ * sendHtmlDummyWebsite(): Taon.ResponseHtml {
1098
+ * return `
1099
+ <html>
1100
+ <head>
1101
+ <title>Dummy website</title>
1102
+ </head>
1103
+ <body>
1104
+ <h1>This is dummy website</h1>
1105
+ <p>Served as HTML string from Taon controller method</p>
1106
+ </body>
1107
+ </html>
1108
+ * `; *
1109
+ * }
1110
+ * ...
1111
+ * ```
1112
+ */
1113
+ declare function HTML(pathOrOptions?: Pick<TaonHttpDecoratorOptions, 'path' | 'pathIsGlobal'>): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
1114
+ declare function HEAD(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
1115
+ declare function POST(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
1116
+ declare function PUT(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
1117
+ declare function PATCH(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
1118
+ declare function DELETE(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
1119
+
1120
+ declare class ParamConfig {
1121
+ paramName: string;
1122
+ paramType: CoreModels.ParamType;
1123
+ index: number;
1124
+ defaultType: any;
1125
+ expireInSeconds?: number;
1126
+ }
1127
+
1128
+ /**
1129
+ * @link './decorators/http/http-methods-decorators.ts' TaonHttpDecoratorOptions
1130
+ */
1131
+ declare class MethodConfig implements Pick<TaonHttpDecoratorOptions, 'path' | 'middlewares'> {
1132
+ methodName: string;
1133
+ global?: boolean;
1134
+ /**
1135
+ * override default content type
1136
+ */
1137
+ contentType?: any;
1138
+ /**
1139
+ * override default axiso response type
1140
+ */
1141
+ responseType?: any;
1142
+ overrideExpressSendAsHtml?: boolean;
1143
+ path: string;
1144
+ descriptor: PropertyDescriptor;
1145
+ type: CoreModels.HttpMethod;
1146
+ parameters: {
1147
+ [paramName: string]: Partial<ParamConfig>;
1148
+ };
1149
+ /**
1150
+ * Middlewares from controller method options
1151
+ */
1152
+ middlewares?: TaonMiddlewareFunction;
1153
+ /**
1154
+ * Calculated middlewares object from parents controllers
1155
+ */
1156
+ calculatedMiddlewaresMethodObj?: TaonMiddlewareInheritanceObj;
1157
+ /**
1158
+ * Middlewares array in proper order and ready to be used in
1159
+ * express or in axios interceptors.
1160
+ */
1161
+ calculatedMiddlewares: (typeof TaonBaseMiddleware)[];
1162
+ }
1163
+
1164
+ declare namespace Validators {
1165
+ const classNameVlidation: (className: any, target: Function) => any;
1166
+ const checkIfMethodsWithReponseTYpeAlowed: (methods: MethodConfig[], current: MethodConfig) => void;
1167
+ const validateClassFunctions: (controllers: any[], entities: any[], proviers: any[], repositories: any[]) => void;
1168
+ const preventUndefinedModel: (model: any, id: any) => void;
1169
+ }
1170
+
1171
+ declare class TaonBaseClass<CloneT extends TaonBaseClass = any> {
1172
+ /**
1173
+ * class initialization hook
1174
+ * taon after class instance creation
1175
+ */
1176
+ _(): Promise<void>;
1177
+ /**
1178
+ *
1179
+ * @param overrideObjOrFn if object is provided it will override values in cloned object,
1180
+ * if function is provided it will be called with old cloned values and should return
1181
+ * object with values to override
1182
+ * @returns cloned instance of the class
1183
+ */
1184
+ clone(overrideObjOrFn?: Partial<CloneT> | ((oldValues: Partial<CloneT>) => Partial<CloneT>)): CloneT;
1185
+ }
1186
+
1187
+ declare abstract class TaonBaseEntity<
1188
+ /**
1189
+ * type for cloning
1190
+ */
1191
+ CloneT extends TaonBaseClass = any> extends TaonBaseClass<CloneT> {
1192
+ /**
1193
+ * simple check if relation is ok
1194
+ */
1195
+ relation(relationName: RelationPath<CloneT>): string;
1196
+ /**
1197
+ * simple check if relation is ok
1198
+ */
1199
+ relations(relationNames: RelationPath<CloneT>[]): string[];
1200
+ }
1201
+
1202
+ declare abstract class TaonBaseAbstractEntity<CloneT extends TaonBaseClass = any> extends TaonBaseEntity<CloneT> {
1203
+ id: string;
1204
+ version: number;
1205
+ }
1206
+ type AbstractEntityOmitKeys<ENTITY> = Omit<ENTITY, 'id' | 'version' | '_' | 'clone'>;
1207
+
1208
+ /**
1209
+ * TODO prevent calling methods when not initialized
1210
+ * with init(ctx)
1211
+ */
1212
+ declare abstract class TaonBaseAngularService {
1213
+ protected readonly platformId: Object;
1214
+ protected readonly currentContext: TaonContext;
1215
+ /**
1216
+ * @deprecated
1217
+ * current context host backend port (for localhost backend)
1218
+ */
1219
+ protected readonly CURRENT_HOST_BACKEND_PORT: number | undefined;
1220
+ /**
1221
+ * @deprecated
1222
+ * current context host URL (for localhost backend)
1223
+ */
1224
+ protected readonly CURRENT_HOST_URL: string | undefined;
1225
+ constructor();
1226
+ /**
1227
+ * Returns true if the application is running in SSR (server-side rendering) mode only.
1228
+ */
1229
+ get isSsrPlatform(): boolean;
1230
+ /**
1231
+ * Returns true if the application is running in browser-only mode.
1232
+ */
1233
+ get isBrowserPlatform(): boolean;
1234
+ /**
1235
+ * @deprecated
1236
+ * Returns the host URL for the backend service
1237
+ * that is running on localhost (normal NodeJS/ExpressJS mode).
1238
+ */
1239
+ get host(): string;
1240
+ injectController<T>(ctor: new (...args: any[]) => T,
1241
+ /**
1242
+ * optional override context
1243
+ */
1244
+ overrideCurrentContext?: TaonContext): T;
1245
+ static ɵfac: i0.ɵɵFactoryDeclaration<TaonBaseAngularService, never>;
1246
+ static ɵprov: i0.ɵɵInjectableDeclaration<TaonBaseAngularService>;
1247
+ }
1248
+
1249
+ declare const TaonBaseContext: {
1250
+ readonly contextName: string;
1251
+ readonly appId: string;
1252
+ cloneAsRemote: (cloneOpt?: {
1253
+ overrideRemoteHost?: string;
1254
+ }) => /*elided*/ any;
1255
+ cloneAsNormal: (cloneOpt?: {
1256
+ overrideHost?: string;
1257
+ }) => /*elided*/ any;
1258
+ __ref(): Promise<taon_browser.EndpointContext>;
1259
+ readonly __refSync: taon_browser.EndpointContext;
1260
+ getClassInstance<T>(ctor: new (...args: any[]) => T): T;
1261
+ getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
1262
+ initialize: (overrideOptions?: taon_browser.Models.TaonInitializeParams) => Promise<taon_browser.EndpointContext>;
1263
+ readonly realtime: {
1264
+ readonly client: taon_browser.RealtimeClient;
1265
+ readonly server: taon_browser.RealtimeServer;
1266
+ };
1267
+ };
1268
+
1269
+ interface MulterFileUploadResponse {
1270
+ ok: boolean;
1271
+ originalName: string;
1272
+ /**
1273
+ * name change to this to avoid confusion with originalname
1274
+ * (similar to originalname with added uniq part)
1275
+ */
1276
+ savedAs: string;
1277
+ size: number;
1278
+ mimetype: string;
1279
+ }
1280
+ declare class TaonBaseController<UPLOAD_FILE_QUERY_PARAMS = {}> extends TaonBaseInjector {
1281
+ /**
1282
+ * Hook that is called when taon app is inited
1283
+ * (all contexts are created and inited)
1284
+ */
1285
+ afterAllCtxInited(options: {
1286
+ ctxStorage: ContextsEndpointStorage;
1287
+ }): Promise<void>;
1288
+ uploadFormDataToServer(formData: FormData, queryParams?: UPLOAD_FILE_QUERY_PARAMS): Models.Http.Response<MulterFileUploadResponse[]>;
1289
+ /**
1290
+ * Hook after file is uploaded
1291
+ * through `uploadFormDataToServer` or `uploadLocalFileToServer`
1292
+ */
1293
+ protected afterFileUploadAction(file?: MulterFileUploadResponse, queryParams?: UPLOAD_FILE_QUERY_PARAMS): void | Promise<void>;
1294
+ uploadLocalFileToServer(absFilePath: string, options?: Pick<Models.Http.Rest.Ng2RestAxiosRequestConfig, 'onUploadProgress'>, queryParams?: UPLOAD_FILE_QUERY_PARAMS): Promise<MulterFileUploadResponse[]>;
1295
+ /**
1296
+ * Easy way to wait for status change with http (1s default) pooling.
1297
+ *
1298
+ * example (in sub class):
1299
+ * ```ts
1300
+ async check() {
1301
+ await this.waitForProperStatusChange({
1302
+ request: () => this.uploadFormDataToServer(void 0, void 0).request(),
1303
+ statusCheck: resp => resp.body.json[0].ok,
1304
+ });
1305
+ }
1306
+ * ```
1307
+ */
1308
+ _waitForProperStatusChange<T>(options: {
1309
+ actionName: string;
1310
+ /**
1311
+ * Request for pooling
1312
+ */
1313
+ request: (opt?: {
1314
+ /**
1315
+ * optional index number to identify request in logs
1316
+ * (starts from 0 and increments by 1 on each try)
1317
+ */
1318
+ reqIndexNum?: number;
1319
+ httpErrorsCount?: number;
1320
+ }) => ReturnType<Models.Http.Response<T>['request']>;
1321
+ poolingInterval?: number;
1322
+ /**
1323
+ * default infinite tries
1324
+ */
1325
+ maxTries?: number;
1326
+ /**
1327
+ * default infiniti allowed http errors
1328
+ */
1329
+ allowedHttpErrors?: number;
1330
+ /**
1331
+ * condition to be met
1332
+ */
1333
+ statusCheck?: (response: Awaited<ReturnType<typeof options.request>>) => boolean;
1334
+ /**
1335
+ * if return true.. loop will continue
1336
+ * if false .. will exit the loop
1337
+ */
1338
+ loopRequestsOnBackendError?: (opt: {
1339
+ unknownError: Error;
1340
+ unknownHttpError: HttpResponseError<any>;
1341
+ taonError: HttpResponseError<RestErrorResponseWrapper>;
1342
+ reqIndexNum?: number;
1343
+ httpErrorsCount?: number;
1344
+ }) => boolean | Promise<boolean>;
1345
+ }): Promise<void>;
1346
+ }
1347
+
1348
+ /**
1349
+ * Please override property entityClassFn with entity class.
1350
+ */
1351
+ declare abstract class TaonBaseCrudController<Entity, UPLOAD_FILE_QUERY_PARAMS = {}> extends TaonBaseController<UPLOAD_FILE_QUERY_PARAMS> {
1352
+ protected db: TaonBaseRepository<Entity>;
1353
+ /**
1354
+ * Please provide entity as class property entityClassFn:
1355
+ * @returns class function
1356
+ *
1357
+ */
1358
+ abstract entityClassResolveFn: () => any;
1359
+ _(): Promise<void>;
1360
+ bufforedChanges(id: number | string, property: string, alreadyLength?: number): Models.Http.Response<string | any[]>;
1361
+ pagination(pageNumber?: number, pageSize?: number, search?: string): Models.Http.Response<Entity[]>;
1362
+ getAll(): Models.Http.Response<Entity[]>;
1363
+ getBy(id: number | string): Models.Http.Response<Entity>;
1364
+ updateById(id: number | string, item: Entity): Models.Http.Response<Entity>;
1365
+ patchById(id: number | string, item: Entity): Models.Http.Response<Entity>;
1366
+ bulkUpdate(items: Entity[]): Models.Http.Response<Entity[]>;
1367
+ deleteById(id: number | string): Models.Http.Response<Entity>;
1368
+ bulkDelete(ids: (number | string)[]): Models.Http.Response<(number | string | Entity)[]>;
1369
+ clearTable(): Models.Http.Response<void>;
1370
+ save(item: Entity): Models.Http.Response<Entity>;
1371
+ bulkCreate(items: Entity): Models.Http.Response<Entity[]>;
1372
+ }
1373
+
1374
+ /**
1375
+ * Configurable file upload middleware (multer based)
1376
+ */
1377
+ declare class TaonBaseFileUploadMiddleware extends TaonBaseMiddleware {
1378
+ interceptServerMethod({ req, res, next }: TaonServerMiddlewareInterceptOptions, { methodName, expressPath }: TaonAdditionalMiddlewareMethodInfo): Promise<void>;
1379
+ uploadDir(): string;
1380
+ storage(): multer.StorageEngine;
1381
+ upload(): multer.Multer;
1382
+ middleware(): express__default.RequestHandler;
1383
+ }
1384
+
1385
+ declare class TaonBaseMigration extends TaonBaseInjector implements MigrationInterface {
1386
+ /**
1387
+ * by default is READY to run
1388
+ */
1389
+ isReadyToRun(): boolean;
1390
+ getDescription(): string;
1391
+ up(queryRunner: QueryRunner): Promise<any>;
1392
+ down(queryRunner: QueryRunner): Promise<any>;
1393
+ }
1394
+
1395
+ /**
1396
+ * TODO
1397
+ * - global provider available in all contexts
1398
+ * - provider available in own context
1399
+ */
1400
+ declare class TaonBaseProvider extends TaonBaseInjector {
1401
+ }
1402
+
1403
+ declare abstract class TaonBaseSubscriberForEntity<Entity = any> extends TaonBaseInjector implements EntitySubscriberInterface {
1404
+ abstract listenTo(): new (...args: any[]) => Entity;
1405
+ /**
1406
+ * Called after entity is loaded.
1407
+ */
1408
+ afterLoad(entity: any): void;
1409
+ /**
1410
+ * Called before query execution.
1411
+ */
1412
+ beforeQuery(event: any): void;
1413
+ /**
1414
+ * Called after query execution.
1415
+ */
1416
+ afterQuery(event: any): void;
1417
+ /**
1418
+ * Called before entity insertion.
1419
+ */
1420
+ beforeInsert(event: InsertEvent<any>): void;
1421
+ /**
1422
+ * Called after entity insertion.
1423
+ */
1424
+ afterInsert(event: InsertEvent<any>): void;
1425
+ /**
1426
+ * Called before entity update.
1427
+ */
1428
+ beforeUpdate(event: UpdateEvent<any>): void;
1429
+ /**
1430
+ * Called after entity update.
1431
+ */
1432
+ afterUpdate(event: UpdateEvent<any>): void;
1433
+ /**
1434
+ * Called before entity removal.
1435
+ */
1436
+ beforeRemove(event: RemoveEvent<any>): void;
1437
+ /**
1438
+ * Called after entity removal.
1439
+ */
1440
+ afterRemove(event: RemoveEvent<any>): void;
1441
+ /**
1442
+ * Called before entity removal.
1443
+ */
1444
+ beforeSoftRemove(event: SoftRemoveEvent<any>): void;
1445
+ /**
1446
+ * Called after entity removal.
1447
+ */
1448
+ afterSoftRemove(event: SoftRemoveEvent<any>): void;
1449
+ /**
1450
+ * Called before entity recovery.
1451
+ */
1452
+ beforeRecover(event: RecoverEvent<any>): void;
1453
+ /**
1454
+ * Called after entity recovery.
1455
+ */
1456
+ afterRecover(event: RecoverEvent<any>): void;
1457
+ /**
1458
+ * Called before transaction start.
1459
+ */
1460
+ beforeTransactionStart(event: TransactionStartEvent): void;
1461
+ /**
1462
+ * Called after transaction start.
1463
+ */
1464
+ afterTransactionStart(event: TransactionStartEvent): void;
1465
+ /**
1466
+ * Called before transaction commit.
1467
+ */
1468
+ beforeTransactionCommit(event: TransactionCommitEvent): void;
1469
+ /**
1470
+ * Called after transaction commit.
1471
+ */
1472
+ afterTransactionCommit(event: TransactionCommitEvent): void;
1473
+ /**
1474
+ * Called before transaction rollback.
1475
+ */
1476
+ beforeTransactionRollback(event: TransactionRollbackEvent): void;
1477
+ /**
1478
+ * Called after transaction rollback.
1479
+ */
1480
+ afterTransactionRollback(event: TransactionRollbackEvent): void;
1481
+ }
1482
+
1483
+ declare class DecoratorAbstractOpt {
1484
+ className: string;
1485
+ }
1486
+
1487
+ declare class TaonControllerOptions<ControllerClass = any> extends DecoratorAbstractOpt {
1488
+ /**
1489
+ * typeorm realtime subscribtion // TODO disabled for now, does not make sense ?s
1490
+ */
1491
+ realtime?: boolean;
1492
+ /**
1493
+ * override default path for controller api
1494
+ */
1495
+ path?: string;
1496
+ /**
1497
+ * Middlewares to be applied to all methods in the controller
1498
+ */
1499
+ middlewares?: TaonMiddlewareFunction;
1500
+ }
1501
+
1502
+ declare class ControllerConfig extends TaonControllerOptions {
1503
+ methods: {
1504
+ [methodName: string]: Partial<MethodConfig>;
1505
+ };
1506
+ /**
1507
+ * Calculated path from parents controllers
1508
+ */
1509
+ calculatedPath?: string;
1510
+ /**
1511
+ * a way to transform entity before sending to browser
1512
+ */
1513
+ browserTransformFn?: (entity: any) => any;
1514
+ /**
1515
+ * Calculated middlewares object from parents controllers
1516
+ */
1517
+ calculatedMiddlewaresControllerObj?: TaonMiddlewareInheritanceObj;
1518
+ }
1519
+ declare const controllerConfigFrom: (partial: Partial<ControllerConfig>) => ControllerConfig;
1520
+
1521
+ declare class DITaonContainer {
1522
+ private static instances;
1523
+ static resolve<T>(target: Function): T;
1524
+ static inject<T>(target: new (...args: any[]) => T): T;
1525
+ }
1526
+
1527
+ declare class FormlyHorizontalWrapper extends FieldWrapper {
1528
+ fieldComponent: ViewContainerRef;
1529
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormlyHorizontalWrapper, never>;
1530
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormlyHorizontalWrapper, "formly-horizontal-wrapper", never, {}, {}, never, never, false, never>;
1531
+ }
1532
+
1533
+ declare class RepeatTypeComponent extends FieldArrayType {
1534
+ get labelTemplate(): any;
1535
+ constructor(builder: FormlyFormBuilder);
1536
+ static ɵfac: i0.ɵɵFactoryDeclaration<RepeatTypeComponent, never>;
1537
+ static ɵcmp: i0.ɵɵComponentDeclaration<RepeatTypeComponent, "formly-repeat-section", never, {}, {}, never, never, false, never>;
1538
+ }
1539
+
1540
+ type FormlyInputType = 'input' | 'switch' | 'datepicker' | 'repeat' | 'group' | 'select';
1541
+
1542
+ declare function getFromlyConfigFor(target: Function, options?: {
1543
+ formType?: CoreModels.UIFramework;
1544
+ keysPathesToInclude?: string[];
1545
+ keysPathesToExclude?: string[];
1546
+ parentModel?: string;
1547
+ relativePath?: string;
1548
+ level?: number;
1549
+ maxLevel?: number;
1550
+ }): FormlyFieldConfig<_ngx_formly_core.FormlyFieldProps & {
1551
+ [additionalProperties: string]: any;
1552
+ }>[];
1553
+ type FormlyArrayTransformFn = (fieldsArray: FormlyFieldConfig[], fieldObject?: {
1554
+ [propKey: string]: FormlyFieldConfig;
1555
+ }) => FormlyFieldConfig[];
1556
+
1557
+ declare function findTypeForEntity(entity: Function, isArray?: boolean): FormlyEntityType;
1558
+ type FormlyEntityType = {
1559
+ name: string;
1560
+ component: Function;
1561
+ entity?: Function;
1562
+ isArray?: boolean;
1563
+ };
1564
+ declare function typeFromEntity(component: Function, entity?: Function | Function[]): {
1565
+ name: string;
1566
+ component: Function;
1567
+ entity: Function | Function[];
1568
+ isArray: boolean;
1569
+ };
1570
+ declare function typeFromName(component: Function, name: string): {
1571
+ name: string;
1572
+ component: Function;
1573
+ };
1574
+ declare function RegisterComponentTypeForEntity(entity: Function | Function[]): any;
1575
+ declare function RegisterComponentType(className: string, ...optionslNames: string[]): any;
1576
+ declare function getRegisteredComponents(): FormlyEntityType[];
1577
+
1578
+ declare namespace ClassHelpers {
1579
+ /**
1580
+ * TODO - repalce in every place when getting class fn from object
1581
+ */
1582
+ const getClassFnFromObject: (json: Object) => any;
1583
+ const getName: (classFnOrObject: any) => string;
1584
+ const getOrginalClass: (classFnOrObject: any) => any;
1585
+ const getFullInternalName: (classFnOrObject: any) => string;
1586
+ const getUniqueKey: (classFnOrObject: any) => string;
1587
+ const isContextClassObject: (obj: any) => boolean;
1588
+ const setName: (target: Function, className: string) => void;
1589
+ const hasParentClassWithName: (target: Function, className: string, targets?: any[]) => boolean;
1590
+ /**
1591
+ * Express async handler for middleware functions.
1592
+ */
1593
+ const asyncHandler: (fn: any) => (req: any, res: any, next: any) => void;
1594
+ const getMethodsNames: (classOrClassInstance: any, allMethodsNames?: any[]) => string[];
1595
+ const getControllerConfigs: (target: Function, configs?: ControllerConfig[], callerTarget?: Function) => ControllerConfig[];
1596
+ const ensureClassConfig: (target: Function) => Partial<ControllerConfig>;
1597
+ const ensureMethodConfig: (target: any, propertyKey: string | symbol) => Partial<MethodConfig>;
1598
+ const getClassConfig: (constructor: Function) => Partial<ControllerConfig> | undefined;
1599
+ }
1600
+
1601
+ declare const cloneObj: <CloneT>(override: Partial<CloneT>, classFn: Function) => CloneT;
1602
+
1603
+ declare namespace TaonHelpers {
1604
+ const fillUpTo: (s: string, nCharacters: number) => string;
1605
+ const isGoodPath: (p: string) => boolean;
1606
+ const firstStringOrElemFromArray: (stringOrArrayOfString: string[] | string) => string;
1607
+ const tryTransformParam: (param: any) => any;
1608
+ const getExpressPath: (c: ControllerConfig, pathOrClassConfig: Partial<MethodConfig>) => string;
1609
+ const defaultType: (value: any) => {};
1610
+ const parseJSONwithStringJSONs: (object: Object, waring?: boolean) => Object;
1611
+ const isPlainFileOrFolder: (filePath: any) => boolean;
1612
+ const ipcKeyNameResponse: (target: Function, methodConfig: Partial<MethodConfig>, expressPath: string) => string;
1613
+ const ipcKeyNameRequest: (target: Function, methodConfig: Partial<MethodConfig>, expressPath: string) => string;
1614
+ const websqlMocks: (headers: any) => {
1615
+ request: Express.Request;
1616
+ response: Express.Response;
1617
+ };
1618
+ }
1619
+
1620
+ /**
1621
+ * 100 default characters varchar
1622
+ */
1623
+ declare const StringColumn: <T = string>(defaultValue?: T, length?: number) => PropertyDecorator;
1624
+ /**
1625
+ * 100 characters varchar
1626
+ */
1627
+ declare const String100Column: <T = string>(defaultValue?: T) => PropertyDecorator;
1628
+ /**
1629
+ * 20 characters varchar
1630
+ */
1631
+ declare const String20Column: <T = string>(defaultValue?: T) => PropertyDecorator;
1632
+ /**
1633
+ * 45 characters varchar
1634
+ */
1635
+ declare const String45Column: <T = string>(defaultValue?: T) => PropertyDecorator;
1636
+ /**
1637
+ * 500 characters varchar
1638
+ */
1639
+ declare const String500Column: <T = string>(defaultValue?: T) => PropertyDecorator;
1640
+ /**
1641
+ * 200 characters varchar
1642
+ */
1643
+ declare const String200Column: <T = string>(defaultValue?: T) => PropertyDecorator;
1644
+ declare const NumberColumn: () => PropertyDecorator;
1645
+ declare const DecimalNumberColumn: () => PropertyDecorator;
1646
+ declare const SimpleJsonColumn: () => PropertyDecorator;
1647
+ declare const BooleanColumn: (defaultValue: boolean | null) => PropertyDecorator;
1648
+ declare const DateTimeColumn: (defaultValue?: boolean | null) => PropertyDecorator;
1649
+
1650
+ /**
1651
+ * Server for realtime communication
1652
+ * you can trigger:
1653
+ * - entity changes (any property in table changed)
1654
+ * - entity custom property changes (specific property changed)
1655
+ * - entity table changes (new instance added, instance removed)
1656
+ * - custom events
1657
+ *
1658
+ * and also listen to:
1659
+ * - custom events from yourself
1660
+ */
1661
+ declare class RealtimeServer {
1662
+ private core;
1663
+ constructor(core: RealtimeCore);
1664
+ private init;
1665
+ private triggerChanges;
1666
+ triggerEntityChanges(entityObjOrClass: Function | object,
1667
+ /**
1668
+ * value of unique key property of entity instance
1669
+ * (this value is not needed if entityObjOrClass is instance of entity)
1670
+ */
1671
+ idToTrigger?: number | string): void;
1672
+ triggerEntityPropertyChanges(entityObjOrClass: Function | object,
1673
+ /**
1674
+ * property name or array of property names that changed
1675
+ * for entity instance
1676
+ */
1677
+ property: string | string[],
1678
+ /**
1679
+ * value of unique key property of entity instance
1680
+ * (this value is not needed if entityObjOrClass is instance of entity)
1681
+ */
1682
+ idToTrigger?: number | string): void;
1683
+ triggerEntityTableChanges(entityClassOrInstance: Function | object): void;
1684
+ triggerCustomEvent(customEvent: string, dataToPush: any): void;
1685
+ /**
1686
+ * Listen to custom events from users
1687
+ * @param customEvent global event name
1688
+ */
1689
+ listenChangesCustomEvent(customEvent: string): Observable<any>;
1690
+ }
1691
+
1692
+ declare abstract class RealtimeStrategy {
1693
+ protected ctx: EndpointContext;
1694
+ constructor(ctx: EndpointContext);
1695
+ get ioClient(): typeof io;
1696
+ ioServer(url: string, opt: ServerOptions): Server$1<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>;
1697
+ abstract toString(): string;
1698
+ }
1699
+
1700
+ declare namespace RealtimeModels {
1701
+ type SubsManagerOpt = {
1702
+ core: RealtimeCore;
1703
+ customEvent: string;
1704
+ roomName: string;
1705
+ property: string;
1706
+ };
1707
+ interface ChangeOption {
1708
+ /**
1709
+ * Specify property name to listen changes on that property only;
1710
+ */
1711
+ property?: string;
1712
+ /**
1713
+ * Override custom event name to listen
1714
+ */
1715
+ customEvent?: string;
1716
+ /**
1717
+ * Value from entity object.
1718
+ * Key for this value is usually id or unique key
1719
+ * property defined in entity decorator.
1720
+ * TODO @LAST IMPLEMENT unique key support
1721
+ */
1722
+ idOrUniqValue?: any;
1723
+ }
1724
+ type EventHandler = (...args: any[]) => void;
1725
+ }
1726
+
1727
+ declare class MockServerIpc {
1728
+ contextName: string;
1729
+ static serverByContextName: Map<string, MockServerIpc>;
1730
+ static from(contextName: string): MockServerIpc;
1731
+ namespacesByName: Map<string, MockNamespaceIpc>;
1732
+ constructor(contextName: string);
1733
+ of(namespace: string): MockNamespaceIpc;
1734
+ }
1735
+ declare class MockNamespaceIpc {
1736
+ /**
1737
+ * Namespace name
1738
+ */
1739
+ name: string;
1740
+ server: MockServerIpc;
1741
+ electronClients: Set<Electron.WebContents>;
1742
+ roomsByRoomName: {
1743
+ [roomName: string]: Set<Electron.WebContents>;
1744
+ };
1745
+ private namespaceEventHandlers;
1746
+ constructor(
1747
+ /**
1748
+ * Namespace name
1749
+ */
1750
+ name: string, server: MockServerIpc);
1751
+ on(eventName: string, callback: RealtimeModels.EventHandler): any;
1752
+ off(event: string, callback?: RealtimeModels.EventHandler): any;
1753
+ emit(eventName: string, ...args: any[]): any;
1754
+ to(roomName: string): RoomEmitterIpc;
1755
+ in(roomName: string): RoomEmitterIpc;
1756
+ join(webContents: Electron.WebContents, roomName: string): void;
1757
+ leave(webContents: Electron.WebContents, roomName: string): void;
1758
+ path(): string;
1759
+ get nsp(): {
1760
+ readonly name: string;
1761
+ };
1762
+ }
1763
+ declare class RoomEmitterIpc {
1764
+ private electronClients;
1765
+ /**
1766
+ * namespace name
1767
+ */
1768
+ private name;
1769
+ private includeSender;
1770
+ private sender;
1771
+ constructor(electronClients: Set<Electron.WebContents>,
1772
+ /**
1773
+ * namespace name
1774
+ */
1775
+ name: string, includeSender?: boolean, sender?: MockSocketIpc);
1776
+ emit(eventName: string, ...args: any[]): void;
1777
+ }
1778
+ declare class MockSocketIpc {
1779
+ namespaceName: string;
1780
+ ipcRenderer: typeof ipcRenderer;
1781
+ private socketEventHandlers;
1782
+ get name(): string;
1783
+ /**
1784
+ * @param namespaceName instead url for ipc
1785
+ */
1786
+ constructor(namespaceName: string);
1787
+ on(eventName: string, callback: (event: any, ...args: any[]) => void): void;
1788
+ off(event: string, callback?: (event: any, ...args: any[]) => void): void;
1789
+ emit(event: string, ...args: any[]): void;
1790
+ }
1791
+ /**
1792
+ * Purpose:
1793
+ * - backend-browser communication between 2 processes in electron mode
1794
+ */
1795
+ declare class RealtimeStrategyIpc extends RealtimeStrategy {
1796
+ protected ctx: EndpointContext;
1797
+ toString(): string;
1798
+ constructor(ctx: EndpointContext);
1799
+ ioServer(__: string, opt: ServerOptions): any;
1800
+ get ioClient(): any;
1801
+ }
1802
+
1803
+ /**
1804
+ * Purpose:
1805
+ * - browser-browser communication mock (in websql mode)
1806
+ */
1807
+ declare class RealtimeStrategyMock extends RealtimeStrategy {
1808
+ protected ctx: EndpointContext;
1809
+ toString(): string;
1810
+ constructor(ctx: EndpointContext);
1811
+ ioServer(url: string, opt: ServerOptions): any;
1812
+ get ioClient(): any;
1813
+ }
1814
+
1815
+ /**
1816
+ * Purpose:
1817
+ * - backend-browser communication
1818
+ * - backend-backend communication
1819
+ */
1820
+ declare class RealtimeStrategySocketIO extends RealtimeStrategy {
1821
+ protected ctx: EndpointContext;
1822
+ toString(): string;
1823
+ constructor(ctx: EndpointContext);
1824
+ ioServer(...args: any[]): any;
1825
+ get ioClient(): typeof io;
1826
+ }
1827
+
1828
+ /**
1829
+ * Realtime class
1830
+ * - mock (when browser-browser)
1831
+ * - sockets (from socket io when backend-browser)
1832
+ * - ipc (when electron is used or between processes)
1833
+ * - webworker (when webworker is used in browser or nodejs)
1834
+ */
1835
+ declare class RealtimeCore {
1836
+ ctx: EndpointContext;
1837
+ readonly allHttpMethods: string[];
1838
+ readonly client: RealtimeClient;
1839
+ readonly server: RealtimeServer;
1840
+ readonly strategy: RealtimeStrategy;
1841
+ /**
1842
+ * global FE socket - only for established connection
1843
+ */
1844
+ conectSocketFE: Socket<DefaultEventsMap, DefaultEventsMap>;
1845
+ /**
1846
+ * socket for namespaces and rooms
1847
+ */
1848
+ socketFE: Socket<DefaultEventsMap, DefaultEventsMap>;
1849
+ /**
1850
+ * global BE socket - only for established connection
1851
+ */
1852
+ connectSocketBE: Server$1<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>;
1853
+ /**
1854
+ * socket for namespaces and rooms
1855
+ */
1856
+ socketBE: Server$1<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>;
1857
+ constructor(ctx: EndpointContext);
1858
+ private resolveStrategy;
1859
+ pathFor(namespace?: string): URL;
1860
+ }
1861
+
1862
+ /**
1863
+ * Client for realtime communication
1864
+ * you can listen to:
1865
+ * - entity changes (any property in table changed)
1866
+ * - entity custom property changes (specific property changed)
1867
+ * - entity table changes (new instance added, instance removed)
1868
+ * - custom events
1869
+ */
1870
+ declare class RealtimeClient {
1871
+ private core;
1872
+ private subsManagers;
1873
+ constructor(core: RealtimeCore);
1874
+ private init;
1875
+ /**
1876
+ * Usage:
1877
+ * myContext.realtimeClient.listenChangesEntity(myEntityInstance);
1878
+ *
1879
+ *
1880
+ * Changes trigger on backend needs to be done manually.. example code:
1881
+ *
1882
+ * myContext.realtimeServer.triggerEntityChanges(myEntityInstance);
1883
+ * ...
1884
+ */
1885
+ listenChangesEntity<RESULT = any>(entityClassFnOrObj: Function | object, options?: RealtimeModels.ChangeOption): Observable<RESULT>;
1886
+ /**
1887
+ * Listen changes entity table
1888
+ * Example: for pagination, lists update ...
1889
+ */
1890
+ listenChangesEntityTable<RESULT = any>(entityClassFn: Function): Observable<RESULT>;
1891
+ listenChangesCustomEvent<RESULT = any>(customEvent: string): Observable<RESULT>;
1892
+ /**
1893
+ * Trigger custom event on backend
1894
+ * @param customEvent global event name
1895
+ * @param dataToPush
1896
+ */
1897
+ triggerCustomEvent(customEvent: string, dataToPush?: any): void;
1898
+ private getUniqueIdentifierForConnection;
1899
+ }
1900
+
1901
+ declare class RealtimeSubsManager {
1902
+ private options;
1903
+ private isListening;
1904
+ private observers;
1905
+ constructor(options: RealtimeModels.SubsManagerOpt);
1906
+ startListenIfNotStarted(realtime: Socket<DefaultEventsMap, DefaultEventsMap>): void;
1907
+ add(observer: Subscriber<any>): void;
1908
+ remove(observer: Subscriber<any>): void;
1909
+ private update;
1910
+ }
1911
+
1912
+ /**
1913
+ * Controller decorator
1914
+ */
1915
+ declare function TaonController<ControllerClass = any>(options?: TaonControllerOptions<ControllerClass>): (constructor: Function) => void;
1916
+
1917
+ /**
1918
+ * Entity decorator
1919
+ */
1920
+ declare function TaonEntity<T = any>(options?: TaonEntityOptions<T>): (constructor: Function) => void;
1921
+ declare class TaonEntityOptions<T = any> extends DecoratorAbstractOpt {
1922
+ /**
1923
+ * default unique property is "id"
1924
+ * for your entity it may be something else
1925
+ */
1926
+ uniqueKeyProp?: string;
1927
+ createTable?: boolean;
1928
+ defaultModelValues?: Mapping.ModelValue<T>;
1929
+ defaultModelMapping?: Mapping.Mapping<T>;
1930
+ defaultModelMappingDeep?: {
1931
+ [lodashPathes: string]: string | [string];
1932
+ };
1933
+ }
1934
+
1935
+ /**
1936
+ * Provider decorator
1937
+ */
1938
+ declare function TaonMiddleware<T = any>(options?: TaonMiddlewareOptions<T>): (constructor: Function) => void;
1939
+ declare class TaonMiddlewareOptions<T = any> extends DecoratorAbstractOpt {
1940
+ }
1941
+
1942
+ /**
1943
+ * Migration decorator
1944
+ */
1945
+ declare function TaonMigration(options: TaonMigrationOptions): any;
1946
+ declare class TaonMigrationOptions<T = any> extends DecoratorAbstractOpt {
1947
+ }
1948
+
1949
+ /**
1950
+ * Provider decorator
1951
+ */
1952
+ declare function TaonProvider<T = any>(options?: TaonProviderOptions<T>): (constructor: Function) => void;
1953
+ declare class TaonProviderOptions<T = any> extends DecoratorAbstractOpt {
1954
+ }
1955
+
1956
+ /**
1957
+ * Repository decorator
1958
+ */
1959
+ declare function TaonRepository(options: TaonRepositoryOptions): (constructor: Function) => void;
1960
+ declare class TaonRepositoryOptions<T = any> extends DecoratorAbstractOpt {
1961
+ }
1962
+
1963
+ /**
1964
+ * Subscriber decorator
1965
+ */
1966
+ declare function TaonSubscriber<T = any>(options: TaonSubscriberOptions<T>): any;
1967
+ declare class TaonSubscriberOptions<T = any> extends DecoratorAbstractOpt {
1968
+ allowedEvents?: (keyof T)[];
1969
+ }
1970
+
1971
+ /**
1972
+ * @deprecated use Taon.Http.Param.Path (is more safe and cleaner)
1973
+ */
1974
+ declare function Path(name: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
1975
+ declare function Query(name?: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
1976
+ declare function Cookie(name: string, expireInSecond?: number): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
1977
+ declare function Header(name?: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
1978
+ declare function Body(name?: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
1979
+
1980
+ declare class TaonAdminService {
1981
+ private static _instance;
1982
+ static get Instance(): TaonAdminService;
1983
+ scrollableEnabled: boolean;
1984
+ private onEditMode;
1985
+ onEditMode$: rxjs.Observable<unknown>;
1986
+ adminPanelIsOpen: boolean;
1987
+ draggablePopupMode: boolean;
1988
+ draggablePopupModeFullScreen: boolean;
1989
+ /**
1990
+ * Property used in taon
1991
+ */
1992
+ keepWebsqlDbDataAfterReload: boolean;
1993
+ constructor();
1994
+ setEditMode(value: boolean): void;
1995
+ setKeepWebsqlDbDataAfterReload(value: boolean): void;
1996
+ enabledTabs: any[];
1997
+ hide(): void;
1998
+ show(): void;
1999
+ logout(): void;
2000
+ }
2001
+
2002
+ declare namespace Taon {
2003
+ /**
2004
+ * Remove global taon loader from env.ts [loading.preAngularBootstrap]
2005
+ */
2006
+ const removeLoader: (afterMS?: number) => Promise<void>;
2007
+ const error: (opt: Pick<RestErrorResponseWrapper, "message" | "status" | "details" | "code"> | string) => void;
2008
+ type ResponseHtml = Models.Http.Response<string>;
2009
+ export import Response = Models.Http.Response;
2010
+ export import StartParams = Models.StartParams;
2011
+ const getResponseValue: <T>(response: Response<T>, options?: {
2012
+ req: express.Request<any>;
2013
+ res: express.Response<any>;
2014
+ }) => Promise<T>;
2015
+ const isBrowser: boolean;
2016
+ const isNode: boolean;
2017
+ const isWebSQL: boolean;
2018
+ const isElectron: boolean;
2019
+ 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>, MIDDLEWARES extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARES>) => {
2020
+ readonly contextName: string;
2021
+ readonly appId: string;
2022
+ cloneAsRemote: (cloneOpt?: {
2023
+ overrideRemoteHost?: string;
2024
+ }) => /*elided*/ any;
2025
+ cloneAsNormal: (cloneOpt?: {
2026
+ overrideHost?: string;
2027
+ }) => /*elided*/ any;
2028
+ __ref(): Promise<EndpointContext>;
2029
+ readonly __refSync: EndpointContext;
2030
+ getClassInstance<T>(ctor: new (...args: any[]) => T): T;
2031
+ getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
2032
+ initialize: (overrideOptions?: Models.TaonInitializeParams) => Promise<EndpointContext>;
2033
+ readonly realtime: {
2034
+ readonly client: taon_browser.RealtimeClient;
2035
+ readonly server: taon_browser.RealtimeServer;
2036
+ };
2037
+ };
2038
+ const createContextTemplate: <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>, MIDDLEWARE extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARE>) => () => {
2039
+ readonly contextName: string;
2040
+ readonly appId: string;
2041
+ cloneAsRemote: (cloneOpt?: {
2042
+ overrideRemoteHost?: string;
2043
+ }) => /*elided*/ any;
2044
+ cloneAsNormal: (cloneOpt?: {
2045
+ overrideHost?: string;
2046
+ }) => /*elided*/ any;
2047
+ __ref(): Promise<EndpointContext>;
2048
+ readonly __refSync: EndpointContext;
2049
+ getClassInstance<T>(ctor: new (...args: any[]) => T): T;
2050
+ getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
2051
+ initialize: (overrideOptions?: Models.TaonInitializeParams) => Promise<EndpointContext>;
2052
+ readonly realtime: {
2053
+ readonly client: taon_browser.RealtimeClient;
2054
+ readonly server: taon_browser.RealtimeServer;
2055
+ };
2056
+ };
2057
+ const inject: <T>(entity: () => new (...args: any[]) => T) => T;
2058
+ const symbols: typeof Symbols;
2059
+ /**
2060
+ * @deprecated
2061
+ * use createContext instead
2062
+ */
2063
+ const init: (options: {
2064
+ host: string;
2065
+ entities: Function[];
2066
+ controllers: Function[];
2067
+ }) => Promise<{
2068
+ readonly contextName: string;
2069
+ readonly appId: string;
2070
+ cloneAsRemote: (cloneOpt?: {
2071
+ overrideRemoteHost?: string;
2072
+ }) => /*elided*/ any;
2073
+ cloneAsNormal: (cloneOpt?: {
2074
+ overrideHost?: string;
2075
+ }) => /*elided*/ any;
2076
+ __ref(): Promise<EndpointContext>;
2077
+ readonly __refSync: EndpointContext;
2078
+ getClassInstance<T>(ctor: new (...args: any[]) => T): T;
2079
+ getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
2080
+ initialize: (overrideOptions?: Models.TaonInitializeParams) => Promise<EndpointContext>;
2081
+ readonly realtime: {
2082
+ readonly client: taon_browser.RealtimeClient;
2083
+ readonly server: taon_browser.RealtimeServer;
2084
+ };
2085
+ }>;
2086
+ }
2087
+ declare const TAON_FLATTEN_MAPPING: {
2088
+ 'taon/src': {
2089
+ 'Taon.Http.GET': string;
2090
+ 'Taon.Http.POST': string;
2091
+ 'Taon.Http.PUT': string;
2092
+ 'Taon.Http.DELETE': string;
2093
+ 'Taon.Http.PATCH': string;
2094
+ 'Taon.Http.HEAD': string;
2095
+ 'Taon.Http.HTML': string;
2096
+ 'Taon.Http.Response': string;
2097
+ 'Taon.Http.Param.Query': string;
2098
+ 'Taon.Http.Param.Path': string;
2099
+ 'Taon.Http.Param.Body': string;
2100
+ 'Taon.Http.Param.Cookie': string;
2101
+ 'Taon.Http.Param.Header': string;
2102
+ 'Taon.Base.Controller': string;
2103
+ 'Taon.Base.CrudController': string;
2104
+ 'Taon.Base.Entity': string;
2105
+ 'Taon.Base.AbstractEntity': string;
2106
+ 'Taon.Base.AbstractEntityOmitKeys': string;
2107
+ 'Taon.Base.Provider': string;
2108
+ 'Taon.Base.Class': string;
2109
+ 'Taon.Base.Repository': string;
2110
+ 'Taon.Base.CustomRepository': string;
2111
+ 'Taon.Base.SubscriberForEntity': string;
2112
+ 'Taon.Base.Migration': string;
2113
+ 'Taon.Base.Middleware': string;
2114
+ 'Taon.Base.AngularService': string;
2115
+ 'Taon.Base.Context': string;
2116
+ 'Taon.Controller': string;
2117
+ 'Taon.Entity': string;
2118
+ 'Taon.Provider': string;
2119
+ 'Taon.Repository': string;
2120
+ 'Taon.Subscriber': string;
2121
+ 'Taon.Migration': string;
2122
+ 'Taon.Middleware': string;
2123
+ 'Taon.Orm.Repository': string;
2124
+ 'Taon.Orm.Connection': string;
2125
+ 'Taon.Orm.ListenEvent.AfterInsert': string;
2126
+ 'Taon.Orm.ListenEvent.AfterLoad': string;
2127
+ 'Taon.Orm.ListenEvent.AfterRecover': string;
2128
+ 'Taon.Orm.ListenEvent.AfterRemove': string;
2129
+ 'Taon.Orm.ListenEvent.AfterSoftRemove': string;
2130
+ 'Taon.Orm.ListenEvent.AfterUpdate': string;
2131
+ 'Taon.Orm.ListenEvent.BeforeInsert': string;
2132
+ 'Taon.Orm.ListenEvent.BeforeRecover': string;
2133
+ 'Taon.Orm.ListenEvent.BeforeRemove': string;
2134
+ 'Taon.Orm.ListenEvent.BeforeSoftRemove': string;
2135
+ 'Taon.Orm.ListenEvent.BeforeUpdate': string;
2136
+ 'Taon.Orm.Tree.Children': string;
2137
+ 'Taon.Orm.Tree.Parent': string;
2138
+ 'Taon.Orm.Column.Generated': string;
2139
+ 'Taon.Orm.Column.Primary': string;
2140
+ 'Taon.Orm.Column.Index': string;
2141
+ 'Taon.Orm.Column.CreateDate': string;
2142
+ 'Taon.Orm.Column.UpdateDate': string;
2143
+ 'Taon.Orm.Column.DeleteDate': string;
2144
+ 'Taon.Orm.Column.Custom': string;
2145
+ 'Taon.Orm.Column.String': string;
2146
+ 'Taon.Orm.Column.String100': string;
2147
+ 'Taon.Orm.Column.String45': string;
2148
+ 'Taon.Orm.Column.String500': string;
2149
+ 'Taon.Orm.Column.String200': string;
2150
+ 'Taon.Orm.Column.Number': string;
2151
+ 'Taon.Orm.Column.DecimalNumber': string;
2152
+ 'Taon.Orm.Column.SimpleJson': string;
2153
+ 'Taon.Orm.Column.Boolean': string;
2154
+ 'Taon.Orm.Column.DateTIme': string;
2155
+ 'Taon.Orm.Column.Version': string;
2156
+ 'Taon.Orm.Column.Virtual': string;
2157
+ 'Taon.Orm.Join.Table': string;
2158
+ 'Taon.Orm.Join.Column': string;
2159
+ 'Taon.Orm.Relation.OneToMany': string;
2160
+ 'Taon.Orm.Relation.OneToOne': string;
2161
+ 'Taon.Orm.Relation.ManyToMany': string;
2162
+ 'Taon.Orm.Relation.ManyToOne': string;
2163
+ };
2164
+ 'taon-storage/src': {
2165
+ 'Stor.Property.In.LocalStorage': string;
2166
+ 'Stor.Property.In.IndexedDb': string;
2167
+ 'Stor.In.LocalStorage': string;
2168
+ 'Stor.In.IndexedDb': string;
2169
+ 'Stor.property.in.localstorage': string;
2170
+ 'Stor.property.in.indexedb': string;
2171
+ 'Stor.property.in.indexedDb': string;
2172
+ 'Stor.proper.in.localstorage': string;
2173
+ 'Stor.proper.in.indexedb': string;
2174
+ };
2175
+ };
2176
+
2177
+ export { BaseTaonClassesNames, Body, BooleanColumn, CURRENT_HOST_BACKEND_PORT, CURRENT_HOST_URL, ClassHelpers, ContextDbMigrations, ContextsEndpointStorage, ControllerConfig, Cookie, DELETE, DITaonContainer, DateTimeColumn, DecimalNumberColumn, DecoratorAbstractOpt, EndpointContext, EntityProcess, FormlyHorizontalWrapper, GET, HEAD, HTML, Header, MethodConfig, MockNamespaceIpc, MockServerIpc, MockSocketIpc, Models, NumberColumn, PATCH, POST, PUT, ParamConfig, Path, Query, RealtimeClient, RealtimeCore, RealtimeModels, RealtimeServer, RealtimeStrategy, RealtimeStrategyIpc, RealtimeStrategyMock, RealtimeStrategySocketIO, RealtimeSubsManager, RegisterComponentType, RegisterComponentTypeForEntity, RepeatTypeComponent, SimpleJsonColumn, String100Column, String200Column, String20Column, String45Column, String500Column, StringColumn, Symbols, TAON_CONTEXT, TAON_FLATTEN_MAPPING, Taon, TaonAdminService, TaonBaseAbstractEntity, TaonBaseAngularService, TaonBaseClass, TaonBaseContext, TaonBaseController, TaonBaseCrudController, TaonBaseCustomRepository, TaonBaseEntity, TaonBaseFileUploadMiddleware, TaonBaseInjector, TaonBaseMiddleware, TaonBaseMigration, TaonBaseProvider, TaonBaseRepository, TaonBaseSubscriberForEntity, TaonController, TaonControllerOptions, TaonEntity, TaonEntityKeysToOmitArr, TaonEntityOptions, TaonHelpers, TaonMiddleware, TaonMiddlewareOptions, TaonMigration, TaonMigrationOptions, TaonProvider, TaonProviderOptions, TaonRepository, TaonRepositoryOptions, TaonRestResponseWrapper, TaonSubscriber, TaonSubscriberOptions, TaonTempDatabasesFolder, TaonTempRoutesFolder, Validators, apiPrefix, cloneObj, controllerConfigFrom, createContext, createContextTemplate, findTypeForEntity, getFromlyConfigFor, getRegisteredComponents, getResponseValue, getTransformFunction, inject, singleTransform, typeFromEntity, typeFromName };
2178
+ export type { AbstractEntityOmitKeys, FormlyArrayTransformFn, FormlyEntityType, FormlyInputType, MigrationStatus, MulterFileUploadResponse, TaonAdditionalMiddlewareMethodInfo, TaonContext, TaonEntityKeysToOmit, TaonHttpDecoratorOptions, TaonMiddlewareFunction, TaonMiddlewareInheritanceObj };