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
@@ -4,207 +4,116 @@ Object.defineProperty(exports, Symbol.toStringTag, {
4
4
  value: "Module"
5
5
  });
6
6
 
7
- const e = require("@redis/client");
7
+ const t = require("@redis/client");
8
8
 
9
- const t = require("./Package.67.cjs");
9
+ const e = require("cluster-key-slot");
10
10
 
11
- const r = require("cluster-key-slot");
11
+ const r = require("./Package.66.cjs");
12
+
13
+ const s = require("./Package.67.cjs");
12
14
 
13
15
  require("buffer");
14
16
 
15
- const s = e => e && e.__esModule ? e : {
16
- default: e
17
+ const i = t => t && t.__esModule ? t : {
18
+ default: t
17
19
  };
18
20
 
19
- const i = s(r);
21
+ const n = i(e);
20
22
 
21
- var n = class {
22
- _eventListeners;
23
- _maxListeners;
24
- _logger;
25
- constructor(e) {
26
- this._eventListeners = new Map, this._maxListeners = 100, this._logger = e?.logger;
27
- }
28
- once(e, t) {
29
- let r = (...s) => {
30
- this.off(e, r), t(...s);
31
- };
32
- return this.on(e, r), this;
33
- }
34
- listenerCount(e) {
35
- if (!e) return this.getAllListeners().length;
36
- let t = this._eventListeners.get(e);
37
- return t ? t.length : 0;
38
- }
39
- eventNames() {
40
- return [ ...this._eventListeners.keys() ];
41
- }
42
- rawListeners(e) {
43
- return e ? this._eventListeners.get(e) ?? [] : this.getAllListeners();
44
- }
45
- prependListener(e, t) {
46
- let r = this._eventListeners.get(e) ?? [];
47
- return r.unshift(t), this._eventListeners.set(e, r), this;
48
- }
49
- prependOnceListener(e, t) {
50
- let r = (...s) => {
51
- this.off(e, r), t(...s);
52
- };
53
- return this.prependListener(e, r), this;
54
- }
55
- maxListeners() {
56
- return this._maxListeners;
57
- }
58
- addListener(e, t) {
59
- return this.on(e, t), this;
60
- }
61
- on(e, t) {
62
- this._eventListeners.has(e) || this._eventListeners.set(e, []);
63
- let r = this._eventListeners.get(e);
64
- return r && (r.length >= this._maxListeners && console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${r.length + 1} ${e} listeners added. Use setMaxListeners() to increase limit.`),
65
- r.push(t)), this;
66
- }
67
- removeListener(e, t) {
68
- return this.off(e, t), this;
69
- }
70
- off(e, t) {
71
- let r = this._eventListeners.get(e) ?? [], s = r.indexOf(t);
72
- return s !== -1 && r.splice(s, 1), r.length === 0 && this._eventListeners.delete(e),
73
- this;
74
- }
75
- emit(e, ...t) {
76
- let r = !1, s = this._eventListeners.get(e);
77
- if (s && s.length > 0) for (let e of s) e(...t), r = !0;
78
- return r;
79
- }
80
- listeners(e) {
81
- return this._eventListeners.get(e) ?? [];
82
- }
83
- removeAllListeners(e) {
84
- return e ? this._eventListeners.delete(e) : this._eventListeners.clear(), this;
85
- }
86
- setMaxListeners(e) {
87
- this._maxListeners = e;
88
- for (let t of this._eventListeners.values()) t.length > e && t.splice(e);
89
- }
90
- getAllListeners() {
91
- let e = new Array;
92
- for (let t of this._eventListeners.values()) e = [ ...e, ...t ];
93
- return e;
94
- }
23
+ var o = (t => {
24
+ t["RedisClientNotConnectedThrown"] = "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.";
25
+ return t;
26
+ })(o || {});
27
+
28
+ var c = t => {
29
+ const e = Math.min(2 ** t * 100, 2e3);
30
+ const r = (Math.random() - .5) * 100;
31
+ return e + r;
95
32
  };
96
33
 
97
- var o = class extends n {
98
- _hooks;
99
- _throwHookErrors=!1;
100
- constructor(e) {
101
- super({
102
- logger: e?.logger
103
- }), this._hooks = new Map, e?.throwHookErrors !== void 0 && (this._throwHookErrors = e.throwHookErrors);
104
- }
105
- get hooks() {
106
- return this._hooks;
107
- }
108
- get throwHookErrors() {
109
- return this._throwHookErrors;
110
- }
111
- set throwHookErrors(e) {
112
- this._throwHookErrors = e;
113
- }
114
- get logger() {
115
- return this._logger;
116
- }
117
- set logger(e) {
118
- this._logger = e;
119
- }
120
- onHook(e, t) {
121
- let r = this._hooks.get(e);
122
- r ? r.push(t) : this._hooks.set(e, [ t ]);
123
- }
124
- addHook(e, t) {
125
- this.onHook(e, t);
126
- }
127
- onHooks(e) {
128
- for (let t of e) this.onHook(t.event, t.handler);
129
- }
130
- prependHook(e, t) {
131
- let r = this._hooks.get(e);
132
- r ? r.unshift(t) : this._hooks.set(e, [ t ]);
133
- }
134
- prependOnceHook(e, t) {
135
- let r = async (...s) => (this.removeHook(e, r), t(...s));
136
- this.prependHook(e, r);
137
- }
138
- onceHook(e, t) {
139
- let r = async (...s) => (this.removeHook(e, r), t(...s));
140
- this.onHook(e, r);
141
- }
142
- removeHook(e, t) {
143
- let r = this._hooks.get(e);
144
- if (r) {
145
- let e = r.indexOf(t);
146
- e !== -1 && r.splice(e, 1);
147
- }
148
- }
149
- removeHooks(e) {
150
- for (let t of e) this.removeHook(t.event, t.handler);
151
- }
152
- async hook(e, ...t) {
153
- let r = this._hooks.get(e);
154
- if (r) for (let s of r) try {
155
- await s(...t);
156
- } catch (t) {
157
- let r = `${e}: ${t.message}`;
158
- if (this.emit("error", new Error(r)), this._logger && this._logger.error(r), this._throwHookErrors) throw new Error(r);
34
+ function a(t, e) {
35
+ t ??= "redis://localhost:6379";
36
+ const r = new l(t, e);
37
+ if (e?.namespace) {
38
+ r.namespace = e.namespace;
39
+ const t = new s.Keyv(r, {
40
+ namespace: e?.namespace,
41
+ useKeyPrefix: false
42
+ });
43
+ if (e?.throwOnConnectError) {
44
+ t.throwOnErrors = true;
45
+ }
46
+ if (e?.throwOnErrors) {
47
+ t.throwOnErrors = true;
159
48
  }
49
+ return t;
160
50
  }
161
- async callHook(e, ...t) {
162
- await this.hook(e, ...t);
163
- }
164
- getHooks(e) {
165
- return this._hooks.get(e);
51
+ const i = new s.Keyv(r, {
52
+ useKeyPrefix: false
53
+ });
54
+ if (e?.throwOnConnectError) {
55
+ i.throwOnErrors = true;
166
56
  }
167
- clearHooks() {
168
- this._hooks.clear();
57
+ if (e?.throwOnErrors) {
58
+ i.throwOnErrors = true;
169
59
  }
170
- };
171
-
172
- var a = (e => {
173
- e["RedisClientNotConnectedThrown"] = "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.";
174
- return e;
175
- })(a || {});
60
+ i.namespace = void 0;
61
+ return i;
62
+ }
176
63
 
177
- var c = e => {
178
- const t = Math.min(2 ** e * 100, 2e3);
179
- const r = (Math.random() - .5) * 100;
180
- return t + r;
181
- };
64
+ function h(t, e) {
65
+ const r = a(t, e);
66
+ const s = r.store;
67
+ s.throwOnConnectError = false;
68
+ s.throwOnErrors = false;
69
+ const i = s.client;
70
+ if (i.options) {
71
+ i.options.disableOfflineQueue = true;
72
+ if (i.options.socket) {
73
+ i.options.socket.reconnectStrategy = false;
74
+ }
75
+ }
76
+ r.throwOnErrors = false;
77
+ return r;
78
+ }
182
79
 
183
- var h = class extends o {
184
- _client=e.createClient();
80
+ var l = class extends r.Hookified {
81
+ _client=t.createClient();
185
82
  _namespace;
186
83
  _keyPrefixSeparator="::";
187
84
  _clearBatchSize=1e3;
188
85
  _useUnlink=true;
189
86
  _noNamespaceAffectsAll=false;
190
87
  _throwOnConnectError=true;
191
- _throwErrors=false;
88
+ _throwOnErrors=false;
192
89
  _connectionTimeout;
193
- constructor(t, r) {
90
+ constructor(e, r) {
194
91
  super();
195
92
  const s = {
196
93
  reconnectStrategy: c
197
94
  };
198
- if (t) {
199
- if (typeof t === "string") {
200
- this._client = e.createClient({
201
- url: t,
95
+ if (e) {
96
+ if (typeof e === "string") {
97
+ this._client = t.createClient({
98
+ url: e,
202
99
  socket: s
203
100
  });
204
- } else if (t.connect !== void 0) {
205
- this._client = this.isClientCluster(t) ? t : t;
206
- } else if (t instanceof Object) {
207
- this._client = t.rootNodes === void 0 ? e.createClient(t) : e.createCluster(t);
101
+ } else if (e.connect !== void 0) {
102
+ if (this.isClientSentinel(e)) {
103
+ this._client = e;
104
+ } else if (this.isClientCluster(e)) {
105
+ this._client = e;
106
+ } else {
107
+ this._client = e;
108
+ }
109
+ } else if (e instanceof Object) {
110
+ if (e.sentinelRootNodes !== void 0) {
111
+ this._client = t.createSentinel(e);
112
+ } else if (e.rootNodes === void 0) {
113
+ this._client = t.createClient(e);
114
+ } else {
115
+ this._client = t.createCluster(e);
116
+ }
208
117
  }
209
118
  }
210
119
  this.setOptions(r);
@@ -213,53 +122,53 @@ var h = class extends o {
213
122
  get client() {
214
123
  return this._client;
215
124
  }
216
- set client(e) {
217
- this._client = e;
125
+ set client(t) {
126
+ this._client = t;
218
127
  this.initClient();
219
128
  }
220
129
  get opts() {
221
- let e = "redis://localhost:6379";
130
+ let t = "redis://localhost:6379";
222
131
  if (this._client.options) {
223
- const t = this._client.options?.url;
224
- if (t) {
225
- e = t;
132
+ const e = this._client.options?.url;
133
+ if (e) {
134
+ t = e;
226
135
  }
227
136
  }
228
- const t = {
137
+ const e = {
229
138
  namespace: this._namespace,
230
139
  keyPrefixSeparator: this._keyPrefixSeparator,
231
140
  clearBatchSize: this._clearBatchSize,
232
141
  noNamespaceAffectsAll: this._noNamespaceAffectsAll,
233
142
  useUnlink: this._useUnlink,
234
143
  throwOnConnectError: this._throwOnConnectError,
235
- throwErrors: this._throwErrors,
144
+ throwOnErrors: this._throwOnErrors,
236
145
  connectionTimeout: this._connectionTimeout,
237
146
  dialect: "redis",
238
- url: e
147
+ url: t
239
148
  };
240
- return t;
149
+ return e;
241
150
  }
242
- set opts(e) {
243
- this.setOptions(e);
151
+ set opts(t) {
152
+ this.setOptions(t);
244
153
  }
245
154
  get namespace() {
246
155
  return this._namespace;
247
156
  }
248
- set namespace(e) {
249
- this._namespace = e;
157
+ set namespace(t) {
158
+ this._namespace = t;
250
159
  }
251
160
  get keyPrefixSeparator() {
252
161
  return this._keyPrefixSeparator;
253
162
  }
254
- set keyPrefixSeparator(e) {
255
- this._keyPrefixSeparator = e;
163
+ set keyPrefixSeparator(t) {
164
+ this._keyPrefixSeparator = t;
256
165
  }
257
166
  get clearBatchSize() {
258
167
  return this._clearBatchSize;
259
168
  }
260
- set clearBatchSize(e) {
261
- if (e > 0) {
262
- this._clearBatchSize = e;
169
+ set clearBatchSize(t) {
170
+ if (t > 0) {
171
+ this._clearBatchSize = t;
263
172
  } else {
264
173
  this.emit("error", "clearBatchSize must be greater than 0");
265
174
  }
@@ -267,32 +176,32 @@ var h = class extends o {
267
176
  get useUnlink() {
268
177
  return this._useUnlink;
269
178
  }
270
- set useUnlink(e) {
271
- this._useUnlink = e;
179
+ set useUnlink(t) {
180
+ this._useUnlink = t;
272
181
  }
273
182
  get noNamespaceAffectsAll() {
274
183
  return this._noNamespaceAffectsAll;
275
184
  }
276
- set noNamespaceAffectsAll(e) {
277
- this._noNamespaceAffectsAll = e;
185
+ set noNamespaceAffectsAll(t) {
186
+ this._noNamespaceAffectsAll = t;
278
187
  }
279
188
  get throwOnConnectError() {
280
189
  return this._throwOnConnectError;
281
190
  }
282
- set throwOnConnectError(e) {
283
- this._throwOnConnectError = e;
191
+ set throwOnConnectError(t) {
192
+ this._throwOnConnectError = t;
284
193
  }
285
- get throwErrors() {
286
- return this._throwErrors;
194
+ get throwOnErrors() {
195
+ return this._throwOnErrors;
287
196
  }
288
- set throwErrors(e) {
289
- this._throwErrors = e;
197
+ set throwOnErrors(t) {
198
+ this._throwOnErrors = t;
290
199
  }
291
200
  get connectionTimeout() {
292
201
  return this._connectionTimeout;
293
202
  }
294
- set connectionTimeout(e) {
295
- this._connectionTimeout = e;
203
+ set connectionTimeout(t) {
204
+ this._connectionTimeout = t;
296
205
  }
297
206
  async getClient() {
298
207
  if (this._client.isOpen) {
@@ -304,214 +213,292 @@ var h = class extends o {
304
213
  } else {
305
214
  await Promise.race([ this._client.connect(), this.createTimeoutPromise(this._connectionTimeout) ]);
306
215
  }
307
- } catch (e) {
308
- this.emit("error", e);
216
+ } catch (t) {
217
+ this.emit("error", t);
218
+ await this.disconnect(true);
309
219
  if (this._throwOnConnectError) {
310
220
  throw new Error("Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.");
311
221
  }
312
- await this.disconnect(true);
313
222
  }
314
223
  this.initClient();
315
224
  return this._client;
316
225
  }
317
- async set(e, t, r) {
226
+ async set(t, e, r) {
318
227
  const s = await this.getClient();
319
228
  try {
320
- e = this.createKeyPrefix(e, this._namespace);
229
+ t = this.createKeyPrefix(t, this._namespace);
321
230
  if (r) {
322
- await s.set(e, t, {
231
+ await s.set(t, e, {
323
232
  PX: r
324
233
  });
325
234
  } else {
326
- await s.set(e, t);
235
+ await s.set(t, e);
327
236
  }
328
- } catch (e) {
329
- this.emit("error", e);
330
- if (this._throwErrors) {
331
- throw e;
237
+ } catch (t) {
238
+ this.emit("error", t);
239
+ if (this._throwOnErrors) {
240
+ throw t;
332
241
  }
333
242
  }
334
243
  }
335
- async setMany(e) {
336
- const t = await this.getClient();
244
+ async setMany(t) {
337
245
  try {
338
- const r = t.multi();
339
- for (const {key: t, value: s, ttl: i} of e) {
340
- const e = this.createKeyPrefix(t, this._namespace);
341
- if (i) {
342
- r.set(e, s, {
343
- PX: i
344
- });
345
- } else {
346
- r.set(e, s);
246
+ if (this.isCluster()) {
247
+ await this.getClient();
248
+ const e = new Map;
249
+ for (const r of t) {
250
+ const t = this.createKeyPrefix(r.key, this._namespace);
251
+ const s = n.default(t);
252
+ const i = e.get(s) ?? [];
253
+ i.push(r);
254
+ e.set(s, i);
255
+ }
256
+ await Promise.all(Array.from(e.entries(), (async ([t, e]) => {
257
+ const r = await this.getSlotMaster(t);
258
+ const s = r.multi();
259
+ for (const {key: t, value: r, ttl: i} of e) {
260
+ const e = this.createKeyPrefix(t, this._namespace);
261
+ if (i) {
262
+ s.set(e, r, {
263
+ PX: i
264
+ });
265
+ } else {
266
+ s.set(e, r);
267
+ }
268
+ }
269
+ await s.exec();
270
+ })));
271
+ } else {
272
+ const e = await this.getClient();
273
+ const r = e.multi();
274
+ for (const {key: e, value: s, ttl: i} of t) {
275
+ const t = this.createKeyPrefix(e, this._namespace);
276
+ if (i) {
277
+ r.set(t, s, {
278
+ PX: i
279
+ });
280
+ } else {
281
+ r.set(t, s);
282
+ }
347
283
  }
284
+ await r.exec();
348
285
  }
349
- await r.exec();
350
- } catch (e) {
351
- this.emit("error", e);
352
- if (this._throwErrors) {
353
- throw e;
286
+ } catch (t) {
287
+ this.emit("error", t);
288
+ if (this._throwOnConnectError && t.message === "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.") {
289
+ throw t;
290
+ }
291
+ if (this._throwOnErrors) {
292
+ throw t;
354
293
  }
355
294
  }
356
295
  }
357
- async has(e) {
358
- const t = await this.getClient();
296
+ async has(t) {
297
+ const e = await this.getClient();
359
298
  try {
360
- e = this.createKeyPrefix(e, this._namespace);
361
- const r = await t.exists(e);
299
+ t = this.createKeyPrefix(t, this._namespace);
300
+ const r = await e.exists(t);
362
301
  return r === 1;
363
- } catch (e) {
364
- this.emit("error", e);
365
- if (this._throwErrors) {
366
- throw e;
302
+ } catch (t) {
303
+ this.emit("error", t);
304
+ if (this._throwOnErrors) {
305
+ throw t;
367
306
  }
368
307
  return false;
369
308
  }
370
309
  }
371
- async hasMany(e) {
372
- const t = await this.getClient();
310
+ async hasMany(t) {
373
311
  try {
374
- const r = t.multi();
375
- for (const t of e) {
376
- const e = this.createKeyPrefix(t, this._namespace);
377
- r.exists(e);
312
+ const e = t.map((t => this.createKeyPrefix(t, this._namespace)));
313
+ if (this.isCluster()) {
314
+ const t = this.getSlotMap(e);
315
+ const r = new Map;
316
+ await Promise.all(Array.from(t.entries(), (async ([t, e]) => {
317
+ const s = await this.getSlotMaster(t);
318
+ const i = s.multi();
319
+ for (const t of e) {
320
+ i.exists(t);
321
+ }
322
+ const n = await i.exec();
323
+ for (const [t, s] of n.entries()) {
324
+ r.set(e[t], typeof s === "number" && s === 1);
325
+ }
326
+ })));
327
+ return e.map((t => r.get(t) ?? false));
328
+ } else {
329
+ const t = await this.getClient();
330
+ const r = t.multi();
331
+ for (const t of e) {
332
+ r.exists(t);
333
+ }
334
+ const s = await r.exec();
335
+ return s.map((t => typeof t === "number" && t === 1));
378
336
  }
379
- const s = await r.exec();
380
- return s.map((e => e === 1));
381
- } catch (t) {
382
- this.emit("error", t);
383
- if (this._throwErrors) {
384
- throw t;
337
+ } catch (e) {
338
+ this.emit("error", e);
339
+ if (this._throwOnConnectError && e.message === "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.") {
340
+ throw e;
341
+ }
342
+ if (this._throwOnErrors) {
343
+ throw e;
385
344
  }
386
345
  return Array.from({
387
- length: e.length
346
+ length: t.length
388
347
  }).fill(false);
389
348
  }
390
349
  }
391
- async get(e) {
392
- const t = await this.getClient();
350
+ async get(t) {
351
+ const e = await this.getClient();
393
352
  try {
394
- e = this.createKeyPrefix(e, this._namespace);
395
- const r = await t.get(e);
353
+ t = this.createKeyPrefix(t, this._namespace);
354
+ const r = await e.get(t);
396
355
  if (r === null) {
397
356
  return void 0;
398
357
  }
399
358
  return r;
400
- } catch (e) {
401
- this.emit("error", e);
402
- if (this._throwErrors) {
403
- throw e;
359
+ } catch (t) {
360
+ this.emit("error", t);
361
+ if (this._throwOnErrors) {
362
+ throw t;
404
363
  }
405
364
  return void 0;
406
365
  }
407
366
  }
408
- async getMany(e) {
409
- if (e.length === 0) {
367
+ async getMany(t) {
368
+ if (t.length === 0) {
410
369
  return [];
411
370
  }
412
- e = e.map((e => this.createKeyPrefix(e, this._namespace)));
371
+ t = t.map((t => this.createKeyPrefix(t, this._namespace)));
413
372
  try {
414
- const t = await this.mget(e);
415
- return t;
416
- } catch (t) {
417
- this.emit("error", t);
418
- if (this._throwErrors) {
419
- throw t;
373
+ const e = await this.mget(t);
374
+ return e;
375
+ } catch (e) {
376
+ this.emit("error", e);
377
+ if (this._throwOnErrors) {
378
+ throw e;
420
379
  }
421
380
  return Array.from({
422
- length: e.length
381
+ length: t.length
423
382
  }).fill(void 0);
424
383
  }
425
384
  }
426
- async delete(e) {
427
- const t = await this.getClient();
385
+ async delete(t) {
386
+ const e = await this.getClient();
428
387
  try {
429
- e = this.createKeyPrefix(e, this._namespace);
388
+ t = this.createKeyPrefix(t, this._namespace);
430
389
  let r = 0;
431
- r = await (this._useUnlink ? t.unlink(e) : t.del(e));
390
+ r = await (this._useUnlink ? e.unlink(t) : e.del(t));
432
391
  return r > 0;
433
- } catch (e) {
434
- this.emit("error", e);
435
- if (this._throwErrors) {
436
- throw e;
392
+ } catch (t) {
393
+ this.emit("error", t);
394
+ if (this._throwOnErrors) {
395
+ throw t;
437
396
  }
438
397
  return false;
439
398
  }
440
399
  }
441
- async deleteMany(e) {
442
- let t = false;
443
- const r = await this.getClient();
400
+ async deleteMany(t) {
401
+ let e = false;
444
402
  try {
445
- const s = r.multi();
446
- for (const t of e) {
447
- const e = this.createKeyPrefix(t, this._namespace);
448
- if (this._useUnlink) {
449
- s.unlink(e);
450
- } else {
451
- s.del(e);
403
+ const r = t.map((t => this.createKeyPrefix(t, this._namespace)));
404
+ if (this.isCluster()) {
405
+ const t = this.getSlotMap(r);
406
+ await Promise.all(Array.from(t.entries(), (async ([t, r]) => {
407
+ const s = await this.getSlotMaster(t);
408
+ const i = s.multi();
409
+ for (const t of r) {
410
+ if (this._useUnlink) {
411
+ i.unlink(t);
412
+ } else {
413
+ i.del(t);
414
+ }
415
+ }
416
+ const n = await i.exec();
417
+ for (const t of n) {
418
+ if (typeof t === "number" && t > 0) {
419
+ e = true;
420
+ }
421
+ }
422
+ })));
423
+ } else {
424
+ const t = await this.getClient();
425
+ const s = t.multi();
426
+ for (const t of r) {
427
+ if (this._useUnlink) {
428
+ s.unlink(t);
429
+ } else {
430
+ s.del(t);
431
+ }
452
432
  }
453
- }
454
- const i = await s.exec();
455
- for (const e of i) {
456
- if (typeof e === "number" && e > 0) {
457
- t = true;
433
+ const i = await s.exec();
434
+ for (const t of i) {
435
+ if (typeof t === "number" && t > 0) {
436
+ e = true;
437
+ }
458
438
  }
459
439
  }
460
- } catch (e) {
461
- this.emit("error", e);
462
- if (this._throwErrors) {
463
- throw e;
440
+ } catch (t) {
441
+ this.emit("error", t);
442
+ if (this._throwOnConnectError && t.message === "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.") {
443
+ throw t;
444
+ }
445
+ if (this._throwOnErrors) {
446
+ throw t;
464
447
  }
465
448
  }
466
- return t;
449
+ return e;
467
450
  }
468
- async disconnect(e) {
451
+ async disconnect(t) {
469
452
  if (this._client.isOpen) {
470
- await (e ? this._client.disconnect() : this._client.quit());
453
+ await (t ? this._client.destroy() : this._client.close());
471
454
  }
472
455
  }
473
- createKeyPrefix(e, t) {
474
- if (t) {
475
- return `${t}${this._keyPrefixSeparator}${e}`;
456
+ createKeyPrefix(t, e) {
457
+ if (e) {
458
+ return `${e}${this._keyPrefixSeparator}${t}`;
476
459
  }
477
- return e;
460
+ return t;
478
461
  }
479
- getKeyWithoutPrefix(e, t) {
480
- if (t) {
481
- return e.replace(`${t}${this._keyPrefixSeparator}`, "");
462
+ getKeyWithoutPrefix(t, e) {
463
+ if (e) {
464
+ return t.replace(`${e}${this._keyPrefixSeparator}`, "");
482
465
  }
483
- return e;
466
+ return t;
484
467
  }
485
468
  isCluster() {
486
469
  return this.isClientCluster(this._client);
487
470
  }
471
+ isSentinel() {
472
+ return this.isClientSentinel(this._client);
473
+ }
488
474
  async getMasterNodes() {
489
475
  if (this.isCluster()) {
490
- const e = await this.getClient();
491
- return Promise.all(e.masters.map((async t => e.nodeClient(t))));
476
+ const t = await this.getClient();
477
+ const e = t.masters.map((async e => t.nodeClient(e)));
478
+ return Promise.all(e);
492
479
  }
493
480
  return [ await this.getClient() ];
494
481
  }
495
- async* iterator(e) {
496
- const t = await this.getMasterNodes();
497
- for (const r of t) {
498
- const t = e ? `${e}${this._keyPrefixSeparator}*` : "*";
482
+ async* iterator(t) {
483
+ const e = await this.getMasterNodes();
484
+ for (const r of e) {
485
+ const e = t ? `${t}${this._keyPrefixSeparator}*` : "*";
499
486
  let s = "0";
500
487
  do {
501
- const i = await r.scan(Number.parseInt(s, 10), {
502
- MATCH: t,
488
+ const i = await r.scan(s, {
489
+ MATCH: e,
503
490
  TYPE: "string"
504
491
  });
505
492
  s = i.cursor.toString();
506
493
  let {keys: n} = i;
507
- if (!e && !this._noNamespaceAffectsAll) {
508
- n = n.filter((e => !e.includes(this._keyPrefixSeparator)));
494
+ if (!t && !this._noNamespaceAffectsAll) {
495
+ n = n.filter((t => !t.includes(this._keyPrefixSeparator)));
509
496
  }
510
497
  if (n.length > 0) {
511
- const t = await this.mget(n);
498
+ const e = await this.mget(n);
512
499
  for (const r of n.keys()) {
513
- const s = this.getKeyWithoutPrefix(n[r], e);
514
- const i = t[r];
500
+ const s = this.getKeyWithoutPrefix(n[r], t);
501
+ const i = e[r];
515
502
  yield [ s, i ];
516
503
  }
517
504
  }
@@ -520,115 +507,123 @@ var h = class extends o {
520
507
  }
521
508
  async clear() {
522
509
  try {
523
- const e = await this.getMasterNodes();
524
- await Promise.all(e.map((async e => {
510
+ const t = await this.getMasterNodes();
511
+ await Promise.all(t.map((async t => {
525
512
  if (!this._namespace && this._noNamespaceAffectsAll) {
526
- await e.flushDb();
513
+ await t.flushDb();
527
514
  return;
528
515
  }
529
- let t = "0";
516
+ let e = "0";
530
517
  const r = this._clearBatchSize;
531
518
  const s = this._namespace ? `${this._namespace}${this._keyPrefixSeparator}*` : "*";
532
519
  const i = [];
533
520
  do {
534
- const n = await e.scan(Number.parseInt(t, 10), {
521
+ const n = await t.scan(e, {
535
522
  MATCH: s,
536
523
  COUNT: r,
537
524
  TYPE: "string"
538
525
  });
539
- t = n.cursor.toString();
526
+ e = n.cursor.toString();
540
527
  let {keys: o} = n;
541
528
  if (o.length === 0) {
542
529
  continue;
543
530
  }
544
531
  if (!this._namespace) {
545
- o = o.filter((e => !e.includes(this._keyPrefixSeparator)));
532
+ o = o.filter((t => !t.includes(this._keyPrefixSeparator)));
546
533
  }
547
534
  i.push(this.clearWithClusterSupport(o));
548
- } while (t !== "0");
535
+ } while (e !== "0");
549
536
  await Promise.all(i);
550
537
  })));
551
- } catch (e) {
552
- this.emit("error", e);
538
+ } catch (t) {
539
+ this.emit("error", t);
553
540
  }
554
541
  }
555
- async mget(e) {
556
- const t = this.getSlotMap(e);
557
- const r = new Map;
558
- await Promise.all(Array.from(t.entries(), (async ([e, t]) => {
559
- const s = await this.getSlotMaster(e);
560
- const i = await s.mGet(t);
561
- for (const [e, s] of i.entries()) {
562
- r.set(t[e], s ?? void 0);
542
+ async mget(t) {
543
+ const e = new Map;
544
+ if (this.isCluster()) {
545
+ const r = this.getSlotMap(t);
546
+ await Promise.all(Array.from(r.entries(), (async ([t, r]) => {
547
+ const s = await this.getSlotMaster(t);
548
+ const i = await s.mGet(r);
549
+ for (const [t, s] of i.entries()) {
550
+ e.set(r[t], s ?? void 0);
551
+ }
552
+ })));
553
+ } else {
554
+ const r = await this.getClient();
555
+ const s = await r.mGet(t);
556
+ for (const [r, i] of s.entries()) {
557
+ e.set(t[r], i ?? void 0);
563
558
  }
564
- })));
565
- return e.map((e => r.get(e)));
566
- }
567
- async clearWithClusterSupport(e) {
568
- if (e.length > 0) {
569
- const t = this.getSlotMap(e);
570
- await Promise.all(Array.from(t.entries(), (async ([e, t]) => {
571
- const r = await this.getSlotMaster(e);
572
- return this._useUnlink ? r.unlink(t) : r.del(t);
559
+ }
560
+ return t.map((t => e.get(t)));
561
+ }
562
+ async clearWithClusterSupport(t) {
563
+ if (t.length > 0) {
564
+ const e = this.getSlotMap(t);
565
+ await Promise.all(Array.from(e.entries(), (async ([t, e]) => {
566
+ const r = await this.getSlotMaster(t);
567
+ return this._useUnlink ? r.unlink(e) : r.del(e);
573
568
  })));
574
569
  }
575
570
  }
576
- async getSlotMaster(e) {
577
- const t = await this.getClient();
571
+ async getSlotMaster(t) {
572
+ const e = await this.getClient();
578
573
  if (this.isCluster()) {
579
- const r = t;
580
- const s = r.slots[e].master;
574
+ const r = e;
575
+ const s = r.slots[t].master;
581
576
  return r.nodeClient(s);
582
577
  }
583
- return t;
578
+ return e;
584
579
  }
585
- getSlotMap(e) {
586
- const t = new Map;
580
+ getSlotMap(t) {
581
+ const e = new Map;
587
582
  if (this.isCluster()) {
588
- for (const r of e) {
589
- const e = i.default(r);
590
- const s = t.get(e) ?? [];
583
+ for (const r of t) {
584
+ const t = n.default(r);
585
+ const s = e.get(t) ?? [];
591
586
  s.push(r);
592
- t.set(e, s);
587
+ e.set(t, s);
593
588
  }
594
589
  } else {
595
- t.set(0, e);
590
+ e.set(0, t);
596
591
  }
597
- return t;
592
+ return e;
598
593
  }
599
- isClientCluster(e) {
600
- if (e.options === void 0 && e.scan === void 0) {
601
- return true;
602
- }
603
- return false;
594
+ isClientCluster(t) {
595
+ return t.slots !== void 0;
604
596
  }
605
- setOptions(e) {
606
- if (!e) {
597
+ isClientSentinel(t) {
598
+ return t.getSentinelNode !== void 0;
599
+ }
600
+ setOptions(t) {
601
+ if (!t) {
607
602
  return;
608
603
  }
609
- if (e.namespace) {
610
- this._namespace = e.namespace;
604
+ if (t.namespace) {
605
+ this._namespace = t.namespace;
611
606
  }
612
- if (e.keyPrefixSeparator !== void 0) {
613
- this._keyPrefixSeparator = e.keyPrefixSeparator;
607
+ if (t.keyPrefixSeparator !== void 0) {
608
+ this._keyPrefixSeparator = t.keyPrefixSeparator;
614
609
  }
615
- if (e.clearBatchSize !== void 0 && e.clearBatchSize > 0) {
616
- this._clearBatchSize = e.clearBatchSize;
610
+ if (t.clearBatchSize !== void 0 && t.clearBatchSize > 0) {
611
+ this._clearBatchSize = t.clearBatchSize;
617
612
  }
618
- if (e.useUnlink !== void 0) {
619
- this._useUnlink = e.useUnlink;
613
+ if (t.useUnlink !== void 0) {
614
+ this._useUnlink = t.useUnlink;
620
615
  }
621
- if (e.noNamespaceAffectsAll !== void 0) {
622
- this._noNamespaceAffectsAll = e.noNamespaceAffectsAll;
616
+ if (t.noNamespaceAffectsAll !== void 0) {
617
+ this._noNamespaceAffectsAll = t.noNamespaceAffectsAll;
623
618
  }
624
- if (e.throwOnConnectError !== void 0) {
625
- this._throwOnConnectError = e.throwOnConnectError;
619
+ if (t.throwOnConnectError !== void 0) {
620
+ this._throwOnConnectError = t.throwOnConnectError;
626
621
  }
627
- if (e.throwErrors !== void 0) {
628
- this._throwErrors = e.throwErrors;
622
+ if (t.throwOnErrors !== void 0) {
623
+ this._throwOnErrors = t.throwOnErrors;
629
624
  }
630
- if (e.connectionTimeout !== void 0) {
631
- this._connectionTimeout = e.connectionTimeout;
625
+ if (t.connectionTimeout !== void 0) {
626
+ this._connectionTimeout = t.connectionTimeout;
632
627
  }
633
628
  }
634
629
  initClient() {
@@ -638,43 +633,40 @@ var h = class extends o {
638
633
  this._client.on("disconnect", (() => {
639
634
  this.emit("disconnect", this._client);
640
635
  }));
641
- this._client.on("reconnecting", (e => {
642
- this.emit("reconnecting", e);
636
+ this._client.on("reconnecting", (t => {
637
+ this.emit("reconnecting", t);
643
638
  }));
644
639
  }
645
- async createTimeoutPromise(e) {
646
- return new Promise(((t, r) => setTimeout((() => {
647
- r(new Error(`Redis timed out after ${e}ms`));
648
- }), e)));
640
+ async createTimeoutPromise(t) {
641
+ return new Promise(((e, r) => setTimeout((() => {
642
+ r(new Error(`Redis timed out after ${t}ms`));
643
+ }), t)));
649
644
  }
650
645
  };
651
646
 
652
- function l(e, r) {
653
- e ??= "redis://localhost:6379";
654
- const s = new h(e, r);
655
- const i = new t.Keyv(s, {
656
- namespace: r?.namespace,
657
- useKeyPrefix: false
658
- });
659
- return i;
660
- }
661
-
662
647
  Object.defineProperty(exports, "createClient", {
663
648
  enumerable: true,
664
- get: () => e.createClient
649
+ get: () => t.createClient
665
650
  });
666
651
 
667
652
  Object.defineProperty(exports, "createCluster", {
668
653
  enumerable: true,
669
- get: () => e.createCluster
654
+ get: () => t.createCluster
670
655
  });
671
656
 
672
- exports.Keyv = t.Keyv;
657
+ Object.defineProperty(exports, "createSentinel", {
658
+ enumerable: true,
659
+ get: () => t.createSentinel
660
+ });
661
+
662
+ exports.Keyv = s.Keyv;
663
+
664
+ exports.RedisErrorMessages = o;
673
665
 
674
- exports.RedisErrorMessages = a;
666
+ exports.createKeyv = a;
675
667
 
676
- exports.createKeyv = l;
668
+ exports.createKeyvNonBlocking = h;
677
669
 
678
- exports.default = h;
670
+ exports.default = l;
679
671
 
680
672
  exports.defaultReconnectStrategy = c;