lakutata 2.0.80 → 2.0.81

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 (394) hide show
  1. package/com/cacher.cjs +8 -10
  2. package/com/cacher.d.ts +83 -14
  3. package/com/cacher.mjs +8 -10
  4. package/com/database.cjs +11 -11
  5. package/com/database.mjs +11 -11
  6. package/com/docker.cjs +17 -19
  7. package/com/docker.d.ts +3 -141
  8. package/com/docker.mjs +13 -15
  9. package/com/entrypoint.cjs +7 -5
  10. package/com/entrypoint.mjs +7 -5
  11. package/com/logger.cjs +7 -7
  12. package/com/logger.mjs +7 -7
  13. package/com/monitor.cjs +5 -3
  14. package/com/monitor.mjs +5 -3
  15. package/decorator/ctrl.cjs +3 -3
  16. package/decorator/ctrl.mjs +3 -3
  17. package/decorator/orm.cjs +98 -98
  18. package/decorator/orm.mjs +142 -56
  19. package/helper.cjs +9 -11
  20. package/helper.mjs +5 -7
  21. package/lakutata.cjs +23 -30
  22. package/lakutata.mjs +14 -18
  23. package/orm.cjs +1423 -886
  24. package/orm.mjs +1474 -724
  25. package/package.json +1 -1
  26. package/provider/database.cjs +11 -11
  27. package/provider/database.mjs +11 -11
  28. package/provider/passwordHash.cjs +4 -2
  29. package/provider/passwordHash.mjs +4 -2
  30. package/src/components/Database.cjs +11 -11
  31. package/src/components/Database.mjs +11 -11
  32. package/src/components/Logger.cjs +7 -7
  33. package/src/components/Logger.mjs +7 -7
  34. package/src/components/cacher/Cacher.cjs +1178 -264
  35. package/src/components/cacher/Cacher.mjs +1087 -173
  36. package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +479 -2963
  37. package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +469 -2947
  38. package/src/components/docker/ConnectionOptionsBuilder.cjs +15 -17
  39. package/src/components/docker/ConnectionOptionsBuilder.mjs +13 -15
  40. package/src/components/docker/Docker.cjs +4884 -4945
  41. package/src/components/docker/Docker.mjs +4902 -4963
  42. package/src/components/docker/lib/DockerContainer.cjs +23 -25
  43. package/src/components/docker/lib/DockerContainer.mjs +17 -19
  44. package/src/components/docker/lib/DockerContainerTTY.cjs +9 -11
  45. package/src/components/docker/lib/DockerContainerTTY.mjs +9 -11
  46. package/src/components/docker/lib/DockerImage.cjs +4 -2
  47. package/src/components/docker/lib/DockerImage.mjs +4 -2
  48. package/src/components/entrypoint/Entrypoint.cjs +2170 -1678
  49. package/src/components/entrypoint/Entrypoint.mjs +2126 -1634
  50. package/src/components/entrypoint/lib/AccessControl.cjs +4 -2
  51. package/src/components/entrypoint/lib/AccessControl.mjs +4 -2
  52. package/src/components/entrypoint/lib/AccessControlRule.cjs +4 -2
  53. package/src/components/entrypoint/lib/AccessControlRule.mjs +4 -2
  54. package/src/components/entrypoint/lib/Controller.cjs +4 -2
  55. package/src/components/entrypoint/lib/Controller.mjs +4 -2
  56. package/src/components/monitor/AliveMonitor.cjs +4 -2
  57. package/src/components/monitor/AliveMonitor.mjs +4 -2
  58. package/src/components/monitor/CpuMonitor.cjs +5 -3
  59. package/src/components/monitor/CpuMonitor.mjs +5 -3
  60. package/src/components/monitor/EventLoopMonitor.cjs +4 -2
  61. package/src/components/monitor/EventLoopMonitor.mjs +4 -2
  62. package/src/components/monitor/HttpRequestMonitor.cjs +5 -3
  63. package/src/components/monitor/HttpRequestMonitor.mjs +5 -3
  64. package/src/components/monitor/MemoryMonitor.cjs +5 -3
  65. package/src/components/monitor/MemoryMonitor.mjs +5 -3
  66. package/src/decorators/ctrl/CLIAction.cjs +3 -3
  67. package/src/decorators/ctrl/CLIAction.mjs +3 -3
  68. package/src/decorators/ctrl/HTTPAction.cjs +3 -3
  69. package/src/decorators/ctrl/HTTPAction.mjs +3 -3
  70. package/src/decorators/ctrl/ServiceAction.cjs +3 -3
  71. package/src/decorators/ctrl/ServiceAction.mjs +3 -3
  72. package/src/decorators/ctrl/http/DELETE.cjs +3 -3
  73. package/src/decorators/ctrl/http/DELETE.mjs +3 -3
  74. package/src/decorators/ctrl/http/GET.cjs +3 -3
  75. package/src/decorators/ctrl/http/GET.mjs +3 -3
  76. package/src/decorators/ctrl/http/HEAD.cjs +3 -3
  77. package/src/decorators/ctrl/http/HEAD.mjs +3 -3
  78. package/src/decorators/ctrl/http/OPTIONS.cjs +3 -3
  79. package/src/decorators/ctrl/http/OPTIONS.mjs +3 -3
  80. package/src/decorators/ctrl/http/PATCH.cjs +3 -3
  81. package/src/decorators/ctrl/http/PATCH.mjs +3 -3
  82. package/src/decorators/ctrl/http/POST.cjs +3 -3
  83. package/src/decorators/ctrl/http/POST.mjs +3 -3
  84. package/src/decorators/ctrl/http/PUT.cjs +3 -3
  85. package/src/decorators/ctrl/http/PUT.mjs +3 -3
  86. package/src/decorators/orm/AfterInsert.cjs +17 -39
  87. package/src/decorators/orm/AfterInsert.mjs +18 -38
  88. package/src/decorators/orm/AfterLoad.cjs +17 -39
  89. package/src/decorators/orm/AfterLoad.mjs +18 -38
  90. package/src/decorators/orm/AfterRecover.cjs +17 -39
  91. package/src/decorators/orm/AfterRecover.mjs +18 -38
  92. package/src/decorators/orm/AfterRemove.cjs +17 -39
  93. package/src/decorators/orm/AfterRemove.mjs +18 -38
  94. package/src/decorators/orm/AfterSoftRemove.cjs +17 -39
  95. package/src/decorators/orm/AfterSoftRemove.mjs +18 -38
  96. package/src/decorators/orm/AfterUpdate.cjs +17 -39
  97. package/src/decorators/orm/AfterUpdate.mjs +18 -38
  98. package/src/decorators/orm/BeforeInsert.cjs +17 -39
  99. package/src/decorators/orm/BeforeInsert.mjs +18 -38
  100. package/src/decorators/orm/BeforeRecover.cjs +17 -39
  101. package/src/decorators/orm/BeforeRecover.mjs +18 -38
  102. package/src/decorators/orm/BeforeRemove.cjs +17 -39
  103. package/src/decorators/orm/BeforeRemove.mjs +18 -38
  104. package/src/decorators/orm/BeforeSoftRemove.cjs +17 -39
  105. package/src/decorators/orm/BeforeSoftRemove.mjs +18 -38
  106. package/src/decorators/orm/BeforeUpdate.cjs +17 -39
  107. package/src/decorators/orm/BeforeUpdate.mjs +18 -38
  108. package/src/decorators/orm/Check.cjs +17 -42
  109. package/src/decorators/orm/Check.mjs +18 -41
  110. package/src/decorators/orm/ChildEntity.cjs +17 -42
  111. package/src/decorators/orm/ChildEntity.mjs +18 -41
  112. package/src/decorators/orm/Column.cjs +17 -74
  113. package/src/decorators/orm/Column.mjs +19 -74
  114. package/src/decorators/orm/CreateDateColumn.cjs +17 -38
  115. package/src/decorators/orm/CreateDateColumn.mjs +18 -37
  116. package/src/decorators/orm/DeleteDateColumn.cjs +17 -38
  117. package/src/decorators/orm/DeleteDateColumn.mjs +17 -36
  118. package/src/decorators/orm/Entity.cjs +17 -48
  119. package/src/decorators/orm/Entity.mjs +17 -46
  120. package/src/decorators/orm/EventSubscriber.cjs +17 -35
  121. package/src/decorators/orm/EventSubscriber.mjs +18 -34
  122. package/src/decorators/orm/Exclusion.cjs +17 -42
  123. package/src/decorators/orm/Exclusion.mjs +18 -41
  124. package/src/decorators/orm/Generated.cjs +17 -37
  125. package/src/decorators/orm/Generated.mjs +18 -36
  126. package/src/decorators/orm/Index.cjs +17 -54
  127. package/src/decorators/orm/Index.mjs +19 -54
  128. package/src/decorators/orm/JoinColumn.cjs +17 -42
  129. package/src/decorators/orm/JoinColumn.mjs +18 -41
  130. package/src/decorators/orm/JoinTable.cjs +17 -43
  131. package/src/decorators/orm/JoinTable.mjs +17 -41
  132. package/src/decorators/orm/ManyToMany.cjs +17 -55
  133. package/src/decorators/orm/ManyToMany.mjs +17 -53
  134. package/src/decorators/orm/ManyToOne.cjs +17 -55
  135. package/src/decorators/orm/ManyToOne.mjs +17 -53
  136. package/src/decorators/orm/ObjectIdColumn.cjs +17 -41
  137. package/src/decorators/orm/ObjectIdColumn.mjs +18 -40
  138. package/src/decorators/orm/OneToMany.cjs +17 -47
  139. package/src/decorators/orm/OneToMany.mjs +19 -47
  140. package/src/decorators/orm/OneToOne.cjs +17 -55
  141. package/src/decorators/orm/OneToOne.mjs +17 -53
  142. package/src/decorators/orm/PrimaryColumn.cjs +17 -62
  143. package/src/decorators/orm/PrimaryColumn.mjs +19 -62
  144. package/src/decorators/orm/PrimaryGeneratedColumn.cjs +17 -67
  145. package/src/decorators/orm/PrimaryGeneratedColumn.mjs +19 -67
  146. package/src/decorators/orm/RelationId.cjs +17 -39
  147. package/src/decorators/orm/RelationId.mjs +18 -38
  148. package/src/decorators/orm/TableInheritance.cjs +17 -39
  149. package/src/decorators/orm/TableInheritance.mjs +18 -38
  150. package/src/decorators/orm/Tree.cjs +17 -37
  151. package/src/decorators/orm/Tree.mjs +18 -36
  152. package/src/decorators/orm/TreeChildren.cjs +17 -44
  153. package/src/decorators/orm/TreeChildren.mjs +17 -42
  154. package/src/decorators/orm/TreeLevelColumn.cjs +17 -38
  155. package/src/decorators/orm/TreeLevelColumn.mjs +17 -36
  156. package/src/decorators/orm/TreeParent.cjs +17 -44
  157. package/src/decorators/orm/TreeParent.mjs +17 -42
  158. package/src/decorators/orm/Unique.cjs +17 -57
  159. package/src/decorators/orm/Unique.mjs +19 -57
  160. package/src/decorators/orm/UpdateDateColumn.cjs +17 -38
  161. package/src/decorators/orm/UpdateDateColumn.mjs +18 -37
  162. package/src/decorators/orm/VersionColumn.cjs +17 -38
  163. package/src/decorators/orm/VersionColumn.mjs +18 -37
  164. package/src/decorators/orm/ViewColumn.cjs +17 -38
  165. package/src/decorators/orm/ViewColumn.mjs +18 -37
  166. package/src/decorators/orm/ViewEntity.cjs +17 -47
  167. package/src/decorators/orm/ViewEntity.mjs +18 -46
  168. package/src/decorators/orm/VirtualColumn.cjs +17 -55
  169. package/src/decorators/orm/VirtualColumn.mjs +17 -53
  170. package/src/lib/base/BaseObject.cjs +4 -2
  171. package/src/lib/base/BaseObject.mjs +4 -2
  172. package/src/lib/base/EventEmitter.cjs +1200 -1193
  173. package/src/lib/base/EventEmitter.mjs +1201 -1194
  174. package/src/lib/base/internal/ApplicationConfigLoader.cjs +4 -2
  175. package/src/lib/base/internal/ApplicationConfigLoader.mjs +4 -2
  176. package/src/lib/base/internal/ControllerEntrypoint.cjs +3 -3
  177. package/src/lib/base/internal/ControllerEntrypoint.mjs +3 -3
  178. package/src/lib/base/internal/DataValidator.cjs +176 -179
  179. package/src/lib/base/internal/DataValidator.mjs +177 -180
  180. package/src/lib/base/internal/ModuleConfigLoader.cjs +4 -3
  181. package/src/lib/base/internal/ModuleConfigLoader.mjs +4 -3
  182. package/src/lib/base/internal/ObjectType.cjs +4 -2
  183. package/src/lib/base/internal/ObjectType.mjs +4 -2
  184. package/src/lib/base/internal/PatternManager.cjs +740 -735
  185. package/src/lib/base/internal/PatternManager.mjs +745 -740
  186. package/src/lib/base/internal/StringifyPattern.cjs +1 -1
  187. package/src/lib/base/internal/StringifyPattern.mjs +1 -1
  188. package/src/lib/core/Application.cjs +151 -147
  189. package/src/lib/core/Application.mjs +199 -197
  190. package/src/lib/core/Component.cjs +4 -2
  191. package/src/lib/core/Component.mjs +4 -2
  192. package/src/lib/core/Container.cjs +4 -2
  193. package/src/lib/core/Container.mjs +4 -2
  194. package/src/lib/core/Module.cjs +5 -3
  195. package/src/lib/core/Module.mjs +5 -3
  196. package/src/lib/core/Provider.cjs +4 -2
  197. package/src/lib/core/Provider.mjs +4 -2
  198. package/src/lib/helpers/Glob.cjs +970 -721
  199. package/src/lib/helpers/Glob.mjs +1036 -787
  200. package/src/lib/helpers/IsHtml.cjs +7 -13
  201. package/src/lib/helpers/IsHtml.mjs +7 -13
  202. package/src/lib/helpers/IsXML.cjs +1158 -1016
  203. package/src/lib/helpers/IsXML.mjs +871 -729
  204. package/src/lib/helpers/MD5.cjs +1 -1
  205. package/src/lib/helpers/MD5.mjs +1 -1
  206. package/src/lib/helpers/NonceStr.cjs +1 -1
  207. package/src/lib/helpers/NonceStr.mjs +1 -1
  208. package/src/lib/helpers/ObjectHash.cjs +379 -372
  209. package/src/lib/helpers/ObjectHash.mjs +379 -372
  210. package/src/lib/helpers/RandomString.cjs +168 -147
  211. package/src/lib/helpers/RandomString.mjs +167 -146
  212. package/src/lib/helpers/SHA1.cjs +1 -1
  213. package/src/lib/helpers/SHA1.mjs +1 -1
  214. package/src/lib/helpers/SHA256.cjs +1 -1
  215. package/src/lib/helpers/SHA256.mjs +1 -1
  216. package/src/lib/helpers/SortArray.cjs +1 -1
  217. package/src/lib/helpers/SortArray.mjs +1 -1
  218. package/src/lib/helpers/Statistics.cjs +1 -1
  219. package/src/lib/helpers/Statistics.mjs +1 -1
  220. package/src/lib/helpers/URLBuilder.cjs +355 -355
  221. package/src/lib/helpers/URLBuilder.mjs +350 -350
  222. package/src/lib/helpers/UUID.cjs +1 -1
  223. package/src/lib/helpers/UUID.mjs +1 -1
  224. package/src/lib/ioc/DependencyInjectionContainer.cjs +32 -30
  225. package/src/lib/ioc/DependencyInjectionContainer.mjs +12 -10
  226. package/src/lib/ioc/ListModules.cjs +5174 -5249
  227. package/src/lib/ioc/ListModules.mjs +5177 -5252
  228. package/src/lib/validation/VLD.cjs +4080 -3902
  229. package/src/lib/validation/VLD.mjs +2970 -2792
  230. package/src/options/ApplicationOptions.cjs +4 -2
  231. package/src/options/ApplicationOptions.mjs +4 -2
  232. package/src/options/LoadAnonymousObjectOptions.cjs +4 -2
  233. package/src/options/LoadAnonymousObjectOptions.mjs +4 -2
  234. package/src/options/LoadNamedObjectOptions.cjs +4 -2
  235. package/src/options/LoadNamedObjectOptions.mjs +4 -2
  236. package/src/options/LoadObjectOptions.cjs +4 -2
  237. package/src/options/LoadObjectOptions.mjs +4 -2
  238. package/src/options/ModuleLoadObjectsOptions.cjs +4 -2
  239. package/src/options/ModuleLoadObjectsOptions.mjs +4 -2
  240. package/src/options/ModuleOptions.cjs +4 -4
  241. package/src/options/ModuleOptions.mjs +4 -4
  242. package/src/options/OverridableNamedObjectOptions.cjs +4 -2
  243. package/src/options/OverridableNamedObjectOptions.mjs +4 -2
  244. package/src/options/OverridableObjectOptions.cjs +4 -2
  245. package/src/options/OverridableObjectOptions.mjs +4 -2
  246. package/src/providers/Database.cjs +11 -11
  247. package/src/providers/Database.mjs +11 -11
  248. package/src/providers/PasswordHash.cjs +5 -3
  249. package/src/providers/PasswordHash.mjs +190 -188
  250. package/src/providers/migration/GenerateMigration.cjs +15 -19
  251. package/src/providers/migration/GenerateMigration.mjs +15 -19
  252. package/vendor/Package.10.cjs +2 -8
  253. package/vendor/Package.10.mjs +2 -8
  254. package/vendor/Package.11.cjs +5 -83
  255. package/vendor/Package.11.mjs +5 -77
  256. package/vendor/Package.112.cjs +48900 -0
  257. package/vendor/Package.112.mjs +48764 -0
  258. package/vendor/Package.12.cjs +4 -2
  259. package/vendor/Package.12.mjs +6 -4
  260. package/vendor/Package.13.cjs +87 -1
  261. package/vendor/Package.13.mjs +81 -1
  262. package/vendor/Package.14.cjs +1 -14057
  263. package/vendor/Package.14.mjs +1 -14031
  264. package/vendor/Package.15.cjs +1 -1
  265. package/vendor/Package.15.mjs +1 -1
  266. package/vendor/Package.16.cjs +18129 -1935
  267. package/vendor/Package.16.mjs +18115 -1839
  268. package/vendor/Package.17.cjs +1922 -47918
  269. package/vendor/Package.17.mjs +1874 -47937
  270. package/vendor/Package.18.cjs +35 -1
  271. package/vendor/Package.18.mjs +35 -1
  272. package/vendor/Package.19.cjs +37 -0
  273. package/vendor/Package.19.mjs +35 -0
  274. package/vendor/Package.2.cjs +5739 -5710
  275. package/vendor/Package.2.mjs +5733 -5704
  276. package/vendor/Package.20.cjs +37 -0
  277. package/vendor/Package.20.mjs +35 -0
  278. package/vendor/Package.21.cjs +37 -0
  279. package/vendor/Package.21.mjs +35 -0
  280. package/vendor/Package.22.cjs +37 -0
  281. package/vendor/Package.22.mjs +35 -0
  282. package/vendor/Package.23.cjs +37 -0
  283. package/vendor/Package.23.mjs +35 -0
  284. package/vendor/Package.24.cjs +37 -0
  285. package/vendor/Package.24.mjs +35 -0
  286. package/vendor/Package.25.cjs +37 -0
  287. package/vendor/Package.25.mjs +35 -0
  288. package/vendor/Package.26.cjs +37 -0
  289. package/vendor/Package.26.mjs +35 -0
  290. package/vendor/Package.27.cjs +37 -0
  291. package/vendor/Package.27.mjs +35 -0
  292. package/vendor/Package.28.cjs +37 -0
  293. package/vendor/Package.28.mjs +35 -0
  294. package/vendor/Package.29.cjs +40 -0
  295. package/vendor/Package.29.mjs +38 -0
  296. package/vendor/Package.30.cjs +41 -0
  297. package/vendor/Package.30.mjs +39 -0
  298. package/vendor/Package.31.cjs +72 -0
  299. package/vendor/Package.31.mjs +70 -0
  300. package/vendor/Package.32.cjs +37 -0
  301. package/vendor/Package.32.mjs +35 -0
  302. package/vendor/Package.33.cjs +37 -0
  303. package/vendor/Package.33.mjs +35 -0
  304. package/vendor/Package.34.cjs +46 -0
  305. package/vendor/Package.34.mjs +44 -0
  306. package/vendor/Package.35.cjs +34 -0
  307. package/vendor/Package.35.mjs +32 -0
  308. package/vendor/Package.36.cjs +40 -0
  309. package/vendor/Package.36.mjs +38 -0
  310. package/vendor/Package.37.cjs +36 -0
  311. package/vendor/Package.37.mjs +34 -0
  312. package/vendor/Package.38.cjs +52 -0
  313. package/vendor/Package.38.mjs +50 -0
  314. package/vendor/Package.39.cjs +41 -0
  315. package/vendor/Package.39.mjs +39 -0
  316. package/vendor/Package.4.cjs +884 -874
  317. package/vendor/Package.4.mjs +884 -874
  318. package/vendor/Package.40.cjs +42 -0
  319. package/vendor/Package.40.mjs +40 -0
  320. package/vendor/Package.41.cjs +53 -0
  321. package/vendor/Package.41.mjs +51 -0
  322. package/vendor/Package.42.cjs +53 -0
  323. package/vendor/Package.42.mjs +51 -0
  324. package/vendor/Package.43.cjs +40 -0
  325. package/vendor/Package.43.mjs +38 -0
  326. package/vendor/Package.44.cjs +46 -0
  327. package/vendor/Package.44.mjs +44 -0
  328. package/vendor/Package.45.cjs +53 -0
  329. package/vendor/Package.45.mjs +51 -0
  330. package/vendor/Package.46.cjs +59 -0
  331. package/vendor/Package.46.mjs +57 -0
  332. package/vendor/Package.47.cjs +65 -0
  333. package/vendor/Package.47.mjs +63 -0
  334. package/vendor/Package.48.cjs +38 -0
  335. package/vendor/Package.48.mjs +36 -0
  336. package/vendor/Package.49.cjs +38 -0
  337. package/vendor/Package.49.mjs +36 -0
  338. package/vendor/Package.5.cjs +15 -11
  339. package/vendor/Package.5.mjs +11 -7
  340. package/vendor/Package.50.cjs +36 -0
  341. package/vendor/Package.50.mjs +34 -0
  342. package/vendor/Package.51.cjs +43 -0
  343. package/vendor/Package.51.mjs +41 -0
  344. package/vendor/Package.52.cjs +37 -0
  345. package/vendor/Package.52.mjs +35 -0
  346. package/vendor/Package.53.cjs +43 -0
  347. package/vendor/Package.53.mjs +41 -0
  348. package/vendor/Package.54.cjs +55 -0
  349. package/vendor/Package.54.mjs +53 -0
  350. package/vendor/Package.55.cjs +37 -0
  351. package/vendor/Package.55.mjs +35 -0
  352. package/vendor/Package.56.cjs +37 -0
  353. package/vendor/Package.56.mjs +35 -0
  354. package/vendor/Package.57.cjs +37 -0
  355. package/vendor/Package.57.mjs +35 -0
  356. package/vendor/Package.58.cjs +45 -0
  357. package/vendor/Package.58.mjs +43 -0
  358. package/vendor/Package.59.cjs +53 -0
  359. package/vendor/Package.59.mjs +51 -0
  360. package/vendor/Package.6.cjs +520 -511
  361. package/vendor/Package.6.mjs +543 -534
  362. package/vendor/Package.60.cjs +47649 -0
  363. package/vendor/Package.60.mjs +47606 -0
  364. package/vendor/Package.610.cjs +11 -11
  365. package/vendor/Package.610.mjs +11 -11
  366. package/vendor/Package.611.cjs +33 -23
  367. package/vendor/Package.611.mjs +19 -9
  368. package/vendor/Package.612.cjs +42 -36
  369. package/vendor/Package.612.mjs +35 -29
  370. package/vendor/Package.613.cjs +5 -4
  371. package/vendor/Package.613.mjs +5 -4
  372. package/vendor/Package.62.cjs +92 -89
  373. package/vendor/Package.62.mjs +185 -182
  374. package/vendor/Package.63.cjs +509 -166
  375. package/vendor/Package.63.mjs +490 -165
  376. package/vendor/Package.64.cjs +139 -511
  377. package/vendor/Package.64.mjs +139 -491
  378. package/vendor/Package.65.cjs +4135 -150
  379. package/vendor/Package.65.mjs +4143 -150
  380. package/vendor/Package.66.cjs +346 -4150
  381. package/vendor/Package.66.mjs +346 -4158
  382. package/vendor/Package.67.cjs +412 -261
  383. package/vendor/Package.67.mjs +410 -259
  384. package/vendor/Package.68.cjs +397 -405
  385. package/vendor/Package.68.mjs +227 -242
  386. package/vendor/Package.8.cjs +0 -4
  387. package/vendor/Package.8.mjs +0 -4
  388. package/vendor/Package.9.cjs +132 -118
  389. package/vendor/Package.9.mjs +138 -124
  390. package/vendor/TypeDef.internal.3.d.ts +0 -4
  391. package/vendor/Package.102.cjs +0 -48773
  392. package/vendor/Package.102.mjs +0 -48697
  393. package/vendor/Package.122.cjs +0 -3
  394. package/vendor/Package.122.mjs +0 -1
@@ -1,57 +1,59 @@
1
1
  "use strict";
2
2
 
3
- const e = require("buffer");
3
+ const t = require("buffer");
4
4
 
5
- var t = s => {
5
+ var e = (s, i = true) => {
6
6
  if (s === void 0 || s === null) {
7
7
  return "null";
8
8
  }
9
9
  if (typeof s === "string") {
10
- return JSON.stringify(s.startsWith(":") ? ":" + s : s);
10
+ return JSON.stringify(i && s.startsWith(":") ? `:${s}` : s);
11
11
  }
12
- if (e.Buffer.isBuffer(s)) {
13
- return JSON.stringify(":base64:" + s.toString("base64"));
12
+ if (t.Buffer.isBuffer(s)) {
13
+ return JSON.stringify(`:base64:${s.toString("base64")}`);
14
14
  }
15
15
  if (s?.toJSON) {
16
16
  s = s.toJSON();
17
17
  }
18
18
  if (typeof s === "object") {
19
- let e = "";
20
- const i = Array.isArray(s);
21
- e = i ? "[" : "{";
22
- let r = true;
23
- for (const o in s) {
24
- const a = typeof s[o] === "function" || !i && s[o] === void 0;
25
- if (!Object.hasOwn(s, o) || a) {
19
+ let t = "";
20
+ const r = Array.isArray(s);
21
+ t = r ? "[" : "{";
22
+ let o = true;
23
+ for (const a in s) {
24
+ const n = typeof s[a] === "function" || !r && s[a] === void 0;
25
+ if (!Object.hasOwn(s, a) || n) {
26
26
  continue;
27
27
  }
28
- if (!r) {
29
- e += ",";
28
+ if (!o) {
29
+ t += ",";
30
30
  }
31
- r = false;
32
- if (i) {
33
- e += t(s[o]);
34
- } else if (s[o] !== void 0) {
35
- e += t(o) + ":" + t(s[o]);
31
+ o = false;
32
+ if (r) {
33
+ t += e(s[a], i);
34
+ } else if (s[a] !== void 0) {
35
+ t += `${e(a, false)}:${e(s[a], i)}`;
36
36
  }
37
37
  }
38
- e += i ? "]" : "}";
39
- return e;
38
+ t += r ? "]" : "}";
39
+ return t;
40
40
  }
41
41
  return JSON.stringify(s);
42
42
  };
43
43
 
44
- var s = t => JSON.parse(t, ((t, s) => {
44
+ var s = t => e(t, true);
45
+
46
+ var i = e => JSON.parse(e, ((e, s) => {
45
47
  if (typeof s === "string") {
46
48
  if (s.startsWith(":base64:")) {
47
- return e.Buffer.from(s.slice(8), "base64");
49
+ return t.Buffer.from(s.slice(8), "base64");
48
50
  }
49
51
  return s.startsWith(":") ? s.slice(1) : s;
50
52
  }
51
53
  return s;
52
54
  }));
53
55
 
54
- var i = class {
56
+ var r = class {
55
57
  _eventListeners;
56
58
  _maxListeners;
57
59
  constructor() {
@@ -61,98 +63,98 @@ var i = class {
61
63
  maxListeners() {
62
64
  return this._maxListeners;
63
65
  }
64
- addListener(e, t) {
65
- this.on(e, t);
66
+ addListener(t, e) {
67
+ this.on(t, e);
66
68
  }
67
- on(e, t) {
68
- if (!this._eventListeners.has(e)) {
69
- this._eventListeners.set(e, []);
69
+ on(t, e) {
70
+ if (!this._eventListeners.has(t)) {
71
+ this._eventListeners.set(t, []);
70
72
  }
71
- const s = this._eventListeners.get(e);
73
+ const s = this._eventListeners.get(t);
72
74
  if (s) {
73
75
  if (s.length >= this._maxListeners) {
74
- console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${s.length + 1} ${e} listeners added. Use setMaxListeners() to increase limit.`);
76
+ console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${s.length + 1} ${t} listeners added. Use setMaxListeners() to increase limit.`);
75
77
  }
76
- s.push(t);
78
+ s.push(e);
77
79
  }
78
80
  return this;
79
81
  }
80
- removeListener(e, t) {
81
- this.off(e, t);
82
+ removeListener(t, e) {
83
+ this.off(t, e);
82
84
  }
83
- off(e, t) {
84
- const s = this._eventListeners.get(e) ?? [];
85
- const i = s.indexOf(t);
85
+ off(t, e) {
86
+ const s = this._eventListeners.get(t) ?? [];
87
+ const i = s.indexOf(e);
86
88
  if (i !== -1) {
87
89
  s.splice(i, 1);
88
90
  }
89
91
  if (s.length === 0) {
90
- this._eventListeners.delete(e);
92
+ this._eventListeners.delete(t);
91
93
  }
92
94
  }
93
- once(e, t) {
95
+ once(t, e) {
94
96
  const s = (...i) => {
95
- t(...i);
96
- this.off(e, s);
97
+ e(...i);
98
+ this.off(t, s);
97
99
  };
98
- this.on(e, s);
100
+ this.on(t, s);
99
101
  }
100
- emit(e, ...t) {
101
- const s = this._eventListeners.get(e);
102
+ emit(t, ...e) {
103
+ const s = this._eventListeners.get(t);
102
104
  if (s && s.length > 0) {
103
- for (const e of s) {
104
- e(...t);
105
+ for (const t of s) {
106
+ t(...e);
105
107
  }
106
108
  }
107
109
  }
108
- listeners(e) {
109
- return this._eventListeners.get(e) ?? [];
110
+ listeners(t) {
111
+ return this._eventListeners.get(t) ?? [];
110
112
  }
111
- removeAllListeners(e) {
112
- if (e) {
113
- this._eventListeners.delete(e);
113
+ removeAllListeners(t) {
114
+ if (t) {
115
+ this._eventListeners.delete(t);
114
116
  } else {
115
117
  this._eventListeners.clear();
116
118
  }
117
119
  }
118
- setMaxListeners(e) {
119
- this._maxListeners = e;
120
+ setMaxListeners(t) {
121
+ this._maxListeners = t;
120
122
  }
121
123
  };
122
124
 
123
- var r = i;
125
+ var o = r;
124
126
 
125
- var o = class extends r {
127
+ var a = class extends o {
126
128
  _hookHandlers;
127
129
  constructor() {
128
130
  super();
129
131
  this._hookHandlers = new Map;
130
132
  }
131
- addHandler(e, t) {
132
- const s = this._hookHandlers.get(e);
133
+ addHandler(t, e) {
134
+ const s = this._hookHandlers.get(t);
133
135
  if (s) {
134
- s.push(t);
136
+ s.push(e);
135
137
  } else {
136
- this._hookHandlers.set(e, [ t ]);
138
+ this._hookHandlers.set(t, [ e ]);
137
139
  }
138
140
  }
139
- removeHandler(e, t) {
140
- const s = this._hookHandlers.get(e);
141
+ removeHandler(t, e) {
142
+ const s = this._hookHandlers.get(t);
141
143
  if (s) {
142
- const e = s.indexOf(t);
143
- if (e !== -1) {
144
- s.splice(e, 1);
144
+ const t = s.indexOf(e);
145
+ if (t !== -1) {
146
+ s.splice(t, 1);
145
147
  }
146
148
  }
147
149
  }
148
- trigger(e, t) {
149
- const s = this._hookHandlers.get(e);
150
+ trigger(t, e) {
151
+ const s = this._hookHandlers.get(t);
150
152
  if (s) {
151
153
  for (const i of s) {
152
154
  try {
153
- i(t);
154
- } catch (t) {
155
- this.emit("error", new Error(`Error in hook handler for event "${e}": ${t.message}`));
155
+ i(e);
156
+ } catch (e) {
157
+ this.emit("error", new Error(`Error in hook handler for event "${t}": ${e.message}`));
156
158
  }
157
159
  }
158
160
  }
@@ -162,19 +164,19 @@ var o = class extends r {
162
164
  }
163
165
  };
164
166
 
165
- var a = o;
167
+ var n = a;
166
168
 
167
- var n = class extends r {
169
+ var h = class extends o {
168
170
  enabled=true;
169
171
  hits=0;
170
172
  misses=0;
171
173
  sets=0;
172
174
  deletes=0;
173
175
  errors=0;
174
- constructor(e) {
176
+ constructor(t) {
175
177
  super();
176
- if (e !== void 0) {
177
- this.enabled = e;
178
+ if (t !== void 0) {
179
+ this.enabled = t;
178
180
  }
179
181
  this.reset();
180
182
  }
@@ -198,6 +200,15 @@ var n = class extends r {
198
200
  this.deletes++;
199
201
  }
200
202
  }
203
+ hitsOrMisses(t) {
204
+ for (const e of t) {
205
+ if (e === void 0) {
206
+ this.miss();
207
+ } else {
208
+ this.hit();
209
+ }
210
+ }
211
+ }
201
212
  reset() {
202
213
  this.hits = 0;
203
214
  this.misses = 0;
@@ -207,52 +218,57 @@ var n = class extends r {
207
218
  }
208
219
  };
209
220
 
210
- var h = n;
221
+ var l = h;
211
222
 
212
- var l = (e => {
213
- e["PRE_SET"] = "preSet";
214
- e["POST_SET"] = "postSet";
215
- e["PRE_GET"] = "preGet";
216
- e["POST_GET"] = "postGet";
217
- e["PRE_GET_MANY"] = "preGetMany";
218
- e["POST_GET_MANY"] = "postGetMany";
219
- e["PRE_DELETE"] = "preDelete";
220
- e["POST_DELETE"] = "postDelete";
221
- return e;
222
- })(l || {});
223
+ var c = (t => {
224
+ t["PRE_SET"] = "preSet";
225
+ t["POST_SET"] = "postSet";
226
+ t["PRE_GET"] = "preGet";
227
+ t["POST_GET"] = "postGet";
228
+ t["PRE_GET_MANY"] = "preGetMany";
229
+ t["POST_GET_MANY"] = "postGetMany";
230
+ t["PRE_GET_RAW"] = "preGetRaw";
231
+ t["POST_GET_RAW"] = "postGetRaw";
232
+ t["PRE_GET_MANY_RAW"] = "preGetManyRaw";
233
+ t["POST_GET_MANY_RAW"] = "postGetManyRaw";
234
+ t["PRE_DELETE"] = "preDelete";
235
+ t["POST_DELETE"] = "postDelete";
236
+ return t;
237
+ })(c || {});
223
238
 
224
- var c = [ "sqlite", "postgres", "mysql", "mongo", "redis", "valkey", "etcd" ];
239
+ var f = [ "sqlite", "postgres", "mysql", "mongo", "redis", "valkey", "etcd" ];
225
240
 
226
- var f = class extends r {
241
+ var p = class extends o {
227
242
  opts;
228
243
  iterator;
229
- hooks=new a;
230
- stats=new h(false);
244
+ hooks=new n;
245
+ stats=new l(false);
231
246
  _ttl;
232
247
  _namespace;
233
248
  _store=new Map;
234
- _serialize=t;
235
- _deserialize=s;
249
+ _serialize=s;
250
+ _deserialize=i;
236
251
  _compression;
237
252
  _useKeyPrefix=true;
238
- constructor(e, i) {
253
+ _throwOnErrors=false;
254
+ constructor(t, e) {
239
255
  super();
240
- i ??= {};
241
256
  e ??= {};
257
+ t ??= {};
242
258
  this.opts = {
243
259
  namespace: "keyv",
244
- serialize: t,
245
- deserialize: s,
260
+ serialize: s,
261
+ deserialize: i,
246
262
  emitErrors: true,
247
263
  store: new Map,
248
- ...i
264
+ ...e
249
265
  };
250
- if (e && e.get) {
251
- this.opts.store = e;
266
+ if (t && t.get) {
267
+ this.opts.store = t;
252
268
  } else {
253
269
  this.opts = {
254
270
  ...this.opts,
255
- ...e
271
+ ...t
256
272
  };
257
273
  }
258
274
  this._store = this.opts.store ?? new Map;
@@ -267,7 +283,7 @@ var f = class extends r {
267
283
  throw new Error("Invalid storage adapter");
268
284
  }
269
285
  if (typeof this._store.on === "function") {
270
- this._store.on("error", (e => this.emit("error", e)));
286
+ this._store.on("error", (t => this.emit("error", t)));
271
287
  }
272
288
  this._store.namespace = this._namespace;
273
289
  if (typeof this._store[Symbol.iterator] === "function" && this._store instanceof Map) {
@@ -285,24 +301,27 @@ var f = class extends r {
285
301
  if (this.opts.useKeyPrefix !== void 0) {
286
302
  this._useKeyPrefix = this.opts.useKeyPrefix;
287
303
  }
304
+ if (this.opts.throwOnErrors !== void 0) {
305
+ this._throwOnErrors = this.opts.throwOnErrors;
306
+ }
288
307
  }
289
308
  get store() {
290
309
  return this._store;
291
310
  }
292
- set store(e) {
293
- if (this._isValidStorageAdapter(e)) {
294
- this._store = e;
295
- this.opts.store = e;
296
- if (typeof e.on === "function") {
297
- e.on("error", (e => this.emit("error", e)));
311
+ set store(t) {
312
+ if (this._isValidStorageAdapter(t)) {
313
+ this._store = t;
314
+ this.opts.store = t;
315
+ if (typeof t.on === "function") {
316
+ t.on("error", (t => this.emit("error", t)));
298
317
  }
299
318
  if (this._namespace) {
300
319
  this._store.namespace = this._namespace;
301
320
  }
302
- if (typeof e[Symbol.iterator] === "function" && e instanceof Map) {
303
- this.iterator = this.generateIterator(e);
304
- } else if ("iterator" in e && e.opts && this._checkIterableAdapter()) {
305
- this.iterator = this.generateIterator(e.iterator.bind(e));
321
+ if (typeof t[Symbol.iterator] === "function" && t instanceof Map) {
322
+ this.iterator = this.generateIterator(t);
323
+ } else if ("iterator" in t && t.opts && this._checkIterableAdapter()) {
324
+ this.iterator = this.generateIterator(t.iterator?.bind(t));
306
325
  }
307
326
  } else {
308
327
  throw new Error("Invalid storage adapter");
@@ -311,120 +330,142 @@ var f = class extends r {
311
330
  get compression() {
312
331
  return this._compression;
313
332
  }
314
- set compression(e) {
315
- this._compression = e;
333
+ set compression(t) {
334
+ this._compression = t;
316
335
  }
317
336
  get namespace() {
318
337
  return this._namespace;
319
338
  }
320
- set namespace(e) {
321
- this._namespace = e;
322
- this.opts.namespace = e;
323
- this._store.namespace = e;
339
+ set namespace(t) {
340
+ this._namespace = t;
341
+ this.opts.namespace = t;
342
+ this._store.namespace = t;
324
343
  if (this.opts.store) {
325
- this.opts.store.namespace = e;
344
+ this.opts.store.namespace = t;
326
345
  }
327
346
  }
328
347
  get ttl() {
329
348
  return this._ttl;
330
349
  }
331
- set ttl(e) {
332
- this.opts.ttl = e;
333
- this._ttl = e;
350
+ set ttl(t) {
351
+ this.opts.ttl = t;
352
+ this._ttl = t;
334
353
  }
335
354
  get serialize() {
336
355
  return this._serialize;
337
356
  }
338
- set serialize(e) {
339
- this.opts.serialize = e;
340
- this._serialize = e;
357
+ set serialize(t) {
358
+ this.opts.serialize = t;
359
+ this._serialize = t;
341
360
  }
342
361
  get deserialize() {
343
362
  return this._deserialize;
344
363
  }
345
- set deserialize(e) {
346
- this.opts.deserialize = e;
347
- this._deserialize = e;
364
+ set deserialize(t) {
365
+ this.opts.deserialize = t;
366
+ this._deserialize = t;
348
367
  }
349
368
  get useKeyPrefix() {
350
369
  return this._useKeyPrefix;
351
370
  }
352
- set useKeyPrefix(e) {
353
- this._useKeyPrefix = e;
354
- this.opts.useKeyPrefix = e;
371
+ set useKeyPrefix(t) {
372
+ this._useKeyPrefix = t;
373
+ this.opts.useKeyPrefix = t;
374
+ }
375
+ get throwOnErrors() {
376
+ return this._throwOnErrors;
377
+ }
378
+ set throwOnErrors(t) {
379
+ this._throwOnErrors = t;
380
+ this.opts.throwOnErrors = t;
355
381
  }
356
- generateIterator(e) {
357
- const t = async function*() {
358
- for await (const [t, s] of typeof e === "function" ? e(this._store.namespace) : e) {
359
- const e = await this.deserializeData(s);
360
- if (this._useKeyPrefix && this._store.namespace && !t.includes(this._store.namespace)) {
382
+ generateIterator(t) {
383
+ const e = async function*() {
384
+ for await (const [e, s] of typeof t === "function" ? t(this._store.namespace) : t) {
385
+ const t = await this.deserializeData(s);
386
+ if (this._useKeyPrefix && this._store.namespace && !e.includes(this._store.namespace)) {
361
387
  continue;
362
388
  }
363
- if (typeof e.expires === "number" && Date.now() > e.expires) {
364
- this.delete(t);
389
+ if (typeof t.expires === "number" && Date.now() > t.expires) {
390
+ this.delete(e);
365
391
  continue;
366
392
  }
367
- yield [ this._getKeyUnprefix(t), e.value ];
393
+ yield [ this._getKeyUnprefix(e), t.value ];
368
394
  }
369
395
  };
370
- return t.bind(this);
396
+ return e.bind(this);
371
397
  }
372
398
  _checkIterableAdapter() {
373
- return c.includes(this._store.opts.dialect) || c.some((e => this._store.opts.url.includes(e)));
399
+ return f.includes(this._store.opts.dialect) || f.some((t => this._store.opts.url.includes(t)));
374
400
  }
375
- _getKeyPrefix(e) {
401
+ _getKeyPrefix(t) {
376
402
  if (!this._useKeyPrefix) {
377
- return e;
403
+ return t;
378
404
  }
379
405
  if (!this._namespace) {
380
- return e;
406
+ return t;
381
407
  }
382
- return `${this._namespace}:${e}`;
408
+ return `${this._namespace}:${t}`;
383
409
  }
384
- _getKeyPrefixArray(e) {
410
+ _getKeyPrefixArray(t) {
385
411
  if (!this._useKeyPrefix) {
386
- return e;
412
+ return t;
387
413
  }
388
414
  if (!this._namespace) {
389
- return e;
415
+ return t;
390
416
  }
391
- return e.map((e => `${this._namespace}:${e}`));
417
+ return t.map((t => `${this._namespace}:${t}`));
392
418
  }
393
- _getKeyUnprefix(e) {
419
+ _getKeyUnprefix(t) {
394
420
  if (!this._useKeyPrefix) {
395
- return e;
421
+ return t;
396
422
  }
397
- return e.split(":").splice(1).join(":");
423
+ return t.split(":").splice(1).join(":");
398
424
  }
399
- _isValidStorageAdapter(e) {
400
- return e instanceof Map || typeof e.get === "function" && typeof e.set === "function" && typeof e.delete === "function" && typeof e.clear === "function";
425
+ _isValidStorageAdapter(t) {
426
+ return t instanceof Map || typeof t.get === "function" && typeof t.set === "function" && typeof t.delete === "function" && typeof t.clear === "function";
401
427
  }
402
- async get(e, t) {
428
+ async get(t, e) {
403
429
  const {store: s} = this.opts;
404
- const i = Array.isArray(e);
405
- const r = i ? this._getKeyPrefixArray(e) : this._getKeyPrefix(e);
406
- const o = e => typeof e.expires === "number" && Date.now() > e.expires;
430
+ const i = Array.isArray(t);
431
+ const r = i ? this._getKeyPrefixArray(t) : this._getKeyPrefix(t);
432
+ const o = t => typeof t.expires === "number" && Date.now() > t.expires;
407
433
  if (i) {
408
- if (t?.raw === true) {
409
- return this.getMany(e, {
434
+ if (e?.raw === true) {
435
+ return this.getMany(t, {
410
436
  raw: true
411
437
  });
412
438
  }
413
- return this.getMany(e, {
439
+ return this.getMany(t, {
414
440
  raw: false
415
441
  });
416
442
  }
417
443
  this.hooks.trigger("preGet", {
418
444
  key: r
419
445
  });
420
- const a = await s.get(r);
446
+ let a;
447
+ try {
448
+ a = await s.get(r);
449
+ } catch (t) {
450
+ if (this.throwOnErrors) {
451
+ throw t;
452
+ }
453
+ }
421
454
  const n = typeof a === "string" || this.opts.compression ? await this.deserializeData(a) : a;
422
455
  if (n === void 0 || n === null) {
456
+ this.hooks.trigger("postGet", {
457
+ key: r,
458
+ value: void 0
459
+ });
423
460
  this.stats.miss();
424
461
  return void 0;
425
462
  }
426
463
  if (o(n)) {
427
- await this.delete(e);
464
+ await this.delete(t);
465
+ this.hooks.trigger("postGet", {
466
+ key: r,
467
+ value: void 0
468
+ });
428
469
  this.stats.miss();
429
470
  return void 0;
430
471
  }
@@ -433,30 +474,30 @@ var f = class extends r {
433
474
  value: n
434
475
  });
435
476
  this.stats.hit();
436
- return t?.raw ? n : n.value;
477
+ return e?.raw ? n : n.value;
437
478
  }
438
- async getMany(e, t) {
479
+ async getMany(t, e) {
439
480
  const {store: s} = this.opts;
440
- const i = this._getKeyPrefixArray(e);
441
- const r = e => typeof e.expires === "number" && Date.now() > e.expires;
481
+ const i = this._getKeyPrefixArray(t);
482
+ const r = t => typeof t.expires === "number" && Date.now() > t.expires;
442
483
  this.hooks.trigger("preGetMany", {
443
484
  keys: i
444
485
  });
445
486
  if (s.getMany === void 0) {
446
- const e = i.map((async e => {
447
- const i = await s.get(e);
487
+ const t = i.map((async t => {
488
+ const i = await s.get(t);
448
489
  const o = typeof i === "string" || this.opts.compression ? await this.deserializeData(i) : i;
449
490
  if (o === void 0 || o === null) {
450
491
  return void 0;
451
492
  }
452
493
  if (r(o)) {
453
- await this.delete(e);
494
+ await this.delete(t);
454
495
  return void 0;
455
496
  }
456
- return t?.raw ? o : o.value;
497
+ return e?.raw ? o : o.value;
457
498
  }));
458
- const o = await Promise.allSettled(e);
459
- const a = o.map((e => e.value));
499
+ const o = await Promise.allSettled(t);
500
+ const a = o.map((t => t.value));
460
501
  this.hooks.trigger("postGetMany", a);
461
502
  if (a.length > 0) {
462
503
  this.stats.hit();
@@ -465,6 +506,7 @@ var f = class extends r {
465
506
  }
466
507
  const o = await s.getMany(i);
467
508
  const a = [];
509
+ const n = [];
468
510
  for (const s in o) {
469
511
  let i = o[s];
470
512
  if (typeof i === "string") {
@@ -475,12 +517,15 @@ var f = class extends r {
475
517
  continue;
476
518
  }
477
519
  if (r(i)) {
478
- await this.delete(e[s]);
520
+ n.push(t[s]);
479
521
  a.push(void 0);
480
522
  continue;
481
523
  }
482
- const n = t?.raw ? i : i.value;
483
- a.push(n);
524
+ const h = e?.raw ? i : i.value;
525
+ a.push(h);
526
+ }
527
+ if (n.length > 0) {
528
+ await this.deleteMany(n);
484
529
  }
485
530
  this.hooks.trigger("postGetMany", a);
486
531
  if (a.length > 0) {
@@ -488,10 +533,95 @@ var f = class extends r {
488
533
  }
489
534
  return a;
490
535
  }
491
- async set(e, t, s) {
536
+ async getRaw(t) {
537
+ const {store: e} = this.opts;
538
+ const s = this._getKeyPrefix(t);
539
+ this.hooks.trigger("preGetRaw", {
540
+ key: s
541
+ });
542
+ const i = await e.get(s);
543
+ if (i === void 0 || i === null) {
544
+ this.hooks.trigger("postGetRaw", {
545
+ key: s,
546
+ value: void 0
547
+ });
548
+ this.stats.miss();
549
+ return void 0;
550
+ }
551
+ const r = typeof i === "string" || this.opts.compression ? await this.deserializeData(i) : i;
552
+ if (r !== void 0 && r.expires !== void 0 && r.expires !== null && r.expires < Date.now()) {
553
+ this.hooks.trigger("postGetRaw", {
554
+ key: s,
555
+ value: void 0
556
+ });
557
+ this.stats.miss();
558
+ await this.delete(t);
559
+ return void 0;
560
+ }
561
+ this.stats.hit();
562
+ this.hooks.trigger("postGetRaw", {
563
+ key: s,
564
+ value: r
565
+ });
566
+ return r;
567
+ }
568
+ async getManyRaw(t) {
569
+ const {store: e} = this.opts;
570
+ const s = this._getKeyPrefixArray(t);
571
+ if (t.length === 0) {
572
+ const e = Array.from({
573
+ length: t.length
574
+ }).fill(void 0);
575
+ this.stats.misses += t.length;
576
+ this.hooks.trigger("postGetManyRaw", {
577
+ keys: s,
578
+ values: e
579
+ });
580
+ return e;
581
+ }
582
+ let i = [];
583
+ if (e.getMany === void 0) {
584
+ const t = s.map((async t => {
585
+ const s = await e.get(t);
586
+ if (s !== void 0 && s !== null) {
587
+ return this.deserializeData(s);
588
+ }
589
+ return void 0;
590
+ }));
591
+ const r = await Promise.allSettled(t);
592
+ i = r.map((t => t.value));
593
+ } else {
594
+ const t = await e.getMany(s);
595
+ for (const e of t) {
596
+ if (e !== void 0 && e !== null) {
597
+ i.push(await this.deserializeData(e));
598
+ } else {
599
+ i.push(void 0);
600
+ }
601
+ }
602
+ }
603
+ const r = [];
604
+ const o = t => typeof t.expires === "number" && Date.now() > t.expires;
605
+ for (const [t, e] of i.entries()) {
606
+ if (e !== void 0 && o(e)) {
607
+ r.push(s[t]);
608
+ i[t] = void 0;
609
+ }
610
+ }
611
+ if (r.length > 0) {
612
+ await this.deleteMany(r);
613
+ }
614
+ this.stats.hitsOrMisses(i);
615
+ this.hooks.trigger("postGetManyRaw", {
616
+ keys: s,
617
+ values: i
618
+ });
619
+ return i;
620
+ }
621
+ async set(t, e, s) {
492
622
  const i = {
493
- key: e,
494
- value: t,
623
+ key: t,
624
+ value: e,
495
625
  ttl: s
496
626
  };
497
627
  this.hooks.trigger("preSet", i);
@@ -513,13 +643,16 @@ var f = class extends r {
513
643
  const h = await this.serializeData(n);
514
644
  let l = true;
515
645
  try {
516
- const e = await o.set(r, h, i.ttl);
517
- if (typeof e === "boolean") {
518
- l = e;
646
+ const t = await o.set(r, h, i.ttl);
647
+ if (typeof t === "boolean") {
648
+ l = t;
519
649
  }
520
- } catch (e) {
650
+ } catch (t) {
521
651
  l = false;
522
- this.emit("error", e);
652
+ this.emit("error", t);
653
+ if (this._throwOnErrors) {
654
+ throw t;
655
+ }
523
656
  }
524
657
  this.hooks.trigger("postSet", {
525
658
  key: r,
@@ -529,63 +662,71 @@ var f = class extends r {
529
662
  this.stats.set();
530
663
  return l;
531
664
  }
532
- async setMany(e) {
533
- let t = [];
665
+ async setMany(t) {
666
+ let e = [];
534
667
  try {
535
- if (this._store.setMany !== void 0) {
536
- const s = await Promise.all(e.map((async ({key: e, value: t, ttl: s}) => {
668
+ if (this._store.setMany === void 0) {
669
+ const s = [];
670
+ for (const e of t) {
671
+ s.push(this.set(e.key, e.value, e.ttl));
672
+ }
673
+ const i = await Promise.all(s);
674
+ e = i;
675
+ } else {
676
+ const s = await Promise.all(t.map((async ({key: t, value: e, ttl: s}) => {
537
677
  s ??= this._ttl;
538
678
  if (s === 0) {
539
679
  s = void 0;
540
680
  }
541
681
  const i = typeof s === "number" ? Date.now() + s : void 0;
542
- if (typeof t === "symbol") {
682
+ if (typeof e === "symbol") {
543
683
  this.emit("error", "symbol cannot be serialized");
544
684
  throw new Error("symbol cannot be serialized");
545
685
  }
546
686
  const r = {
547
- value: t,
687
+ value: e,
548
688
  expires: i
549
689
  };
550
690
  const o = await this.serializeData(r);
691
+ const a = this._getKeyPrefix(t);
551
692
  return {
552
- key: e,
693
+ key: a,
553
694
  value: o,
554
695
  ttl: s
555
696
  };
556
697
  })));
557
- t = await this._store.setMany(s);
558
- }
559
- const s = [];
560
- for (const t of e) {
561
- s.push(this.set(t.key, t.value, t.ttl));
698
+ e = await this._store.setMany(s);
562
699
  }
563
- const i = await Promise.allSettled(s);
564
- t = i.map((e => e.value));
565
700
  } catch (s) {
566
701
  this.emit("error", s);
567
- t = e.map((() => false));
702
+ if (this._throwOnErrors) {
703
+ throw s;
704
+ }
705
+ e = t.map((() => false));
568
706
  }
569
- return t;
707
+ return e;
570
708
  }
571
- async delete(e) {
572
- const {store: t} = this.opts;
573
- if (Array.isArray(e)) {
574
- return this.deleteMany(e);
709
+ async delete(t) {
710
+ const {store: e} = this.opts;
711
+ if (Array.isArray(t)) {
712
+ return this.deleteMany(t);
575
713
  }
576
- const s = this._getKeyPrefix(e);
714
+ const s = this._getKeyPrefix(t);
577
715
  this.hooks.trigger("preDelete", {
578
716
  key: s
579
717
  });
580
718
  let i = true;
581
719
  try {
582
- const e = await t.delete(s);
583
- if (typeof e === "boolean") {
584
- i = e;
720
+ const t = await e.delete(s);
721
+ if (typeof t === "boolean") {
722
+ i = t;
585
723
  }
586
- } catch (e) {
724
+ } catch (t) {
587
725
  i = false;
588
- this.emit("error", e);
726
+ this.emit("error", t);
727
+ if (this._throwOnErrors) {
728
+ throw t;
729
+ }
589
730
  }
590
731
  this.hooks.trigger("postDelete", {
591
732
  key: s,
@@ -594,69 +735,79 @@ var f = class extends r {
594
735
  this.stats.delete();
595
736
  return i;
596
737
  }
597
- async deleteMany(e) {
738
+ async deleteMany(t) {
598
739
  try {
599
- const {store: t} = this.opts;
600
- const s = this._getKeyPrefixArray(e);
740
+ const {store: e} = this.opts;
741
+ const s = this._getKeyPrefixArray(t);
601
742
  this.hooks.trigger("preDelete", {
602
743
  key: s
603
744
  });
604
- if (t.deleteMany !== void 0) {
605
- return await t.deleteMany(s);
745
+ if (e.deleteMany !== void 0) {
746
+ return await e.deleteMany(s);
606
747
  }
607
- const i = s.map((async e => t.delete(e)));
608
- const r = await Promise.allSettled(i);
609
- const o = r.every((e => e.value === true));
748
+ const i = s.map((async t => e.delete(t)));
749
+ const r = await Promise.all(i);
750
+ const o = r.every(Boolean);
610
751
  this.hooks.trigger("postDelete", {
611
752
  key: s,
612
753
  value: o
613
754
  });
614
755
  return o;
615
- } catch (e) {
616
- this.emit("error", e);
756
+ } catch (t) {
757
+ this.emit("error", t);
758
+ if (this._throwOnErrors) {
759
+ throw t;
760
+ }
617
761
  return false;
618
762
  }
619
763
  }
620
764
  async clear() {
621
765
  this.emit("clear");
622
- const {store: e} = this.opts;
766
+ const {store: t} = this.opts;
623
767
  try {
624
- await e.clear();
625
- } catch (e) {
626
- this.emit("error", e);
768
+ await t.clear();
769
+ } catch (t) {
770
+ this.emit("error", t);
771
+ if (this._throwOnErrors) {
772
+ throw t;
773
+ }
627
774
  }
628
775
  }
629
- async has(e) {
630
- if (Array.isArray(e)) {
631
- return this.hasMany(e);
776
+ async has(t) {
777
+ if (Array.isArray(t)) {
778
+ return this.hasMany(t);
632
779
  }
633
- const t = this._getKeyPrefix(e);
780
+ const e = this._getKeyPrefix(t);
634
781
  const {store: s} = this.opts;
635
782
  if (s.has !== void 0 && !(s instanceof Map)) {
636
- return s.has(t);
783
+ return s.has(e);
637
784
  }
638
785
  let i;
639
786
  try {
640
- i = await s.get(t);
641
- } catch (e) {
642
- this.emit("error", e);
787
+ i = await s.get(e);
788
+ } catch (t) {
789
+ this.emit("error", t);
790
+ if (this._throwOnErrors) {
791
+ throw t;
792
+ }
793
+ return false;
643
794
  }
644
795
  if (i) {
645
- const e = await this.deserializeData(i);
646
- if (e) {
647
- if (e.expires === void 0 || e.expires === null) {
796
+ const t = await this.deserializeData(i);
797
+ if (t) {
798
+ if (t.expires === void 0 || t.expires === null) {
648
799
  return true;
649
800
  }
650
- return e.expires > Date.now();
801
+ return t.expires > Date.now();
651
802
  }
652
803
  }
653
804
  return false;
654
805
  }
655
- async hasMany(e) {
656
- const t = this._getKeyPrefixArray(e);
806
+ async hasMany(t) {
807
+ const e = this._getKeyPrefixArray(t);
657
808
  const {store: s} = this.opts;
658
809
  if (s.hasMany !== void 0) {
659
- return s.hasMany(t);
810
+ return s.hasMany(e);
660
811
  }
661
812
  const i = [];
662
813
  for (const e of t) {
@@ -665,52 +816,52 @@ var f = class extends r {
665
816
  return i;
666
817
  }
667
818
  async disconnect() {
668
- const {store: e} = this.opts;
819
+ const {store: t} = this.opts;
669
820
  this.emit("disconnect");
670
- if (typeof e.disconnect === "function") {
671
- return e.disconnect();
821
+ if (typeof t.disconnect === "function") {
822
+ return t.disconnect();
672
823
  }
673
824
  }
674
- emit(e, ...t) {
675
- if (e === "error" && !this.opts.emitErrors) {
825
+ emit(t, ...e) {
826
+ if (t === "error" && !this.opts.emitErrors) {
676
827
  return;
677
828
  }
678
- super.emit(e, ...t);
829
+ super.emit(t, ...e);
679
830
  }
680
- async serializeData(e) {
831
+ async serializeData(t) {
681
832
  if (!this._serialize) {
682
- return e;
833
+ return t;
683
834
  }
684
835
  if (this._compression?.compress) {
685
836
  return this._serialize({
686
- value: await this._compression.compress(e.value),
687
- expires: e.expires
837
+ value: await this._compression.compress(t.value),
838
+ expires: t.expires
688
839
  });
689
840
  }
690
- return this._serialize(e);
841
+ return this._serialize(t);
691
842
  }
692
- async deserializeData(e) {
843
+ async deserializeData(t) {
693
844
  if (!this._deserialize) {
694
- return e;
845
+ return t;
695
846
  }
696
- if (this._compression?.decompress && typeof e === "string") {
697
- const t = await this._deserialize(e);
847
+ if (this._compression?.decompress && typeof t === "string") {
848
+ const e = await this._deserialize(t);
698
849
  return {
699
- value: await this._compression.decompress(t?.value),
700
- expires: t?.expires
850
+ value: await this._compression.decompress(e?.value),
851
+ expires: e?.expires
701
852
  };
702
853
  }
703
- if (typeof e === "string") {
704
- return this._deserialize(e);
854
+ if (typeof t === "string") {
855
+ return this._deserialize(t);
705
856
  }
706
857
  return void 0;
707
858
  }
708
859
  };
709
860
 
710
- var p = f;
861
+ var u = p;
711
862
 
712
- exports.Keyv = f;
863
+ exports.Keyv = p;
713
864
 
714
- exports.defaultDeserialize = s;
865
+ exports.defaultDeserialize = i;
715
866
 
716
- exports.index_default = p;
867
+ exports.index_default = u;