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