lakutata 2.0.80 → 2.0.81
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/cacher.cjs +8 -10
- package/com/cacher.d.ts +83 -14
- package/com/cacher.mjs +8 -10
- package/com/database.cjs +11 -11
- package/com/database.mjs +11 -11
- package/com/docker.cjs +17 -19
- package/com/docker.d.ts +3 -141
- package/com/docker.mjs +13 -15
- package/com/entrypoint.cjs +7 -5
- package/com/entrypoint.mjs +7 -5
- package/com/logger.cjs +7 -7
- package/com/logger.mjs +7 -7
- package/com/monitor.cjs +5 -3
- package/com/monitor.mjs +5 -3
- package/decorator/ctrl.cjs +3 -3
- package/decorator/ctrl.mjs +3 -3
- package/decorator/orm.cjs +98 -98
- package/decorator/orm.mjs +142 -56
- package/helper.cjs +9 -11
- package/helper.mjs +5 -7
- package/lakutata.cjs +23 -30
- package/lakutata.mjs +14 -18
- package/orm.cjs +1423 -886
- package/orm.mjs +1474 -724
- package/package.json +1 -1
- package/provider/database.cjs +11 -11
- package/provider/database.mjs +11 -11
- package/provider/passwordHash.cjs +4 -2
- package/provider/passwordHash.mjs +4 -2
- package/src/components/Database.cjs +11 -11
- package/src/components/Database.mjs +11 -11
- package/src/components/Logger.cjs +7 -7
- package/src/components/Logger.mjs +7 -7
- package/src/components/cacher/Cacher.cjs +1178 -264
- package/src/components/cacher/Cacher.mjs +1087 -173
- package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +479 -2963
- package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +469 -2947
- package/src/components/docker/ConnectionOptionsBuilder.cjs +15 -17
- package/src/components/docker/ConnectionOptionsBuilder.mjs +13 -15
- package/src/components/docker/Docker.cjs +4884 -4945
- package/src/components/docker/Docker.mjs +4902 -4963
- package/src/components/docker/lib/DockerContainer.cjs +23 -25
- package/src/components/docker/lib/DockerContainer.mjs +17 -19
- package/src/components/docker/lib/DockerContainerTTY.cjs +9 -11
- package/src/components/docker/lib/DockerContainerTTY.mjs +9 -11
- package/src/components/docker/lib/DockerImage.cjs +4 -2
- package/src/components/docker/lib/DockerImage.mjs +4 -2
- package/src/components/entrypoint/Entrypoint.cjs +2170 -1678
- package/src/components/entrypoint/Entrypoint.mjs +2126 -1634
- package/src/components/entrypoint/lib/AccessControl.cjs +4 -2
- package/src/components/entrypoint/lib/AccessControl.mjs +4 -2
- package/src/components/entrypoint/lib/AccessControlRule.cjs +4 -2
- package/src/components/entrypoint/lib/AccessControlRule.mjs +4 -2
- package/src/components/entrypoint/lib/Controller.cjs +4 -2
- package/src/components/entrypoint/lib/Controller.mjs +4 -2
- package/src/components/monitor/AliveMonitor.cjs +4 -2
- package/src/components/monitor/AliveMonitor.mjs +4 -2
- package/src/components/monitor/CpuMonitor.cjs +5 -3
- package/src/components/monitor/CpuMonitor.mjs +5 -3
- package/src/components/monitor/EventLoopMonitor.cjs +4 -2
- package/src/components/monitor/EventLoopMonitor.mjs +4 -2
- package/src/components/monitor/HttpRequestMonitor.cjs +5 -3
- package/src/components/monitor/HttpRequestMonitor.mjs +5 -3
- package/src/components/monitor/MemoryMonitor.cjs +5 -3
- package/src/components/monitor/MemoryMonitor.mjs +5 -3
- package/src/decorators/ctrl/CLIAction.cjs +3 -3
- package/src/decorators/ctrl/CLIAction.mjs +3 -3
- package/src/decorators/ctrl/HTTPAction.cjs +3 -3
- package/src/decorators/ctrl/HTTPAction.mjs +3 -3
- package/src/decorators/ctrl/ServiceAction.cjs +3 -3
- package/src/decorators/ctrl/ServiceAction.mjs +3 -3
- package/src/decorators/ctrl/http/DELETE.cjs +3 -3
- package/src/decorators/ctrl/http/DELETE.mjs +3 -3
- package/src/decorators/ctrl/http/GET.cjs +3 -3
- package/src/decorators/ctrl/http/GET.mjs +3 -3
- package/src/decorators/ctrl/http/HEAD.cjs +3 -3
- package/src/decorators/ctrl/http/HEAD.mjs +3 -3
- package/src/decorators/ctrl/http/OPTIONS.cjs +3 -3
- package/src/decorators/ctrl/http/OPTIONS.mjs +3 -3
- package/src/decorators/ctrl/http/PATCH.cjs +3 -3
- package/src/decorators/ctrl/http/PATCH.mjs +3 -3
- package/src/decorators/ctrl/http/POST.cjs +3 -3
- package/src/decorators/ctrl/http/POST.mjs +3 -3
- package/src/decorators/ctrl/http/PUT.cjs +3 -3
- package/src/decorators/ctrl/http/PUT.mjs +3 -3
- package/src/decorators/orm/AfterInsert.cjs +17 -39
- package/src/decorators/orm/AfterInsert.mjs +18 -38
- package/src/decorators/orm/AfterLoad.cjs +17 -39
- package/src/decorators/orm/AfterLoad.mjs +18 -38
- package/src/decorators/orm/AfterRecover.cjs +17 -39
- package/src/decorators/orm/AfterRecover.mjs +18 -38
- package/src/decorators/orm/AfterRemove.cjs +17 -39
- package/src/decorators/orm/AfterRemove.mjs +18 -38
- package/src/decorators/orm/AfterSoftRemove.cjs +17 -39
- package/src/decorators/orm/AfterSoftRemove.mjs +18 -38
- package/src/decorators/orm/AfterUpdate.cjs +17 -39
- package/src/decorators/orm/AfterUpdate.mjs +18 -38
- package/src/decorators/orm/BeforeInsert.cjs +17 -39
- package/src/decorators/orm/BeforeInsert.mjs +18 -38
- package/src/decorators/orm/BeforeRecover.cjs +17 -39
- package/src/decorators/orm/BeforeRecover.mjs +18 -38
- package/src/decorators/orm/BeforeRemove.cjs +17 -39
- package/src/decorators/orm/BeforeRemove.mjs +18 -38
- package/src/decorators/orm/BeforeSoftRemove.cjs +17 -39
- package/src/decorators/orm/BeforeSoftRemove.mjs +18 -38
- package/src/decorators/orm/BeforeUpdate.cjs +17 -39
- package/src/decorators/orm/BeforeUpdate.mjs +18 -38
- package/src/decorators/orm/Check.cjs +17 -42
- package/src/decorators/orm/Check.mjs +18 -41
- package/src/decorators/orm/ChildEntity.cjs +17 -42
- package/src/decorators/orm/ChildEntity.mjs +18 -41
- package/src/decorators/orm/Column.cjs +17 -74
- package/src/decorators/orm/Column.mjs +19 -74
- package/src/decorators/orm/CreateDateColumn.cjs +17 -38
- package/src/decorators/orm/CreateDateColumn.mjs +18 -37
- package/src/decorators/orm/DeleteDateColumn.cjs +17 -38
- package/src/decorators/orm/DeleteDateColumn.mjs +17 -36
- package/src/decorators/orm/Entity.cjs +17 -48
- package/src/decorators/orm/Entity.mjs +17 -46
- package/src/decorators/orm/EventSubscriber.cjs +17 -35
- package/src/decorators/orm/EventSubscriber.mjs +18 -34
- package/src/decorators/orm/Exclusion.cjs +17 -42
- package/src/decorators/orm/Exclusion.mjs +18 -41
- package/src/decorators/orm/Generated.cjs +17 -37
- package/src/decorators/orm/Generated.mjs +18 -36
- package/src/decorators/orm/Index.cjs +17 -54
- package/src/decorators/orm/Index.mjs +19 -54
- package/src/decorators/orm/JoinColumn.cjs +17 -42
- package/src/decorators/orm/JoinColumn.mjs +18 -41
- package/src/decorators/orm/JoinTable.cjs +17 -43
- package/src/decorators/orm/JoinTable.mjs +17 -41
- package/src/decorators/orm/ManyToMany.cjs +17 -55
- package/src/decorators/orm/ManyToMany.mjs +17 -53
- package/src/decorators/orm/ManyToOne.cjs +17 -55
- package/src/decorators/orm/ManyToOne.mjs +17 -53
- package/src/decorators/orm/ObjectIdColumn.cjs +17 -41
- package/src/decorators/orm/ObjectIdColumn.mjs +18 -40
- package/src/decorators/orm/OneToMany.cjs +17 -47
- package/src/decorators/orm/OneToMany.mjs +19 -47
- package/src/decorators/orm/OneToOne.cjs +17 -55
- package/src/decorators/orm/OneToOne.mjs +17 -53
- package/src/decorators/orm/PrimaryColumn.cjs +17 -62
- package/src/decorators/orm/PrimaryColumn.mjs +19 -62
- package/src/decorators/orm/PrimaryGeneratedColumn.cjs +17 -67
- package/src/decorators/orm/PrimaryGeneratedColumn.mjs +19 -67
- package/src/decorators/orm/RelationId.cjs +17 -39
- package/src/decorators/orm/RelationId.mjs +18 -38
- package/src/decorators/orm/TableInheritance.cjs +17 -39
- package/src/decorators/orm/TableInheritance.mjs +18 -38
- package/src/decorators/orm/Tree.cjs +17 -37
- package/src/decorators/orm/Tree.mjs +18 -36
- package/src/decorators/orm/TreeChildren.cjs +17 -44
- package/src/decorators/orm/TreeChildren.mjs +17 -42
- package/src/decorators/orm/TreeLevelColumn.cjs +17 -38
- package/src/decorators/orm/TreeLevelColumn.mjs +17 -36
- package/src/decorators/orm/TreeParent.cjs +17 -44
- package/src/decorators/orm/TreeParent.mjs +17 -42
- package/src/decorators/orm/Unique.cjs +17 -57
- package/src/decorators/orm/Unique.mjs +19 -57
- package/src/decorators/orm/UpdateDateColumn.cjs +17 -38
- package/src/decorators/orm/UpdateDateColumn.mjs +18 -37
- package/src/decorators/orm/VersionColumn.cjs +17 -38
- package/src/decorators/orm/VersionColumn.mjs +18 -37
- package/src/decorators/orm/ViewColumn.cjs +17 -38
- package/src/decorators/orm/ViewColumn.mjs +18 -37
- package/src/decorators/orm/ViewEntity.cjs +17 -47
- package/src/decorators/orm/ViewEntity.mjs +18 -46
- package/src/decorators/orm/VirtualColumn.cjs +17 -55
- package/src/decorators/orm/VirtualColumn.mjs +17 -53
- package/src/lib/base/BaseObject.cjs +4 -2
- package/src/lib/base/BaseObject.mjs +4 -2
- package/src/lib/base/EventEmitter.cjs +1200 -1193
- package/src/lib/base/EventEmitter.mjs +1201 -1194
- package/src/lib/base/internal/ApplicationConfigLoader.cjs +4 -2
- package/src/lib/base/internal/ApplicationConfigLoader.mjs +4 -2
- package/src/lib/base/internal/ControllerEntrypoint.cjs +3 -3
- package/src/lib/base/internal/ControllerEntrypoint.mjs +3 -3
- package/src/lib/base/internal/DataValidator.cjs +176 -179
- package/src/lib/base/internal/DataValidator.mjs +177 -180
- package/src/lib/base/internal/ModuleConfigLoader.cjs +4 -3
- package/src/lib/base/internal/ModuleConfigLoader.mjs +4 -3
- package/src/lib/base/internal/ObjectType.cjs +4 -2
- package/src/lib/base/internal/ObjectType.mjs +4 -2
- package/src/lib/base/internal/PatternManager.cjs +740 -735
- package/src/lib/base/internal/PatternManager.mjs +745 -740
- package/src/lib/base/internal/StringifyPattern.cjs +1 -1
- package/src/lib/base/internal/StringifyPattern.mjs +1 -1
- package/src/lib/core/Application.cjs +151 -147
- package/src/lib/core/Application.mjs +199 -197
- package/src/lib/core/Component.cjs +4 -2
- package/src/lib/core/Component.mjs +4 -2
- package/src/lib/core/Container.cjs +4 -2
- package/src/lib/core/Container.mjs +4 -2
- package/src/lib/core/Module.cjs +5 -3
- package/src/lib/core/Module.mjs +5 -3
- package/src/lib/core/Provider.cjs +4 -2
- package/src/lib/core/Provider.mjs +4 -2
- package/src/lib/helpers/Glob.cjs +970 -721
- package/src/lib/helpers/Glob.mjs +1036 -787
- package/src/lib/helpers/IsHtml.cjs +7 -13
- package/src/lib/helpers/IsHtml.mjs +7 -13
- package/src/lib/helpers/IsXML.cjs +1158 -1016
- package/src/lib/helpers/IsXML.mjs +871 -729
- package/src/lib/helpers/MD5.cjs +1 -1
- package/src/lib/helpers/MD5.mjs +1 -1
- package/src/lib/helpers/NonceStr.cjs +1 -1
- package/src/lib/helpers/NonceStr.mjs +1 -1
- package/src/lib/helpers/ObjectHash.cjs +379 -372
- package/src/lib/helpers/ObjectHash.mjs +379 -372
- package/src/lib/helpers/RandomString.cjs +168 -147
- package/src/lib/helpers/RandomString.mjs +167 -146
- package/src/lib/helpers/SHA1.cjs +1 -1
- package/src/lib/helpers/SHA1.mjs +1 -1
- package/src/lib/helpers/SHA256.cjs +1 -1
- package/src/lib/helpers/SHA256.mjs +1 -1
- package/src/lib/helpers/SortArray.cjs +1 -1
- package/src/lib/helpers/SortArray.mjs +1 -1
- package/src/lib/helpers/Statistics.cjs +1 -1
- package/src/lib/helpers/Statistics.mjs +1 -1
- package/src/lib/helpers/URLBuilder.cjs +355 -355
- package/src/lib/helpers/URLBuilder.mjs +350 -350
- package/src/lib/helpers/UUID.cjs +1 -1
- package/src/lib/helpers/UUID.mjs +1 -1
- package/src/lib/ioc/DependencyInjectionContainer.cjs +32 -30
- package/src/lib/ioc/DependencyInjectionContainer.mjs +12 -10
- package/src/lib/ioc/ListModules.cjs +5174 -5249
- package/src/lib/ioc/ListModules.mjs +5177 -5252
- package/src/lib/validation/VLD.cjs +4080 -3902
- package/src/lib/validation/VLD.mjs +2970 -2792
- package/src/options/ApplicationOptions.cjs +4 -2
- package/src/options/ApplicationOptions.mjs +4 -2
- package/src/options/LoadAnonymousObjectOptions.cjs +4 -2
- package/src/options/LoadAnonymousObjectOptions.mjs +4 -2
- package/src/options/LoadNamedObjectOptions.cjs +4 -2
- package/src/options/LoadNamedObjectOptions.mjs +4 -2
- package/src/options/LoadObjectOptions.cjs +4 -2
- package/src/options/LoadObjectOptions.mjs +4 -2
- package/src/options/ModuleLoadObjectsOptions.cjs +4 -2
- package/src/options/ModuleLoadObjectsOptions.mjs +4 -2
- package/src/options/ModuleOptions.cjs +4 -4
- package/src/options/ModuleOptions.mjs +4 -4
- package/src/options/OverridableNamedObjectOptions.cjs +4 -2
- package/src/options/OverridableNamedObjectOptions.mjs +4 -2
- package/src/options/OverridableObjectOptions.cjs +4 -2
- package/src/options/OverridableObjectOptions.mjs +4 -2
- package/src/providers/Database.cjs +11 -11
- package/src/providers/Database.mjs +11 -11
- package/src/providers/PasswordHash.cjs +5 -3
- package/src/providers/PasswordHash.mjs +190 -188
- package/src/providers/migration/GenerateMigration.cjs +15 -19
- package/src/providers/migration/GenerateMigration.mjs +15 -19
- package/vendor/Package.10.cjs +2 -8
- package/vendor/Package.10.mjs +2 -8
- package/vendor/Package.11.cjs +5 -83
- package/vendor/Package.11.mjs +5 -77
- package/vendor/Package.112.cjs +48900 -0
- package/vendor/Package.112.mjs +48764 -0
- package/vendor/Package.12.cjs +4 -2
- package/vendor/Package.12.mjs +6 -4
- package/vendor/Package.13.cjs +87 -1
- package/vendor/Package.13.mjs +81 -1
- package/vendor/Package.14.cjs +1 -14057
- package/vendor/Package.14.mjs +1 -14031
- package/vendor/Package.15.cjs +1 -1
- package/vendor/Package.15.mjs +1 -1
- package/vendor/Package.16.cjs +18129 -1935
- package/vendor/Package.16.mjs +18115 -1839
- package/vendor/Package.17.cjs +1922 -47918
- package/vendor/Package.17.mjs +1874 -47937
- package/vendor/Package.18.cjs +35 -1
- package/vendor/Package.18.mjs +35 -1
- package/vendor/Package.19.cjs +37 -0
- package/vendor/Package.19.mjs +35 -0
- package/vendor/Package.2.cjs +5739 -5710
- package/vendor/Package.2.mjs +5733 -5704
- package/vendor/Package.20.cjs +37 -0
- package/vendor/Package.20.mjs +35 -0
- package/vendor/Package.21.cjs +37 -0
- package/vendor/Package.21.mjs +35 -0
- package/vendor/Package.22.cjs +37 -0
- package/vendor/Package.22.mjs +35 -0
- package/vendor/Package.23.cjs +37 -0
- package/vendor/Package.23.mjs +35 -0
- package/vendor/Package.24.cjs +37 -0
- package/vendor/Package.24.mjs +35 -0
- package/vendor/Package.25.cjs +37 -0
- package/vendor/Package.25.mjs +35 -0
- package/vendor/Package.26.cjs +37 -0
- package/vendor/Package.26.mjs +35 -0
- package/vendor/Package.27.cjs +37 -0
- package/vendor/Package.27.mjs +35 -0
- package/vendor/Package.28.cjs +37 -0
- package/vendor/Package.28.mjs +35 -0
- package/vendor/Package.29.cjs +40 -0
- package/vendor/Package.29.mjs +38 -0
- package/vendor/Package.30.cjs +41 -0
- package/vendor/Package.30.mjs +39 -0
- package/vendor/Package.31.cjs +72 -0
- package/vendor/Package.31.mjs +70 -0
- package/vendor/Package.32.cjs +37 -0
- package/vendor/Package.32.mjs +35 -0
- package/vendor/Package.33.cjs +37 -0
- package/vendor/Package.33.mjs +35 -0
- package/vendor/Package.34.cjs +46 -0
- package/vendor/Package.34.mjs +44 -0
- package/vendor/Package.35.cjs +34 -0
- package/vendor/Package.35.mjs +32 -0
- package/vendor/Package.36.cjs +40 -0
- package/vendor/Package.36.mjs +38 -0
- package/vendor/Package.37.cjs +36 -0
- package/vendor/Package.37.mjs +34 -0
- package/vendor/Package.38.cjs +52 -0
- package/vendor/Package.38.mjs +50 -0
- package/vendor/Package.39.cjs +41 -0
- package/vendor/Package.39.mjs +39 -0
- package/vendor/Package.4.cjs +884 -874
- package/vendor/Package.4.mjs +884 -874
- package/vendor/Package.40.cjs +42 -0
- package/vendor/Package.40.mjs +40 -0
- package/vendor/Package.41.cjs +53 -0
- package/vendor/Package.41.mjs +51 -0
- package/vendor/Package.42.cjs +53 -0
- package/vendor/Package.42.mjs +51 -0
- package/vendor/Package.43.cjs +40 -0
- package/vendor/Package.43.mjs +38 -0
- package/vendor/Package.44.cjs +46 -0
- package/vendor/Package.44.mjs +44 -0
- package/vendor/Package.45.cjs +53 -0
- package/vendor/Package.45.mjs +51 -0
- package/vendor/Package.46.cjs +59 -0
- package/vendor/Package.46.mjs +57 -0
- package/vendor/Package.47.cjs +65 -0
- package/vendor/Package.47.mjs +63 -0
- package/vendor/Package.48.cjs +38 -0
- package/vendor/Package.48.mjs +36 -0
- package/vendor/Package.49.cjs +38 -0
- package/vendor/Package.49.mjs +36 -0
- package/vendor/Package.5.cjs +15 -11
- package/vendor/Package.5.mjs +11 -7
- package/vendor/Package.50.cjs +36 -0
- package/vendor/Package.50.mjs +34 -0
- package/vendor/Package.51.cjs +43 -0
- package/vendor/Package.51.mjs +41 -0
- package/vendor/Package.52.cjs +37 -0
- package/vendor/Package.52.mjs +35 -0
- package/vendor/Package.53.cjs +43 -0
- package/vendor/Package.53.mjs +41 -0
- package/vendor/Package.54.cjs +55 -0
- package/vendor/Package.54.mjs +53 -0
- package/vendor/Package.55.cjs +37 -0
- package/vendor/Package.55.mjs +35 -0
- package/vendor/Package.56.cjs +37 -0
- package/vendor/Package.56.mjs +35 -0
- package/vendor/Package.57.cjs +37 -0
- package/vendor/Package.57.mjs +35 -0
- package/vendor/Package.58.cjs +45 -0
- package/vendor/Package.58.mjs +43 -0
- package/vendor/Package.59.cjs +53 -0
- package/vendor/Package.59.mjs +51 -0
- package/vendor/Package.6.cjs +520 -511
- package/vendor/Package.6.mjs +543 -534
- package/vendor/Package.60.cjs +47649 -0
- package/vendor/Package.60.mjs +47606 -0
- package/vendor/Package.610.cjs +11 -11
- package/vendor/Package.610.mjs +11 -11
- package/vendor/Package.611.cjs +33 -23
- package/vendor/Package.611.mjs +19 -9
- package/vendor/Package.612.cjs +42 -36
- package/vendor/Package.612.mjs +35 -29
- package/vendor/Package.613.cjs +5 -4
- package/vendor/Package.613.mjs +5 -4
- package/vendor/Package.62.cjs +92 -89
- package/vendor/Package.62.mjs +185 -182
- package/vendor/Package.63.cjs +509 -166
- package/vendor/Package.63.mjs +490 -165
- package/vendor/Package.64.cjs +139 -511
- package/vendor/Package.64.mjs +139 -491
- package/vendor/Package.65.cjs +4135 -150
- package/vendor/Package.65.mjs +4143 -150
- package/vendor/Package.66.cjs +346 -4150
- package/vendor/Package.66.mjs +346 -4158
- package/vendor/Package.67.cjs +412 -261
- package/vendor/Package.67.mjs +410 -259
- package/vendor/Package.68.cjs +397 -405
- package/vendor/Package.68.mjs +227 -242
- package/vendor/Package.8.cjs +0 -4
- package/vendor/Package.8.mjs +0 -4
- package/vendor/Package.9.cjs +132 -118
- package/vendor/Package.9.mjs +138 -124
- package/vendor/TypeDef.internal.3.d.ts +0 -4
- package/vendor/Package.102.cjs +0 -48773
- package/vendor/Package.102.mjs +0 -48697
- package/vendor/Package.122.cjs +0 -3
- package/vendor/Package.122.mjs +0 -1
package/vendor/Package.68.mjs
CHANGED
|
@@ -1,163 +1,14 @@
|
|
|
1
|
-
import { createClient as t,
|
|
1
|
+
import { createClient as t, createSentinel as e, createCluster as s } from "@redis/client";
|
|
2
2
|
|
|
3
|
-
export { createClient, createCluster } from "@redis/client";
|
|
4
|
-
|
|
5
|
-
import { K as s } from "./Package.67.mjs";
|
|
3
|
+
export { createClient, createCluster, createSentinel } from "@redis/client";
|
|
6
4
|
|
|
7
5
|
import r from "cluster-key-slot";
|
|
8
6
|
|
|
9
|
-
import "
|
|
7
|
+
import { H as i } from "./Package.66.mjs";
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
_eventListeners;
|
|
13
|
-
_maxListeners;
|
|
14
|
-
_logger;
|
|
15
|
-
constructor(t) {
|
|
16
|
-
this._eventListeners = new Map, this._maxListeners = 100, this._logger = t?.logger;
|
|
17
|
-
}
|
|
18
|
-
once(t, e) {
|
|
19
|
-
let s = (...r) => {
|
|
20
|
-
this.off(t, s), e(...r);
|
|
21
|
-
};
|
|
22
|
-
return this.on(t, s), this;
|
|
23
|
-
}
|
|
24
|
-
listenerCount(t) {
|
|
25
|
-
if (!t) return this.getAllListeners().length;
|
|
26
|
-
let e = this._eventListeners.get(t);
|
|
27
|
-
return e ? e.length : 0;
|
|
28
|
-
}
|
|
29
|
-
eventNames() {
|
|
30
|
-
return [ ...this._eventListeners.keys() ];
|
|
31
|
-
}
|
|
32
|
-
rawListeners(t) {
|
|
33
|
-
return t ? this._eventListeners.get(t) ?? [] : this.getAllListeners();
|
|
34
|
-
}
|
|
35
|
-
prependListener(t, e) {
|
|
36
|
-
let s = this._eventListeners.get(t) ?? [];
|
|
37
|
-
return s.unshift(e), this._eventListeners.set(t, s), this;
|
|
38
|
-
}
|
|
39
|
-
prependOnceListener(t, e) {
|
|
40
|
-
let s = (...r) => {
|
|
41
|
-
this.off(t, s), e(...r);
|
|
42
|
-
};
|
|
43
|
-
return this.prependListener(t, s), this;
|
|
44
|
-
}
|
|
45
|
-
maxListeners() {
|
|
46
|
-
return this._maxListeners;
|
|
47
|
-
}
|
|
48
|
-
addListener(t, e) {
|
|
49
|
-
return this.on(t, e), this;
|
|
50
|
-
}
|
|
51
|
-
on(t, e) {
|
|
52
|
-
this._eventListeners.has(t) || this._eventListeners.set(t, []);
|
|
53
|
-
let s = this._eventListeners.get(t);
|
|
54
|
-
return s && (s.length >= this._maxListeners && console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${s.length + 1} ${t} listeners added. Use setMaxListeners() to increase limit.`),
|
|
55
|
-
s.push(e)), this;
|
|
56
|
-
}
|
|
57
|
-
removeListener(t, e) {
|
|
58
|
-
return this.off(t, e), this;
|
|
59
|
-
}
|
|
60
|
-
off(t, e) {
|
|
61
|
-
let s = this._eventListeners.get(t) ?? [], r = s.indexOf(e);
|
|
62
|
-
return r !== -1 && s.splice(r, 1), s.length === 0 && this._eventListeners.delete(t),
|
|
63
|
-
this;
|
|
64
|
-
}
|
|
65
|
-
emit(t, ...e) {
|
|
66
|
-
let s = !1, r = this._eventListeners.get(t);
|
|
67
|
-
if (r && r.length > 0) for (let t of r) t(...e), s = !0;
|
|
68
|
-
return s;
|
|
69
|
-
}
|
|
70
|
-
listeners(t) {
|
|
71
|
-
return this._eventListeners.get(t) ?? [];
|
|
72
|
-
}
|
|
73
|
-
removeAllListeners(t) {
|
|
74
|
-
return t ? this._eventListeners.delete(t) : this._eventListeners.clear(), this;
|
|
75
|
-
}
|
|
76
|
-
setMaxListeners(t) {
|
|
77
|
-
this._maxListeners = t;
|
|
78
|
-
for (let e of this._eventListeners.values()) e.length > t && e.splice(t);
|
|
79
|
-
}
|
|
80
|
-
getAllListeners() {
|
|
81
|
-
let t = new Array;
|
|
82
|
-
for (let e of this._eventListeners.values()) t = [ ...t, ...e ];
|
|
83
|
-
return t;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
9
|
+
import { K as n } from "./Package.67.mjs";
|
|
86
10
|
|
|
87
|
-
|
|
88
|
-
_hooks;
|
|
89
|
-
_throwHookErrors=!1;
|
|
90
|
-
constructor(t) {
|
|
91
|
-
super({
|
|
92
|
-
logger: t?.logger
|
|
93
|
-
}), this._hooks = new Map, t?.throwHookErrors !== void 0 && (this._throwHookErrors = t.throwHookErrors);
|
|
94
|
-
}
|
|
95
|
-
get hooks() {
|
|
96
|
-
return this._hooks;
|
|
97
|
-
}
|
|
98
|
-
get throwHookErrors() {
|
|
99
|
-
return this._throwHookErrors;
|
|
100
|
-
}
|
|
101
|
-
set throwHookErrors(t) {
|
|
102
|
-
this._throwHookErrors = t;
|
|
103
|
-
}
|
|
104
|
-
get logger() {
|
|
105
|
-
return this._logger;
|
|
106
|
-
}
|
|
107
|
-
set logger(t) {
|
|
108
|
-
this._logger = t;
|
|
109
|
-
}
|
|
110
|
-
onHook(t, e) {
|
|
111
|
-
let s = this._hooks.get(t);
|
|
112
|
-
s ? s.push(e) : this._hooks.set(t, [ e ]);
|
|
113
|
-
}
|
|
114
|
-
addHook(t, e) {
|
|
115
|
-
this.onHook(t, e);
|
|
116
|
-
}
|
|
117
|
-
onHooks(t) {
|
|
118
|
-
for (let e of t) this.onHook(e.event, e.handler);
|
|
119
|
-
}
|
|
120
|
-
prependHook(t, e) {
|
|
121
|
-
let s = this._hooks.get(t);
|
|
122
|
-
s ? s.unshift(e) : this._hooks.set(t, [ e ]);
|
|
123
|
-
}
|
|
124
|
-
prependOnceHook(t, e) {
|
|
125
|
-
let s = async (...r) => (this.removeHook(t, s), e(...r));
|
|
126
|
-
this.prependHook(t, s);
|
|
127
|
-
}
|
|
128
|
-
onceHook(t, e) {
|
|
129
|
-
let s = async (...r) => (this.removeHook(t, s), e(...r));
|
|
130
|
-
this.onHook(t, s);
|
|
131
|
-
}
|
|
132
|
-
removeHook(t, e) {
|
|
133
|
-
let s = this._hooks.get(t);
|
|
134
|
-
if (s) {
|
|
135
|
-
let t = s.indexOf(e);
|
|
136
|
-
t !== -1 && s.splice(t, 1);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
removeHooks(t) {
|
|
140
|
-
for (let e of t) this.removeHook(e.event, e.handler);
|
|
141
|
-
}
|
|
142
|
-
async hook(t, ...e) {
|
|
143
|
-
let s = this._hooks.get(t);
|
|
144
|
-
if (s) for (let r of s) try {
|
|
145
|
-
await r(...e);
|
|
146
|
-
} catch (e) {
|
|
147
|
-
let s = `${t}: ${e.message}`;
|
|
148
|
-
if (this.emit("error", new Error(s)), this._logger && this._logger.error(s), this._throwHookErrors) throw new Error(s);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
async callHook(t, ...e) {
|
|
152
|
-
await this.hook(t, ...e);
|
|
153
|
-
}
|
|
154
|
-
getHooks(t) {
|
|
155
|
-
return this._hooks.get(t);
|
|
156
|
-
}
|
|
157
|
-
clearHooks() {
|
|
158
|
-
this._hooks.clear();
|
|
159
|
-
}
|
|
160
|
-
};
|
|
11
|
+
import "buffer";
|
|
161
12
|
|
|
162
13
|
var o = (t => {
|
|
163
14
|
t["RedisClientNotConnectedThrown"] = "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.";
|
|
@@ -170,7 +21,53 @@ var a = t => {
|
|
|
170
21
|
return e + s;
|
|
171
22
|
};
|
|
172
23
|
|
|
173
|
-
|
|
24
|
+
function c(t, e) {
|
|
25
|
+
t ??= "redis://localhost:6379";
|
|
26
|
+
const s = new l(t, e);
|
|
27
|
+
if (e?.namespace) {
|
|
28
|
+
s.namespace = e.namespace;
|
|
29
|
+
const t = new n(s, {
|
|
30
|
+
namespace: e?.namespace,
|
|
31
|
+
useKeyPrefix: false
|
|
32
|
+
});
|
|
33
|
+
if (e?.throwOnConnectError) {
|
|
34
|
+
t.throwOnErrors = true;
|
|
35
|
+
}
|
|
36
|
+
if (e?.throwOnErrors) {
|
|
37
|
+
t.throwOnErrors = true;
|
|
38
|
+
}
|
|
39
|
+
return t;
|
|
40
|
+
}
|
|
41
|
+
const r = new n(s, {
|
|
42
|
+
useKeyPrefix: false
|
|
43
|
+
});
|
|
44
|
+
if (e?.throwOnConnectError) {
|
|
45
|
+
r.throwOnErrors = true;
|
|
46
|
+
}
|
|
47
|
+
if (e?.throwOnErrors) {
|
|
48
|
+
r.throwOnErrors = true;
|
|
49
|
+
}
|
|
50
|
+
r.namespace = void 0;
|
|
51
|
+
return r;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function h(t, e) {
|
|
55
|
+
const s = c(t, e);
|
|
56
|
+
const r = s.store;
|
|
57
|
+
r.throwOnConnectError = false;
|
|
58
|
+
r.throwOnErrors = false;
|
|
59
|
+
const i = r.client;
|
|
60
|
+
if (i.options) {
|
|
61
|
+
i.options.disableOfflineQueue = true;
|
|
62
|
+
if (i.options.socket) {
|
|
63
|
+
i.options.socket.reconnectStrategy = false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
s.throwOnErrors = false;
|
|
67
|
+
return s;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var l = class extends i {
|
|
174
71
|
_client=t();
|
|
175
72
|
_namespace;
|
|
176
73
|
_keyPrefixSeparator="::";
|
|
@@ -178,26 +75,38 @@ var c = class extends n {
|
|
|
178
75
|
_useUnlink=true;
|
|
179
76
|
_noNamespaceAffectsAll=false;
|
|
180
77
|
_throwOnConnectError=true;
|
|
181
|
-
|
|
78
|
+
_throwOnErrors=false;
|
|
182
79
|
_connectionTimeout;
|
|
183
|
-
constructor(
|
|
80
|
+
constructor(r, i) {
|
|
184
81
|
super();
|
|
185
|
-
const
|
|
82
|
+
const n = {
|
|
186
83
|
reconnectStrategy: a
|
|
187
84
|
};
|
|
188
|
-
if (
|
|
189
|
-
if (typeof
|
|
85
|
+
if (r) {
|
|
86
|
+
if (typeof r === "string") {
|
|
190
87
|
this._client = t({
|
|
191
|
-
url:
|
|
192
|
-
socket:
|
|
88
|
+
url: r,
|
|
89
|
+
socket: n
|
|
193
90
|
});
|
|
194
|
-
} else if (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
91
|
+
} else if (r.connect !== void 0) {
|
|
92
|
+
if (this.isClientSentinel(r)) {
|
|
93
|
+
this._client = r;
|
|
94
|
+
} else if (this.isClientCluster(r)) {
|
|
95
|
+
this._client = r;
|
|
96
|
+
} else {
|
|
97
|
+
this._client = r;
|
|
98
|
+
}
|
|
99
|
+
} else if (r instanceof Object) {
|
|
100
|
+
if (r.sentinelRootNodes !== void 0) {
|
|
101
|
+
this._client = e(r);
|
|
102
|
+
} else if (r.rootNodes === void 0) {
|
|
103
|
+
this._client = t(r);
|
|
104
|
+
} else {
|
|
105
|
+
this._client = s(r);
|
|
106
|
+
}
|
|
198
107
|
}
|
|
199
108
|
}
|
|
200
|
-
this.setOptions(
|
|
109
|
+
this.setOptions(i);
|
|
201
110
|
this.initClient();
|
|
202
111
|
}
|
|
203
112
|
get client() {
|
|
@@ -222,7 +131,7 @@ var c = class extends n {
|
|
|
222
131
|
noNamespaceAffectsAll: this._noNamespaceAffectsAll,
|
|
223
132
|
useUnlink: this._useUnlink,
|
|
224
133
|
throwOnConnectError: this._throwOnConnectError,
|
|
225
|
-
|
|
134
|
+
throwOnErrors: this._throwOnErrors,
|
|
226
135
|
connectionTimeout: this._connectionTimeout,
|
|
227
136
|
dialect: "redis",
|
|
228
137
|
url: t
|
|
@@ -272,11 +181,11 @@ var c = class extends n {
|
|
|
272
181
|
set throwOnConnectError(t) {
|
|
273
182
|
this._throwOnConnectError = t;
|
|
274
183
|
}
|
|
275
|
-
get
|
|
276
|
-
return this.
|
|
184
|
+
get throwOnErrors() {
|
|
185
|
+
return this._throwOnErrors;
|
|
277
186
|
}
|
|
278
|
-
set
|
|
279
|
-
this.
|
|
187
|
+
set throwOnErrors(t) {
|
|
188
|
+
this._throwOnErrors = t;
|
|
280
189
|
}
|
|
281
190
|
get connectionTimeout() {
|
|
282
191
|
return this._connectionTimeout;
|
|
@@ -296,10 +205,10 @@ var c = class extends n {
|
|
|
296
205
|
}
|
|
297
206
|
} catch (t) {
|
|
298
207
|
this.emit("error", t);
|
|
208
|
+
await this.disconnect(true);
|
|
299
209
|
if (this._throwOnConnectError) {
|
|
300
210
|
throw new Error("Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.");
|
|
301
211
|
}
|
|
302
|
-
await this.disconnect(true);
|
|
303
212
|
}
|
|
304
213
|
this.initClient();
|
|
305
214
|
return this._client;
|
|
@@ -317,29 +226,59 @@ var c = class extends n {
|
|
|
317
226
|
}
|
|
318
227
|
} catch (t) {
|
|
319
228
|
this.emit("error", t);
|
|
320
|
-
if (this.
|
|
229
|
+
if (this._throwOnErrors) {
|
|
321
230
|
throw t;
|
|
322
231
|
}
|
|
323
232
|
}
|
|
324
233
|
}
|
|
325
234
|
async setMany(t) {
|
|
326
|
-
const e = await this.getClient();
|
|
327
235
|
try {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
s.
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
236
|
+
if (this.isCluster()) {
|
|
237
|
+
await this.getClient();
|
|
238
|
+
const e = new Map;
|
|
239
|
+
for (const s of t) {
|
|
240
|
+
const t = this.createKeyPrefix(s.key, this._namespace);
|
|
241
|
+
const i = r(t);
|
|
242
|
+
const n = e.get(i) ?? [];
|
|
243
|
+
n.push(s);
|
|
244
|
+
e.set(i, n);
|
|
337
245
|
}
|
|
246
|
+
await Promise.all(Array.from(e.entries(), (async ([t, e]) => {
|
|
247
|
+
const s = await this.getSlotMaster(t);
|
|
248
|
+
const r = s.multi();
|
|
249
|
+
for (const {key: t, value: s, ttl: i} of e) {
|
|
250
|
+
const e = this.createKeyPrefix(t, this._namespace);
|
|
251
|
+
if (i) {
|
|
252
|
+
r.set(e, s, {
|
|
253
|
+
PX: i
|
|
254
|
+
});
|
|
255
|
+
} else {
|
|
256
|
+
r.set(e, s);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
await r.exec();
|
|
260
|
+
})));
|
|
261
|
+
} else {
|
|
262
|
+
const e = await this.getClient();
|
|
263
|
+
const s = e.multi();
|
|
264
|
+
for (const {key: e, value: r, ttl: i} of t) {
|
|
265
|
+
const t = this.createKeyPrefix(e, this._namespace);
|
|
266
|
+
if (i) {
|
|
267
|
+
s.set(t, r, {
|
|
268
|
+
PX: i
|
|
269
|
+
});
|
|
270
|
+
} else {
|
|
271
|
+
s.set(t, r);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
await s.exec();
|
|
338
275
|
}
|
|
339
|
-
await s.exec();
|
|
340
276
|
} catch (t) {
|
|
341
277
|
this.emit("error", t);
|
|
342
|
-
if (this.
|
|
278
|
+
if (this._throwOnConnectError && t.message === "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.") {
|
|
279
|
+
throw t;
|
|
280
|
+
}
|
|
281
|
+
if (this._throwOnErrors) {
|
|
343
282
|
throw t;
|
|
344
283
|
}
|
|
345
284
|
}
|
|
@@ -352,25 +291,45 @@ var c = class extends n {
|
|
|
352
291
|
return s === 1;
|
|
353
292
|
} catch (t) {
|
|
354
293
|
this.emit("error", t);
|
|
355
|
-
if (this.
|
|
294
|
+
if (this._throwOnErrors) {
|
|
356
295
|
throw t;
|
|
357
296
|
}
|
|
358
297
|
return false;
|
|
359
298
|
}
|
|
360
299
|
}
|
|
361
300
|
async hasMany(t) {
|
|
362
|
-
const e = await this.getClient();
|
|
363
301
|
try {
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
const t = this.
|
|
367
|
-
s
|
|
302
|
+
const e = t.map((t => this.createKeyPrefix(t, this._namespace)));
|
|
303
|
+
if (this.isCluster()) {
|
|
304
|
+
const t = this.getSlotMap(e);
|
|
305
|
+
const s = new Map;
|
|
306
|
+
await Promise.all(Array.from(t.entries(), (async ([t, e]) => {
|
|
307
|
+
const r = await this.getSlotMaster(t);
|
|
308
|
+
const i = r.multi();
|
|
309
|
+
for (const t of e) {
|
|
310
|
+
i.exists(t);
|
|
311
|
+
}
|
|
312
|
+
const n = await i.exec();
|
|
313
|
+
for (const [t, r] of n.entries()) {
|
|
314
|
+
s.set(e[t], typeof r === "number" && r === 1);
|
|
315
|
+
}
|
|
316
|
+
})));
|
|
317
|
+
return e.map((t => s.get(t) ?? false));
|
|
318
|
+
} else {
|
|
319
|
+
const t = await this.getClient();
|
|
320
|
+
const s = t.multi();
|
|
321
|
+
for (const t of e) {
|
|
322
|
+
s.exists(t);
|
|
323
|
+
}
|
|
324
|
+
const r = await s.exec();
|
|
325
|
+
return r.map((t => typeof t === "number" && t === 1));
|
|
368
326
|
}
|
|
369
|
-
const r = await s.exec();
|
|
370
|
-
return r.map((t => t === 1));
|
|
371
327
|
} catch (e) {
|
|
372
328
|
this.emit("error", e);
|
|
373
|
-
if (this.
|
|
329
|
+
if (this._throwOnConnectError && e.message === "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.") {
|
|
330
|
+
throw e;
|
|
331
|
+
}
|
|
332
|
+
if (this._throwOnErrors) {
|
|
374
333
|
throw e;
|
|
375
334
|
}
|
|
376
335
|
return Array.from({
|
|
@@ -389,7 +348,7 @@ var c = class extends n {
|
|
|
389
348
|
return s;
|
|
390
349
|
} catch (t) {
|
|
391
350
|
this.emit("error", t);
|
|
392
|
-
if (this.
|
|
351
|
+
if (this._throwOnErrors) {
|
|
393
352
|
throw t;
|
|
394
353
|
}
|
|
395
354
|
return void 0;
|
|
@@ -405,7 +364,7 @@ var c = class extends n {
|
|
|
405
364
|
return e;
|
|
406
365
|
} catch (e) {
|
|
407
366
|
this.emit("error", e);
|
|
408
|
-
if (this.
|
|
367
|
+
if (this._throwOnErrors) {
|
|
409
368
|
throw e;
|
|
410
369
|
}
|
|
411
370
|
return Array.from({
|
|
@@ -422,7 +381,7 @@ var c = class extends n {
|
|
|
422
381
|
return s > 0;
|
|
423
382
|
} catch (t) {
|
|
424
383
|
this.emit("error", t);
|
|
425
|
-
if (this.
|
|
384
|
+
if (this._throwOnErrors) {
|
|
426
385
|
throw t;
|
|
427
386
|
}
|
|
428
387
|
return false;
|
|
@@ -430,26 +389,50 @@ var c = class extends n {
|
|
|
430
389
|
}
|
|
431
390
|
async deleteMany(t) {
|
|
432
391
|
let e = false;
|
|
433
|
-
const s = await this.getClient();
|
|
434
392
|
try {
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
const t = this.
|
|
438
|
-
|
|
439
|
-
r.
|
|
440
|
-
|
|
441
|
-
|
|
393
|
+
const s = t.map((t => this.createKeyPrefix(t, this._namespace)));
|
|
394
|
+
if (this.isCluster()) {
|
|
395
|
+
const t = this.getSlotMap(s);
|
|
396
|
+
await Promise.all(Array.from(t.entries(), (async ([t, s]) => {
|
|
397
|
+
const r = await this.getSlotMaster(t);
|
|
398
|
+
const i = r.multi();
|
|
399
|
+
for (const t of s) {
|
|
400
|
+
if (this._useUnlink) {
|
|
401
|
+
i.unlink(t);
|
|
402
|
+
} else {
|
|
403
|
+
i.del(t);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
const n = await i.exec();
|
|
407
|
+
for (const t of n) {
|
|
408
|
+
if (typeof t === "number" && t > 0) {
|
|
409
|
+
e = true;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
})));
|
|
413
|
+
} else {
|
|
414
|
+
const t = await this.getClient();
|
|
415
|
+
const r = t.multi();
|
|
416
|
+
for (const t of s) {
|
|
417
|
+
if (this._useUnlink) {
|
|
418
|
+
r.unlink(t);
|
|
419
|
+
} else {
|
|
420
|
+
r.del(t);
|
|
421
|
+
}
|
|
442
422
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
423
|
+
const i = await r.exec();
|
|
424
|
+
for (const t of i) {
|
|
425
|
+
if (typeof t === "number" && t > 0) {
|
|
426
|
+
e = true;
|
|
427
|
+
}
|
|
448
428
|
}
|
|
449
429
|
}
|
|
450
430
|
} catch (t) {
|
|
451
431
|
this.emit("error", t);
|
|
452
|
-
if (this.
|
|
432
|
+
if (this._throwOnConnectError && t.message === "Redis client is not connected or has failed to connect. This is thrown because throwOnConnectError is set to true.") {
|
|
433
|
+
throw t;
|
|
434
|
+
}
|
|
435
|
+
if (this._throwOnErrors) {
|
|
453
436
|
throw t;
|
|
454
437
|
}
|
|
455
438
|
}
|
|
@@ -457,7 +440,7 @@ var c = class extends n {
|
|
|
457
440
|
}
|
|
458
441
|
async disconnect(t) {
|
|
459
442
|
if (this._client.isOpen) {
|
|
460
|
-
await (t ? this._client.
|
|
443
|
+
await (t ? this._client.destroy() : this._client.close());
|
|
461
444
|
}
|
|
462
445
|
}
|
|
463
446
|
createKeyPrefix(t, e) {
|
|
@@ -475,10 +458,14 @@ var c = class extends n {
|
|
|
475
458
|
isCluster() {
|
|
476
459
|
return this.isClientCluster(this._client);
|
|
477
460
|
}
|
|
461
|
+
isSentinel() {
|
|
462
|
+
return this.isClientSentinel(this._client);
|
|
463
|
+
}
|
|
478
464
|
async getMasterNodes() {
|
|
479
465
|
if (this.isCluster()) {
|
|
480
466
|
const t = await this.getClient();
|
|
481
|
-
|
|
467
|
+
const e = t.masters.map((async e => t.nodeClient(e)));
|
|
468
|
+
return Promise.all(e);
|
|
482
469
|
}
|
|
483
470
|
return [ await this.getClient() ];
|
|
484
471
|
}
|
|
@@ -488,7 +475,7 @@ var c = class extends n {
|
|
|
488
475
|
const e = t ? `${t}${this._keyPrefixSeparator}*` : "*";
|
|
489
476
|
let r = "0";
|
|
490
477
|
do {
|
|
491
|
-
const i = await s.scan(
|
|
478
|
+
const i = await s.scan(r, {
|
|
492
479
|
MATCH: e,
|
|
493
480
|
TYPE: "string"
|
|
494
481
|
});
|
|
@@ -521,7 +508,7 @@ var c = class extends n {
|
|
|
521
508
|
const r = this._namespace ? `${this._namespace}${this._keyPrefixSeparator}*` : "*";
|
|
522
509
|
const i = [];
|
|
523
510
|
do {
|
|
524
|
-
const n = await t.scan(
|
|
511
|
+
const n = await t.scan(e, {
|
|
525
512
|
MATCH: r,
|
|
526
513
|
COUNT: s,
|
|
527
514
|
TYPE: "string"
|
|
@@ -543,16 +530,24 @@ var c = class extends n {
|
|
|
543
530
|
}
|
|
544
531
|
}
|
|
545
532
|
async mget(t) {
|
|
546
|
-
const e =
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
533
|
+
const e = new Map;
|
|
534
|
+
if (this.isCluster()) {
|
|
535
|
+
const s = this.getSlotMap(t);
|
|
536
|
+
await Promise.all(Array.from(s.entries(), (async ([t, s]) => {
|
|
537
|
+
const r = await this.getSlotMaster(t);
|
|
538
|
+
const i = await r.mGet(s);
|
|
539
|
+
for (const [t, r] of i.entries()) {
|
|
540
|
+
e.set(s[t], r ?? void 0);
|
|
541
|
+
}
|
|
542
|
+
})));
|
|
543
|
+
} else {
|
|
544
|
+
const s = await this.getClient();
|
|
545
|
+
const r = await s.mGet(t);
|
|
546
|
+
for (const [s, i] of r.entries()) {
|
|
547
|
+
e.set(t[s], i ?? void 0);
|
|
553
548
|
}
|
|
554
|
-
}
|
|
555
|
-
return t.map((t =>
|
|
549
|
+
}
|
|
550
|
+
return t.map((t => e.get(t)));
|
|
556
551
|
}
|
|
557
552
|
async clearWithClusterSupport(t) {
|
|
558
553
|
if (t.length > 0) {
|
|
@@ -587,10 +582,10 @@ var c = class extends n {
|
|
|
587
582
|
return e;
|
|
588
583
|
}
|
|
589
584
|
isClientCluster(t) {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
return
|
|
585
|
+
return t.slots !== void 0;
|
|
586
|
+
}
|
|
587
|
+
isClientSentinel(t) {
|
|
588
|
+
return t.getSentinelNode !== void 0;
|
|
594
589
|
}
|
|
595
590
|
setOptions(t) {
|
|
596
591
|
if (!t) {
|
|
@@ -614,8 +609,8 @@ var c = class extends n {
|
|
|
614
609
|
if (t.throwOnConnectError !== void 0) {
|
|
615
610
|
this._throwOnConnectError = t.throwOnConnectError;
|
|
616
611
|
}
|
|
617
|
-
if (t.
|
|
618
|
-
this.
|
|
612
|
+
if (t.throwOnErrors !== void 0) {
|
|
613
|
+
this._throwOnErrors = t.throwOnErrors;
|
|
619
614
|
}
|
|
620
615
|
if (t.connectionTimeout !== void 0) {
|
|
621
616
|
this._connectionTimeout = t.connectionTimeout;
|
|
@@ -639,14 +634,4 @@ var c = class extends n {
|
|
|
639
634
|
}
|
|
640
635
|
};
|
|
641
636
|
|
|
642
|
-
|
|
643
|
-
t ??= "redis://localhost:6379";
|
|
644
|
-
const r = new c(t, e);
|
|
645
|
-
const i = new s(r, {
|
|
646
|
-
namespace: e?.namespace,
|
|
647
|
-
useKeyPrefix: false
|
|
648
|
-
});
|
|
649
|
-
return i;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
export { s as Keyv, o as RedisErrorMessages, h as createKeyv, c as default, a as defaultReconnectStrategy };
|
|
637
|
+
export { n as Keyv, o as RedisErrorMessages, c as createKeyv, h as createKeyvNonBlocking, l as default, a as defaultReconnectStrategy };
|
package/vendor/Package.8.cjs
CHANGED