lakutata 2.0.65 → 2.0.67

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 (213) hide show
  1. package/com/cacher.cjs +1 -1
  2. package/com/cacher.d.ts +4 -4
  3. package/com/cacher.mjs +1 -1
  4. package/com/database.cjs +0 -2
  5. package/com/database.d.ts +4 -4
  6. package/com/database.mjs +0 -2
  7. package/com/docker.d.ts +5 -5
  8. package/com/entrypoint.cjs +3 -1
  9. package/com/entrypoint.d.ts +2 -2
  10. package/com/entrypoint.mjs +3 -1
  11. package/com/logger.d.ts +1 -1
  12. package/com/monitor.d.ts +2 -2
  13. package/decorator/asst.d.ts +1 -1
  14. package/decorator/ctrl.cjs +3 -1
  15. package/decorator/ctrl.d.ts +4 -4
  16. package/decorator/ctrl.mjs +3 -1
  17. package/decorator/di.d.ts +3 -3
  18. package/decorator/dto.d.ts +3 -3
  19. package/decorator/orm.cjs +86 -88
  20. package/decorator/orm.d.ts +51 -75
  21. package/decorator/orm.mjs +44 -46
  22. package/helper.cjs +24 -18
  23. package/helper.d.ts +129 -3
  24. package/helper.mjs +6 -2
  25. package/lakutata.cjs +3 -1
  26. package/lakutata.d.ts +10 -10
  27. package/lakutata.mjs +3 -1
  28. package/orm.cjs +1075 -112
  29. package/orm.d.ts +6 -6
  30. package/orm.mjs +1015 -17
  31. package/package.json +1 -1
  32. package/provider/database.cjs +0 -2
  33. package/provider/database.d.ts +4 -4
  34. package/provider/database.mjs +0 -2
  35. package/provider/passwordHash.d.ts +1 -1
  36. package/src/components/Database.cjs +0 -2
  37. package/src/components/Database.mjs +0 -2
  38. package/src/components/cacher/Cacher.cjs +1 -1
  39. package/src/components/cacher/Cacher.mjs +1 -1
  40. package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +1 -1
  41. package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +1 -1
  42. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.cjs +2 -2
  43. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.mjs +2 -2
  44. package/src/components/cacher/adapters/CreateMongoCacheAdapter.cjs +2 -2
  45. package/src/components/cacher/adapters/CreateMongoCacheAdapter.mjs +2 -2
  46. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.cjs +2 -2
  47. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.mjs +2 -2
  48. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.cjs +2 -2
  49. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.mjs +2 -2
  50. package/src/components/cacher/adapters/CreateRedisCacheAdapter.cjs +2 -2
  51. package/src/components/cacher/adapters/CreateRedisCacheAdapter.mjs +2 -2
  52. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.cjs +2 -2
  53. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.mjs +2 -2
  54. package/src/components/entrypoint/Entrypoint.cjs +3 -1
  55. package/src/components/entrypoint/Entrypoint.mjs +3 -1
  56. package/src/decorators/ctrl/CLIAction.cjs +7 -5
  57. package/src/decorators/ctrl/CLIAction.mjs +3 -1
  58. package/src/decorators/ctrl/HTTPAction.cjs +8 -6
  59. package/src/decorators/ctrl/HTTPAction.mjs +3 -1
  60. package/src/decorators/ctrl/ServiceAction.cjs +3 -1
  61. package/src/decorators/ctrl/ServiceAction.mjs +7 -5
  62. package/src/decorators/ctrl/http/DELETE.cjs +3 -1
  63. package/src/decorators/ctrl/http/DELETE.mjs +3 -1
  64. package/src/decorators/ctrl/http/GET.cjs +3 -1
  65. package/src/decorators/ctrl/http/GET.mjs +3 -1
  66. package/src/decorators/ctrl/http/HEAD.cjs +3 -1
  67. package/src/decorators/ctrl/http/HEAD.mjs +3 -1
  68. package/src/decorators/ctrl/http/OPTIONS.cjs +3 -1
  69. package/src/decorators/ctrl/http/OPTIONS.mjs +3 -1
  70. package/src/decorators/ctrl/http/PATCH.cjs +3 -1
  71. package/src/decorators/ctrl/http/PATCH.mjs +3 -1
  72. package/src/decorators/ctrl/http/POST.cjs +3 -1
  73. package/src/decorators/ctrl/http/POST.mjs +3 -1
  74. package/src/decorators/ctrl/http/PUT.cjs +3 -1
  75. package/src/decorators/ctrl/http/PUT.mjs +3 -1
  76. package/src/decorators/orm/AfterInsert.cjs +27 -7
  77. package/src/decorators/orm/AfterInsert.mjs +28 -6
  78. package/src/decorators/orm/AfterLoad.cjs +27 -7
  79. package/src/decorators/orm/AfterLoad.mjs +28 -6
  80. package/src/decorators/orm/AfterRecover.cjs +27 -7
  81. package/src/decorators/orm/AfterRecover.mjs +28 -6
  82. package/src/decorators/orm/AfterRemove.cjs +27 -7
  83. package/src/decorators/orm/AfterRemove.mjs +28 -6
  84. package/src/decorators/orm/AfterSoftRemove.cjs +27 -7
  85. package/src/decorators/orm/AfterSoftRemove.mjs +28 -6
  86. package/src/decorators/orm/AfterUpdate.cjs +27 -7
  87. package/src/decorators/orm/AfterUpdate.mjs +28 -6
  88. package/src/decorators/orm/BeforeInsert.cjs +27 -7
  89. package/src/decorators/orm/BeforeInsert.mjs +28 -6
  90. package/src/decorators/orm/BeforeRecover.cjs +27 -7
  91. package/src/decorators/orm/BeforeRecover.mjs +28 -6
  92. package/src/decorators/orm/BeforeRemove.cjs +27 -7
  93. package/src/decorators/orm/BeforeRemove.mjs +28 -6
  94. package/src/decorators/orm/BeforeSoftRemove.cjs +27 -7
  95. package/src/decorators/orm/BeforeSoftRemove.mjs +28 -6
  96. package/src/decorators/orm/BeforeUpdate.cjs +27 -7
  97. package/src/decorators/orm/BeforeUpdate.mjs +28 -6
  98. package/src/decorators/orm/Check.cjs +30 -7
  99. package/src/decorators/orm/Check.mjs +31 -6
  100. package/src/decorators/orm/ChildEntity.cjs +30 -7
  101. package/src/decorators/orm/ChildEntity.mjs +31 -6
  102. package/src/decorators/orm/Column.cjs +62 -7
  103. package/src/decorators/orm/Column.mjs +63 -6
  104. package/src/decorators/orm/CreateDateColumn.cjs +26 -7
  105. package/src/decorators/orm/CreateDateColumn.mjs +27 -6
  106. package/src/decorators/orm/DeleteDateColumn.cjs +26 -7
  107. package/src/decorators/orm/DeleteDateColumn.mjs +27 -6
  108. package/src/decorators/orm/Entity.cjs +36 -7
  109. package/src/decorators/orm/Entity.mjs +37 -6
  110. package/src/decorators/orm/EventSubscriber.cjs +23 -7
  111. package/src/decorators/orm/EventSubscriber.mjs +24 -6
  112. package/src/decorators/orm/Exclusion.cjs +30 -7
  113. package/src/decorators/orm/Exclusion.mjs +31 -6
  114. package/src/decorators/orm/Generated.cjs +25 -7
  115. package/src/decorators/orm/Generated.mjs +26 -6
  116. package/src/decorators/orm/Index.cjs +42 -7
  117. package/src/decorators/orm/Index.mjs +43 -6
  118. package/src/decorators/orm/JoinColumn.cjs +30 -7
  119. package/src/decorators/orm/JoinColumn.mjs +31 -6
  120. package/src/decorators/orm/JoinTable.cjs +31 -7
  121. package/src/decorators/orm/JoinTable.mjs +32 -6
  122. package/src/decorators/orm/ManyToMany.cjs +43 -7
  123. package/src/decorators/orm/ManyToMany.mjs +44 -6
  124. package/src/decorators/orm/ManyToOne.cjs +43 -7
  125. package/src/decorators/orm/ManyToOne.mjs +44 -6
  126. package/src/decorators/orm/ObjectIdColumn.cjs +29 -7
  127. package/src/decorators/orm/ObjectIdColumn.mjs +30 -6
  128. package/src/decorators/orm/OneToMany.cjs +35 -7
  129. package/src/decorators/orm/OneToMany.mjs +36 -6
  130. package/src/decorators/orm/OneToOne.cjs +43 -7
  131. package/src/decorators/orm/OneToOne.mjs +44 -6
  132. package/src/decorators/orm/PrimaryColumn.cjs +50 -7
  133. package/src/decorators/orm/PrimaryColumn.mjs +51 -6
  134. package/src/decorators/orm/PrimaryGeneratedColumn.cjs +55 -7
  135. package/src/decorators/orm/PrimaryGeneratedColumn.mjs +56 -6
  136. package/src/decorators/orm/RelationId.cjs +27 -7
  137. package/src/decorators/orm/RelationId.mjs +28 -6
  138. package/src/decorators/orm/TableInheritance.cjs +27 -7
  139. package/src/decorators/orm/TableInheritance.mjs +28 -6
  140. package/src/decorators/orm/Tree.cjs +25 -7
  141. package/src/decorators/orm/Tree.mjs +26 -6
  142. package/src/decorators/orm/TreeChildren.cjs +32 -7
  143. package/src/decorators/orm/TreeChildren.mjs +33 -6
  144. package/src/decorators/orm/TreeLevelColumn.cjs +26 -7
  145. package/src/decorators/orm/TreeLevelColumn.mjs +27 -6
  146. package/src/decorators/orm/TreeParent.cjs +32 -7
  147. package/src/decorators/orm/TreeParent.mjs +33 -6
  148. package/src/decorators/orm/Unique.cjs +45 -7
  149. package/src/decorators/orm/Unique.mjs +46 -6
  150. package/src/decorators/orm/UpdateDateColumn.cjs +26 -7
  151. package/src/decorators/orm/UpdateDateColumn.mjs +27 -6
  152. package/src/decorators/orm/VersionColumn.cjs +26 -7
  153. package/src/decorators/orm/VersionColumn.mjs +27 -6
  154. package/src/decorators/orm/ViewColumn.cjs +26 -7
  155. package/src/decorators/orm/ViewColumn.mjs +27 -6
  156. package/src/decorators/orm/ViewEntity.cjs +35 -7
  157. package/src/decorators/orm/ViewEntity.mjs +36 -6
  158. package/src/decorators/orm/VirtualColumn.cjs +43 -7
  159. package/src/decorators/orm/VirtualColumn.mjs +44 -6
  160. package/src/lib/base/internal/ControllerEntrypoint.cjs +70 -610
  161. package/src/lib/base/internal/ControllerEntrypoint.mjs +87 -627
  162. package/src/lib/base/internal/StringifyPattern.cjs +1 -1
  163. package/src/lib/base/internal/StringifyPattern.mjs +1 -1
  164. package/src/lib/core/Application.cjs +3 -1
  165. package/src/lib/core/Application.mjs +3 -1
  166. package/src/lib/helpers/MD5.cjs +1 -1
  167. package/src/lib/helpers/MD5.mjs +1 -1
  168. package/src/lib/helpers/SHA1.cjs +1 -1
  169. package/src/lib/helpers/SHA1.mjs +1 -1
  170. package/src/lib/helpers/SHA256.cjs +1 -1
  171. package/src/lib/helpers/SHA256.mjs +1 -1
  172. package/src/lib/helpers/SortArray.cjs +1 -1
  173. package/src/lib/helpers/SortArray.mjs +1 -1
  174. package/src/lib/helpers/UUID.cjs +45 -0
  175. package/src/lib/helpers/UUID.mjs +39 -0
  176. package/src/providers/Database.cjs +0 -2
  177. package/src/providers/Database.mjs +0 -2
  178. package/vendor/Package.122.cjs +13223 -16706
  179. package/vendor/Package.122.mjs +13498 -16881
  180. package/vendor/Package.19.cjs +184 -195
  181. package/vendor/Package.19.mjs +176 -187
  182. package/vendor/Package.610.cjs +297 -113
  183. package/vendor/Package.610.mjs +285 -97
  184. package/vendor/Package.611.cjs +85 -103
  185. package/vendor/Package.611.mjs +80 -98
  186. package/vendor/Package.612.cjs +100 -121
  187. package/vendor/Package.612.mjs +97 -120
  188. package/vendor/Package.613.cjs +196 -0
  189. package/vendor/Package.613.mjs +180 -0
  190. package/vendor/Package.64.cjs +511 -134
  191. package/vendor/Package.64.mjs +491 -134
  192. package/vendor/Package.65.cjs +140 -4118
  193. package/vendor/Package.65.mjs +140 -4126
  194. package/vendor/Package.66.cjs +4142 -692
  195. package/vendor/Package.66.mjs +4151 -689
  196. package/vendor/Package.67.cjs +571 -535
  197. package/vendor/Package.67.mjs +586 -528
  198. package/vendor/Package.68.cjs +633 -96
  199. package/vendor/Package.68.mjs +619 -94
  200. package/vendor/Package.69.cjs +96 -294
  201. package/vendor/Package.69.mjs +95 -295
  202. package/vendor/TypeDef.internal.1.d.ts +1 -1
  203. package/vendor/TypeDef.internal.10.d.ts +1 -1
  204. package/vendor/TypeDef.internal.11.d.ts +2 -2
  205. package/vendor/TypeDef.internal.12.d.ts +2 -2
  206. package/vendor/TypeDef.internal.13.d.ts +6 -6
  207. package/vendor/TypeDef.internal.3.d.ts +3 -3
  208. package/vendor/TypeDef.internal.4.d.ts +181 -347
  209. package/vendor/TypeDef.internal.5.d.ts +2 -2
  210. package/vendor/TypeDef.internal.6.d.ts +2 -2
  211. package/vendor/TypeDef.internal.7.d.ts +1 -1
  212. package/vendor/TypeDef.internal.8.d.ts +1 -1
  213. package/vendor/TypeDef.internal.9.d.ts +1 -1
@@ -1,327 +1,127 @@
1
- import t from "events";
1
+ import e from "events";
2
2
 
3
- import { Buffer as e } from "buffer";
3
+ import t from "memjs";
4
4
 
5
- import { MongoClient as n, GridFSBucket as s, MongoServerError as a } from "mongodb";
5
+ import { d as s } from "./Package.67.mjs";
6
6
 
7
- var o = new Set([ "url", "collection", "namespace", "serialize", "deserialize", "uri", "useGridFS", "dialect", "db" ]);
7
+ import "buffer";
8
8
 
9
- var i = class extends t {
10
- ttlSupport=false;
11
- opts;
12
- connect;
9
+ var r = class extends e {
10
+ ttlSupport=true;
13
11
  namespace;
14
- constructor(t, e) {
12
+ client;
13
+ opts;
14
+ constructor(e, s) {
15
15
  super();
16
- t ??= {};
17
- if (typeof t === "string") {
18
- t = {
19
- url: t
20
- };
16
+ s = {
17
+ ...typeof e === "string" ? {
18
+ uri: e
19
+ } : e,
20
+ ...s
21
+ };
22
+ if (s.uri && s.url === void 0) {
23
+ s.url = s.uri;
21
24
  }
22
- if (t.uri) {
23
- t = {
24
- url: t.uri,
25
- ...t
26
- };
25
+ if (e === void 0) {
26
+ e = "localhost:11211";
27
+ s.url = s.uri = e;
27
28
  }
28
- this.opts = {
29
- url: "mongodb://127.0.0.1:27017",
30
- collection: "keyv",
31
- ...t,
32
- ...e
33
- };
34
- delete this.opts.emitErrors;
35
- const a = Object.fromEntries(Object.entries(this.opts).filter((([t]) => !o.has(t))));
36
- this.opts = Object.fromEntries(Object.entries(this.opts).filter((([t]) => o.has(t))));
37
- this.connect = new Promise((async (t, e) => {
38
- try {
39
- let e = "";
40
- if (this.opts.url) {
41
- e = this.opts.url;
42
- }
43
- const o = new n(e, a);
44
- await o.connect();
45
- const i = o.db(this.opts.db);
46
- if (this.opts.useGridFS) {
47
- const e = new s(i, {
48
- readPreference: this.opts.readPreference,
49
- bucketName: this.opts.collection
50
- });
51
- const n = i.collection(`${this.opts.collection}.files`);
52
- await n.createIndex({
53
- uploadDate: -1
54
- });
55
- await n.createIndex({
56
- "metadata.expiresAt": 1
57
- });
58
- await n.createIndex({
59
- "metadata.lastAccessed": 1
60
- });
61
- await n.createIndex({
62
- "metadata.filename": 1
63
- });
64
- t({
65
- bucket: e,
66
- store: n,
67
- db: i,
68
- mongoClient: o
69
- });
29
+ this.opts = s;
30
+ this.client = t.Client.create(e, s);
31
+ }
32
+ _getNamespace() {
33
+ return `namespace:${this.namespace}`;
34
+ }
35
+ async get(e) {
36
+ return new Promise(((t, r) => {
37
+ this.client.get(this.formatKey(e), ((e, i) => {
38
+ if (e) {
39
+ this.emit("error", e);
40
+ r(e);
70
41
  } else {
71
- let e = "keyv";
72
- if (this.opts.collection) {
73
- e = this.opts.collection;
42
+ let e;
43
+ if (i === null) {
44
+ e = {
45
+ value: void 0,
46
+ expires: 0
47
+ };
48
+ } else {
49
+ e = this.opts.deserialize ? this.opts.deserialize(i) : s(i);
74
50
  }
75
- const n = i.collection(e);
76
- await n.createIndex({
77
- key: 1
78
- }, {
79
- unique: true,
80
- background: true
81
- });
82
- await n.createIndex({
83
- expiresAt: 1
84
- }, {
85
- expireAfterSeconds: 0,
86
- background: true
87
- });
88
- t({
89
- store: n,
90
- mongoClient: o
91
- });
51
+ t(e);
92
52
  }
93
- } catch (t) {
94
- this.emit("error", t);
95
- }
53
+ }));
96
54
  }));
97
55
  }
98
- async get(t) {
99
- const n = await this.connect;
100
- if (this.opts.useGridFS) {
101
- await n.store.updateOne({
102
- filename: t
103
- }, {
104
- $set: {
105
- "metadata.lastAccessed": new Date
106
- }
107
- });
108
- const s = n.bucket.openDownloadStreamByName(t);
109
- return new Promise((t => {
110
- const n = [];
111
- s.on("error", (() => {
112
- t(void 0);
113
- }));
114
- s.on("end", (() => {
115
- const s = e.concat(n).toString("utf8");
116
- t(s);
117
- }));
118
- s.on("data", (t => {
119
- n.push(t);
120
- }));
121
- }));
56
+ async getMany(e) {
57
+ const t = [];
58
+ for (const s of e) {
59
+ t.push(this.get(s));
122
60
  }
123
- const s = await n.store.findOne({
124
- key: {
125
- $eq: t
61
+ return Promise.allSettled(t).then((e => {
62
+ const t = [];
63
+ for (const s of e) {
64
+ t.push(s.value);
126
65
  }
127
- });
128
- if (!s) {
129
- return void 0;
130
- }
131
- return s.value;
66
+ return t;
67
+ }));
132
68
  }
133
- async getMany(t) {
134
- if (this.opts.useGridFS) {
135
- const e = [];
136
- for (const n of t) {
137
- e.push(this.get(n));
138
- }
139
- const n = await Promise.allSettled(e);
140
- const s = [];
141
- for (const t of n) {
142
- s.push(t.value);
143
- }
144
- return s;
69
+ async set(e, t, s) {
70
+ const r = {};
71
+ if (s !== void 0) {
72
+ r.expires = r.ttl = Math.floor(s / 1e3);
145
73
  }
146
- const e = await this.connect;
147
- const n = await e.store.s.db.collection(this.opts.collection).find({
148
- key: {
149
- $in: t
150
- }
151
- }).project({
152
- _id: 0,
153
- value: 1,
154
- key: 1
155
- }).toArray();
156
- const s = [ ...t ];
157
- let a = 0;
158
- for (const e of t) {
159
- const t = n.findIndex((t => t.key === e));
160
- s[a] = t > -1 ? n[t].value : void 0;
161
- a++;
162
- }
163
- return s;
74
+ await this.client.set(this.formatKey(e), t, r);
164
75
  }
165
- async set(t, e, n) {
166
- const s = typeof n === "number" ? new Date(Date.now() + n) : null;
167
- if (this.opts.useGridFS) {
168
- const n = await this.connect;
169
- const a = n.bucket.openUploadStream(t, {
170
- metadata: {
171
- expiresAt: s,
172
- lastAccessed: new Date
76
+ async delete(e) {
77
+ return new Promise(((t, s) => {
78
+ this.client.delete(this.formatKey(e), ((e, r) => {
79
+ if (e) {
80
+ this.emit("error", e);
81
+ s(e);
82
+ } else {
83
+ t(Boolean(r));
173
84
  }
174
- });
175
- return new Promise((t => {
176
- a.on("finish", (() => {
177
- t(a);
178
- }));
179
- a.end(e);
180
85
  }));
181
- }
182
- const a = await this.connect;
183
- await a.store.updateOne({
184
- key: {
185
- $eq: t
186
- }
187
- }, {
188
- $set: {
189
- key: t,
190
- value: e,
191
- expiresAt: s
192
- }
193
- }, {
194
- upsert: true
195
- });
196
- }
197
- async delete(t) {
198
- if (typeof t !== "string") {
199
- return false;
200
- }
201
- const e = await this.connect;
202
- if (this.opts.useGridFS) {
203
- try {
204
- const n = e.db;
205
- const a = new s(n, {
206
- bucketName: this.opts.collection
207
- });
208
- const o = await a.find({
209
- filename: t
210
- }).toArray();
211
- await e.bucket.delete(o[0]._id);
212
- return true;
213
- } catch {
214
- return false;
215
- }
216
- }
217
- const n = await e.store.deleteOne({
218
- key: {
219
- $eq: t
220
- }
221
- });
222
- return n.deletedCount > 0;
86
+ }));
223
87
  }
224
- async deleteMany(t) {
225
- const e = await this.connect;
226
- if (this.opts.useGridFS) {
227
- const n = e.db;
228
- const a = new s(n, {
229
- bucketName: this.opts.collection
230
- });
231
- const o = await a.find({
232
- filename: {
233
- $in: t
234
- }
235
- }).toArray();
236
- if (o.length === 0) {
237
- return false;
238
- }
239
- await Promise.all(o.map((async t => e.bucket.delete(t._id))));
240
- return true;
241
- }
242
- const n = await e.store.deleteMany({
243
- key: {
244
- $in: t
245
- }
246
- });
247
- return n.deletedCount > 0;
88
+ async deleteMany(e) {
89
+ const t = e.map((async e => this.delete(e)));
90
+ const s = await Promise.allSettled(t);
91
+ return s.every((e => e.value === true));
248
92
  }
249
93
  async clear() {
250
- const t = await this.connect;
251
- if (this.opts.useGridFS) {
252
- try {
253
- await t.bucket.drop();
254
- } catch (t) {
255
- if (!(t instanceof a && t.code === 26)) {
256
- throw t;
257
- }
258
- }
259
- }
260
- await t.store.deleteMany({
261
- key: {
262
- $regex: this.namespace ? `^${this.namespace}:*` : ""
263
- }
264
- });
265
- }
266
- async clearExpired() {
267
- if (!this.opts.useGridFS) {
268
- return false;
269
- }
270
- return this.connect.then((async t => {
271
- const e = t.db;
272
- const n = new s(e, {
273
- bucketName: this.opts.collection
274
- });
275
- return n.find({
276
- "metadata.expiresAt": {
277
- $lte: new Date(Date.now())
94
+ return new Promise(((e, t) => {
95
+ this.client.flush((s => {
96
+ if (s) {
97
+ this.emit("error", s);
98
+ t(s);
99
+ } else {
100
+ e(void 0);
278
101
  }
279
- }).toArray().then((async e => Promise.all(e.map((async e => t.bucket.delete(e._id)))).then((() => true))));
102
+ }));
280
103
  }));
281
104
  }
282
- async clearUnusedFor(t) {
283
- if (!this.opts.useGridFS) {
284
- return false;
105
+ formatKey(e) {
106
+ let t = e;
107
+ if (this.namespace) {
108
+ t = this.namespace.trim() + ":" + e.trim();
285
109
  }
286
- const e = await this.connect;
287
- const n = e.db;
288
- const a = new s(n, {
289
- bucketName: this.opts.collection
290
- });
291
- const o = await a.find({
292
- "metadata.lastAccessed": {
293
- $lte: new Date(Date.now() - t * 1e3)
294
- }
295
- }).toArray();
296
- await Promise.all(o.map((async t => e.bucket.delete(t._id))));
297
- return true;
298
- }
299
- async* iterator(t) {
300
- const e = await this.connect;
301
- const n = new RegExp(`^${t ? t + ":" : ".*"}`);
302
- const s = this.opts.useGridFS ? e.store.find({
303
- filename: n
304
- }).map((async t => [ t.filename, await this.get(t.filename) ])) : e.store.find({
305
- key: n
306
- }).map((t => [ t.key, t.value ]));
307
- yield* s;
308
- }
309
- async has(t) {
310
- const e = await this.connect;
311
- const n = {
312
- [this.opts.useGridFS ? "filename" : "key"]: {
313
- $eq: t
314
- }
315
- };
316
- const s = await e.store.count(n);
317
- return s !== 0;
110
+ return t;
318
111
  }
319
- async disconnect() {
320
- const t = await this.connect;
321
- await t.mongoClient.close();
112
+ async has(e) {
113
+ return new Promise((t => {
114
+ this.client.get(this.formatKey(e), ((e, s) => {
115
+ if (e) {
116
+ t(false);
117
+ } else {
118
+ t(s !== null);
119
+ }
120
+ }));
121
+ }));
322
122
  }
323
123
  };
324
124
 
325
- var c = i;
125
+ var i = r;
326
126
 
327
- export { i as KeyvMongo, c as default };
127
+ export { r as KeyvMemcache, i as default };
@@ -276,4 +276,4 @@ declare class Time extends Date {
276
276
  clone(): Time;
277
277
  }
278
278
 
279
- export { Time as T };
279
+ export { Time };
@@ -11,4 +11,4 @@ interface IPatRun {
11
11
  toJSON(): string;
12
12
  }
13
13
 
14
- export type { ActionPattern as A, IPatRun as I };
14
+ export type { ActionPattern, IPatRun };
@@ -1,7 +1,7 @@
1
- import { I as IConstructor } from './TypeDef.internal.9.js';
1
+ import { IConstructor } from './TypeDef.internal.9.js';
2
2
 
3
3
  type ClassDecorator<Constructor extends IConstructor> = (target: Constructor) => Constructor | void;
4
4
 
5
5
  type PropertyDecorator<ClassPrototype> = (target: ClassPrototype, propertyKey: string | symbol) => void;
6
6
 
7
- export type { ClassDecorator as C, PropertyDecorator as P };
7
+ export type { ClassDecorator, PropertyDecorator };
@@ -1,4 +1,4 @@
1
- import { k as OrderByCondition } from './TypeDef.internal.4.js';
1
+ import { OrderByCondition } from './TypeDef.internal.4.js';
2
2
 
3
3
  /**
4
4
  * Describes all index options.
@@ -104,4 +104,4 @@ interface EntityOptions {
104
104
  comment?: string;
105
105
  }
106
106
 
107
- export type { EntityOptions as E, IndexOptions as I };
107
+ export type { EntityOptions, IndexOptions };
@@ -1,8 +1,8 @@
1
- import { P as Provider, B as BaseObject, I as IBaseObjectConstructor, a as Container, M as Module, C as Component } from './TypeDef.internal.3.js';
2
- import { D as DTO, J as JSONSchema, F as FunctionSchema } from './TypeDef.internal.5.js';
3
- import { A as ActionPattern, I as IPatRun } from './TypeDef.internal.10.js';
1
+ import { Provider, BaseObject, IBaseObjectConstructor, Container, Module, Component } from './TypeDef.internal.3.js';
2
+ import { DTO, JSONSchema, FunctionSchema } from './TypeDef.internal.5.js';
3
+ import { ActionPattern, IPatRun } from './TypeDef.internal.10.js';
4
4
  import { IncomingMessage, ServerResponse } from 'node:http';
5
- import { E as Exception } from './TypeDef.internal.7.js';
5
+ import { Exception } from './TypeDef.internal.7.js';
6
6
 
7
7
  /**
8
8
  * Context types
@@ -411,5 +411,5 @@ declare class Entrypoint extends Component {
411
411
  getCliActions(): EntrypointActions<CLIActionInfo>;
412
412
  }
413
413
 
414
- export { BuildCLIEntrypoint as l, BuildHTTPEntrypoint as m, BuildServiceEntrypoint as n, BuildEntrypoints as o, Entrypoint as p, ContextType as q, BaseContext as r, CLIContext as s, HTTPContext as t, ServiceContext as u, Controller as w, AccessControlRule as y };
415
- export type { ActionGroupInfo as A, BaseActionInfo as B, CLIEntrypoint as C, EntrypointDestroyer as E, HTTPEntrypoint as H, ServiceEntrypoint as S, CLIMap as a, HTTPRouteMap as b, CLIEntrypointHandler as c, HTTPEntrypointHandler as d, ServiceEntrypointHandler as e, EntrypointDestroyerRegistrar as f, EntrypointOptions as g, HTTPActionInfo as h, ServiceActionInfo as i, CLIActionInfo as j, EntrypointActions as k, ControllerProperty as v, AccessControlRuleHandler as x };
414
+ export { AccessControlRule, BaseContext, BuildCLIEntrypoint, BuildEntrypoints, BuildHTTPEntrypoint, BuildServiceEntrypoint, CLIContext, ContextType, Controller, Entrypoint, HTTPContext, ServiceContext };
415
+ export type { AccessControlRuleHandler, ActionGroupInfo, BaseActionInfo, CLIActionInfo, CLIEntrypoint, CLIEntrypointHandler, CLIMap, ControllerProperty, EntrypointActions, EntrypointDestroyer, EntrypointDestroyerRegistrar, EntrypointOptions, HTTPActionInfo, HTTPEntrypoint, HTTPEntrypointHandler, HTTPRouteMap, ServiceActionInfo, ServiceEntrypoint, ServiceEntrypointHandler };
@@ -1,4 +1,4 @@
1
- import { D as DTO } from './TypeDef.internal.5.js';
1
+ import { DTO } from './TypeDef.internal.5.js';
2
2
  import './TypeDef.internal.2.js';
3
3
 
4
4
  /**
@@ -979,5 +979,5 @@ declare class Container {
979
979
  destroy(): Promise<void>;
980
980
  }
981
981
 
982
- export { BaseObject as B, Component as C, Module as M, OverridableNamedObjectOptions as O, Provider as P, Container as a, ModuleOptions as b, ModuleConfigLoader as c, LoadObjectOptions as d, LoadAnonymousObjectOptions as h, LoadNamedObjectOptions as i, ModuleLoadObjectsOptions as j, OverridableObjectOptions as k };
983
- export type { EventAndListener as E, IBaseObjectConstructor as I, LifetimeType as L, ConstructorOptions as e, event as f, ListenerFn as g };
982
+ export { BaseObject, Component, Container, LoadAnonymousObjectOptions, LoadNamedObjectOptions, LoadObjectOptions, Module, ModuleConfigLoader, ModuleLoadObjectsOptions, ModuleOptions, OverridableNamedObjectOptions, OverridableObjectOptions, Provider };
983
+ export type { ConstructorOptions, EventAndListener, IBaseObjectConstructor, LifetimeType, ListenerFn, event };