lakutata 2.0.81 → 2.0.83

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 (234) hide show
  1. package/com/docker.cjs +1 -1
  2. package/com/docker.mjs +1 -1
  3. package/decorator/orm.cjs +84 -84
  4. package/decorator/orm.mjs +42 -128
  5. package/orm.cjs +873 -1410
  6. package/orm.mjs +708 -1458
  7. package/package.json +1 -1
  8. package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +230 -239
  9. package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +230 -239
  10. package/src/components/docker/ConnectionOptionsBuilder.cjs +1 -1
  11. package/src/components/docker/ConnectionOptionsBuilder.mjs +1 -1
  12. package/src/components/docker/Docker.cjs +4919 -4808
  13. package/src/components/docker/Docker.mjs +4939 -4828
  14. package/src/components/docker/lib/DockerContainer.cjs +1 -1
  15. package/src/components/docker/lib/DockerContainer.mjs +1 -1
  16. package/src/components/docker/lib/DockerContainerTTY.cjs +1 -1
  17. package/src/components/docker/lib/DockerContainerTTY.mjs +1 -1
  18. package/src/components/entrypoint/Entrypoint.cjs +1669 -2159
  19. package/src/components/entrypoint/Entrypoint.mjs +1629 -2119
  20. package/src/decorators/orm/AfterInsert.cjs +26 -4
  21. package/src/decorators/orm/AfterInsert.mjs +25 -5
  22. package/src/decorators/orm/AfterLoad.cjs +26 -4
  23. package/src/decorators/orm/AfterLoad.mjs +25 -5
  24. package/src/decorators/orm/AfterRecover.cjs +26 -4
  25. package/src/decorators/orm/AfterRecover.mjs +25 -5
  26. package/src/decorators/orm/AfterRemove.cjs +26 -4
  27. package/src/decorators/orm/AfterRemove.mjs +25 -5
  28. package/src/decorators/orm/AfterSoftRemove.cjs +26 -4
  29. package/src/decorators/orm/AfterSoftRemove.mjs +25 -5
  30. package/src/decorators/orm/AfterUpdate.cjs +26 -4
  31. package/src/decorators/orm/AfterUpdate.mjs +25 -5
  32. package/src/decorators/orm/BeforeInsert.cjs +26 -4
  33. package/src/decorators/orm/BeforeInsert.mjs +25 -5
  34. package/src/decorators/orm/BeforeRecover.cjs +26 -4
  35. package/src/decorators/orm/BeforeRecover.mjs +25 -5
  36. package/src/decorators/orm/BeforeRemove.cjs +26 -4
  37. package/src/decorators/orm/BeforeRemove.mjs +25 -5
  38. package/src/decorators/orm/BeforeSoftRemove.cjs +26 -4
  39. package/src/decorators/orm/BeforeSoftRemove.mjs +25 -5
  40. package/src/decorators/orm/BeforeUpdate.cjs +26 -4
  41. package/src/decorators/orm/BeforeUpdate.mjs +25 -5
  42. package/src/decorators/orm/Check.cjs +29 -4
  43. package/src/decorators/orm/Check.mjs +28 -5
  44. package/src/decorators/orm/ChildEntity.cjs +29 -4
  45. package/src/decorators/orm/ChildEntity.mjs +28 -5
  46. package/src/decorators/orm/Column.cjs +61 -4
  47. package/src/decorators/orm/Column.mjs +61 -6
  48. package/src/decorators/orm/CreateDateColumn.cjs +25 -4
  49. package/src/decorators/orm/CreateDateColumn.mjs +24 -5
  50. package/src/decorators/orm/DeleteDateColumn.cjs +25 -4
  51. package/src/decorators/orm/DeleteDateColumn.mjs +23 -4
  52. package/src/decorators/orm/Entity.cjs +35 -4
  53. package/src/decorators/orm/Entity.mjs +33 -4
  54. package/src/decorators/orm/EventSubscriber.cjs +22 -4
  55. package/src/decorators/orm/EventSubscriber.mjs +21 -5
  56. package/src/decorators/orm/Exclusion.cjs +29 -4
  57. package/src/decorators/orm/Exclusion.mjs +28 -5
  58. package/src/decorators/orm/Generated.cjs +24 -4
  59. package/src/decorators/orm/Generated.mjs +23 -5
  60. package/src/decorators/orm/Index.cjs +41 -4
  61. package/src/decorators/orm/Index.mjs +41 -6
  62. package/src/decorators/orm/JoinColumn.cjs +29 -4
  63. package/src/decorators/orm/JoinColumn.mjs +28 -5
  64. package/src/decorators/orm/JoinTable.cjs +30 -4
  65. package/src/decorators/orm/JoinTable.mjs +28 -4
  66. package/src/decorators/orm/ManyToMany.cjs +42 -4
  67. package/src/decorators/orm/ManyToMany.mjs +40 -4
  68. package/src/decorators/orm/ManyToOne.cjs +42 -4
  69. package/src/decorators/orm/ManyToOne.mjs +40 -4
  70. package/src/decorators/orm/ObjectIdColumn.cjs +28 -4
  71. package/src/decorators/orm/ObjectIdColumn.mjs +27 -5
  72. package/src/decorators/orm/OneToMany.cjs +34 -4
  73. package/src/decorators/orm/OneToMany.mjs +34 -6
  74. package/src/decorators/orm/OneToOne.cjs +42 -4
  75. package/src/decorators/orm/OneToOne.mjs +40 -4
  76. package/src/decorators/orm/PrimaryColumn.cjs +49 -4
  77. package/src/decorators/orm/PrimaryColumn.mjs +49 -6
  78. package/src/decorators/orm/PrimaryGeneratedColumn.cjs +54 -4
  79. package/src/decorators/orm/PrimaryGeneratedColumn.mjs +54 -6
  80. package/src/decorators/orm/RelationId.cjs +26 -4
  81. package/src/decorators/orm/RelationId.mjs +25 -5
  82. package/src/decorators/orm/TableInheritance.cjs +26 -4
  83. package/src/decorators/orm/TableInheritance.mjs +25 -5
  84. package/src/decorators/orm/Tree.cjs +24 -4
  85. package/src/decorators/orm/Tree.mjs +23 -5
  86. package/src/decorators/orm/TreeChildren.cjs +31 -4
  87. package/src/decorators/orm/TreeChildren.mjs +29 -4
  88. package/src/decorators/orm/TreeLevelColumn.cjs +25 -4
  89. package/src/decorators/orm/TreeLevelColumn.mjs +23 -4
  90. package/src/decorators/orm/TreeParent.cjs +31 -4
  91. package/src/decorators/orm/TreeParent.mjs +29 -4
  92. package/src/decorators/orm/Unique.cjs +44 -4
  93. package/src/decorators/orm/Unique.mjs +44 -6
  94. package/src/decorators/orm/UpdateDateColumn.cjs +25 -4
  95. package/src/decorators/orm/UpdateDateColumn.mjs +24 -5
  96. package/src/decorators/orm/VersionColumn.cjs +25 -4
  97. package/src/decorators/orm/VersionColumn.mjs +24 -5
  98. package/src/decorators/orm/ViewColumn.cjs +25 -4
  99. package/src/decorators/orm/ViewColumn.mjs +24 -5
  100. package/src/decorators/orm/ViewEntity.cjs +34 -4
  101. package/src/decorators/orm/ViewEntity.mjs +33 -5
  102. package/src/decorators/orm/VirtualColumn.cjs +42 -4
  103. package/src/decorators/orm/VirtualColumn.mjs +40 -4
  104. package/src/lib/base/EventEmitter.cjs +1193 -1200
  105. package/src/lib/base/EventEmitter.mjs +1194 -1201
  106. package/src/lib/base/internal/DataValidator.cjs +185 -174
  107. package/src/lib/base/internal/DataValidator.mjs +186 -175
  108. package/src/lib/base/internal/PatternManager.cjs +735 -740
  109. package/src/lib/base/internal/PatternManager.mjs +740 -745
  110. package/src/lib/core/Application.cjs +99 -112
  111. package/src/lib/core/Application.mjs +127 -140
  112. package/src/lib/helpers/IsHtml.cjs +13 -7
  113. package/src/lib/helpers/IsHtml.mjs +13 -7
  114. package/src/lib/helpers/IsXML.cjs +1016 -1158
  115. package/src/lib/helpers/IsXML.mjs +729 -871
  116. package/src/lib/helpers/ObjectHash.cjs +371 -378
  117. package/src/lib/helpers/ObjectHash.mjs +371 -378
  118. package/src/lib/helpers/RandomString.cjs +146 -167
  119. package/src/lib/helpers/RandomString.mjs +145 -166
  120. package/src/lib/helpers/URLBuilder.cjs +355 -355
  121. package/src/lib/helpers/URLBuilder.mjs +350 -350
  122. package/src/lib/ioc/ListModules.cjs +5237 -5160
  123. package/src/lib/ioc/ListModules.mjs +5252 -5175
  124. package/src/lib/validation/VLD.cjs +3903 -4080
  125. package/src/lib/validation/VLD.mjs +2793 -2970
  126. package/src/providers/migration/GenerateMigration.cjs +2 -2
  127. package/src/providers/migration/GenerateMigration.mjs +2 -2
  128. package/vendor/Package.112.cjs +38321 -38240
  129. package/vendor/Package.112.mjs +37720 -37579
  130. package/vendor/Package.16.cjs +7386 -7268
  131. package/vendor/Package.16.mjs +6706 -6588
  132. package/vendor/Package.18.cjs +48229 -20
  133. package/vendor/Package.18.mjs +48192 -24
  134. package/vendor/Package.2.cjs +5698 -5727
  135. package/vendor/Package.2.mjs +5707 -5736
  136. package/vendor/Package.4.cjs +874 -884
  137. package/vendor/Package.4.mjs +874 -884
  138. package/vendor/Package.5.cjs +11 -15
  139. package/vendor/Package.5.mjs +7 -11
  140. package/vendor/Package.6.cjs +511 -520
  141. package/vendor/Package.6.mjs +534 -543
  142. package/vendor/Package.62.cjs +87 -90
  143. package/vendor/Package.62.mjs +180 -183
  144. package/vendor/Package.65.cjs +1285 -1292
  145. package/vendor/Package.65.mjs +190 -197
  146. package/vendor/Package.68.cjs +111 -252
  147. package/vendor/Package.68.mjs +134 -268
  148. package/vendor/Package.9.cjs +118 -132
  149. package/vendor/Package.9.mjs +124 -138
  150. package/vendor/TypeDef.internal.3.d.ts +0 -14
  151. package/vendor/Package.19.cjs +0 -37
  152. package/vendor/Package.19.mjs +0 -35
  153. package/vendor/Package.20.cjs +0 -37
  154. package/vendor/Package.20.mjs +0 -35
  155. package/vendor/Package.21.cjs +0 -37
  156. package/vendor/Package.21.mjs +0 -35
  157. package/vendor/Package.22.cjs +0 -37
  158. package/vendor/Package.22.mjs +0 -35
  159. package/vendor/Package.23.cjs +0 -37
  160. package/vendor/Package.23.mjs +0 -35
  161. package/vendor/Package.24.cjs +0 -37
  162. package/vendor/Package.24.mjs +0 -35
  163. package/vendor/Package.25.cjs +0 -37
  164. package/vendor/Package.25.mjs +0 -35
  165. package/vendor/Package.26.cjs +0 -37
  166. package/vendor/Package.26.mjs +0 -35
  167. package/vendor/Package.27.cjs +0 -37
  168. package/vendor/Package.27.mjs +0 -35
  169. package/vendor/Package.28.cjs +0 -37
  170. package/vendor/Package.28.mjs +0 -35
  171. package/vendor/Package.29.cjs +0 -40
  172. package/vendor/Package.29.mjs +0 -38
  173. package/vendor/Package.30.cjs +0 -41
  174. package/vendor/Package.30.mjs +0 -39
  175. package/vendor/Package.31.cjs +0 -72
  176. package/vendor/Package.31.mjs +0 -70
  177. package/vendor/Package.32.cjs +0 -37
  178. package/vendor/Package.32.mjs +0 -35
  179. package/vendor/Package.33.cjs +0 -37
  180. package/vendor/Package.33.mjs +0 -35
  181. package/vendor/Package.34.cjs +0 -46
  182. package/vendor/Package.34.mjs +0 -44
  183. package/vendor/Package.35.cjs +0 -34
  184. package/vendor/Package.35.mjs +0 -32
  185. package/vendor/Package.36.cjs +0 -40
  186. package/vendor/Package.36.mjs +0 -38
  187. package/vendor/Package.37.cjs +0 -36
  188. package/vendor/Package.37.mjs +0 -34
  189. package/vendor/Package.38.cjs +0 -52
  190. package/vendor/Package.38.mjs +0 -50
  191. package/vendor/Package.39.cjs +0 -41
  192. package/vendor/Package.39.mjs +0 -39
  193. package/vendor/Package.40.cjs +0 -42
  194. package/vendor/Package.40.mjs +0 -40
  195. package/vendor/Package.41.cjs +0 -53
  196. package/vendor/Package.41.mjs +0 -51
  197. package/vendor/Package.42.cjs +0 -53
  198. package/vendor/Package.42.mjs +0 -51
  199. package/vendor/Package.43.cjs +0 -40
  200. package/vendor/Package.43.mjs +0 -38
  201. package/vendor/Package.44.cjs +0 -46
  202. package/vendor/Package.44.mjs +0 -44
  203. package/vendor/Package.45.cjs +0 -53
  204. package/vendor/Package.45.mjs +0 -51
  205. package/vendor/Package.46.cjs +0 -59
  206. package/vendor/Package.46.mjs +0 -57
  207. package/vendor/Package.47.cjs +0 -65
  208. package/vendor/Package.47.mjs +0 -63
  209. package/vendor/Package.48.cjs +0 -38
  210. package/vendor/Package.48.mjs +0 -36
  211. package/vendor/Package.49.cjs +0 -38
  212. package/vendor/Package.49.mjs +0 -36
  213. package/vendor/Package.50.cjs +0 -36
  214. package/vendor/Package.50.mjs +0 -34
  215. package/vendor/Package.51.cjs +0 -43
  216. package/vendor/Package.51.mjs +0 -41
  217. package/vendor/Package.52.cjs +0 -37
  218. package/vendor/Package.52.mjs +0 -35
  219. package/vendor/Package.53.cjs +0 -43
  220. package/vendor/Package.53.mjs +0 -41
  221. package/vendor/Package.54.cjs +0 -55
  222. package/vendor/Package.54.mjs +0 -53
  223. package/vendor/Package.55.cjs +0 -37
  224. package/vendor/Package.55.mjs +0 -35
  225. package/vendor/Package.56.cjs +0 -37
  226. package/vendor/Package.56.mjs +0 -35
  227. package/vendor/Package.57.cjs +0 -37
  228. package/vendor/Package.57.mjs +0 -35
  229. package/vendor/Package.58.cjs +0 -45
  230. package/vendor/Package.58.mjs +0 -43
  231. package/vendor/Package.59.cjs +0 -53
  232. package/vendor/Package.59.mjs +0 -51
  233. package/vendor/Package.60.cjs +0 -47649
  234. package/vendor/Package.60.mjs +0 -47606
@@ -312,269 +312,260 @@ function k() {
312
312
  return g;
313
313
  }
314
314
 
315
- var S;
316
-
317
- function w() {
318
- if (S) return c;
319
- S = 1;
320
- (function(e) {
321
- "use strict";
322
- Object.defineProperty(e, "__esModule", {
323
- value: true
324
- });
325
- e.KeyvFile = e.defaultOpts = void 0;
326
- const t = r;
327
- const i = t.__importStar(o);
328
- const c = t.__importStar(a);
329
- const p = t.__importStar(n);
330
- const u = t.__importDefault(l);
331
- const d = h();
332
- const f = t.__importDefault(s);
333
- const y = v();
334
- t.__exportStar(k(), e);
335
- e.defaultOpts = {
336
- deserialize: e => (0, d.defaultDeserialize)(e.toString()),
337
- dialect: "redis",
338
- expiredCheckDelay: 24 * 3600 * 1e3,
339
- filename: `${i.tmpdir()}/keyv-file/default.json`,
340
- serialize: d.defaultSerialize,
341
- writeDelay: 100,
342
- checkFileLock: false,
343
- separatedFile: false
344
- };
345
- function m(e) {
346
- return typeof e === "number";
347
- }
348
- class KeyvFile extends u.default {
349
- ttlSupport=true;
350
- namespace;
351
- opts;
352
- _data=new Map;
353
- _lastExpire=0;
354
- _separated;
355
- constructor(t) {
356
- super();
357
- this.opts = Object.assign({}, e.defaultOpts, t);
358
- this._separated = new y.SeparatedFileHelper(this.opts);
359
- if (this.opts.checkFileLock) {
360
- this.acquireFileLock();
361
- }
362
- if (this.opts.separatedFile) {
363
- c.mkdirSync(this.opts.filename, {
364
- recursive: true
365
- });
366
- this._lastExpire = this._separated.getLastExpire();
367
- } else {
368
- this._loadDataSync();
369
- }
315
+ (function(e) {
316
+ "use strict";
317
+ Object.defineProperty(e, "__esModule", {
318
+ value: true
319
+ });
320
+ e.KeyvFile = e.defaultOpts = void 0;
321
+ const t = r;
322
+ const i = t.__importStar(o);
323
+ const c = t.__importStar(a);
324
+ const p = t.__importStar(n);
325
+ const u = t.__importDefault(l);
326
+ const d = h();
327
+ const f = t.__importDefault(s);
328
+ const y = v();
329
+ t.__exportStar(k(), e);
330
+ e.defaultOpts = {
331
+ deserialize: e => (0, d.defaultDeserialize)(e.toString()),
332
+ dialect: "redis",
333
+ expiredCheckDelay: 24 * 3600 * 1e3,
334
+ filename: `${i.tmpdir()}/keyv-file/default.json`,
335
+ serialize: d.defaultSerialize,
336
+ writeDelay: 100,
337
+ checkFileLock: false,
338
+ separatedFile: false
339
+ };
340
+ function m(e) {
341
+ return typeof e === "number";
342
+ }
343
+ class KeyvFile extends u.default {
344
+ ttlSupport=true;
345
+ namespace;
346
+ opts;
347
+ _data=new Map;
348
+ _lastExpire=0;
349
+ _separated;
350
+ constructor(t) {
351
+ super();
352
+ this.opts = Object.assign({}, e.defaultOpts, t);
353
+ this._separated = new y.SeparatedFileHelper(this.opts);
354
+ if (this.opts.checkFileLock) {
355
+ this.acquireFileLock();
356
+ }
357
+ if (this.opts.separatedFile) {
358
+ c.mkdirSync(this.opts.filename, {
359
+ recursive: true
360
+ });
361
+ this._lastExpire = this._separated.getLastExpire();
362
+ } else {
363
+ this._loadDataSync();
370
364
  }
371
- _loadDataSync() {
372
- try {
373
- const e = this.opts.deserialize(c.readFileSync(this.opts.filename));
374
- if (!Array.isArray(e.cache)) {
375
- const t = e.cache;
376
- e.cache = [];
377
- for (const r in t) {
378
- if (t.hasOwnProperty(r)) {
379
- e.cache.push([ r, t[r] ]);
380
- }
365
+ }
366
+ _loadDataSync() {
367
+ try {
368
+ const e = this.opts.deserialize(c.readFileSync(this.opts.filename));
369
+ if (!Array.isArray(e.cache)) {
370
+ const t = e.cache;
371
+ e.cache = [];
372
+ for (const r in t) {
373
+ if (t.hasOwnProperty(r)) {
374
+ e.cache.push([ r, t[r] ]);
381
375
  }
382
376
  }
383
- this._data = new Map(e.cache);
384
- this._lastExpire = e.lastExpire;
385
- } catch (e) {
386
- (0, y.handleIOError)(e);
387
- this._data = new Map;
388
- this._lastExpire = Date.now();
389
377
  }
378
+ this._data = new Map(e.cache);
379
+ this._lastExpire = e.lastExpire;
380
+ } catch (e) {
381
+ (0, y.handleIOError)(e);
382
+ this._data = new Map;
383
+ this._lastExpire = Date.now();
390
384
  }
391
- get _lockFile() {
392
- if (this.opts.separatedFile) {
393
- return this._separated.lockFile;
394
- }
395
- return this.opts.filename + ".lock";
396
- }
397
- acquireFileLock() {
398
- try {
399
- let e = c.openSync(this._lockFile, "wx");
400
- c.closeSync(e);
401
- process.on("SIGINT", (() => {
402
- this.releaseFileLock();
403
- process.exit(0);
404
- }));
405
- process.on("exit", (() => {
406
- this.releaseFileLock();
407
- }));
408
- } catch (e) {
409
- console.error(`[keyv-file] There is another process using this file`);
410
- throw e;
411
- }
385
+ }
386
+ get _lockFile() {
387
+ if (this.opts.separatedFile) {
388
+ return this._separated.lockFile;
412
389
  }
413
- releaseFileLock() {
414
- try {
415
- c.unlinkSync(this._lockFile);
416
- } catch (e) {
417
- (0, y.handleIOError)(e);
418
- }
390
+ return this.opts.filename + ".lock";
391
+ }
392
+ acquireFileLock() {
393
+ try {
394
+ let e = c.openSync(this._lockFile, "wx");
395
+ c.closeSync(e);
396
+ process.on("SIGINT", (() => {
397
+ this.releaseFileLock();
398
+ process.exit(0);
399
+ }));
400
+ process.on("exit", (() => {
401
+ this.releaseFileLock();
402
+ }));
403
+ } catch (e) {
404
+ console.error(`[keyv-file] There is another process using this file`);
405
+ throw e;
419
406
  }
420
- async get(e) {
421
- if (this.opts.separatedFile) {
422
- let t = await this._separated.get(e);
423
- return this._getWithExpire(e, t);
424
- }
425
- return this.getSync(e);
407
+ }
408
+ releaseFileLock() {
409
+ try {
410
+ c.unlinkSync(this._lockFile);
411
+ } catch (e) {
412
+ (0, y.handleIOError)(e);
426
413
  }
427
- getSync(e) {
428
- if (this.opts.separatedFile) {
429
- let t = this._separated.getSync(e);
430
- return this._getWithExpire(e, t);
431
- }
432
- let t = void 0;
433
- try {
434
- const t = this._data.get(e);
435
- return this._getWithExpire(e, t);
436
- } catch (e) {
437
- (0, y.handleIOError)(e);
438
- }
439
- return t;
414
+ }
415
+ async get(e) {
416
+ if (this.opts.separatedFile) {
417
+ let t = await this._separated.get(e);
418
+ return this._getWithExpire(e, t);
440
419
  }
441
- async getMany(e) {
442
- if (this.opts.separatedFile) {
443
- return Promise.all(e.map((e => this.get(e))));
444
- }
445
- return e.map((e => this.getSync(e)));
420
+ return this.getSync(e);
421
+ }
422
+ getSync(e) {
423
+ if (this.opts.separatedFile) {
424
+ let t = this._separated.getSync(e);
425
+ return this._getWithExpire(e, t);
446
426
  }
447
- async set(e, t, r) {
448
- if (r === 0) {
449
- r = undefined;
450
- }
451
- t = {
452
- expire: m(r) ? Date.now() + r : undefined,
453
- value: t
454
- };
455
- this.clearExpire();
456
- if (this.opts.separatedFile) {
457
- return this._separated.set(e, t);
458
- }
459
- this._data.set(e, t);
460
- return this.save();
427
+ let t = void 0;
428
+ try {
429
+ const t = this._data.get(e);
430
+ return this._getWithExpire(e, t);
431
+ } catch (e) {
432
+ (0, y.handleIOError)(e);
461
433
  }
462
- async delete(e) {
463
- if (this.opts.separatedFile) {
464
- return this._separated.delete(e);
465
- }
466
- const t = this._data.delete(e);
467
- await this.save();
468
- return t;
469
- }
470
- async deleteMany(e) {
471
- if (this.opts.separatedFile) {
472
- let t = await Promise.all(e.map((e => this.delete(e))));
473
- return t.every((e => e));
474
- }
475
- let t = e.every((e => this._data.delete(e)));
476
- await this.save();
477
- return t;
478
- }
479
- async clear() {
480
- if (this.opts.separatedFile) {
481
- await this._separated.clear();
482
- this._lastExpire = 0;
483
- return true;
484
- }
485
- this._data = new Map;
486
- this._lastExpire = Date.now();
487
- return this.save();
434
+ return t;
435
+ }
436
+ async getMany(e) {
437
+ if (this.opts.separatedFile) {
438
+ return Promise.all(e.map((e => this.get(e))));
488
439
  }
489
- async has(e) {
490
- const t = await this.get(e);
491
- return t !== undefined;
440
+ return e.map((e => this.getSync(e)));
441
+ }
442
+ async set(e, t, r) {
443
+ if (r === 0) {
444
+ r = undefined;
492
445
  }
493
- isExpired(e) {
494
- return m(e.expire) && e.expire <= Date.now();
446
+ t = {
447
+ expire: m(r) ? Date.now() + r : undefined,
448
+ value: t
449
+ };
450
+ this.clearExpire();
451
+ if (this.opts.separatedFile) {
452
+ return this._separated.set(e, t);
495
453
  }
496
- _getWithExpire(e, t) {
497
- if (!t) {
498
- return;
499
- }
500
- if (this.isExpired(t)) {
501
- this.delete(e);
502
- return;
503
- }
504
- return t.value;
454
+ this._data.set(e, t);
455
+ return this.save();
456
+ }
457
+ async delete(e) {
458
+ if (this.opts.separatedFile) {
459
+ return this._separated.delete(e);
505
460
  }
506
- clearExpire() {
507
- const e = Date.now();
508
- if (e - this._lastExpire <= this.opts.expiredCheckDelay) {
509
- return;
510
- }
511
- this._lastExpire = e;
512
- if (this.opts.separatedFile) {
513
- this._separated.clearExpire((e => this.get(e)));
514
- return;
515
- }
516
- for (const e of this._data.keys()) {
517
- const t = this._data.get(e);
518
- this._getWithExpire(e, t);
519
- }
461
+ const t = this._data.delete(e);
462
+ await this.save();
463
+ return t;
464
+ }
465
+ async deleteMany(e) {
466
+ if (this.opts.separatedFile) {
467
+ let t = await Promise.all(e.map((e => this.delete(e))));
468
+ return t.every((e => e));
520
469
  }
521
- async saveToDisk() {
522
- const e = [];
523
- for (const [t, r] of this._data) {
524
- e.push([ t, r ]);
525
- }
526
- const t = this.opts.serialize({
527
- cache: e,
528
- lastExpire: this._lastExpire
529
- });
530
- await p.mkdir(f.default.dirname(this.opts.filename), {
531
- recursive: true
532
- });
533
- return p.writeFile(this.opts.filename, t);
470
+ let t = e.every((e => this._data.delete(e)));
471
+ await this.save();
472
+ return t;
473
+ }
474
+ async clear() {
475
+ if (this.opts.separatedFile) {
476
+ await this._separated.clear();
477
+ this._lastExpire = 0;
478
+ return true;
534
479
  }
535
- _savePromise;
536
- save() {
537
- this.clearExpire();
538
- if (this._savePromise) {
539
- return this._savePromise;
540
- }
541
- this._savePromise = new Promise(((e, t) => {
542
- setTimeout((() => {
543
- this.saveToDisk().then(e, t).finally((() => {
544
- this._savePromise = void 0;
545
- }));
546
- }), this.opts.writeDelay);
547
- }));
548
- return this._savePromise;
480
+ this._data = new Map;
481
+ this._lastExpire = Date.now();
482
+ return this.save();
483
+ }
484
+ async has(e) {
485
+ const t = await this.get(e);
486
+ return t !== undefined;
487
+ }
488
+ isExpired(e) {
489
+ return m(e.expire) && e.expire <= Date.now();
490
+ }
491
+ _getWithExpire(e, t) {
492
+ if (!t) {
493
+ return;
549
494
  }
550
- disconnect() {
551
- return Promise.resolve();
495
+ if (this.isExpired(t)) {
496
+ this.delete(e);
497
+ return;
552
498
  }
553
- async* iterator(e) {
554
- let t = this.opts.separatedFile ? await this._separated.entries() : this._data.entries();
555
- for (const [r, i] of t) {
556
- if (r === undefined || i === undefined) {
557
- continue;
558
- }
559
- if (!e || r.includes(e)) {
560
- yield [ r, i.value ];
561
- }
499
+ return t.value;
500
+ }
501
+ clearExpire() {
502
+ const e = Date.now();
503
+ if (e - this._lastExpire <= this.opts.expiredCheckDelay) {
504
+ return;
505
+ }
506
+ this._lastExpire = e;
507
+ if (this.opts.separatedFile) {
508
+ this._separated.clearExpire((e => this.get(e)));
509
+ return;
510
+ }
511
+ for (const e of this._data.keys()) {
512
+ const t = this._data.get(e);
513
+ this._getWithExpire(e, t);
514
+ }
515
+ }
516
+ async saveToDisk() {
517
+ const e = [];
518
+ for (const [t, r] of this._data) {
519
+ e.push([ t, r ]);
520
+ }
521
+ const t = this.opts.serialize({
522
+ cache: e,
523
+ lastExpire: this._lastExpire
524
+ });
525
+ await p.mkdir(f.default.dirname(this.opts.filename), {
526
+ recursive: true
527
+ });
528
+ return p.writeFile(this.opts.filename, t);
529
+ }
530
+ _savePromise;
531
+ save() {
532
+ this.clearExpire();
533
+ if (this._savePromise) {
534
+ return this._savePromise;
535
+ }
536
+ this._savePromise = new Promise(((e, t) => {
537
+ setTimeout((() => {
538
+ this.saveToDisk().then(e, t).finally((() => {
539
+ this._savePromise = void 0;
540
+ }));
541
+ }), this.opts.writeDelay);
542
+ }));
543
+ return this._savePromise;
544
+ }
545
+ disconnect() {
546
+ return Promise.resolve();
547
+ }
548
+ async* iterator(e) {
549
+ let t = this.opts.separatedFile ? await this._separated.entries() : this._data.entries();
550
+ for (const [r, i] of t) {
551
+ if (r === undefined || i === undefined) {
552
+ continue;
553
+ }
554
+ if (!e || r.includes(e)) {
555
+ yield [ r, i.value ];
562
556
  }
563
557
  }
564
558
  }
565
- e.KeyvFile = KeyvFile;
566
- e.default = KeyvFile;
567
- })(c);
568
- return c;
569
- }
570
-
571
- var x = w();
559
+ }
560
+ e.KeyvFile = KeyvFile;
561
+ e.default = KeyvFile;
562
+ })(c);
572
563
 
573
- const E = t(x);
564
+ const S = t(c);
574
565
 
575
- async function O(t) {
566
+ async function w(t) {
576
567
  return new e({
577
- store: new x.KeyvFile({
568
+ store: new c.KeyvFile({
578
569
  filename: t.filename,
579
570
  expiredCheckDelay: t.expiredCheckDelay,
580
571
  writeDelay: t.writeDelay
@@ -583,4 +574,4 @@ async function O(t) {
583
574
  });
584
575
  }
585
576
 
586
- export { O as CreateFileCacheAdapter };
577
+ export { w as CreateFileCacheAdapter };
@@ -204,7 +204,7 @@ require("../../lib/helpers/UniqueArray.cjs");
204
204
 
205
205
  require("./options/container/ContainerCommitOptions.cjs");
206
206
 
207
- require("../../../vendor/Package.60.cjs");
207
+ require("../../../vendor/Package.18.cjs");
208
208
 
209
209
  require("querystring");
210
210
 
@@ -198,7 +198,7 @@ import "../../lib/helpers/UniqueArray.mjs";
198
198
 
199
199
  import "./options/container/ContainerCommitOptions.mjs";
200
200
 
201
- import "../../../vendor/Package.60.mjs";
201
+ import "../../../vendor/Package.18.mjs";
202
202
 
203
203
  import "querystring";
204
204