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.
- package/com/docker.cjs +1 -1
- package/com/docker.mjs +1 -1
- package/decorator/orm.cjs +84 -84
- package/decorator/orm.mjs +42 -128
- package/orm.cjs +873 -1410
- package/orm.mjs +708 -1458
- package/package.json +1 -1
- package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +230 -239
- package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +230 -239
- package/src/components/docker/ConnectionOptionsBuilder.cjs +1 -1
- package/src/components/docker/ConnectionOptionsBuilder.mjs +1 -1
- package/src/components/docker/Docker.cjs +4919 -4808
- package/src/components/docker/Docker.mjs +4939 -4828
- package/src/components/docker/lib/DockerContainer.cjs +1 -1
- package/src/components/docker/lib/DockerContainer.mjs +1 -1
- package/src/components/docker/lib/DockerContainerTTY.cjs +1 -1
- package/src/components/docker/lib/DockerContainerTTY.mjs +1 -1
- package/src/components/entrypoint/Entrypoint.cjs +1669 -2159
- package/src/components/entrypoint/Entrypoint.mjs +1629 -2119
- package/src/decorators/orm/AfterInsert.cjs +26 -4
- package/src/decorators/orm/AfterInsert.mjs +25 -5
- package/src/decorators/orm/AfterLoad.cjs +26 -4
- package/src/decorators/orm/AfterLoad.mjs +25 -5
- package/src/decorators/orm/AfterRecover.cjs +26 -4
- package/src/decorators/orm/AfterRecover.mjs +25 -5
- package/src/decorators/orm/AfterRemove.cjs +26 -4
- package/src/decorators/orm/AfterRemove.mjs +25 -5
- package/src/decorators/orm/AfterSoftRemove.cjs +26 -4
- package/src/decorators/orm/AfterSoftRemove.mjs +25 -5
- package/src/decorators/orm/AfterUpdate.cjs +26 -4
- package/src/decorators/orm/AfterUpdate.mjs +25 -5
- package/src/decorators/orm/BeforeInsert.cjs +26 -4
- package/src/decorators/orm/BeforeInsert.mjs +25 -5
- package/src/decorators/orm/BeforeRecover.cjs +26 -4
- package/src/decorators/orm/BeforeRecover.mjs +25 -5
- package/src/decorators/orm/BeforeRemove.cjs +26 -4
- package/src/decorators/orm/BeforeRemove.mjs +25 -5
- package/src/decorators/orm/BeforeSoftRemove.cjs +26 -4
- package/src/decorators/orm/BeforeSoftRemove.mjs +25 -5
- package/src/decorators/orm/BeforeUpdate.cjs +26 -4
- package/src/decorators/orm/BeforeUpdate.mjs +25 -5
- package/src/decorators/orm/Check.cjs +29 -4
- package/src/decorators/orm/Check.mjs +28 -5
- package/src/decorators/orm/ChildEntity.cjs +29 -4
- package/src/decorators/orm/ChildEntity.mjs +28 -5
- package/src/decorators/orm/Column.cjs +61 -4
- package/src/decorators/orm/Column.mjs +61 -6
- package/src/decorators/orm/CreateDateColumn.cjs +25 -4
- package/src/decorators/orm/CreateDateColumn.mjs +24 -5
- package/src/decorators/orm/DeleteDateColumn.cjs +25 -4
- package/src/decorators/orm/DeleteDateColumn.mjs +23 -4
- package/src/decorators/orm/Entity.cjs +35 -4
- package/src/decorators/orm/Entity.mjs +33 -4
- package/src/decorators/orm/EventSubscriber.cjs +22 -4
- package/src/decorators/orm/EventSubscriber.mjs +21 -5
- package/src/decorators/orm/Exclusion.cjs +29 -4
- package/src/decorators/orm/Exclusion.mjs +28 -5
- package/src/decorators/orm/Generated.cjs +24 -4
- package/src/decorators/orm/Generated.mjs +23 -5
- package/src/decorators/orm/Index.cjs +41 -4
- package/src/decorators/orm/Index.mjs +41 -6
- package/src/decorators/orm/JoinColumn.cjs +29 -4
- package/src/decorators/orm/JoinColumn.mjs +28 -5
- package/src/decorators/orm/JoinTable.cjs +30 -4
- package/src/decorators/orm/JoinTable.mjs +28 -4
- package/src/decorators/orm/ManyToMany.cjs +42 -4
- package/src/decorators/orm/ManyToMany.mjs +40 -4
- package/src/decorators/orm/ManyToOne.cjs +42 -4
- package/src/decorators/orm/ManyToOne.mjs +40 -4
- package/src/decorators/orm/ObjectIdColumn.cjs +28 -4
- package/src/decorators/orm/ObjectIdColumn.mjs +27 -5
- package/src/decorators/orm/OneToMany.cjs +34 -4
- package/src/decorators/orm/OneToMany.mjs +34 -6
- package/src/decorators/orm/OneToOne.cjs +42 -4
- package/src/decorators/orm/OneToOne.mjs +40 -4
- package/src/decorators/orm/PrimaryColumn.cjs +49 -4
- package/src/decorators/orm/PrimaryColumn.mjs +49 -6
- package/src/decorators/orm/PrimaryGeneratedColumn.cjs +54 -4
- package/src/decorators/orm/PrimaryGeneratedColumn.mjs +54 -6
- package/src/decorators/orm/RelationId.cjs +26 -4
- package/src/decorators/orm/RelationId.mjs +25 -5
- package/src/decorators/orm/TableInheritance.cjs +26 -4
- package/src/decorators/orm/TableInheritance.mjs +25 -5
- package/src/decorators/orm/Tree.cjs +24 -4
- package/src/decorators/orm/Tree.mjs +23 -5
- package/src/decorators/orm/TreeChildren.cjs +31 -4
- package/src/decorators/orm/TreeChildren.mjs +29 -4
- package/src/decorators/orm/TreeLevelColumn.cjs +25 -4
- package/src/decorators/orm/TreeLevelColumn.mjs +23 -4
- package/src/decorators/orm/TreeParent.cjs +31 -4
- package/src/decorators/orm/TreeParent.mjs +29 -4
- package/src/decorators/orm/Unique.cjs +44 -4
- package/src/decorators/orm/Unique.mjs +44 -6
- package/src/decorators/orm/UpdateDateColumn.cjs +25 -4
- package/src/decorators/orm/UpdateDateColumn.mjs +24 -5
- package/src/decorators/orm/VersionColumn.cjs +25 -4
- package/src/decorators/orm/VersionColumn.mjs +24 -5
- package/src/decorators/orm/ViewColumn.cjs +25 -4
- package/src/decorators/orm/ViewColumn.mjs +24 -5
- package/src/decorators/orm/ViewEntity.cjs +34 -4
- package/src/decorators/orm/ViewEntity.mjs +33 -5
- package/src/decorators/orm/VirtualColumn.cjs +42 -4
- package/src/decorators/orm/VirtualColumn.mjs +40 -4
- package/src/lib/base/EventEmitter.cjs +1193 -1200
- package/src/lib/base/EventEmitter.mjs +1194 -1201
- package/src/lib/base/internal/DataValidator.cjs +185 -174
- package/src/lib/base/internal/DataValidator.mjs +186 -175
- package/src/lib/base/internal/PatternManager.cjs +735 -740
- package/src/lib/base/internal/PatternManager.mjs +740 -745
- package/src/lib/core/Application.cjs +99 -112
- package/src/lib/core/Application.mjs +127 -140
- package/src/lib/helpers/IsHtml.cjs +13 -7
- package/src/lib/helpers/IsHtml.mjs +13 -7
- package/src/lib/helpers/IsXML.cjs +1016 -1158
- package/src/lib/helpers/IsXML.mjs +729 -871
- package/src/lib/helpers/ObjectHash.cjs +371 -378
- package/src/lib/helpers/ObjectHash.mjs +371 -378
- package/src/lib/helpers/RandomString.cjs +146 -167
- package/src/lib/helpers/RandomString.mjs +145 -166
- package/src/lib/helpers/URLBuilder.cjs +355 -355
- package/src/lib/helpers/URLBuilder.mjs +350 -350
- package/src/lib/ioc/ListModules.cjs +5237 -5160
- package/src/lib/ioc/ListModules.mjs +5252 -5175
- package/src/lib/validation/VLD.cjs +3903 -4080
- package/src/lib/validation/VLD.mjs +2793 -2970
- package/src/providers/migration/GenerateMigration.cjs +2 -2
- package/src/providers/migration/GenerateMigration.mjs +2 -2
- package/vendor/Package.112.cjs +38321 -38240
- package/vendor/Package.112.mjs +37720 -37579
- package/vendor/Package.16.cjs +7386 -7268
- package/vendor/Package.16.mjs +6706 -6588
- package/vendor/Package.18.cjs +48229 -20
- package/vendor/Package.18.mjs +48192 -24
- package/vendor/Package.2.cjs +5698 -5727
- package/vendor/Package.2.mjs +5707 -5736
- package/vendor/Package.4.cjs +874 -884
- package/vendor/Package.4.mjs +874 -884
- package/vendor/Package.5.cjs +11 -15
- package/vendor/Package.5.mjs +7 -11
- package/vendor/Package.6.cjs +511 -520
- package/vendor/Package.6.mjs +534 -543
- package/vendor/Package.62.cjs +87 -90
- package/vendor/Package.62.mjs +180 -183
- package/vendor/Package.65.cjs +1285 -1292
- package/vendor/Package.65.mjs +190 -197
- package/vendor/Package.68.cjs +111 -252
- package/vendor/Package.68.mjs +134 -268
- package/vendor/Package.9.cjs +118 -132
- package/vendor/Package.9.mjs +124 -138
- package/vendor/TypeDef.internal.3.d.ts +0 -14
- package/vendor/Package.19.cjs +0 -37
- package/vendor/Package.19.mjs +0 -35
- package/vendor/Package.20.cjs +0 -37
- package/vendor/Package.20.mjs +0 -35
- package/vendor/Package.21.cjs +0 -37
- package/vendor/Package.21.mjs +0 -35
- package/vendor/Package.22.cjs +0 -37
- package/vendor/Package.22.mjs +0 -35
- package/vendor/Package.23.cjs +0 -37
- package/vendor/Package.23.mjs +0 -35
- package/vendor/Package.24.cjs +0 -37
- package/vendor/Package.24.mjs +0 -35
- package/vendor/Package.25.cjs +0 -37
- package/vendor/Package.25.mjs +0 -35
- package/vendor/Package.26.cjs +0 -37
- package/vendor/Package.26.mjs +0 -35
- package/vendor/Package.27.cjs +0 -37
- package/vendor/Package.27.mjs +0 -35
- package/vendor/Package.28.cjs +0 -37
- package/vendor/Package.28.mjs +0 -35
- package/vendor/Package.29.cjs +0 -40
- package/vendor/Package.29.mjs +0 -38
- package/vendor/Package.30.cjs +0 -41
- package/vendor/Package.30.mjs +0 -39
- package/vendor/Package.31.cjs +0 -72
- package/vendor/Package.31.mjs +0 -70
- package/vendor/Package.32.cjs +0 -37
- package/vendor/Package.32.mjs +0 -35
- package/vendor/Package.33.cjs +0 -37
- package/vendor/Package.33.mjs +0 -35
- package/vendor/Package.34.cjs +0 -46
- package/vendor/Package.34.mjs +0 -44
- package/vendor/Package.35.cjs +0 -34
- package/vendor/Package.35.mjs +0 -32
- package/vendor/Package.36.cjs +0 -40
- package/vendor/Package.36.mjs +0 -38
- package/vendor/Package.37.cjs +0 -36
- package/vendor/Package.37.mjs +0 -34
- package/vendor/Package.38.cjs +0 -52
- package/vendor/Package.38.mjs +0 -50
- package/vendor/Package.39.cjs +0 -41
- package/vendor/Package.39.mjs +0 -39
- package/vendor/Package.40.cjs +0 -42
- package/vendor/Package.40.mjs +0 -40
- package/vendor/Package.41.cjs +0 -53
- package/vendor/Package.41.mjs +0 -51
- package/vendor/Package.42.cjs +0 -53
- package/vendor/Package.42.mjs +0 -51
- package/vendor/Package.43.cjs +0 -40
- package/vendor/Package.43.mjs +0 -38
- package/vendor/Package.44.cjs +0 -46
- package/vendor/Package.44.mjs +0 -44
- package/vendor/Package.45.cjs +0 -53
- package/vendor/Package.45.mjs +0 -51
- package/vendor/Package.46.cjs +0 -59
- package/vendor/Package.46.mjs +0 -57
- package/vendor/Package.47.cjs +0 -65
- package/vendor/Package.47.mjs +0 -63
- package/vendor/Package.48.cjs +0 -38
- package/vendor/Package.48.mjs +0 -36
- package/vendor/Package.49.cjs +0 -38
- package/vendor/Package.49.mjs +0 -36
- package/vendor/Package.50.cjs +0 -36
- package/vendor/Package.50.mjs +0 -34
- package/vendor/Package.51.cjs +0 -43
- package/vendor/Package.51.mjs +0 -41
- package/vendor/Package.52.cjs +0 -37
- package/vendor/Package.52.mjs +0 -35
- package/vendor/Package.53.cjs +0 -43
- package/vendor/Package.53.mjs +0 -41
- package/vendor/Package.54.cjs +0 -55
- package/vendor/Package.54.mjs +0 -53
- package/vendor/Package.55.cjs +0 -37
- package/vendor/Package.55.mjs +0 -35
- package/vendor/Package.56.cjs +0 -37
- package/vendor/Package.56.mjs +0 -35
- package/vendor/Package.57.cjs +0 -37
- package/vendor/Package.57.mjs +0 -35
- package/vendor/Package.58.cjs +0 -45
- package/vendor/Package.58.mjs +0 -43
- package/vendor/Package.59.cjs +0 -53
- package/vendor/Package.59.mjs +0 -51
- package/vendor/Package.60.cjs +0 -47649
- package/vendor/Package.60.mjs +0 -47606
package/vendor/Package.68.cjs
CHANGED
|
@@ -6,78 +6,32 @@ Object.defineProperty(exports, Symbol.toStringTag, {
|
|
|
6
6
|
|
|
7
7
|
const t = require("@redis/client");
|
|
8
8
|
|
|
9
|
-
const e = require("
|
|
9
|
+
const e = require("./Package.66.cjs");
|
|
10
10
|
|
|
11
|
-
const r = require("./Package.
|
|
11
|
+
const r = require("./Package.67.cjs");
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const i = require("cluster-key-slot");
|
|
14
14
|
|
|
15
15
|
require("buffer");
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const s = t => t && t.__esModule ? t : {
|
|
18
18
|
default: t
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const n = i
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
42
|
+
_throwErrors=false;
|
|
89
43
|
_connectionTimeout;
|
|
90
44
|
constructor(e, r) {
|
|
91
45
|
super();
|
|
92
|
-
const
|
|
93
|
-
reconnectStrategy:
|
|
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:
|
|
53
|
+
socket: i
|
|
100
54
|
});
|
|
101
55
|
} else if (e.connect !== void 0) {
|
|
102
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
195
|
-
return this.
|
|
136
|
+
get throwErrors() {
|
|
137
|
+
return this._throwErrors;
|
|
196
138
|
}
|
|
197
|
-
set
|
|
198
|
-
this.
|
|
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
|
|
169
|
+
const i = await this.getClient();
|
|
228
170
|
try {
|
|
229
171
|
t = this.createKeyPrefix(t, this._namespace);
|
|
230
172
|
if (r) {
|
|
231
|
-
await
|
|
173
|
+
await i.set(t, e, {
|
|
232
174
|
PX: r
|
|
233
175
|
});
|
|
234
176
|
} else {
|
|
235
|
-
await
|
|
177
|
+
await i.set(t, e);
|
|
236
178
|
}
|
|
237
179
|
} catch (t) {
|
|
238
180
|
this.emit("error", t);
|
|
239
|
-
if (this.
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
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.
|
|
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.
|
|
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
|
|
313
|
-
|
|
314
|
-
const t = this.
|
|
315
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
404
|
-
|
|
405
|
-
const t = this.
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
|
350
|
+
let i = "0";
|
|
487
351
|
do {
|
|
488
|
-
const
|
|
352
|
+
const s = await r.scan(Number.parseInt(i, 10), {
|
|
489
353
|
MATCH: e,
|
|
490
354
|
TYPE: "string"
|
|
491
355
|
});
|
|
492
|
-
|
|
493
|
-
let {keys: n} =
|
|
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
|
|
501
|
-
const
|
|
502
|
-
yield [
|
|
364
|
+
const i = this.getKeyWithoutPrefix(n[r], t);
|
|
365
|
+
const s = e[r];
|
|
366
|
+
yield [ i, s ];
|
|
503
367
|
}
|
|
504
368
|
}
|
|
505
|
-
} while (
|
|
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
|
|
519
|
-
const
|
|
382
|
+
const i = this._namespace ? `${this._namespace}${this._keyPrefixSeparator}*` : "*";
|
|
383
|
+
const s = [];
|
|
520
384
|
do {
|
|
521
|
-
const n = await t.scan(e, {
|
|
522
|
-
MATCH:
|
|
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
|
-
|
|
398
|
+
s.push(this.clearWithClusterSupport(o));
|
|
535
399
|
} while (e !== "0");
|
|
536
|
-
await Promise.all(
|
|
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 =
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
await
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
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 =>
|
|
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
|
|
576
|
-
return r.nodeClient(
|
|
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
|
|
586
|
-
|
|
587
|
-
e.set(t,
|
|
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
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
return
|
|
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.
|
|
623
|
-
this.
|
|
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
|
-
|
|
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 =
|
|
667
|
-
|
|
668
|
-
exports.createKeyvNonBlocking = h;
|
|
527
|
+
exports.createKeyv = h;
|
|
669
528
|
|
|
670
|
-
exports.default =
|
|
529
|
+
exports.default = c;
|
|
671
530
|
|
|
672
|
-
exports.defaultReconnectStrategy =
|
|
531
|
+
exports.defaultReconnectStrategy = a;
|