lakutata 2.0.34 → 2.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/com/cacher.cjs +229 -0
  2. package/com/cacher.d.ts +514 -0
  3. package/com/cacher.mjs +203 -0
  4. package/com/database.cjs +11 -5
  5. package/com/database.mjs +11 -5
  6. package/com/docker.cjs +26 -18
  7. package/com/docker.mjs +22 -14
  8. package/com/entrypoint.cjs +4 -2
  9. package/com/entrypoint.mjs +4 -2
  10. package/com/logger.cjs +9 -3
  11. package/com/logger.mjs +9 -3
  12. package/decorator/ctrl.cjs +4 -2
  13. package/decorator/ctrl.mjs +4 -2
  14. package/decorator/di.cjs +3 -1
  15. package/decorator/di.mjs +3 -1
  16. package/decorator/dto.cjs +3 -1
  17. package/decorator/dto.mjs +3 -1
  18. package/decorator/orm.cjs +27 -21
  19. package/decorator/orm.mjs +11 -5
  20. package/helper.cjs +17 -15
  21. package/helper.mjs +4 -2
  22. package/lakutata.cjs +14 -8
  23. package/lakutata.mjs +10 -4
  24. package/orm.cjs +25 -19
  25. package/orm.mjs +22 -16
  26. package/package.json +6 -1
  27. package/provider/database.cjs +11 -5
  28. package/provider/database.mjs +11 -5
  29. package/provider/passwordHash.cjs +3 -1
  30. package/provider/passwordHash.mjs +3 -1
  31. package/src/components/Database.cjs +11 -5
  32. package/src/components/Database.mjs +11 -5
  33. package/src/components/Logger.cjs +9 -3
  34. package/src/components/Logger.mjs +9 -3
  35. package/src/components/cacher/Cacher.cjs +734 -0
  36. package/src/components/cacher/Cacher.mjs +720 -0
  37. package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +3094 -0
  38. package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +3066 -0
  39. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.cjs +33 -0
  40. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.mjs +35 -0
  41. package/src/components/cacher/adapters/CreateMongoCacheAdapter.cjs +38 -0
  42. package/src/components/cacher/adapters/CreateMongoCacheAdapter.mjs +40 -0
  43. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.cjs +31 -0
  44. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.mjs +33 -0
  45. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.cjs +40 -0
  46. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.mjs +42 -0
  47. package/src/components/cacher/adapters/CreateRedisCacheAdapter.cjs +43 -0
  48. package/src/components/cacher/adapters/CreateRedisCacheAdapter.mjs +45 -0
  49. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.cjs +35 -0
  50. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.mjs +37 -0
  51. package/src/components/cacher/options/CacherOptions.cjs +95 -0
  52. package/src/components/cacher/options/CacherOptions.mjs +89 -0
  53. package/src/components/cacher/options/FileCacheOptions.cjs +79 -0
  54. package/src/components/cacher/options/FileCacheOptions.mjs +73 -0
  55. package/src/components/cacher/options/MemcacheCacheOptions.cjs +81 -0
  56. package/src/components/cacher/options/MemcacheCacheOptions.mjs +75 -0
  57. package/src/components/cacher/options/MongoCacheOptions.cjs +85 -0
  58. package/src/components/cacher/options/MongoCacheOptions.mjs +79 -0
  59. package/src/components/cacher/options/MysqlCacheOptions.cjs +85 -0
  60. package/src/components/cacher/options/MysqlCacheOptions.mjs +79 -0
  61. package/src/components/cacher/options/PostgresCacheOptions.cjs +89 -0
  62. package/src/components/cacher/options/PostgresCacheOptions.mjs +83 -0
  63. package/src/components/cacher/options/RedisCacheOptions.cjs +101 -0
  64. package/src/components/cacher/options/RedisCacheOptions.mjs +95 -0
  65. package/src/components/cacher/options/SqliteCacheOptions.cjs +79 -0
  66. package/src/components/cacher/options/SqliteCacheOptions.mjs +73 -0
  67. package/src/components/cacher/types/CacheStoreOptions.cjs +1 -0
  68. package/src/components/cacher/types/CacheStoreOptions.mjs +1 -0
  69. package/src/components/docker/ConnectionOptionsBuilder.cjs +22 -14
  70. package/src/components/docker/ConnectionOptionsBuilder.mjs +22 -14
  71. package/src/components/docker/Docker.cjs +22 -14
  72. package/src/components/docker/Docker.mjs +22 -14
  73. package/src/components/docker/lib/DockerContainer.cjs +34 -26
  74. package/src/components/docker/lib/DockerContainer.mjs +26 -18
  75. package/src/components/docker/lib/DockerContainerTTY.cjs +18 -10
  76. package/src/components/docker/lib/DockerContainerTTY.mjs +18 -10
  77. package/src/components/docker/lib/DockerImage.cjs +11 -9
  78. package/src/components/docker/lib/DockerImage.mjs +3 -1
  79. package/src/components/docker/options/DockerPruneOptions.cjs +3 -1
  80. package/src/components/docker/options/DockerPruneOptions.mjs +3 -1
  81. package/src/components/docker/options/auth/DockerAuthOptions.cjs +3 -1
  82. package/src/components/docker/options/auth/DockerAuthOptions.mjs +3 -1
  83. package/src/components/docker/options/container/ContainerCommitOptions.cjs +3 -1
  84. package/src/components/docker/options/container/ContainerCommitOptions.mjs +3 -1
  85. package/src/components/docker/options/container/ContainerCreateTTYOptions.cjs +3 -1
  86. package/src/components/docker/options/container/ContainerCreateTTYOptions.mjs +3 -1
  87. package/src/components/docker/options/container/ContainerExecOptions.cjs +3 -1
  88. package/src/components/docker/options/container/ContainerExecOptions.mjs +5 -3
  89. package/src/components/docker/options/container/ContainerExportDirectoryOptions.cjs +3 -1
  90. package/src/components/docker/options/container/ContainerExportDirectoryOptions.mjs +3 -1
  91. package/src/components/docker/options/container/ContainerKillOptions.cjs +3 -1
  92. package/src/components/docker/options/container/ContainerKillOptions.mjs +3 -1
  93. package/src/components/docker/options/container/ContainerLogsOptions.cjs +3 -1
  94. package/src/components/docker/options/container/ContainerLogsOptions.mjs +3 -1
  95. package/src/components/docker/options/container/ContainerRemoveOptions.cjs +3 -1
  96. package/src/components/docker/options/container/ContainerRemoveOptions.mjs +3 -1
  97. package/src/components/docker/options/container/ContainerSettingOptions.cjs +3 -1
  98. package/src/components/docker/options/container/ContainerSettingOptions.mjs +3 -1
  99. package/src/components/docker/options/container/ContainerStopOptions.cjs +3 -1
  100. package/src/components/docker/options/container/ContainerStopOptions.mjs +3 -1
  101. package/src/components/docker/options/container/ContainerTTYConsoleSizeOptions.cjs +3 -1
  102. package/src/components/docker/options/container/ContainerTTYConsoleSizeOptions.mjs +3 -1
  103. package/src/components/docker/options/image/ImageBuildOptions.cjs +3 -1
  104. package/src/components/docker/options/image/ImageBuildOptions.mjs +5 -3
  105. package/src/components/docker/options/image/ImageExportOptions.cjs +3 -1
  106. package/src/components/docker/options/image/ImageExportOptions.mjs +3 -1
  107. package/src/components/docker/options/image/ImageImportOptions.cjs +3 -1
  108. package/src/components/docker/options/image/ImageImportOptions.mjs +3 -1
  109. package/src/components/docker/options/image/ImagePullOptions.cjs +3 -1
  110. package/src/components/docker/options/image/ImagePullOptions.mjs +3 -1
  111. package/src/components/docker/options/image/ImagePushOptions.cjs +3 -1
  112. package/src/components/docker/options/image/ImagePushOptions.mjs +3 -1
  113. package/src/components/docker/options/image/ImageRemoveOptions.cjs +3 -1
  114. package/src/components/docker/options/image/ImageRemoveOptions.mjs +3 -1
  115. package/src/components/docker/options/image/ImageTagOptions.cjs +3 -1
  116. package/src/components/docker/options/image/ImageTagOptions.mjs +3 -1
  117. package/src/components/docker/options/network/NetworkCreateOptions.cjs +3 -1
  118. package/src/components/docker/options/network/NetworkCreateOptions.mjs +3 -1
  119. package/src/components/entrypoint/Entrypoint.cjs +4 -2
  120. package/src/components/entrypoint/Entrypoint.mjs +49 -47
  121. package/src/components/entrypoint/lib/Controller.cjs +3 -1
  122. package/src/components/entrypoint/lib/Controller.mjs +3 -1
  123. package/src/decorators/ctrl/CLIAction.cjs +6 -4
  124. package/src/decorators/ctrl/CLIAction.mjs +4 -2
  125. package/src/decorators/ctrl/HTTPAction.cjs +4 -2
  126. package/src/decorators/ctrl/HTTPAction.mjs +9 -7
  127. package/src/decorators/ctrl/ServiceAction.cjs +8 -6
  128. package/src/decorators/ctrl/ServiceAction.mjs +4 -2
  129. package/src/decorators/ctrl/http/DELETE.cjs +4 -2
  130. package/src/decorators/ctrl/http/DELETE.mjs +4 -2
  131. package/src/decorators/ctrl/http/GET.cjs +4 -2
  132. package/src/decorators/ctrl/http/GET.mjs +4 -2
  133. package/src/decorators/ctrl/http/HEAD.cjs +4 -2
  134. package/src/decorators/ctrl/http/HEAD.mjs +4 -2
  135. package/src/decorators/ctrl/http/OPTIONS.cjs +4 -2
  136. package/src/decorators/ctrl/http/OPTIONS.mjs +4 -2
  137. package/src/decorators/ctrl/http/PATCH.cjs +4 -2
  138. package/src/decorators/ctrl/http/PATCH.mjs +4 -2
  139. package/src/decorators/ctrl/http/POST.cjs +4 -2
  140. package/src/decorators/ctrl/http/POST.mjs +4 -2
  141. package/src/decorators/ctrl/http/PUT.cjs +4 -2
  142. package/src/decorators/ctrl/http/PUT.mjs +4 -2
  143. package/src/decorators/di/Configurable.cjs +3 -1
  144. package/src/decorators/di/Configurable.mjs +3 -1
  145. package/src/decorators/di/Inject.cjs +11 -9
  146. package/src/decorators/di/Inject.mjs +10 -8
  147. package/src/decorators/dto/Accept.cjs +3 -1
  148. package/src/decorators/dto/Accept.mjs +3 -1
  149. package/src/decorators/dto/Expect.cjs +3 -1
  150. package/src/decorators/dto/Expect.mjs +3 -1
  151. package/src/decorators/dto/IndexSignature.cjs +3 -1
  152. package/src/decorators/dto/IndexSignature.mjs +3 -1
  153. package/src/decorators/dto/Return.cjs +3 -1
  154. package/src/decorators/dto/Return.mjs +3 -1
  155. package/src/decorators/orm/AfterInsert.cjs +11 -5
  156. package/src/decorators/orm/AfterInsert.mjs +17 -11
  157. package/src/decorators/orm/AfterLoad.cjs +15 -9
  158. package/src/decorators/orm/AfterLoad.mjs +20 -14
  159. package/src/decorators/orm/AfterRecover.cjs +15 -9
  160. package/src/decorators/orm/AfterRecover.mjs +16 -10
  161. package/src/decorators/orm/AfterRemove.cjs +15 -9
  162. package/src/decorators/orm/AfterRemove.mjs +16 -10
  163. package/src/decorators/orm/AfterSoftRemove.cjs +11 -5
  164. package/src/decorators/orm/AfterSoftRemove.mjs +16 -10
  165. package/src/decorators/orm/AfterUpdate.cjs +11 -5
  166. package/src/decorators/orm/AfterUpdate.mjs +18 -12
  167. package/src/decorators/orm/BeforeInsert.cjs +17 -11
  168. package/src/decorators/orm/BeforeInsert.mjs +15 -9
  169. package/src/decorators/orm/BeforeRecover.cjs +18 -12
  170. package/src/decorators/orm/BeforeRecover.mjs +13 -7
  171. package/src/decorators/orm/BeforeRemove.cjs +18 -12
  172. package/src/decorators/orm/BeforeRemove.mjs +13 -7
  173. package/src/decorators/orm/BeforeSoftRemove.cjs +17 -11
  174. package/src/decorators/orm/BeforeSoftRemove.mjs +13 -7
  175. package/src/decorators/orm/BeforeUpdate.cjs +15 -9
  176. package/src/decorators/orm/BeforeUpdate.mjs +16 -10
  177. package/src/decorators/orm/Check.cjs +11 -5
  178. package/src/decorators/orm/Check.mjs +11 -5
  179. package/src/decorators/orm/ChildEntity.cjs +16 -10
  180. package/src/decorators/orm/ChildEntity.mjs +13 -7
  181. package/src/decorators/orm/Column.cjs +28 -22
  182. package/src/decorators/orm/Column.mjs +11 -5
  183. package/src/decorators/orm/CreateDateColumn.cjs +13 -7
  184. package/src/decorators/orm/CreateDateColumn.mjs +11 -5
  185. package/src/decorators/orm/DeleteDateColumn.cjs +13 -7
  186. package/src/decorators/orm/DeleteDateColumn.mjs +11 -5
  187. package/src/decorators/orm/Entity.cjs +15 -9
  188. package/src/decorators/orm/Entity.mjs +17 -11
  189. package/src/decorators/orm/EventSubscriber.cjs +11 -5
  190. package/src/decorators/orm/EventSubscriber.mjs +11 -5
  191. package/src/decorators/orm/Exclusion.cjs +11 -5
  192. package/src/decorators/orm/Exclusion.mjs +17 -11
  193. package/src/decorators/orm/Generated.cjs +13 -7
  194. package/src/decorators/orm/Generated.mjs +17 -11
  195. package/src/decorators/orm/Index.cjs +19 -13
  196. package/src/decorators/orm/Index.mjs +29 -23
  197. package/src/decorators/orm/JoinColumn.cjs +15 -9
  198. package/src/decorators/orm/JoinColumn.mjs +11 -5
  199. package/src/decorators/orm/JoinTable.cjs +11 -5
  200. package/src/decorators/orm/JoinTable.mjs +15 -9
  201. package/src/decorators/orm/ManyToMany.cjs +18 -12
  202. package/src/decorators/orm/ManyToMany.mjs +22 -16
  203. package/src/decorators/orm/ManyToOne.cjs +21 -15
  204. package/src/decorators/orm/ManyToOne.mjs +22 -16
  205. package/src/decorators/orm/ObjectIdColumn.cjs +11 -5
  206. package/src/decorators/orm/ObjectIdColumn.mjs +17 -11
  207. package/src/decorators/orm/OneToMany.cjs +19 -13
  208. package/src/decorators/orm/OneToMany.mjs +11 -5
  209. package/src/decorators/orm/OneToOne.cjs +20 -14
  210. package/src/decorators/orm/OneToOne.mjs +18 -12
  211. package/src/decorators/orm/PrimaryColumn.cjs +15 -9
  212. package/src/decorators/orm/PrimaryColumn.mjs +30 -24
  213. package/src/decorators/orm/PrimaryGeneratedColumn.cjs +11 -5
  214. package/src/decorators/orm/PrimaryGeneratedColumn.mjs +13 -7
  215. package/src/decorators/orm/RelationId.cjs +16 -10
  216. package/src/decorators/orm/RelationId.mjs +17 -11
  217. package/src/decorators/orm/TableInheritance.cjs +13 -7
  218. package/src/decorators/orm/TableInheritance.mjs +15 -9
  219. package/src/decorators/orm/Tree.cjs +11 -5
  220. package/src/decorators/orm/Tree.mjs +11 -5
  221. package/src/decorators/orm/TreeChildren.cjs +11 -5
  222. package/src/decorators/orm/TreeChildren.mjs +22 -16
  223. package/src/decorators/orm/TreeLevelColumn.cjs +11 -5
  224. package/src/decorators/orm/TreeLevelColumn.mjs +11 -5
  225. package/src/decorators/orm/TreeParent.cjs +17 -11
  226. package/src/decorators/orm/TreeParent.mjs +11 -5
  227. package/src/decorators/orm/Unique.cjs +18 -12
  228. package/src/decorators/orm/Unique.mjs +11 -5
  229. package/src/decorators/orm/UpdateDateColumn.cjs +13 -7
  230. package/src/decorators/orm/UpdateDateColumn.mjs +17 -11
  231. package/src/decorators/orm/VersionColumn.cjs +11 -5
  232. package/src/decorators/orm/VersionColumn.mjs +11 -5
  233. package/src/decorators/orm/ViewColumn.cjs +11 -5
  234. package/src/decorators/orm/ViewColumn.mjs +11 -5
  235. package/src/decorators/orm/ViewEntity.cjs +13 -7
  236. package/src/decorators/orm/ViewEntity.mjs +11 -5
  237. package/src/decorators/orm/VirtualColumn.cjs +11 -5
  238. package/src/decorators/orm/VirtualColumn.mjs +15 -9
  239. package/src/lib/base/BaseObject.cjs +3 -1
  240. package/src/lib/base/BaseObject.mjs +3 -1
  241. package/src/lib/base/Context.cjs +3 -1
  242. package/src/lib/base/Context.mjs +3 -1
  243. package/src/lib/base/internal/ApplicationConfigLoader.cjs +3 -1
  244. package/src/lib/base/internal/ApplicationConfigLoader.mjs +3 -1
  245. package/src/lib/base/internal/ControllerEntrypoint.cjs +1 -1
  246. package/src/lib/base/internal/ControllerEntrypoint.mjs +1 -1
  247. package/src/lib/base/internal/DataValidator.cjs +16 -14
  248. package/src/lib/base/internal/DataValidator.mjs +3 -1
  249. package/src/lib/base/internal/FlexibleDTO.cjs +3 -1
  250. package/src/lib/base/internal/FlexibleDTO.mjs +3 -1
  251. package/src/lib/base/internal/MethodValidation.cjs +18 -16
  252. package/src/lib/base/internal/MethodValidation.mjs +3 -1
  253. package/src/lib/base/internal/ModuleConfigLoader.cjs +3 -1
  254. package/src/lib/base/internal/ModuleConfigLoader.mjs +24 -22
  255. package/src/lib/base/internal/ObjectConfiguration.cjs +3 -1
  256. package/src/lib/base/internal/ObjectConfiguration.mjs +3 -1
  257. package/src/lib/base/internal/ObjectSchemaValidation.cjs +3 -1
  258. package/src/lib/base/internal/ObjectSchemaValidation.mjs +3 -1
  259. package/src/lib/base/internal/ObjectType.cjs +3 -1
  260. package/src/lib/base/internal/ObjectType.mjs +3 -1
  261. package/src/lib/context/CLIContext.cjs +3 -1
  262. package/src/lib/context/CLIContext.mjs +3 -1
  263. package/src/lib/context/HTTPContext.cjs +3 -1
  264. package/src/lib/context/HTTPContext.mjs +3 -1
  265. package/src/lib/context/ServiceContext.cjs +3 -1
  266. package/src/lib/context/ServiceContext.mjs +3 -1
  267. package/src/lib/core/Application.cjs +19 -13
  268. package/src/lib/core/Application.mjs +15 -9
  269. package/src/lib/core/Component.cjs +3 -1
  270. package/src/lib/core/Component.mjs +3 -1
  271. package/src/lib/core/Container.cjs +2 -0
  272. package/src/lib/core/Container.mjs +2 -0
  273. package/src/lib/core/DTO.cjs +3 -1
  274. package/src/lib/core/DTO.mjs +3 -1
  275. package/src/lib/core/Module.cjs +4 -2
  276. package/src/lib/core/Module.mjs +4 -2
  277. package/src/lib/core/Provider.cjs +3 -1
  278. package/src/lib/core/Provider.mjs +3 -1
  279. package/src/lib/helpers/IsSymbol.cjs +3 -1
  280. package/src/lib/helpers/IsSymbol.mjs +3 -1
  281. package/src/lib/helpers/NonceStr.cjs +1 -1
  282. package/src/lib/helpers/NonceStr.mjs +1 -1
  283. package/src/lib/helpers/ObjectHash.cjs +1 -1
  284. package/src/lib/helpers/ObjectHash.mjs +1 -1
  285. package/src/lib/helpers/RandomString.cjs +1 -1
  286. package/src/lib/helpers/RandomString.mjs +1 -1
  287. package/src/lib/ioc/DependencyInjectionContainer.cjs +3 -1
  288. package/src/lib/ioc/DependencyInjectionContainer.mjs +13 -11
  289. package/src/lib/ioc/Errors.cjs +3 -1
  290. package/src/lib/ioc/Errors.mjs +3 -1
  291. package/src/lib/ioc/ListModules.cjs +104 -102
  292. package/src/lib/ioc/ListModules.mjs +4 -2
  293. package/src/lib/ioc/LoadModules.cjs +2 -0
  294. package/src/lib/ioc/LoadModules.mjs +2 -0
  295. package/src/lib/ioc/Resolvers.cjs +9 -7
  296. package/src/lib/ioc/Resolvers.mjs +3 -1
  297. package/src/lib/ioc/Utils.cjs +3 -1
  298. package/src/lib/ioc/Utils.mjs +3 -1
  299. package/src/lib/validation/VLD.cjs +3 -1
  300. package/src/lib/validation/VLD.mjs +3 -1
  301. package/src/options/ApplicationOptions.cjs +3 -1
  302. package/src/options/ApplicationOptions.mjs +3 -1
  303. package/src/options/LoadAnonymousObjectOptions.cjs +3 -1
  304. package/src/options/LoadAnonymousObjectOptions.mjs +3 -1
  305. package/src/options/LoadNamedObjectOptions.cjs +3 -1
  306. package/src/options/LoadNamedObjectOptions.mjs +3 -1
  307. package/src/options/LoadObjectOptions.cjs +3 -1
  308. package/src/options/LoadObjectOptions.mjs +3 -1
  309. package/src/options/ModuleLoadObjectsOptions.cjs +3 -1
  310. package/src/options/ModuleLoadObjectsOptions.mjs +3 -1
  311. package/src/options/ModuleOptions.cjs +3 -1
  312. package/src/options/ModuleOptions.mjs +3 -1
  313. package/src/options/OverridableNamedObjectOptions.cjs +3 -1
  314. package/src/options/OverridableNamedObjectOptions.mjs +3 -1
  315. package/src/options/OverridableObjectOptions.cjs +3 -1
  316. package/src/options/OverridableObjectOptions.mjs +3 -1
  317. package/src/providers/Database.cjs +11 -5
  318. package/src/providers/Database.mjs +11 -5
  319. package/src/providers/PasswordHash.cjs +17 -15
  320. package/src/providers/PasswordHash.mjs +212 -210
  321. package/vendor/Package.10.cjs +0 -2
  322. package/vendor/Package.10.mjs +0 -2
  323. package/vendor/Package.11.cjs +1 -9
  324. package/vendor/Package.11.mjs +1 -9
  325. package/vendor/Package.12.cjs +5 -79
  326. package/vendor/Package.12.mjs +5 -73
  327. package/vendor/{Package.112.cjs → Package.122.cjs} +5501 -5501
  328. package/vendor/{Package.112.mjs → Package.122.mjs} +5507 -5507
  329. package/vendor/Package.13.cjs +7 -1
  330. package/vendor/Package.13.mjs +7 -1
  331. package/vendor/Package.132.cjs +87 -0
  332. package/vendor/Package.132.mjs +79 -0
  333. package/vendor/Package.14.cjs +1 -14055
  334. package/vendor/Package.14.mjs +1 -14029
  335. package/vendor/Package.15.cjs +1 -48245
  336. package/vendor/Package.15.mjs +1 -48209
  337. package/vendor/Package.16.cjs +14063 -0
  338. package/vendor/Package.16.mjs +14035 -0
  339. package/vendor/Package.17.cjs +3 -0
  340. package/vendor/Package.17.mjs +1 -0
  341. package/vendor/Package.18.cjs +48255 -0
  342. package/vendor/Package.18.mjs +48215 -0
  343. package/vendor/Package.19.cjs +3 -0
  344. package/vendor/Package.19.mjs +1 -0
  345. package/vendor/Package.610.cjs +175 -0
  346. package/vendor/Package.610.mjs +157 -0
  347. package/vendor/Package.611.cjs +196 -0
  348. package/vendor/Package.611.mjs +180 -0
  349. package/vendor/Package.62.cjs +1 -1
  350. package/vendor/Package.62.mjs +1 -1
  351. package/vendor/Package.65.cjs +716 -0
  352. package/vendor/Package.65.mjs +710 -0
  353. package/vendor/Package.66.cjs +680 -0
  354. package/vendor/Package.66.mjs +652 -0
  355. package/vendor/Package.67.cjs +143 -0
  356. package/vendor/Package.67.mjs +127 -0
  357. package/vendor/Package.68.cjs +341 -0
  358. package/vendor/Package.68.mjs +327 -0
  359. package/vendor/Package.69.cjs +157 -0
  360. package/vendor/Package.69.mjs +139 -0
@@ -0,0 +1,652 @@
1
+ import { createClient as t, createCluster as e } from "@redis/client";
2
+
3
+ export { createClient, createCluster } from "@redis/client";
4
+
5
+ import { K as s } from "./Package.65.mjs";
6
+
7
+ import r from "cluster-key-slot";
8
+
9
+ import "buffer";
10
+
11
+ var i = class {
12
+ _eventListeners;
13
+ _maxListeners;
14
+ _logger;
15
+ constructor(t) {
16
+ this._eventListeners = new Map, this._maxListeners = 100, this._logger = t?.logger;
17
+ }
18
+ once(t, e) {
19
+ let s = (...r) => {
20
+ this.off(t, s), e(...r);
21
+ };
22
+ return this.on(t, s), this;
23
+ }
24
+ listenerCount(t) {
25
+ if (!t) return this.getAllListeners().length;
26
+ let e = this._eventListeners.get(t);
27
+ return e ? e.length : 0;
28
+ }
29
+ eventNames() {
30
+ return [ ...this._eventListeners.keys() ];
31
+ }
32
+ rawListeners(t) {
33
+ return t ? this._eventListeners.get(t) ?? [] : this.getAllListeners();
34
+ }
35
+ prependListener(t, e) {
36
+ let s = this._eventListeners.get(t) ?? [];
37
+ return s.unshift(e), this._eventListeners.set(t, s), this;
38
+ }
39
+ prependOnceListener(t, e) {
40
+ let s = (...r) => {
41
+ this.off(t, s), e(...r);
42
+ };
43
+ return this.prependListener(t, s), this;
44
+ }
45
+ maxListeners() {
46
+ return this._maxListeners;
47
+ }
48
+ addListener(t, e) {
49
+ return this.on(t, e), this;
50
+ }
51
+ on(t, e) {
52
+ this._eventListeners.has(t) || this._eventListeners.set(t, []);
53
+ let s = this._eventListeners.get(t);
54
+ return s && (s.length >= this._maxListeners && console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${s.length + 1} ${t} listeners added. Use setMaxListeners() to increase limit.`),
55
+ s.push(e)), this;
56
+ }
57
+ removeListener(t, e) {
58
+ return this.off(t, e), this;
59
+ }
60
+ off(t, e) {
61
+ let s = this._eventListeners.get(t) ?? [], r = s.indexOf(e);
62
+ return r !== -1 && s.splice(r, 1), s.length === 0 && this._eventListeners.delete(t),
63
+ this;
64
+ }
65
+ emit(t, ...e) {
66
+ let s = !1, r = this._eventListeners.get(t);
67
+ if (r && r.length > 0) for (let t of r) t(...e), s = !0;
68
+ return s;
69
+ }
70
+ listeners(t) {
71
+ return this._eventListeners.get(t) ?? [];
72
+ }
73
+ removeAllListeners(t) {
74
+ return t ? this._eventListeners.delete(t) : this._eventListeners.clear(), this;
75
+ }
76
+ setMaxListeners(t) {
77
+ this._maxListeners = t;
78
+ for (let e of this._eventListeners.values()) e.length > t && e.splice(t);
79
+ }
80
+ getAllListeners() {
81
+ let t = new Array;
82
+ for (let e of this._eventListeners.values()) t = [ ...t, ...e ];
83
+ return t;
84
+ }
85
+ };
86
+
87
+ var n = class extends i {
88
+ _hooks;
89
+ _throwHookErrors=!1;
90
+ constructor(t) {
91
+ super({
92
+ logger: t?.logger
93
+ }), this._hooks = new Map, t?.throwHookErrors !== void 0 && (this._throwHookErrors = t.throwHookErrors);
94
+ }
95
+ get hooks() {
96
+ return this._hooks;
97
+ }
98
+ get throwHookErrors() {
99
+ return this._throwHookErrors;
100
+ }
101
+ set throwHookErrors(t) {
102
+ this._throwHookErrors = t;
103
+ }
104
+ get logger() {
105
+ return this._logger;
106
+ }
107
+ set logger(t) {
108
+ this._logger = t;
109
+ }
110
+ onHook(t, e) {
111
+ let s = this._hooks.get(t);
112
+ s ? s.push(e) : this._hooks.set(t, [ e ]);
113
+ }
114
+ addHook(t, e) {
115
+ this.onHook(t, e);
116
+ }
117
+ onHooks(t) {
118
+ for (let e of t) this.onHook(e.event, e.handler);
119
+ }
120
+ prependHook(t, e) {
121
+ let s = this._hooks.get(t);
122
+ s ? s.unshift(e) : this._hooks.set(t, [ e ]);
123
+ }
124
+ prependOnceHook(t, e) {
125
+ let s = async (...r) => (this.removeHook(t, s), e(...r));
126
+ this.prependHook(t, s);
127
+ }
128
+ onceHook(t, e) {
129
+ let s = async (...r) => (this.removeHook(t, s), e(...r));
130
+ this.onHook(t, s);
131
+ }
132
+ removeHook(t, e) {
133
+ let s = this._hooks.get(t);
134
+ if (s) {
135
+ let t = s.indexOf(e);
136
+ t !== -1 && s.splice(t, 1);
137
+ }
138
+ }
139
+ removeHooks(t) {
140
+ for (let e of t) this.removeHook(e.event, e.handler);
141
+ }
142
+ async hook(t, ...e) {
143
+ let s = this._hooks.get(t);
144
+ if (s) for (let r of s) try {
145
+ await r(...e);
146
+ } catch (e) {
147
+ let s = `${t}: ${e.message}`;
148
+ if (this.emit("error", new Error(s)), this._logger && this._logger.error(s), this._throwHookErrors) throw new Error(s);
149
+ }
150
+ }
151
+ async callHook(t, ...e) {
152
+ await this.hook(t, ...e);
153
+ }
154
+ getHooks(t) {
155
+ return this._hooks.get(t);
156
+ }
157
+ clearHooks() {
158
+ this._hooks.clear();
159
+ }
160
+ };
161
+
162
+ var o = (t => {
163
+ t["RedisClientNotConnectedThrown"] = "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.";
164
+ return t;
165
+ })(o || {});
166
+
167
+ var a = t => {
168
+ const e = Math.min(2 ** t * 100, 2e3);
169
+ const s = (Math.random() - .5) * 100;
170
+ return e + s;
171
+ };
172
+
173
+ var c = class extends n {
174
+ _client=t();
175
+ _namespace;
176
+ _keyPrefixSeparator="::";
177
+ _clearBatchSize=1e3;
178
+ _useUnlink=true;
179
+ _noNamespaceAffectsAll=false;
180
+ _throwOnConnectError=true;
181
+ _throwErrors=false;
182
+ _connectionTimeout;
183
+ constructor(s, r) {
184
+ super();
185
+ const i = {
186
+ reconnectStrategy: a
187
+ };
188
+ if (s) {
189
+ if (typeof s === "string") {
190
+ this._client = t({
191
+ url: s,
192
+ socket: i
193
+ });
194
+ } else if (s.connect !== void 0) {
195
+ this._client = this.isClientCluster(s) ? s : s;
196
+ } else if (s instanceof Object) {
197
+ this._client = s.rootNodes === void 0 ? t(s) : e(s);
198
+ }
199
+ }
200
+ this.setOptions(r);
201
+ this.initClient();
202
+ }
203
+ get client() {
204
+ return this._client;
205
+ }
206
+ set client(t) {
207
+ this._client = t;
208
+ this.initClient();
209
+ }
210
+ get opts() {
211
+ let t = "redis://localhost:6379";
212
+ if (this._client.options) {
213
+ const e = this._client.options?.url;
214
+ if (e) {
215
+ t = e;
216
+ }
217
+ }
218
+ const e = {
219
+ namespace: this._namespace,
220
+ keyPrefixSeparator: this._keyPrefixSeparator,
221
+ clearBatchSize: this._clearBatchSize,
222
+ noNamespaceAffectsAll: this._noNamespaceAffectsAll,
223
+ useUnlink: this._useUnlink,
224
+ throwOnConnectError: this._throwOnConnectError,
225
+ throwErrors: this._throwErrors,
226
+ connectionTimeout: this._connectionTimeout,
227
+ dialect: "redis",
228
+ url: t
229
+ };
230
+ return e;
231
+ }
232
+ set opts(t) {
233
+ this.setOptions(t);
234
+ }
235
+ get namespace() {
236
+ return this._namespace;
237
+ }
238
+ set namespace(t) {
239
+ this._namespace = t;
240
+ }
241
+ get keyPrefixSeparator() {
242
+ return this._keyPrefixSeparator;
243
+ }
244
+ set keyPrefixSeparator(t) {
245
+ this._keyPrefixSeparator = t;
246
+ }
247
+ get clearBatchSize() {
248
+ return this._clearBatchSize;
249
+ }
250
+ set clearBatchSize(t) {
251
+ if (t > 0) {
252
+ this._clearBatchSize = t;
253
+ } else {
254
+ this.emit("error", "clearBatchSize must be greater than 0");
255
+ }
256
+ }
257
+ get useUnlink() {
258
+ return this._useUnlink;
259
+ }
260
+ set useUnlink(t) {
261
+ this._useUnlink = t;
262
+ }
263
+ get noNamespaceAffectsAll() {
264
+ return this._noNamespaceAffectsAll;
265
+ }
266
+ set noNamespaceAffectsAll(t) {
267
+ this._noNamespaceAffectsAll = t;
268
+ }
269
+ get throwOnConnectError() {
270
+ return this._throwOnConnectError;
271
+ }
272
+ set throwOnConnectError(t) {
273
+ this._throwOnConnectError = t;
274
+ }
275
+ get throwErrors() {
276
+ return this._throwErrors;
277
+ }
278
+ set throwErrors(t) {
279
+ this._throwErrors = t;
280
+ }
281
+ get connectionTimeout() {
282
+ return this._connectionTimeout;
283
+ }
284
+ set connectionTimeout(t) {
285
+ this._connectionTimeout = t;
286
+ }
287
+ async getClient() {
288
+ if (this._client.isOpen) {
289
+ return this._client;
290
+ }
291
+ try {
292
+ if (this._connectionTimeout === void 0) {
293
+ await this._client.connect();
294
+ } else {
295
+ await Promise.race([ this._client.connect(), this.createTimeoutPromise(this._connectionTimeout) ]);
296
+ }
297
+ } catch (t) {
298
+ this.emit("error", t);
299
+ if (this._throwOnConnectError) {
300
+ throw new Error("Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.");
301
+ }
302
+ await this.disconnect(true);
303
+ }
304
+ this.initClient();
305
+ return this._client;
306
+ }
307
+ async set(t, e, s) {
308
+ const r = await this.getClient();
309
+ try {
310
+ t = this.createKeyPrefix(t, this._namespace);
311
+ if (s) {
312
+ await r.set(t, e, {
313
+ PX: s
314
+ });
315
+ } else {
316
+ await r.set(t, e);
317
+ }
318
+ } catch (t) {
319
+ this.emit("error", t);
320
+ if (this._throwErrors) {
321
+ throw t;
322
+ }
323
+ }
324
+ }
325
+ async setMany(t) {
326
+ const e = await this.getClient();
327
+ try {
328
+ const s = e.multi();
329
+ for (const {key: e, value: r, ttl: i} of t) {
330
+ const t = this.createKeyPrefix(e, this._namespace);
331
+ if (i) {
332
+ s.set(t, r, {
333
+ PX: i
334
+ });
335
+ } else {
336
+ s.set(t, r);
337
+ }
338
+ }
339
+ await s.exec();
340
+ } catch (t) {
341
+ this.emit("error", t);
342
+ if (this._throwErrors) {
343
+ throw t;
344
+ }
345
+ }
346
+ }
347
+ async has(t) {
348
+ const e = await this.getClient();
349
+ try {
350
+ t = this.createKeyPrefix(t, this._namespace);
351
+ const s = await e.exists(t);
352
+ return s === 1;
353
+ } catch (t) {
354
+ this.emit("error", t);
355
+ if (this._throwErrors) {
356
+ throw t;
357
+ }
358
+ return false;
359
+ }
360
+ }
361
+ async hasMany(t) {
362
+ const e = await this.getClient();
363
+ try {
364
+ const s = e.multi();
365
+ for (const e of t) {
366
+ const t = this.createKeyPrefix(e, this._namespace);
367
+ s.exists(t);
368
+ }
369
+ const r = await s.exec();
370
+ return r.map((t => t === 1));
371
+ } catch (e) {
372
+ this.emit("error", e);
373
+ if (this._throwErrors) {
374
+ throw e;
375
+ }
376
+ return Array.from({
377
+ length: t.length
378
+ }).fill(false);
379
+ }
380
+ }
381
+ async get(t) {
382
+ const e = await this.getClient();
383
+ try {
384
+ t = this.createKeyPrefix(t, this._namespace);
385
+ const s = await e.get(t);
386
+ if (s === null) {
387
+ return void 0;
388
+ }
389
+ return s;
390
+ } catch (t) {
391
+ this.emit("error", t);
392
+ if (this._throwErrors) {
393
+ throw t;
394
+ }
395
+ return void 0;
396
+ }
397
+ }
398
+ async getMany(t) {
399
+ if (t.length === 0) {
400
+ return [];
401
+ }
402
+ t = t.map((t => this.createKeyPrefix(t, this._namespace)));
403
+ try {
404
+ const e = await this.mget(t);
405
+ return e;
406
+ } catch (e) {
407
+ this.emit("error", e);
408
+ if (this._throwErrors) {
409
+ throw e;
410
+ }
411
+ return Array.from({
412
+ length: t.length
413
+ }).fill(void 0);
414
+ }
415
+ }
416
+ async delete(t) {
417
+ const e = await this.getClient();
418
+ try {
419
+ t = this.createKeyPrefix(t, this._namespace);
420
+ let s = 0;
421
+ s = await (this._useUnlink ? e.unlink(t) : e.del(t));
422
+ return s > 0;
423
+ } catch (t) {
424
+ this.emit("error", t);
425
+ if (this._throwErrors) {
426
+ throw t;
427
+ }
428
+ return false;
429
+ }
430
+ }
431
+ async deleteMany(t) {
432
+ let e = false;
433
+ const s = await this.getClient();
434
+ try {
435
+ const r = s.multi();
436
+ for (const e of t) {
437
+ const t = this.createKeyPrefix(e, this._namespace);
438
+ if (this._useUnlink) {
439
+ r.unlink(t);
440
+ } else {
441
+ r.del(t);
442
+ }
443
+ }
444
+ const i = await r.exec();
445
+ for (const t of i) {
446
+ if (typeof t === "number" && t > 0) {
447
+ e = true;
448
+ }
449
+ }
450
+ } catch (t) {
451
+ this.emit("error", t);
452
+ if (this._throwErrors) {
453
+ throw t;
454
+ }
455
+ }
456
+ return e;
457
+ }
458
+ async disconnect(t) {
459
+ if (this._client.isOpen) {
460
+ await (t ? this._client.disconnect() : this._client.quit());
461
+ }
462
+ }
463
+ createKeyPrefix(t, e) {
464
+ if (e) {
465
+ return `${e}${this._keyPrefixSeparator}${t}`;
466
+ }
467
+ return t;
468
+ }
469
+ getKeyWithoutPrefix(t, e) {
470
+ if (e) {
471
+ return t.replace(`${e}${this._keyPrefixSeparator}`, "");
472
+ }
473
+ return t;
474
+ }
475
+ isCluster() {
476
+ return this.isClientCluster(this._client);
477
+ }
478
+ async getMasterNodes() {
479
+ if (this.isCluster()) {
480
+ const t = await this.getClient();
481
+ return Promise.all(t.masters.map((async e => t.nodeClient(e))));
482
+ }
483
+ return [ await this.getClient() ];
484
+ }
485
+ async* iterator(t) {
486
+ const e = await this.getMasterNodes();
487
+ for (const s of e) {
488
+ const e = t ? `${t}${this._keyPrefixSeparator}*` : "*";
489
+ let r = "0";
490
+ do {
491
+ const i = await s.scan(Number.parseInt(r, 10), {
492
+ MATCH: e,
493
+ TYPE: "string"
494
+ });
495
+ r = i.cursor.toString();
496
+ let {keys: n} = i;
497
+ if (!t && !this._noNamespaceAffectsAll) {
498
+ n = n.filter((t => !t.includes(this._keyPrefixSeparator)));
499
+ }
500
+ if (n.length > 0) {
501
+ const e = await this.mget(n);
502
+ for (const s of n.keys()) {
503
+ const r = this.getKeyWithoutPrefix(n[s], t);
504
+ const i = e[s];
505
+ yield [ r, i ];
506
+ }
507
+ }
508
+ } while (r !== "0");
509
+ }
510
+ }
511
+ async clear() {
512
+ try {
513
+ const t = await this.getMasterNodes();
514
+ await Promise.all(t.map((async t => {
515
+ if (!this._namespace && this._noNamespaceAffectsAll) {
516
+ await t.flushDb();
517
+ return;
518
+ }
519
+ let e = "0";
520
+ const s = this._clearBatchSize;
521
+ const r = this._namespace ? `${this._namespace}${this._keyPrefixSeparator}*` : "*";
522
+ const i = [];
523
+ do {
524
+ const n = await t.scan(Number.parseInt(e, 10), {
525
+ MATCH: r,
526
+ COUNT: s,
527
+ TYPE: "string"
528
+ });
529
+ e = n.cursor.toString();
530
+ let {keys: o} = n;
531
+ if (o.length === 0) {
532
+ continue;
533
+ }
534
+ if (!this._namespace) {
535
+ o = o.filter((t => !t.includes(this._keyPrefixSeparator)));
536
+ }
537
+ i.push(this.clearWithClusterSupport(o));
538
+ } while (e !== "0");
539
+ await Promise.all(i);
540
+ })));
541
+ } catch (t) {
542
+ this.emit("error", t);
543
+ }
544
+ }
545
+ async mget(t) {
546
+ const e = this.getSlotMap(t);
547
+ const s = new Map;
548
+ await Promise.all(Array.from(e.entries(), (async ([t, e]) => {
549
+ const r = await this.getSlotMaster(t);
550
+ const i = await r.mGet(e);
551
+ for (const [t, r] of i.entries()) {
552
+ s.set(e[t], r ?? void 0);
553
+ }
554
+ })));
555
+ return t.map((t => s.get(t)));
556
+ }
557
+ async clearWithClusterSupport(t) {
558
+ if (t.length > 0) {
559
+ const e = this.getSlotMap(t);
560
+ await Promise.all(Array.from(e.entries(), (async ([t, e]) => {
561
+ const s = await this.getSlotMaster(t);
562
+ return this._useUnlink ? s.unlink(e) : s.del(e);
563
+ })));
564
+ }
565
+ }
566
+ async getSlotMaster(t) {
567
+ const e = await this.getClient();
568
+ if (this.isCluster()) {
569
+ const s = e;
570
+ const r = s.slots[t].master;
571
+ return s.nodeClient(r);
572
+ }
573
+ return e;
574
+ }
575
+ getSlotMap(t) {
576
+ const e = new Map;
577
+ if (this.isCluster()) {
578
+ for (const s of t) {
579
+ const t = r(s);
580
+ const i = e.get(t) ?? [];
581
+ i.push(s);
582
+ e.set(t, i);
583
+ }
584
+ } else {
585
+ e.set(0, t);
586
+ }
587
+ return e;
588
+ }
589
+ isClientCluster(t) {
590
+ if (t.options === void 0 && t.scan === void 0) {
591
+ return true;
592
+ }
593
+ return false;
594
+ }
595
+ setOptions(t) {
596
+ if (!t) {
597
+ return;
598
+ }
599
+ if (t.namespace) {
600
+ this._namespace = t.namespace;
601
+ }
602
+ if (t.keyPrefixSeparator !== void 0) {
603
+ this._keyPrefixSeparator = t.keyPrefixSeparator;
604
+ }
605
+ if (t.clearBatchSize !== void 0 && t.clearBatchSize > 0) {
606
+ this._clearBatchSize = t.clearBatchSize;
607
+ }
608
+ if (t.useUnlink !== void 0) {
609
+ this._useUnlink = t.useUnlink;
610
+ }
611
+ if (t.noNamespaceAffectsAll !== void 0) {
612
+ this._noNamespaceAffectsAll = t.noNamespaceAffectsAll;
613
+ }
614
+ if (t.throwOnConnectError !== void 0) {
615
+ this._throwOnConnectError = t.throwOnConnectError;
616
+ }
617
+ if (t.throwErrors !== void 0) {
618
+ this._throwErrors = t.throwErrors;
619
+ }
620
+ if (t.connectionTimeout !== void 0) {
621
+ this._connectionTimeout = t.connectionTimeout;
622
+ }
623
+ }
624
+ initClient() {
625
+ this._client.on("connect", (() => {
626
+ this.emit("connect", this._client);
627
+ }));
628
+ this._client.on("disconnect", (() => {
629
+ this.emit("disconnect", this._client);
630
+ }));
631
+ this._client.on("reconnecting", (t => {
632
+ this.emit("reconnecting", t);
633
+ }));
634
+ }
635
+ async createTimeoutPromise(t) {
636
+ return new Promise(((e, s) => setTimeout((() => {
637
+ s(new Error(`Redis timed out after ${t}ms`));
638
+ }), t)));
639
+ }
640
+ };
641
+
642
+ function h(t, e) {
643
+ t ??= "redis://localhost:6379";
644
+ const r = new c(t, e);
645
+ const i = new s(r, {
646
+ namespace: e?.namespace,
647
+ useKeyPrefix: false
648
+ });
649
+ return i;
650
+ }
651
+
652
+ export { s as Keyv, o as RedisErrorMessages, h as createKeyv, c as default, a as defaultReconnectStrategy };