@decaf-ts/core 0.13.1 → 0.14.0

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 (664) hide show
  1. package/README.md +1 -1
  2. package/dist/core.cjs +1 -1
  3. package/dist/core.cjs.map +1 -1
  4. package/dist/core.js +1 -1
  5. package/dist/core.js.map +1 -1
  6. package/lib/cjs/auth/constants.js.map +1 -0
  7. package/lib/cjs/auth/decorators.js.map +1 -0
  8. package/lib/cjs/auth/index.js.map +1 -0
  9. package/lib/cjs/fs/FilesystemAdapter.js.map +1 -0
  10. package/lib/cjs/fs/FsDispatch.js.map +1 -0
  11. package/lib/cjs/fs/helpers.js.map +1 -0
  12. package/lib/cjs/fs/index.js.map +1 -0
  13. package/lib/cjs/fs/indexStore.js.map +1 -0
  14. package/lib/cjs/fs/locks/FilesystemLock.js.map +1 -0
  15. package/lib/cjs/fs/locks/FilesystemMultiLock.js.map +1 -0
  16. package/lib/{fs → cjs/fs}/types.js.map +1 -1
  17. package/lib/cjs/identity/decorators.js.map +1 -0
  18. package/lib/cjs/identity/index.js.map +1 -0
  19. package/lib/{index.cjs → cjs/index.cjs} +1 -1
  20. package/lib/cjs/index.js.map +1 -0
  21. package/lib/cjs/interfaces/ContextuallyLogged.js.map +1 -0
  22. package/lib/cjs/interfaces/ErrorParser.js.map +1 -0
  23. package/lib/{interfaces → cjs/interfaces}/Executor.js.map +1 -1
  24. package/lib/cjs/interfaces/Observable.js.map +1 -0
  25. package/lib/{interfaces → cjs/interfaces}/Observer.js.map +1 -1
  26. package/lib/cjs/interfaces/Paginatable.js.map +1 -0
  27. package/lib/{interfaces → cjs/interfaces}/Queriable.js.map +1 -1
  28. package/lib/cjs/interfaces/RawExecutor.js.map +1 -0
  29. package/lib/cjs/interfaces/SequenceOptions.js.map +1 -0
  30. package/lib/cjs/interfaces/index.js.map +1 -0
  31. package/lib/cjs/migrations/Migration.js.map +1 -0
  32. package/lib/cjs/migrations/MigrationService.js.map +1 -0
  33. package/lib/cjs/migrations/MigrationTaskBuilder.js.map +1 -0
  34. package/lib/cjs/migrations/MigrationTasks.js.map +1 -0
  35. package/lib/cjs/migrations/MigrationVersioning.js.map +1 -0
  36. package/lib/cjs/migrations/SemverMigrationVersioning.js.map +1 -0
  37. package/lib/cjs/migrations/StandardMigrationVersioning.js.map +1 -0
  38. package/lib/cjs/migrations/constants.js.map +1 -0
  39. package/lib/cjs/migrations/decorators.js.map +1 -0
  40. package/lib/cjs/migrations/index.js.map +1 -0
  41. package/lib/{persistence → cjs/migrations}/types.js.map +1 -1
  42. package/lib/cjs/model/BaseModel.js.map +1 -0
  43. package/lib/cjs/model/SequenceModel.js.map +1 -0
  44. package/lib/cjs/model/construction.js.map +1 -0
  45. package/lib/cjs/model/decorators.js.map +1 -0
  46. package/lib/cjs/model/index.js.map +1 -0
  47. package/lib/cjs/model/indexing.js.map +1 -0
  48. package/lib/{model → cjs/model}/types.js.map +1 -1
  49. package/lib/cjs/overrides/Metadata.js.map +1 -0
  50. package/lib/cjs/overrides/Model.js.map +1 -0
  51. package/lib/cjs/overrides/ModelBuilder.js.map +1 -0
  52. package/lib/cjs/overrides/index.js.map +1 -0
  53. package/lib/cjs/overrides/injectables.js.map +1 -0
  54. package/lib/cjs/overrides/overrides.js.map +1 -0
  55. package/lib/{persistence → cjs/persistence}/Adapter.cjs +12 -4
  56. package/lib/cjs/persistence/Adapter.js.map +1 -0
  57. package/lib/cjs/persistence/Context.js.map +1 -0
  58. package/lib/cjs/persistence/ContextLock.js.map +1 -0
  59. package/lib/cjs/persistence/Dispatch.js.map +1 -0
  60. package/lib/cjs/persistence/ObserverHandler.js.map +1 -0
  61. package/lib/cjs/persistence/Sequence.js.map +1 -0
  62. package/lib/cjs/persistence/constants.js.map +1 -0
  63. package/lib/cjs/persistence/decorators.js.map +1 -0
  64. package/lib/cjs/persistence/errors.js.map +1 -0
  65. package/lib/cjs/persistence/event-filters.js.map +1 -0
  66. package/lib/cjs/persistence/generators.js.map +1 -0
  67. package/lib/cjs/persistence/index.js.map +1 -0
  68. package/lib/cjs/persistence/transactions.js.map +1 -0
  69. package/lib/cjs/persistence/types.js.map +1 -0
  70. package/lib/cjs/query/Condition.js.map +1 -0
  71. package/lib/cjs/query/MethodQueryBuilder.js.map +1 -0
  72. package/lib/cjs/query/Paginator.js.map +1 -0
  73. package/lib/cjs/query/Statement.js.map +1 -0
  74. package/lib/cjs/query/constants.js.map +1 -0
  75. package/lib/cjs/query/decorators.js.map +1 -0
  76. package/lib/cjs/query/errors.js.map +1 -0
  77. package/lib/cjs/query/index.js.map +1 -0
  78. package/lib/{query → cjs/query}/options.js.map +1 -1
  79. package/lib/{query → cjs/query}/selectors.js.map +1 -1
  80. package/lib/cjs/query/types.js.map +1 -0
  81. package/lib/cjs/query/utils.js.map +1 -0
  82. package/lib/cjs/ram/RamAdapter.js.map +1 -0
  83. package/lib/cjs/ram/RamPaginator.js.map +1 -0
  84. package/lib/cjs/ram/RamStatement.js.map +1 -0
  85. package/lib/cjs/ram/constants.js.map +1 -0
  86. package/lib/cjs/ram/handlers.js.map +1 -0
  87. package/lib/cjs/ram/index.js.map +1 -0
  88. package/lib/{tasks → cjs/ram}/types.js.map +1 -1
  89. package/lib/{repository → cjs/repository}/Repository.cjs +10 -2
  90. package/lib/cjs/repository/Repository.js.map +1 -0
  91. package/lib/cjs/repository/constants.js.map +1 -0
  92. package/lib/cjs/repository/decorators.js.map +1 -0
  93. package/lib/cjs/repository/errors.js.map +1 -0
  94. package/lib/cjs/repository/index.js.map +1 -0
  95. package/lib/cjs/repository/injectables.js.map +1 -0
  96. package/lib/cjs/repository/types.js.map +1 -0
  97. package/lib/cjs/repository/utils.js.map +1 -0
  98. package/lib/cjs/services/ModelService.js.map +1 -0
  99. package/lib/cjs/services/PersistenceService.js.map +1 -0
  100. package/lib/cjs/services/index.js.map +1 -0
  101. package/lib/cjs/services/services.js.map +1 -0
  102. package/lib/cjs/tasks/CleanUpTask.js.map +1 -0
  103. package/lib/cjs/tasks/TaskContext.js.map +1 -0
  104. package/lib/cjs/tasks/TaskEngine.js.map +1 -0
  105. package/lib/cjs/tasks/TaskErrors.js.map +1 -0
  106. package/lib/cjs/tasks/TaskEventBus.js.map +1 -0
  107. package/lib/cjs/tasks/TaskEventService.js.map +1 -0
  108. package/lib/cjs/tasks/TaskHandler.js.map +1 -0
  109. package/lib/cjs/tasks/TaskHandlerRegistry.js.map +1 -0
  110. package/lib/cjs/tasks/TaskService.js.map +1 -0
  111. package/lib/cjs/tasks/TaskStateChangeError.js.map +1 -0
  112. package/lib/cjs/tasks/TaskTracker.js.map +1 -0
  113. package/lib/cjs/tasks/builder.js.map +1 -0
  114. package/lib/cjs/tasks/constants.js.map +1 -0
  115. package/lib/cjs/tasks/decorators.js.map +1 -0
  116. package/lib/cjs/tasks/index.js.map +1 -0
  117. package/lib/cjs/tasks/logging.js.map +1 -0
  118. package/lib/cjs/tasks/models/TaskBackoffModel.js.map +1 -0
  119. package/lib/cjs/tasks/models/TaskErrorModel.js.map +1 -0
  120. package/lib/cjs/tasks/models/TaskEventModel.js.map +1 -0
  121. package/lib/cjs/tasks/models/TaskIOSerializer.js.map +1 -0
  122. package/lib/cjs/tasks/models/TaskLogEntryModel.js.map +1 -0
  123. package/lib/cjs/tasks/models/TaskModel.js.map +1 -0
  124. package/lib/cjs/tasks/models/TaskStepResultModel.js.map +1 -0
  125. package/lib/cjs/tasks/models/TaskStepSpecModel.js.map +1 -0
  126. package/lib/cjs/tasks/models/index.js.map +1 -0
  127. package/lib/{ram → cjs/tasks}/types.js.map +1 -1
  128. package/lib/cjs/tasks/utils.js.map +1 -0
  129. package/lib/cjs/utils/ContextualLoggedClass.js.map +1 -0
  130. package/lib/cjs/utils/decorators.js.map +1 -0
  131. package/lib/cjs/utils/errors.js.map +1 -0
  132. package/lib/cjs/utils/index.js.map +1 -0
  133. package/lib/cjs/utils/throttling.js.map +1 -0
  134. package/lib/cjs/utils/types.js.map +1 -0
  135. package/lib/cjs/utils/utils.js.map +1 -0
  136. package/lib/cjs/workers/TaskEngine.js.map +1 -0
  137. package/lib/cjs/workers/WorkThreadEnvironment.js.map +1 -0
  138. package/lib/cjs/workers/index.js.map +1 -0
  139. package/lib/{workers → cjs/workers}/messages.js.map +1 -1
  140. package/lib/{migrations → cjs/workers}/types.js.map +1 -1
  141. package/lib/cjs/workers/workerThread.js.map +1 -0
  142. package/lib/esm/index.js +1 -1
  143. package/lib/esm/persistence/Adapter.js +12 -4
  144. package/lib/esm/persistence/Adapter.js.map +1 -1
  145. package/lib/esm/repository/Repository.js +10 -2
  146. package/lib/esm/repository/Repository.js.map +1 -1
  147. package/lib/{esm → types}/index.d.ts +1 -1
  148. package/lib/{esm → types}/persistence/transactions.d.ts +1 -1
  149. package/lib/{repository → types/repository}/Repository.d.ts +1 -1
  150. package/lib/{services → types/services}/ModelService.d.ts +2 -2
  151. package/lib/{esm → types}/tasks/TaskService.d.ts +2 -2
  152. package/package.json +26 -20
  153. package/lib/auth/constants.js.map +0 -1
  154. package/lib/auth/decorators.js.map +0 -1
  155. package/lib/auth/index.js.map +0 -1
  156. package/lib/esm/auth/constants.d.ts +0 -5
  157. package/lib/esm/auth/decorators.d.ts +0 -5
  158. package/lib/esm/auth/index.d.ts +0 -2
  159. package/lib/esm/repository/Repository.d.ts +0 -501
  160. package/lib/esm/services/ModelService.d.ts +0 -45
  161. package/lib/fs/FilesystemAdapter.d.ts +0 -70
  162. package/lib/fs/FilesystemAdapter.js.map +0 -1
  163. package/lib/fs/FsDispatch.d.ts +0 -7
  164. package/lib/fs/FsDispatch.js.map +0 -1
  165. package/lib/fs/helpers.d.ts +0 -17
  166. package/lib/fs/helpers.js.map +0 -1
  167. package/lib/fs/index.d.ts +0 -4
  168. package/lib/fs/index.js.map +0 -1
  169. package/lib/fs/indexStore.d.ts +0 -28
  170. package/lib/fs/indexStore.js.map +0 -1
  171. package/lib/fs/locks/FilesystemLock.d.ts +0 -13
  172. package/lib/fs/locks/FilesystemLock.js.map +0 -1
  173. package/lib/fs/locks/FilesystemMultiLock.d.ts +0 -8
  174. package/lib/fs/locks/FilesystemMultiLock.js.map +0 -1
  175. package/lib/fs/types.d.ts +0 -40
  176. package/lib/identity/decorators.d.ts +0 -72
  177. package/lib/identity/decorators.js.map +0 -1
  178. package/lib/identity/index.d.ts +0 -6
  179. package/lib/identity/index.js.map +0 -1
  180. package/lib/index.d.ts +0 -33
  181. package/lib/index.js.map +0 -1
  182. package/lib/interfaces/ContextuallyLogged.d.ts +0 -8
  183. package/lib/interfaces/ContextuallyLogged.js.map +0 -1
  184. package/lib/interfaces/ErrorParser.d.ts +0 -16
  185. package/lib/interfaces/ErrorParser.js.map +0 -1
  186. package/lib/interfaces/Executor.d.ts +0 -16
  187. package/lib/interfaces/Observable.d.ts +0 -33
  188. package/lib/interfaces/Observable.js.map +0 -1
  189. package/lib/interfaces/Observer.d.ts +0 -15
  190. package/lib/interfaces/Paginatable.d.ts +0 -20
  191. package/lib/interfaces/Paginatable.js.map +0 -1
  192. package/lib/interfaces/Queriable.d.ts +0 -47
  193. package/lib/interfaces/RawExecutor.d.ts +0 -28
  194. package/lib/interfaces/RawExecutor.js.map +0 -1
  195. package/lib/interfaces/SequenceOptions.d.ts +0 -79
  196. package/lib/interfaces/SequenceOptions.js.map +0 -1
  197. package/lib/interfaces/index.d.ts +0 -12
  198. package/lib/interfaces/index.js.map +0 -1
  199. package/lib/migrations/Migration.d.ts +0 -19
  200. package/lib/migrations/Migration.js.map +0 -1
  201. package/lib/migrations/MigrationService.d.ts +0 -63
  202. package/lib/migrations/MigrationService.js.map +0 -1
  203. package/lib/migrations/MigrationTaskBuilder.d.ts +0 -10
  204. package/lib/migrations/MigrationTaskBuilder.js.map +0 -1
  205. package/lib/migrations/MigrationTasks.d.ts +0 -9
  206. package/lib/migrations/MigrationTasks.js.map +0 -1
  207. package/lib/migrations/MigrationVersioning.d.ts +0 -7
  208. package/lib/migrations/MigrationVersioning.js.map +0 -1
  209. package/lib/migrations/SemverMigrationVersioning.d.ts +0 -10
  210. package/lib/migrations/SemverMigrationVersioning.js.map +0 -1
  211. package/lib/migrations/StandardMigrationVersioning.d.ts +0 -12
  212. package/lib/migrations/StandardMigrationVersioning.js.map +0 -1
  213. package/lib/migrations/constants.d.ts +0 -2
  214. package/lib/migrations/constants.js.map +0 -1
  215. package/lib/migrations/decorators.d.ts +0 -12
  216. package/lib/migrations/decorators.js.map +0 -1
  217. package/lib/migrations/index.d.ts +0 -14
  218. package/lib/migrations/index.js.map +0 -1
  219. package/lib/migrations/types.d.ts +0 -46
  220. package/lib/model/BaseModel.d.ts +0 -37
  221. package/lib/model/BaseModel.js.map +0 -1
  222. package/lib/model/SequenceModel.d.ts +0 -32
  223. package/lib/model/SequenceModel.js.map +0 -1
  224. package/lib/model/construction.d.ts +0 -455
  225. package/lib/model/construction.js.map +0 -1
  226. package/lib/model/decorators.d.ts +0 -237
  227. package/lib/model/decorators.js.map +0 -1
  228. package/lib/model/index.d.ts +0 -11
  229. package/lib/model/index.js.map +0 -1
  230. package/lib/model/indexing.d.ts +0 -20
  231. package/lib/model/indexing.js.map +0 -1
  232. package/lib/model/types.d.ts +0 -60
  233. package/lib/overrides/Metadata.d.ts +0 -22
  234. package/lib/overrides/Metadata.js.map +0 -1
  235. package/lib/overrides/Model.d.ts +0 -94
  236. package/lib/overrides/Model.js.map +0 -1
  237. package/lib/overrides/ModelBuilder.d.ts +0 -31
  238. package/lib/overrides/ModelBuilder.js.map +0 -1
  239. package/lib/overrides/index.d.ts +0 -10
  240. package/lib/overrides/index.js.map +0 -1
  241. package/lib/overrides/injectables.d.ts +0 -10
  242. package/lib/overrides/injectables.js.map +0 -1
  243. package/lib/overrides/overrides.d.ts +0 -1
  244. package/lib/overrides/overrides.js.map +0 -1
  245. package/lib/persistence/Adapter.d.ts +0 -469
  246. package/lib/persistence/Adapter.js.map +0 -1
  247. package/lib/persistence/Context.d.ts +0 -16
  248. package/lib/persistence/Context.js.map +0 -1
  249. package/lib/persistence/ContextLock.d.ts +0 -18
  250. package/lib/persistence/ContextLock.js.map +0 -1
  251. package/lib/persistence/Dispatch.d.ts +0 -128
  252. package/lib/persistence/Dispatch.js.map +0 -1
  253. package/lib/persistence/ObserverHandler.d.ts +0 -111
  254. package/lib/persistence/ObserverHandler.js.map +0 -1
  255. package/lib/persistence/Sequence.d.ts +0 -126
  256. package/lib/persistence/Sequence.js.map +0 -1
  257. package/lib/persistence/constants.d.ts +0 -74
  258. package/lib/persistence/constants.js.map +0 -1
  259. package/lib/persistence/decorators.d.ts +0 -28
  260. package/lib/persistence/decorators.js.map +0 -1
  261. package/lib/persistence/errors.d.ts +0 -33
  262. package/lib/persistence/errors.js.map +0 -1
  263. package/lib/persistence/event-filters.d.ts +0 -20
  264. package/lib/persistence/event-filters.js.map +0 -1
  265. package/lib/persistence/generators.d.ts +0 -14
  266. package/lib/persistence/generators.js.map +0 -1
  267. package/lib/persistence/index.d.ts +0 -18
  268. package/lib/persistence/index.js.map +0 -1
  269. package/lib/persistence/transactions.d.ts +0 -4
  270. package/lib/persistence/transactions.js.map +0 -1
  271. package/lib/persistence/types.d.ts +0 -86
  272. package/lib/query/Condition.d.ts +0 -131
  273. package/lib/query/Condition.js.map +0 -1
  274. package/lib/query/MethodQueryBuilder.d.ts +0 -185
  275. package/lib/query/MethodQueryBuilder.js.map +0 -1
  276. package/lib/query/Paginator.d.ts +0 -105
  277. package/lib/query/Paginator.js.map +0 -1
  278. package/lib/query/Statement.d.ts +0 -136
  279. package/lib/query/Statement.js.map +0 -1
  280. package/lib/query/constants.d.ts +0 -69
  281. package/lib/query/constants.js.map +0 -1
  282. package/lib/query/decorators.d.ts +0 -8
  283. package/lib/query/decorators.js.map +0 -1
  284. package/lib/query/errors.d.ts +0 -21
  285. package/lib/query/errors.js.map +0 -1
  286. package/lib/query/index.d.ts +0 -16
  287. package/lib/query/index.js.map +0 -1
  288. package/lib/query/options.d.ts +0 -393
  289. package/lib/query/selectors.d.ts +0 -39
  290. package/lib/query/types.d.ts +0 -158
  291. package/lib/query/types.js.map +0 -1
  292. package/lib/query/utils.d.ts +0 -40
  293. package/lib/query/utils.js.map +0 -1
  294. package/lib/ram/RamAdapter.d.ts +0 -341
  295. package/lib/ram/RamAdapter.js.map +0 -1
  296. package/lib/ram/RamPaginator.d.ts +0 -54
  297. package/lib/ram/RamPaginator.js.map +0 -1
  298. package/lib/ram/RamStatement.d.ts +0 -92
  299. package/lib/ram/RamStatement.js.map +0 -1
  300. package/lib/ram/constants.d.ts +0 -8
  301. package/lib/ram/constants.js.map +0 -1
  302. package/lib/ram/handlers.d.ts +0 -24
  303. package/lib/ram/handlers.js.map +0 -1
  304. package/lib/ram/index.d.ts +0 -6
  305. package/lib/ram/index.js.map +0 -1
  306. package/lib/ram/types.d.ts +0 -50
  307. package/lib/repository/Repository.js.map +0 -1
  308. package/lib/repository/constants.d.ts +0 -36
  309. package/lib/repository/constants.js.map +0 -1
  310. package/lib/repository/decorators.d.ts +0 -30
  311. package/lib/repository/decorators.js.map +0 -1
  312. package/lib/repository/errors.d.ts +0 -19
  313. package/lib/repository/errors.js.map +0 -1
  314. package/lib/repository/index.d.ts +0 -12
  315. package/lib/repository/index.js.map +0 -1
  316. package/lib/repository/injectables.d.ts +0 -95
  317. package/lib/repository/injectables.js.map +0 -1
  318. package/lib/repository/types.d.ts +0 -28
  319. package/lib/repository/types.js.map +0 -1
  320. package/lib/repository/utils.d.ts +0 -36
  321. package/lib/repository/utils.js.map +0 -1
  322. package/lib/services/ModelService.js.map +0 -1
  323. package/lib/services/PersistenceService.d.ts +0 -17
  324. package/lib/services/PersistenceService.js.map +0 -1
  325. package/lib/services/index.d.ts +0 -8
  326. package/lib/services/index.js.map +0 -1
  327. package/lib/services/services.d.ts +0 -96
  328. package/lib/services/services.js.map +0 -1
  329. package/lib/tasks/CleanUpTask.d.ts +0 -15
  330. package/lib/tasks/CleanUpTask.js.map +0 -1
  331. package/lib/tasks/TaskContext.d.ts +0 -30
  332. package/lib/tasks/TaskContext.js.map +0 -1
  333. package/lib/tasks/TaskEngine.d.ts +0 -97
  334. package/lib/tasks/TaskEngine.js.map +0 -1
  335. package/lib/tasks/TaskErrors.d.ts +0 -65
  336. package/lib/tasks/TaskErrors.js.map +0 -1
  337. package/lib/tasks/TaskEventBus.d.ts +0 -17
  338. package/lib/tasks/TaskEventBus.js.map +0 -1
  339. package/lib/tasks/TaskEventService.d.ts +0 -7
  340. package/lib/tasks/TaskEventService.js.map +0 -1
  341. package/lib/tasks/TaskHandler.d.ts +0 -12
  342. package/lib/tasks/TaskHandler.js.map +0 -1
  343. package/lib/tasks/TaskHandlerRegistry.d.ts +0 -8
  344. package/lib/tasks/TaskHandlerRegistry.js.map +0 -1
  345. package/lib/tasks/TaskService.d.ts +0 -65
  346. package/lib/tasks/TaskService.js.map +0 -1
  347. package/lib/tasks/TaskStateChangeError.d.ts +0 -11
  348. package/lib/tasks/TaskStateChangeError.js.map +0 -1
  349. package/lib/tasks/TaskTracker.d.ts +0 -47
  350. package/lib/tasks/TaskTracker.js.map +0 -1
  351. package/lib/tasks/builder.d.ts +0 -72
  352. package/lib/tasks/builder.js.map +0 -1
  353. package/lib/tasks/constants.d.ts +0 -31
  354. package/lib/tasks/constants.js.map +0 -1
  355. package/lib/tasks/decorators.d.ts +0 -4
  356. package/lib/tasks/decorators.js.map +0 -1
  357. package/lib/tasks/index.d.ts +0 -22
  358. package/lib/tasks/index.js.map +0 -1
  359. package/lib/tasks/logging.d.ts +0 -31
  360. package/lib/tasks/logging.js.map +0 -1
  361. package/lib/tasks/models/TaskBackoffModel.d.ts +0 -9
  362. package/lib/tasks/models/TaskBackoffModel.js.map +0 -1
  363. package/lib/tasks/models/TaskErrorModel.d.ts +0 -8
  364. package/lib/tasks/models/TaskErrorModel.js.map +0 -1
  365. package/lib/tasks/models/TaskEventModel.d.ts +0 -11
  366. package/lib/tasks/models/TaskEventModel.js.map +0 -1
  367. package/lib/tasks/models/TaskIOSerializer.d.ts +0 -33
  368. package/lib/tasks/models/TaskIOSerializer.js.map +0 -1
  369. package/lib/tasks/models/TaskLogEntryModel.d.ts +0 -10
  370. package/lib/tasks/models/TaskLogEntryModel.js.map +0 -1
  371. package/lib/tasks/models/TaskModel.d.ts +0 -43
  372. package/lib/tasks/models/TaskModel.js.map +0 -1
  373. package/lib/tasks/models/TaskStepResultModel.d.ts +0 -9
  374. package/lib/tasks/models/TaskStepResultModel.js.map +0 -1
  375. package/lib/tasks/models/TaskStepSpecModel.d.ts +0 -9
  376. package/lib/tasks/models/TaskStepSpecModel.js.map +0 -1
  377. package/lib/tasks/models/index.d.ts +0 -8
  378. package/lib/tasks/models/index.js.map +0 -1
  379. package/lib/tasks/types.d.ts +0 -71
  380. package/lib/tasks/utils.d.ts +0 -5
  381. package/lib/tasks/utils.js.map +0 -1
  382. package/lib/utils/ContextualLoggedClass.d.ts +0 -37
  383. package/lib/utils/ContextualLoggedClass.js.map +0 -1
  384. package/lib/utils/decorators.d.ts +0 -27
  385. package/lib/utils/decorators.js.map +0 -1
  386. package/lib/utils/errors.d.ts +0 -56
  387. package/lib/utils/errors.js.map +0 -1
  388. package/lib/utils/index.d.ts +0 -11
  389. package/lib/utils/index.js.map +0 -1
  390. package/lib/utils/throttling.d.ts +0 -9
  391. package/lib/utils/throttling.js.map +0 -1
  392. package/lib/utils/types.d.ts +0 -23
  393. package/lib/utils/types.js.map +0 -1
  394. package/lib/utils/utils.d.ts +0 -22
  395. package/lib/utils/utils.js.map +0 -1
  396. package/lib/workers/TaskEngine.d.ts +0 -40
  397. package/lib/workers/TaskEngine.js.map +0 -1
  398. package/lib/workers/WorkThreadEnvironment.d.ts +0 -35
  399. package/lib/workers/WorkThreadEnvironment.js.map +0 -1
  400. package/lib/workers/index.d.ts +0 -4
  401. package/lib/workers/index.js.map +0 -1
  402. package/lib/workers/messages.d.ts +0 -69
  403. package/lib/workers/types.d.ts +0 -41
  404. package/lib/workers/types.js.map +0 -1
  405. package/lib/workers/workerThread.d.ts +0 -1
  406. package/lib/workers/workerThread.js.map +0 -1
  407. /package/lib/{auth → cjs/auth}/constants.cjs +0 -0
  408. /package/lib/{auth → cjs/auth}/decorators.cjs +0 -0
  409. /package/lib/{auth → cjs/auth}/index.cjs +0 -0
  410. /package/lib/{fs → cjs/fs}/FilesystemAdapter.cjs +0 -0
  411. /package/lib/{fs → cjs/fs}/FsDispatch.cjs +0 -0
  412. /package/lib/{fs → cjs/fs}/helpers.cjs +0 -0
  413. /package/lib/{fs → cjs/fs}/index.cjs +0 -0
  414. /package/lib/{fs → cjs/fs}/indexStore.cjs +0 -0
  415. /package/lib/{fs → cjs/fs}/locks/FilesystemLock.cjs +0 -0
  416. /package/lib/{fs → cjs/fs}/locks/FilesystemMultiLock.cjs +0 -0
  417. /package/lib/{fs → cjs/fs}/types.cjs +0 -0
  418. /package/lib/{identity → cjs/identity}/decorators.cjs +0 -0
  419. /package/lib/{identity → cjs/identity}/index.cjs +0 -0
  420. /package/lib/{interfaces → cjs/interfaces}/ContextuallyLogged.cjs +0 -0
  421. /package/lib/{interfaces → cjs/interfaces}/ErrorParser.cjs +0 -0
  422. /package/lib/{interfaces → cjs/interfaces}/Executor.cjs +0 -0
  423. /package/lib/{interfaces → cjs/interfaces}/Observable.cjs +0 -0
  424. /package/lib/{interfaces → cjs/interfaces}/Observer.cjs +0 -0
  425. /package/lib/{interfaces → cjs/interfaces}/Paginatable.cjs +0 -0
  426. /package/lib/{interfaces → cjs/interfaces}/Queriable.cjs +0 -0
  427. /package/lib/{interfaces → cjs/interfaces}/RawExecutor.cjs +0 -0
  428. /package/lib/{interfaces → cjs/interfaces}/SequenceOptions.cjs +0 -0
  429. /package/lib/{interfaces → cjs/interfaces}/index.cjs +0 -0
  430. /package/lib/{migrations → cjs/migrations}/Migration.cjs +0 -0
  431. /package/lib/{migrations → cjs/migrations}/MigrationService.cjs +0 -0
  432. /package/lib/{migrations → cjs/migrations}/MigrationTaskBuilder.cjs +0 -0
  433. /package/lib/{migrations → cjs/migrations}/MigrationTasks.cjs +0 -0
  434. /package/lib/{migrations → cjs/migrations}/MigrationVersioning.cjs +0 -0
  435. /package/lib/{migrations → cjs/migrations}/SemverMigrationVersioning.cjs +0 -0
  436. /package/lib/{migrations → cjs/migrations}/StandardMigrationVersioning.cjs +0 -0
  437. /package/lib/{migrations → cjs/migrations}/constants.cjs +0 -0
  438. /package/lib/{migrations → cjs/migrations}/decorators.cjs +0 -0
  439. /package/lib/{migrations → cjs/migrations}/index.cjs +0 -0
  440. /package/lib/{migrations → cjs/migrations}/types.cjs +0 -0
  441. /package/lib/{model → cjs/model}/BaseModel.cjs +0 -0
  442. /package/lib/{model → cjs/model}/SequenceModel.cjs +0 -0
  443. /package/lib/{model → cjs/model}/construction.cjs +0 -0
  444. /package/lib/{model → cjs/model}/decorators.cjs +0 -0
  445. /package/lib/{model → cjs/model}/index.cjs +0 -0
  446. /package/lib/{model → cjs/model}/indexing.cjs +0 -0
  447. /package/lib/{model → cjs/model}/types.cjs +0 -0
  448. /package/lib/{overrides → cjs/overrides}/Metadata.cjs +0 -0
  449. /package/lib/{overrides → cjs/overrides}/Model.cjs +0 -0
  450. /package/lib/{overrides → cjs/overrides}/ModelBuilder.cjs +0 -0
  451. /package/lib/{overrides → cjs/overrides}/index.cjs +0 -0
  452. /package/lib/{overrides → cjs/overrides}/injectables.cjs +0 -0
  453. /package/lib/{overrides → cjs/overrides}/overrides.cjs +0 -0
  454. /package/lib/{persistence → cjs/persistence}/Context.cjs +0 -0
  455. /package/lib/{persistence → cjs/persistence}/ContextLock.cjs +0 -0
  456. /package/lib/{persistence → cjs/persistence}/Dispatch.cjs +0 -0
  457. /package/lib/{persistence → cjs/persistence}/ObserverHandler.cjs +0 -0
  458. /package/lib/{persistence → cjs/persistence}/Sequence.cjs +0 -0
  459. /package/lib/{persistence → cjs/persistence}/constants.cjs +0 -0
  460. /package/lib/{persistence → cjs/persistence}/decorators.cjs +0 -0
  461. /package/lib/{persistence → cjs/persistence}/errors.cjs +0 -0
  462. /package/lib/{persistence → cjs/persistence}/event-filters.cjs +0 -0
  463. /package/lib/{persistence → cjs/persistence}/generators.cjs +0 -0
  464. /package/lib/{persistence → cjs/persistence}/index.cjs +0 -0
  465. /package/lib/{persistence → cjs/persistence}/transactions.cjs +0 -0
  466. /package/lib/{persistence → cjs/persistence}/types.cjs +0 -0
  467. /package/lib/{query → cjs/query}/Condition.cjs +0 -0
  468. /package/lib/{query → cjs/query}/MethodQueryBuilder.cjs +0 -0
  469. /package/lib/{query → cjs/query}/Paginator.cjs +0 -0
  470. /package/lib/{query → cjs/query}/Statement.cjs +0 -0
  471. /package/lib/{query → cjs/query}/constants.cjs +0 -0
  472. /package/lib/{query → cjs/query}/decorators.cjs +0 -0
  473. /package/lib/{query → cjs/query}/errors.cjs +0 -0
  474. /package/lib/{query → cjs/query}/index.cjs +0 -0
  475. /package/lib/{query → cjs/query}/options.cjs +0 -0
  476. /package/lib/{query → cjs/query}/selectors.cjs +0 -0
  477. /package/lib/{query → cjs/query}/types.cjs +0 -0
  478. /package/lib/{query → cjs/query}/utils.cjs +0 -0
  479. /package/lib/{ram → cjs/ram}/RamAdapter.cjs +0 -0
  480. /package/lib/{ram → cjs/ram}/RamPaginator.cjs +0 -0
  481. /package/lib/{ram → cjs/ram}/RamStatement.cjs +0 -0
  482. /package/lib/{ram → cjs/ram}/constants.cjs +0 -0
  483. /package/lib/{ram → cjs/ram}/handlers.cjs +0 -0
  484. /package/lib/{ram → cjs/ram}/index.cjs +0 -0
  485. /package/lib/{ram → cjs/ram}/types.cjs +0 -0
  486. /package/lib/{repository → cjs/repository}/constants.cjs +0 -0
  487. /package/lib/{repository → cjs/repository}/decorators.cjs +0 -0
  488. /package/lib/{repository → cjs/repository}/errors.cjs +0 -0
  489. /package/lib/{repository → cjs/repository}/index.cjs +0 -0
  490. /package/lib/{repository → cjs/repository}/injectables.cjs +0 -0
  491. /package/lib/{repository → cjs/repository}/types.cjs +0 -0
  492. /package/lib/{repository → cjs/repository}/utils.cjs +0 -0
  493. /package/lib/{services → cjs/services}/ModelService.cjs +0 -0
  494. /package/lib/{services → cjs/services}/PersistenceService.cjs +0 -0
  495. /package/lib/{services → cjs/services}/index.cjs +0 -0
  496. /package/lib/{services → cjs/services}/services.cjs +0 -0
  497. /package/lib/{tasks → cjs/tasks}/CleanUpTask.cjs +0 -0
  498. /package/lib/{tasks → cjs/tasks}/TaskContext.cjs +0 -0
  499. /package/lib/{tasks → cjs/tasks}/TaskEngine.cjs +0 -0
  500. /package/lib/{tasks → cjs/tasks}/TaskErrors.cjs +0 -0
  501. /package/lib/{tasks → cjs/tasks}/TaskEventBus.cjs +0 -0
  502. /package/lib/{tasks → cjs/tasks}/TaskEventService.cjs +0 -0
  503. /package/lib/{tasks → cjs/tasks}/TaskHandler.cjs +0 -0
  504. /package/lib/{tasks → cjs/tasks}/TaskHandlerRegistry.cjs +0 -0
  505. /package/lib/{tasks → cjs/tasks}/TaskService.cjs +0 -0
  506. /package/lib/{tasks → cjs/tasks}/TaskStateChangeError.cjs +0 -0
  507. /package/lib/{tasks → cjs/tasks}/TaskTracker.cjs +0 -0
  508. /package/lib/{tasks → cjs/tasks}/builder.cjs +0 -0
  509. /package/lib/{tasks → cjs/tasks}/constants.cjs +0 -0
  510. /package/lib/{tasks → cjs/tasks}/decorators.cjs +0 -0
  511. /package/lib/{tasks → cjs/tasks}/index.cjs +0 -0
  512. /package/lib/{tasks → cjs/tasks}/logging.cjs +0 -0
  513. /package/lib/{tasks → cjs/tasks}/models/TaskBackoffModel.cjs +0 -0
  514. /package/lib/{tasks → cjs/tasks}/models/TaskErrorModel.cjs +0 -0
  515. /package/lib/{tasks → cjs/tasks}/models/TaskEventModel.cjs +0 -0
  516. /package/lib/{tasks → cjs/tasks}/models/TaskIOSerializer.cjs +0 -0
  517. /package/lib/{tasks → cjs/tasks}/models/TaskLogEntryModel.cjs +0 -0
  518. /package/lib/{tasks → cjs/tasks}/models/TaskModel.cjs +0 -0
  519. /package/lib/{tasks → cjs/tasks}/models/TaskStepResultModel.cjs +0 -0
  520. /package/lib/{tasks → cjs/tasks}/models/TaskStepSpecModel.cjs +0 -0
  521. /package/lib/{tasks → cjs/tasks}/models/index.cjs +0 -0
  522. /package/lib/{tasks → cjs/tasks}/types.cjs +0 -0
  523. /package/lib/{tasks → cjs/tasks}/utils.cjs +0 -0
  524. /package/lib/{utils → cjs/utils}/ContextualLoggedClass.cjs +0 -0
  525. /package/lib/{utils → cjs/utils}/decorators.cjs +0 -0
  526. /package/lib/{utils → cjs/utils}/errors.cjs +0 -0
  527. /package/lib/{utils → cjs/utils}/index.cjs +0 -0
  528. /package/lib/{utils → cjs/utils}/throttling.cjs +0 -0
  529. /package/lib/{utils → cjs/utils}/types.cjs +0 -0
  530. /package/lib/{utils → cjs/utils}/utils.cjs +0 -0
  531. /package/lib/{workers → cjs/workers}/TaskEngine.cjs +0 -0
  532. /package/lib/{workers → cjs/workers}/WorkThreadEnvironment.cjs +0 -0
  533. /package/lib/{workers → cjs/workers}/index.cjs +0 -0
  534. /package/lib/{workers → cjs/workers}/messages.cjs +0 -0
  535. /package/lib/{workers → cjs/workers}/types.cjs +0 -0
  536. /package/lib/{workers → cjs/workers}/workerThread.cjs +0 -0
  537. /package/lib/{auth → types/auth}/constants.d.ts +0 -0
  538. /package/lib/{auth → types/auth}/decorators.d.ts +0 -0
  539. /package/lib/{auth → types/auth}/index.d.ts +0 -0
  540. /package/lib/{esm → types}/fs/FilesystemAdapter.d.ts +0 -0
  541. /package/lib/{esm → types}/fs/FsDispatch.d.ts +0 -0
  542. /package/lib/{esm → types}/fs/helpers.d.ts +0 -0
  543. /package/lib/{esm → types}/fs/index.d.ts +0 -0
  544. /package/lib/{esm → types}/fs/indexStore.d.ts +0 -0
  545. /package/lib/{esm → types}/fs/locks/FilesystemLock.d.ts +0 -0
  546. /package/lib/{esm → types}/fs/locks/FilesystemMultiLock.d.ts +0 -0
  547. /package/lib/{esm → types}/fs/types.d.ts +0 -0
  548. /package/lib/{esm → types}/identity/decorators.d.ts +0 -0
  549. /package/lib/{esm → types}/identity/index.d.ts +0 -0
  550. /package/lib/{esm → types}/interfaces/ContextuallyLogged.d.ts +0 -0
  551. /package/lib/{esm → types}/interfaces/ErrorParser.d.ts +0 -0
  552. /package/lib/{esm → types}/interfaces/Executor.d.ts +0 -0
  553. /package/lib/{esm → types}/interfaces/Observable.d.ts +0 -0
  554. /package/lib/{esm → types}/interfaces/Observer.d.ts +0 -0
  555. /package/lib/{esm → types}/interfaces/Paginatable.d.ts +0 -0
  556. /package/lib/{esm → types}/interfaces/Queriable.d.ts +0 -0
  557. /package/lib/{esm → types}/interfaces/RawExecutor.d.ts +0 -0
  558. /package/lib/{esm → types}/interfaces/SequenceOptions.d.ts +0 -0
  559. /package/lib/{esm → types}/interfaces/index.d.ts +0 -0
  560. /package/lib/{esm → types}/migrations/Migration.d.ts +0 -0
  561. /package/lib/{esm → types}/migrations/MigrationService.d.ts +0 -0
  562. /package/lib/{esm → types}/migrations/MigrationTaskBuilder.d.ts +0 -0
  563. /package/lib/{esm → types}/migrations/MigrationTasks.d.ts +0 -0
  564. /package/lib/{esm → types}/migrations/MigrationVersioning.d.ts +0 -0
  565. /package/lib/{esm → types}/migrations/SemverMigrationVersioning.d.ts +0 -0
  566. /package/lib/{esm → types}/migrations/StandardMigrationVersioning.d.ts +0 -0
  567. /package/lib/{esm → types}/migrations/constants.d.ts +0 -0
  568. /package/lib/{esm → types}/migrations/decorators.d.ts +0 -0
  569. /package/lib/{esm → types}/migrations/index.d.ts +0 -0
  570. /package/lib/{esm → types}/migrations/types.d.ts +0 -0
  571. /package/lib/{esm → types}/model/BaseModel.d.ts +0 -0
  572. /package/lib/{esm → types}/model/SequenceModel.d.ts +0 -0
  573. /package/lib/{esm → types}/model/construction.d.ts +0 -0
  574. /package/lib/{esm → types}/model/decorators.d.ts +0 -0
  575. /package/lib/{esm → types}/model/index.d.ts +0 -0
  576. /package/lib/{esm → types}/model/indexing.d.ts +0 -0
  577. /package/lib/{esm → types}/model/types.d.ts +0 -0
  578. /package/lib/{esm → types}/overrides/Metadata.d.ts +0 -0
  579. /package/lib/{esm → types}/overrides/Model.d.ts +0 -0
  580. /package/lib/{esm → types}/overrides/ModelBuilder.d.ts +0 -0
  581. /package/lib/{esm → types}/overrides/index.d.ts +0 -0
  582. /package/lib/{esm → types}/overrides/injectables.d.ts +0 -0
  583. /package/lib/{esm → types}/overrides/overrides.d.ts +0 -0
  584. /package/lib/{esm → types}/persistence/Adapter.d.ts +0 -0
  585. /package/lib/{esm → types}/persistence/Context.d.ts +0 -0
  586. /package/lib/{esm → types}/persistence/ContextLock.d.ts +0 -0
  587. /package/lib/{esm → types}/persistence/Dispatch.d.ts +0 -0
  588. /package/lib/{esm → types}/persistence/ObserverHandler.d.ts +0 -0
  589. /package/lib/{esm → types}/persistence/Sequence.d.ts +0 -0
  590. /package/lib/{esm → types}/persistence/constants.d.ts +0 -0
  591. /package/lib/{esm → types}/persistence/decorators.d.ts +0 -0
  592. /package/lib/{esm → types}/persistence/errors.d.ts +0 -0
  593. /package/lib/{esm → types}/persistence/event-filters.d.ts +0 -0
  594. /package/lib/{esm → types}/persistence/generators.d.ts +0 -0
  595. /package/lib/{esm → types}/persistence/index.d.ts +0 -0
  596. /package/lib/{esm → types}/persistence/types.d.ts +0 -0
  597. /package/lib/{esm → types}/query/Condition.d.ts +0 -0
  598. /package/lib/{esm → types}/query/MethodQueryBuilder.d.ts +0 -0
  599. /package/lib/{esm → types}/query/Paginator.d.ts +0 -0
  600. /package/lib/{esm → types}/query/Statement.d.ts +0 -0
  601. /package/lib/{esm → types}/query/constants.d.ts +0 -0
  602. /package/lib/{esm → types}/query/decorators.d.ts +0 -0
  603. /package/lib/{esm → types}/query/errors.d.ts +0 -0
  604. /package/lib/{esm → types}/query/index.d.ts +0 -0
  605. /package/lib/{esm → types}/query/options.d.ts +0 -0
  606. /package/lib/{esm → types}/query/selectors.d.ts +0 -0
  607. /package/lib/{esm → types}/query/types.d.ts +0 -0
  608. /package/lib/{esm → types}/query/utils.d.ts +0 -0
  609. /package/lib/{esm → types}/ram/RamAdapter.d.ts +0 -0
  610. /package/lib/{esm → types}/ram/RamPaginator.d.ts +0 -0
  611. /package/lib/{esm → types}/ram/RamStatement.d.ts +0 -0
  612. /package/lib/{esm → types}/ram/constants.d.ts +0 -0
  613. /package/lib/{esm → types}/ram/handlers.d.ts +0 -0
  614. /package/lib/{esm → types}/ram/index.d.ts +0 -0
  615. /package/lib/{esm → types}/ram/types.d.ts +0 -0
  616. /package/lib/{esm → types}/repository/constants.d.ts +0 -0
  617. /package/lib/{esm → types}/repository/decorators.d.ts +0 -0
  618. /package/lib/{esm → types}/repository/errors.d.ts +0 -0
  619. /package/lib/{esm → types}/repository/index.d.ts +0 -0
  620. /package/lib/{esm → types}/repository/injectables.d.ts +0 -0
  621. /package/lib/{esm → types}/repository/types.d.ts +0 -0
  622. /package/lib/{esm → types}/repository/utils.d.ts +0 -0
  623. /package/lib/{esm → types}/services/PersistenceService.d.ts +0 -0
  624. /package/lib/{esm → types}/services/index.d.ts +0 -0
  625. /package/lib/{esm → types}/services/services.d.ts +0 -0
  626. /package/lib/{esm → types}/tasks/CleanUpTask.d.ts +0 -0
  627. /package/lib/{esm → types}/tasks/TaskContext.d.ts +0 -0
  628. /package/lib/{esm → types}/tasks/TaskEngine.d.ts +0 -0
  629. /package/lib/{esm → types}/tasks/TaskErrors.d.ts +0 -0
  630. /package/lib/{esm → types}/tasks/TaskEventBus.d.ts +0 -0
  631. /package/lib/{esm → types}/tasks/TaskEventService.d.ts +0 -0
  632. /package/lib/{esm → types}/tasks/TaskHandler.d.ts +0 -0
  633. /package/lib/{esm → types}/tasks/TaskHandlerRegistry.d.ts +0 -0
  634. /package/lib/{esm → types}/tasks/TaskStateChangeError.d.ts +0 -0
  635. /package/lib/{esm → types}/tasks/TaskTracker.d.ts +0 -0
  636. /package/lib/{esm → types}/tasks/builder.d.ts +0 -0
  637. /package/lib/{esm → types}/tasks/constants.d.ts +0 -0
  638. /package/lib/{esm → types}/tasks/decorators.d.ts +0 -0
  639. /package/lib/{esm → types}/tasks/index.d.ts +0 -0
  640. /package/lib/{esm → types}/tasks/logging.d.ts +0 -0
  641. /package/lib/{esm → types}/tasks/models/TaskBackoffModel.d.ts +0 -0
  642. /package/lib/{esm → types}/tasks/models/TaskErrorModel.d.ts +0 -0
  643. /package/lib/{esm → types}/tasks/models/TaskEventModel.d.ts +0 -0
  644. /package/lib/{esm → types}/tasks/models/TaskIOSerializer.d.ts +0 -0
  645. /package/lib/{esm → types}/tasks/models/TaskLogEntryModel.d.ts +0 -0
  646. /package/lib/{esm → types}/tasks/models/TaskModel.d.ts +0 -0
  647. /package/lib/{esm → types}/tasks/models/TaskStepResultModel.d.ts +0 -0
  648. /package/lib/{esm → types}/tasks/models/TaskStepSpecModel.d.ts +0 -0
  649. /package/lib/{esm → types}/tasks/models/index.d.ts +0 -0
  650. /package/lib/{esm → types}/tasks/types.d.ts +0 -0
  651. /package/lib/{esm → types}/tasks/utils.d.ts +0 -0
  652. /package/lib/{esm → types}/utils/ContextualLoggedClass.d.ts +0 -0
  653. /package/lib/{esm → types}/utils/decorators.d.ts +0 -0
  654. /package/lib/{esm → types}/utils/errors.d.ts +0 -0
  655. /package/lib/{esm → types}/utils/index.d.ts +0 -0
  656. /package/lib/{esm → types}/utils/throttling.d.ts +0 -0
  657. /package/lib/{esm → types}/utils/types.d.ts +0 -0
  658. /package/lib/{esm → types}/utils/utils.d.ts +0 -0
  659. /package/lib/{esm → types}/workers/TaskEngine.d.ts +0 -0
  660. /package/lib/{esm → types}/workers/WorkThreadEnvironment.d.ts +0 -0
  661. /package/lib/{esm → types}/workers/index.d.ts +0 -0
  662. /package/lib/{esm → types}/workers/messages.d.ts +0 -0
  663. /package/lib/{esm → types}/workers/types.d.ts +0 -0
  664. /package/lib/{esm → types}/workers/workerThread.d.ts +0 -0
@@ -1,501 +0,0 @@
1
- import { IRepository, Repository as Rep, PrimaryKeyType } from "@decaf-ts/db-decorators";
2
- import { Logger } from "@decaf-ts/logging";
3
- import { ContextualArgs, ContextualizedArgs, MaybeContextualArg, MethodOrOperation } from "../utils/ContextualLoggedClass";
4
- import { Adapter } from "../persistence/Adapter";
5
- import { ObserverHandler } from "../persistence/ObserverHandler";
6
- import type { DirectionLimitOffset, QueryOptions } from "../query/types";
7
- import { SelectSelector } from "../query/selectors";
8
- import { CountWhereOption, WhereOption } from "../query/options";
9
- import { Condition } from "../query/Condition";
10
- import { Queriable } from "../interfaces/Queriable";
11
- import { SequenceOptions } from "../interfaces/SequenceOptions";
12
- import { OrderDirection } from "./constants";
13
- import type { AllOperationKeys, ContextOf, EventIds, FlagsOf, InferredAdapterConfig, ObserverFilter, PersistenceObservable, PersistenceObserver } from "../persistence/types";
14
- import type { Observer } from "../interfaces/Observer";
15
- import { Constructor } from "@decaf-ts/decoration";
16
- import { Model } from "@decaf-ts/decorator-validation";
17
- import { SerializedPage } from "../query/Paginator";
18
- /**
19
- * @description Type alias for Repository class with simplified generic parameters.
20
- * @summary Provides a more concise way to reference the Repository class with its generic parameters.
21
- * @template M - The model type that extends Model.
22
- * @template F - The repository flags type.
23
- * @template C - The context type.
24
- * @template Q - The query type.
25
- * @template A - The adapter type.
26
- * @typedef Repo
27
- * @memberOf module:core
28
- */
29
- export type Repo<M extends Model<boolean>> = Repository<M, any>;
30
- /**
31
- * @description Core repository implementation for database operations on models on a table by table way.
32
- * @summary Provides CRUD operations, querying capabilities, and observer pattern implementation for model persistence.
33
- * @template M - The model type that extends Model.
34
- * @template Q - The query type used by the adapter.
35
- * @template A - The adapter type for database operations.
36
- * @template F - The repository flags type.
37
- * @template C - The context type for operations.
38
- * @param {A} [adapter] - Optional adapter instance for database operations.
39
- * @param {Constructor<M>} [clazz] - Optional constructor for the model class.
40
- * @param {...any[]} [args] - Additional arguments for repository initialization.
41
- * @class Repository
42
- * @example
43
- * // Creating a repository for User model
44
- * const userRepo = Repository.forModel(User);
45
- *
46
- * // Using the repository for CRUD operations
47
- * const user = await userRepo.create(new User({ name: 'John' }));
48
- * const retrievedUser = await userRepo.read(user.id);
49
- * user.name = 'Jane';
50
- * await userRepo.update(user);
51
- * await userRepo.delete(user.id);
52
- *
53
- * // Querying with conditions
54
- * const users = await userRepo
55
- * .select()
56
- * .where({ name: 'Jane' })
57
- * .orderBy('createdAt', OrderDirection.DSC)
58
- * .limit(10)
59
- * .execute();
60
- * @mermaid
61
- * sequenceDiagram
62
- * participant C as Client Code
63
- * participant R as Repository
64
- * participant A as Adapter
65
- * participant DB as Database
66
- * participant O as Observers
67
- *
68
- * C->>+R: create(model)
69
- * R->>R: createPrefix(model)
70
- * R->>+A: prepare(model)
71
- * A-->>-R: prepared data
72
- * R->>+A: create(table, id, record)
73
- * A->>+DB: Insert Operation
74
- * DB-->>-A: Result
75
- * A-->>-R: record
76
- * R->>+A: revert(record)
77
- * A-->>-R: model instance
78
- * R->>R: createSuffix(model)
79
- * R->>+O: updateObservers(table, CREATE, id)
80
- * O-->>-R: Notification complete
81
- * R-->>-C: created model
82
- */
83
- export declare class Repository<M extends Model<boolean>, A extends Adapter<any, any, any, any>> extends Rep<M, ContextOf<A>> implements PersistenceObservable<ContextOf<A>>, PersistenceObserver<ContextOf<A>>, Queriable<M>, IRepository<M, ContextOf<A>> {
84
- private static _cache;
85
- protected observers: Observer[];
86
- protected observerHandler?: ObserverHandler;
87
- private readonly _adapter;
88
- private _tableName;
89
- protected _overrides: Partial<FlagsOf<ContextOf<A>>>;
90
- private logger;
91
- /**
92
- * @description Logger instance for this repository.
93
- * @summary Provides access to the logger for this repository instance.
94
- * @return {Logger} The logger instance.
95
- */
96
- get log(): Logger;
97
- /**
98
- * @description Adapter for database operations.
99
- * @summary Provides access to the adapter instance for this repository.
100
- * @template A - The adapter type.
101
- * @return {A} The adapter instance.
102
- * @throws {InternalError} If no adapter is found.
103
- */
104
- protected get adapter(): A;
105
- /**
106
- * @description Table name for this repository's model.
107
- * @summary Gets the database table name associated with this repository's model.
108
- * @return {string} The table name.
109
- */
110
- protected get tableName(): string;
111
- /**
112
- * @description Primary key properties for this repository's model.
113
- * @summary Gets the sequence options containing primary key information.
114
- * @return {SequenceOptions} The primary key properties.
115
- * @deprecated for Model.sequenceFor(class)
116
- */
117
- protected get pkProps(): SequenceOptions;
118
- get filters(): Record<"onlyOnCreate" | "onlyOnUpdate" | "onlyOnDelete" | "onlyOnTransactional" | "onlyOnSingle" | "onlyOnBulk", ObserverFilter>;
119
- constructor(adapter?: A, clazz?: Constructor<M>, force?: boolean, ...args: any[]);
120
- protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<A>, ARGS>, operation: METHOD): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
121
- protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<A>, ARGS>, operation: METHOD, allowCreate: false): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
122
- protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<A>, ARGS>, operation: METHOD, allowCreate: true): Promise<ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>>;
123
- protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<A>, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<ContextOf<A>>>): Promise<ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>>;
124
- protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<A>, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<ContextOf<A>>>): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
125
- /**
126
- * @description Creates a proxy with overridden repository flags.
127
- * @summary Returns a proxy of this repository with the specified flags overridden.
128
- * @param {Partial<F>} flags - The flags to override.
129
- * @return {Repository} A proxy of this repository with overridden flags.
130
- */
131
- override(flags: Partial<FlagsOf<ContextOf<A>>>): this;
132
- /**
133
- * @description Creates a new instance of the Repository class with a specific adapter and arguments.
134
- *
135
- * @template A - The type of the adapter.
136
- * @template Q - The type of the query builder.
137
- * @template F - The type of the filter.
138
- * @template C - The type of the context.
139
- *
140
- * @param {Partial<InferredAdapterConfig<A>>} conf - adapter configurations to override.
141
- * @param [args] - Additional arguments to be passed to the new instance.
142
- *
143
- * @return A new instance of the Repository class with the specified adapter and arguments.
144
- */
145
- for(conf: Partial<InferredAdapterConfig<A>>, ...args: any[]): this;
146
- /**
147
- * @description Creates a new observer handler.
148
- * @summary Factory method for creating an observer handler instance.
149
- * @return {ObserverHandler} A new observer handler instance.
150
- */
151
- protected ObserverHandler(): ObserverHandler;
152
- /**
153
- * @description Prepares a model for creation.
154
- * @summary Validates the model and prepares it for creation in the database.
155
- * @template M - The model type.
156
- * @param {M} model - The model to create.
157
- * @param {...any[]} args - Additional arguments.
158
- * @return The prepared model and context arguments.
159
- * @throws {ValidationError} If the model fails validation.
160
- */
161
- protected createPrefix(model: M, ...args: MaybeContextualArg<ContextOf<A>>): Promise<[M, ...any[], ContextOf<A>]>;
162
- /**
163
- * @description Creates a model in the database.
164
- * @summary Persists a model instance to the database.
165
- * @param {M} model - The model to create.
166
- * @param {...any[]} args - Additional arguments.
167
- * @return {Promise<M>} The created model with updated properties.
168
- */
169
- create(model: M, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M>;
170
- /**
171
- * @description Creates multiple models in the database.
172
- * @summary Persists multiple model instances to the database in a batch operation.
173
- * @param {M[]} models - The models to create.
174
- * @param {...any[]} args - Additional arguments.
175
- * @return {Promise<M[]>} The created models with updated properties.
176
- */
177
- createAll(models: M[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[]>;
178
- /**
179
- * @description Prepares multiple models for creation.
180
- * @summary Validates multiple models and prepares them for creation in the database.
181
- * @param {M[]} models - The models to create.
182
- * @param {...any[]} args - Additional arguments.
183
- * @return The prepared models and context arguments.
184
- * @throws {ValidationError} If any model fails validation.
185
- */
186
- protected createAllPrefix(models: M[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<[M[], ...any[], ContextOf<A>]>;
187
- /**
188
- * @description Prepares for reading a model by ID.
189
- * @summary Prepares the context and enforces decorators before reading a model.
190
- * @param {string} key - The primary key of the model to read.
191
- * @param {...any[]} args - Additional arguments.
192
- * @return The key and context arguments.
193
- */
194
- protected readPrefix(key: PrimaryKeyType, ...args: MaybeContextualArg<ContextOf<A>>): Promise<[PrimaryKeyType, ...any[], ContextOf<A>]>;
195
- /**
196
- * @description Reads a model from the database by ID.
197
- * @summary Retrieves a model instance from the database using its primary key.
198
- * @param {PrimaryKeyType} id - The primary key of the model to read.
199
- * @param {...any[]} args - Additional arguments.
200
- * @return {Promise<M>} The retrieved model instance.
201
- */
202
- read(id: PrimaryKeyType, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M>;
203
- /**
204
- * @description Prepares for reading multiple models by IDs.
205
- * @summary Prepares the context and enforces decorators before reading multiple models.
206
- * @param {string[]|number[]} keys - The primary keys of the models to read.
207
- * @param {...any[]} args - Additional arguments.
208
- * @return The keys and context arguments.
209
- */
210
- protected readAllPrefix(keys: PrimaryKeyType[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<[PrimaryKeyType[], ...any[], ContextOf<A>]>;
211
- /**
212
- * @description Reads multiple models from the database by IDs.
213
- * @summary Retrieves multiple model instances from the database using their primary keys.
214
- * @param {string[]|number[]} keys - The primary keys of the models to read.
215
- * @param {...any[]} args - Additional arguments.
216
- * @return {Promise<M[]>} The retrieved model instances.
217
- */
218
- readAll(keys: PrimaryKeyType[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[]>;
219
- /**
220
- * @description Updates a model in the database.
221
- * @summary Persists changes to an existing model instance in the database.
222
- * @param {M} model - The model to update.
223
- * @param {...any[]} args - Additional arguments.
224
- * @return {Promise<M>} The updated model with refreshed properties.
225
- */
226
- update(model: M, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M>;
227
- /**
228
- * @description Prepares a model for update.
229
- * @summary Validates the model and prepares it for update in the database.
230
- * @param {M} model - The model to update.
231
- * @param {...any[]} args - Additional arguments.
232
- * @return The prepared model and context arguments.
233
- * @throws {InternalError} If the model has no primary key value.
234
- * @throws {ValidationError} If the model fails validation.
235
- */
236
- protected updatePrefix(model: M, ...args: MaybeContextualArg<ContextOf<A>>): Promise<[M, ...args: any[], ContextOf<A>, M | undefined]>;
237
- /**
238
- * @description Updates multiple models in the database.
239
- * @summary Persists changes to multiple existing model instances in the database in a batch operation.
240
- * @param {M[]} models - The models to update.
241
- * @param {...any[]} args - Additional arguments.
242
- * @return {Promise<M[]>} The updated models with refreshed properties.
243
- */
244
- updateAll(models: M[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[]>;
245
- /**
246
- * @description Prepares multiple models for update.
247
- * @summary Validates multiple models and prepares them for update in the database.
248
- * @param {M[]} models - The models to update.
249
- * @param {...any[]} args - Additional arguments.
250
- * @return {Promise<any[]>} The prepared models and context arguments.
251
- * @throws {InternalError} If any model has no primary key value.
252
- * @throws {ValidationError} If any model fails validation.
253
- */
254
- protected updateAllPrefix(models: M[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<[M[], ...args: any[], ContextOf<A>, M[] | undefined]>;
255
- /**
256
- * @description Prepares for deleting a model by ID.
257
- * @summary Prepares the context and enforces decorators before deleting a model.
258
- * @param {any} key - The primary key of the model to delete.
259
- * @param {...any[]} args - Additional arguments.
260
- * @return The key and context arguments.
261
- */
262
- protected deletePrefix(key: PrimaryKeyType, ...args: MaybeContextualArg<ContextOf<A>>): Promise<[PrimaryKeyType, ...any[], ContextOf<A>]>;
263
- /**
264
- * @description Deletes a model from the database by ID.
265
- * @summary Removes a model instance from the database using its primary key.
266
- * @param {string|number|bigint} id - The primary key of the model to delete.
267
- * @param {...any[]} args - Additional arguments.
268
- * @return {Promise<M>} The deleted model instance.
269
- */
270
- delete(id: PrimaryKeyType, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M>;
271
- /**
272
- * @description Prepares for deleting multiple models by IDs.
273
- * @summary Prepares the context and enforces decorators before deleting multiple models.
274
- * @param {string[]|number[]} keys - The primary keys of the models to delete.
275
- * @param {...any[]} args - Additional arguments.
276
- * @return The keys and context arguments.
277
- */
278
- protected deleteAllPrefix(keys: PrimaryKeyType[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<[PrimaryKeyType[], ...any[], ContextOf<A>]>;
279
- /**
280
- * @description Deletes multiple models from the database by IDs.
281
- * @summary Removes multiple model instances from the database using their primary keys.
282
- * @param {string[]|number[]} keys - The primary keys of the models to delete.
283
- * @param {...any[]} args - Additional arguments.
284
- * @return {Promise<M[]>} The deleted model instances.
285
- */
286
- deleteAll(keys: PrimaryKeyType[], ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[]>;
287
- /**
288
- * @description Creates a select query without specifying fields.
289
- * @summary Starts building a query that will return all fields of the model.
290
- * @template S - The array type of select selectors.
291
- * @return A query builder for the model.
292
- */
293
- select<S extends readonly SelectSelector<M>[]>(): WhereOption<M, M[]>;
294
- /**
295
- * @description Creates a select query with specific fields.
296
- * @summary Starts building a query that will return only the specified fields of the model.
297
- * @template S - The array type of select selectors.
298
- * @param selector - The fields to select.
299
- * @return A query builder for the selected fields.
300
- */
301
- select<S extends readonly SelectSelector<M>[]>(selector: readonly [...S]): WhereOption<M, Pick<M, S[number]>[]>;
302
- /**
303
- * @description Creates a count query
304
- * @summary Starts building a query that will count records
305
- * @template S - The select selector type
306
- * @param {S} [selector] - Optional field to count (counts all if not specified)
307
- * @return A count query builder with distinct() available
308
- */
309
- count<S extends SelectSelector<M>>(selector?: S): CountWhereOption<M>;
310
- /**
311
- * @description Creates a min query
312
- * @summary Starts building a query that will find the minimum value
313
- * @template S - The select selector type
314
- * @param {S} selector - Field to find minimum value of
315
- * @return A min query builder
316
- */
317
- min<S extends SelectSelector<M>>(selector: S): WhereOption<M, M[S]>;
318
- /**
319
- * @description Creates a max query
320
- * @summary Starts building a query that will find the maximum value
321
- * @template S - The select selector type
322
- * @param {S} selector - Field to find maximum value of
323
- * @return A max query builder
324
- */
325
- max<S extends SelectSelector<M>>(selector: S): WhereOption<M, M[S]>;
326
- /**
327
- * @description Creates a sum query
328
- * @summary Starts building a query that will sum values
329
- * @template S - The select selector type
330
- * @param {S} selector - Field to sum
331
- * @return A sum query builder
332
- */
333
- sum<S extends SelectSelector<M>>(selector: S): WhereOption<M, number>;
334
- /**
335
- * @description Creates an average query
336
- * @summary Starts building a query that will compute the average value
337
- * @template S - The select selector type
338
- * @param {S} selector - Field to average
339
- * @return An average query builder
340
- */
341
- avg<S extends SelectSelector<M>>(selector: S): WhereOption<M, number>;
342
- /**
343
- * @description Creates a distinct query
344
- * @summary Starts building a query that will find distinct values
345
- * @template S - The select selector type
346
- * @param {S} selector - Field to find distinct values of
347
- * @return A distinct query builder
348
- */
349
- distinct<S extends SelectSelector<M>>(selector: S): WhereOption<M, M[S][]>;
350
- /**
351
- * @description Executes a query with the specified conditions and options.
352
- * @summary Provides a simplified way to query the database with common query parameters.
353
- * @param {Condition<M>} condition - The condition to filter records.
354
- * @param orderBy - The field to order results by.
355
- * @param {OrderDirection} [order=OrderDirection.ASC] - The sort direction.
356
- * @param {number} [limit] - Optional maximum number of results to return.
357
- * @param {number} [skip] - Optional number of results to skip.
358
- * @return {Promise<M[]>} The query results as model instances.
359
- */
360
- query(condition: Condition<M>, orderBy: keyof M, order?: OrderDirection, limit?: number, skip?: number, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[]>;
361
- listBy(key: keyof M, order: OrderDirection, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[]>;
362
- paginateBy(key: keyof M, order: OrderDirection, ref?: Omit<DirectionLimitOffset, "direction">, ...args: MaybeContextualArg<ContextOf<A>>): Promise<SerializedPage<M>>;
363
- find(value: string, order?: OrderDirection, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[]>;
364
- page(value: string, direction?: OrderDirection, ref?: Omit<DirectionLimitOffset, "direction">, ...args: MaybeContextualArg<ContextOf<A>>): Promise<SerializedPage<M>>;
365
- findOneBy(key: keyof M, value: any, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M>;
366
- findBy(key: keyof M, value: any, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[]>;
367
- findByPaginate(key: keyof M, value: any, ref?: DirectionLimitOffset, ...args: MaybeContextualArg<ContextOf<A>>): Promise<SerializedPage<M>>;
368
- /**
369
- * @description Counts records, optionally filtered by a key value
370
- * @summary Returns the count of records matching the optional key condition
371
- * @param {string} key - The field to count (optional, counts all if not specified)
372
- * @param {...any[]} args - Additional arguments including context
373
- * @return {Promise<number>} The count of matching records
374
- */
375
- countOf(key?: keyof M, ...args: MaybeContextualArg<ContextOf<A>>): Promise<number>;
376
- /**
377
- * @description Finds the maximum value of a field
378
- * @summary Returns the maximum value for the specified field across all records
379
- * @param {string} key - The field to find the maximum value of
380
- * @param {...any[]} args - Additional arguments including context
381
- * @return {Promise<any>} The maximum value
382
- */
383
- maxOf<K extends keyof M>(key: K, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[K]>;
384
- /**
385
- * @description Finds the minimum value of a field
386
- * @summary Returns the minimum value for the specified field across all records
387
- * @param {string} key - The field to find the minimum value of
388
- * @param {...any[]} args - Additional arguments including context
389
- * @return {Promise<any>} The minimum value
390
- */
391
- minOf<K extends keyof M>(key: K, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[K]>;
392
- /**
393
- * @description Calculates the average value of a field
394
- * @summary Returns the average value for the specified numeric field across all records
395
- * @param {string} key - The field to calculate the average of
396
- * @param {...any[]} args - Additional arguments including context
397
- * @return {Promise<number>} The average value
398
- */
399
- avgOf<K extends keyof M>(key: K, ...args: MaybeContextualArg<ContextOf<A>>): Promise<number>;
400
- /**
401
- * @description Calculates the sum of a field
402
- * @summary Returns the sum of values for the specified numeric field across all records
403
- * @param {string} key - The field to sum
404
- * @param {...any[]} args - Additional arguments including context
405
- * @return {Promise<number>} The sum
406
- */
407
- sumOf<K extends keyof M>(key: K, ...args: MaybeContextualArg<ContextOf<A>>): Promise<number>;
408
- /**
409
- * @description Finds distinct values of a field
410
- * @summary Returns an array of unique values for the specified field
411
- * @param {string} key - The field to get distinct values of
412
- * @param {...any[]} args - Additional arguments including context
413
- * @return {Promise<any[]>} An array of distinct values
414
- */
415
- distinctOf<K extends keyof M>(key: K, ...args: MaybeContextualArg<ContextOf<A>>): Promise<M[K][]>;
416
- /**
417
- * @description Groups records by a field
418
- * @summary Returns records grouped by the specified field
419
- * @param {string} key - The field to group by
420
- * @param {...any[]} args - Additional arguments including context
421
- * @return {Promise<Record<string, M[]>>} Records grouped by the field value
422
- */
423
- groupOf<K extends keyof M>(key: K, ...args: MaybeContextualArg<ContextOf<A>>): Promise<Record<string, M[]>>;
424
- statement(name: string, ...args: MaybeContextualArg<ContextOf<A>>): Promise<any>;
425
- private getDefaultQueryAttributes;
426
- private buildDefaultStartsWithCondition;
427
- attr(prop: keyof M): import("../query/options").AttributeOption<M>;
428
- /**
429
- * @description Registers an observer for this repository.
430
- * @summary Adds an observer that will be notified of changes to models in this repository.
431
- * @param {Observer} observer - The observer to register.
432
- * @param {ObserverFilter} [filter] - Optional filter to limit which events the observer receives.
433
- * @return {void}
434
- * @see {Observable#observe}
435
- */
436
- observe(observer: Observer, filter?: ObserverFilter): () => void;
437
- /**
438
- * @description Unregisters an observer from this repository.
439
- * @summary Removes an observer so it will no longer receive notifications of changes.
440
- * @param {Observer} observer - The observer to unregister.
441
- * @return {void}
442
- * @throws {InternalError} If the observer handler is not initialized.
443
- * @see {Observable#unObserve}
444
- */
445
- unObserve(observer: Observer): void;
446
- /**
447
- * @description Notifies all observers of an event.
448
- * @summary Updates all registered observers with information about a database event.
449
- * @param {string} table - The table name where the event occurred.
450
- * @param {OperationKeys|BulkCrudOperationKeys|string} event - The type of event that occurred.
451
- * @param {EventIds} id - The ID or IDs of the affected records.
452
- * @param {...any[]} args - Additional arguments.
453
- * @return {Promise<void>} A promise that resolves when all observers have been notified.
454
- * @throws {InternalError} If the observer handler is not initialized.
455
- */
456
- updateObservers(table: Constructor<M> | string, event: AllOperationKeys, id: EventIds, ...args: ContextualArgs<ContextOf<A>>): Promise<void>;
457
- /**
458
- * @description Alias for updateObservers.
459
- * @summary Notifies all observers of an event (alias for updateObservers).
460
- * @param {string} table - The table name where the event occurred.
461
- * @param {OperationKeys|BulkCrudOperationKeys|string} event - The type of event that occurred.
462
- * @param {EventIds} id - The ID or IDs of the affected records.
463
- * @param {...any[]} args - Additional arguments.
464
- * @return {Promise<void>} A promise that resolves when all observers have been notified.
465
- */
466
- refresh(table: Constructor<M> | string, event: AllOperationKeys, id: EventIds, ...args: ContextualArgs<ContextOf<A>>): Promise<void>;
467
- /**
468
- * @description Creates or retrieves a repository for a model.
469
- * @summary Factory method that returns a repository instance for the specified model.
470
- * @template M - The model type that extends Model.
471
- * @template R - The repository type that extends Repo<M>.
472
- * @param {Constructor<M>} model - The model constructor.
473
- * @param {string} [alias] - Optional default adapter flavour if not specified on the model.
474
- * @param {...any[]} [args] - Additional arguments to pass to the repository constructor.
475
- * @return {R} A repository instance for the model.
476
- * @throws {InternalError} If no adapter is registered for the flavour.
477
- */
478
- static forModel<M extends Model, R extends Repo<M>>(model: Constructor<M>, alias?: string, ...args: any[]): R;
479
- /**
480
- * @description Retrieves a repository for a model from the cache.
481
- * @summary Gets a repository constructor or instance for the specified model from the internal cache.
482
- * @template M - The model type that extends Model.
483
- * @param {Constructor<M>} model - The model constructor.
484
- * @param {string} [alias] - The adapter alias.
485
- * @return {Constructor<Repo<M>> | Repo<M>} The repository constructor or instance.
486
- * @throws {InternalError} If no repository is registered for the model.
487
- */
488
- private static get;
489
- /**
490
- * @description Registers a repository for a model.
491
- * @summary Associates a repository constructor or instance with a model in the internal cache.
492
- * @template M - The model type that extends Model.
493
- * @param {Constructor<M>} model - The model constructor.
494
- * @param {Constructor<Repo<M>> | Repo<M>} repo - The repository constructor or instance.
495
- * @param {string} [alias] the adapter alias/flavour.
496
- * @throws {InternalError} If a repository is already registered for the model.
497
- */
498
- static register<M extends Model>(model: Constructor<M>, repo: Constructor<Repo<M>> | Repo<M>, alias?: string, force?: boolean): void;
499
- static statements<R extends Repository<any, any>, K extends keyof R>(repo: Constructor<R> | R, method?: K): undefined | (K extends keyof R ? boolean : (keyof R)[]);
500
- static queries<R extends Repository<any, any>, K extends keyof R>(repo: Constructor<R> | R, method?: K): undefined | (K extends keyof R ? QueryOptions : Record<keyof R, QueryOptions>);
501
- }
@@ -1,45 +0,0 @@
1
- import { type Constructor } from "@decaf-ts/decoration";
2
- import { Model, type ModelConstructor } from "@decaf-ts/decorator-validation";
3
- import { type Repo } from "../repository/Repository";
4
- import { Service } from "./services";
5
- import type { AllOperationKeys, ContextOf, EventIds, ObserverFilter, PersistenceObservable, PersistenceObserver } from "../persistence/types";
6
- import { type IRepository, type PrimaryKeyType } from "@decaf-ts/db-decorators";
7
- import type { ContextualArgs, ContextualizedArgs, MaybeContextualArg, MethodOrOperation } from "../utils/ContextualLoggedClass";
8
- import { OrderDirection } from "../repository/constants";
9
- import { type DirectionLimitOffset } from "../query/types";
10
- import { type Observer } from "../interfaces";
11
- import { SelectSelector, WhereOption } from "../query/index";
12
- export type ArrayMode = "one" | "many";
13
- export declare class ModelService<M extends Model<boolean>, R extends Repo<M> = Repo<M>> extends Service implements IRepository<M, ContextOf<R>>, PersistenceObservable<ContextOf<R>>, PersistenceObserver<ContextOf<R>> {
14
- private readonly clazz;
15
- protected _repository: R;
16
- get class(): Constructor<M>;
17
- get repo(): R;
18
- constructor(clazz: Constructor<M>, name?: string);
19
- static getService<M extends Model<boolean>, S extends ModelService<M>>(name: string | symbol | Constructor<M>): S;
20
- create(model: M, ...args: MaybeContextualArg<ContextOf<R>>): Promise<M>;
21
- createAll(models: M[], ...args: MaybeContextualArg<ContextOf<R>>): Promise<M[]>;
22
- delete(key: PrimaryKeyType, ...args: MaybeContextualArg<ContextOf<R>>): Promise<M>;
23
- deleteAll(keys: PrimaryKeyType[], ...args: MaybeContextualArg<ContextOf<R>>): Promise<M[]>;
24
- read(key: PrimaryKeyType, ...args: MaybeContextualArg<ContextOf<R>>): Promise<M>;
25
- readAll(keys: PrimaryKeyType[], ...args: MaybeContextualArg<ContextOf<R>>): Promise<M[]>;
26
- query<M, R extends ArrayMode = "one">(methodName: string, ...args: unknown[]): Promise<R extends "one" ? M : M[]>;
27
- update(model: M, ...args: MaybeContextualArg<ContextOf<R>>): Promise<M>;
28
- updateAll(models: M[], ...args: any[]): Promise<M[]>;
29
- select<S extends readonly SelectSelector<M>[]>(): WhereOption<M, M[]>;
30
- select<S extends readonly SelectSelector<M>[]>(selector: readonly [...S]): WhereOption<M, Pick<M, S[number]>[]>;
31
- listBy(key: keyof M, order: OrderDirection, ...args: MaybeContextualArg<ContextOf<R>>): Promise<M[]>;
32
- paginateBy(key: keyof M, order: OrderDirection, ref: Omit<DirectionLimitOffset, "direction">, ...args: MaybeContextualArg<ContextOf<R>>): Promise<import("../query/Paginator").SerializedPage<M>>;
33
- findOneBy(key: keyof M, value: any, ...args: MaybeContextualArg<ContextOf<R>>): Promise<M>;
34
- findBy(key: keyof M, value: any, ...args: MaybeContextualArg<ContextOf<R>>): Promise<M[]>;
35
- findByPaginate(key: keyof M, value: any, ref: DirectionLimitOffset, ...args: MaybeContextualArg<ContextOf<R>>): Promise<import("../query/Paginator").SerializedPage<M>>;
36
- statement(name: string, ...args: MaybeContextualArg<ContextOf<R>>): Promise<any>;
37
- static forModel<M extends Model<boolean>, S extends ModelService<M>>(this: new (model: ModelConstructor<M>) => S, model: ModelConstructor<M>, alias?: string | symbol): S;
38
- refresh(table: Constructor<M>, event: AllOperationKeys, id: EventIds, ...args: ContextualArgs<ContextOf<R>>): Promise<void>;
39
- observe(observer: Observer, filter?: ObserverFilter): () => void;
40
- unObserve(observer: Observer): void;
41
- updateObservers(model: Constructor, operation: AllOperationKeys, ids: EventIds, ...args: ContextualArgs<ContextOf<R>>): Promise<void>;
42
- protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<this["repo"]>, ARGS>, operation: METHOD): ContextualizedArgs<ContextOf<this["repo"]>, ARGS, METHOD extends string ? true : false>;
43
- protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<this["repo"]>, ARGS>, operation: METHOD, allowCreate: false): ContextualizedArgs<ContextOf<this["repo"]>, ARGS, METHOD extends string ? true : false>;
44
- protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<ContextOf<this["repo"]>, ARGS>, operation: METHOD, allowCreate: true): Promise<ContextualizedArgs<ContextOf<this["repo"]>, ARGS, METHOD extends string ? true : false>>;
45
- }
@@ -1,70 +0,0 @@
1
- import { promises as defaultFs } from "node:fs";
2
- import { Constructor } from "@decaf-ts/decoration";
3
- import { Model } from "@decaf-ts/decorator-validation";
4
- import { PrimaryKeyType } from "@decaf-ts/db-decorators";
5
- import { Dispatch } from "../persistence/Dispatch";
6
- import { ContextualArgs, MaybeContextualArg } from "../utils/ContextualLoggedClass";
7
- import { RamAdapter } from "../ram";
8
- import type { RamContext, RawRamQuery } from "../ram/types";
9
- import type { FilesystemConfig } from "./types";
10
- export declare class FilesystemAdapter extends RamAdapter {
11
- private readonly rootDir;
12
- private readonly dbPath;
13
- private readonly fs;
14
- private readonly jsonSpacing?;
15
- private readonly onHydrated?;
16
- private readonly indexStore;
17
- private readonly pkColumnCache;
18
- private readonly indexDescriptorCache;
19
- private readonly tableWatchers;
20
- private rootWatcher?;
21
- private watching;
22
- private ready;
23
- private readonly watchDebounceMs;
24
- private readonly watchEnabled;
25
- private readonly pendingObserverRefresh;
26
- constructor(conf?: FilesystemConfig, alias?: string);
27
- initialize(...args: MaybeContextualArg<any>): Promise<void>;
28
- getFs(): typeof defaultFs;
29
- getStoragePath(): string;
30
- getTablePath(tableName: string): string;
31
- getIndexesPath(tableName: string): string;
32
- protected Dispatch(): Dispatch<FilesystemAdapter>;
33
- private initializeFromDisk;
34
- ensureWatching(): Promise<void>;
35
- stopWatching(): void;
36
- private ensureReady;
37
- private startRootWatcher;
38
- private handleRootEvent;
39
- private normalizeFilename;
40
- private scheduleObserverRefresh;
41
- private flushObserverRefresh;
42
- private clearPendingObserverRefresh;
43
- private watchTable;
44
- private unwatchTable;
45
- private handleTableEvent;
46
- private removeRecordFromMap;
47
- private applyRecord;
48
- private hydrateTable;
49
- private directoryExists;
50
- private tablePath;
51
- private recordPath;
52
- private indexesPath;
53
- private writeRecord;
54
- private removeRecord;
55
- private syncIndexesForWrite;
56
- private removeIndexesForRecord;
57
- private getIndexDescriptors;
58
- private collectIndexMetadata;
59
- private asIndexMetadata;
60
- private buildColumns;
61
- private columnNameOrFallback;
62
- private getPkColumn;
63
- private buildIndexSource;
64
- create<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, ...args: ContextualArgs<RamContext>): Promise<Record<string, any>>;
65
- read<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, ...args: ContextualArgs<RamContext>): Promise<Record<string, any>>;
66
- update<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, ...args: ContextualArgs<RamContext>): Promise<Record<string, any>>;
67
- delete<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, ...args: ContextualArgs<RamContext>): Promise<Record<string, any>>;
68
- raw<R, D extends boolean>(rawInput: RawRamQuery<any>, docsOnly?: D, ...args: ContextualArgs<RamContext>): Promise<import("..").RawResult<R, D>>;
69
- static decoration(): void;
70
- }