lakutata 2.0.80 → 2.0.82
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 +1421 -884
- 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 +13 -13
- package/src/components/Database.mjs +17 -17
- package/src/components/Logger.cjs +7 -7
- package/src/components/Logger.mjs +7 -7
- package/src/components/cacher/Cacher.cjs +1186 -272
- package/src/components/cacher/Cacher.mjs +1094 -180
- package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +478 -2962
- package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +468 -2946
- package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.cjs +12 -12
- package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.mjs +11 -11
- package/src/components/cacher/adapters/CreateMongoCacheAdapter.cjs +16 -16
- package/src/components/cacher/adapters/CreateMongoCacheAdapter.mjs +14 -14
- package/src/components/cacher/adapters/CreateMysqlCacheAdapter.cjs +11 -11
- package/src/components/cacher/adapters/CreateMysqlCacheAdapter.mjs +11 -11
- package/src/components/cacher/adapters/CreatePostgresCacheAdapter.cjs +12 -12
- package/src/components/cacher/adapters/CreatePostgresCacheAdapter.mjs +13 -13
- package/src/components/cacher/adapters/CreateRedisCacheAdapter.cjs +2 -2
- package/src/components/cacher/adapters/CreateRedisCacheAdapter.mjs +2 -2
- package/src/components/cacher/adapters/CreateSqliteCacheAdapter.cjs +10 -10
- package/src/components/cacher/adapters/CreateSqliteCacheAdapter.mjs +10 -10
- package/src/components/cacher/lib/IsDriverPackageInstalled.cjs +2 -2
- package/src/components/cacher/lib/IsDriverPackageInstalled.mjs +5 -5
- package/src/components/docker/ConnectionOptionsBuilder.cjs +23 -25
- package/src/components/docker/ConnectionOptionsBuilder.mjs +19 -21
- package/src/components/docker/Docker.cjs +5035 -5096
- package/src/components/docker/Docker.mjs +4955 -5016
- 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/docker/lib/ParseEnvToRecord.cjs +2 -2
- package/src/components/docker/lib/ParseEnvToRecord.mjs +12 -12
- package/src/components/docker/lib/ParseRepositoryTag.cjs +9 -9
- package/src/components/docker/lib/ParseRepositoryTag.mjs +11 -11
- package/src/components/entrypoint/Entrypoint.cjs +2179 -1687
- package/src/components/entrypoint/Entrypoint.mjs +2182 -1690
- 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 +6 -4
- package/src/components/monitor/AliveMonitor.mjs +6 -4
- 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 +8 -6
- package/src/components/monitor/MemoryMonitor.mjs +5 -3
- package/src/decorators/asst/After.cjs +3 -3
- package/src/decorators/asst/After.mjs +2 -2
- package/src/decorators/asst/Before.cjs +2 -2
- package/src/decorators/asst/Before.mjs +4 -4
- package/src/decorators/ctrl/CLIAction.cjs +5 -5
- package/src/decorators/ctrl/CLIAction.mjs +10 -10
- package/src/decorators/ctrl/HTTPAction.cjs +9 -9
- package/src/decorators/ctrl/HTTPAction.mjs +7 -7
- package/src/decorators/ctrl/ServiceAction.cjs +6 -6
- package/src/decorators/ctrl/ServiceAction.mjs +7 -7
- package/src/decorators/ctrl/http/DELETE.cjs +5 -5
- package/src/decorators/ctrl/http/DELETE.mjs +5 -5
- package/src/decorators/ctrl/http/GET.cjs +5 -5
- package/src/decorators/ctrl/http/GET.mjs +5 -5
- package/src/decorators/ctrl/http/HEAD.cjs +5 -5
- package/src/decorators/ctrl/http/HEAD.mjs +5 -5
- package/src/decorators/ctrl/http/OPTIONS.cjs +5 -5
- package/src/decorators/ctrl/http/OPTIONS.mjs +5 -5
- package/src/decorators/ctrl/http/PATCH.cjs +5 -5
- package/src/decorators/ctrl/http/PATCH.mjs +5 -5
- package/src/decorators/ctrl/http/POST.cjs +5 -5
- package/src/decorators/ctrl/http/POST.mjs +5 -5
- package/src/decorators/ctrl/http/PUT.cjs +5 -5
- package/src/decorators/ctrl/http/PUT.mjs +5 -5
- package/src/decorators/di/Autoload.cjs +2 -2
- package/src/decorators/di/Autoload.mjs +2 -2
- package/src/decorators/di/Configurable.cjs +3 -3
- package/src/decorators/di/Configurable.mjs +2 -2
- package/src/decorators/di/Inject.cjs +6 -6
- package/src/decorators/di/Inject.mjs +11 -11
- package/src/decorators/di/Lifetime.cjs +18 -18
- package/src/decorators/di/Lifetime.mjs +13 -13
- package/src/decorators/dto/Accept.cjs +3 -3
- package/src/decorators/dto/Accept.mjs +2 -2
- package/src/decorators/dto/Expect.cjs +2 -2
- package/src/decorators/dto/Expect.mjs +3 -3
- package/src/decorators/dto/IndexSignature.cjs +2 -2
- package/src/decorators/dto/IndexSignature.mjs +3 -3
- package/src/decorators/dto/Return.cjs +3 -3
- package/src/decorators/dto/Return.mjs +2 -2
- 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 +1202 -1195
- package/src/lib/base/EventEmitter.mjs +1202 -1195
- package/src/lib/base/async-constructor/Append.cjs +11 -11
- package/src/lib/base/async-constructor/Append.mjs +7 -7
- package/src/lib/base/internal/ApplicationConfigLoader.cjs +4 -2
- package/src/lib/base/internal/ApplicationConfigLoader.mjs +4 -2
- package/src/lib/base/internal/BasicInfo.cjs +10 -10
- package/src/lib/base/internal/BasicInfo.mjs +9 -9
- package/src/lib/base/internal/CamelCase.cjs +4 -4
- package/src/lib/base/internal/CamelCase.mjs +11 -11
- package/src/lib/base/internal/ConfigurableRecordsInjection.cjs +19 -19
- package/src/lib/base/internal/ConfigurableRecordsInjection.mjs +18 -18
- package/src/lib/base/internal/ConstructorSymbol.cjs +10 -10
- package/src/lib/base/internal/ConstructorSymbol.mjs +8 -8
- package/src/lib/base/internal/ControllerEntrypoint.cjs +67 -67
- package/src/lib/base/internal/ControllerEntrypoint.mjs +38 -38
- package/src/lib/base/internal/DataValidator.cjs +176 -179
- package/src/lib/base/internal/DataValidator.mjs +221 -224
- package/src/lib/base/internal/GetActionDTOAndOptions.cjs +9 -9
- package/src/lib/base/internal/GetActionDTOAndOptions.mjs +10 -10
- package/src/lib/base/internal/IEEE754.cjs +74 -74
- package/src/lib/base/internal/IEEE754.mjs +70 -70
- package/src/lib/base/internal/MethodAssistantFunction.cjs +28 -28
- package/src/lib/base/internal/MethodAssistantFunction.mjs +38 -38
- package/src/lib/base/internal/MethodValidation.cjs +25 -25
- package/src/lib/base/internal/MethodValidation.mjs +20 -20
- package/src/lib/base/internal/ModuleConfigLoader.cjs +4 -3
- package/src/lib/base/internal/ModuleConfigLoader.mjs +4 -3
- package/src/lib/base/internal/ObjectConfiguration.cjs +10 -10
- package/src/lib/base/internal/ObjectConfiguration.mjs +15 -15
- package/src/lib/base/internal/ObjectContainer.cjs +7 -7
- package/src/lib/base/internal/ObjectContainer.mjs +6 -6
- package/src/lib/base/internal/ObjectInjection.cjs +16 -16
- package/src/lib/base/internal/ObjectInjection.mjs +13 -13
- package/src/lib/base/internal/ObjectLifetime.cjs +10 -10
- package/src/lib/base/internal/ObjectLifetime.mjs +9 -9
- package/src/lib/base/internal/ObjectType.cjs +4 -2
- package/src/lib/base/internal/ObjectType.mjs +4 -2
- package/src/lib/base/internal/ObjectWeakRefs.cjs +11 -11
- package/src/lib/base/internal/ObjectWeakRefs.mjs +9 -9
- package/src/lib/base/internal/PatternManager.cjs +744 -739
- package/src/lib/base/internal/PatternManager.mjs +748 -743
- package/src/lib/base/internal/StringifyPattern.cjs +26 -26
- package/src/lib/base/internal/StringifyPattern.mjs +26 -26
- package/src/lib/base/internal/ThrowWarning.cjs +2 -2
- package/src/lib/base/internal/ThrowWarning.mjs +2 -2
- package/src/lib/core/Alias.cjs +5 -5
- package/src/lib/core/Application.cjs +146 -142
- package/src/lib/core/Application.mjs +204 -202
- 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/ArrayToSet.cjs +2 -2
- package/src/lib/helpers/ArrayToSet.mjs +3 -3
- package/src/lib/helpers/As.cjs +2 -2
- package/src/lib/helpers/As.mjs +2 -2
- package/src/lib/helpers/ConvertArrayLikeToIterable.cjs +3 -3
- package/src/lib/helpers/ConvertArrayLikeToIterable.mjs +3 -3
- package/src/lib/helpers/ConvertArrayLikeToStream.cjs +2 -2
- package/src/lib/helpers/ConvertArrayLikeToStream.mjs +2 -2
- package/src/lib/helpers/Delay.cjs +2 -2
- package/src/lib/helpers/Delay.mjs +2 -2
- package/src/lib/helpers/DevNull.cjs +2 -2
- package/src/lib/helpers/DevNull.mjs +2 -2
- package/src/lib/helpers/GetObjectNestingDepth.cjs +12 -12
- package/src/lib/helpers/GetObjectNestingDepth.mjs +11 -11
- package/src/lib/helpers/GetObjectPropertyPaths.cjs +7 -7
- package/src/lib/helpers/GetObjectPropertyPaths.mjs +9 -9
- package/src/lib/helpers/Glob.cjs +1192 -943
- package/src/lib/helpers/Glob.mjs +1256 -1007
- package/src/lib/helpers/GraceExit.cjs +3 -3
- package/src/lib/helpers/GraceExit.mjs +7 -7
- package/src/lib/helpers/HexToIEEE754.cjs +4 -4
- package/src/lib/helpers/HexToIEEE754.mjs +2 -2
- package/src/lib/helpers/HexToSigned.cjs +5 -5
- package/src/lib/helpers/HexToSigned.mjs +4 -4
- package/src/lib/helpers/HexToUnsigned.cjs +2 -2
- package/src/lib/helpers/HexToUnsigned.mjs +2 -2
- package/src/lib/helpers/IEEE754ToHex.cjs +5 -5
- package/src/lib/helpers/IEEE754ToHex.mjs +5 -5
- package/src/lib/helpers/IsAbortError.cjs +2 -2
- package/src/lib/helpers/IsAbortError.mjs +3 -3
- package/src/lib/helpers/IsEmptyObject.cjs +3 -3
- package/src/lib/helpers/IsEmptyObject.mjs +3 -3
- package/src/lib/helpers/IsExists.cjs +5 -5
- package/src/lib/helpers/IsExists.mjs +4 -4
- package/src/lib/helpers/IsHtml.cjs +18 -8
- package/src/lib/helpers/IsHtml.mjs +18 -8
- package/src/lib/helpers/IsNativeFunction.cjs +2 -2
- package/src/lib/helpers/IsNativeFunction.mjs +2 -2
- package/src/lib/helpers/IsPath.cjs +2 -2
- package/src/lib/helpers/IsPath.mjs +5 -5
- package/src/lib/helpers/IsPromise.cjs +2 -2
- package/src/lib/helpers/IsPromise.mjs +2 -2
- package/src/lib/helpers/IsPromiseLike.cjs +5 -5
- package/src/lib/helpers/IsPromiseLike.mjs +6 -6
- package/src/lib/helpers/IsXML.cjs +1525 -1531
- package/src/lib/helpers/IsXML.mjs +1521 -1527
- package/src/lib/helpers/MD5.cjs +3 -3
- package/src/lib/helpers/MD5.mjs +3 -3
- package/src/lib/helpers/MergeArray.cjs +3 -3
- package/src/lib/helpers/MergeArray.mjs +3 -3
- package/src/lib/helpers/MergeMap.cjs +3 -3
- package/src/lib/helpers/MergeMap.mjs +3 -3
- package/src/lib/helpers/MergeSet.cjs +2 -2
- package/src/lib/helpers/MergeSet.mjs +3 -3
- package/src/lib/helpers/NoCase.cjs +27 -27
- package/src/lib/helpers/NoCase.mjs +24 -24
- package/src/lib/helpers/NonceStr.cjs +3 -3
- package/src/lib/helpers/NonceStr.mjs +3 -3
- package/src/lib/helpers/ObjectConstructor.cjs +2 -2
- package/src/lib/helpers/ObjectConstructor.mjs +4 -4
- package/src/lib/helpers/ObjectHash.cjs +385 -378
- package/src/lib/helpers/ObjectHash.mjs +381 -374
- package/src/lib/helpers/ObjectParentConstructor.cjs +2 -2
- package/src/lib/helpers/ObjectParentConstructor.mjs +5 -5
- package/src/lib/helpers/ObjectParentConstructors.cjs +6 -6
- package/src/lib/helpers/ObjectParentConstructors.mjs +2 -2
- package/src/lib/helpers/ObjectPrototype.cjs +2 -2
- package/src/lib/helpers/ObjectPrototype.mjs +2 -2
- package/src/lib/helpers/ObjectToMap.cjs +2 -2
- package/src/lib/helpers/ObjectToMap.mjs +3 -3
- package/src/lib/helpers/Paginator.cjs +2 -2
- package/src/lib/helpers/Paginator.mjs +6 -6
- package/src/lib/helpers/RandomString.cjs +170 -149
- package/src/lib/helpers/RandomString.mjs +167 -146
- package/src/lib/helpers/SHA1.cjs +3 -3
- package/src/lib/helpers/SHA1.mjs +3 -3
- package/src/lib/helpers/SHA256.cjs +3 -3
- package/src/lib/helpers/SHA256.mjs +3 -3
- package/src/lib/helpers/SetToArray.cjs +2 -2
- package/src/lib/helpers/SetToArray.mjs +2 -2
- package/src/lib/helpers/SignedToHex.cjs +4 -4
- package/src/lib/helpers/SignedToHex.mjs +4 -4
- package/src/lib/helpers/SortArray.cjs +17 -17
- package/src/lib/helpers/SortArray.mjs +16 -16
- package/src/lib/helpers/SortKeys.cjs +41 -41
- package/src/lib/helpers/SortKeys.mjs +41 -41
- package/src/lib/helpers/SortObject.cjs +2 -2
- package/src/lib/helpers/SortObject.mjs +2 -2
- package/src/lib/helpers/Statistics.cjs +1 -1
- package/src/lib/helpers/Statistics.mjs +1 -1
- package/src/lib/helpers/Templating.cjs +25 -25
- package/src/lib/helpers/Templating.mjs +25 -25
- package/src/lib/helpers/URLBuilder.cjs +355 -355
- package/src/lib/helpers/URLBuilder.mjs +349 -349
- package/src/lib/helpers/UUID.cjs +1 -1
- package/src/lib/helpers/UUID.mjs +1 -1
- package/src/lib/helpers/UniqueArray.cjs +3 -3
- package/src/lib/helpers/UniqueArray.mjs +2 -2
- package/src/lib/helpers/UnsignedToHex.cjs +3 -3
- package/src/lib/helpers/UnsignedToHex.mjs +3 -3
- package/src/lib/ioc/DependencyInjectionContainer.cjs +111 -109
- package/src/lib/ioc/DependencyInjectionContainer.mjs +123 -121
- package/src/lib/ioc/FunctionTokenizer.cjs +115 -115
- package/src/lib/ioc/FunctionTokenizer.mjs +102 -102
- package/src/lib/ioc/Lifetime.cjs +5 -5
- package/src/lib/ioc/Lifetime.mjs +5 -5
- package/src/lib/ioc/ListModules.cjs +5222 -5297
- package/src/lib/ioc/ListModules.mjs +5187 -5262
- package/src/lib/ioc/LoadModules.cjs +56 -56
- package/src/lib/ioc/LoadModules.mjs +69 -69
- package/src/lib/ioc/ParamParser.cjs +30 -30
- package/src/lib/ioc/ParamParser.mjs +41 -41
- package/src/lib/ioc/Resolvers.cjs +87 -87
- package/src/lib/ioc/Resolvers.mjs +109 -109
- package/src/lib/ioc/Utils.cjs +12 -12
- package/src/lib/ioc/Utils.mjs +18 -18
- package/src/lib/validation/VLD.cjs +4198 -4020
- package/src/lib/validation/VLD.mjs +3137 -2959
- 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 +13 -13
- package/src/providers/Database.mjs +18 -18
- package/src/providers/PasswordHash.cjs +334 -332
- package/src/providers/PasswordHash.mjs +389 -387
- package/src/providers/migration/GenerateMigration.cjs +15 -19
- package/src/providers/migration/GenerateMigration.mjs +15 -19
- package/vendor/Package.1.cjs +256 -256
- package/vendor/Package.1.mjs +254 -254
- 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 +18115 -1921
- package/vendor/Package.16.mjs +18115 -1839
- package/vendor/Package.17.cjs +1926 -47922
- package/vendor/Package.17.mjs +1852 -47915
- 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 +5856 -5827
- package/vendor/Package.2.mjs +5854 -5825
- 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.3.cjs +60 -60
- package/vendor/Package.3.mjs +85 -85
- 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 +887 -877
- 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 +19 -15
- package/vendor/Package.5.mjs +14 -10
- 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 +2067 -2058
- package/vendor/Package.6.mjs +2073 -2064
- package/vendor/Package.60.cjs +47649 -0
- package/vendor/Package.60.mjs +47606 -0
- package/vendor/Package.610.cjs +19 -19
- package/vendor/Package.610.mjs +11 -11
- package/vendor/Package.611.cjs +40 -30
- package/vendor/Package.611.mjs +30 -20
- package/vendor/Package.612.cjs +48 -42
- package/vendor/Package.612.mjs +39 -33
- package/vendor/Package.613.cjs +64 -63
- package/vendor/Package.613.mjs +34 -33
- package/vendor/Package.62.cjs +300 -297
- package/vendor/Package.62.mjs +283 -280
- package/vendor/Package.63.cjs +511 -168
- 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 +433 -282
- package/vendor/Package.67.mjs +431 -280
- package/vendor/Package.68.cjs +248 -397
- package/vendor/Package.68.mjs +81 -230
- package/vendor/Package.69.cjs +8 -8
- package/vendor/Package.7.cjs +3 -3
- package/vendor/Package.7.mjs +3 -3
- package/vendor/Package.8.cjs +0 -4
- package/vendor/Package.8.mjs +0 -4
- package/vendor/Package.9.cjs +138 -124
- package/vendor/Package.9.mjs +135 -121
- 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
|
@@ -2,43 +2,45 @@ import { _ as e, a as t } from "../../../vendor/Package.1.mjs";
|
|
|
2
2
|
|
|
3
3
|
import r from "events";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { H as s } from "../../../vendor/Package.66.mjs";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { K as i } from "../../../vendor/Package.67.mjs";
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Component as n } from "../../lib/core/Component.mjs";
|
|
10
|
+
|
|
11
|
+
import { Configurable as o } from "../../decorators/di/Configurable.mjs";
|
|
10
12
|
|
|
11
13
|
import { As as a } from "../../lib/helpers/As.mjs";
|
|
12
14
|
|
|
13
|
-
import { CreateFileCacheAdapter as
|
|
15
|
+
import { CreateFileCacheAdapter as c } from "./adapters/CreateFileCacheAdapter.mjs";
|
|
14
16
|
|
|
15
|
-
import { CreateRedisCacheAdapter as
|
|
17
|
+
import { CreateRedisCacheAdapter as l } from "./adapters/CreateRedisCacheAdapter.mjs";
|
|
16
18
|
|
|
17
|
-
import { CreateMemcacheCacheAdapter as
|
|
19
|
+
import { CreateMemcacheCacheAdapter as h } from "./adapters/CreateMemcacheCacheAdapter.mjs";
|
|
18
20
|
|
|
19
|
-
import { CreateMongoCacheAdapter as
|
|
21
|
+
import { CreateMongoCacheAdapter as m } from "./adapters/CreateMongoCacheAdapter.mjs";
|
|
20
22
|
|
|
21
|
-
import { CreateSqliteCacheAdapter as
|
|
23
|
+
import { CreateSqliteCacheAdapter as u } from "./adapters/CreateSqliteCacheAdapter.mjs";
|
|
22
24
|
|
|
23
|
-
import { CreatePostgresCacheAdapter as
|
|
25
|
+
import { CreatePostgresCacheAdapter as d } from "./adapters/CreatePostgresCacheAdapter.mjs";
|
|
24
26
|
|
|
25
|
-
import { CreateMysqlCacheAdapter as
|
|
27
|
+
import { CreateMysqlCacheAdapter as f } from "./adapters/CreateMysqlCacheAdapter.mjs";
|
|
26
28
|
|
|
27
|
-
import { D as
|
|
29
|
+
import { D as p } from "../../../vendor/Package.2.mjs";
|
|
28
30
|
|
|
29
31
|
import { FileCacheOptions as y } from "./options/FileCacheOptions.mjs";
|
|
30
32
|
|
|
31
|
-
import { RedisCacheOptions as
|
|
33
|
+
import { RedisCacheOptions as g } from "./options/RedisCacheOptions.mjs";
|
|
32
34
|
|
|
33
|
-
import { MemcacheCacheOptions as
|
|
35
|
+
import { MemcacheCacheOptions as b } from "./options/MemcacheCacheOptions.mjs";
|
|
34
36
|
|
|
35
|
-
import { MongoCacheOptions as
|
|
37
|
+
import { MongoCacheOptions as v } from "./options/MongoCacheOptions.mjs";
|
|
36
38
|
|
|
37
|
-
import { SqliteCacheOptions as
|
|
39
|
+
import { SqliteCacheOptions as _ } from "./options/SqliteCacheOptions.mjs";
|
|
38
40
|
|
|
39
|
-
import { PostgresCacheOptions as
|
|
41
|
+
import { PostgresCacheOptions as j } from "./options/PostgresCacheOptions.mjs";
|
|
40
42
|
|
|
41
|
-
import { MysqlCacheOptions as
|
|
43
|
+
import { MysqlCacheOptions as w } from "./options/MysqlCacheOptions.mjs";
|
|
42
44
|
|
|
43
45
|
import "buffer";
|
|
44
46
|
|
|
@@ -134,10 +136,12 @@ import "os";
|
|
|
134
136
|
|
|
135
137
|
import "path";
|
|
136
138
|
|
|
137
|
-
import "stream";
|
|
138
|
-
|
|
139
139
|
import "fs";
|
|
140
140
|
|
|
141
|
+
import "../../../vendor/Package.10.mjs";
|
|
142
|
+
|
|
143
|
+
import "stream";
|
|
144
|
+
|
|
141
145
|
import "../../lib/ioc/Utils.mjs";
|
|
142
146
|
|
|
143
147
|
import "../../lib/ioc/FunctionTokenizer.mjs";
|
|
@@ -180,15 +184,9 @@ import "../../lib/core/Provider.mjs";
|
|
|
180
184
|
|
|
181
185
|
import "../../../vendor/Package.12.mjs";
|
|
182
186
|
|
|
183
|
-
import "
|
|
184
|
-
|
|
185
|
-
import "constants";
|
|
186
|
-
|
|
187
|
-
import "../../../vendor/Package.15.mjs";
|
|
187
|
+
import "fs/promises";
|
|
188
188
|
|
|
189
|
-
import "
|
|
190
|
-
|
|
191
|
-
import "../../../vendor/Package.122.mjs";
|
|
189
|
+
import "../../../vendor/Package.14.mjs";
|
|
192
190
|
|
|
193
191
|
import "./lib/IsDriverPackageInstalled.mjs";
|
|
194
192
|
|
|
@@ -196,49 +194,537 @@ import "./exceptions/CacheDriverNotFoundException.mjs";
|
|
|
196
194
|
|
|
197
195
|
import "../../lib/helpers/URLBuilder.mjs";
|
|
198
196
|
|
|
199
|
-
var
|
|
197
|
+
var S = class {
|
|
198
|
+
get name() {
|
|
199
|
+
return "crc32";
|
|
200
|
+
}
|
|
201
|
+
toHashSync(e) {
|
|
202
|
+
let t;
|
|
203
|
+
if (e instanceof Uint8Array) {
|
|
204
|
+
t = e;
|
|
205
|
+
} else if (e instanceof ArrayBuffer) {
|
|
206
|
+
t = new Uint8Array(e);
|
|
207
|
+
} else if (e instanceof DataView) {
|
|
208
|
+
t = new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
209
|
+
} else {
|
|
210
|
+
const r = e;
|
|
211
|
+
t = new Uint8Array(r.buffer, r.byteOffset, r.byteLength);
|
|
212
|
+
}
|
|
213
|
+
const r = 3988292384;
|
|
214
|
+
let s = 4294967295;
|
|
215
|
+
for (let e = 0; e < t.length; e++) {
|
|
216
|
+
s = s ^ t[e];
|
|
217
|
+
for (let e = 0; e < 8; e++) {
|
|
218
|
+
s = s >>> 1 ^ r & -(s & 1);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
s = (s ^ 4294967295) >>> 0;
|
|
222
|
+
const i = s.toString(16).padStart(8, "0");
|
|
223
|
+
return i;
|
|
224
|
+
}
|
|
225
|
+
async toHash(e) {
|
|
226
|
+
return this.toHashSync(e);
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
var A = class {
|
|
231
|
+
_algorithm="SHA-256";
|
|
232
|
+
constructor(e) {
|
|
233
|
+
if (e?.algorithm) {
|
|
234
|
+
this._algorithm = e?.algorithm;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
get name() {
|
|
238
|
+
return this._algorithm;
|
|
239
|
+
}
|
|
240
|
+
async toHash(e) {
|
|
241
|
+
const t = await crypto.subtle.digest(this._algorithm, e);
|
|
242
|
+
const r = Array.from(new Uint8Array(t));
|
|
243
|
+
const s = r.map((e => e.toString(16).padStart(2, "0"))).join("");
|
|
244
|
+
return s;
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
var k = class {
|
|
249
|
+
get name() {
|
|
250
|
+
return "djb2";
|
|
251
|
+
}
|
|
252
|
+
toHashSync(e) {
|
|
253
|
+
let t;
|
|
254
|
+
if (e instanceof Uint8Array) {
|
|
255
|
+
t = e;
|
|
256
|
+
} else if (e instanceof ArrayBuffer) {
|
|
257
|
+
t = new Uint8Array(e);
|
|
258
|
+
} else if (e instanceof DataView) {
|
|
259
|
+
t = new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
260
|
+
} else {
|
|
261
|
+
const r = e;
|
|
262
|
+
t = new Uint8Array(r.buffer, r.byteOffset, r.byteLength);
|
|
263
|
+
}
|
|
264
|
+
let r = 5381;
|
|
265
|
+
for (let e = 0; e < t.length; e++) {
|
|
266
|
+
r = (r << 5) + r + t[e];
|
|
267
|
+
r = r >>> 0;
|
|
268
|
+
}
|
|
269
|
+
const s = r.toString(16).padStart(8, "0");
|
|
270
|
+
return s;
|
|
271
|
+
}
|
|
272
|
+
async toHash(e) {
|
|
273
|
+
return this.toHashSync(e);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
var x = class {
|
|
278
|
+
get name() {
|
|
279
|
+
return "fnv1";
|
|
280
|
+
}
|
|
281
|
+
toHashSync(e) {
|
|
282
|
+
let t;
|
|
283
|
+
if (e instanceof Uint8Array) {
|
|
284
|
+
t = e;
|
|
285
|
+
} else if (e instanceof ArrayBuffer) {
|
|
286
|
+
t = new Uint8Array(e);
|
|
287
|
+
} else if (e instanceof DataView) {
|
|
288
|
+
t = new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
289
|
+
} else {
|
|
290
|
+
const r = e;
|
|
291
|
+
t = new Uint8Array(r.buffer, r.byteOffset, r.byteLength);
|
|
292
|
+
}
|
|
293
|
+
const r = 2166136261;
|
|
294
|
+
const s = 16777619;
|
|
295
|
+
let i = r;
|
|
296
|
+
for (let e = 0; e < t.length; e++) {
|
|
297
|
+
i = i * s;
|
|
298
|
+
i = i ^ t[e];
|
|
299
|
+
i = i >>> 0;
|
|
300
|
+
}
|
|
301
|
+
const n = i.toString(16).padStart(8, "0");
|
|
302
|
+
return n;
|
|
303
|
+
}
|
|
304
|
+
async toHash(e) {
|
|
305
|
+
return this.toHashSync(e);
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
var C = class {
|
|
310
|
+
_seed;
|
|
311
|
+
constructor(e = 0) {
|
|
312
|
+
this._seed = e >>> 0;
|
|
313
|
+
}
|
|
314
|
+
get name() {
|
|
315
|
+
return "murmer";
|
|
316
|
+
}
|
|
317
|
+
get seed() {
|
|
318
|
+
return this._seed;
|
|
319
|
+
}
|
|
320
|
+
toHashSync(e) {
|
|
321
|
+
let t;
|
|
322
|
+
if (e instanceof Uint8Array) {
|
|
323
|
+
t = e;
|
|
324
|
+
} else if (e instanceof ArrayBuffer) {
|
|
325
|
+
t = new Uint8Array(e);
|
|
326
|
+
} else if (e instanceof DataView) {
|
|
327
|
+
t = new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
328
|
+
} else {
|
|
329
|
+
const r = e;
|
|
330
|
+
t = new Uint8Array(r.buffer, r.byteOffset, r.byteLength);
|
|
331
|
+
}
|
|
332
|
+
const r = 3432918353;
|
|
333
|
+
const s = 461845907;
|
|
334
|
+
const i = t.length;
|
|
335
|
+
const n = Math.floor(i / 4);
|
|
336
|
+
let o = this._seed;
|
|
337
|
+
for (let e = 0; e < n; e++) {
|
|
338
|
+
const i = e * 4;
|
|
339
|
+
let n = t[i] & 255 | (t[i + 1] & 255) << 8 | (t[i + 2] & 255) << 16 | (t[i + 3] & 255) << 24;
|
|
340
|
+
n = this._imul(n, r);
|
|
341
|
+
n = this._rotl32(n, 15);
|
|
342
|
+
n = this._imul(n, s);
|
|
343
|
+
o ^= n;
|
|
344
|
+
o = this._rotl32(o, 13);
|
|
345
|
+
o = this._imul(o, 5) + 3864292196;
|
|
346
|
+
}
|
|
347
|
+
const a = n * 4;
|
|
348
|
+
let c = 0;
|
|
349
|
+
switch (i & 3) {
|
|
350
|
+
case 3:
|
|
351
|
+
c ^= (t[a + 2] & 255) << 16;
|
|
352
|
+
|
|
353
|
+
case 2:
|
|
354
|
+
c ^= (t[a + 1] & 255) << 8;
|
|
355
|
+
|
|
356
|
+
case 1:
|
|
357
|
+
c ^= t[a] & 255;
|
|
358
|
+
c = this._imul(c, r);
|
|
359
|
+
c = this._rotl32(c, 15);
|
|
360
|
+
c = this._imul(c, s);
|
|
361
|
+
o ^= c;
|
|
362
|
+
}
|
|
363
|
+
o ^= i;
|
|
364
|
+
o ^= o >>> 16;
|
|
365
|
+
o = this._imul(o, 2246822507);
|
|
366
|
+
o ^= o >>> 13;
|
|
367
|
+
o = this._imul(o, 3266489909);
|
|
368
|
+
o ^= o >>> 16;
|
|
369
|
+
o = o >>> 0;
|
|
370
|
+
const l = o.toString(16).padStart(8, "0");
|
|
371
|
+
return l;
|
|
372
|
+
}
|
|
373
|
+
async toHash(e) {
|
|
374
|
+
return this.toHashSync(e);
|
|
375
|
+
}
|
|
376
|
+
_imul(e, t) {
|
|
377
|
+
if (Math.imul) {
|
|
378
|
+
return Math.imul(e, t);
|
|
379
|
+
}
|
|
380
|
+
const r = e >>> 16 & 65535;
|
|
381
|
+
const s = e & 65535;
|
|
382
|
+
const i = t >>> 16 & 65535;
|
|
383
|
+
const n = t & 65535;
|
|
384
|
+
return s * n + (r * n + s * i << 16 >>> 0) | 0;
|
|
385
|
+
}
|
|
386
|
+
_rotl32(e, t) {
|
|
387
|
+
return e << t | e >>> 32 - t;
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
var P = class {
|
|
392
|
+
_providers=new Map;
|
|
393
|
+
_getFuzzy=true;
|
|
394
|
+
constructor(e) {
|
|
395
|
+
if (e?.providers) {
|
|
396
|
+
this.loadProviders(e?.providers);
|
|
397
|
+
}
|
|
398
|
+
if (e?.getFuzzy !== void 0) {
|
|
399
|
+
this._getFuzzy = Boolean(e?.getFuzzy);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
loadProviders(e) {
|
|
403
|
+
for (const t of e) {
|
|
404
|
+
this._providers.set(t.name, t);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
get providers() {
|
|
408
|
+
return this._providers;
|
|
409
|
+
}
|
|
410
|
+
set providers(e) {
|
|
411
|
+
this._providers = e;
|
|
412
|
+
}
|
|
413
|
+
get names() {
|
|
414
|
+
return Array.from(this._providers.keys());
|
|
415
|
+
}
|
|
416
|
+
get(e, t) {
|
|
417
|
+
const r = t?.fuzzy ?? this._getFuzzy;
|
|
418
|
+
e = e.trim();
|
|
419
|
+
let s = this._providers.get(e);
|
|
420
|
+
if (s === void 0 && r === true) {
|
|
421
|
+
e = e.toLowerCase();
|
|
422
|
+
s = this._providers.get(e);
|
|
423
|
+
}
|
|
424
|
+
if (s === void 0 && r === true) {
|
|
425
|
+
e = e.replaceAll("-", "");
|
|
426
|
+
s = this._providers.get(e);
|
|
427
|
+
}
|
|
428
|
+
return s;
|
|
429
|
+
}
|
|
430
|
+
add(e) {
|
|
431
|
+
this._providers.set(e.name, e);
|
|
432
|
+
}
|
|
433
|
+
remove(e) {
|
|
434
|
+
return this._providers.delete(e);
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
var z = class extends s {
|
|
439
|
+
_parse=JSON.parse;
|
|
440
|
+
_stringify=JSON.stringify;
|
|
441
|
+
_providers=new P;
|
|
442
|
+
_defaultAlgorithm="SHA-256";
|
|
443
|
+
_defaultAlgorithmSync="djb2";
|
|
444
|
+
constructor(e) {
|
|
445
|
+
super(e);
|
|
446
|
+
if (e?.parse) {
|
|
447
|
+
this._parse = e.parse;
|
|
448
|
+
}
|
|
449
|
+
if (e?.stringify) {
|
|
450
|
+
this._stringify = e.stringify;
|
|
451
|
+
}
|
|
452
|
+
if (e?.defaultAlgorithm) {
|
|
453
|
+
this._defaultAlgorithm = e.defaultAlgorithm;
|
|
454
|
+
}
|
|
455
|
+
if (e?.defaultAlgorithmSync) {
|
|
456
|
+
this._defaultAlgorithmSync = e.defaultAlgorithmSync;
|
|
457
|
+
}
|
|
458
|
+
this.loadProviders(e?.providers, {
|
|
459
|
+
includeBase: e?.includeBase ?? true
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
get parse() {
|
|
463
|
+
return this._parse;
|
|
464
|
+
}
|
|
465
|
+
set parse(e) {
|
|
466
|
+
this._parse = e;
|
|
467
|
+
}
|
|
468
|
+
get stringify() {
|
|
469
|
+
return this._stringify;
|
|
470
|
+
}
|
|
471
|
+
set stringify(e) {
|
|
472
|
+
this._stringify = e;
|
|
473
|
+
}
|
|
474
|
+
get providers() {
|
|
475
|
+
return this._providers;
|
|
476
|
+
}
|
|
477
|
+
set providers(e) {
|
|
478
|
+
this._providers = e;
|
|
479
|
+
}
|
|
480
|
+
get names() {
|
|
481
|
+
return this._providers.names;
|
|
482
|
+
}
|
|
483
|
+
get defaultAlgorithm() {
|
|
484
|
+
return this._defaultAlgorithm;
|
|
485
|
+
}
|
|
486
|
+
set defaultAlgorithm(e) {
|
|
487
|
+
this._defaultAlgorithm = e;
|
|
488
|
+
}
|
|
489
|
+
get defaultAlgorithmSync() {
|
|
490
|
+
return this._defaultAlgorithmSync;
|
|
491
|
+
}
|
|
492
|
+
set defaultAlgorithmSync(e) {
|
|
493
|
+
this._defaultAlgorithmSync = e;
|
|
494
|
+
}
|
|
495
|
+
async toHash(e, t) {
|
|
496
|
+
const r = {
|
|
497
|
+
data: e,
|
|
498
|
+
algorithm: t?.algorithm ?? this._defaultAlgorithm,
|
|
499
|
+
maxLength: t?.maxLength
|
|
500
|
+
};
|
|
501
|
+
await this.beforeHook("toHash", r);
|
|
502
|
+
const s = this._stringify(r.data);
|
|
503
|
+
const i = new TextEncoder;
|
|
504
|
+
const n = i.encode(s);
|
|
505
|
+
let o = this._providers.get(r.algorithm);
|
|
506
|
+
if (!o) {
|
|
507
|
+
o = new A({
|
|
508
|
+
algorithm: this._defaultAlgorithm
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
let a = await o.toHash(n);
|
|
512
|
+
if (t?.maxLength && a.length > t?.maxLength) {
|
|
513
|
+
a = a.substring(0, t.maxLength);
|
|
514
|
+
}
|
|
515
|
+
const c = {
|
|
516
|
+
hash: a,
|
|
517
|
+
data: r.data,
|
|
518
|
+
algorithm: r.algorithm
|
|
519
|
+
};
|
|
520
|
+
await this.afterHook("toHash", c);
|
|
521
|
+
return c.hash;
|
|
522
|
+
}
|
|
523
|
+
async toNumber(e, t = {}) {
|
|
524
|
+
const {min: r = 0, max: s = 100, algorithm: i = this._defaultAlgorithm, hashLength: n = 16} = t;
|
|
525
|
+
if (r > s) {
|
|
526
|
+
throw new Error("min cannot be greater than max");
|
|
527
|
+
}
|
|
528
|
+
const o = await this.toHash(e, {
|
|
529
|
+
algorithm: i,
|
|
530
|
+
maxLength: n
|
|
531
|
+
});
|
|
532
|
+
const a = Number.parseInt(o, 16);
|
|
533
|
+
const c = s - r + 1;
|
|
534
|
+
const l = r + a % c;
|
|
535
|
+
return l;
|
|
536
|
+
}
|
|
537
|
+
toHashSync(e, t) {
|
|
538
|
+
const r = {
|
|
539
|
+
data: e,
|
|
540
|
+
algorithm: t?.algorithm ?? this._defaultAlgorithmSync,
|
|
541
|
+
maxLength: t?.maxLength
|
|
542
|
+
};
|
|
543
|
+
this.beforeHook("toHashSync", r);
|
|
544
|
+
const s = r.algorithm;
|
|
545
|
+
const i = this._stringify(r.data);
|
|
546
|
+
const n = new TextEncoder;
|
|
547
|
+
const o = n.encode(i);
|
|
548
|
+
const a = this._providers.get(s);
|
|
549
|
+
if (!a) {
|
|
550
|
+
throw new Error(`Hash provider '${s}' not found`);
|
|
551
|
+
}
|
|
552
|
+
if (!a.toHashSync) {
|
|
553
|
+
throw new Error(`Hash provider '${s}' does not support synchronous hashing. Use toHash() instead or choose a different algorithm (djb2, fnv1, murmer, crc32).`);
|
|
554
|
+
}
|
|
555
|
+
let c = a.toHashSync(o);
|
|
556
|
+
if (t?.maxLength && c.length > t?.maxLength) {
|
|
557
|
+
c = c.substring(0, t.maxLength);
|
|
558
|
+
}
|
|
559
|
+
const l = {
|
|
560
|
+
hash: c,
|
|
561
|
+
data: r.data,
|
|
562
|
+
algorithm: r.algorithm
|
|
563
|
+
};
|
|
564
|
+
this.afterHook("toHashSync", l);
|
|
565
|
+
return l.hash;
|
|
566
|
+
}
|
|
567
|
+
toNumberSync(e, t = {}) {
|
|
568
|
+
const {min: r = 0, max: s = 100, algorithm: i = this._defaultAlgorithmSync, hashLength: n = 16} = t;
|
|
569
|
+
if (r > s) {
|
|
570
|
+
throw new Error("min cannot be greater than max");
|
|
571
|
+
}
|
|
572
|
+
const o = this.toHashSync(e, {
|
|
573
|
+
algorithm: i,
|
|
574
|
+
maxLength: n
|
|
575
|
+
});
|
|
576
|
+
const a = Number.parseInt(o, 16);
|
|
577
|
+
const c = s - r + 1;
|
|
578
|
+
const l = r + a % c;
|
|
579
|
+
return l;
|
|
580
|
+
}
|
|
581
|
+
loadProviders(e, t = {
|
|
582
|
+
includeBase: true
|
|
583
|
+
}) {
|
|
584
|
+
if (e) {
|
|
585
|
+
for (const t of e) {
|
|
586
|
+
this._providers.add(t);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
if (t.includeBase) {
|
|
590
|
+
this.providers.add(new A({
|
|
591
|
+
algorithm: "SHA-256"
|
|
592
|
+
}));
|
|
593
|
+
this.providers.add(new A({
|
|
594
|
+
algorithm: "SHA-384"
|
|
595
|
+
}));
|
|
596
|
+
this.providers.add(new A({
|
|
597
|
+
algorithm: "SHA-512"
|
|
598
|
+
}));
|
|
599
|
+
this.providers.add(new S);
|
|
600
|
+
this.providers.add(new k);
|
|
601
|
+
this.providers.add(new x);
|
|
602
|
+
this.providers.add(new C);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
var shorthandToMilliseconds = e => {
|
|
608
|
+
let t;
|
|
609
|
+
if (e === void 0) {
|
|
610
|
+
return void 0;
|
|
611
|
+
}
|
|
612
|
+
if (typeof e === "number") {
|
|
613
|
+
t = e;
|
|
614
|
+
} else {
|
|
615
|
+
if (typeof e !== "string") {
|
|
616
|
+
return void 0;
|
|
617
|
+
}
|
|
618
|
+
e = e.trim();
|
|
619
|
+
if (Number.isNaN(Number(e))) {
|
|
620
|
+
const r = /^([\d.]+)\s*(ms|s|m|h|hr|d)$/i.exec(e);
|
|
621
|
+
if (!r) {
|
|
622
|
+
throw new Error(`Unsupported time format: "${e}". Use 'ms', 's', 'm', 'h', 'hr', or 'd'.`);
|
|
623
|
+
}
|
|
624
|
+
const [, s, i] = r;
|
|
625
|
+
const n = Number.parseFloat(s);
|
|
626
|
+
const o = i.toLowerCase();
|
|
627
|
+
switch (o) {
|
|
628
|
+
case "ms":
|
|
629
|
+
{
|
|
630
|
+
t = n;
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
case "s":
|
|
635
|
+
{
|
|
636
|
+
t = n * 1e3;
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
case "m":
|
|
641
|
+
{
|
|
642
|
+
t = n * 1e3 * 60;
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
case "h":
|
|
647
|
+
{
|
|
648
|
+
t = n * 1e3 * 60 * 60;
|
|
649
|
+
break;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
case "hr":
|
|
653
|
+
{
|
|
654
|
+
t = n * 1e3 * 60 * 60;
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
case "d":
|
|
659
|
+
{
|
|
660
|
+
t = n * 1e3 * 60 * 60 * 24;
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
default:
|
|
665
|
+
{
|
|
666
|
+
t = Number(e);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
} else {
|
|
670
|
+
t = Number(e);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
return t;
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
var shorthandToTime = (e, t) => {
|
|
677
|
+
t ??= new Date;
|
|
678
|
+
const r = shorthandToMilliseconds(e);
|
|
679
|
+
if (r === void 0) {
|
|
680
|
+
return t.getTime();
|
|
681
|
+
}
|
|
682
|
+
return t.getTime() + r;
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
var H = new Map;
|
|
200
686
|
|
|
201
|
-
function
|
|
202
|
-
return
|
|
687
|
+
function hasKey(e) {
|
|
688
|
+
return H.has(e);
|
|
203
689
|
}
|
|
204
690
|
|
|
205
|
-
function
|
|
206
|
-
|
|
691
|
+
function addKey(e) {
|
|
692
|
+
H.set(e, []);
|
|
207
693
|
}
|
|
208
694
|
|
|
209
|
-
function
|
|
210
|
-
|
|
695
|
+
function removeKey(e) {
|
|
696
|
+
H.delete(e);
|
|
211
697
|
}
|
|
212
698
|
|
|
213
|
-
function
|
|
214
|
-
const r =
|
|
699
|
+
function addCallbackToKey(e, t) {
|
|
700
|
+
const r = getCallbacksByKey(e);
|
|
215
701
|
r.push(t);
|
|
216
|
-
|
|
702
|
+
H.set(e, r);
|
|
217
703
|
}
|
|
218
704
|
|
|
219
|
-
function
|
|
220
|
-
return
|
|
705
|
+
function getCallbacksByKey(e) {
|
|
706
|
+
return H.get(e) ?? [];
|
|
221
707
|
}
|
|
222
708
|
|
|
223
|
-
async function
|
|
709
|
+
async function enqueue(e) {
|
|
224
710
|
return new Promise(((t, r) => {
|
|
225
711
|
const s = {
|
|
226
712
|
resolve: t,
|
|
227
713
|
reject: r
|
|
228
714
|
};
|
|
229
|
-
|
|
715
|
+
addCallbackToKey(e, s);
|
|
230
716
|
}));
|
|
231
717
|
}
|
|
232
718
|
|
|
233
|
-
function
|
|
234
|
-
const t =
|
|
235
|
-
|
|
719
|
+
function dequeue(e) {
|
|
720
|
+
const t = getCallbacksByKey(e);
|
|
721
|
+
removeKey(e);
|
|
236
722
|
return t;
|
|
237
723
|
}
|
|
238
724
|
|
|
239
|
-
function
|
|
725
|
+
function coalesce(e) {
|
|
240
726
|
const {key: t, error: r, result: s} = e;
|
|
241
|
-
for (const e of
|
|
727
|
+
for (const e of dequeue(t)) {
|
|
242
728
|
if (r) {
|
|
243
729
|
e.reject(r);
|
|
244
730
|
} else {
|
|
@@ -247,40 +733,422 @@ function O(e) {
|
|
|
247
733
|
}
|
|
248
734
|
}
|
|
249
735
|
|
|
250
|
-
async function
|
|
251
|
-
if (!
|
|
252
|
-
|
|
736
|
+
async function coalesceAsync(e, t) {
|
|
737
|
+
if (!hasKey(e)) {
|
|
738
|
+
addKey(e);
|
|
253
739
|
try {
|
|
254
740
|
const r = await Promise.resolve(t());
|
|
255
|
-
|
|
741
|
+
coalesce({
|
|
256
742
|
key: e,
|
|
257
743
|
result: r
|
|
258
744
|
});
|
|
259
745
|
return r;
|
|
260
746
|
} catch (t) {
|
|
261
|
-
|
|
747
|
+
coalesce({
|
|
262
748
|
key: e,
|
|
263
749
|
error: t
|
|
264
750
|
});
|
|
265
751
|
throw t;
|
|
266
752
|
}
|
|
267
753
|
}
|
|
268
|
-
return
|
|
754
|
+
return enqueue(e);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
var O = (e => {
|
|
758
|
+
e["SHA256"] = "SHA-256";
|
|
759
|
+
e["SHA384"] = "SHA-384";
|
|
760
|
+
e["SHA512"] = "SHA-512";
|
|
761
|
+
e["DJB2"] = "djb2";
|
|
762
|
+
e["FNV1"] = "fnv1";
|
|
763
|
+
e["MURMER"] = "murmer";
|
|
764
|
+
e["CRC32"] = "crc32";
|
|
765
|
+
return e;
|
|
766
|
+
})(O || {});
|
|
767
|
+
|
|
768
|
+
async function hash(e, t = {
|
|
769
|
+
algorithm: "SHA-256",
|
|
770
|
+
serialize: JSON.stringify
|
|
771
|
+
}) {
|
|
772
|
+
const r = t?.algorithm ?? "SHA-256";
|
|
773
|
+
const s = t?.serialize ?? JSON.stringify;
|
|
774
|
+
const i = s(e);
|
|
775
|
+
const n = new z;
|
|
776
|
+
return n.toHash(i, {
|
|
777
|
+
algorithm: r
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
function hashSync(e, t = {
|
|
782
|
+
algorithm: "djb2",
|
|
783
|
+
serialize: JSON.stringify
|
|
784
|
+
}) {
|
|
785
|
+
const r = t?.algorithm ?? "djb2";
|
|
786
|
+
const s = t?.serialize ?? JSON.stringify;
|
|
787
|
+
const i = s(e);
|
|
788
|
+
const n = new z;
|
|
789
|
+
return n.toHashSync(i, {
|
|
790
|
+
algorithm: r
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
async function hashToNumber(e, t = {
|
|
795
|
+
min: 0,
|
|
796
|
+
max: 10,
|
|
797
|
+
algorithm: "SHA-256",
|
|
798
|
+
serialize: JSON.stringify
|
|
799
|
+
}) {
|
|
800
|
+
const r = t?.min ?? 0;
|
|
801
|
+
const s = t?.max ?? 10;
|
|
802
|
+
const i = t?.algorithm ?? "SHA-256";
|
|
803
|
+
const n = t?.serialize ?? JSON.stringify;
|
|
804
|
+
const o = t?.hashLength ?? 16;
|
|
805
|
+
if (r >= s) {
|
|
806
|
+
throw new Error(`Invalid range: min (${r}) must be less than max (${s})`);
|
|
807
|
+
}
|
|
808
|
+
const a = n(e);
|
|
809
|
+
const c = new z;
|
|
810
|
+
return c.toNumber(a, {
|
|
811
|
+
algorithm: i,
|
|
812
|
+
min: r,
|
|
813
|
+
max: s,
|
|
814
|
+
hashLength: o
|
|
815
|
+
});
|
|
269
816
|
}
|
|
270
817
|
|
|
271
|
-
function
|
|
818
|
+
function hashToNumberSync(e, t = {
|
|
819
|
+
min: 0,
|
|
820
|
+
max: 10,
|
|
821
|
+
algorithm: "djb2",
|
|
822
|
+
serialize: JSON.stringify
|
|
823
|
+
}) {
|
|
824
|
+
const r = t?.min ?? 0;
|
|
825
|
+
const s = t?.max ?? 10;
|
|
826
|
+
const i = t?.algorithm ?? "djb2";
|
|
827
|
+
const n = t?.serialize ?? JSON.stringify;
|
|
828
|
+
const o = t?.hashLength ?? 16;
|
|
829
|
+
if (r >= s) {
|
|
830
|
+
throw new Error(`Invalid range: min (${r}) must be less than max (${s})`);
|
|
831
|
+
}
|
|
832
|
+
const a = n(e);
|
|
833
|
+
const c = new z;
|
|
834
|
+
return c.toNumberSync(a, {
|
|
835
|
+
algorithm: i,
|
|
836
|
+
min: r,
|
|
837
|
+
max: s,
|
|
838
|
+
hashLength: o
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
function isKeyvInstance(e) {
|
|
843
|
+
if (e === null || e === void 0) {
|
|
844
|
+
return false;
|
|
845
|
+
}
|
|
846
|
+
if (e instanceof i) {
|
|
847
|
+
return true;
|
|
848
|
+
}
|
|
849
|
+
const t = [ "generateIterator", "get", "getMany", "set", "setMany", "delete", "deleteMany", "has", "hasMany", "clear", "disconnect", "serialize", "deserialize" ];
|
|
850
|
+
return t.every((t => typeof e[t] === "function"));
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
function isObject(e) {
|
|
272
854
|
return e !== null && typeof e === "object" && !Array.isArray(e);
|
|
273
855
|
}
|
|
274
856
|
|
|
275
|
-
function
|
|
857
|
+
function lessThan(e, t) {
|
|
858
|
+
return typeof e === "number" && typeof t === "number" ? e < t : false;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
function wrapSync(e, t) {
|
|
862
|
+
const {ttl: r, keyPrefix: s, cache: i, serialize: n} = t;
|
|
863
|
+
return (...o) => {
|
|
864
|
+
let a = createWrapKey(e, o, {
|
|
865
|
+
keyPrefix: s,
|
|
866
|
+
serialize: n
|
|
867
|
+
});
|
|
868
|
+
if (t.createKey) {
|
|
869
|
+
a = t.createKey(e, o, t);
|
|
870
|
+
}
|
|
871
|
+
let c = i.get(a);
|
|
872
|
+
if (c === void 0) {
|
|
873
|
+
try {
|
|
874
|
+
c = e(...o);
|
|
875
|
+
i.set(a, c, r);
|
|
876
|
+
} catch (e) {
|
|
877
|
+
i.emit("error", e);
|
|
878
|
+
if (t.cacheErrors) {
|
|
879
|
+
i.set(a, e, r);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
return c;
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
async function getOrSet(e, t, r) {
|
|
888
|
+
const s = typeof e === "function" ? e(r) : e;
|
|
889
|
+
let i = await r.cache.get(s);
|
|
890
|
+
if (i === void 0) {
|
|
891
|
+
const e = r.cacheId ?? "default";
|
|
892
|
+
const n = `${e}::${s}`;
|
|
893
|
+
i = await coalesceAsync(n, (async () => {
|
|
894
|
+
try {
|
|
895
|
+
const e = await t();
|
|
896
|
+
await r.cache.set(s, e, r.ttl);
|
|
897
|
+
return e;
|
|
898
|
+
} catch (e) {
|
|
899
|
+
r.cache.emit("error", e);
|
|
900
|
+
if (r.cacheErrors) {
|
|
901
|
+
await r.cache.set(s, e, r.ttl);
|
|
902
|
+
}
|
|
903
|
+
if (r.throwErrors) {
|
|
904
|
+
throw e;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}));
|
|
908
|
+
}
|
|
909
|
+
return i;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
function wrap(e, t) {
|
|
913
|
+
const {keyPrefix: r, serialize: s} = t;
|
|
914
|
+
return async (...i) => {
|
|
915
|
+
let n = createWrapKey(e, i, {
|
|
916
|
+
keyPrefix: r,
|
|
917
|
+
serialize: s
|
|
918
|
+
});
|
|
919
|
+
if (t.createKey) {
|
|
920
|
+
n = t.createKey(e, i, t);
|
|
921
|
+
}
|
|
922
|
+
return getOrSet(n, (async () => e(...i)), t);
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
function createWrapKey(e, t, r) {
|
|
927
|
+
const {keyPrefix: s, serialize: i} = r || {};
|
|
928
|
+
if (!s) {
|
|
929
|
+
return `${e.name}::${hashSync(t, {
|
|
930
|
+
serialize: i
|
|
931
|
+
})}`;
|
|
932
|
+
}
|
|
933
|
+
return `${s}::${e.name}::${hashSync(t, {
|
|
934
|
+
serialize: i
|
|
935
|
+
})}`;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
function runIfFn(e, ...t) {
|
|
276
939
|
return typeof e === "function" ? e(...t) : e;
|
|
277
940
|
}
|
|
278
941
|
|
|
279
|
-
|
|
280
|
-
|
|
942
|
+
var sleep = async e => new Promise((t => setTimeout(t, e)));
|
|
943
|
+
|
|
944
|
+
var L = class {
|
|
945
|
+
_hits=0;
|
|
946
|
+
_misses=0;
|
|
947
|
+
_gets=0;
|
|
948
|
+
_sets=0;
|
|
949
|
+
_deletes=0;
|
|
950
|
+
_clears=0;
|
|
951
|
+
_vsize=0;
|
|
952
|
+
_ksize=0;
|
|
953
|
+
_count=0;
|
|
954
|
+
_enabled=false;
|
|
955
|
+
constructor(e) {
|
|
956
|
+
if (e?.enabled) {
|
|
957
|
+
this._enabled = e.enabled;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
get enabled() {
|
|
961
|
+
return this._enabled;
|
|
962
|
+
}
|
|
963
|
+
set enabled(e) {
|
|
964
|
+
this._enabled = e;
|
|
965
|
+
}
|
|
966
|
+
get hits() {
|
|
967
|
+
return this._hits;
|
|
968
|
+
}
|
|
969
|
+
get misses() {
|
|
970
|
+
return this._misses;
|
|
971
|
+
}
|
|
972
|
+
get gets() {
|
|
973
|
+
return this._gets;
|
|
974
|
+
}
|
|
975
|
+
get sets() {
|
|
976
|
+
return this._sets;
|
|
977
|
+
}
|
|
978
|
+
get deletes() {
|
|
979
|
+
return this._deletes;
|
|
980
|
+
}
|
|
981
|
+
get clears() {
|
|
982
|
+
return this._clears;
|
|
983
|
+
}
|
|
984
|
+
get vsize() {
|
|
985
|
+
return this._vsize;
|
|
986
|
+
}
|
|
987
|
+
get ksize() {
|
|
988
|
+
return this._ksize;
|
|
989
|
+
}
|
|
990
|
+
get count() {
|
|
991
|
+
return this._count;
|
|
992
|
+
}
|
|
993
|
+
incrementHits() {
|
|
994
|
+
if (!this._enabled) {
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
this._hits++;
|
|
998
|
+
}
|
|
999
|
+
incrementMisses() {
|
|
1000
|
+
if (!this._enabled) {
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
this._misses++;
|
|
1004
|
+
}
|
|
1005
|
+
incrementGets() {
|
|
1006
|
+
if (!this._enabled) {
|
|
1007
|
+
return;
|
|
1008
|
+
}
|
|
1009
|
+
this._gets++;
|
|
1010
|
+
}
|
|
1011
|
+
incrementSets() {
|
|
1012
|
+
if (!this._enabled) {
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
this._sets++;
|
|
1016
|
+
}
|
|
1017
|
+
incrementDeletes() {
|
|
1018
|
+
if (!this._enabled) {
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
this._deletes++;
|
|
1022
|
+
}
|
|
1023
|
+
incrementClears() {
|
|
1024
|
+
if (!this._enabled) {
|
|
1025
|
+
return;
|
|
1026
|
+
}
|
|
1027
|
+
this._clears++;
|
|
1028
|
+
}
|
|
1029
|
+
incrementVSize(e) {
|
|
1030
|
+
if (!this._enabled) {
|
|
1031
|
+
return;
|
|
1032
|
+
}
|
|
1033
|
+
this._vsize += this.roughSizeOfObject(e);
|
|
1034
|
+
}
|
|
1035
|
+
decreaseVSize(e) {
|
|
1036
|
+
if (!this._enabled) {
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1039
|
+
this._vsize -= this.roughSizeOfObject(e);
|
|
1040
|
+
}
|
|
1041
|
+
incrementKSize(e) {
|
|
1042
|
+
if (!this._enabled) {
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
this._ksize += this.roughSizeOfString(e);
|
|
1046
|
+
}
|
|
1047
|
+
decreaseKSize(e) {
|
|
1048
|
+
if (!this._enabled) {
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
this._ksize -= this.roughSizeOfString(e);
|
|
1052
|
+
}
|
|
1053
|
+
incrementCount() {
|
|
1054
|
+
if (!this._enabled) {
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
this._count++;
|
|
1058
|
+
}
|
|
1059
|
+
decreaseCount() {
|
|
1060
|
+
if (!this._enabled) {
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
this._count--;
|
|
1064
|
+
}
|
|
1065
|
+
setCount(e) {
|
|
1066
|
+
if (!this._enabled) {
|
|
1067
|
+
return;
|
|
1068
|
+
}
|
|
1069
|
+
this._count = e;
|
|
1070
|
+
}
|
|
1071
|
+
roughSizeOfString(e) {
|
|
1072
|
+
return e.length * 2;
|
|
1073
|
+
}
|
|
1074
|
+
roughSizeOfObject(e) {
|
|
1075
|
+
const t = [];
|
|
1076
|
+
const r = [ e ];
|
|
1077
|
+
let s = 0;
|
|
1078
|
+
while (r.length > 0) {
|
|
1079
|
+
const e = r.pop();
|
|
1080
|
+
if (typeof e === "boolean") {
|
|
1081
|
+
s += 4;
|
|
1082
|
+
} else if (typeof e === "string") {
|
|
1083
|
+
s += e.length * 2;
|
|
1084
|
+
} else if (typeof e === "number") {
|
|
1085
|
+
s += 8;
|
|
1086
|
+
} else {
|
|
1087
|
+
if (e === null || e === void 0) {
|
|
1088
|
+
s += 4;
|
|
1089
|
+
continue;
|
|
1090
|
+
}
|
|
1091
|
+
if (t.includes(e)) {
|
|
1092
|
+
continue;
|
|
1093
|
+
}
|
|
1094
|
+
t.push(e);
|
|
1095
|
+
for (const t in e) {
|
|
1096
|
+
s += t.length * 2;
|
|
1097
|
+
r.push(e[t]);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
return s;
|
|
1102
|
+
}
|
|
1103
|
+
reset() {
|
|
1104
|
+
this._hits = 0;
|
|
1105
|
+
this._misses = 0;
|
|
1106
|
+
this._gets = 0;
|
|
1107
|
+
this._sets = 0;
|
|
1108
|
+
this._deletes = 0;
|
|
1109
|
+
this._clears = 0;
|
|
1110
|
+
this._vsize = 0;
|
|
1111
|
+
this._ksize = 0;
|
|
1112
|
+
this._count = 0;
|
|
1113
|
+
}
|
|
1114
|
+
resetStoreValues() {
|
|
1115
|
+
this._vsize = 0;
|
|
1116
|
+
this._ksize = 0;
|
|
1117
|
+
this._count = 0;
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
function getTtlFromExpires(e) {
|
|
1122
|
+
if (e === void 0 || e === null) {
|
|
1123
|
+
return void 0;
|
|
1124
|
+
}
|
|
1125
|
+
const t = Date.now();
|
|
1126
|
+
if (e < t) {
|
|
1127
|
+
return void 0;
|
|
1128
|
+
}
|
|
1129
|
+
return e - t;
|
|
281
1130
|
}
|
|
282
1131
|
|
|
283
|
-
|
|
1132
|
+
function getCascadingTtl(e, t, r) {
|
|
1133
|
+
return r ?? t ?? shorthandToMilliseconds(e);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
function calculateTtlFromExpiration(e, t) {
|
|
1137
|
+
const r = getTtlFromExpires(t);
|
|
1138
|
+
const s = e ? Date.now() + e : void 0;
|
|
1139
|
+
if (r === void 0) {
|
|
1140
|
+
return e;
|
|
1141
|
+
}
|
|
1142
|
+
if (s === void 0) {
|
|
1143
|
+
return r;
|
|
1144
|
+
}
|
|
1145
|
+
if (t && t > s) {
|
|
1146
|
+
return e;
|
|
1147
|
+
}
|
|
1148
|
+
return r;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
var I = class {
|
|
284
1152
|
opts;
|
|
285
1153
|
namespace;
|
|
286
1154
|
_cache;
|
|
@@ -328,19 +1196,21 @@ var E = class {
|
|
|
328
1196
|
}
|
|
329
1197
|
};
|
|
330
1198
|
|
|
331
|
-
var
|
|
1199
|
+
var _storeLabel = e => e === 0 ? "primary" : `secondary:${e - 1}`;
|
|
1200
|
+
|
|
1201
|
+
var createCache = e => {
|
|
332
1202
|
const t = new r;
|
|
333
|
-
const
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
const
|
|
338
|
-
const
|
|
339
|
-
const
|
|
1203
|
+
const s = new i;
|
|
1204
|
+
s.serialize = void 0;
|
|
1205
|
+
s.deserialize = void 0;
|
|
1206
|
+
const n = e?.stores?.length ? e.stores : [ s ];
|
|
1207
|
+
const o = e?.nonBlocking ?? false;
|
|
1208
|
+
const a = e?.cacheId ?? Math.random().toString(36).slice(2);
|
|
1209
|
+
const get = async e => {
|
|
340
1210
|
let r;
|
|
341
|
-
if (
|
|
1211
|
+
if (o) {
|
|
342
1212
|
try {
|
|
343
|
-
r = await Promise.race(
|
|
1213
|
+
r = await Promise.race(n.map((async t => t.get(e))));
|
|
344
1214
|
if (r === void 0) {
|
|
345
1215
|
return void 0;
|
|
346
1216
|
}
|
|
@@ -351,40 +1221,79 @@ var B = e => {
|
|
|
351
1221
|
});
|
|
352
1222
|
}
|
|
353
1223
|
} else {
|
|
354
|
-
for (
|
|
1224
|
+
for (let s = 0; s < n.length; s++) {
|
|
1225
|
+
const i = n[s];
|
|
355
1226
|
try {
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
358
|
-
r =
|
|
1227
|
+
const n = await i.get(e);
|
|
1228
|
+
if (n !== void 0) {
|
|
1229
|
+
r = n;
|
|
359
1230
|
t.emit("get", {
|
|
360
1231
|
key: e,
|
|
361
|
-
value: r
|
|
1232
|
+
value: r,
|
|
1233
|
+
store: _storeLabel(s)
|
|
362
1234
|
});
|
|
363
1235
|
break;
|
|
364
1236
|
}
|
|
365
1237
|
} catch (r) {
|
|
366
1238
|
t.emit("get", {
|
|
367
1239
|
key: e,
|
|
368
|
-
error: r
|
|
1240
|
+
error: r,
|
|
1241
|
+
store: _storeLabel(s)
|
|
369
1242
|
});
|
|
370
1243
|
}
|
|
371
1244
|
}
|
|
372
1245
|
}
|
|
373
1246
|
return r;
|
|
374
1247
|
};
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
1248
|
+
const mget = async e => {
|
|
1249
|
+
let r = e.map((() => void 0));
|
|
1250
|
+
if (o) {
|
|
1251
|
+
try {
|
|
1252
|
+
r = await Promise.race(n.map((async t => t.getMany(e))));
|
|
1253
|
+
} catch (r) {
|
|
1254
|
+
t.emit("mget", {
|
|
1255
|
+
keys: e,
|
|
1256
|
+
error: r
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
} else {
|
|
1260
|
+
for (const s of n) {
|
|
1261
|
+
try {
|
|
1262
|
+
const t = r.map(((t, r) => t === void 0 ? {
|
|
1263
|
+
originalIndex: r,
|
|
1264
|
+
key: e[r]
|
|
1265
|
+
} : void 0)).filter((e => e !== void 0));
|
|
1266
|
+
if (t.length === 0) {
|
|
1267
|
+
break;
|
|
1268
|
+
}
|
|
1269
|
+
const i = t.map((e => e.key));
|
|
1270
|
+
const n = await s.getMany(i);
|
|
1271
|
+
for (const [e, s] of n.entries()) {
|
|
1272
|
+
if (s === void 0) {
|
|
1273
|
+
continue;
|
|
1274
|
+
}
|
|
1275
|
+
const {originalIndex: i} = t[e];
|
|
1276
|
+
r[i] = s;
|
|
1277
|
+
}
|
|
1278
|
+
} catch (r) {
|
|
1279
|
+
t.emit("mget", {
|
|
1280
|
+
keys: e,
|
|
1281
|
+
error: r
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
380
1285
|
}
|
|
381
|
-
|
|
1286
|
+
t.emit("mget", {
|
|
1287
|
+
keys: e,
|
|
1288
|
+
values: r
|
|
1289
|
+
});
|
|
1290
|
+
return r;
|
|
382
1291
|
};
|
|
383
|
-
const
|
|
1292
|
+
const ttl = async e => {
|
|
384
1293
|
let r;
|
|
385
|
-
if (
|
|
1294
|
+
if (o) {
|
|
386
1295
|
try {
|
|
387
|
-
r = await Promise.race(
|
|
1296
|
+
r = await Promise.race(n.map((async t => t.get(e, {
|
|
388
1297
|
raw: true
|
|
389
1298
|
}))));
|
|
390
1299
|
if (r === void 0) {
|
|
@@ -397,13 +1306,13 @@ var B = e => {
|
|
|
397
1306
|
});
|
|
398
1307
|
}
|
|
399
1308
|
} else {
|
|
400
|
-
for (const s of
|
|
1309
|
+
for (const s of n) {
|
|
401
1310
|
try {
|
|
402
|
-
const
|
|
1311
|
+
const i = await s.get(e, {
|
|
403
1312
|
raw: true
|
|
404
1313
|
});
|
|
405
|
-
if (
|
|
406
|
-
r =
|
|
1314
|
+
if (i !== void 0) {
|
|
1315
|
+
r = i;
|
|
407
1316
|
t.emit("ttl", {
|
|
408
1317
|
key: e,
|
|
409
1318
|
value: r
|
|
@@ -423,72 +1332,77 @@ var B = e => {
|
|
|
423
1332
|
}
|
|
424
1333
|
return void 0;
|
|
425
1334
|
};
|
|
426
|
-
const
|
|
1335
|
+
const set = async (r, s, i, n) => {
|
|
427
1336
|
try {
|
|
428
|
-
|
|
429
|
-
|
|
1337
|
+
const a = r.map((async (r, o) => {
|
|
1338
|
+
await r.set(s, i, n ?? e?.ttl);
|
|
430
1339
|
t.emit("set", {
|
|
431
1340
|
key: s,
|
|
432
|
-
value:
|
|
1341
|
+
value: i,
|
|
1342
|
+
store: _storeLabel(o)
|
|
433
1343
|
});
|
|
434
|
-
|
|
1344
|
+
}));
|
|
1345
|
+
if (o) {
|
|
1346
|
+
Promise.all(a);
|
|
1347
|
+
t.emit("set", {
|
|
1348
|
+
key: s,
|
|
1349
|
+
value: i
|
|
1350
|
+
});
|
|
1351
|
+
return i;
|
|
435
1352
|
}
|
|
436
|
-
await Promise.all(
|
|
1353
|
+
await Promise.all(a);
|
|
437
1354
|
t.emit("set", {
|
|
438
1355
|
key: s,
|
|
439
|
-
value:
|
|
1356
|
+
value: i
|
|
440
1357
|
});
|
|
441
|
-
return
|
|
1358
|
+
return i;
|
|
442
1359
|
} catch (e) {
|
|
443
1360
|
t.emit("set", {
|
|
444
1361
|
key: s,
|
|
445
|
-
value:
|
|
1362
|
+
value: i,
|
|
446
1363
|
error: e
|
|
447
1364
|
});
|
|
448
1365
|
return Promise.reject(e);
|
|
449
1366
|
}
|
|
450
1367
|
};
|
|
451
|
-
const
|
|
452
|
-
const
|
|
453
|
-
key:
|
|
454
|
-
value:
|
|
455
|
-
ttl:
|
|
1368
|
+
const mset = async (r, s) => {
|
|
1369
|
+
const i = s.map((({key: t, value: r, ttl: s}) => ({
|
|
1370
|
+
key: t,
|
|
1371
|
+
value: r,
|
|
1372
|
+
ttl: s ?? e?.ttl
|
|
456
1373
|
})));
|
|
457
1374
|
try {
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
if (a) {
|
|
463
|
-
Promise.all(s);
|
|
1375
|
+
const e = r.map((async e => e.setMany(i)));
|
|
1376
|
+
if (o) {
|
|
1377
|
+
Promise.all(e);
|
|
464
1378
|
t.emit("mset", {
|
|
465
|
-
list:
|
|
1379
|
+
list: i
|
|
466
1380
|
});
|
|
467
|
-
return
|
|
1381
|
+
return i;
|
|
468
1382
|
}
|
|
469
|
-
await Promise.all(
|
|
1383
|
+
await Promise.all(e);
|
|
470
1384
|
t.emit("mset", {
|
|
471
|
-
list:
|
|
1385
|
+
list: i
|
|
472
1386
|
});
|
|
473
|
-
return
|
|
1387
|
+
return i;
|
|
474
1388
|
} catch (e) {
|
|
475
1389
|
t.emit("mset", {
|
|
476
|
-
list:
|
|
1390
|
+
list: i,
|
|
477
1391
|
error: e
|
|
478
1392
|
});
|
|
479
1393
|
return Promise.reject(e);
|
|
480
1394
|
}
|
|
481
1395
|
};
|
|
482
|
-
const
|
|
1396
|
+
const del = async e => {
|
|
483
1397
|
try {
|
|
484
|
-
if (
|
|
485
|
-
Promise.all(
|
|
1398
|
+
if (o) {
|
|
1399
|
+
Promise.all(n.map((async t => t.delete(e))));
|
|
486
1400
|
t.emit("del", {
|
|
487
1401
|
key: e
|
|
488
1402
|
});
|
|
489
1403
|
return true;
|
|
490
1404
|
}
|
|
491
|
-
await Promise.all(
|
|
1405
|
+
await Promise.all(n.map((async t => t.delete(e))));
|
|
492
1406
|
t.emit("del", {
|
|
493
1407
|
key: e
|
|
494
1408
|
});
|
|
@@ -501,13 +1415,13 @@ var B = e => {
|
|
|
501
1415
|
return Promise.reject(r);
|
|
502
1416
|
}
|
|
503
1417
|
};
|
|
504
|
-
const
|
|
1418
|
+
const mdel = async e => {
|
|
505
1419
|
try {
|
|
506
1420
|
const r = [];
|
|
507
1421
|
for (const t of e) {
|
|
508
|
-
r.push(...
|
|
1422
|
+
r.push(...n.map((async e => e.delete(t))));
|
|
509
1423
|
}
|
|
510
|
-
if (
|
|
1424
|
+
if (o) {
|
|
511
1425
|
Promise.all(r);
|
|
512
1426
|
t.emit("mdel", {
|
|
513
1427
|
keys: e
|
|
@@ -527,14 +1441,14 @@ var B = e => {
|
|
|
527
1441
|
return Promise.reject(r);
|
|
528
1442
|
}
|
|
529
1443
|
};
|
|
530
|
-
const
|
|
1444
|
+
const clear = async () => {
|
|
531
1445
|
try {
|
|
532
|
-
if (
|
|
533
|
-
Promise.all(
|
|
1446
|
+
if (o) {
|
|
1447
|
+
Promise.all(n.map((async e => e.clear())));
|
|
534
1448
|
t.emit("clear");
|
|
535
1449
|
return true;
|
|
536
1450
|
}
|
|
537
|
-
await Promise.all(
|
|
1451
|
+
await Promise.all(n.map((async e => e.clear())));
|
|
538
1452
|
t.emit("clear");
|
|
539
1453
|
return true;
|
|
540
1454
|
} catch (e) {
|
|
@@ -542,26 +1456,26 @@ var B = e => {
|
|
|
542
1456
|
return Promise.reject(e);
|
|
543
1457
|
}
|
|
544
1458
|
};
|
|
545
|
-
const
|
|
1459
|
+
const wrap = async (r, s, i, o) => coalesceAsync(`${a}::${r}`, (async () => {
|
|
546
1460
|
let c;
|
|
1461
|
+
let l;
|
|
1462
|
+
let h = 0;
|
|
547
1463
|
let m;
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
ttl: o,
|
|
552
|
-
refreshThreshold: a
|
|
1464
|
+
const {ttl: u, refreshThreshold: d, raw: f} = isObject(i) ? i : {
|
|
1465
|
+
ttl: i,
|
|
1466
|
+
refreshThreshold: o
|
|
553
1467
|
};
|
|
554
|
-
const
|
|
555
|
-
for (;
|
|
1468
|
+
const resolveTtl = t => runIfFn(u, t) ?? e?.ttl;
|
|
1469
|
+
for (;h < n.length; h++) {
|
|
556
1470
|
try {
|
|
557
|
-
const e = await
|
|
1471
|
+
const e = await n[h].get(r, {
|
|
558
1472
|
raw: true
|
|
559
1473
|
});
|
|
560
1474
|
if (e !== void 0) {
|
|
561
1475
|
c = e.value;
|
|
562
|
-
|
|
1476
|
+
l = e;
|
|
563
1477
|
if (typeof e.expires === "number") {
|
|
564
|
-
|
|
1478
|
+
m = Math.max(0, e.expires - Date.now());
|
|
565
1479
|
}
|
|
566
1480
|
break;
|
|
567
1481
|
}
|
|
@@ -569,18 +1483,18 @@ var B = e => {
|
|
|
569
1483
|
}
|
|
570
1484
|
if (c === void 0) {
|
|
571
1485
|
const e = await s();
|
|
572
|
-
const t =
|
|
573
|
-
await
|
|
574
|
-
return
|
|
1486
|
+
const t = resolveTtl(e);
|
|
1487
|
+
await set(n, r, e, t);
|
|
1488
|
+
return f ? {
|
|
575
1489
|
value: e,
|
|
576
1490
|
expires: Date.now() + t
|
|
577
1491
|
} : e;
|
|
578
1492
|
}
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
581
|
-
|
|
1493
|
+
const p = lessThan(m, runIfFn(d, c) ?? e?.refreshThreshold);
|
|
1494
|
+
if (p) {
|
|
1495
|
+
coalesceAsync(`+++${a}__${r}`, s).then((async s => {
|
|
582
1496
|
try {
|
|
583
|
-
await
|
|
1497
|
+
await set(e?.refreshAllStores ? n : n.slice(0, h + 1), r, s, resolveTtl(s));
|
|
584
1498
|
t.emit("refresh", {
|
|
585
1499
|
key: r,
|
|
586
1500
|
value: s
|
|
@@ -600,40 +1514,40 @@ var B = e => {
|
|
|
600
1514
|
});
|
|
601
1515
|
}));
|
|
602
1516
|
}
|
|
603
|
-
if (!
|
|
604
|
-
await
|
|
1517
|
+
if (!p && h > 0) {
|
|
1518
|
+
await set(n.slice(0, h), r, c, resolveTtl(c));
|
|
605
1519
|
}
|
|
606
|
-
return
|
|
1520
|
+
return f ? l : c;
|
|
607
1521
|
}));
|
|
608
|
-
const
|
|
609
|
-
const
|
|
610
|
-
const
|
|
1522
|
+
const on = (e, r) => t.addListener(e, r);
|
|
1523
|
+
const off = (e, r) => t.removeListener(e, r);
|
|
1524
|
+
const disconnect = async () => {
|
|
611
1525
|
try {
|
|
612
|
-
await Promise.all(
|
|
1526
|
+
await Promise.all(n.map((async e => e.disconnect())));
|
|
613
1527
|
} catch (e) {
|
|
614
1528
|
return Promise.reject(e);
|
|
615
1529
|
}
|
|
616
1530
|
};
|
|
617
|
-
const
|
|
1531
|
+
const cacheId = () => a;
|
|
618
1532
|
return {
|
|
619
|
-
get
|
|
620
|
-
mget
|
|
621
|
-
ttl
|
|
622
|
-
set: async (e, t, r) =>
|
|
623
|
-
mset: async e =>
|
|
624
|
-
del
|
|
625
|
-
mdel
|
|
626
|
-
clear
|
|
627
|
-
wrap
|
|
628
|
-
on
|
|
629
|
-
off
|
|
630
|
-
disconnect
|
|
631
|
-
cacheId
|
|
632
|
-
stores:
|
|
1533
|
+
get,
|
|
1534
|
+
mget,
|
|
1535
|
+
ttl,
|
|
1536
|
+
set: async (e, t, r) => set(n, e, t, r),
|
|
1537
|
+
mset: async e => mset(n, e),
|
|
1538
|
+
del,
|
|
1539
|
+
mdel,
|
|
1540
|
+
clear,
|
|
1541
|
+
wrap,
|
|
1542
|
+
on,
|
|
1543
|
+
off,
|
|
1544
|
+
disconnect,
|
|
1545
|
+
cacheId,
|
|
1546
|
+
stores: n
|
|
633
1547
|
};
|
|
634
1548
|
};
|
|
635
1549
|
|
|
636
|
-
const
|
|
1550
|
+
const BuildCacherOptions = e => ({
|
|
637
1551
|
class: Cacher,
|
|
638
1552
|
stores: e?.stores,
|
|
639
1553
|
ttl: e?.ttl,
|
|
@@ -643,38 +1557,38 @@ const N = e => ({
|
|
|
643
1557
|
cacheId: e?.cacheId
|
|
644
1558
|
});
|
|
645
1559
|
|
|
646
|
-
class Cacher extends
|
|
1560
|
+
class Cacher extends n {
|
|
647
1561
|
async init() {
|
|
648
1562
|
const e = this.stores ? Array.isArray(this.stores) ? this.stores : [ this.stores ] : [];
|
|
649
1563
|
const t = await Promise.all(e.map((e => {
|
|
650
1564
|
switch (e.type) {
|
|
651
1565
|
case "file":
|
|
652
|
-
return
|
|
1566
|
+
return c(e);
|
|
653
1567
|
|
|
654
1568
|
case "redis":
|
|
655
|
-
return
|
|
1569
|
+
return l(e);
|
|
656
1570
|
|
|
657
1571
|
case "memcache":
|
|
658
|
-
return
|
|
1572
|
+
return h(e);
|
|
659
1573
|
|
|
660
1574
|
case "mongo":
|
|
661
|
-
return
|
|
1575
|
+
return m(e);
|
|
662
1576
|
|
|
663
1577
|
case "sqlite":
|
|
664
|
-
return
|
|
1578
|
+
return u(e);
|
|
665
1579
|
|
|
666
1580
|
case "postgres":
|
|
667
|
-
return
|
|
1581
|
+
return d(e);
|
|
668
1582
|
|
|
669
1583
|
case "mysql":
|
|
670
|
-
return
|
|
1584
|
+
return f(e);
|
|
671
1585
|
|
|
672
1586
|
default:
|
|
673
1587
|
return undefined;
|
|
674
1588
|
}
|
|
675
1589
|
})));
|
|
676
1590
|
const r = t.filter((e => !!e));
|
|
677
|
-
this.cache =
|
|
1591
|
+
this.cache = createCache({
|
|
678
1592
|
stores: r.length ? r : undefined,
|
|
679
1593
|
ttl: this.ttl,
|
|
680
1594
|
refreshThreshold: this.refreshThreshold,
|
|
@@ -721,16 +1635,16 @@ class Cacher extends o {
|
|
|
721
1635
|
}
|
|
722
1636
|
}
|
|
723
1637
|
|
|
724
|
-
e([
|
|
1638
|
+
e([ o(p.Alternatives(p.Array(p.Alternatives(y.Schema(), g.Schema(), b.Schema(), v.Schema(), _.Schema(), j.Schema(), w.Schema())), y.Schema(), g.Schema(), b.Schema(), v.Schema(), _.Schema(), j.Schema(), w.Schema()).optional()), t("design:type", Object) ], Cacher.prototype, "stores", void 0);
|
|
725
1639
|
|
|
726
|
-
e([
|
|
1640
|
+
e([ o(p.Number().positive().integer().optional()), t("design:type", Number) ], Cacher.prototype, "ttl", void 0);
|
|
727
1641
|
|
|
728
|
-
e([
|
|
1642
|
+
e([ o(p.Number().positive().integer().optional()), t("design:type", Number) ], Cacher.prototype, "refreshThreshold", void 0);
|
|
729
1643
|
|
|
730
|
-
e([
|
|
1644
|
+
e([ o(p.Boolean().optional()), t("design:type", Boolean) ], Cacher.prototype, "refreshAllStores", void 0);
|
|
731
1645
|
|
|
732
|
-
e([
|
|
1646
|
+
e([ o(p.Boolean().optional()), t("design:type", Boolean) ], Cacher.prototype, "nonBlocking", void 0);
|
|
733
1647
|
|
|
734
|
-
e([
|
|
1648
|
+
e([ o(p.String().optional()), t("design:type", String) ], Cacher.prototype, "cacheId", void 0);
|
|
735
1649
|
|
|
736
|
-
export {
|
|
1650
|
+
export { BuildCacherOptions, Cacher };
|