lakutata 2.0.82 → 2.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/com/docker.cjs +1 -1
- package/com/docker.mjs +1 -1
- package/decorator/orm.cjs +84 -84
- package/decorator/orm.mjs +42 -128
- package/orm.cjs +871 -1408
- package/orm.mjs +712 -1462
- package/package.json +1 -1
- package/src/components/Database.cjs +2 -2
- package/src/components/Database.mjs +6 -6
- package/src/components/cacher/Cacher.cjs +129 -129
- package/src/components/cacher/Cacher.mjs +117 -117
- package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +303 -312
- package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +304 -313
- 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 +11 -11
- package/src/components/docker/ConnectionOptionsBuilder.mjs +7 -7
- package/src/components/docker/Docker.cjs +5067 -4956
- package/src/components/docker/Docker.mjs +4982 -4871
- package/src/components/docker/lib/DockerContainer.cjs +1 -1
- package/src/components/docker/lib/DockerContainer.mjs +1 -1
- package/src/components/docker/lib/DockerContainerTTY.cjs +1 -1
- package/src/components/docker/lib/DockerContainerTTY.mjs +1 -1
- package/src/components/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 +1678 -2168
- package/src/components/entrypoint/Entrypoint.mjs +1680 -2170
- package/src/components/monitor/AliveMonitor.cjs +2 -2
- package/src/components/monitor/AliveMonitor.mjs +2 -2
- package/src/components/monitor/MemoryMonitor.cjs +3 -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 +2 -2
- package/src/decorators/ctrl/CLIAction.mjs +7 -7
- package/src/decorators/ctrl/HTTPAction.cjs +6 -6
- package/src/decorators/ctrl/HTTPAction.mjs +4 -4
- package/src/decorators/ctrl/ServiceAction.cjs +3 -3
- package/src/decorators/ctrl/ServiceAction.mjs +4 -4
- package/src/decorators/ctrl/http/DELETE.cjs +2 -2
- package/src/decorators/ctrl/http/DELETE.mjs +2 -2
- package/src/decorators/ctrl/http/GET.cjs +2 -2
- package/src/decorators/ctrl/http/GET.mjs +2 -2
- package/src/decorators/ctrl/http/HEAD.cjs +2 -2
- package/src/decorators/ctrl/http/HEAD.mjs +2 -2
- package/src/decorators/ctrl/http/OPTIONS.cjs +2 -2
- package/src/decorators/ctrl/http/OPTIONS.mjs +2 -2
- package/src/decorators/ctrl/http/PATCH.cjs +2 -2
- package/src/decorators/ctrl/http/PATCH.mjs +2 -2
- package/src/decorators/ctrl/http/POST.cjs +2 -2
- package/src/decorators/ctrl/http/POST.mjs +2 -2
- package/src/decorators/ctrl/http/PUT.cjs +2 -2
- package/src/decorators/ctrl/http/PUT.mjs +2 -2
- 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 +26 -4
- package/src/decorators/orm/AfterInsert.mjs +25 -5
- package/src/decorators/orm/AfterLoad.cjs +26 -4
- package/src/decorators/orm/AfterLoad.mjs +25 -5
- package/src/decorators/orm/AfterRecover.cjs +26 -4
- package/src/decorators/orm/AfterRecover.mjs +25 -5
- package/src/decorators/orm/AfterRemove.cjs +26 -4
- package/src/decorators/orm/AfterRemove.mjs +25 -5
- package/src/decorators/orm/AfterSoftRemove.cjs +26 -4
- package/src/decorators/orm/AfterSoftRemove.mjs +25 -5
- package/src/decorators/orm/AfterUpdate.cjs +26 -4
- package/src/decorators/orm/AfterUpdate.mjs +25 -5
- package/src/decorators/orm/BeforeInsert.cjs +26 -4
- package/src/decorators/orm/BeforeInsert.mjs +25 -5
- package/src/decorators/orm/BeforeRecover.cjs +26 -4
- package/src/decorators/orm/BeforeRecover.mjs +25 -5
- package/src/decorators/orm/BeforeRemove.cjs +26 -4
- package/src/decorators/orm/BeforeRemove.mjs +25 -5
- package/src/decorators/orm/BeforeSoftRemove.cjs +26 -4
- package/src/decorators/orm/BeforeSoftRemove.mjs +25 -5
- package/src/decorators/orm/BeforeUpdate.cjs +26 -4
- package/src/decorators/orm/BeforeUpdate.mjs +25 -5
- package/src/decorators/orm/Check.cjs +29 -4
- package/src/decorators/orm/Check.mjs +28 -5
- package/src/decorators/orm/ChildEntity.cjs +29 -4
- package/src/decorators/orm/ChildEntity.mjs +28 -5
- package/src/decorators/orm/Column.cjs +61 -4
- package/src/decorators/orm/Column.mjs +61 -6
- package/src/decorators/orm/CreateDateColumn.cjs +25 -4
- package/src/decorators/orm/CreateDateColumn.mjs +24 -5
- package/src/decorators/orm/DeleteDateColumn.cjs +25 -4
- package/src/decorators/orm/DeleteDateColumn.mjs +23 -4
- package/src/decorators/orm/Entity.cjs +35 -4
- package/src/decorators/orm/Entity.mjs +33 -4
- package/src/decorators/orm/EventSubscriber.cjs +22 -4
- package/src/decorators/orm/EventSubscriber.mjs +21 -5
- package/src/decorators/orm/Exclusion.cjs +29 -4
- package/src/decorators/orm/Exclusion.mjs +28 -5
- package/src/decorators/orm/Generated.cjs +24 -4
- package/src/decorators/orm/Generated.mjs +23 -5
- package/src/decorators/orm/Index.cjs +41 -4
- package/src/decorators/orm/Index.mjs +41 -6
- package/src/decorators/orm/JoinColumn.cjs +29 -4
- package/src/decorators/orm/JoinColumn.mjs +28 -5
- package/src/decorators/orm/JoinTable.cjs +30 -4
- package/src/decorators/orm/JoinTable.mjs +28 -4
- package/src/decorators/orm/ManyToMany.cjs +42 -4
- package/src/decorators/orm/ManyToMany.mjs +40 -4
- package/src/decorators/orm/ManyToOne.cjs +42 -4
- package/src/decorators/orm/ManyToOne.mjs +40 -4
- package/src/decorators/orm/ObjectIdColumn.cjs +28 -4
- package/src/decorators/orm/ObjectIdColumn.mjs +27 -5
- package/src/decorators/orm/OneToMany.cjs +34 -4
- package/src/decorators/orm/OneToMany.mjs +34 -6
- package/src/decorators/orm/OneToOne.cjs +42 -4
- package/src/decorators/orm/OneToOne.mjs +40 -4
- package/src/decorators/orm/PrimaryColumn.cjs +49 -4
- package/src/decorators/orm/PrimaryColumn.mjs +49 -6
- package/src/decorators/orm/PrimaryGeneratedColumn.cjs +54 -4
- package/src/decorators/orm/PrimaryGeneratedColumn.mjs +54 -6
- package/src/decorators/orm/RelationId.cjs +26 -4
- package/src/decorators/orm/RelationId.mjs +25 -5
- package/src/decorators/orm/TableInheritance.cjs +26 -4
- package/src/decorators/orm/TableInheritance.mjs +25 -5
- package/src/decorators/orm/Tree.cjs +24 -4
- package/src/decorators/orm/Tree.mjs +23 -5
- package/src/decorators/orm/TreeChildren.cjs +31 -4
- package/src/decorators/orm/TreeChildren.mjs +29 -4
- package/src/decorators/orm/TreeLevelColumn.cjs +25 -4
- package/src/decorators/orm/TreeLevelColumn.mjs +23 -4
- package/src/decorators/orm/TreeParent.cjs +31 -4
- package/src/decorators/orm/TreeParent.mjs +29 -4
- package/src/decorators/orm/Unique.cjs +44 -4
- package/src/decorators/orm/Unique.mjs +44 -6
- package/src/decorators/orm/UpdateDateColumn.cjs +25 -4
- package/src/decorators/orm/UpdateDateColumn.mjs +24 -5
- package/src/decorators/orm/VersionColumn.cjs +25 -4
- package/src/decorators/orm/VersionColumn.mjs +24 -5
- package/src/decorators/orm/ViewColumn.cjs +25 -4
- package/src/decorators/orm/ViewColumn.mjs +24 -5
- package/src/decorators/orm/ViewEntity.cjs +34 -4
- package/src/decorators/orm/ViewEntity.mjs +33 -5
- package/src/decorators/orm/VirtualColumn.cjs +42 -4
- package/src/decorators/orm/VirtualColumn.mjs +40 -4
- package/src/lib/base/EventEmitter.cjs +1195 -1202
- package/src/lib/base/EventEmitter.mjs +1195 -1202
- 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/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 +65 -65
- package/src/lib/base/internal/ControllerEntrypoint.mjs +36 -36
- package/src/lib/base/internal/DataValidator.cjs +185 -174
- package/src/lib/base/internal/DataValidator.mjs +230 -219
- 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/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/ObjectWeakRefs.cjs +11 -11
- package/src/lib/base/internal/ObjectWeakRefs.mjs +9 -9
- package/src/lib/base/internal/PatternManager.cjs +739 -744
- package/src/lib/base/internal/PatternManager.mjs +743 -748
- 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 +115 -128
- package/src/lib/core/Application.mjs +135 -148
- 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 +890 -890
- package/src/lib/helpers/Glob.mjs +889 -889
- 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 +8 -18
- package/src/lib/helpers/IsHtml.mjs +8 -18
- 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 +1531 -1525
- package/src/lib/helpers/IsXML.mjs +1527 -1521
- package/src/lib/helpers/MD5.cjs +2 -2
- package/src/lib/helpers/MD5.mjs +2 -2
- 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 +2 -2
- package/src/lib/helpers/NonceStr.mjs +2 -2
- package/src/lib/helpers/ObjectConstructor.cjs +2 -2
- package/src/lib/helpers/ObjectConstructor.mjs +4 -4
- package/src/lib/helpers/ObjectHash.cjs +377 -384
- package/src/lib/helpers/ObjectHash.mjs +373 -380
- 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 +148 -169
- package/src/lib/helpers/RandomString.mjs +145 -166
- package/src/lib/helpers/SHA1.cjs +2 -2
- package/src/lib/helpers/SHA1.mjs +2 -2
- package/src/lib/helpers/SHA256.cjs +2 -2
- package/src/lib/helpers/SHA256.mjs +2 -2
- 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 +16 -16
- package/src/lib/helpers/SortArray.mjs +15 -15
- 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/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/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 +106 -106
- package/src/lib/ioc/DependencyInjectionContainer.mjs +122 -122
- 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 +5298 -5221
- package/src/lib/ioc/ListModules.mjs +5258 -5181
- 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 +4025 -4202
- package/src/lib/validation/VLD.mjs +2972 -3149
- package/src/providers/Database.cjs +2 -2
- package/src/providers/Database.mjs +7 -7
- package/src/providers/PasswordHash.cjs +330 -330
- package/src/providers/PasswordHash.mjs +397 -397
- package/src/providers/migration/GenerateMigration.cjs +2 -2
- package/src/providers/migration/GenerateMigration.mjs +2 -2
- package/vendor/Package.1.cjs +256 -256
- package/vendor/Package.1.mjs +254 -254
- package/vendor/Package.112.cjs +42157 -42076
- package/vendor/Package.112.mjs +42222 -42081
- package/vendor/Package.13.cjs +36 -36
- package/vendor/Package.13.mjs +24 -24
- package/vendor/Package.16.cjs +12351 -12233
- package/vendor/Package.16.mjs +12348 -12230
- package/vendor/Package.17.cjs +924 -924
- package/vendor/Package.17.mjs +943 -943
- package/vendor/Package.18.cjs +48229 -20
- package/vendor/Package.18.mjs +48192 -24
- package/vendor/Package.2.cjs +5824 -5853
- package/vendor/Package.2.mjs +5780 -5809
- package/vendor/Package.3.cjs +60 -60
- package/vendor/Package.3.mjs +85 -85
- package/vendor/Package.4.cjs +874 -884
- package/vendor/Package.4.mjs +877 -887
- package/vendor/Package.5.cjs +15 -19
- package/vendor/Package.5.mjs +10 -14
- package/vendor/Package.6.cjs +2058 -2067
- package/vendor/Package.6.mjs +2064 -2073
- package/vendor/Package.610.cjs +9 -9
- package/vendor/Package.611.cjs +39 -39
- package/vendor/Package.611.mjs +22 -22
- package/vendor/Package.612.cjs +33 -33
- package/vendor/Package.612.mjs +17 -17
- package/vendor/Package.613.cjs +62 -62
- package/vendor/Package.613.mjs +29 -29
- package/vendor/Package.62.cjs +295 -298
- package/vendor/Package.62.mjs +278 -281
- package/vendor/Package.63.cjs +354 -354
- package/vendor/Package.63.mjs +229 -229
- package/vendor/Package.64.cjs +74 -74
- package/vendor/Package.64.mjs +74 -74
- package/vendor/Package.65.cjs +1851 -1858
- package/vendor/Package.65.mjs +1693 -1700
- package/vendor/Package.66.cjs +16 -16
- package/vendor/Package.66.mjs +16 -16
- package/vendor/Package.67.cjs +87 -87
- package/vendor/Package.67.mjs +85 -85
- package/vendor/Package.68.cjs +14 -14
- package/vendor/Package.68.mjs +6 -6
- package/vendor/Package.69.cjs +8 -8
- package/vendor/Package.7.cjs +3 -3
- package/vendor/Package.7.mjs +3 -3
- package/vendor/Package.9.cjs +124 -138
- package/vendor/Package.9.mjs +121 -135
- package/vendor/TypeDef.internal.3.d.ts +0 -14
- package/vendor/Package.19.cjs +0 -37
- package/vendor/Package.19.mjs +0 -35
- package/vendor/Package.20.cjs +0 -37
- package/vendor/Package.20.mjs +0 -35
- package/vendor/Package.21.cjs +0 -37
- package/vendor/Package.21.mjs +0 -35
- package/vendor/Package.22.cjs +0 -37
- package/vendor/Package.22.mjs +0 -35
- package/vendor/Package.23.cjs +0 -37
- package/vendor/Package.23.mjs +0 -35
- package/vendor/Package.24.cjs +0 -37
- package/vendor/Package.24.mjs +0 -35
- package/vendor/Package.25.cjs +0 -37
- package/vendor/Package.25.mjs +0 -35
- package/vendor/Package.26.cjs +0 -37
- package/vendor/Package.26.mjs +0 -35
- package/vendor/Package.27.cjs +0 -37
- package/vendor/Package.27.mjs +0 -35
- package/vendor/Package.28.cjs +0 -37
- package/vendor/Package.28.mjs +0 -35
- package/vendor/Package.29.cjs +0 -40
- package/vendor/Package.29.mjs +0 -38
- package/vendor/Package.30.cjs +0 -41
- package/vendor/Package.30.mjs +0 -39
- package/vendor/Package.31.cjs +0 -72
- package/vendor/Package.31.mjs +0 -70
- package/vendor/Package.32.cjs +0 -37
- package/vendor/Package.32.mjs +0 -35
- package/vendor/Package.33.cjs +0 -37
- package/vendor/Package.33.mjs +0 -35
- package/vendor/Package.34.cjs +0 -46
- package/vendor/Package.34.mjs +0 -44
- package/vendor/Package.35.cjs +0 -34
- package/vendor/Package.35.mjs +0 -32
- package/vendor/Package.36.cjs +0 -40
- package/vendor/Package.36.mjs +0 -38
- package/vendor/Package.37.cjs +0 -36
- package/vendor/Package.37.mjs +0 -34
- package/vendor/Package.38.cjs +0 -52
- package/vendor/Package.38.mjs +0 -50
- package/vendor/Package.39.cjs +0 -41
- package/vendor/Package.39.mjs +0 -39
- package/vendor/Package.40.cjs +0 -42
- package/vendor/Package.40.mjs +0 -40
- package/vendor/Package.41.cjs +0 -53
- package/vendor/Package.41.mjs +0 -51
- package/vendor/Package.42.cjs +0 -53
- package/vendor/Package.42.mjs +0 -51
- package/vendor/Package.43.cjs +0 -40
- package/vendor/Package.43.mjs +0 -38
- package/vendor/Package.44.cjs +0 -46
- package/vendor/Package.44.mjs +0 -44
- package/vendor/Package.45.cjs +0 -53
- package/vendor/Package.45.mjs +0 -51
- package/vendor/Package.46.cjs +0 -59
- package/vendor/Package.46.mjs +0 -57
- package/vendor/Package.47.cjs +0 -65
- package/vendor/Package.47.mjs +0 -63
- package/vendor/Package.48.cjs +0 -38
- package/vendor/Package.48.mjs +0 -36
- package/vendor/Package.49.cjs +0 -38
- package/vendor/Package.49.mjs +0 -36
- package/vendor/Package.50.cjs +0 -36
- package/vendor/Package.50.mjs +0 -34
- package/vendor/Package.51.cjs +0 -43
- package/vendor/Package.51.mjs +0 -41
- package/vendor/Package.52.cjs +0 -37
- package/vendor/Package.52.mjs +0 -35
- package/vendor/Package.53.cjs +0 -43
- package/vendor/Package.53.mjs +0 -41
- package/vendor/Package.54.cjs +0 -55
- package/vendor/Package.54.mjs +0 -53
- package/vendor/Package.55.cjs +0 -37
- package/vendor/Package.55.mjs +0 -35
- package/vendor/Package.56.cjs +0 -37
- package/vendor/Package.56.mjs +0 -35
- package/vendor/Package.57.cjs +0 -37
- package/vendor/Package.57.mjs +0 -35
- package/vendor/Package.58.cjs +0 -45
- package/vendor/Package.58.mjs +0 -43
- package/vendor/Package.59.cjs +0 -53
- package/vendor/Package.59.mjs +0 -51
- package/vendor/Package.60.cjs +0 -47649
- package/vendor/Package.60.mjs +0 -47606
|
@@ -10,9 +10,9 @@ import "../../../../vendor/Package.14.mjs";
|
|
|
10
10
|
|
|
11
11
|
import i from "buffer";
|
|
12
12
|
|
|
13
|
-
import
|
|
13
|
+
import s from "path";
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import a from "fs";
|
|
16
16
|
|
|
17
17
|
import n from "fs/promises";
|
|
18
18
|
|
|
@@ -24,51 +24,51 @@ import "../../../../vendor/Package.1.mjs";
|
|
|
24
24
|
|
|
25
25
|
var c = {};
|
|
26
26
|
|
|
27
|
-
var u;
|
|
28
|
-
|
|
29
27
|
var p;
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
var u;
|
|
30
|
+
|
|
31
|
+
function h() {
|
|
32
|
+
if (u) return p;
|
|
33
|
+
u = 1;
|
|
34
34
|
"use strict";
|
|
35
35
|
var e = Object.defineProperty;
|
|
36
36
|
var t = Object.getOwnPropertyDescriptor;
|
|
37
37
|
var r = Object.getOwnPropertyNames;
|
|
38
|
-
var
|
|
39
|
-
var
|
|
38
|
+
var s = Object.prototype.hasOwnProperty;
|
|
39
|
+
var a = (t, r) => {
|
|
40
40
|
for (var i in r) e(t, i, {
|
|
41
41
|
get: r[i],
|
|
42
42
|
enumerable: true
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
-
var
|
|
46
|
-
if (
|
|
47
|
-
for (let l of r(
|
|
48
|
-
get: () =>
|
|
49
|
-
enumerable: !(o = t(
|
|
45
|
+
var n = (i, a, n, o) => {
|
|
46
|
+
if (a && typeof a === "object" || typeof a === "function") {
|
|
47
|
+
for (let l of r(a)) if (!s.call(i, l) && l !== n) e(i, l, {
|
|
48
|
+
get: () => a[l],
|
|
49
|
+
enumerable: !(o = t(a, l)) || o.enumerable
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
return i;
|
|
53
53
|
};
|
|
54
|
-
var
|
|
54
|
+
var o = t => n(e({}, "__esModule", {
|
|
55
55
|
value: true
|
|
56
56
|
}), t);
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
defaultDeserialize: () =>
|
|
60
|
-
defaultSerialize: () =>
|
|
57
|
+
var l = {};
|
|
58
|
+
a(l, {
|
|
59
|
+
defaultDeserialize: () => f,
|
|
60
|
+
defaultSerialize: () => d
|
|
61
61
|
});
|
|
62
|
-
|
|
63
|
-
var
|
|
64
|
-
var
|
|
62
|
+
p = o(l);
|
|
63
|
+
var c = i;
|
|
64
|
+
var h = (e, t = true) => {
|
|
65
65
|
if (e === void 0 || e === null) {
|
|
66
66
|
return "null";
|
|
67
67
|
}
|
|
68
68
|
if (typeof e === "string") {
|
|
69
69
|
return JSON.stringify(t && e.startsWith(":") ? `:${e}` : e);
|
|
70
70
|
}
|
|
71
|
-
if (
|
|
71
|
+
if (c.Buffer.isBuffer(e)) {
|
|
72
72
|
return JSON.stringify(`:base64:${e.toString("base64")}`);
|
|
73
73
|
}
|
|
74
74
|
if (e?.toJSON) {
|
|
@@ -78,20 +78,20 @@ function requireDist() {
|
|
|
78
78
|
let r = "";
|
|
79
79
|
const i = Array.isArray(e);
|
|
80
80
|
r = i ? "[" : "{";
|
|
81
|
-
let
|
|
82
|
-
for (const
|
|
83
|
-
const n = typeof e[
|
|
84
|
-
if (!Object.hasOwn(e,
|
|
81
|
+
let s = true;
|
|
82
|
+
for (const a in e) {
|
|
83
|
+
const n = typeof e[a] === "function" || !i && e[a] === void 0;
|
|
84
|
+
if (!Object.hasOwn(e, a) || n) {
|
|
85
85
|
continue;
|
|
86
86
|
}
|
|
87
|
-
if (!
|
|
87
|
+
if (!s) {
|
|
88
88
|
r += ",";
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
s = false;
|
|
91
91
|
if (i) {
|
|
92
|
-
r +=
|
|
93
|
-
} else if (e[
|
|
94
|
-
r += `${
|
|
92
|
+
r += h(e[a], t);
|
|
93
|
+
} else if (e[a] !== void 0) {
|
|
94
|
+
r += `${h(a, false)}:${h(e[a], t)}`;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
r += i ? "]" : "}";
|
|
@@ -99,38 +99,38 @@ function requireDist() {
|
|
|
99
99
|
}
|
|
100
100
|
return JSON.stringify(e);
|
|
101
101
|
};
|
|
102
|
-
var
|
|
103
|
-
var
|
|
102
|
+
var d = e => h(e, true);
|
|
103
|
+
var f = e => JSON.parse(e, ((e, t) => {
|
|
104
104
|
if (typeof t === "string") {
|
|
105
105
|
if (t.startsWith(":base64:")) {
|
|
106
|
-
return
|
|
106
|
+
return c.Buffer.from(t.slice(8), "base64");
|
|
107
107
|
}
|
|
108
108
|
return t.startsWith(":") ? t.slice(1) : t;
|
|
109
109
|
}
|
|
110
110
|
return t;
|
|
111
111
|
}));
|
|
112
112
|
0 && (module.exports = {
|
|
113
|
-
defaultDeserialize,
|
|
114
|
-
defaultSerialize
|
|
113
|
+
defaultDeserialize: f,
|
|
114
|
+
defaultSerialize: d
|
|
115
115
|
});
|
|
116
|
-
return
|
|
116
|
+
return p;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
var d = {};
|
|
120
120
|
|
|
121
|
-
var
|
|
121
|
+
var f = {};
|
|
122
122
|
|
|
123
|
-
var
|
|
123
|
+
var y;
|
|
124
124
|
|
|
125
|
-
function
|
|
126
|
-
if (
|
|
127
|
-
|
|
125
|
+
function m() {
|
|
126
|
+
if (y) return f;
|
|
127
|
+
y = 1;
|
|
128
128
|
"use strict";
|
|
129
|
-
Object.defineProperty(
|
|
129
|
+
Object.defineProperty(f, "__esModule", {
|
|
130
130
|
value: true
|
|
131
131
|
});
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
f.SafeFilenameEncoder = void 0;
|
|
133
|
+
f.SafeFilenameEncoder = {
|
|
134
134
|
encode(e) {
|
|
135
135
|
return e.replace(/[^0-9a-zA-Z]/g, (e => {
|
|
136
136
|
const t = e.charCodeAt(0);
|
|
@@ -144,26 +144,26 @@ function requireSafeEncoder() {
|
|
|
144
144
|
return decodeURIComponent(e.replace(/_/g, "%"));
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
|
-
return
|
|
147
|
+
return f;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
var
|
|
150
|
+
var _;
|
|
151
151
|
|
|
152
|
-
function
|
|
153
|
-
if (
|
|
154
|
-
|
|
152
|
+
function v() {
|
|
153
|
+
if (_) return d;
|
|
154
|
+
_ = 1;
|
|
155
155
|
"use strict";
|
|
156
156
|
Object.defineProperty(d, "__esModule", {
|
|
157
157
|
value: true
|
|
158
158
|
});
|
|
159
159
|
d.SeparatedFileHelper = void 0;
|
|
160
|
-
d.handleIOError =
|
|
160
|
+
d.handleIOError = c;
|
|
161
161
|
const e = r;
|
|
162
|
-
const t = e.__importDefault(
|
|
163
|
-
const i = e.__importStar(
|
|
162
|
+
const t = e.__importDefault(s);
|
|
163
|
+
const i = e.__importStar(a);
|
|
164
164
|
const o = e.__importStar(n);
|
|
165
|
-
const l =
|
|
166
|
-
function
|
|
165
|
+
const l = m();
|
|
166
|
+
function c(e) {
|
|
167
167
|
if (e.code === "ENOENT") {
|
|
168
168
|
return;
|
|
169
169
|
} else {
|
|
@@ -185,7 +185,7 @@ function requireSeparatedFileStore() {
|
|
|
185
185
|
try {
|
|
186
186
|
return Number(i.readFileSync(this._lastExpireFile, "utf8"));
|
|
187
187
|
} catch (e) {
|
|
188
|
-
|
|
188
|
+
c(e);
|
|
189
189
|
}
|
|
190
190
|
return 0;
|
|
191
191
|
}
|
|
@@ -193,7 +193,7 @@ function requireSeparatedFileStore() {
|
|
|
193
193
|
try {
|
|
194
194
|
o.writeFile(this._lastExpireFile, e.toString());
|
|
195
195
|
} catch (e) {
|
|
196
|
-
|
|
196
|
+
c(e);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
async get(e) {
|
|
@@ -202,7 +202,7 @@ function requireSeparatedFileStore() {
|
|
|
202
202
|
let r = this.opts.deserialize(t);
|
|
203
203
|
return r;
|
|
204
204
|
} catch (e) {
|
|
205
|
-
|
|
205
|
+
c(e);
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
getSync(e) {
|
|
@@ -211,7 +211,7 @@ function requireSeparatedFileStore() {
|
|
|
211
211
|
let r = this.opts.deserialize(t);
|
|
212
212
|
return r;
|
|
213
213
|
} catch (e) {
|
|
214
|
-
|
|
214
|
+
c(e);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
_getKey(e) {
|
|
@@ -225,7 +225,7 @@ function requireSeparatedFileStore() {
|
|
|
225
225
|
});
|
|
226
226
|
await o.writeFile(this._getKey(e), r);
|
|
227
227
|
} catch (e) {
|
|
228
|
-
|
|
228
|
+
c(e);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
async delete(e) {
|
|
@@ -233,7 +233,7 @@ function requireSeparatedFileStore() {
|
|
|
233
233
|
await o.unlink(this._getKey(e));
|
|
234
234
|
return true;
|
|
235
235
|
} catch (e) {
|
|
236
|
-
|
|
236
|
+
c(e);
|
|
237
237
|
return false;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -251,7 +251,7 @@ function requireSeparatedFileStore() {
|
|
|
251
251
|
}
|
|
252
252
|
await o.writeFile(this._lastExpireFile, Date.now().toString());
|
|
253
253
|
} catch (e) {
|
|
254
|
-
|
|
254
|
+
c(e);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
async entries() {
|
|
@@ -265,19 +265,19 @@ function requireSeparatedFileStore() {
|
|
|
265
265
|
return d;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
var
|
|
268
|
+
var g = {};
|
|
269
269
|
|
|
270
|
-
var
|
|
270
|
+
var F;
|
|
271
271
|
|
|
272
|
-
function
|
|
273
|
-
if (
|
|
274
|
-
|
|
272
|
+
function k() {
|
|
273
|
+
if (F) return g;
|
|
274
|
+
F = 1;
|
|
275
275
|
"use strict";
|
|
276
|
-
Object.defineProperty(
|
|
276
|
+
Object.defineProperty(g, "__esModule", {
|
|
277
277
|
value: true
|
|
278
278
|
});
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
g.Field = void 0;
|
|
280
|
+
g.makeField = e;
|
|
281
281
|
class Field {
|
|
282
282
|
kv;
|
|
283
283
|
key;
|
|
@@ -305,276 +305,267 @@ function requireMakeField() {
|
|
|
305
305
|
return this.kv.delete(this.key);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
|
|
309
|
-
function
|
|
308
|
+
g.Field = Field;
|
|
309
|
+
function e(e, t, r) {
|
|
310
310
|
return new Field(e, t, r);
|
|
311
311
|
}
|
|
312
|
-
return
|
|
312
|
+
return g;
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
recursive: true
|
|
365
|
-
});
|
|
366
|
-
this._lastExpire = this._separated.getLastExpire();
|
|
367
|
-
} else {
|
|
368
|
-
this._loadDataSync();
|
|
369
|
-
}
|
|
315
|
+
(function(e) {
|
|
316
|
+
"use strict";
|
|
317
|
+
Object.defineProperty(e, "__esModule", {
|
|
318
|
+
value: true
|
|
319
|
+
});
|
|
320
|
+
e.KeyvFile = e.defaultOpts = void 0;
|
|
321
|
+
const t = r;
|
|
322
|
+
const i = t.__importStar(o);
|
|
323
|
+
const c = t.__importStar(a);
|
|
324
|
+
const p = t.__importStar(n);
|
|
325
|
+
const u = t.__importDefault(l);
|
|
326
|
+
const d = h();
|
|
327
|
+
const f = t.__importDefault(s);
|
|
328
|
+
const y = v();
|
|
329
|
+
t.__exportStar(k(), e);
|
|
330
|
+
e.defaultOpts = {
|
|
331
|
+
deserialize: e => (0, d.defaultDeserialize)(e.toString()),
|
|
332
|
+
dialect: "redis",
|
|
333
|
+
expiredCheckDelay: 24 * 3600 * 1e3,
|
|
334
|
+
filename: `${i.tmpdir()}/keyv-file/default.json`,
|
|
335
|
+
serialize: d.defaultSerialize,
|
|
336
|
+
writeDelay: 100,
|
|
337
|
+
checkFileLock: false,
|
|
338
|
+
separatedFile: false
|
|
339
|
+
};
|
|
340
|
+
function m(e) {
|
|
341
|
+
return typeof e === "number";
|
|
342
|
+
}
|
|
343
|
+
class KeyvFile extends u.default {
|
|
344
|
+
ttlSupport=true;
|
|
345
|
+
namespace;
|
|
346
|
+
opts;
|
|
347
|
+
_data=new Map;
|
|
348
|
+
_lastExpire=0;
|
|
349
|
+
_separated;
|
|
350
|
+
constructor(t) {
|
|
351
|
+
super();
|
|
352
|
+
this.opts = Object.assign({}, e.defaultOpts, t);
|
|
353
|
+
this._separated = new y.SeparatedFileHelper(this.opts);
|
|
354
|
+
if (this.opts.checkFileLock) {
|
|
355
|
+
this.acquireFileLock();
|
|
356
|
+
}
|
|
357
|
+
if (this.opts.separatedFile) {
|
|
358
|
+
c.mkdirSync(this.opts.filename, {
|
|
359
|
+
recursive: true
|
|
360
|
+
});
|
|
361
|
+
this._lastExpire = this._separated.getLastExpire();
|
|
362
|
+
} else {
|
|
363
|
+
this._loadDataSync();
|
|
370
364
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
365
|
+
}
|
|
366
|
+
_loadDataSync() {
|
|
367
|
+
try {
|
|
368
|
+
const e = this.opts.deserialize(c.readFileSync(this.opts.filename));
|
|
369
|
+
if (!Array.isArray(e.cache)) {
|
|
370
|
+
const t = e.cache;
|
|
371
|
+
e.cache = [];
|
|
372
|
+
for (const r in t) {
|
|
373
|
+
if (t.hasOwnProperty(r)) {
|
|
374
|
+
e.cache.push([ r, t[r] ]);
|
|
381
375
|
}
|
|
382
376
|
}
|
|
383
|
-
this._data = new Map(e.cache);
|
|
384
|
-
this._lastExpire = e.lastExpire;
|
|
385
|
-
} catch (e) {
|
|
386
|
-
(0, f.handleIOError)(e);
|
|
387
|
-
this._data = new Map;
|
|
388
|
-
this._lastExpire = Date.now();
|
|
389
377
|
}
|
|
378
|
+
this._data = new Map(e.cache);
|
|
379
|
+
this._lastExpire = e.lastExpire;
|
|
380
|
+
} catch (e) {
|
|
381
|
+
(0, y.handleIOError)(e);
|
|
382
|
+
this._data = new Map;
|
|
383
|
+
this._lastExpire = Date.now();
|
|
390
384
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
return this.opts.filename + ".lock";
|
|
396
|
-
}
|
|
397
|
-
acquireFileLock() {
|
|
398
|
-
try {
|
|
399
|
-
let e = c.openSync(this._lockFile, "wx");
|
|
400
|
-
c.closeSync(e);
|
|
401
|
-
process.on("SIGINT", (() => {
|
|
402
|
-
this.releaseFileLock();
|
|
403
|
-
process.exit(0);
|
|
404
|
-
}));
|
|
405
|
-
process.on("exit", (() => {
|
|
406
|
-
this.releaseFileLock();
|
|
407
|
-
}));
|
|
408
|
-
} catch (e) {
|
|
409
|
-
console.error(`[keyv-file] There is another process using this file`);
|
|
410
|
-
throw e;
|
|
411
|
-
}
|
|
385
|
+
}
|
|
386
|
+
get _lockFile() {
|
|
387
|
+
if (this.opts.separatedFile) {
|
|
388
|
+
return this._separated.lockFile;
|
|
412
389
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
390
|
+
return this.opts.filename + ".lock";
|
|
391
|
+
}
|
|
392
|
+
acquireFileLock() {
|
|
393
|
+
try {
|
|
394
|
+
let e = c.openSync(this._lockFile, "wx");
|
|
395
|
+
c.closeSync(e);
|
|
396
|
+
process.on("SIGINT", (() => {
|
|
397
|
+
this.releaseFileLock();
|
|
398
|
+
process.exit(0);
|
|
399
|
+
}));
|
|
400
|
+
process.on("exit", (() => {
|
|
401
|
+
this.releaseFileLock();
|
|
402
|
+
}));
|
|
403
|
+
} catch (e) {
|
|
404
|
+
console.error(`[keyv-file] There is another process using this file`);
|
|
405
|
+
throw e;
|
|
419
406
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
407
|
+
}
|
|
408
|
+
releaseFileLock() {
|
|
409
|
+
try {
|
|
410
|
+
c.unlinkSync(this._lockFile);
|
|
411
|
+
} catch (e) {
|
|
412
|
+
(0, y.handleIOError)(e);
|
|
426
413
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
let t = void 0;
|
|
433
|
-
try {
|
|
434
|
-
const t = this._data.get(e);
|
|
435
|
-
return this._getWithExpire(e, t);
|
|
436
|
-
} catch (e) {
|
|
437
|
-
(0, f.handleIOError)(e);
|
|
438
|
-
}
|
|
439
|
-
return t;
|
|
414
|
+
}
|
|
415
|
+
async get(e) {
|
|
416
|
+
if (this.opts.separatedFile) {
|
|
417
|
+
let t = await this._separated.get(e);
|
|
418
|
+
return this._getWithExpire(e, t);
|
|
440
419
|
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
420
|
+
return this.getSync(e);
|
|
421
|
+
}
|
|
422
|
+
getSync(e) {
|
|
423
|
+
if (this.opts.separatedFile) {
|
|
424
|
+
let t = this._separated.getSync(e);
|
|
425
|
+
return this._getWithExpire(e, t);
|
|
446
426
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
value: t
|
|
454
|
-
};
|
|
455
|
-
this.clearExpire();
|
|
456
|
-
if (this.opts.separatedFile) {
|
|
457
|
-
return this._separated.set(e, t);
|
|
458
|
-
}
|
|
459
|
-
this._data.set(e, t);
|
|
460
|
-
return this.save();
|
|
427
|
+
let t = void 0;
|
|
428
|
+
try {
|
|
429
|
+
const t = this._data.get(e);
|
|
430
|
+
return this._getWithExpire(e, t);
|
|
431
|
+
} catch (e) {
|
|
432
|
+
(0, y.handleIOError)(e);
|
|
461
433
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
await this.save();
|
|
468
|
-
return t;
|
|
469
|
-
}
|
|
470
|
-
async deleteMany(e) {
|
|
471
|
-
if (this.opts.separatedFile) {
|
|
472
|
-
let t = await Promise.all(e.map((e => this.delete(e))));
|
|
473
|
-
return t.every((e => e));
|
|
474
|
-
}
|
|
475
|
-
let t = e.every((e => this._data.delete(e)));
|
|
476
|
-
await this.save();
|
|
477
|
-
return t;
|
|
478
|
-
}
|
|
479
|
-
async clear() {
|
|
480
|
-
if (this.opts.separatedFile) {
|
|
481
|
-
await this._separated.clear();
|
|
482
|
-
this._lastExpire = 0;
|
|
483
|
-
return true;
|
|
484
|
-
}
|
|
485
|
-
this._data = new Map;
|
|
486
|
-
this._lastExpire = Date.now();
|
|
487
|
-
return this.save();
|
|
434
|
+
return t;
|
|
435
|
+
}
|
|
436
|
+
async getMany(e) {
|
|
437
|
+
if (this.opts.separatedFile) {
|
|
438
|
+
return Promise.all(e.map((e => this.get(e))));
|
|
488
439
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
440
|
+
return e.map((e => this.getSync(e)));
|
|
441
|
+
}
|
|
442
|
+
async set(e, t, r) {
|
|
443
|
+
if (r === 0) {
|
|
444
|
+
r = undefined;
|
|
492
445
|
}
|
|
493
|
-
|
|
494
|
-
|
|
446
|
+
t = {
|
|
447
|
+
expire: m(r) ? Date.now() + r : undefined,
|
|
448
|
+
value: t
|
|
449
|
+
};
|
|
450
|
+
this.clearExpire();
|
|
451
|
+
if (this.opts.separatedFile) {
|
|
452
|
+
return this._separated.set(e, t);
|
|
495
453
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
return t.value;
|
|
454
|
+
this._data.set(e, t);
|
|
455
|
+
return this.save();
|
|
456
|
+
}
|
|
457
|
+
async delete(e) {
|
|
458
|
+
if (this.opts.separatedFile) {
|
|
459
|
+
return this._separated.delete(e);
|
|
505
460
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
for (const e of this._data.keys()) {
|
|
517
|
-
const t = this._data.get(e);
|
|
518
|
-
this._getWithExpire(e, t);
|
|
519
|
-
}
|
|
461
|
+
const t = this._data.delete(e);
|
|
462
|
+
await this.save();
|
|
463
|
+
return t;
|
|
464
|
+
}
|
|
465
|
+
async deleteMany(e) {
|
|
466
|
+
if (this.opts.separatedFile) {
|
|
467
|
+
let t = await Promise.all(e.map((e => this.delete(e))));
|
|
468
|
+
return t.every((e => e));
|
|
520
469
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
await u.mkdir(h.default.dirname(this.opts.filename), {
|
|
531
|
-
recursive: true
|
|
532
|
-
});
|
|
533
|
-
return u.writeFile(this.opts.filename, t);
|
|
470
|
+
let t = e.every((e => this._data.delete(e)));
|
|
471
|
+
await this.save();
|
|
472
|
+
return t;
|
|
473
|
+
}
|
|
474
|
+
async clear() {
|
|
475
|
+
if (this.opts.separatedFile) {
|
|
476
|
+
await this._separated.clear();
|
|
477
|
+
this._lastExpire = 0;
|
|
478
|
+
return true;
|
|
534
479
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
return
|
|
480
|
+
this._data = new Map;
|
|
481
|
+
this._lastExpire = Date.now();
|
|
482
|
+
return this.save();
|
|
483
|
+
}
|
|
484
|
+
async has(e) {
|
|
485
|
+
const t = await this.get(e);
|
|
486
|
+
return t !== undefined;
|
|
487
|
+
}
|
|
488
|
+
isExpired(e) {
|
|
489
|
+
return m(e.expire) && e.expire <= Date.now();
|
|
490
|
+
}
|
|
491
|
+
_getWithExpire(e, t) {
|
|
492
|
+
if (!t) {
|
|
493
|
+
return;
|
|
549
494
|
}
|
|
550
|
-
|
|
551
|
-
|
|
495
|
+
if (this.isExpired(t)) {
|
|
496
|
+
this.delete(e);
|
|
497
|
+
return;
|
|
552
498
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
499
|
+
return t.value;
|
|
500
|
+
}
|
|
501
|
+
clearExpire() {
|
|
502
|
+
const e = Date.now();
|
|
503
|
+
if (e - this._lastExpire <= this.opts.expiredCheckDelay) {
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
this._lastExpire = e;
|
|
507
|
+
if (this.opts.separatedFile) {
|
|
508
|
+
this._separated.clearExpire((e => this.get(e)));
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
for (const e of this._data.keys()) {
|
|
512
|
+
const t = this._data.get(e);
|
|
513
|
+
this._getWithExpire(e, t);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
async saveToDisk() {
|
|
517
|
+
const e = [];
|
|
518
|
+
for (const [t, r] of this._data) {
|
|
519
|
+
e.push([ t, r ]);
|
|
520
|
+
}
|
|
521
|
+
const t = this.opts.serialize({
|
|
522
|
+
cache: e,
|
|
523
|
+
lastExpire: this._lastExpire
|
|
524
|
+
});
|
|
525
|
+
await p.mkdir(f.default.dirname(this.opts.filename), {
|
|
526
|
+
recursive: true
|
|
527
|
+
});
|
|
528
|
+
return p.writeFile(this.opts.filename, t);
|
|
529
|
+
}
|
|
530
|
+
_savePromise;
|
|
531
|
+
save() {
|
|
532
|
+
this.clearExpire();
|
|
533
|
+
if (this._savePromise) {
|
|
534
|
+
return this._savePromise;
|
|
535
|
+
}
|
|
536
|
+
this._savePromise = new Promise(((e, t) => {
|
|
537
|
+
setTimeout((() => {
|
|
538
|
+
this.saveToDisk().then(e, t).finally((() => {
|
|
539
|
+
this._savePromise = void 0;
|
|
540
|
+
}));
|
|
541
|
+
}), this.opts.writeDelay);
|
|
542
|
+
}));
|
|
543
|
+
return this._savePromise;
|
|
544
|
+
}
|
|
545
|
+
disconnect() {
|
|
546
|
+
return Promise.resolve();
|
|
547
|
+
}
|
|
548
|
+
async* iterator(e) {
|
|
549
|
+
let t = this.opts.separatedFile ? await this._separated.entries() : this._data.entries();
|
|
550
|
+
for (const [r, i] of t) {
|
|
551
|
+
if (r === undefined || i === undefined) {
|
|
552
|
+
continue;
|
|
553
|
+
}
|
|
554
|
+
if (!e || r.includes(e)) {
|
|
555
|
+
yield [ r, i.value ];
|
|
562
556
|
}
|
|
563
557
|
}
|
|
564
558
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
var F = requireLib();
|
|
559
|
+
}
|
|
560
|
+
e.KeyvFile = KeyvFile;
|
|
561
|
+
e.default = KeyvFile;
|
|
562
|
+
})(c);
|
|
572
563
|
|
|
573
|
-
const
|
|
564
|
+
const S = t(c);
|
|
574
565
|
|
|
575
|
-
async function
|
|
566
|
+
async function w(t) {
|
|
576
567
|
return new e({
|
|
577
|
-
store: new
|
|
568
|
+
store: new c.KeyvFile({
|
|
578
569
|
filename: t.filename,
|
|
579
570
|
expiredCheckDelay: t.expiredCheckDelay,
|
|
580
571
|
writeDelay: t.writeDelay
|
|
@@ -583,4 +574,4 @@ async function CreateFileCacheAdapter(t) {
|
|
|
583
574
|
});
|
|
584
575
|
}
|
|
585
576
|
|
|
586
|
-
export { CreateFileCacheAdapter };
|
|
577
|
+
export { w as CreateFileCacheAdapter };
|