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,3 @@
1
+ "use strict";
2
+
3
+ require("constants");
@@ -0,0 +1 @@
1
+ import "constants";
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, {
4
+ value: "Module"
5
+ });
6
+
7
+ const t = require("events");
8
+
9
+ const e = require("./Package.65.cjs");
10
+
11
+ const s = require("pg");
12
+
13
+ require("buffer");
14
+
15
+ const a = t => t && t.__esModule ? t : {
16
+ default: t
17
+ };
18
+
19
+ const i = a(t);
20
+
21
+ const o = a(s);
22
+
23
+ var r;
24
+
25
+ var n;
26
+
27
+ var c = (t, e = {}) => {
28
+ if (n !== t) {
29
+ r = void 0;
30
+ n = t;
31
+ }
32
+ r ??= new o.default.Pool({
33
+ connectionString: t,
34
+ ...e
35
+ });
36
+ return r;
37
+ };
38
+
39
+ var h = async () => {
40
+ await r.end();
41
+ n = void 0;
42
+ };
43
+
44
+ var u = class extends i.default {
45
+ ttlSupport;
46
+ opts;
47
+ query;
48
+ namespace;
49
+ constructor(t) {
50
+ super();
51
+ this.ttlSupport = false;
52
+ if (typeof t === "string") {
53
+ const e = t;
54
+ t = {
55
+ dialect: "postgres",
56
+ uri: e
57
+ };
58
+ } else {
59
+ t = {
60
+ dialect: "postgres",
61
+ uri: "postgresql://localhost:5432",
62
+ ...t
63
+ };
64
+ }
65
+ const e = async () => {
66
+ const e = c(t.uri, t);
67
+ return async (t, s) => {
68
+ const a = await e.query(t, s);
69
+ return a.rows;
70
+ };
71
+ };
72
+ this.opts = {
73
+ table: "keyv",
74
+ schema: "public",
75
+ keySize: 255,
76
+ ...t
77
+ };
78
+ let s = `CREATE${this.opts.useUnloggedTable ? " UNLOGGED " : " "}TABLE IF NOT EXISTS ${this.opts.schema}.${this.opts.table}(key VARCHAR(${Number(this.opts.keySize)}) PRIMARY KEY, value TEXT )`;
79
+ if (this.opts.schema !== "public") {
80
+ s = `CREATE SCHEMA IF NOT EXISTS ${this.opts.schema}; ${s}`;
81
+ }
82
+ const a = e().then((async t => {
83
+ try {
84
+ await t(s);
85
+ } catch (e) {
86
+ if (e.code !== "23505") {
87
+ this.emit("error", e);
88
+ }
89
+ return t;
90
+ }
91
+ return t;
92
+ })).catch((t => this.emit("error", t)));
93
+ this.query = async (t, e) => a.then((s => s(t, e)));
94
+ }
95
+ async get(t) {
96
+ const e = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
97
+ const s = await this.query(e, [ t ]);
98
+ const a = s[0];
99
+ return a === void 0 ? void 0 : a.value;
100
+ }
101
+ async getMany(t) {
102
+ const e = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = ANY($1)`;
103
+ const s = await this.query(e, [ t ]);
104
+ const a = [];
105
+ for (const e of t) {
106
+ const t = s?.findIndex((t => t.key === e));
107
+ a.push(t > -1 ? s[t].value : void 0);
108
+ }
109
+ return a;
110
+ }
111
+ async set(t, e) {
112
+ const s = `INSERT INTO ${this.opts.schema}.${this.opts.table} (key, value)\n VALUES($1, $2) \n ON CONFLICT(key) \n DO UPDATE SET value=excluded.value;`;
113
+ await this.query(s, [ t, e ]);
114
+ }
115
+ async delete(t) {
116
+ const e = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
117
+ const s = `DELETE FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
118
+ const a = await this.query(e, [ t ]);
119
+ if (a[0] === void 0) {
120
+ return false;
121
+ }
122
+ await this.query(s, [ t ]);
123
+ return true;
124
+ }
125
+ async deleteMany(t) {
126
+ const e = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = ANY($1)`;
127
+ const s = `DELETE FROM ${this.opts.schema}.${this.opts.table} WHERE key = ANY($1)`;
128
+ const a = await this.query(e, [ t ]);
129
+ if (a[0] === void 0) {
130
+ return false;
131
+ }
132
+ await this.query(s, [ t ]);
133
+ return true;
134
+ }
135
+ async clear() {
136
+ const t = `DELETE FROM ${this.opts.schema}.${this.opts.table} WHERE key LIKE $1`;
137
+ await this.query(t, [ this.namespace ? `${this.namespace}:%` : "%" ]);
138
+ }
139
+ async* iterator(t) {
140
+ const e = Number.parseInt(String(this.opts.iterationLimit), 10) || 10;
141
+ async function* s(a, i, o) {
142
+ const r = `SELECT * FROM ${i.schema}.${i.table} WHERE key LIKE $1 LIMIT $2 OFFSET $3`;
143
+ const n = await o(r, [ `${t ? t + ":" : ""}%`, e, a ]);
144
+ if (n.length === 0) {
145
+ return;
146
+ }
147
+ for (const t of n) {
148
+ a += 1;
149
+ yield [ t.key, t.value ];
150
+ }
151
+ yield* s(a, i, o);
152
+ }
153
+ yield* s(0, this.opts, this.query);
154
+ }
155
+ async has(t) {
156
+ const e = `SELECT EXISTS ( SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1 )`;
157
+ const s = await this.query(e, [ t ]);
158
+ return s[0].exists;
159
+ }
160
+ async disconnect() {
161
+ await h();
162
+ }
163
+ };
164
+
165
+ var E = t => new e.index_default({
166
+ store: new u(t)
167
+ });
168
+
169
+ var y = u;
170
+
171
+ exports.KeyvPostgres = u;
172
+
173
+ exports.createKeyv = E;
174
+
175
+ exports.default = y;
@@ -0,0 +1,157 @@
1
+ import t from "events";
2
+
3
+ import { i as s } from "./Package.65.mjs";
4
+
5
+ import e from "pg";
6
+
7
+ import "buffer";
8
+
9
+ var a;
10
+
11
+ var i;
12
+
13
+ var o = (t, s = {}) => {
14
+ if (i !== t) {
15
+ a = void 0;
16
+ i = t;
17
+ }
18
+ a ??= new e.Pool({
19
+ connectionString: t,
20
+ ...s
21
+ });
22
+ return a;
23
+ };
24
+
25
+ var r = async () => {
26
+ await a.end();
27
+ i = void 0;
28
+ };
29
+
30
+ var n = class extends t {
31
+ ttlSupport;
32
+ opts;
33
+ query;
34
+ namespace;
35
+ constructor(t) {
36
+ super();
37
+ this.ttlSupport = false;
38
+ if (typeof t === "string") {
39
+ const s = t;
40
+ t = {
41
+ dialect: "postgres",
42
+ uri: s
43
+ };
44
+ } else {
45
+ t = {
46
+ dialect: "postgres",
47
+ uri: "postgresql://localhost:5432",
48
+ ...t
49
+ };
50
+ }
51
+ const s = async () => {
52
+ const s = o(t.uri, t);
53
+ return async (t, e) => {
54
+ const a = await s.query(t, e);
55
+ return a.rows;
56
+ };
57
+ };
58
+ this.opts = {
59
+ table: "keyv",
60
+ schema: "public",
61
+ keySize: 255,
62
+ ...t
63
+ };
64
+ let e = `CREATE${this.opts.useUnloggedTable ? " UNLOGGED " : " "}TABLE IF NOT EXISTS ${this.opts.schema}.${this.opts.table}(key VARCHAR(${Number(this.opts.keySize)}) PRIMARY KEY, value TEXT )`;
65
+ if (this.opts.schema !== "public") {
66
+ e = `CREATE SCHEMA IF NOT EXISTS ${this.opts.schema}; ${e}`;
67
+ }
68
+ const a = s().then((async t => {
69
+ try {
70
+ await t(e);
71
+ } catch (s) {
72
+ if (s.code !== "23505") {
73
+ this.emit("error", s);
74
+ }
75
+ return t;
76
+ }
77
+ return t;
78
+ })).catch((t => this.emit("error", t)));
79
+ this.query = async (t, s) => a.then((e => e(t, s)));
80
+ }
81
+ async get(t) {
82
+ const s = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
83
+ const e = await this.query(s, [ t ]);
84
+ const a = e[0];
85
+ return a === void 0 ? void 0 : a.value;
86
+ }
87
+ async getMany(t) {
88
+ const s = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = ANY($1)`;
89
+ const e = await this.query(s, [ t ]);
90
+ const a = [];
91
+ for (const s of t) {
92
+ const t = e?.findIndex((t => t.key === s));
93
+ a.push(t > -1 ? e[t].value : void 0);
94
+ }
95
+ return a;
96
+ }
97
+ async set(t, s) {
98
+ const e = `INSERT INTO ${this.opts.schema}.${this.opts.table} (key, value)\n VALUES($1, $2) \n ON CONFLICT(key) \n DO UPDATE SET value=excluded.value;`;
99
+ await this.query(e, [ t, s ]);
100
+ }
101
+ async delete(t) {
102
+ const s = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
103
+ const e = `DELETE FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
104
+ const a = await this.query(s, [ t ]);
105
+ if (a[0] === void 0) {
106
+ return false;
107
+ }
108
+ await this.query(e, [ t ]);
109
+ return true;
110
+ }
111
+ async deleteMany(t) {
112
+ const s = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = ANY($1)`;
113
+ const e = `DELETE FROM ${this.opts.schema}.${this.opts.table} WHERE key = ANY($1)`;
114
+ const a = await this.query(s, [ t ]);
115
+ if (a[0] === void 0) {
116
+ return false;
117
+ }
118
+ await this.query(e, [ t ]);
119
+ return true;
120
+ }
121
+ async clear() {
122
+ const t = `DELETE FROM ${this.opts.schema}.${this.opts.table} WHERE key LIKE $1`;
123
+ await this.query(t, [ this.namespace ? `${this.namespace}:%` : "%" ]);
124
+ }
125
+ async* iterator(t) {
126
+ const s = Number.parseInt(String(this.opts.iterationLimit), 10) || 10;
127
+ async function* e(a, i, o) {
128
+ const r = `SELECT * FROM ${i.schema}.${i.table} WHERE key LIKE $1 LIMIT $2 OFFSET $3`;
129
+ const n = await o(r, [ `${t ? t + ":" : ""}%`, s, a ]);
130
+ if (n.length === 0) {
131
+ return;
132
+ }
133
+ for (const t of n) {
134
+ a += 1;
135
+ yield [ t.key, t.value ];
136
+ }
137
+ yield* e(a, i, o);
138
+ }
139
+ yield* e(0, this.opts, this.query);
140
+ }
141
+ async has(t) {
142
+ const s = `SELECT EXISTS ( SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1 )`;
143
+ const e = await this.query(s, [ t ]);
144
+ return e[0].exists;
145
+ }
146
+ async disconnect() {
147
+ await r();
148
+ }
149
+ };
150
+
151
+ var c = t => new s({
152
+ store: new n(t)
153
+ });
154
+
155
+ var h = n;
156
+
157
+ export { n as KeyvPostgres, c as createKeyv, h as default };
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, {
4
+ value: "Module"
5
+ });
6
+
7
+ const t = require("events");
8
+
9
+ const e = require("mysql2");
10
+
11
+ const s = t => t && t.__esModule ? t : {
12
+ default: t
13
+ };
14
+
15
+ const a = s(t);
16
+
17
+ const o = s(e);
18
+
19
+ var n;
20
+
21
+ var i;
22
+
23
+ var r = t => {
24
+ t = t.replace(/#/g, "%23");
25
+ const e = new URL(t);
26
+ const s = {
27
+ user: decodeURIComponent(e.username),
28
+ password: decodeURIComponent(e.password) || void 0,
29
+ host: e.hostname,
30
+ port: e.port ? Number.parseInt(e.port, 10) : void 0,
31
+ database: decodeURIComponent(e.pathname.slice(1))
32
+ };
33
+ for (const t of Object.keys(s)) {
34
+ if (s[t] === void 0) {
35
+ delete s[t];
36
+ }
37
+ }
38
+ return s;
39
+ };
40
+
41
+ var c = (t, e = {}) => {
42
+ if (i !== t) {
43
+ n = void 0;
44
+ i = t;
45
+ }
46
+ const s = r(t);
47
+ const a = {
48
+ ...s,
49
+ ...e
50
+ };
51
+ n ??= o.default.createPool(a);
52
+ return n.promise();
53
+ };
54
+
55
+ var E = () => {
56
+ if (n) {
57
+ n.end();
58
+ }
59
+ i = void 0;
60
+ };
61
+
62
+ var l = new Set([ "adapter", "compression", "connect", "dialect", "keySize", "table", "ttl", "uri" ]);
63
+
64
+ var u = class extends a.default {
65
+ ttlSupport=false;
66
+ opts;
67
+ namespace;
68
+ query;
69
+ constructor(t) {
70
+ super();
71
+ let e = {
72
+ dialect: "mysql",
73
+ uri: "mysql://localhost"
74
+ };
75
+ if (typeof t === "string") {
76
+ e.uri = t;
77
+ } else {
78
+ e = {
79
+ ...e,
80
+ ...t
81
+ };
82
+ }
83
+ if (e.intervalExpiration !== void 0 && e.intervalExpiration > 0) {
84
+ this.ttlSupport = true;
85
+ }
86
+ const s = Object.fromEntries(Object.entries(e).filter((([t]) => !l.has(t))));
87
+ delete s.namespace;
88
+ delete s.serialize;
89
+ delete s.deserialize;
90
+ const a = async () => {
91
+ const t = c(e.uri, s);
92
+ return async e => {
93
+ const s = await t.query(e);
94
+ return s[0];
95
+ };
96
+ };
97
+ this.opts = {
98
+ table: "keyv",
99
+ keySize: 255,
100
+ ...e
101
+ };
102
+ const o = `CREATE TABLE IF NOT EXISTS ${this.opts.table}(id VARCHAR(${Number(this.opts.keySize)}) PRIMARY KEY, value TEXT)`;
103
+ const n = a().then((async t => {
104
+ await t(o);
105
+ if (this.opts.intervalExpiration !== void 0 && this.opts.intervalExpiration > 0) {
106
+ await t("SET GLOBAL event_scheduler = ON;");
107
+ await t("DROP EVENT IF EXISTS keyv_delete_expired_keys;");
108
+ await t(`CREATE EVENT IF NOT EXISTS keyv_delete_expired_keys ON SCHEDULE EVERY ${this.opts.intervalExpiration} SECOND\n\t\t\t\t\tDO DELETE FROM ${this.opts.table}\n\t\t\t\t\tWHERE CAST(value->'$.expires' AS UNSIGNED) BETWEEN 1 AND UNIX_TIMESTAMP(NOW(3)) * 1000;`);
109
+ }
110
+ return t;
111
+ })).catch((t => this.emit("error", t)));
112
+ this.query = async t => {
113
+ const e = await n;
114
+ return e(t);
115
+ };
116
+ }
117
+ async get(t) {
118
+ const e = `SELECT * FROM ${this.opts.table} WHERE id = ?`;
119
+ const s = o.default.format(e, [ t ]);
120
+ const a = await this.query(s);
121
+ const n = a[0];
122
+ return n?.value;
123
+ }
124
+ async getMany(t) {
125
+ const e = `SELECT * FROM ${this.opts.table} WHERE id IN (?)`;
126
+ const s = o.default.format(e, [ t ]);
127
+ const a = await this.query(s);
128
+ const n = [];
129
+ for (const e of t) {
130
+ const t = a.findIndex((t => t.id === e));
131
+ n.push(t === -1 ? void 0 : a[t].value);
132
+ }
133
+ return n;
134
+ }
135
+ async set(t, e) {
136
+ const s = `INSERT INTO ${this.opts.table} (id, value)\n\t\t\tVALUES(?, ?) \n\t\t\tON DUPLICATE KEY UPDATE value=?;`;
137
+ const a = [ t, e, e ];
138
+ const n = o.default.format(s, a);
139
+ return this.query(n);
140
+ }
141
+ async delete(t) {
142
+ const e = `SELECT * FROM ${this.opts.table} WHERE id = ?`;
143
+ const s = o.default.format(e, [ t ]);
144
+ const a = `DELETE FROM ${this.opts.table} WHERE id = ?`;
145
+ const n = o.default.format(a, [ t ]);
146
+ const i = await this.query(s);
147
+ const r = i[0];
148
+ if (r === void 0) {
149
+ return false;
150
+ }
151
+ await this.query(n);
152
+ return true;
153
+ }
154
+ async deleteMany(t) {
155
+ const e = `DELETE FROM ${this.opts.table} WHERE id IN (?)`;
156
+ const s = o.default.format(e, [ t ]);
157
+ const a = await this.query(s);
158
+ return a.affectedRows !== 0;
159
+ }
160
+ async clear() {
161
+ const t = `DELETE FROM ${this.opts.table} WHERE id LIKE ?`;
162
+ const e = o.default.format(t, [ this.namespace ? `${this.namespace}:%` : "%" ]);
163
+ await this.query(e);
164
+ }
165
+ async* iterator(t) {
166
+ const e = Number.parseInt(this.opts.iterationLimit, 10) || 10;
167
+ async function* s(a, n, i) {
168
+ const r = `SELECT * FROM ${n.table} WHERE id LIKE ? LIMIT ? OFFSET ?`;
169
+ const c = o.default.format(r, [ `${t ? t + ":" : ""}%`, e, a ]);
170
+ const E = await i(c);
171
+ if (E.length === 0) {
172
+ return;
173
+ }
174
+ for (const t of E) {
175
+ a += 1;
176
+ yield [ t.id, t.value ];
177
+ }
178
+ yield* s(a, n, i);
179
+ }
180
+ yield* s(0, this.opts, this.query);
181
+ }
182
+ async has(t) {
183
+ const e = `SELECT EXISTS ( SELECT * FROM ${this.opts.table} WHERE id = '${t}' )`;
184
+ const s = await this.query(e);
185
+ return Object.values(s[0])[0] === 1;
186
+ }
187
+ async disconnect() {
188
+ E();
189
+ }
190
+ };
191
+
192
+ var d = u;
193
+
194
+ exports.KeyvMysql = u;
195
+
196
+ exports.default = d;
@@ -0,0 +1,180 @@
1
+ import t from "events";
2
+
3
+ import e from "mysql2";
4
+
5
+ var s;
6
+
7
+ var a;
8
+
9
+ var o = t => {
10
+ t = t.replace(/#/g, "%23");
11
+ const e = new URL(t);
12
+ const s = {
13
+ user: decodeURIComponent(e.username),
14
+ password: decodeURIComponent(e.password) || void 0,
15
+ host: e.hostname,
16
+ port: e.port ? Number.parseInt(e.port, 10) : void 0,
17
+ database: decodeURIComponent(e.pathname.slice(1))
18
+ };
19
+ for (const t of Object.keys(s)) {
20
+ if (s[t] === void 0) {
21
+ delete s[t];
22
+ }
23
+ }
24
+ return s;
25
+ };
26
+
27
+ var i = (t, i = {}) => {
28
+ if (a !== t) {
29
+ s = void 0;
30
+ a = t;
31
+ }
32
+ const n = o(t);
33
+ const r = {
34
+ ...n,
35
+ ...i
36
+ };
37
+ s ??= e.createPool(r);
38
+ return s.promise();
39
+ };
40
+
41
+ var n = () => {
42
+ if (s) {
43
+ s.end();
44
+ }
45
+ a = void 0;
46
+ };
47
+
48
+ var r = new Set([ "adapter", "compression", "connect", "dialect", "keySize", "table", "ttl", "uri" ]);
49
+
50
+ var c = class extends t {
51
+ ttlSupport=false;
52
+ opts;
53
+ namespace;
54
+ query;
55
+ constructor(t) {
56
+ super();
57
+ let e = {
58
+ dialect: "mysql",
59
+ uri: "mysql://localhost"
60
+ };
61
+ if (typeof t === "string") {
62
+ e.uri = t;
63
+ } else {
64
+ e = {
65
+ ...e,
66
+ ...t
67
+ };
68
+ }
69
+ if (e.intervalExpiration !== void 0 && e.intervalExpiration > 0) {
70
+ this.ttlSupport = true;
71
+ }
72
+ const s = Object.fromEntries(Object.entries(e).filter((([t]) => !r.has(t))));
73
+ delete s.namespace;
74
+ delete s.serialize;
75
+ delete s.deserialize;
76
+ const a = async () => {
77
+ const t = i(e.uri, s);
78
+ return async e => {
79
+ const s = await t.query(e);
80
+ return s[0];
81
+ };
82
+ };
83
+ this.opts = {
84
+ table: "keyv",
85
+ keySize: 255,
86
+ ...e
87
+ };
88
+ const o = `CREATE TABLE IF NOT EXISTS ${this.opts.table}(id VARCHAR(${Number(this.opts.keySize)}) PRIMARY KEY, value TEXT)`;
89
+ const n = a().then((async t => {
90
+ await t(o);
91
+ if (this.opts.intervalExpiration !== void 0 && this.opts.intervalExpiration > 0) {
92
+ await t("SET GLOBAL event_scheduler = ON;");
93
+ await t("DROP EVENT IF EXISTS keyv_delete_expired_keys;");
94
+ await t(`CREATE EVENT IF NOT EXISTS keyv_delete_expired_keys ON SCHEDULE EVERY ${this.opts.intervalExpiration} SECOND\n\t\t\t\t\tDO DELETE FROM ${this.opts.table}\n\t\t\t\t\tWHERE CAST(value->'$.expires' AS UNSIGNED) BETWEEN 1 AND UNIX_TIMESTAMP(NOW(3)) * 1000;`);
95
+ }
96
+ return t;
97
+ })).catch((t => this.emit("error", t)));
98
+ this.query = async t => {
99
+ const e = await n;
100
+ return e(t);
101
+ };
102
+ }
103
+ async get(t) {
104
+ const s = `SELECT * FROM ${this.opts.table} WHERE id = ?`;
105
+ const a = e.format(s, [ t ]);
106
+ const o = await this.query(a);
107
+ const i = o[0];
108
+ return i?.value;
109
+ }
110
+ async getMany(t) {
111
+ const s = `SELECT * FROM ${this.opts.table} WHERE id IN (?)`;
112
+ const a = e.format(s, [ t ]);
113
+ const o = await this.query(a);
114
+ const i = [];
115
+ for (const e of t) {
116
+ const t = o.findIndex((t => t.id === e));
117
+ i.push(t === -1 ? void 0 : o[t].value);
118
+ }
119
+ return i;
120
+ }
121
+ async set(t, s) {
122
+ const a = `INSERT INTO ${this.opts.table} (id, value)\n\t\t\tVALUES(?, ?) \n\t\t\tON DUPLICATE KEY UPDATE value=?;`;
123
+ const o = [ t, s, s ];
124
+ const i = e.format(a, o);
125
+ return this.query(i);
126
+ }
127
+ async delete(t) {
128
+ const s = `SELECT * FROM ${this.opts.table} WHERE id = ?`;
129
+ const a = e.format(s, [ t ]);
130
+ const o = `DELETE FROM ${this.opts.table} WHERE id = ?`;
131
+ const i = e.format(o, [ t ]);
132
+ const n = await this.query(a);
133
+ const r = n[0];
134
+ if (r === void 0) {
135
+ return false;
136
+ }
137
+ await this.query(i);
138
+ return true;
139
+ }
140
+ async deleteMany(t) {
141
+ const s = `DELETE FROM ${this.opts.table} WHERE id IN (?)`;
142
+ const a = e.format(s, [ t ]);
143
+ const o = await this.query(a);
144
+ return o.affectedRows !== 0;
145
+ }
146
+ async clear() {
147
+ const t = `DELETE FROM ${this.opts.table} WHERE id LIKE ?`;
148
+ const s = e.format(t, [ this.namespace ? `${this.namespace}:%` : "%" ]);
149
+ await this.query(s);
150
+ }
151
+ async* iterator(t) {
152
+ const s = Number.parseInt(this.opts.iterationLimit, 10) || 10;
153
+ async function* a(o, i, n) {
154
+ const r = `SELECT * FROM ${i.table} WHERE id LIKE ? LIMIT ? OFFSET ?`;
155
+ const c = e.format(r, [ `${t ? t + ":" : ""}%`, s, o ]);
156
+ const E = await n(c);
157
+ if (E.length === 0) {
158
+ return;
159
+ }
160
+ for (const t of E) {
161
+ o += 1;
162
+ yield [ t.id, t.value ];
163
+ }
164
+ yield* a(o, i, n);
165
+ }
166
+ yield* a(0, this.opts, this.query);
167
+ }
168
+ async has(t) {
169
+ const e = `SELECT EXISTS ( SELECT * FROM ${this.opts.table} WHERE id = '${t}' )`;
170
+ const s = await this.query(e);
171
+ return Object.values(s[0])[0] === 1;
172
+ }
173
+ async disconnect() {
174
+ n();
175
+ }
176
+ };
177
+
178
+ var E = c;
179
+
180
+ export { c as KeyvMysql, E as default };