@zyno-io/ts-server-foundation 26.712.36

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 (771) hide show
  1. package/README.md +31 -0
  2. package/dist/devconsole/assets/index-BlWLbczn.css +1 -0
  3. package/dist/devconsole/assets/index-lSF6DUY3.js +3 -0
  4. package/dist/devconsole/index.html +13 -0
  5. package/dist/src/app/base.d.ts +66 -0
  6. package/dist/src/app/base.d.ts.map +1 -0
  7. package/dist/src/app/base.js +577 -0
  8. package/dist/src/app/base.js.map +1 -0
  9. package/dist/src/app/commands.d.ts +20 -0
  10. package/dist/src/app/commands.d.ts.map +1 -0
  11. package/dist/src/app/commands.js +17 -0
  12. package/dist/src/app/commands.js.map +1 -0
  13. package/dist/src/app/config-loader.d.ts +9 -0
  14. package/dist/src/app/config-loader.d.ts.map +1 -0
  15. package/dist/src/app/config-loader.js +91 -0
  16. package/dist/src/app/config-loader.js.map +1 -0
  17. package/dist/src/app/config.d.ts +96 -0
  18. package/dist/src/app/config.d.ts.map +1 -0
  19. package/dist/src/app/config.js +114 -0
  20. package/dist/src/app/config.js.map +1 -0
  21. package/dist/src/app/const.d.ts +5 -0
  22. package/dist/src/app/const.d.ts.map +1 -0
  23. package/dist/src/app/const.js +17 -0
  24. package/dist/src/app/const.js.map +1 -0
  25. package/dist/src/app/current.d.ts +5 -0
  26. package/dist/src/app/current.d.ts.map +1 -0
  27. package/dist/src/app/current.js +14 -0
  28. package/dist/src/app/current.js.map +1 -0
  29. package/dist/src/app/index.d.ts +8 -0
  30. package/dist/src/app/index.d.ts.map +1 -0
  31. package/dist/src/app/index.js +13 -0
  32. package/dist/src/app/index.js.map +1 -0
  33. package/dist/src/app/lifecycle.d.ts +9 -0
  34. package/dist/src/app/lifecycle.d.ts.map +1 -0
  35. package/dist/src/app/lifecycle.js +21 -0
  36. package/dist/src/app/lifecycle.js.map +1 -0
  37. package/dist/src/app/migrations-entrypoint.d.ts +3 -0
  38. package/dist/src/app/migrations-entrypoint.d.ts.map +1 -0
  39. package/dist/src/app/migrations-entrypoint.js +35 -0
  40. package/dist/src/app/migrations-entrypoint.js.map +1 -0
  41. package/dist/src/app/resolver.d.ts +6 -0
  42. package/dist/src/app/resolver.d.ts.map +1 -0
  43. package/dist/src/app/resolver.js +15 -0
  44. package/dist/src/app/resolver.js.map +1 -0
  45. package/dist/src/auth/index.d.ts +3 -0
  46. package/dist/src/auth/index.d.ts.map +1 -0
  47. package/dist/src/auth/index.js +15 -0
  48. package/dist/src/auth/index.js.map +1 -0
  49. package/dist/src/auth/jwt.d.ts +61 -0
  50. package/dist/src/auth/jwt.d.ts.map +1 -0
  51. package/dist/src/auth/jwt.js +379 -0
  52. package/dist/src/auth/jwt.js.map +1 -0
  53. package/dist/src/auth/provider.d.ts +21 -0
  54. package/dist/src/auth/provider.d.ts.map +1 -0
  55. package/dist/src/auth/provider.js +148 -0
  56. package/dist/src/auth/provider.js.map +1 -0
  57. package/dist/src/cli/common.d.ts +13 -0
  58. package/dist/src/cli/common.d.ts.map +1 -0
  59. package/dist/src/cli/common.js +99 -0
  60. package/dist/src/cli/common.js.map +1 -0
  61. package/dist/src/cli/tsf-create-app.d.ts +3 -0
  62. package/dist/src/cli/tsf-create-app.d.ts.map +1 -0
  63. package/dist/src/cli/tsf-create-app.js +89 -0
  64. package/dist/src/cli/tsf-create-app.js.map +1 -0
  65. package/dist/src/cli/tsf-dev.d.ts +3 -0
  66. package/dist/src/cli/tsf-dev.d.ts.map +1 -0
  67. package/dist/src/cli/tsf-dev.js +753 -0
  68. package/dist/src/cli/tsf-dev.js.map +1 -0
  69. package/dist/src/cli/tsf-gen-proto.d.ts +3 -0
  70. package/dist/src/cli/tsf-gen-proto.d.ts.map +1 -0
  71. package/dist/src/cli/tsf-gen-proto.js +134 -0
  72. package/dist/src/cli/tsf-gen-proto.js.map +1 -0
  73. package/dist/src/cli/tsf-install.d.ts +8 -0
  74. package/dist/src/cli/tsf-install.d.ts.map +1 -0
  75. package/dist/src/cli/tsf-install.js +424 -0
  76. package/dist/src/cli/tsf-install.js.map +1 -0
  77. package/dist/src/cli/tsf-migrate.d.ts +3 -0
  78. package/dist/src/cli/tsf-migrate.d.ts.map +1 -0
  79. package/dist/src/cli/tsf-migrate.js +271 -0
  80. package/dist/src/cli/tsf-migrate.js.map +1 -0
  81. package/dist/src/cli/tsf-test.d.ts +4 -0
  82. package/dist/src/cli/tsf-test.d.ts.map +1 -0
  83. package/dist/src/cli/tsf-test.js +350 -0
  84. package/dist/src/cli/tsf-test.js.map +1 -0
  85. package/dist/src/cli/tsf-update.d.ts +3 -0
  86. package/dist/src/cli/tsf-update.d.ts.map +1 -0
  87. package/dist/src/cli/tsf-update.js +12 -0
  88. package/dist/src/cli/tsf-update.js.map +1 -0
  89. package/dist/src/cli/tsf.d.ts +3 -0
  90. package/dist/src/cli/tsf.d.ts.map +1 -0
  91. package/dist/src/cli/tsf.js +29 -0
  92. package/dist/src/cli/tsf.js.map +1 -0
  93. package/dist/src/database/database.d.ts +54 -0
  94. package/dist/src/database/database.d.ts.map +1 -0
  95. package/dist/src/database/database.js +695 -0
  96. package/dist/src/database/database.js.map +1 -0
  97. package/dist/src/database/driver.d.ts +28 -0
  98. package/dist/src/database/driver.d.ts.map +1 -0
  99. package/dist/src/database/driver.js +5 -0
  100. package/dist/src/database/driver.js.map +1 -0
  101. package/dist/src/database/drivers/index.d.ts +4 -0
  102. package/dist/src/database/drivers/index.d.ts.map +1 -0
  103. package/dist/src/database/drivers/index.js +9 -0
  104. package/dist/src/database/drivers/index.js.map +1 -0
  105. package/dist/src/database/drivers/mysql-session-rpc.d.ts +40 -0
  106. package/dist/src/database/drivers/mysql-session-rpc.d.ts.map +1 -0
  107. package/dist/src/database/drivers/mysql-session-rpc.js +180 -0
  108. package/dist/src/database/drivers/mysql-session-rpc.js.map +1 -0
  109. package/dist/src/database/drivers/mysql-session.d.ts +25 -0
  110. package/dist/src/database/drivers/mysql-session.d.ts.map +1 -0
  111. package/dist/src/database/drivers/mysql-session.js +124 -0
  112. package/dist/src/database/drivers/mysql-session.js.map +1 -0
  113. package/dist/src/database/drivers/mysql.d.ts +20 -0
  114. package/dist/src/database/drivers/mysql.d.ts.map +1 -0
  115. package/dist/src/database/drivers/mysql.js +84 -0
  116. package/dist/src/database/drivers/mysql.js.map +1 -0
  117. package/dist/src/database/drivers/postgres.d.ts +22 -0
  118. package/dist/src/database/drivers/postgres.d.ts.map +1 -0
  119. package/dist/src/database/drivers/postgres.js +80 -0
  120. package/dist/src/database/drivers/postgres.js.map +1 -0
  121. package/dist/src/database/entity.d.ts +112 -0
  122. package/dist/src/database/entity.d.ts.map +1 -0
  123. package/dist/src/database/entity.js +333 -0
  124. package/dist/src/database/entity.js.map +1 -0
  125. package/dist/src/database/errors.d.ts +7 -0
  126. package/dist/src/database/errors.d.ts.map +1 -0
  127. package/dist/src/database/errors.js +34 -0
  128. package/dist/src/database/errors.js.map +1 -0
  129. package/dist/src/database/factory.d.ts +48 -0
  130. package/dist/src/database/factory.d.ts.map +1 -0
  131. package/dist/src/database/factory.js +139 -0
  132. package/dist/src/database/factory.js.map +1 -0
  133. package/dist/src/database/identifiers.d.ts +8 -0
  134. package/dist/src/database/identifiers.d.ts.map +1 -0
  135. package/dist/src/database/identifiers.js +46 -0
  136. package/dist/src/database/identifiers.js.map +1 -0
  137. package/dist/src/database/index.d.ts +14 -0
  138. package/dist/src/database/index.d.ts.map +1 -0
  139. package/dist/src/database/index.js +33 -0
  140. package/dist/src/database/index.js.map +1 -0
  141. package/dist/src/database/metadata.d.ts +27 -0
  142. package/dist/src/database/metadata.d.ts.map +1 -0
  143. package/dist/src/database/metadata.js +70 -0
  144. package/dist/src/database/metadata.js.map +1 -0
  145. package/dist/src/database/migration/create/comparator.d.ts +3 -0
  146. package/dist/src/database/migration/create/comparator.d.ts.map +1 -0
  147. package/dist/src/database/migration/create/comparator.js +302 -0
  148. package/dist/src/database/migration/create/comparator.js.map +1 -0
  149. package/dist/src/database/migration/create/db-reader.d.ts +9 -0
  150. package/dist/src/database/migration/create/db-reader.d.ts.map +1 -0
  151. package/dist/src/database/migration/create/db-reader.js +478 -0
  152. package/dist/src/database/migration/create/db-reader.js.map +1 -0
  153. package/dist/src/database/migration/create/ddl-generator.d.ts +4 -0
  154. package/dist/src/database/migration/create/ddl-generator.d.ts.map +1 -0
  155. package/dist/src/database/migration/create/ddl-generator.js +431 -0
  156. package/dist/src/database/migration/create/ddl-generator.js.map +1 -0
  157. package/dist/src/database/migration/create/entity-reader.d.ts +7 -0
  158. package/dist/src/database/migration/create/entity-reader.d.ts.map +1 -0
  159. package/dist/src/database/migration/create/entity-reader.js +169 -0
  160. package/dist/src/database/migration/create/entity-reader.js.map +1 -0
  161. package/dist/src/database/migration/create/file-generator.d.ts +7 -0
  162. package/dist/src/database/migration/create/file-generator.d.ts.map +1 -0
  163. package/dist/src/database/migration/create/file-generator.js +60 -0
  164. package/dist/src/database/migration/create/file-generator.js.map +1 -0
  165. package/dist/src/database/migration/create/index.d.ts +19 -0
  166. package/dist/src/database/migration/create/index.d.ts.map +1 -0
  167. package/dist/src/database/migration/create/index.js +102 -0
  168. package/dist/src/database/migration/create/index.js.map +1 -0
  169. package/dist/src/database/migration/create/schema-model.d.ts +99 -0
  170. package/dist/src/database/migration/create/schema-model.d.ts.map +1 -0
  171. package/dist/src/database/migration/create/schema-model.js +24 -0
  172. package/dist/src/database/migration/create/schema-model.js.map +1 -0
  173. package/dist/src/database/migration/create/type-mapper.d.ts +13 -0
  174. package/dist/src/database/migration/create/type-mapper.d.ts.map +1 -0
  175. package/dist/src/database/migration/create/type-mapper.js +293 -0
  176. package/dist/src/database/migration/create/type-mapper.js.map +1 -0
  177. package/dist/src/database/migration/index.d.ts +33 -0
  178. package/dist/src/database/migration/index.d.ts.map +1 -0
  179. package/dist/src/database/migration/index.js +165 -0
  180. package/dist/src/database/migration/index.js.map +1 -0
  181. package/dist/src/database/migration/maintenance.d.ts +26 -0
  182. package/dist/src/database/migration/maintenance.d.ts.map +1 -0
  183. package/dist/src/database/migration/maintenance.js +65 -0
  184. package/dist/src/database/migration/maintenance.js.map +1 -0
  185. package/dist/src/database/query.d.ts +79 -0
  186. package/dist/src/database/query.d.ts.map +1 -0
  187. package/dist/src/database/query.js +435 -0
  188. package/dist/src/database/query.js.map +1 -0
  189. package/dist/src/database/schema.d.ts +147 -0
  190. package/dist/src/database/schema.d.ts.map +1 -0
  191. package/dist/src/database/schema.js +709 -0
  192. package/dist/src/database/schema.js.map +1 -0
  193. package/dist/src/database/session.d.ts +63 -0
  194. package/dist/src/database/session.d.ts.map +1 -0
  195. package/dist/src/database/session.js +226 -0
  196. package/dist/src/database/session.js.map +1 -0
  197. package/dist/src/database/sql.d.ts +37 -0
  198. package/dist/src/database/sql.d.ts.map +1 -0
  199. package/dist/src/database/sql.js +143 -0
  200. package/dist/src/database/sql.js.map +1 -0
  201. package/dist/src/database/values.d.ts +6 -0
  202. package/dist/src/database/values.d.ts.map +1 -0
  203. package/dist/src/database/values.js +237 -0
  204. package/dist/src/database/values.js.map +1 -0
  205. package/dist/src/devconsole/controller.d.ts +11 -0
  206. package/dist/src/devconsole/controller.d.ts.map +1 -0
  207. package/dist/src/devconsole/controller.js +78 -0
  208. package/dist/src/devconsole/controller.js.map +1 -0
  209. package/dist/src/devconsole/generated/devconsole.d.ts +306 -0
  210. package/dist/src/devconsole/generated/devconsole.d.ts.map +1 -0
  211. package/dist/src/devconsole/generated/devconsole.js +4029 -0
  212. package/dist/src/devconsole/generated/devconsole.js.map +1 -0
  213. package/dist/src/devconsole/index.d.ts +10 -0
  214. package/dist/src/devconsole/index.d.ts.map +1 -0
  215. package/dist/src/devconsole/index.js +26 -0
  216. package/dist/src/devconsole/index.js.map +1 -0
  217. package/dist/src/devconsole/observers.d.ts +4 -0
  218. package/dist/src/devconsole/observers.d.ts.map +1 -0
  219. package/dist/src/devconsole/observers.js +170 -0
  220. package/dist/src/devconsole/observers.js.map +1 -0
  221. package/dist/src/devconsole/runtime.d.ts +16 -0
  222. package/dist/src/devconsole/runtime.d.ts.map +1 -0
  223. package/dist/src/devconsole/runtime.js +48 -0
  224. package/dist/src/devconsole/runtime.js.map +1 -0
  225. package/dist/src/devconsole/security.d.ts +8 -0
  226. package/dist/src/devconsole/security.d.ts.map +1 -0
  227. package/dist/src/devconsole/security.js +33 -0
  228. package/dist/src/devconsole/security.js.map +1 -0
  229. package/dist/src/devconsole/server.d.ts +25 -0
  230. package/dist/src/devconsole/server.d.ts.map +1 -0
  231. package/dist/src/devconsole/server.js +452 -0
  232. package/dist/src/devconsole/server.js.map +1 -0
  233. package/dist/src/devconsole/store.d.ts +111 -0
  234. package/dist/src/devconsole/store.d.ts.map +1 -0
  235. package/dist/src/devconsole/store.js +177 -0
  236. package/dist/src/devconsole/store.js.map +1 -0
  237. package/dist/src/di/container.d.ts +38 -0
  238. package/dist/src/di/container.d.ts.map +1 -0
  239. package/dist/src/di/container.js +252 -0
  240. package/dist/src/di/container.js.map +1 -0
  241. package/dist/src/di/errors.d.ts +18 -0
  242. package/dist/src/di/errors.d.ts.map +1 -0
  243. package/dist/src/di/errors.js +71 -0
  244. package/dist/src/di/errors.js.map +1 -0
  245. package/dist/src/di/index.d.ts +5 -0
  246. package/dist/src/di/index.d.ts.map +1 -0
  247. package/dist/src/di/index.js +10 -0
  248. package/dist/src/di/index.js.map +1 -0
  249. package/dist/src/di/module.d.ts +29 -0
  250. package/dist/src/di/module.d.ts.map +1 -0
  251. package/dist/src/di/module.js +42 -0
  252. package/dist/src/di/module.js.map +1 -0
  253. package/dist/src/di/provider.d.ts +34 -0
  254. package/dist/src/di/provider.d.ts.map +1 -0
  255. package/dist/src/di/provider.js +24 -0
  256. package/dist/src/di/provider.js.map +1 -0
  257. package/dist/src/env.d.ts +122 -0
  258. package/dist/src/env.d.ts.map +1 -0
  259. package/dist/src/env.js +61 -0
  260. package/dist/src/env.js.map +1 -0
  261. package/dist/src/events/event-bus.d.ts +26 -0
  262. package/dist/src/events/event-bus.d.ts.map +1 -0
  263. package/dist/src/events/event-bus.js +67 -0
  264. package/dist/src/events/event-bus.js.map +1 -0
  265. package/dist/src/events/index.d.ts +2 -0
  266. package/dist/src/events/index.d.ts.map +1 -0
  267. package/dist/src/events/index.js +7 -0
  268. package/dist/src/events/index.js.map +1 -0
  269. package/dist/src/health/healthcheck.controller.d.ts +9 -0
  270. package/dist/src/health/healthcheck.controller.d.ts.map +1 -0
  271. package/dist/src/health/healthcheck.controller.js +33 -0
  272. package/dist/src/health/healthcheck.controller.js.map +1 -0
  273. package/dist/src/health/healthcheck.service.d.ts +13 -0
  274. package/dist/src/health/healthcheck.service.d.ts.map +1 -0
  275. package/dist/src/health/healthcheck.service.js +37 -0
  276. package/dist/src/health/healthcheck.service.js.map +1 -0
  277. package/dist/src/health/index.d.ts +3 -0
  278. package/dist/src/health/index.d.ts.map +1 -0
  279. package/dist/src/health/index.js +8 -0
  280. package/dist/src/health/index.js.map +1 -0
  281. package/dist/src/helpers/async/context.d.ts +10 -0
  282. package/dist/src/helpers/async/context.d.ts.map +1 -0
  283. package/dist/src/helpers/async/context.js +52 -0
  284. package/dist/src/helpers/async/context.js.map +1 -0
  285. package/dist/src/helpers/async/process.d.ts +16 -0
  286. package/dist/src/helpers/async/process.d.ts.map +1 -0
  287. package/dist/src/helpers/async/process.js +62 -0
  288. package/dist/src/helpers/async/process.js.map +1 -0
  289. package/dist/src/helpers/async/promise.d.ts +11 -0
  290. package/dist/src/helpers/async/promise.d.ts.map +1 -0
  291. package/dist/src/helpers/async/promise.js +32 -0
  292. package/dist/src/helpers/async/promise.js.map +1 -0
  293. package/dist/src/helpers/data/array.d.ts +5 -0
  294. package/dist/src/helpers/data/array.d.ts.map +1 -0
  295. package/dist/src/helpers/data/array.js +27 -0
  296. package/dist/src/helpers/data/array.js.map +1 -0
  297. package/dist/src/helpers/data/objects.d.ts +13 -0
  298. package/dist/src/helpers/data/objects.d.ts.map +1 -0
  299. package/dist/src/helpers/data/objects.js +55 -0
  300. package/dist/src/helpers/data/objects.js.map +1 -0
  301. package/dist/src/helpers/data/serialization.d.ts +5 -0
  302. package/dist/src/helpers/data/serialization.d.ts.map +1 -0
  303. package/dist/src/helpers/data/serialization.js +25 -0
  304. package/dist/src/helpers/data/serialization.js.map +1 -0
  305. package/dist/src/helpers/data/transformer.d.ts +13 -0
  306. package/dist/src/helpers/data/transformer.d.ts.map +1 -0
  307. package/dist/src/helpers/data/transformer.js +50 -0
  308. package/dist/src/helpers/data/transformer.js.map +1 -0
  309. package/dist/src/helpers/index.d.ts +19 -0
  310. package/dist/src/helpers/index.d.ts.map +1 -0
  311. package/dist/src/helpers/index.js +30 -0
  312. package/dist/src/helpers/index.js.map +1 -0
  313. package/dist/src/helpers/io/package.d.ts +10 -0
  314. package/dist/src/helpers/io/package.d.ts.map +1 -0
  315. package/dist/src/helpers/io/package.js +35 -0
  316. package/dist/src/helpers/io/package.js.map +1 -0
  317. package/dist/src/helpers/io/stream.d.ts +18 -0
  318. package/dist/src/helpers/io/stream.d.ts.map +1 -0
  319. package/dist/src/helpers/io/stream.js +131 -0
  320. package/dist/src/helpers/io/stream.js.map +1 -0
  321. package/dist/src/helpers/redis/broadcast.d.ts +15 -0
  322. package/dist/src/helpers/redis/broadcast.d.ts.map +1 -0
  323. package/dist/src/helpers/redis/broadcast.js +93 -0
  324. package/dist/src/helpers/redis/broadcast.js.map +1 -0
  325. package/dist/src/helpers/redis/cache.d.ts +20 -0
  326. package/dist/src/helpers/redis/cache.d.ts.map +1 -0
  327. package/dist/src/helpers/redis/cache.js +57 -0
  328. package/dist/src/helpers/redis/cache.js.map +1 -0
  329. package/dist/src/helpers/redis/mutex.d.ts +45 -0
  330. package/dist/src/helpers/redis/mutex.d.ts.map +1 -0
  331. package/dist/src/helpers/redis/mutex.js +446 -0
  332. package/dist/src/helpers/redis/mutex.js.map +1 -0
  333. package/dist/src/helpers/redis/redis.d.ts +12 -0
  334. package/dist/src/helpers/redis/redis.d.ts.map +1 -0
  335. package/dist/src/helpers/redis/redis.js +62 -0
  336. package/dist/src/helpers/redis/redis.js.map +1 -0
  337. package/dist/src/helpers/security/crypto.d.ts +31 -0
  338. package/dist/src/helpers/security/crypto.d.ts.map +1 -0
  339. package/dist/src/helpers/security/crypto.js +108 -0
  340. package/dist/src/helpers/security/crypto.js.map +1 -0
  341. package/dist/src/helpers/security/validation.d.ts +3 -0
  342. package/dist/src/helpers/security/validation.d.ts.map +1 -0
  343. package/dist/src/helpers/security/validation.js +14 -0
  344. package/dist/src/helpers/security/validation.js.map +1 -0
  345. package/dist/src/helpers/utils/date.d.ts +4 -0
  346. package/dist/src/helpers/utils/date.d.ts.map +1 -0
  347. package/dist/src/helpers/utils/date.js +16 -0
  348. package/dist/src/helpers/utils/date.js.map +1 -0
  349. package/dist/src/helpers/utils/error.d.ts +20 -0
  350. package/dist/src/helpers/utils/error.d.ts.map +1 -0
  351. package/dist/src/helpers/utils/error.js +164 -0
  352. package/dist/src/helpers/utils/error.js.map +1 -0
  353. package/dist/src/helpers/utils/uuid.d.ts +5 -0
  354. package/dist/src/helpers/utils/uuid.d.ts.map +1 -0
  355. package/dist/src/helpers/utils/uuid.js +13 -0
  356. package/dist/src/helpers/utils/uuid.js.map +1 -0
  357. package/dist/src/http/auth.d.ts +20 -0
  358. package/dist/src/http/auth.d.ts.map +1 -0
  359. package/dist/src/http/auth.js +68 -0
  360. package/dist/src/http/auth.js.map +1 -0
  361. package/dist/src/http/base.d.ts +57 -0
  362. package/dist/src/http/base.d.ts.map +1 -0
  363. package/dist/src/http/base.js +331 -0
  364. package/dist/src/http/base.js.map +1 -0
  365. package/dist/src/http/context.d.ts +6 -0
  366. package/dist/src/http/context.d.ts.map +1 -0
  367. package/dist/src/http/context.js +26 -0
  368. package/dist/src/http/context.js.map +1 -0
  369. package/dist/src/http/cors.d.ts +25 -0
  370. package/dist/src/http/cors.d.ts.map +1 -0
  371. package/dist/src/http/cors.js +124 -0
  372. package/dist/src/http/cors.js.map +1 -0
  373. package/dist/src/http/decorators.d.ts +64 -0
  374. package/dist/src/http/decorators.d.ts.map +1 -0
  375. package/dist/src/http/decorators.js +102 -0
  376. package/dist/src/http/decorators.js.map +1 -0
  377. package/dist/src/http/errors.d.ts +50 -0
  378. package/dist/src/http/errors.d.ts.map +1 -0
  379. package/dist/src/http/errors.js +158 -0
  380. package/dist/src/http/errors.js.map +1 -0
  381. package/dist/src/http/index.d.ts +31 -0
  382. package/dist/src/http/index.d.ts.map +1 -0
  383. package/dist/src/http/index.js +33 -0
  384. package/dist/src/http/index.js.map +1 -0
  385. package/dist/src/http/middleware.d.ts +12 -0
  386. package/dist/src/http/middleware.d.ts.map +1 -0
  387. package/dist/src/http/middleware.js +31 -0
  388. package/dist/src/http/middleware.js.map +1 -0
  389. package/dist/src/http/parameter-resolvers.d.ts +3 -0
  390. package/dist/src/http/parameter-resolvers.d.ts.map +1 -0
  391. package/dist/src/http/parameter-resolvers.js +8 -0
  392. package/dist/src/http/parameter-resolvers.js.map +1 -0
  393. package/dist/src/http/request-logging.d.ts +34 -0
  394. package/dist/src/http/request-logging.d.ts.map +1 -0
  395. package/dist/src/http/request-logging.js +130 -0
  396. package/dist/src/http/request-logging.js.map +1 -0
  397. package/dist/src/http/request.d.ts +69 -0
  398. package/dist/src/http/request.d.ts.map +1 -0
  399. package/dist/src/http/request.js +366 -0
  400. package/dist/src/http/request.js.map +1 -0
  401. package/dist/src/http/response.d.ts +98 -0
  402. package/dist/src/http/response.d.ts.map +1 -0
  403. package/dist/src/http/response.js +292 -0
  404. package/dist/src/http/response.js.map +1 -0
  405. package/dist/src/http/router.d.ts +100 -0
  406. package/dist/src/http/router.d.ts.map +1 -0
  407. package/dist/src/http/router.js +1085 -0
  408. package/dist/src/http/router.js.map +1 -0
  409. package/dist/src/http/startup-logging.d.ts +8 -0
  410. package/dist/src/http/startup-logging.d.ts.map +1 -0
  411. package/dist/src/http/startup-logging.js +55 -0
  412. package/dist/src/http/startup-logging.js.map +1 -0
  413. package/dist/src/http/static-files.d.ts +15 -0
  414. package/dist/src/http/static-files.d.ts.map +1 -0
  415. package/dist/src/http/static-files.js +110 -0
  416. package/dist/src/http/static-files.js.map +1 -0
  417. package/dist/src/http/store.d.ts +8 -0
  418. package/dist/src/http/store.d.ts.map +1 -0
  419. package/dist/src/http/store.js +47 -0
  420. package/dist/src/http/store.js.map +1 -0
  421. package/dist/src/http/types.d.ts +23 -0
  422. package/dist/src/http/types.d.ts.map +1 -0
  423. package/dist/src/http/types.js +3 -0
  424. package/dist/src/http/types.js.map +1 -0
  425. package/dist/src/http/upgrade.d.ts +22 -0
  426. package/dist/src/http/upgrade.d.ts.map +1 -0
  427. package/dist/src/http/upgrade.js +164 -0
  428. package/dist/src/http/upgrade.js.map +1 -0
  429. package/dist/src/http/uploads.d.ts +36 -0
  430. package/dist/src/http/uploads.d.ts.map +1 -0
  431. package/dist/src/http/uploads.js +287 -0
  432. package/dist/src/http/uploads.js.map +1 -0
  433. package/dist/src/http/workflow.d.ts +34 -0
  434. package/dist/src/http/workflow.d.ts.map +1 -0
  435. package/dist/src/http/workflow.js +40 -0
  436. package/dist/src/http/workflow.js.map +1 -0
  437. package/dist/src/index.d.ts +21 -0
  438. package/dist/src/index.d.ts.map +1 -0
  439. package/dist/src/index.js +88 -0
  440. package/dist/src/index.js.map +1 -0
  441. package/dist/src/openapi/controller.d.ts +9 -0
  442. package/dist/src/openapi/controller.d.ts.map +1 -0
  443. package/dist/src/openapi/controller.js +45 -0
  444. package/dist/src/openapi/controller.js.map +1 -0
  445. package/dist/src/openapi/index.d.ts +5 -0
  446. package/dist/src/openapi/index.d.ts.map +1 -0
  447. package/dist/src/openapi/index.js +21 -0
  448. package/dist/src/openapi/index.js.map +1 -0
  449. package/dist/src/openapi/schema.d.ts +26 -0
  450. package/dist/src/openapi/schema.d.ts.map +1 -0
  451. package/dist/src/openapi/schema.js +1128 -0
  452. package/dist/src/openapi/schema.js.map +1 -0
  453. package/dist/src/openapi/serializer.d.ts +16 -0
  454. package/dist/src/openapi/serializer.d.ts.map +1 -0
  455. package/dist/src/openapi/serializer.js +506 -0
  456. package/dist/src/openapi/serializer.js.map +1 -0
  457. package/dist/src/openapi/types.d.ts +84 -0
  458. package/dist/src/openapi/types.d.ts.map +1 -0
  459. package/dist/src/openapi/types.js +5 -0
  460. package/dist/src/openapi/types.js.map +1 -0
  461. package/dist/src/reflection/annotations.d.ts +15 -0
  462. package/dist/src/reflection/annotations.d.ts.map +1 -0
  463. package/dist/src/reflection/annotations.js +228 -0
  464. package/dist/src/reflection/annotations.js.map +1 -0
  465. package/dist/src/reflection/conversion.d.ts +15 -0
  466. package/dist/src/reflection/conversion.d.ts.map +1 -0
  467. package/dist/src/reflection/conversion.js +360 -0
  468. package/dist/src/reflection/conversion.js.map +1 -0
  469. package/dist/src/reflection/deserializer.d.ts +15 -0
  470. package/dist/src/reflection/deserializer.d.ts.map +1 -0
  471. package/dist/src/reflection/deserializer.js +42 -0
  472. package/dist/src/reflection/deserializer.js.map +1 -0
  473. package/dist/src/reflection/entity.d.ts +9 -0
  474. package/dist/src/reflection/entity.d.ts.map +1 -0
  475. package/dist/src/reflection/entity.js +74 -0
  476. package/dist/src/reflection/entity.js.map +1 -0
  477. package/dist/src/reflection/errors.d.ts +8 -0
  478. package/dist/src/reflection/errors.d.ts.map +1 -0
  479. package/dist/src/reflection/errors.js +21 -0
  480. package/dist/src/reflection/errors.js.map +1 -0
  481. package/dist/src/reflection/index.d.ts +8 -0
  482. package/dist/src/reflection/index.d.ts.map +1 -0
  483. package/dist/src/reflection/index.js +13 -0
  484. package/dist/src/reflection/index.js.map +1 -0
  485. package/dist/src/reflection/metadata-store.d.ts +14 -0
  486. package/dist/src/reflection/metadata-store.d.ts.map +1 -0
  487. package/dist/src/reflection/metadata-store.js +18 -0
  488. package/dist/src/reflection/metadata-store.js.map +1 -0
  489. package/dist/src/reflection/model.d.ts +271 -0
  490. package/dist/src/reflection/model.d.ts.map +1 -0
  491. package/dist/src/reflection/model.js +36 -0
  492. package/dist/src/reflection/model.js.map +1 -0
  493. package/dist/src/reflection/reflection-class.d.ts +60 -0
  494. package/dist/src/reflection/reflection-class.d.ts.map +1 -0
  495. package/dist/src/reflection/reflection-class.js +263 -0
  496. package/dist/src/reflection/reflection-class.js.map +1 -0
  497. package/dist/src/reflection/type-utils.d.ts +34 -0
  498. package/dist/src/reflection/type-utils.d.ts.map +1 -0
  499. package/dist/src/reflection/type-utils.js +485 -0
  500. package/dist/src/reflection/type-utils.js.map +1 -0
  501. package/dist/src/reflection.d.ts +2 -0
  502. package/dist/src/reflection.d.ts.map +1 -0
  503. package/dist/src/reflection.js +5 -0
  504. package/dist/src/reflection.js.map +1 -0
  505. package/dist/src/services/cli.d.ts +9 -0
  506. package/dist/src/services/cli.d.ts.map +1 -0
  507. package/dist/src/services/cli.js +47 -0
  508. package/dist/src/services/cli.js.map +1 -0
  509. package/dist/src/services/index.d.ts +8 -0
  510. package/dist/src/services/index.d.ts.map +1 -0
  511. package/dist/src/services/index.js +13 -0
  512. package/dist/src/services/index.js.map +1 -0
  513. package/dist/src/services/leader.d.ts +31 -0
  514. package/dist/src/services/leader.d.ts.map +1 -0
  515. package/dist/src/services/leader.js +176 -0
  516. package/dist/src/services/leader.js.map +1 -0
  517. package/dist/src/services/logger.d.ts +60 -0
  518. package/dist/src/services/logger.d.ts.map +1 -0
  519. package/dist/src/services/logger.js +349 -0
  520. package/dist/src/services/logger.js.map +1 -0
  521. package/dist/src/services/mail/index.d.ts +57 -0
  522. package/dist/src/services/mail/index.d.ts.map +1 -0
  523. package/dist/src/services/mail/index.js +89 -0
  524. package/dist/src/services/mail/index.js.map +1 -0
  525. package/dist/src/services/mail/postmark.d.ts +11 -0
  526. package/dist/src/services/mail/postmark.d.ts.map +1 -0
  527. package/dist/src/services/mail/postmark.js +41 -0
  528. package/dist/src/services/mail/postmark.js.map +1 -0
  529. package/dist/src/services/mail/smtp.d.ts +11 -0
  530. package/dist/src/services/mail/smtp.d.ts.map +1 -0
  531. package/dist/src/services/mail/smtp.js +50 -0
  532. package/dist/src/services/mail/smtp.js.map +1 -0
  533. package/dist/src/services/mesh-client/index.d.ts +9 -0
  534. package/dist/src/services/mesh-client/index.d.ts.map +1 -0
  535. package/dist/src/services/mesh-client/index.js +18 -0
  536. package/dist/src/services/mesh-client/index.js.map +1 -0
  537. package/dist/src/services/mesh-client/mesh-client-redis-registry.d.ts +23 -0
  538. package/dist/src/services/mesh-client/mesh-client-redis-registry.d.ts.map +1 -0
  539. package/dist/src/services/mesh-client/mesh-client-redis-registry.js +360 -0
  540. package/dist/src/services/mesh-client/mesh-client-redis-registry.js.map +1 -0
  541. package/dist/src/services/mesh-client/mesh-client-registry.d.ts +16 -0
  542. package/dist/src/services/mesh-client/mesh-client-registry.d.ts.map +1 -0
  543. package/dist/src/services/mesh-client/mesh-client-registry.js +44 -0
  544. package/dist/src/services/mesh-client/mesh-client-registry.js.map +1 -0
  545. package/dist/src/services/mesh-client/mesh-client-service.d.ts +88 -0
  546. package/dist/src/services/mesh-client/mesh-client-service.d.ts.map +1 -0
  547. package/dist/src/services/mesh-client/mesh-client-service.js +222 -0
  548. package/dist/src/services/mesh-client/mesh-client-service.js.map +1 -0
  549. package/dist/src/services/mesh-client/mesh-srpc-server.d.ts +95 -0
  550. package/dist/src/services/mesh-client/mesh-srpc-server.d.ts.map +1 -0
  551. package/dist/src/services/mesh-client/mesh-srpc-server.js +475 -0
  552. package/dist/src/services/mesh-client/mesh-srpc-server.js.map +1 -0
  553. package/dist/src/services/mesh-client/types.d.ts +36 -0
  554. package/dist/src/services/mesh-client/types.d.ts.map +1 -0
  555. package/dist/src/services/mesh-client/types.js +38 -0
  556. package/dist/src/services/mesh-client/types.js.map +1 -0
  557. package/dist/src/services/mesh.d.ts +73 -0
  558. package/dist/src/services/mesh.d.ts.map +1 -0
  559. package/dist/src/services/mesh.js +511 -0
  560. package/dist/src/services/mesh.js.map +1 -0
  561. package/dist/src/services/worker/entity.d.ts +26 -0
  562. package/dist/src/services/worker/entity.d.ts.map +1 -0
  563. package/dist/src/services/worker/entity.js +30 -0
  564. package/dist/src/services/worker/entity.js.map +1 -0
  565. package/dist/src/services/worker/index.d.ts +25 -0
  566. package/dist/src/services/worker/index.d.ts.map +1 -0
  567. package/dist/src/services/worker/index.js +52 -0
  568. package/dist/src/services/worker/index.js.map +1 -0
  569. package/dist/src/services/worker/observer.d.ts +13 -0
  570. package/dist/src/services/worker/observer.d.ts.map +1 -0
  571. package/dist/src/services/worker/observer.js +22 -0
  572. package/dist/src/services/worker/observer.js.map +1 -0
  573. package/dist/src/services/worker/queue.d.ts +38 -0
  574. package/dist/src/services/worker/queue.d.ts.map +1 -0
  575. package/dist/src/services/worker/queue.js +227 -0
  576. package/dist/src/services/worker/queue.js.map +1 -0
  577. package/dist/src/services/worker/recorder.d.ts +17 -0
  578. package/dist/src/services/worker/recorder.d.ts.map +1 -0
  579. package/dist/src/services/worker/recorder.js +88 -0
  580. package/dist/src/services/worker/recorder.js.map +1 -0
  581. package/dist/src/services/worker/runner.d.ts +37 -0
  582. package/dist/src/services/worker/runner.d.ts.map +1 -0
  583. package/dist/src/services/worker/runner.js +319 -0
  584. package/dist/src/services/worker/runner.js.map +1 -0
  585. package/dist/src/services/worker/types.d.ts +63 -0
  586. package/dist/src/services/worker/types.d.ts.map +1 -0
  587. package/dist/src/services/worker/types.js +38 -0
  588. package/dist/src/services/worker/types.js.map +1 -0
  589. package/dist/src/srpc/SrpcByteStream.d.ts +60 -0
  590. package/dist/src/srpc/SrpcByteStream.d.ts.map +1 -0
  591. package/dist/src/srpc/SrpcByteStream.js +237 -0
  592. package/dist/src/srpc/SrpcByteStream.js.map +1 -0
  593. package/dist/src/srpc/SrpcClient.d.ts +67 -0
  594. package/dist/src/srpc/SrpcClient.d.ts.map +1 -0
  595. package/dist/src/srpc/SrpcClient.js +406 -0
  596. package/dist/src/srpc/SrpcClient.js.map +1 -0
  597. package/dist/src/srpc/SrpcServer.d.ts +56 -0
  598. package/dist/src/srpc/SrpcServer.d.ts.map +1 -0
  599. package/dist/src/srpc/SrpcServer.js +519 -0
  600. package/dist/src/srpc/SrpcServer.js.map +1 -0
  601. package/dist/src/srpc/index.d.ts +9 -0
  602. package/dist/src/srpc/index.d.ts.map +1 -0
  603. package/dist/src/srpc/index.js +17 -0
  604. package/dist/src/srpc/index.js.map +1 -0
  605. package/dist/src/srpc/observer.d.ts +21 -0
  606. package/dist/src/srpc/observer.d.ts.map +1 -0
  607. package/dist/src/srpc/observer.js +22 -0
  608. package/dist/src/srpc/observer.js.map +1 -0
  609. package/dist/src/srpc/types.d.ts +92 -0
  610. package/dist/src/srpc/types.d.ts.map +1 -0
  611. package/dist/src/srpc/types.js +28 -0
  612. package/dist/src/srpc/types.js.map +1 -0
  613. package/dist/src/telemetry/index.d.ts +3 -0
  614. package/dist/src/telemetry/index.d.ts.map +1 -0
  615. package/dist/src/telemetry/index.js +22 -0
  616. package/dist/src/telemetry/index.js.map +1 -0
  617. package/dist/src/telemetry/otel/helpers.d.ts +45 -0
  618. package/dist/src/telemetry/otel/helpers.d.ts.map +1 -0
  619. package/dist/src/telemetry/otel/helpers.js +142 -0
  620. package/dist/src/telemetry/otel/helpers.js.map +1 -0
  621. package/dist/src/telemetry/otel/index.d.ts +22 -0
  622. package/dist/src/telemetry/otel/index.d.ts.map +1 -0
  623. package/dist/src/telemetry/otel/index.js +268 -0
  624. package/dist/src/telemetry/otel/index.js.map +1 -0
  625. package/dist/src/telemetry/otel/metrics.controller.d.ts +5 -0
  626. package/dist/src/telemetry/otel/metrics.controller.d.ts.map +1 -0
  627. package/dist/src/telemetry/otel/metrics.controller.js +82 -0
  628. package/dist/src/telemetry/otel/metrics.controller.js.map +1 -0
  629. package/dist/src/telemetry/otel/metrics.d.ts +2 -0
  630. package/dist/src/telemetry/otel/metrics.d.ts.map +1 -0
  631. package/dist/src/telemetry/otel/metrics.js +16 -0
  632. package/dist/src/telemetry/otel/metrics.js.map +1 -0
  633. package/dist/src/telemetry/sentry.d.ts +9 -0
  634. package/dist/src/telemetry/sentry.d.ts.map +1 -0
  635. package/dist/src/telemetry/sentry.js +63 -0
  636. package/dist/src/telemetry/sentry.js.map +1 -0
  637. package/dist/src/testing/database-readiness.d.ts +11 -0
  638. package/dist/src/testing/database-readiness.d.ts.map +1 -0
  639. package/dist/src/testing/database-readiness.js +102 -0
  640. package/dist/src/testing/database-readiness.js.map +1 -0
  641. package/dist/src/testing/expect.d.ts +21 -0
  642. package/dist/src/testing/expect.d.ts.map +1 -0
  643. package/dist/src/testing/expect.js +110 -0
  644. package/dist/src/testing/expect.js.map +1 -0
  645. package/dist/src/testing/fixtures.d.ts +18 -0
  646. package/dist/src/testing/fixtures.d.ts.map +1 -0
  647. package/dist/src/testing/fixtures.js +46 -0
  648. package/dist/src/testing/fixtures.js.map +1 -0
  649. package/dist/src/testing/index.d.ts +143 -0
  650. package/dist/src/testing/index.d.ts.map +1 -0
  651. package/dist/src/testing/index.js +993 -0
  652. package/dist/src/testing/index.js.map +1 -0
  653. package/dist/src/testing/mysql-session-manager-process.d.ts +3 -0
  654. package/dist/src/testing/mysql-session-manager-process.d.ts.map +1 -0
  655. package/dist/src/testing/mysql-session-manager-process.js +77 -0
  656. package/dist/src/testing/mysql-session-manager-process.js.map +1 -0
  657. package/dist/src/testing/mysql-session-manager.d.ts +59 -0
  658. package/dist/src/testing/mysql-session-manager.d.ts.map +1 -0
  659. package/dist/src/testing/mysql-session-manager.js +910 -0
  660. package/dist/src/testing/mysql-session-manager.js.map +1 -0
  661. package/dist/src/testing/sql.d.ts +47 -0
  662. package/dist/src/testing/sql.d.ts.map +1 -0
  663. package/dist/src/testing/sql.js +313 -0
  664. package/dist/src/testing/sql.js.map +1 -0
  665. package/dist/src/type-compiler/go/ast_expression.go +161 -0
  666. package/dist/src/type-compiler/go/ast_metadata.go +355 -0
  667. package/dist/src/type-compiler/go/collect.go +806 -0
  668. package/dist/src/type-compiler/go/emission_plan.go +205 -0
  669. package/dist/src/type-compiler/go/emit_ast.go +406 -0
  670. package/dist/src/type-compiler/go/emit_ast_test.go +248 -0
  671. package/dist/src/type-compiler/go/go.mod +10 -0
  672. package/dist/src/type-compiler/go/plugin.go +308 -0
  673. package/dist/src/type-compiler/go/plugin_test.go +752 -0
  674. package/dist/src/type-compiler/go/precompute.go +86 -0
  675. package/dist/src/type-compiler/go/receive_type.go +837 -0
  676. package/dist/src/type-compiler/go/resolve.go +265 -0
  677. package/dist/src/type-compiler/go/source_scan.go +51 -0
  678. package/dist/src/type-compiler/go/text_parse.go +671 -0
  679. package/dist/src/type-compiler/go/type_expr.go +1227 -0
  680. package/dist/src/type-compiler/go/typia_expr.go +2119 -0
  681. package/dist/src/type-compiler/index.cjs +6 -0
  682. package/dist/src/types/index.d.ts +7 -0
  683. package/dist/src/types/index.d.ts.map +1 -0
  684. package/dist/src/types/index.js +14 -0
  685. package/dist/src/types/index.js.map +1 -0
  686. package/dist/src/types/phone.d.ts +6 -0
  687. package/dist/src/types/phone.d.ts.map +1 -0
  688. package/dist/src/types/phone.js +64 -0
  689. package/dist/src/types/phone.js.map +1 -0
  690. package/dist/src/types/primitives.d.ts +33 -0
  691. package/dist/src/types/primitives.d.ts.map +1 -0
  692. package/dist/src/types/primitives.js +5 -0
  693. package/dist/src/types/primitives.js.map +1 -0
  694. package/dist/src/types/runtime.d.ts +5 -0
  695. package/dist/src/types/runtime.d.ts.map +1 -0
  696. package/dist/src/types/runtime.js +20 -0
  697. package/dist/src/types/runtime.js.map +1 -0
  698. package/dist/src/types/type-annotations.d.ts +28 -0
  699. package/dist/src/types/type-annotations.d.ts.map +1 -0
  700. package/dist/src/types/type-annotations.js +33 -0
  701. package/dist/src/types/type-annotations.js.map +1 -0
  702. package/dist/src/types.d.ts +2 -0
  703. package/dist/src/types.d.ts.map +1 -0
  704. package/dist/src/types.js +7 -0
  705. package/dist/src/types.js.map +1 -0
  706. package/docs/.vitepress/config.mts +85 -0
  707. package/docs/content/CONTRIBUTING.md +53 -0
  708. package/docs/content/README-DEV.md +59 -0
  709. package/docs/content/README.md +52 -0
  710. package/docs/content/authentication.md +213 -0
  711. package/docs/content/cli.md +214 -0
  712. package/docs/content/configuration.md +191 -0
  713. package/docs/content/database.md +476 -0
  714. package/docs/content/devconsole.md +148 -0
  715. package/docs/content/di.md +212 -0
  716. package/docs/content/documentation-plan.md +182 -0
  717. package/docs/content/env.md +120 -0
  718. package/docs/content/getting-started.md +324 -0
  719. package/docs/content/health.md +64 -0
  720. package/docs/content/helpers.md +294 -0
  721. package/docs/content/http.md +402 -0
  722. package/docs/content/index.md +109 -0
  723. package/docs/content/leader-service.md +98 -0
  724. package/docs/content/logging.md +225 -0
  725. package/docs/content/mail.md +171 -0
  726. package/docs/content/mesh-client.md +333 -0
  727. package/docs/content/mesh-service.md +255 -0
  728. package/docs/content/migrations.md +190 -0
  729. package/docs/content/openapi.md +134 -0
  730. package/docs/content/overview.md +98 -0
  731. package/docs/content/public/images/devconsole/01-dashboard.png +0 -0
  732. package/docs/content/public/images/devconsole/02-routes.png +0 -0
  733. package/docs/content/public/images/devconsole/03-openapi.png +0 -0
  734. package/docs/content/public/images/devconsole/04-requests.png +0 -0
  735. package/docs/content/public/images/devconsole/05-srpc.png +0 -0
  736. package/docs/content/public/images/devconsole/06-database.png +0 -0
  737. package/docs/content/public/images/devconsole/06b-database-log.png +0 -0
  738. package/docs/content/public/images/devconsole/07-health.png +0 -0
  739. package/docs/content/public/images/devconsole/08-mutex.png +0 -0
  740. package/docs/content/public/images/devconsole/09-repl.png +0 -0
  741. package/docs/content/public/images/devconsole/10-workers.png +0 -0
  742. package/docs/content/public-api.md +84 -0
  743. package/docs/content/redis.md +174 -0
  744. package/docs/content/reflection.md +180 -0
  745. package/docs/content/release.md +100 -0
  746. package/docs/content/sql.md +121 -0
  747. package/docs/content/srpc.md +292 -0
  748. package/docs/content/telemetry.md +173 -0
  749. package/docs/content/testing.md +327 -0
  750. package/docs/content/type-reflection-architecture.md +149 -0
  751. package/docs/content/types.md +286 -0
  752. package/docs/content/uploads.md +145 -0
  753. package/docs/content/worker.md +182 -0
  754. package/docs/openapi.md +3 -0
  755. package/package.json +124 -0
  756. package/resources/proto/devconsole.proto +286 -0
  757. package/template-app/.env.development +10 -0
  758. package/template-app/gitignore.tmpl +11 -0
  759. package/template-app/package.json.tmpl +25 -0
  760. package/template-app/src/app.ts +13 -0
  761. package/template-app/src/config.ts +5 -0
  762. package/template-app/src/controllers/Example.controller.ts +19 -0
  763. package/template-app/src/database.ts +5 -0
  764. package/template-app/src/entities/Example.entity.ts +9 -0
  765. package/template-app/src/index.ts +7 -0
  766. package/template-app/src/migrations/.gitkeep +2 -0
  767. package/template-app/src/services/Example.service.ts +20 -0
  768. package/template-app/tests/app.spec.ts +8 -0
  769. package/template-app/tsconfig.json +26 -0
  770. package/template-app/tsconfig.test.json +5 -0
  771. package/types.d.ts +4 -0
@@ -0,0 +1,910 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.__tsfTypeAliases = exports.MySQLSessionManager = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const node_crypto_1 = require("node:crypto");
6
+ const promise_1 = tslib_1.__importDefault(require("mysql2/promise"));
7
+ const env_1 = require("../env");
8
+ const mysql_session_rpc_1 = require("../database/drivers/mysql-session-rpc");
9
+ const logger_1 = require("../services/logger");
10
+ let _MySQLSessionManagerMetadata_1;
11
+ class MySQLSessionManager {
12
+ options;
13
+ rpcServer;
14
+ databases = new Map();
15
+ poolSize;
16
+ logger = (0, logger_1.createLogger)('MySQLSessionManager');
17
+ nextFrontendConnectionId = 0;
18
+ nextBackendConnectionId = 0;
19
+ constructor(options) {
20
+ this.options = options;
21
+ this.poolSize = normalizePoolSize(options.poolSize);
22
+ }
23
+ get port() {
24
+ if (!this.rpcServer)
25
+ throw new Error('MySQL session manager has not started');
26
+ return this.rpcServer.port;
27
+ }
28
+ async start() {
29
+ this.rpcServer = await (0, mysql_session_rpc_1.listenRpc)(0, (method, params, peer) => this.handle(method, params, peer));
30
+ this.logger.debug('Shared MySQL session manager started', { port: this.rpcServer.port, poolSize: this.poolSize });
31
+ }
32
+ async stop() {
33
+ this.logger.debug('Shared MySQL session manager stopping', { poolSize: this.poolSize, groups: this.databases.size });
34
+ if (this.rpcServer)
35
+ await this.rpcServer.close();
36
+ this.rpcServer = undefined;
37
+ const groups = [...this.databases.values()];
38
+ this.databases.clear();
39
+ for (const group of groups) {
40
+ for (const waiter of group.waiters.splice(0))
41
+ waiter.reject(new Error('MySQL session manager stopped'));
42
+ for (const slot of group.slots) {
43
+ for (const waiter of slot.waiters.splice(0))
44
+ waiter.reject(new Error('MySQL session manager stopped'));
45
+ slot.schemaPreparing?.reject(new Error('MySQL session manager stopped'));
46
+ await slot.queue.catch(() => { });
47
+ await this.closeBackendConnection(slot, 'manager-stop');
48
+ }
49
+ }
50
+ for (const group of groups) {
51
+ if (group.keepDatabase || env_1.Env.TEST_KEEP_DB)
52
+ continue;
53
+ for (const slot of group.slots) {
54
+ await this.dropDatabase(slot.databaseName).catch(() => { });
55
+ }
56
+ }
57
+ this.logger.debug('Shared MySQL session manager stopped');
58
+ }
59
+ async handle(method, params, peer) {
60
+ const request = assertRequest(params, this.options.token);
61
+ switch (method) {
62
+ case 'ensureDatabase':
63
+ return this.ensureDatabase(readString(request, 'key'), readString(request, 'prefix'), readBoolean(request, 'keepDatabase'), peer);
64
+ case 'releaseDatabase':
65
+ return this.releaseDatabase(readString(request, 'key'), readOptionalString(request, 'leaseId'));
66
+ case 'prepareSchema':
67
+ return this.prepareSchema(readString(request, 'key'), readOptionalString(request, 'leaseId'));
68
+ case 'completeSchema':
69
+ return this.completeSchema(readString(request, 'key'), readOptionalString(request, 'leaseId'), readOptionalString(request, 'preparationId'), readBoolean(request, 'ok'), readOptionalString(request, 'error'));
70
+ case 'acquire':
71
+ return this.acquire(readString(request, 'key'), readOptionalString(request, 'leaseId'), readString(request, 'clientId'), peer);
72
+ case 'release':
73
+ return this.release(peer);
74
+ case 'query':
75
+ return this.run(peer, 'query', readString(request, 'sql'), readValues(request));
76
+ case 'execute':
77
+ return this.run(peer, 'execute', readString(request, 'sql'), readValues(request));
78
+ default:
79
+ throw new Error(`Unknown MySQL session manager method: ${method}`);
80
+ }
81
+ }
82
+ async ensureDatabase(key, prefix, keepDatabase, owner) {
83
+ const group = this.ensureGroup(key, prefix, keepDatabase);
84
+ const slot = await this.reserveSlot(group, owner);
85
+ this.debugSlot('Shared MySQL database lease reserved', slot);
86
+ try {
87
+ await slot.databaseReady;
88
+ }
89
+ catch (error) {
90
+ this.logger.error('Shared MySQL database lease reservation failed', error, this.slotLogData(slot));
91
+ await this.destroySlot(group, slot, true);
92
+ throw error;
93
+ }
94
+ this.debugSlot('Shared MySQL database lease ready', slot);
95
+ return { databaseName: slot.databaseName, leaseId: slot.reservation.id };
96
+ }
97
+ async releaseDatabase(key, leaseId) {
98
+ const group = this.databases.get(key);
99
+ if (!group)
100
+ return { released: false };
101
+ const slot = this.findSlotByLeaseId(group, leaseId);
102
+ if (!slot)
103
+ return { released: false };
104
+ const databaseLeaseId = slot.reservation?.id;
105
+ this.debugSlot('Shared MySQL database lease releasing', slot, { reason: 'release-database', leaseId: databaseLeaseId });
106
+ for (const waiter of slot.waiters.splice(0))
107
+ waiter.reject(new Error('MySQL session database lease released'));
108
+ try {
109
+ if (slot.connection)
110
+ await this.enqueueSlot(slot, () => this.resetConnectionAfterLease(slot));
111
+ }
112
+ finally {
113
+ for (const waiter of slot.waiters.splice(0))
114
+ waiter.reject(new Error('MySQL session database lease released'));
115
+ slot.lease = undefined;
116
+ slot.reservation = undefined;
117
+ this.wakeSlotWaiter(group);
118
+ }
119
+ this.debugSlot('Shared MySQL database lease released', slot, { reason: 'release-database', leaseId: databaseLeaseId });
120
+ return { released: true };
121
+ }
122
+ ensureGroup(key, prefix, keepDatabase) {
123
+ let group = this.databases.get(key);
124
+ if (!group) {
125
+ group = {
126
+ key,
127
+ prefix,
128
+ keepDatabase,
129
+ slots: [],
130
+ waiters: [],
131
+ nextSlotIndex: 0
132
+ };
133
+ this.databases.set(key, group);
134
+ this.logger.debug('Shared MySQL database group created', this.groupLogData(group));
135
+ }
136
+ else {
137
+ group.keepDatabase = group.keepDatabase || keepDatabase;
138
+ }
139
+ return group;
140
+ }
141
+ async reserveSlot(group, owner) {
142
+ const slot = this.reserveAvailableSlot(group);
143
+ if (slot) {
144
+ this.debugSlot('Shared MySQL database slot reserved', slot, this.groupLogData(group));
145
+ return slot;
146
+ }
147
+ this.logger.debug('Shared MySQL database slot waiting', this.groupLogData(group));
148
+ return new Promise((resolve, reject) => {
149
+ const waiter = {
150
+ owner,
151
+ resolve,
152
+ reject
153
+ };
154
+ group.waiters.push(waiter);
155
+ owner.once('close', () => {
156
+ const index = group.waiters.indexOf(waiter);
157
+ if (index >= 0)
158
+ group.waiters.splice(index, 1);
159
+ this.logger.debug('Shared MySQL database slot wait cancelled', this.groupLogData(group));
160
+ reject(new Error('Client disconnected before acquiring a MySQL session database slot'));
161
+ });
162
+ });
163
+ }
164
+ reserveAvailableSlot(group) {
165
+ const existing = group.slots.find(slot => !slot.reservation);
166
+ const slot = existing ?? (group.slots.length < this.poolSize ? this.createSlot(group) : undefined);
167
+ if (!slot)
168
+ return undefined;
169
+ slot.reservation = { id: (0, node_crypto_1.randomUUID)() };
170
+ return slot;
171
+ }
172
+ wakeSlotWaiter(group) {
173
+ while (group.waiters.length) {
174
+ const slot = this.reserveAvailableSlot(group);
175
+ if (!slot)
176
+ return;
177
+ const waiter = group.waiters.shift();
178
+ this.debugSlot('Shared MySQL database slot assigned to waiter', slot, this.groupLogData(group));
179
+ waiter.resolve(slot);
180
+ }
181
+ }
182
+ createSlot(group) {
183
+ const slotIndex = group.nextSlotIndex++;
184
+ const databaseName = this.createDatabaseName(group.key, group.prefix, slotIndex);
185
+ const slot = {
186
+ key: group.key,
187
+ slotIndex,
188
+ databaseName,
189
+ databaseReady: this.createDatabase(databaseName),
190
+ waiters: [],
191
+ queue: Promise.resolve(),
192
+ transactionReady: false,
193
+ transactionStack: [],
194
+ nextTransactionId: 0,
195
+ baselineSavepointName: `tsf_session_baseline_${slotIndex + 1}`
196
+ };
197
+ group.slots.push(slot);
198
+ this.logSlot('Shared MySQL database slot created', slot, this.groupLogData(group));
199
+ return slot;
200
+ }
201
+ async prepareSchema(key, leaseId) {
202
+ const slot = await this.requireReadySlot(key, leaseId);
203
+ if (slot.schemaReady) {
204
+ this.debugSlot('Shared MySQL schema already prepared', slot);
205
+ return { run: false };
206
+ }
207
+ if (slot.schemaPreparing) {
208
+ this.debugSlot('Shared MySQL schema preparation waiting', slot, { preparationId: slot.schemaPreparing.id });
209
+ await slot.schemaPreparing.promise;
210
+ return { run: false };
211
+ }
212
+ const id = (0, node_crypto_1.randomUUID)();
213
+ let resolve;
214
+ let reject;
215
+ const promise = new Promise((promiseResolve, promiseReject) => {
216
+ resolve = promiseResolve;
217
+ reject = promiseReject;
218
+ });
219
+ promise.catch(() => { });
220
+ const timeout = setTimeout(() => {
221
+ if (slot.schemaPreparing?.id === id)
222
+ this.failSchemaPreparation(slot, new Error('Timed out preparing shared MySQL schema'));
223
+ }, 180000);
224
+ slot.schemaPreparing = { id, timeout, promise, resolve, reject };
225
+ this.logSlot('Shared MySQL schema preparation started', slot, { preparationId: id });
226
+ return { run: true, preparationId: id };
227
+ }
228
+ async completeSchema(key, leaseId, preparationId, ok, error) {
229
+ const slot = await this.requireReadySlot(key, leaseId);
230
+ const preparing = slot.schemaPreparing;
231
+ if (!preparing)
232
+ return { completed: false };
233
+ if (preparationId !== preparing.id)
234
+ throw new Error('Schema preparation id does not match the active preparation');
235
+ slot.schemaPreparing = undefined;
236
+ clearTimeout(preparing.timeout);
237
+ if (ok) {
238
+ this.logSlot('Shared MySQL schema preparation completing', slot, { preparationId });
239
+ try {
240
+ slot.schemaReady = true;
241
+ await this.enqueueSlot(slot, async () => {
242
+ const connection = await this.ensureConnection(slot);
243
+ await this.restartPersistentTransaction(slot, connection);
244
+ });
245
+ preparing.resolve();
246
+ this.logSlot('Shared MySQL schema preparation completed', slot, { preparationId });
247
+ }
248
+ catch (startError) {
249
+ slot.schemaReady = false;
250
+ const normalizedError = startError instanceof Error ? startError : new Error(String(startError));
251
+ this.logger.error('Shared MySQL schema preparation completion failed', normalizedError, this.slotLogData(slot, { preparationId }));
252
+ preparing.reject(normalizedError);
253
+ throw normalizedError;
254
+ }
255
+ }
256
+ else {
257
+ this.logger.error('Shared MySQL schema preparation failed', new Error(error || 'Schema preparation failed'), this.slotLogData(slot, { preparationId }));
258
+ preparing.reject(new Error(error || 'Schema preparation failed'));
259
+ const group = this.databases.get(key);
260
+ if (group)
261
+ await this.destroySlot(group, slot, true);
262
+ }
263
+ return { completed: true };
264
+ }
265
+ async acquire(key, leaseId, clientId, owner) {
266
+ const slot = await this.requireReadySlot(key, leaseId);
267
+ while (slot.lease) {
268
+ this.debugSlot('Shared MySQL frontend connection waiting', slot, {
269
+ clientId,
270
+ activeFrontendConnectionId: slot.lease.id,
271
+ activeClientId: slot.lease.clientId,
272
+ frontendWaiters: slot.waiters.length
273
+ });
274
+ await new Promise((resolve, reject) => {
275
+ const waiter = { owner, clientId, resolve, reject };
276
+ slot.waiters.push(waiter);
277
+ owner.once('close', () => {
278
+ const index = slot.waiters.indexOf(waiter);
279
+ if (index >= 0)
280
+ slot.waiters.splice(index, 1);
281
+ this.debugSlot('Shared MySQL frontend connection wait cancelled', slot, { clientId });
282
+ reject(new Error('Client disconnected before acquiring the MySQL session lease'));
283
+ });
284
+ });
285
+ }
286
+ const frontendConnectionId = this.createConnectionId('frontend', ++this.nextFrontendConnectionId);
287
+ slot.lease = { id: frontendConnectionId, clientId, owner };
288
+ this.debugSlot('Shared MySQL frontend connection acquired', slot, { frontendConnectionId, clientId });
289
+ owner.once('close', () => {
290
+ if (slot.lease?.owner === owner) {
291
+ this.debugSlot('Shared MySQL frontend connection disconnected', slot, { frontendConnectionId, clientId });
292
+ void this.release(owner).catch(error => this.logger.error('Shared MySQL frontend disconnect cleanup failed', error, this.slotLogData(slot, { frontendConnectionId, clientId })));
293
+ }
294
+ });
295
+ try {
296
+ await this.enqueueSlot(slot, async () => {
297
+ const connection = await this.ensureConnection(slot);
298
+ if (slot.schemaReady)
299
+ await this.ensurePersistentTransaction(slot, connection);
300
+ else
301
+ await rollbackConnection(connection);
302
+ });
303
+ }
304
+ catch (error) {
305
+ this.logger.error('Shared MySQL frontend connection acquire failed', error, this.slotLogData(slot, { frontendConnectionId, clientId }));
306
+ if (slot.lease?.owner === owner) {
307
+ slot.lease = undefined;
308
+ const next = slot.waiters.shift();
309
+ if (next)
310
+ next.resolve();
311
+ }
312
+ throw error;
313
+ }
314
+ return { databaseName: slot.databaseName };
315
+ }
316
+ async release(owner) {
317
+ const slot = this.findSlotByOwner(owner);
318
+ if (!slot)
319
+ return { released: false };
320
+ const frontendConnectionId = slot.lease?.id;
321
+ const clientId = slot.lease?.clientId;
322
+ this.debugSlot('Shared MySQL frontend connection releasing', slot, { frontendConnectionId, clientId });
323
+ try {
324
+ await this.enqueueSlot(slot, () => this.resetConnectionAfterLease(slot));
325
+ }
326
+ finally {
327
+ if (slot.lease?.owner === owner)
328
+ slot.lease = undefined;
329
+ const next = slot.waiters.shift();
330
+ if (next) {
331
+ this.debugSlot('Shared MySQL frontend connection waiter resumed', slot, { clientId: next.clientId });
332
+ next.resolve();
333
+ }
334
+ }
335
+ this.debugSlot('Shared MySQL frontend connection released', slot, { frontendConnectionId, clientId });
336
+ return { released: true };
337
+ }
338
+ async run(owner, operation, sql, values) {
339
+ const slot = this.findSlotByOwner(owner);
340
+ if (!slot)
341
+ throw new Error('Client does not hold the MySQL session lease');
342
+ return this.enqueueSlot(slot, async () => {
343
+ if (slot.lease?.owner !== owner)
344
+ throw new Error('Client does not hold the MySQL session lease');
345
+ const connection = await this.ensureConnection(slot);
346
+ const runtimeDdl = readRuntimeDdlSignal(sql);
347
+ if (runtimeDdl && !slot.schemaPreparing) {
348
+ if (isInternalLocksTableCreate(runtimeDdl.statement))
349
+ return this.runIsolatedSlotStatement(slot, operation, sql, values);
350
+ this.throwRuntimeDdl(slot, runtimeDdl);
351
+ }
352
+ if (slot.schemaReady) {
353
+ await this.ensurePersistentTransaction(slot, connection);
354
+ const transactionCommand = readTransactionCommand(sql);
355
+ if (transactionCommand)
356
+ return this.runManagedTransactionCommand(slot, connection, transactionCommand);
357
+ this.logManagedSessionSqlSignal(slot, sql);
358
+ }
359
+ const [rows] = operation === 'query' ? await connection.query(sql, values) : await connection.execute(sql, values);
360
+ return normalizeMySQLResult(rows);
361
+ });
362
+ }
363
+ async runIsolatedSlotStatement(slot, operation, sql, values) {
364
+ const connection = await promise_1.default.createConnection({ ...this.options.mysql, database: slot.databaseName });
365
+ try {
366
+ const [rows] = operation === 'query' ? await connection.query(sql, values) : await connection.execute(sql, values);
367
+ return normalizeMySQLResult(rows);
368
+ }
369
+ finally {
370
+ await connection.end();
371
+ }
372
+ }
373
+ async requireReadySlot(key, leaseId) {
374
+ const group = this.databases.get(key);
375
+ if (!group)
376
+ throw new Error(`Unknown shared MySQL database key: ${key}`);
377
+ const slot = this.findSlotByLeaseId(group, leaseId);
378
+ if (!slot)
379
+ throw new Error(`Unknown shared MySQL database lease: ${leaseId ?? '(default)'}`);
380
+ await slot.databaseReady;
381
+ return slot;
382
+ }
383
+ findSlotByLeaseId(group, leaseId) {
384
+ if (leaseId)
385
+ return group.slots.find(slot => slot.reservation?.id === leaseId);
386
+ return group.slots.length === 1 ? group.slots[0] : undefined;
387
+ }
388
+ findSlotByOwner(owner) {
389
+ for (const group of this.databases.values()) {
390
+ const slot = group.slots.find(candidate => candidate.lease?.owner === owner);
391
+ if (slot)
392
+ return slot;
393
+ }
394
+ }
395
+ async ensureConnection(slot) {
396
+ if (!slot.connection) {
397
+ const backendConnectionId = this.createConnectionId('backend', ++this.nextBackendConnectionId);
398
+ slot.backendConnectionId = backendConnectionId;
399
+ this.debugSlot('Shared MySQL backend connection opening', slot);
400
+ try {
401
+ slot.connection = await promise_1.default.createConnection({
402
+ ...this.options.mysql,
403
+ database: slot.databaseName,
404
+ decimalNumbers: true
405
+ });
406
+ this.logSlot('Shared MySQL backend connection opened', slot);
407
+ }
408
+ catch (error) {
409
+ this.logger.error('Shared MySQL backend connection open failed', error, this.slotLogData(slot));
410
+ slot.backendConnectionId = undefined;
411
+ throw error;
412
+ }
413
+ }
414
+ return slot.connection;
415
+ }
416
+ async enqueueSlot(slot, worker) {
417
+ const run = slot.queue.catch(() => { }).then(worker);
418
+ slot.queue = run.then(() => { }, () => { });
419
+ return run;
420
+ }
421
+ async ensurePersistentTransaction(slot, connection) {
422
+ if (slot.transactionReady)
423
+ return;
424
+ await this.restartPersistentTransaction(slot, connection);
425
+ }
426
+ async restartPersistentTransaction(slot, connection) {
427
+ slot.transactionReady = false;
428
+ this.debugSlot('Shared MySQL backend transaction restarting', slot);
429
+ await rollbackConnection(connection);
430
+ await connection.query('START TRANSACTION');
431
+ slot.transactionStack = [];
432
+ slot.nextTransactionId = 0;
433
+ await connection.query(`SAVEPOINT ${quoteIdentifier(slot.baselineSavepointName)}`);
434
+ slot.transactionReady = true;
435
+ this.logSlot('Shared MySQL backend transaction ready', slot, {
436
+ baselineSavepoint: slot.baselineSavepointName
437
+ });
438
+ }
439
+ async resetConnectionAfterLease(slot) {
440
+ const connection = slot.connection;
441
+ if (!connection)
442
+ return;
443
+ if (!slot.schemaReady) {
444
+ this.debugSlot('Shared MySQL backend connection resetting before schema readiness', slot);
445
+ await rollbackConnection(connection);
446
+ slot.transactionReady = false;
447
+ slot.transactionStack = [];
448
+ return;
449
+ }
450
+ await this.ensurePersistentTransaction(slot, connection);
451
+ try {
452
+ await connection.query(`ROLLBACK TO SAVEPOINT ${quoteIdentifier(slot.baselineSavepointName)}`);
453
+ slot.transactionStack = [];
454
+ await connection.query('SET FOREIGN_KEY_CHECKS = 1').catch(() => { });
455
+ this.debugSlot('Shared MySQL backend transaction reset to baseline', slot, {
456
+ baselineSavepoint: slot.baselineSavepointName
457
+ });
458
+ }
459
+ catch (error) {
460
+ this.logger.warning('Shared MySQL backend transaction baseline reset failed; restarting', error, this.slotLogData(slot, {
461
+ baselineSavepoint: slot.baselineSavepointName
462
+ }));
463
+ await this.restartPersistentTransaction(slot, connection);
464
+ }
465
+ }
466
+ async runManagedTransactionCommand(slot, connection, command) {
467
+ this.traceManagedSessionSql(slot, command.toUpperCase(), command.toUpperCase());
468
+ if (command === 'begin') {
469
+ const name = `tsf_session_tx_${++slot.nextTransactionId}`;
470
+ slot.transactionStack.push(name);
471
+ await connection.query(`SAVEPOINT ${quoteIdentifier(name)}`);
472
+ this.debugSlot('Shared MySQL frontend transaction began', slot, { savepoint: name });
473
+ return emptyMySQLResult();
474
+ }
475
+ if (command === 'commit') {
476
+ const name = slot.transactionStack.pop();
477
+ if (name)
478
+ await connection.query(`RELEASE SAVEPOINT ${quoteIdentifier(name)}`);
479
+ this.debugSlot('Shared MySQL frontend transaction committed', slot, { savepoint: name });
480
+ return emptyMySQLResult();
481
+ }
482
+ const name = slot.transactionStack.pop();
483
+ if (name)
484
+ await connection.query(`ROLLBACK TO SAVEPOINT ${quoteIdentifier(name)}`);
485
+ else
486
+ await this.resetConnectionAfterLease(slot);
487
+ this.debugSlot('Shared MySQL frontend transaction rolled back', slot, { savepoint: name });
488
+ return emptyMySQLResult();
489
+ }
490
+ async destroySlot(group, slot, dropDatabase) {
491
+ const databaseLeaseId = slot.reservation?.id;
492
+ this.debugSlot('Shared MySQL database slot destroying', slot, { dropDatabase, leaseId: databaseLeaseId });
493
+ const index = group.slots.indexOf(slot);
494
+ if (index >= 0)
495
+ group.slots.splice(index, 1);
496
+ for (const waiter of slot.waiters.splice(0))
497
+ waiter.reject(new Error('MySQL session database slot removed'));
498
+ slot.schemaPreparing?.reject(new Error('MySQL session database slot removed'));
499
+ await slot.queue.catch(() => { });
500
+ await this.closeBackendConnection(slot, 'slot-destroy');
501
+ slot.lease = undefined;
502
+ slot.reservation = undefined;
503
+ slot.transactionReady = false;
504
+ slot.transactionStack = [];
505
+ if (dropDatabase && !group.keepDatabase && !env_1.Env.TEST_KEEP_DB)
506
+ await this.dropDatabase(slot.databaseName).catch(() => { });
507
+ this.wakeSlotWaiter(group);
508
+ this.logSlot('Shared MySQL database slot destroyed', slot, { dropDatabase, leaseId: databaseLeaseId });
509
+ }
510
+ async createDatabase(databaseName) {
511
+ this.logger.debug('Shared MySQL database creating', { databaseName });
512
+ const connection = await this.adminConnection();
513
+ try {
514
+ await connection.query(`CREATE DATABASE ${quoteIdentifier(databaseName)}`);
515
+ }
516
+ finally {
517
+ await connection.end();
518
+ }
519
+ this.logger.debug('Shared MySQL database created', { databaseName });
520
+ }
521
+ async dropDatabase(databaseName) {
522
+ this.logger.debug('Shared MySQL database dropping', { databaseName });
523
+ const connection = await this.adminConnection();
524
+ try {
525
+ await connection.query(`DROP DATABASE IF EXISTS ${quoteIdentifier(databaseName)}`);
526
+ }
527
+ finally {
528
+ await connection.end();
529
+ }
530
+ this.logger.debug('Shared MySQL database dropped', { databaseName });
531
+ }
532
+ adminConnection() {
533
+ return promise_1.default.createConnection({ ...this.options.mysql, database: 'mysql' });
534
+ }
535
+ createDatabaseName(key, prefix, slotIndex) {
536
+ const safePrefix = prefix.replace(/[^a-zA-Z0-9_]/g, '_') || 'test';
537
+ const hash = hashKey(key);
538
+ const ts = this.options.testRunTs ?? env_1.Env.TEST_RUN_TS ?? String(Math.floor(Date.now() / 1000));
539
+ return `${safePrefix}_${ts}_${process.pid}_${hash}_${slotIndex + 1}`;
540
+ }
541
+ failSchemaPreparation(slot, error) {
542
+ const preparing = slot.schemaPreparing;
543
+ if (!preparing)
544
+ return;
545
+ this.logger.error('Shared MySQL schema preparation timed out', error, this.slotLogData(slot, { preparationId: preparing.id }));
546
+ slot.schemaPreparing = undefined;
547
+ clearTimeout(preparing.timeout);
548
+ preparing.reject(error);
549
+ const group = this.databases.get(slot.key);
550
+ if (!group)
551
+ return;
552
+ const index = group.slots.indexOf(slot);
553
+ if (index >= 0)
554
+ group.slots.splice(index, 1);
555
+ slot.reservation = undefined;
556
+ slot.transactionReady = false;
557
+ slot.transactionStack = [];
558
+ if (!group.keepDatabase && !env_1.Env.TEST_KEEP_DB)
559
+ void this.dropDatabase(slot.databaseName).catch(() => { });
560
+ this.wakeSlotWaiter(group);
561
+ }
562
+ async closeBackendConnection(slot, reason) {
563
+ const connection = slot.connection;
564
+ if (!connection)
565
+ return;
566
+ this.logSlot('Shared MySQL backend connection closing', slot, { reason });
567
+ await rollbackConnection(connection);
568
+ await connection
569
+ .end()
570
+ .catch(error => this.logger.error('Shared MySQL backend connection close failed', error, this.slotLogData(slot, { reason })));
571
+ slot.connection = undefined;
572
+ slot.transactionReady = false;
573
+ slot.transactionStack = [];
574
+ this.logSlot('Shared MySQL backend connection closed', slot, { reason });
575
+ slot.backendConnectionId = undefined;
576
+ }
577
+ logSlot(message, slot, data) {
578
+ this.logger.debug(message, this.slotLogData(slot, data));
579
+ }
580
+ debugSlot(message, slot, data) {
581
+ this.logger.debug(message, this.slotLogData(slot, data));
582
+ }
583
+ slotLogData(slot, data) {
584
+ return {
585
+ keyHash: hashKey(slot.key),
586
+ slotIndex: slot.slotIndex,
587
+ databaseName: slot.databaseName,
588
+ leaseId: slot.reservation?.id,
589
+ backendConnectionId: slot.backendConnectionId,
590
+ frontendConnectionId: slot.lease?.id,
591
+ clientId: slot.lease?.clientId,
592
+ frontendWaiters: slot.waiters.length,
593
+ transactionDepth: slot.transactionStack.length,
594
+ transactionReady: slot.transactionReady,
595
+ schemaReady: !!slot.schemaReady,
596
+ ...data
597
+ };
598
+ }
599
+ groupLogData(group, data) {
600
+ return {
601
+ keyHash: hashKey(group.key),
602
+ prefix: group.prefix,
603
+ keepDatabase: group.keepDatabase,
604
+ poolSize: this.poolSize,
605
+ slots: group.slots.length,
606
+ slotWaiters: group.waiters.length,
607
+ ...data
608
+ };
609
+ }
610
+ createConnectionId(kind, value) {
611
+ return `${kind}-${process.pid}-${value}`;
612
+ }
613
+ logManagedSessionSqlSignal(slot, sql) {
614
+ const signal = readManagedSessionSqlSignal(sql);
615
+ if (!signal)
616
+ return;
617
+ if (signal.invalidatesSavepoints) {
618
+ this.logger.warning('Shared MySQL managed session executing SQL that can invalidate savepoints', this.slotLogData(slot, {
619
+ sqlCommand: signal.command,
620
+ sqlStatement: signal.statement
621
+ }));
622
+ return;
623
+ }
624
+ this.traceManagedSessionSql(slot, signal.command, signal.statement);
625
+ }
626
+ throwRuntimeDdl(slot, signal) {
627
+ throw new Error(`Shared MySQL session manager blocked runtime DDL (${signal.command}) on database ${slot.databaseName}. ` +
628
+ `DDL is only allowed during schema preparation and migrations. Statement: ${signal.statement}`);
629
+ }
630
+ traceManagedSessionSql(slot, sqlCommand, sqlStatement) {
631
+ if (!isEnabledFlag(env_1.Env.TSF_TEST_MYSQL_SESSION_TRACE_SQL))
632
+ return;
633
+ this.logSlot('Shared MySQL managed session SQL', slot, {
634
+ sqlCommand,
635
+ sqlStatement
636
+ });
637
+ }
638
+ static __tsfType = _MySQLSessionManagerMetadata_1 = ({ kind: 16, name: "MySQLSessionManager", typeName: "MySQLSessionManager", classType: () => MySQLSessionManager, properties: [], methods: [{ name: "start", parameters: [], returnType: { kind: 22, type: { kind: 3 } } }, { name: "stop", parameters: [], returnType: { kind: 22, type: { kind: 3 } } }], hasConstructor: true, constructorParameters: [{ name: "options", type: { kind: 18, typeName: "MySQLSessionManagerOptions", types: [{ kind: 20, name: "mysql", type: { kind: 16, typeName: "PoolOptions", classType: () => (typeof PoolOptions !== "undefined" ? PoolOptions : (typeof exports !== "undefined" ? exports.PoolOptions : undefined)) }, optional: false }, { kind: 20, name: "token", type: { kind: 6 }, optional: false }, { kind: 20, name: "testRunTs", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "poolSize", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }] }, optional: false, default: false }] });
639
+ }
640
+ exports.MySQLSessionManager = MySQLSessionManager;
641
+ _MySQLSessionManagerMetadata_1.classType = MySQLSessionManager;
642
+ MySQLSessionManager.__tsfType = _MySQLSessionManagerMetadata_1;
643
+ function normalizePoolSize(poolSize) {
644
+ if (!Number.isFinite(poolSize) || !poolSize)
645
+ return 1;
646
+ return Math.max(1, Math.floor(poolSize));
647
+ }
648
+ function assertRequest(params, token) {
649
+ if (!params || typeof params !== 'object')
650
+ throw new Error('MySQL session manager request params are required');
651
+ const request = params;
652
+ if (request.token !== token)
653
+ throw new Error('Invalid MySQL session manager token');
654
+ return request;
655
+ }
656
+ function readString(request, key) {
657
+ const value = request[key];
658
+ if (typeof value !== 'string' || value.length === 0)
659
+ throw new Error(`Expected ${key} to be a non-empty string`);
660
+ return value;
661
+ }
662
+ function readOptionalString(request, key) {
663
+ const value = request[key];
664
+ if (value === undefined)
665
+ return undefined;
666
+ if (typeof value !== 'string')
667
+ throw new Error(`Expected ${key} to be a string`);
668
+ return value;
669
+ }
670
+ function readBoolean(request, key) {
671
+ const value = request[key];
672
+ if (typeof value !== 'boolean')
673
+ throw new Error(`Expected ${key} to be a boolean`);
674
+ return value;
675
+ }
676
+ function readValues(request) {
677
+ const value = request.values;
678
+ if (value === undefined)
679
+ return [];
680
+ if (!Array.isArray(value))
681
+ throw new Error('Expected values to be an array');
682
+ return value;
683
+ }
684
+ function normalizeMySQLResult(rows) {
685
+ if (Array.isArray(rows))
686
+ return rows;
687
+ if (!rows || typeof rows !== 'object')
688
+ return rows;
689
+ const result = rows;
690
+ return {
691
+ affectedRows: result.affectedRows,
692
+ insertId: result.insertId,
693
+ warningStatus: result.warningStatus,
694
+ changedRows: result.changedRows
695
+ };
696
+ }
697
+ function emptyMySQLResult() {
698
+ return {
699
+ affectedRows: 0,
700
+ insertId: 0,
701
+ warningStatus: 0,
702
+ changedRows: 0
703
+ };
704
+ }
705
+ function readTransactionCommand(sql) {
706
+ const normalized = sql
707
+ .trim()
708
+ .replace(/;+\s*$/, '')
709
+ .replace(/\s+/g, ' ')
710
+ .toUpperCase();
711
+ if (normalized === 'START TRANSACTION' || normalized === 'BEGIN' || normalized === 'BEGIN WORK')
712
+ return 'begin';
713
+ if (normalized === 'COMMIT' || normalized === 'COMMIT WORK')
714
+ return 'commit';
715
+ if (normalized === 'ROLLBACK' || normalized === 'ROLLBACK WORK')
716
+ return 'rollback';
717
+ }
718
+ function readRuntimeDdlSignal(sql) {
719
+ for (const statement of summarizeSqlStatements(sql)) {
720
+ const command = readDdlCommand(statement.toUpperCase());
721
+ if (command)
722
+ return { command, statement };
723
+ }
724
+ }
725
+ function readManagedSessionSqlSignal(sql) {
726
+ const statement = summarizeSqlStatement(sql);
727
+ if (!statement)
728
+ return undefined;
729
+ const upper = statement.toUpperCase();
730
+ const invalidatingCommand = readSavepointInvalidatingCommand(upper);
731
+ if (invalidatingCommand)
732
+ return { command: invalidatingCommand, statement, invalidatesSavepoints: true };
733
+ const traceCommand = readTraceableTransactionCommand(upper);
734
+ if (traceCommand)
735
+ return { command: traceCommand, statement, invalidatesSavepoints: false };
736
+ }
737
+ function readSavepointInvalidatingCommand(upperStatement) {
738
+ const ddlCommand = readDdlCommand(upperStatement);
739
+ if (ddlCommand)
740
+ return ddlCommand;
741
+ if (/^LOCK\s+TABLES\b/.test(upperStatement))
742
+ return 'LOCK TABLES';
743
+ if (/^UNLOCK\s+TABLES\b/.test(upperStatement))
744
+ return 'UNLOCK TABLES';
745
+ if (/^SET\s+(?:SESSION\s+|@@SESSION\.)?AUTOCOMMIT\s*=\s*(?:1|ON|TRUE)\b/.test(upperStatement))
746
+ return 'SET AUTOCOMMIT';
747
+ if (/^START\s+TRANSACTION\b/.test(upperStatement))
748
+ return 'START TRANSACTION';
749
+ if (/^BEGIN\b/.test(upperStatement))
750
+ return 'BEGIN';
751
+ if (/^COMMIT\b/.test(upperStatement))
752
+ return 'COMMIT';
753
+ if (/^ROLLBACK\b(?!\s+TO\s+SAVEPOINT\b)/.test(upperStatement))
754
+ return 'ROLLBACK';
755
+ }
756
+ function readDdlCommand(upperStatement) {
757
+ if (/^CREATE\b/.test(upperStatement))
758
+ return 'CREATE';
759
+ if (/^ALTER\b/.test(upperStatement))
760
+ return 'ALTER';
761
+ if (/^DROP\b/.test(upperStatement))
762
+ return 'DROP';
763
+ if (/^TRUNCATE\b/.test(upperStatement))
764
+ return 'TRUNCATE';
765
+ if (/^RENAME\b/.test(upperStatement))
766
+ return 'RENAME';
767
+ }
768
+ function isInternalLocksTableCreate(statement) {
769
+ return /^CREATE\s+TABLE\s+IF\s+NOT\s+EXISTS\s+`?[A-Za-z0-9_]+`?\s*\(\s*`?key`?\s+VARCHAR\(255\)\s+NOT\s+NULL\s+PRIMARY\s+KEY,\s*`?createdAt`?\s+DATETIME\s+NOT\s+NULL\s+DEFAULT\s+CURRENT_TIMESTAMP,\s*`?lastTouched`?\s+DATETIME\s*\)$/i.test(statement);
770
+ }
771
+ function readTraceableTransactionCommand(upperStatement) {
772
+ if (/^SAVEPOINT\b/.test(upperStatement))
773
+ return 'SAVEPOINT';
774
+ if (/^ROLLBACK\s+TO\s+SAVEPOINT\b/.test(upperStatement))
775
+ return 'ROLLBACK TO SAVEPOINT';
776
+ if (/^RELEASE\s+SAVEPOINT\b/.test(upperStatement))
777
+ return 'RELEASE SAVEPOINT';
778
+ }
779
+ function summarizeSqlStatement(sql) {
780
+ return stripLeadingSqlComments(sql)
781
+ .trim()
782
+ .replace(/;+\s*$/, '')
783
+ .replace(/\s+/g, ' ')
784
+ .slice(0, 500);
785
+ }
786
+ function summarizeSqlStatements(sql) {
787
+ return splitSqlStatementsForInspection(sql)
788
+ .map(summarizeSqlStatement)
789
+ .filter(statement => statement.length > 0);
790
+ }
791
+ function splitSqlStatementsForInspection(sql) {
792
+ const statements = [];
793
+ let statementStart = 0;
794
+ let quote;
795
+ let inLineComment = false;
796
+ let inBlockComment = false;
797
+ let i = 0;
798
+ while (i < sql.length) {
799
+ const char = sql[i];
800
+ const next = sql[i + 1];
801
+ if (inLineComment) {
802
+ if (char === '\n' || char === '\r')
803
+ inLineComment = false;
804
+ i++;
805
+ continue;
806
+ }
807
+ if (inBlockComment) {
808
+ if (char === '*' && next === '/') {
809
+ inBlockComment = false;
810
+ i += 2;
811
+ }
812
+ else {
813
+ i++;
814
+ }
815
+ continue;
816
+ }
817
+ if (quote) {
818
+ if ((quote === "'" || quote === '"') && char === '\\') {
819
+ i += 2;
820
+ continue;
821
+ }
822
+ if (char === quote) {
823
+ if (next === quote) {
824
+ i += 2;
825
+ continue;
826
+ }
827
+ quote = undefined;
828
+ }
829
+ i++;
830
+ continue;
831
+ }
832
+ if (char === '-' && next === '-') {
833
+ inLineComment = true;
834
+ i += 2;
835
+ continue;
836
+ }
837
+ if (char === '#') {
838
+ inLineComment = true;
839
+ i++;
840
+ continue;
841
+ }
842
+ if (char === '/' && next === '*') {
843
+ inBlockComment = true;
844
+ i += 2;
845
+ continue;
846
+ }
847
+ if (char === "'" || char === '"' || char === '`') {
848
+ quote = char;
849
+ i++;
850
+ continue;
851
+ }
852
+ if (char === ';') {
853
+ const statement = sql.slice(statementStart, i).trim();
854
+ if (statement)
855
+ statements.push(statement);
856
+ statementStart = i + 1;
857
+ }
858
+ i++;
859
+ }
860
+ const statement = sql.slice(statementStart).trim();
861
+ if (statement)
862
+ statements.push(statement);
863
+ return statements;
864
+ }
865
+ function stripLeadingSqlComments(sql) {
866
+ let statement = sql;
867
+ while (true) {
868
+ const trimmed = statement.trimStart();
869
+ if (trimmed.startsWith('--')) {
870
+ const nextLine = trimmed.indexOf('\n');
871
+ if (nextLine < 0)
872
+ return '';
873
+ statement = trimmed.slice(nextLine + 1);
874
+ continue;
875
+ }
876
+ if (trimmed.startsWith('#')) {
877
+ const nextLine = trimmed.indexOf('\n');
878
+ if (nextLine < 0)
879
+ return '';
880
+ statement = trimmed.slice(nextLine + 1);
881
+ continue;
882
+ }
883
+ if (trimmed.startsWith('/*')) {
884
+ const end = trimmed.indexOf('*/');
885
+ if (end < 0)
886
+ return trimmed;
887
+ statement = trimmed.slice(end + 2);
888
+ continue;
889
+ }
890
+ return trimmed;
891
+ }
892
+ }
893
+ function isEnabledFlag(value) {
894
+ if (value === undefined || value === null)
895
+ return false;
896
+ const normalized = String(value).trim().toLowerCase();
897
+ return normalized === '1' || normalized === 'true' || normalized === 'yes' || normalized === 'on';
898
+ }
899
+ function hashKey(key) {
900
+ return (0, node_crypto_1.createHash)('sha1').update(key).digest('hex').slice(0, 10);
901
+ }
902
+ async function rollbackConnection(connection) {
903
+ await connection.query('ROLLBACK').catch(() => { });
904
+ await connection.query('SET FOREIGN_KEY_CHECKS = 1').catch(() => { });
905
+ }
906
+ function quoteIdentifier(identifier) {
907
+ return `\`${identifier.replace(/`/g, '``')}\``;
908
+ }
909
+ exports.__tsfTypeAliases = ({ "DatabasePoolState": { kind: 18, typeName: "DatabasePoolState", types: [{ kind: 20, name: "key", type: { kind: 6 }, optional: false }, { kind: 20, name: "prefix", type: { kind: 6 }, optional: false }, { kind: 20, name: "keepDatabase", type: { kind: 8 }, optional: false }, { kind: 20, name: "slots", type: { kind: 14, type: { kind: 18, typeName: "DatabaseSlotState", types: [{ kind: 20, name: "key", type: { kind: 6 }, optional: false }, { kind: 20, name: "slotIndex", type: { kind: 7 }, optional: false }, { kind: 20, name: "databaseName", type: { kind: 6 }, optional: false }, { kind: 20, name: "databaseReady", type: { kind: 22, type: { kind: 3 } }, optional: false }, { kind: 20, name: "schemaReady", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "schemaPreparing", type: { kind: 12, types: [{ kind: 2, typeName: "{\n id: string;\n timeout: NodeJS.Timeout;\n promise: Promise<void>;\n resolve: () => void;\n reject: (error: Error) => void;\n }" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "connection", type: { kind: 12, types: [{ kind: 16, typeName: "Connection", classType: () => (typeof Connection !== "undefined" ? Connection : (typeof exports !== "undefined" ? exports.Connection : undefined)) }, { kind: 4 }] }, optional: true }, { kind: 20, name: "backendConnectionId", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "lease", type: { kind: 12, types: [{ kind: 18, typeName: "Lease", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "clientId", type: { kind: 6 }, optional: false }, { kind: 20, name: "owner", type: { kind: 16, typeName: "RpcPeer", classType: () => (typeof require !== "undefined" ? require("../database/drivers/mysql-session-rpc").RpcPeer : undefined) }, optional: false }] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "waiters", type: { kind: 14, type: { kind: 18, typeName: "LeaseWaiter", types: [{ kind: 20, name: "owner", type: { kind: 16, typeName: "RpcPeer", classType: () => (typeof require !== "undefined" ? require("../database/drivers/mysql-session-rpc").RpcPeer : undefined) }, optional: false }, { kind: 20, name: "clientId", type: { kind: 6 }, optional: false }, { kind: 20, name: "resolve", type: { kind: 2, typeName: "() => void" }, optional: false }, { kind: 20, name: "reject", type: { kind: 2, typeName: "(error: Error) => void" }, optional: false }] } }, optional: false }, { kind: 20, name: "reservation", type: { kind: 12, types: [{ kind: 18, typeName: "SlotReservation", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queue", type: { kind: 22, type: { kind: 3 } }, optional: false }, { kind: 20, name: "transactionReady", type: { kind: 8 }, optional: false }, { kind: 20, name: "transactionStack", type: { kind: 14, type: { kind: 6 } }, optional: false }, { kind: 20, name: "nextTransactionId", type: { kind: 7 }, optional: false }, { kind: 20, name: "baselineSavepointName", type: { kind: 6 }, optional: false }] } }, optional: false }, { kind: 20, name: "waiters", type: { kind: 14, type: { kind: 18, typeName: "SlotWaiter", types: [{ kind: 20, name: "owner", type: { kind: 16, typeName: "RpcPeer", classType: () => (typeof require !== "undefined" ? require("../database/drivers/mysql-session-rpc").RpcPeer : undefined) }, optional: false }, { kind: 20, name: "resolve", type: { kind: 2, typeName: "(slot: DatabaseSlotState) => void" }, optional: false }, { kind: 20, name: "reject", type: { kind: 2, typeName: "(error: Error) => void" }, optional: false }] } }, optional: false }, { kind: 20, name: "nextSlotIndex", type: { kind: 7 }, optional: false }] }, "DatabaseSlotState": { kind: 18, typeName: "DatabaseSlotState", types: [{ kind: 20, name: "key", type: { kind: 6 }, optional: false }, { kind: 20, name: "slotIndex", type: { kind: 7 }, optional: false }, { kind: 20, name: "databaseName", type: { kind: 6 }, optional: false }, { kind: 20, name: "databaseReady", type: { kind: 22, type: { kind: 3 } }, optional: false }, { kind: 20, name: "schemaReady", type: { kind: 12, types: [{ kind: 8 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "schemaPreparing", type: { kind: 12, types: [{ kind: 2, typeName: "{\n id: string;\n timeout: NodeJS.Timeout;\n promise: Promise<void>;\n resolve: () => void;\n reject: (error: Error) => void;\n }" }, { kind: 4 }] }, optional: true }, { kind: 20, name: "connection", type: { kind: 12, types: [{ kind: 16, typeName: "Connection", classType: () => (typeof Connection !== "undefined" ? Connection : (typeof exports !== "undefined" ? exports.Connection : undefined)) }, { kind: 4 }] }, optional: true }, { kind: 20, name: "backendConnectionId", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "lease", type: { kind: 12, types: [{ kind: 18, typeName: "Lease", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "clientId", type: { kind: 6 }, optional: false }, { kind: 20, name: "owner", type: { kind: 16, typeName: "RpcPeer", classType: () => (typeof require !== "undefined" ? require("../database/drivers/mysql-session-rpc").RpcPeer : undefined) }, optional: false }] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "waiters", type: { kind: 14, type: { kind: 18, typeName: "LeaseWaiter", types: [{ kind: 20, name: "owner", type: { kind: 16, typeName: "RpcPeer", classType: () => (typeof require !== "undefined" ? require("../database/drivers/mysql-session-rpc").RpcPeer : undefined) }, optional: false }, { kind: 20, name: "clientId", type: { kind: 6 }, optional: false }, { kind: 20, name: "resolve", type: { kind: 2, typeName: "() => void" }, optional: false }, { kind: 20, name: "reject", type: { kind: 2, typeName: "(error: Error) => void" }, optional: false }] } }, optional: false }, { kind: 20, name: "reservation", type: { kind: 12, types: [{ kind: 18, typeName: "SlotReservation", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }] }, { kind: 4 }] }, optional: true }, { kind: 20, name: "queue", type: { kind: 22, type: { kind: 3 } }, optional: false }, { kind: 20, name: "transactionReady", type: { kind: 8 }, optional: false }, { kind: 20, name: "transactionStack", type: { kind: 14, type: { kind: 6 } }, optional: false }, { kind: 20, name: "nextTransactionId", type: { kind: 7 }, optional: false }, { kind: 20, name: "baselineSavepointName", type: { kind: 6 }, optional: false }] }, "Lease": { kind: 18, typeName: "Lease", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }, { kind: 20, name: "clientId", type: { kind: 6 }, optional: false }, { kind: 20, name: "owner", type: { kind: 16, typeName: "RpcPeer", classType: () => (typeof require !== "undefined" ? require("../database/drivers/mysql-session-rpc").RpcPeer : undefined) }, optional: false }] }, "LeaseWaiter": { kind: 18, typeName: "LeaseWaiter", types: [{ kind: 20, name: "owner", type: { kind: 16, typeName: "RpcPeer", classType: () => (typeof require !== "undefined" ? require("../database/drivers/mysql-session-rpc").RpcPeer : undefined) }, optional: false }, { kind: 20, name: "clientId", type: { kind: 6 }, optional: false }, { kind: 20, name: "resolve", type: { kind: 2, typeName: "() => void" }, optional: false }, { kind: 20, name: "reject", type: { kind: 2, typeName: "(error: Error) => void" }, optional: false }] }, "ManagedSessionSqlSignal": { kind: 18, typeName: "ManagedSessionSqlSignal", types: [{ kind: 20, name: "command", type: { kind: 6 }, optional: false }, { kind: 20, name: "statement", type: { kind: 6 }, optional: false }, { kind: 20, name: "invalidatesSavepoints", type: { kind: 8 }, optional: false }] }, "MySQLSessionManagerOptions": { kind: 18, typeName: "MySQLSessionManagerOptions", types: [{ kind: 20, name: "mysql", type: { kind: 16, typeName: "PoolOptions", classType: () => (typeof PoolOptions !== "undefined" ? PoolOptions : (typeof exports !== "undefined" ? exports.PoolOptions : undefined)) }, optional: false }, { kind: 20, name: "token", type: { kind: 6 }, optional: false }, { kind: 20, name: "testRunTs", type: { kind: 12, types: [{ kind: 6 }, { kind: 4 }] }, optional: true }, { kind: 20, name: "poolSize", type: { kind: 12, types: [{ kind: 7 }, { kind: 4 }] }, optional: true }] }, "RuntimeDdlSignal": { kind: 18, typeName: "RuntimeDdlSignal", types: [{ kind: 20, name: "command", type: { kind: 6 }, optional: false }, { kind: 20, name: "statement", type: { kind: 6 }, optional: false }] }, "SlotReservation": { kind: 18, typeName: "SlotReservation", types: [{ kind: 20, name: "id", type: { kind: 6 }, optional: false }] }, "SlotWaiter": { kind: 18, typeName: "SlotWaiter", types: [{ kind: 20, name: "owner", type: { kind: 16, typeName: "RpcPeer", classType: () => (typeof require !== "undefined" ? require("../database/drivers/mysql-session-rpc").RpcPeer : undefined) }, optional: false }, { kind: 20, name: "resolve", type: { kind: 2, typeName: "(slot: DatabaseSlotState) => void" }, optional: false }, { kind: 20, name: "reject", type: { kind: 2, typeName: "(error: Error) => void" }, optional: false }] }, "TransactionCommand": { kind: 12, types: [{ kind: 10, literal: "begin" }, { kind: 10, literal: "commit" }, { kind: 10, literal: "rollback" }], typeName: "TransactionCommand" } });
910
+ //# sourceMappingURL=mysql-session-manager.js.map