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
@@ -6,78 +6,32 @@ Object.defineProperty(exports, Symbol.toStringTag, {
6
6
 
7
7
  const t = require("@redis/client");
8
8
 
9
- const e = require("cluster-key-slot");
9
+ const e = require("./Package.66.cjs");
10
10
 
11
- const r = require("./Package.66.cjs");
11
+ const r = require("./Package.67.cjs");
12
12
 
13
- const s = require("./Package.67.cjs");
13
+ const i = require("cluster-key-slot");
14
14
 
15
15
  require("buffer");
16
16
 
17
- const i = t => t && t.__esModule ? t : {
17
+ const s = t => t && t.__esModule ? t : {
18
18
  default: t
19
19
  };
20
20
 
21
- const n = i(e);
21
+ const n = s(i);
22
22
 
23
23
  var o = (t => {
24
24
  t["RedisClientNotConnectedThrown"] = "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.";
25
25
  return t;
26
26
  })(o || {});
27
27
 
28
- var c = t => {
28
+ var a = t => {
29
29
  const e = Math.min(2 ** t * 100, 2e3);
30
30
  const r = (Math.random() - .5) * 100;
31
31
  return e + r;
32
32
  };
33
33
 
34
- function a(t, e) {
35
- t ??= "redis://localhost:6379";
36
- const r = new l(t, e);
37
- if (e?.namespace) {
38
- r.namespace = e.namespace;
39
- const t = new s.Keyv(r, {
40
- namespace: e?.namespace,
41
- useKeyPrefix: false
42
- });
43
- if (e?.throwOnConnectError) {
44
- t.throwOnErrors = true;
45
- }
46
- if (e?.throwOnErrors) {
47
- t.throwOnErrors = true;
48
- }
49
- return t;
50
- }
51
- const i = new s.Keyv(r, {
52
- useKeyPrefix: false
53
- });
54
- if (e?.throwOnConnectError) {
55
- i.throwOnErrors = true;
56
- }
57
- if (e?.throwOnErrors) {
58
- i.throwOnErrors = true;
59
- }
60
- i.namespace = void 0;
61
- return i;
62
- }
63
-
64
- function h(t, e) {
65
- const r = a(t, e);
66
- const s = r.store;
67
- s.throwOnConnectError = false;
68
- s.throwOnErrors = false;
69
- const i = s.client;
70
- if (i.options) {
71
- i.options.disableOfflineQueue = true;
72
- if (i.options.socket) {
73
- i.options.socket.reconnectStrategy = false;
74
- }
75
- }
76
- r.throwOnErrors = false;
77
- return r;
78
- }
79
-
80
- var l = class extends r.Hookified {
34
+ var c = class extends e.Hookified {
81
35
  _client=t.createClient();
82
36
  _namespace;
83
37
  _keyPrefixSeparator="::";
@@ -85,35 +39,23 @@ var l = class extends r.Hookified {
85
39
  _useUnlink=true;
86
40
  _noNamespaceAffectsAll=false;
87
41
  _throwOnConnectError=true;
88
- _throwOnErrors=false;
42
+ _throwErrors=false;
89
43
  _connectionTimeout;
90
44
  constructor(e, r) {
91
45
  super();
92
- const s = {
93
- reconnectStrategy: c
46
+ const i = {
47
+ reconnectStrategy: a
94
48
  };
95
49
  if (e) {
96
50
  if (typeof e === "string") {
97
51
  this._client = t.createClient({
98
52
  url: e,
99
- socket: s
53
+ socket: i
100
54
  });
101
55
  } else if (e.connect !== void 0) {
102
- if (this.isClientSentinel(e)) {
103
- this._client = e;
104
- } else if (this.isClientCluster(e)) {
105
- this._client = e;
106
- } else {
107
- this._client = e;
108
- }
56
+ this._client = this.isClientCluster(e) ? e : e;
109
57
  } else if (e instanceof Object) {
110
- if (e.sentinelRootNodes !== void 0) {
111
- this._client = t.createSentinel(e);
112
- } else if (e.rootNodes === void 0) {
113
- this._client = t.createClient(e);
114
- } else {
115
- this._client = t.createCluster(e);
116
- }
58
+ this._client = e.rootNodes === void 0 ? t.createClient(e) : t.createCluster(e);
117
59
  }
118
60
  }
119
61
  this.setOptions(r);
@@ -141,7 +83,7 @@ var l = class extends r.Hookified {
141
83
  noNamespaceAffectsAll: this._noNamespaceAffectsAll,
142
84
  useUnlink: this._useUnlink,
143
85
  throwOnConnectError: this._throwOnConnectError,
144
- throwOnErrors: this._throwOnErrors,
86
+ throwErrors: this._throwErrors,
145
87
  connectionTimeout: this._connectionTimeout,
146
88
  dialect: "redis",
147
89
  url: t
@@ -191,11 +133,11 @@ var l = class extends r.Hookified {
191
133
  set throwOnConnectError(t) {
192
134
  this._throwOnConnectError = t;
193
135
  }
194
- get throwOnErrors() {
195
- return this._throwOnErrors;
136
+ get throwErrors() {
137
+ return this._throwErrors;
196
138
  }
197
- set throwOnErrors(t) {
198
- this._throwOnErrors = t;
139
+ set throwErrors(t) {
140
+ this._throwErrors = t;
199
141
  }
200
142
  get connectionTimeout() {
201
143
  return this._connectionTimeout;
@@ -215,80 +157,50 @@ var l = class extends r.Hookified {
215
157
  }
216
158
  } catch (t) {
217
159
  this.emit("error", t);
218
- await this.disconnect(true);
219
160
  if (this._throwOnConnectError) {
220
161
  throw new Error("Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.");
221
162
  }
163
+ await this.disconnect(true);
222
164
  }
223
165
  this.initClient();
224
166
  return this._client;
225
167
  }
226
168
  async set(t, e, r) {
227
- const s = await this.getClient();
169
+ const i = await this.getClient();
228
170
  try {
229
171
  t = this.createKeyPrefix(t, this._namespace);
230
172
  if (r) {
231
- await s.set(t, e, {
173
+ await i.set(t, e, {
232
174
  PX: r
233
175
  });
234
176
  } else {
235
- await s.set(t, e);
177
+ await i.set(t, e);
236
178
  }
237
179
  } catch (t) {
238
180
  this.emit("error", t);
239
- if (this._throwOnErrors) {
181
+ if (this._throwErrors) {
240
182
  throw t;
241
183
  }
242
184
  }
243
185
  }
244
186
  async setMany(t) {
187
+ const e = await this.getClient();
245
188
  try {
246
- if (this.isCluster()) {
247
- await this.getClient();
248
- const e = new Map;
249
- for (const r of t) {
250
- const t = this.createKeyPrefix(r.key, this._namespace);
251
- const s = n.default(t);
252
- const i = e.get(s) ?? [];
253
- i.push(r);
254
- e.set(s, i);
255
- }
256
- await Promise.all(Array.from(e.entries(), (async ([t, e]) => {
257
- const r = await this.getSlotMaster(t);
258
- const s = r.multi();
259
- for (const {key: t, value: r, ttl: i} of e) {
260
- const e = this.createKeyPrefix(t, this._namespace);
261
- if (i) {
262
- s.set(e, r, {
263
- PX: i
264
- });
265
- } else {
266
- s.set(e, r);
267
- }
268
- }
269
- await s.exec();
270
- })));
271
- } else {
272
- const e = await this.getClient();
273
- const r = e.multi();
274
- for (const {key: e, value: s, ttl: i} of t) {
275
- const t = this.createKeyPrefix(e, this._namespace);
276
- if (i) {
277
- r.set(t, s, {
278
- PX: i
279
- });
280
- } else {
281
- r.set(t, s);
282
- }
189
+ const r = e.multi();
190
+ for (const {key: e, value: i, ttl: s} of t) {
191
+ const t = this.createKeyPrefix(e, this._namespace);
192
+ if (s) {
193
+ r.set(t, i, {
194
+ PX: s
195
+ });
196
+ } else {
197
+ r.set(t, i);
283
198
  }
284
- await r.exec();
285
199
  }
200
+ await r.exec();
286
201
  } catch (t) {
287
202
  this.emit("error", t);
288
- if (this._throwOnConnectError && t.message === "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.") {
289
- throw t;
290
- }
291
- if (this._throwOnErrors) {
203
+ if (this._throwErrors) {
292
204
  throw t;
293
205
  }
294
206
  }
@@ -301,45 +213,25 @@ var l = class extends r.Hookified {
301
213
  return r === 1;
302
214
  } catch (t) {
303
215
  this.emit("error", t);
304
- if (this._throwOnErrors) {
216
+ if (this._throwErrors) {
305
217
  throw t;
306
218
  }
307
219
  return false;
308
220
  }
309
221
  }
310
222
  async hasMany(t) {
223
+ const e = await this.getClient();
311
224
  try {
312
- const e = t.map((t => this.createKeyPrefix(t, this._namespace)));
313
- if (this.isCluster()) {
314
- const t = this.getSlotMap(e);
315
- const r = new Map;
316
- await Promise.all(Array.from(t.entries(), (async ([t, e]) => {
317
- const s = await this.getSlotMaster(t);
318
- const i = s.multi();
319
- for (const t of e) {
320
- i.exists(t);
321
- }
322
- const n = await i.exec();
323
- for (const [t, s] of n.entries()) {
324
- r.set(e[t], typeof s === "number" && s === 1);
325
- }
326
- })));
327
- return e.map((t => r.get(t) ?? false));
328
- } else {
329
- const t = await this.getClient();
330
- const r = t.multi();
331
- for (const t of e) {
332
- r.exists(t);
333
- }
334
- const s = await r.exec();
335
- return s.map((t => typeof t === "number" && t === 1));
225
+ const r = e.multi();
226
+ for (const e of t) {
227
+ const t = this.createKeyPrefix(e, this._namespace);
228
+ r.exists(t);
336
229
  }
230
+ const i = await r.exec();
231
+ return i.map((t => t === 1));
337
232
  } catch (e) {
338
233
  this.emit("error", e);
339
- if (this._throwOnConnectError && e.message === "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.") {
340
- throw e;
341
- }
342
- if (this._throwOnErrors) {
234
+ if (this._throwErrors) {
343
235
  throw e;
344
236
  }
345
237
  return Array.from({
@@ -358,7 +250,7 @@ var l = class extends r.Hookified {
358
250
  return r;
359
251
  } catch (t) {
360
252
  this.emit("error", t);
361
- if (this._throwOnErrors) {
253
+ if (this._throwErrors) {
362
254
  throw t;
363
255
  }
364
256
  return void 0;
@@ -374,7 +266,7 @@ var l = class extends r.Hookified {
374
266
  return e;
375
267
  } catch (e) {
376
268
  this.emit("error", e);
377
- if (this._throwOnErrors) {
269
+ if (this._throwErrors) {
378
270
  throw e;
379
271
  }
380
272
  return Array.from({
@@ -391,7 +283,7 @@ var l = class extends r.Hookified {
391
283
  return r > 0;
392
284
  } catch (t) {
393
285
  this.emit("error", t);
394
- if (this._throwOnErrors) {
286
+ if (this._throwErrors) {
395
287
  throw t;
396
288
  }
397
289
  return false;
@@ -399,50 +291,26 @@ var l = class extends r.Hookified {
399
291
  }
400
292
  async deleteMany(t) {
401
293
  let e = false;
294
+ const r = await this.getClient();
402
295
  try {
403
- const r = t.map((t => this.createKeyPrefix(t, this._namespace)));
404
- if (this.isCluster()) {
405
- const t = this.getSlotMap(r);
406
- await Promise.all(Array.from(t.entries(), (async ([t, r]) => {
407
- const s = await this.getSlotMaster(t);
408
- const i = s.multi();
409
- for (const t of r) {
410
- if (this._useUnlink) {
411
- i.unlink(t);
412
- } else {
413
- i.del(t);
414
- }
415
- }
416
- const n = await i.exec();
417
- for (const t of n) {
418
- if (typeof t === "number" && t > 0) {
419
- e = true;
420
- }
421
- }
422
- })));
423
- } else {
424
- const t = await this.getClient();
425
- const s = t.multi();
426
- for (const t of r) {
427
- if (this._useUnlink) {
428
- s.unlink(t);
429
- } else {
430
- s.del(t);
431
- }
296
+ const i = r.multi();
297
+ for (const e of t) {
298
+ const t = this.createKeyPrefix(e, this._namespace);
299
+ if (this._useUnlink) {
300
+ i.unlink(t);
301
+ } else {
302
+ i.del(t);
432
303
  }
433
- const i = await s.exec();
434
- for (const t of i) {
435
- if (typeof t === "number" && t > 0) {
436
- e = true;
437
- }
304
+ }
305
+ const s = await i.exec();
306
+ for (const t of s) {
307
+ if (typeof t === "number" && t > 0) {
308
+ e = true;
438
309
  }
439
310
  }
440
311
  } catch (t) {
441
312
  this.emit("error", t);
442
- if (this._throwOnConnectError && t.message === "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.") {
443
- throw t;
444
- }
445
- if (this._throwOnErrors) {
313
+ if (this._throwErrors) {
446
314
  throw t;
447
315
  }
448
316
  }
@@ -450,7 +318,7 @@ var l = class extends r.Hookified {
450
318
  }
451
319
  async disconnect(t) {
452
320
  if (this._client.isOpen) {
453
- await (t ? this._client.destroy() : this._client.close());
321
+ await (t ? this._client.disconnect() : this._client.quit());
454
322
  }
455
323
  }
456
324
  createKeyPrefix(t, e) {
@@ -468,14 +336,10 @@ var l = class extends r.Hookified {
468
336
  isCluster() {
469
337
  return this.isClientCluster(this._client);
470
338
  }
471
- isSentinel() {
472
- return this.isClientSentinel(this._client);
473
- }
474
339
  async getMasterNodes() {
475
340
  if (this.isCluster()) {
476
341
  const t = await this.getClient();
477
- const e = t.masters.map((async e => t.nodeClient(e)));
478
- return Promise.all(e);
342
+ return Promise.all(t.masters.map((async e => t.nodeClient(e))));
479
343
  }
480
344
  return [ await this.getClient() ];
481
345
  }
@@ -483,26 +347,26 @@ var l = class extends r.Hookified {
483
347
  const e = await this.getMasterNodes();
484
348
  for (const r of e) {
485
349
  const e = t ? `${t}${this._keyPrefixSeparator}*` : "*";
486
- let s = "0";
350
+ let i = "0";
487
351
  do {
488
- const i = await r.scan(s, {
352
+ const s = await r.scan(Number.parseInt(i, 10), {
489
353
  MATCH: e,
490
354
  TYPE: "string"
491
355
  });
492
- s = i.cursor.toString();
493
- let {keys: n} = i;
356
+ i = s.cursor.toString();
357
+ let {keys: n} = s;
494
358
  if (!t && !this._noNamespaceAffectsAll) {
495
359
  n = n.filter((t => !t.includes(this._keyPrefixSeparator)));
496
360
  }
497
361
  if (n.length > 0) {
498
362
  const e = await this.mget(n);
499
363
  for (const r of n.keys()) {
500
- const s = this.getKeyWithoutPrefix(n[r], t);
501
- const i = e[r];
502
- yield [ s, i ];
364
+ const i = this.getKeyWithoutPrefix(n[r], t);
365
+ const s = e[r];
366
+ yield [ i, s ];
503
367
  }
504
368
  }
505
- } while (s !== "0");
369
+ } while (i !== "0");
506
370
  }
507
371
  }
508
372
  async clear() {
@@ -515,11 +379,11 @@ var l = class extends r.Hookified {
515
379
  }
516
380
  let e = "0";
517
381
  const r = this._clearBatchSize;
518
- const s = this._namespace ? `${this._namespace}${this._keyPrefixSeparator}*` : "*";
519
- const i = [];
382
+ const i = this._namespace ? `${this._namespace}${this._keyPrefixSeparator}*` : "*";
383
+ const s = [];
520
384
  do {
521
- const n = await t.scan(e, {
522
- MATCH: s,
385
+ const n = await t.scan(Number.parseInt(e, 10), {
386
+ MATCH: i,
523
387
  COUNT: r,
524
388
  TYPE: "string"
525
389
  });
@@ -531,33 +395,25 @@ var l = class extends r.Hookified {
531
395
  if (!this._namespace) {
532
396
  o = o.filter((t => !t.includes(this._keyPrefixSeparator)));
533
397
  }
534
- i.push(this.clearWithClusterSupport(o));
398
+ s.push(this.clearWithClusterSupport(o));
535
399
  } while (e !== "0");
536
- await Promise.all(i);
400
+ await Promise.all(s);
537
401
  })));
538
402
  } catch (t) {
539
403
  this.emit("error", t);
540
404
  }
541
405
  }
542
406
  async mget(t) {
543
- const e = new Map;
544
- if (this.isCluster()) {
545
- const r = this.getSlotMap(t);
546
- await Promise.all(Array.from(r.entries(), (async ([t, r]) => {
547
- const s = await this.getSlotMaster(t);
548
- const i = await s.mGet(r);
549
- for (const [t, s] of i.entries()) {
550
- e.set(r[t], s ?? void 0);
551
- }
552
- })));
553
- } else {
554
- const r = await this.getClient();
555
- const s = await r.mGet(t);
556
- for (const [r, i] of s.entries()) {
557
- e.set(t[r], i ?? void 0);
407
+ const e = this.getSlotMap(t);
408
+ const r = new Map;
409
+ await Promise.all(Array.from(e.entries(), (async ([t, e]) => {
410
+ const i = await this.getSlotMaster(t);
411
+ const s = await i.mGet(e);
412
+ for (const [t, i] of s.entries()) {
413
+ r.set(e[t], i ?? void 0);
558
414
  }
559
- }
560
- return t.map((t => e.get(t)));
415
+ })));
416
+ return t.map((t => r.get(t)));
561
417
  }
562
418
  async clearWithClusterSupport(t) {
563
419
  if (t.length > 0) {
@@ -572,8 +428,8 @@ var l = class extends r.Hookified {
572
428
  const e = await this.getClient();
573
429
  if (this.isCluster()) {
574
430
  const r = e;
575
- const s = r.slots[t].master;
576
- return r.nodeClient(s);
431
+ const i = r.slots[t].master;
432
+ return r.nodeClient(i);
577
433
  }
578
434
  return e;
579
435
  }
@@ -582,9 +438,9 @@ var l = class extends r.Hookified {
582
438
  if (this.isCluster()) {
583
439
  for (const r of t) {
584
440
  const t = n.default(r);
585
- const s = e.get(t) ?? [];
586
- s.push(r);
587
- e.set(t, s);
441
+ const i = e.get(t) ?? [];
442
+ i.push(r);
443
+ e.set(t, i);
588
444
  }
589
445
  } else {
590
446
  e.set(0, t);
@@ -592,10 +448,10 @@ var l = class extends r.Hookified {
592
448
  return e;
593
449
  }
594
450
  isClientCluster(t) {
595
- return t.slots !== void 0;
596
- }
597
- isClientSentinel(t) {
598
- return t.getSentinelNode !== void 0;
451
+ if (t.options === void 0 && t.scan === void 0) {
452
+ return true;
453
+ }
454
+ return false;
599
455
  }
600
456
  setOptions(t) {
601
457
  if (!t) {
@@ -619,8 +475,8 @@ var l = class extends r.Hookified {
619
475
  if (t.throwOnConnectError !== void 0) {
620
476
  this._throwOnConnectError = t.throwOnConnectError;
621
477
  }
622
- if (t.throwOnErrors !== void 0) {
623
- this._throwOnErrors = t.throwOnErrors;
478
+ if (t.throwErrors !== void 0) {
479
+ this._throwErrors = t.throwErrors;
624
480
  }
625
481
  if (t.connectionTimeout !== void 0) {
626
482
  this._connectionTimeout = t.connectionTimeout;
@@ -644,6 +500,16 @@ var l = class extends r.Hookified {
644
500
  }
645
501
  };
646
502
 
503
+ function h(t, e) {
504
+ t ??= "redis://localhost:6379";
505
+ const i = new c(t, e);
506
+ const s = new r.Keyv(i, {
507
+ namespace: e?.namespace,
508
+ useKeyPrefix: false
509
+ });
510
+ return s;
511
+ }
512
+
647
513
  Object.defineProperty(exports, "createClient", {
648
514
  enumerable: true,
649
515
  get: () => t.createClient
@@ -654,19 +520,12 @@ Object.defineProperty(exports, "createCluster", {
654
520
  get: () => t.createCluster
655
521
  });
656
522
 
657
- Object.defineProperty(exports, "createSentinel", {
658
- enumerable: true,
659
- get: () => t.createSentinel
660
- });
661
-
662
- exports.Keyv = s.Keyv;
523
+ exports.Keyv = r.Keyv;
663
524
 
664
525
  exports.RedisErrorMessages = o;
665
526
 
666
- exports.createKeyv = a;
667
-
668
- exports.createKeyvNonBlocking = h;
527
+ exports.createKeyv = h;
669
528
 
670
- exports.default = l;
529
+ exports.default = c;
671
530
 
672
- exports.defaultReconnectStrategy = c;
531
+ exports.defaultReconnectStrategy = a;