lakutata 2.0.34 → 2.0.35

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 (210) hide show
  1. package/com/cacher.cjs +211 -0
  2. package/com/cacher.d.ts +514 -0
  3. package/com/cacher.mjs +185 -0
  4. package/com/database.cjs +6 -2
  5. package/com/database.mjs +6 -2
  6. package/com/docker.cjs +23 -17
  7. package/com/docker.mjs +19 -13
  8. package/com/entrypoint.cjs +1 -1
  9. package/com/entrypoint.mjs +1 -1
  10. package/com/logger.cjs +6 -2
  11. package/com/logger.mjs +6 -2
  12. package/decorator/ctrl.cjs +1 -1
  13. package/decorator/ctrl.mjs +1 -1
  14. package/decorator/orm.cjs +22 -18
  15. package/decorator/orm.mjs +6 -2
  16. package/helper.cjs +1 -1
  17. package/helper.mjs +1 -1
  18. package/lakutata.cjs +7 -3
  19. package/lakutata.mjs +7 -3
  20. package/orm.cjs +19 -15
  21. package/orm.mjs +15 -11
  22. package/package.json +6 -1
  23. package/provider/database.cjs +6 -2
  24. package/provider/database.mjs +6 -2
  25. package/src/components/Database.cjs +6 -2
  26. package/src/components/Database.mjs +6 -2
  27. package/src/components/Logger.cjs +6 -2
  28. package/src/components/Logger.mjs +6 -2
  29. package/src/components/cacher/Cacher.cjs +193 -0
  30. package/src/components/cacher/Cacher.mjs +183 -0
  31. package/src/components/cacher/options/CacherOptions.cjs +93 -0
  32. package/src/components/cacher/options/CacherOptions.mjs +87 -0
  33. package/src/components/cacher/options/FileCacheOptions.cjs +77 -0
  34. package/src/components/cacher/options/FileCacheOptions.mjs +71 -0
  35. package/src/components/cacher/options/MemcacheCacheOptions.cjs +79 -0
  36. package/src/components/cacher/options/MemcacheCacheOptions.mjs +73 -0
  37. package/src/components/cacher/options/MongoCacheOptions.cjs +83 -0
  38. package/src/components/cacher/options/MongoCacheOptions.mjs +77 -0
  39. package/src/components/cacher/options/MysqlCacheOptions.cjs +83 -0
  40. package/src/components/cacher/options/MysqlCacheOptions.mjs +77 -0
  41. package/src/components/cacher/options/PostgresCacheOptions.cjs +87 -0
  42. package/src/components/cacher/options/PostgresCacheOptions.mjs +81 -0
  43. package/src/components/cacher/options/RedisCacheOptions.cjs +99 -0
  44. package/src/components/cacher/options/RedisCacheOptions.mjs +93 -0
  45. package/src/components/cacher/options/SqliteCacheOptions.cjs +77 -0
  46. package/src/components/cacher/options/SqliteCacheOptions.mjs +71 -0
  47. package/src/components/cacher/types/CacheStoreOptions.cjs +1 -0
  48. package/src/components/cacher/types/CacheStoreOptions.mjs +1 -0
  49. package/src/components/docker/ConnectionOptionsBuilder.cjs +19 -13
  50. package/src/components/docker/ConnectionOptionsBuilder.mjs +19 -13
  51. package/src/components/docker/Docker.cjs +19 -13
  52. package/src/components/docker/Docker.mjs +19 -13
  53. package/src/components/docker/lib/DockerContainer.cjs +26 -20
  54. package/src/components/docker/lib/DockerContainer.mjs +20 -14
  55. package/src/components/docker/lib/DockerContainerTTY.cjs +15 -9
  56. package/src/components/docker/lib/DockerContainerTTY.mjs +15 -9
  57. package/src/components/entrypoint/Entrypoint.cjs +1 -1
  58. package/src/components/entrypoint/Entrypoint.mjs +1 -1
  59. package/src/decorators/ctrl/CLIAction.cjs +1 -1
  60. package/src/decorators/ctrl/CLIAction.mjs +1 -1
  61. package/src/decorators/ctrl/HTTPAction.cjs +1 -1
  62. package/src/decorators/ctrl/HTTPAction.mjs +1 -1
  63. package/src/decorators/ctrl/ServiceAction.cjs +1 -1
  64. package/src/decorators/ctrl/ServiceAction.mjs +1 -1
  65. package/src/decorators/ctrl/http/DELETE.cjs +1 -1
  66. package/src/decorators/ctrl/http/DELETE.mjs +1 -1
  67. package/src/decorators/ctrl/http/GET.cjs +1 -1
  68. package/src/decorators/ctrl/http/GET.mjs +1 -1
  69. package/src/decorators/ctrl/http/HEAD.cjs +1 -1
  70. package/src/decorators/ctrl/http/HEAD.mjs +1 -1
  71. package/src/decorators/ctrl/http/OPTIONS.cjs +1 -1
  72. package/src/decorators/ctrl/http/OPTIONS.mjs +1 -1
  73. package/src/decorators/ctrl/http/PATCH.cjs +1 -1
  74. package/src/decorators/ctrl/http/PATCH.mjs +1 -1
  75. package/src/decorators/ctrl/http/POST.cjs +1 -1
  76. package/src/decorators/ctrl/http/POST.mjs +1 -1
  77. package/src/decorators/ctrl/http/PUT.cjs +1 -1
  78. package/src/decorators/ctrl/http/PUT.mjs +1 -1
  79. package/src/decorators/orm/AfterInsert.cjs +6 -2
  80. package/src/decorators/orm/AfterInsert.mjs +13 -9
  81. package/src/decorators/orm/AfterLoad.cjs +6 -2
  82. package/src/decorators/orm/AfterLoad.mjs +16 -12
  83. package/src/decorators/orm/AfterRecover.cjs +6 -2
  84. package/src/decorators/orm/AfterRecover.mjs +10 -6
  85. package/src/decorators/orm/AfterRemove.cjs +6 -2
  86. package/src/decorators/orm/AfterRemove.mjs +10 -6
  87. package/src/decorators/orm/AfterSoftRemove.cjs +6 -2
  88. package/src/decorators/orm/AfterSoftRemove.mjs +10 -6
  89. package/src/decorators/orm/AfterUpdate.cjs +6 -2
  90. package/src/decorators/orm/AfterUpdate.mjs +14 -10
  91. package/src/decorators/orm/BeforeInsert.cjs +6 -2
  92. package/src/decorators/orm/BeforeInsert.mjs +10 -6
  93. package/src/decorators/orm/BeforeRecover.cjs +13 -9
  94. package/src/decorators/orm/BeforeRecover.mjs +6 -2
  95. package/src/decorators/orm/BeforeRemove.cjs +13 -9
  96. package/src/decorators/orm/BeforeRemove.mjs +6 -2
  97. package/src/decorators/orm/BeforeSoftRemove.cjs +10 -6
  98. package/src/decorators/orm/BeforeSoftRemove.mjs +6 -2
  99. package/src/decorators/orm/BeforeUpdate.cjs +6 -2
  100. package/src/decorators/orm/BeforeUpdate.mjs +11 -7
  101. package/src/decorators/orm/Check.cjs +6 -2
  102. package/src/decorators/orm/Check.mjs +6 -2
  103. package/src/decorators/orm/ChildEntity.cjs +11 -7
  104. package/src/decorators/orm/ChildEntity.mjs +6 -2
  105. package/src/decorators/orm/Column.cjs +23 -19
  106. package/src/decorators/orm/Column.mjs +6 -2
  107. package/src/decorators/orm/CreateDateColumn.cjs +8 -4
  108. package/src/decorators/orm/CreateDateColumn.mjs +6 -2
  109. package/src/decorators/orm/DeleteDateColumn.cjs +6 -2
  110. package/src/decorators/orm/DeleteDateColumn.mjs +6 -2
  111. package/src/decorators/orm/Entity.cjs +6 -2
  112. package/src/decorators/orm/Entity.mjs +12 -8
  113. package/src/decorators/orm/EventSubscriber.cjs +6 -2
  114. package/src/decorators/orm/EventSubscriber.mjs +6 -2
  115. package/src/decorators/orm/Exclusion.cjs +6 -2
  116. package/src/decorators/orm/Exclusion.mjs +12 -8
  117. package/src/decorators/orm/Generated.cjs +10 -6
  118. package/src/decorators/orm/Generated.mjs +12 -8
  119. package/src/decorators/orm/Index.cjs +14 -10
  120. package/src/decorators/orm/Index.mjs +24 -20
  121. package/src/decorators/orm/JoinColumn.cjs +6 -2
  122. package/src/decorators/orm/JoinColumn.mjs +6 -2
  123. package/src/decorators/orm/JoinTable.cjs +6 -2
  124. package/src/decorators/orm/JoinTable.mjs +8 -4
  125. package/src/decorators/orm/ManyToMany.cjs +13 -9
  126. package/src/decorators/orm/ManyToMany.mjs +17 -13
  127. package/src/decorators/orm/ManyToOne.cjs +6 -2
  128. package/src/decorators/orm/ManyToOne.mjs +6 -2
  129. package/src/decorators/orm/ObjectIdColumn.cjs +6 -2
  130. package/src/decorators/orm/ObjectIdColumn.mjs +12 -8
  131. package/src/decorators/orm/OneToMany.cjs +14 -10
  132. package/src/decorators/orm/OneToMany.mjs +6 -2
  133. package/src/decorators/orm/OneToOne.cjs +15 -11
  134. package/src/decorators/orm/OneToOne.mjs +13 -9
  135. package/src/decorators/orm/PrimaryColumn.cjs +6 -2
  136. package/src/decorators/orm/PrimaryColumn.mjs +26 -22
  137. package/src/decorators/orm/PrimaryGeneratedColumn.cjs +6 -2
  138. package/src/decorators/orm/PrimaryGeneratedColumn.mjs +8 -4
  139. package/src/decorators/orm/RelationId.cjs +11 -7
  140. package/src/decorators/orm/RelationId.mjs +12 -8
  141. package/src/decorators/orm/TableInheritance.cjs +6 -2
  142. package/src/decorators/orm/TableInheritance.mjs +10 -6
  143. package/src/decorators/orm/Tree.cjs +6 -2
  144. package/src/decorators/orm/Tree.mjs +6 -2
  145. package/src/decorators/orm/TreeChildren.cjs +6 -2
  146. package/src/decorators/orm/TreeChildren.mjs +17 -13
  147. package/src/decorators/orm/TreeLevelColumn.cjs +6 -2
  148. package/src/decorators/orm/TreeLevelColumn.mjs +6 -2
  149. package/src/decorators/orm/TreeParent.cjs +12 -8
  150. package/src/decorators/orm/TreeParent.mjs +6 -2
  151. package/src/decorators/orm/Unique.cjs +6 -2
  152. package/src/decorators/orm/Unique.mjs +6 -2
  153. package/src/decorators/orm/UpdateDateColumn.cjs +8 -4
  154. package/src/decorators/orm/UpdateDateColumn.mjs +6 -2
  155. package/src/decorators/orm/VersionColumn.cjs +6 -2
  156. package/src/decorators/orm/VersionColumn.mjs +6 -2
  157. package/src/decorators/orm/ViewColumn.cjs +6 -2
  158. package/src/decorators/orm/ViewColumn.mjs +6 -2
  159. package/src/decorators/orm/ViewEntity.cjs +8 -4
  160. package/src/decorators/orm/ViewEntity.mjs +6 -2
  161. package/src/decorators/orm/VirtualColumn.cjs +6 -2
  162. package/src/decorators/orm/VirtualColumn.mjs +10 -6
  163. package/src/lib/base/internal/ControllerEntrypoint.cjs +1 -1
  164. package/src/lib/base/internal/ControllerEntrypoint.mjs +1 -1
  165. package/src/lib/core/Application.cjs +11 -7
  166. package/src/lib/core/Application.mjs +7 -3
  167. package/src/lib/core/Module.cjs +1 -1
  168. package/src/lib/core/Module.mjs +1 -1
  169. package/src/lib/helpers/NonceStr.cjs +1 -1
  170. package/src/lib/helpers/NonceStr.mjs +1 -1
  171. package/src/lib/helpers/ObjectHash.cjs +1 -1
  172. package/src/lib/helpers/ObjectHash.mjs +1 -1
  173. package/src/lib/helpers/RandomString.cjs +1 -1
  174. package/src/lib/helpers/RandomString.mjs +1 -1
  175. package/src/providers/Database.cjs +6 -2
  176. package/src/providers/Database.mjs +6 -2
  177. package/vendor/Package.112.cjs +5498 -5500
  178. package/vendor/Package.112.mjs +5504 -5506
  179. package/vendor/Package.12.cjs +4 -80
  180. package/vendor/Package.12.mjs +4 -74
  181. package/vendor/Package.122.cjs +87 -0
  182. package/vendor/Package.122.mjs +79 -0
  183. package/vendor/Package.13.cjs +1 -1
  184. package/vendor/Package.13.mjs +1 -1
  185. package/vendor/Package.14.cjs +1 -14055
  186. package/vendor/Package.14.mjs +1 -14029
  187. package/vendor/Package.15.cjs +12449 -46635
  188. package/vendor/Package.15.mjs +12435 -46611
  189. package/vendor/Package.16.cjs +3 -0
  190. package/vendor/Package.16.mjs +1 -0
  191. package/vendor/Package.17.cjs +48245 -0
  192. package/vendor/Package.17.mjs +48202 -0
  193. package/vendor/Package.18.cjs +3 -0
  194. package/vendor/Package.18.mjs +1 -0
  195. package/vendor/Package.19.cjs +4466 -0
  196. package/vendor/Package.19.mjs +4442 -0
  197. package/vendor/Package.610.cjs +196 -0
  198. package/vendor/Package.610.mjs +180 -0
  199. package/vendor/Package.62.cjs +1 -1
  200. package/vendor/Package.62.mjs +1 -1
  201. package/vendor/Package.65.cjs +860 -0
  202. package/vendor/Package.65.mjs +832 -0
  203. package/vendor/Package.66.cjs +321 -0
  204. package/vendor/Package.66.mjs +305 -0
  205. package/vendor/Package.67.cjs +341 -0
  206. package/vendor/Package.67.mjs +327 -0
  207. package/vendor/Package.68.cjs +333 -0
  208. package/vendor/Package.68.mjs +315 -0
  209. package/vendor/Package.69.cjs +353 -0
  210. package/vendor/Package.69.mjs +335 -0
@@ -0,0 +1,333 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, {
4
+ value: "Module"
5
+ });
6
+
7
+ const e = require("events");
8
+
9
+ const r = require("util");
10
+
11
+ const s = require("./Package.19.cjs");
12
+
13
+ const c = require("sqlite3");
14
+
15
+ require("./Package.1.cjs");
16
+
17
+ require("buffer");
18
+
19
+ require("./Package.5.cjs");
20
+
21
+ require("./Package.12.cjs");
22
+
23
+ require("./Package.8.cjs");
24
+
25
+ require("os");
26
+
27
+ require("path");
28
+
29
+ require("stream");
30
+
31
+ require("fs");
32
+
33
+ require("./Package.18.cjs");
34
+
35
+ require("constants");
36
+
37
+ require("./Package.10.cjs");
38
+
39
+ require("url");
40
+
41
+ require("./Package.16.cjs");
42
+
43
+ require("assert");
44
+
45
+ require("./Package.13.cjs");
46
+
47
+ require("../src/components/cacher/options/CacherOptions.cjs");
48
+
49
+ require("./Package.2.cjs");
50
+
51
+ require("../src/lib/base/internal/DataValidator.cjs");
52
+
53
+ require("./Package.4.cjs");
54
+
55
+ require("node:util/types");
56
+
57
+ require("../src/lib/validation/VLD.cjs");
58
+
59
+ require("../src/exceptions/dto/InvalidValueException.cjs");
60
+
61
+ require("../src/lib/base/abstracts/Exception.cjs");
62
+
63
+ require("../src/lib/base/internal/BasicInfo.cjs");
64
+
65
+ require("../src/lib/helpers/As.cjs");
66
+
67
+ require("./Package.6.cjs");
68
+
69
+ require("./Package.7.cjs");
70
+
71
+ require("../src/lib/base/internal/ThrowWarning.cjs");
72
+
73
+ require("../src/lib/helpers/Templating.cjs");
74
+
75
+ require("../src/lib/base/internal/CamelCase.cjs");
76
+
77
+ require("../src/lib/helpers/NoCase.cjs");
78
+
79
+ require("./Package.9.cjs");
80
+
81
+ require("../src/lib/helpers/IsHtml.cjs");
82
+
83
+ require("../src/lib/helpers/IsXML.cjs");
84
+
85
+ require("../src/constants/DTOMetadataKey.cjs");
86
+
87
+ require("../src/lib/helpers/ObjectConstructor.cjs");
88
+
89
+ require("../src/lib/helpers/ObjectParentConstructors.cjs");
90
+
91
+ require("../src/lib/helpers/ObjectParentConstructor.cjs");
92
+
93
+ require("../src/lib/helpers/ObjectPrototype.cjs");
94
+
95
+ require("../src/decorators/dto/Expect.cjs");
96
+
97
+ require("../src/components/cacher/options/FileCacheOptions.cjs");
98
+
99
+ require("../src/components/cacher/options/MemcacheCacheOptions.cjs");
100
+
101
+ require("../src/components/cacher/options/MongoCacheOptions.cjs");
102
+
103
+ require("../src/components/cacher/options/PostgresCacheOptions.cjs");
104
+
105
+ require("../src/components/cacher/options/MysqlCacheOptions.cjs");
106
+
107
+ require("../src/components/cacher/options/SqliteCacheOptions.cjs");
108
+
109
+ require("../src/components/cacher/options/RedisCacheOptions.cjs");
110
+
111
+ require("../src/lib/core/Component.cjs");
112
+
113
+ require("./Package.3.cjs");
114
+
115
+ require("../src/lib/base/async-constructor/AsyncConstructor.cjs");
116
+
117
+ require("../src/lib/base/async-constructor/Append.cjs");
118
+
119
+ require("../src/lib/helpers/IsPromiseLike.cjs");
120
+
121
+ require("../src/lib/helpers/IsPromise.cjs");
122
+
123
+ require("util/types");
124
+
125
+ require("../src/decorators/di/Lifetime.cjs");
126
+
127
+ require("../src/lib/base/internal/ObjectLifetime.cjs");
128
+
129
+ require("../src/constants/DIMetadataKey.cjs");
130
+
131
+ require("../src/exceptions/di/LifetimeLockedException.cjs");
132
+
133
+ require("../src/exceptions/MethodNotFoundException.cjs");
134
+
135
+ require("../src/lib/ioc/DependencyInjectionContainer.cjs");
136
+
137
+ require("../src/lib/ioc/Errors.cjs");
138
+
139
+ require("../src/exceptions/di/DependencyInjectionException.cjs");
140
+
141
+ require("../src/lib/base/internal/ConstructorSymbol.cjs");
142
+
143
+ require("node:crypto");
144
+
145
+ require("../src/lib/ioc/InjectionMode.cjs");
146
+
147
+ require("../src/lib/ioc/Lifetime.cjs");
148
+
149
+ require("../src/lib/ioc/ListModules.cjs");
150
+
151
+ require("../src/lib/ioc/Utils.cjs");
152
+
153
+ require("../src/lib/ioc/FunctionTokenizer.cjs");
154
+
155
+ require("../src/lib/ioc/LoadModules.cjs");
156
+
157
+ require("../src/lib/ioc/Resolvers.cjs");
158
+
159
+ require("../src/lib/ioc/ParamParser.cjs");
160
+
161
+ require("../src/lib/base/internal/ObjectWeakRefs.cjs");
162
+
163
+ require("../src/lib/base/internal/ConfigurableRecordsInjection.cjs");
164
+
165
+ require("../src/lib/base/internal/ObjectConfiguration.cjs");
166
+
167
+ require("../src/lib/base/internal/ObjectInjection.cjs");
168
+
169
+ require("../src/lib/base/internal/ObjectContainer.cjs");
170
+
171
+ require("../src/lib/helpers/DevNull.cjs");
172
+
173
+ require("../src/decorators/dto/IndexSignature.cjs");
174
+
175
+ require("../src/decorators/dto/Accept.cjs");
176
+
177
+ require("../src/lib/base/internal/MethodValidation.cjs");
178
+
179
+ require("../src/exceptions/dto/InvalidMethodAcceptException.cjs");
180
+
181
+ require("../src/exceptions/dto/InvalidMethodReturnException.cjs");
182
+
183
+ require("../src/lib/helpers/IsEmptyObject.cjs");
184
+
185
+ require("../src/lib/base/EventEmitter.cjs");
186
+
187
+ require("../src/lib/core/Provider.cjs");
188
+
189
+ require("../src/decorators/di/Configurable.cjs");
190
+
191
+ require("../src/lib/helpers/URLBuilder.cjs");
192
+
193
+ const t = e => e && e.__esModule ? e : {
194
+ default: e
195
+ };
196
+
197
+ const i = t(e);
198
+
199
+ const o = t(c);
200
+
201
+ var n = e => String(e).search(/^[a-zA-Z]+$/) < 0 ? "_" + e : e;
202
+
203
+ var a = class extends i.default {
204
+ ttlSupport;
205
+ opts;
206
+ namespace;
207
+ close;
208
+ query;
209
+ constructor(e) {
210
+ super();
211
+ this.ttlSupport = false;
212
+ let s = {
213
+ dialect: "sqlite",
214
+ uri: "sqlite://:memory:"
215
+ };
216
+ if (typeof e === "string") {
217
+ s.uri = e;
218
+ } else {
219
+ s = {
220
+ ...s,
221
+ ...e
222
+ };
223
+ }
224
+ s.db = s.uri.replace(/^sqlite:\/\//, "");
225
+ s.connect = async () => new Promise(((e, r) => {
226
+ const c = new o.default.Database(s.db, (t => {
227
+ if (t) {
228
+ r(t);
229
+ } else {
230
+ if (s.busyTimeout) {
231
+ c.configure("busyTimeout", s.busyTimeout);
232
+ }
233
+ e(c);
234
+ }
235
+ }));
236
+ })).then((e => ({
237
+ query: r.promisify(e.all).bind(e),
238
+ close: r.promisify(e.close).bind(e)
239
+ })));
240
+ this.opts = {
241
+ table: "keyv",
242
+ keySize: 255,
243
+ ...s
244
+ };
245
+ this.opts.table = n(this.opts.table);
246
+ const c = `CREATE TABLE IF NOT EXISTS ${this.opts.table}(key VARCHAR(${Number(this.opts.keySize)}) PRIMARY KEY, value TEXT )`;
247
+ const t = this.opts.connect().then((async e => e.query(c).then((() => e)))).catch((e => this.emit("error", e)));
248
+ this.query = async (e, ...r) => t.then((async s => s.query(e, ...r)));
249
+ this.close = async () => t.then((e => e.close()));
250
+ }
251
+ async get(e) {
252
+ const r = `SELECT * FROM ${this.opts.table} WHERE key = ?`;
253
+ const s = await this.query(r, e);
254
+ const c = s[0];
255
+ if (c === void 0) {
256
+ return void 0;
257
+ }
258
+ return c.value;
259
+ }
260
+ async getMany(e) {
261
+ const r = `SELECT * FROM ${this.opts.table} WHERE key IN (SELECT value FROM json_each(?))`;
262
+ const s = await this.query(r, JSON.stringify(e));
263
+ return e.map((e => {
264
+ const r = s.find((r => r.key === e));
265
+ return r ? r.value : void 0;
266
+ }));
267
+ }
268
+ async set(e, r) {
269
+ const s = `INSERT INTO ${this.opts.table} (key, value)\n\t\t\tVALUES(?, ?) \n\t\t\tON CONFLICT(key) \n\t\t\tDO UPDATE SET value=excluded.value;`;
270
+ return this.query(s, e, r);
271
+ }
272
+ async delete(e) {
273
+ const r = `SELECT * FROM ${this.opts.table} WHERE key = ?`;
274
+ const s = `DELETE FROM ${this.opts.table} WHERE key = ?`;
275
+ const c = await this.query(r, e);
276
+ const t = c[0];
277
+ if (t === void 0) {
278
+ return false;
279
+ }
280
+ await this.query(s, e);
281
+ return true;
282
+ }
283
+ async deleteMany(e) {
284
+ const r = `DELETE FROM ${this.opts.table} WHERE key IN (SELECT value FROM json_each(?))`;
285
+ const s = await this.getMany(e);
286
+ if (s.every((e => e === void 0))) {
287
+ return false;
288
+ }
289
+ await this.query(r, JSON.stringify(e));
290
+ return true;
291
+ }
292
+ async clear() {
293
+ const e = `DELETE FROM ${this.opts.table} WHERE key LIKE ?`;
294
+ await this.query(e, this.namespace ? `${this.namespace}:%` : "%");
295
+ }
296
+ async* iterator(e) {
297
+ const r = Number.parseInt(this.opts.iterationLimit, 10) || 10;
298
+ async function* s(c, t, i) {
299
+ const o = `SELECT * FROM ${t.table} WHERE key LIKE ? LIMIT ? OFFSET ?`;
300
+ const n = await i(o, [ `${e ? e + ":" : ""}%`, r, c ]);
301
+ const a = [ ...n ];
302
+ if (a.length === 0) {
303
+ return;
304
+ }
305
+ for (const e of a) {
306
+ c += 1;
307
+ yield [ e.key, e.value ];
308
+ }
309
+ yield* s(c, t, i);
310
+ }
311
+ yield* s(0, this.opts, this.query);
312
+ }
313
+ async has(e) {
314
+ const r = `SELECT EXISTS ( SELECT * FROM ${this.opts.table} WHERE key = ? )`;
315
+ const s = await this.query(r, e);
316
+ return Object.values(s[0])[0] === 1;
317
+ }
318
+ async disconnect() {
319
+ await this.close();
320
+ }
321
+ };
322
+
323
+ var u = e => new s.index_default({
324
+ store: new a(e)
325
+ });
326
+
327
+ var l = a;
328
+
329
+ exports.KeyvSqlite = a;
330
+
331
+ exports.createKeyv = u;
332
+
333
+ exports.default = l;
@@ -0,0 +1,315 @@
1
+ import t from "events";
2
+
3
+ import { promisify as s } from "util";
4
+
5
+ import { i as e } from "./Package.19.mjs";
6
+
7
+ import r from "sqlite3";
8
+
9
+ import "./Package.1.mjs";
10
+
11
+ import "buffer";
12
+
13
+ import "./Package.5.mjs";
14
+
15
+ import "./Package.12.mjs";
16
+
17
+ import "./Package.8.mjs";
18
+
19
+ import "os";
20
+
21
+ import "path";
22
+
23
+ import "stream";
24
+
25
+ import "fs";
26
+
27
+ import "./Package.18.mjs";
28
+
29
+ import "constants";
30
+
31
+ import "./Package.10.mjs";
32
+
33
+ import "url";
34
+
35
+ import "./Package.16.mjs";
36
+
37
+ import "assert";
38
+
39
+ import "./Package.13.mjs";
40
+
41
+ import "../src/components/cacher/options/CacherOptions.mjs";
42
+
43
+ import "./Package.2.mjs";
44
+
45
+ import "../src/lib/base/internal/DataValidator.mjs";
46
+
47
+ import "./Package.4.mjs";
48
+
49
+ import "node:util/types";
50
+
51
+ import "../src/lib/validation/VLD.mjs";
52
+
53
+ import "../src/exceptions/dto/InvalidValueException.mjs";
54
+
55
+ import "../src/lib/base/abstracts/Exception.mjs";
56
+
57
+ import "../src/lib/base/internal/BasicInfo.mjs";
58
+
59
+ import "../src/lib/helpers/As.mjs";
60
+
61
+ import "./Package.6.mjs";
62
+
63
+ import "./Package.7.mjs";
64
+
65
+ import "../src/lib/base/internal/ThrowWarning.mjs";
66
+
67
+ import "../src/lib/helpers/Templating.mjs";
68
+
69
+ import "../src/lib/base/internal/CamelCase.mjs";
70
+
71
+ import "../src/lib/helpers/NoCase.mjs";
72
+
73
+ import "./Package.9.mjs";
74
+
75
+ import "../src/lib/helpers/IsHtml.mjs";
76
+
77
+ import "../src/lib/helpers/IsXML.mjs";
78
+
79
+ import "../src/constants/DTOMetadataKey.mjs";
80
+
81
+ import "../src/lib/helpers/ObjectConstructor.mjs";
82
+
83
+ import "../src/lib/helpers/ObjectParentConstructors.mjs";
84
+
85
+ import "../src/lib/helpers/ObjectParentConstructor.mjs";
86
+
87
+ import "../src/lib/helpers/ObjectPrototype.mjs";
88
+
89
+ import "../src/decorators/dto/Expect.mjs";
90
+
91
+ import "../src/components/cacher/options/FileCacheOptions.mjs";
92
+
93
+ import "../src/components/cacher/options/MemcacheCacheOptions.mjs";
94
+
95
+ import "../src/components/cacher/options/MongoCacheOptions.mjs";
96
+
97
+ import "../src/components/cacher/options/PostgresCacheOptions.mjs";
98
+
99
+ import "../src/components/cacher/options/MysqlCacheOptions.mjs";
100
+
101
+ import "../src/components/cacher/options/SqliteCacheOptions.mjs";
102
+
103
+ import "../src/components/cacher/options/RedisCacheOptions.mjs";
104
+
105
+ import "../src/lib/core/Component.mjs";
106
+
107
+ import "./Package.3.mjs";
108
+
109
+ import "../src/lib/base/async-constructor/AsyncConstructor.mjs";
110
+
111
+ import "../src/lib/base/async-constructor/Append.mjs";
112
+
113
+ import "../src/lib/helpers/IsPromiseLike.mjs";
114
+
115
+ import "../src/lib/helpers/IsPromise.mjs";
116
+
117
+ import "util/types";
118
+
119
+ import "../src/decorators/di/Lifetime.mjs";
120
+
121
+ import "../src/lib/base/internal/ObjectLifetime.mjs";
122
+
123
+ import "../src/constants/DIMetadataKey.mjs";
124
+
125
+ import "../src/exceptions/di/LifetimeLockedException.mjs";
126
+
127
+ import "../src/exceptions/MethodNotFoundException.mjs";
128
+
129
+ import "../src/lib/ioc/DependencyInjectionContainer.mjs";
130
+
131
+ import "../src/lib/ioc/Errors.mjs";
132
+
133
+ import "../src/exceptions/di/DependencyInjectionException.mjs";
134
+
135
+ import "../src/lib/base/internal/ConstructorSymbol.mjs";
136
+
137
+ import "node:crypto";
138
+
139
+ import "../src/lib/ioc/InjectionMode.mjs";
140
+
141
+ import "../src/lib/ioc/Lifetime.mjs";
142
+
143
+ import "../src/lib/ioc/ListModules.mjs";
144
+
145
+ import "../src/lib/ioc/Utils.mjs";
146
+
147
+ import "../src/lib/ioc/FunctionTokenizer.mjs";
148
+
149
+ import "../src/lib/ioc/LoadModules.mjs";
150
+
151
+ import "../src/lib/ioc/Resolvers.mjs";
152
+
153
+ import "../src/lib/ioc/ParamParser.mjs";
154
+
155
+ import "../src/lib/base/internal/ObjectWeakRefs.mjs";
156
+
157
+ import "../src/lib/base/internal/ConfigurableRecordsInjection.mjs";
158
+
159
+ import "../src/lib/base/internal/ObjectConfiguration.mjs";
160
+
161
+ import "../src/lib/base/internal/ObjectInjection.mjs";
162
+
163
+ import "../src/lib/base/internal/ObjectContainer.mjs";
164
+
165
+ import "../src/lib/helpers/DevNull.mjs";
166
+
167
+ import "../src/decorators/dto/IndexSignature.mjs";
168
+
169
+ import "../src/decorators/dto/Accept.mjs";
170
+
171
+ import "../src/lib/base/internal/MethodValidation.mjs";
172
+
173
+ import "../src/exceptions/dto/InvalidMethodAcceptException.mjs";
174
+
175
+ import "../src/exceptions/dto/InvalidMethodReturnException.mjs";
176
+
177
+ import "../src/lib/helpers/IsEmptyObject.mjs";
178
+
179
+ import "../src/lib/base/EventEmitter.mjs";
180
+
181
+ import "../src/lib/core/Provider.mjs";
182
+
183
+ import "../src/decorators/di/Configurable.mjs";
184
+
185
+ import "../src/lib/helpers/URLBuilder.mjs";
186
+
187
+ var i = t => String(t).search(/^[a-zA-Z]+$/) < 0 ? "_" + t : t;
188
+
189
+ var o = class extends t {
190
+ ttlSupport;
191
+ opts;
192
+ namespace;
193
+ close;
194
+ query;
195
+ constructor(t) {
196
+ super();
197
+ this.ttlSupport = false;
198
+ let e = {
199
+ dialect: "sqlite",
200
+ uri: "sqlite://:memory:"
201
+ };
202
+ if (typeof t === "string") {
203
+ e.uri = t;
204
+ } else {
205
+ e = {
206
+ ...e,
207
+ ...t
208
+ };
209
+ }
210
+ e.db = e.uri.replace(/^sqlite:\/\//, "");
211
+ e.connect = async () => new Promise(((t, s) => {
212
+ const i = new r.Database(e.db, (r => {
213
+ if (r) {
214
+ s(r);
215
+ } else {
216
+ if (e.busyTimeout) {
217
+ i.configure("busyTimeout", e.busyTimeout);
218
+ }
219
+ t(i);
220
+ }
221
+ }));
222
+ })).then((t => ({
223
+ query: s(t.all).bind(t),
224
+ close: s(t.close).bind(t)
225
+ })));
226
+ this.opts = {
227
+ table: "keyv",
228
+ keySize: 255,
229
+ ...e
230
+ };
231
+ this.opts.table = i(this.opts.table);
232
+ const o = `CREATE TABLE IF NOT EXISTS ${this.opts.table}(key VARCHAR(${Number(this.opts.keySize)}) PRIMARY KEY, value TEXT )`;
233
+ const c = this.opts.connect().then((async t => t.query(o).then((() => t)))).catch((t => this.emit("error", t)));
234
+ this.query = async (t, ...s) => c.then((async e => e.query(t, ...s)));
235
+ this.close = async () => c.then((t => t.close()));
236
+ }
237
+ async get(t) {
238
+ const s = `SELECT * FROM ${this.opts.table} WHERE key = ?`;
239
+ const e = await this.query(s, t);
240
+ const r = e[0];
241
+ if (r === void 0) {
242
+ return void 0;
243
+ }
244
+ return r.value;
245
+ }
246
+ async getMany(t) {
247
+ const s = `SELECT * FROM ${this.opts.table} WHERE key IN (SELECT value FROM json_each(?))`;
248
+ const e = await this.query(s, JSON.stringify(t));
249
+ return t.map((t => {
250
+ const s = e.find((s => s.key === t));
251
+ return s ? s.value : void 0;
252
+ }));
253
+ }
254
+ async set(t, s) {
255
+ const e = `INSERT INTO ${this.opts.table} (key, value)\n\t\t\tVALUES(?, ?) \n\t\t\tON CONFLICT(key) \n\t\t\tDO UPDATE SET value=excluded.value;`;
256
+ return this.query(e, t, s);
257
+ }
258
+ async delete(t) {
259
+ const s = `SELECT * FROM ${this.opts.table} WHERE key = ?`;
260
+ const e = `DELETE FROM ${this.opts.table} WHERE key = ?`;
261
+ const r = await this.query(s, t);
262
+ const i = r[0];
263
+ if (i === void 0) {
264
+ return false;
265
+ }
266
+ await this.query(e, t);
267
+ return true;
268
+ }
269
+ async deleteMany(t) {
270
+ const s = `DELETE FROM ${this.opts.table} WHERE key IN (SELECT value FROM json_each(?))`;
271
+ const e = await this.getMany(t);
272
+ if (e.every((t => t === void 0))) {
273
+ return false;
274
+ }
275
+ await this.query(s, JSON.stringify(t));
276
+ return true;
277
+ }
278
+ async clear() {
279
+ const t = `DELETE FROM ${this.opts.table} WHERE key LIKE ?`;
280
+ await this.query(t, this.namespace ? `${this.namespace}:%` : "%");
281
+ }
282
+ async* iterator(t) {
283
+ const s = Number.parseInt(this.opts.iterationLimit, 10) || 10;
284
+ async function* e(r, i, o) {
285
+ const c = `SELECT * FROM ${i.table} WHERE key LIKE ? LIMIT ? OFFSET ?`;
286
+ const n = await o(c, [ `${t ? t + ":" : ""}%`, s, r ]);
287
+ const a = [ ...n ];
288
+ if (a.length === 0) {
289
+ return;
290
+ }
291
+ for (const t of a) {
292
+ r += 1;
293
+ yield [ t.key, t.value ];
294
+ }
295
+ yield* e(r, i, o);
296
+ }
297
+ yield* e(0, this.opts, this.query);
298
+ }
299
+ async has(t) {
300
+ const s = `SELECT EXISTS ( SELECT * FROM ${this.opts.table} WHERE key = ? )`;
301
+ const e = await this.query(s, t);
302
+ return Object.values(e[0])[0] === 1;
303
+ }
304
+ async disconnect() {
305
+ await this.close();
306
+ }
307
+ };
308
+
309
+ var c = t => new e({
310
+ store: new o(t)
311
+ });
312
+
313
+ var n = o;
314
+
315
+ export { o as KeyvSqlite, c as createKeyv, n as default };