lakutata 2.0.79 → 2.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/com/cacher.cjs +8 -10
- package/com/cacher.d.ts +83 -14
- package/com/cacher.mjs +8 -10
- package/com/database.cjs +11 -11
- package/com/database.mjs +11 -11
- package/com/docker.cjs +17 -19
- package/com/docker.d.ts +3 -141
- package/com/docker.mjs +13 -15
- package/com/entrypoint.cjs +7 -5
- package/com/entrypoint.mjs +7 -5
- package/com/logger.cjs +7 -7
- package/com/logger.mjs +7 -7
- package/com/monitor.cjs +5 -3
- package/com/monitor.mjs +5 -3
- package/decorator/ctrl.cjs +3 -3
- package/decorator/ctrl.mjs +3 -3
- package/decorator/orm.cjs +98 -98
- package/decorator/orm.mjs +142 -56
- package/helper.cjs +9 -11
- package/helper.mjs +5 -7
- package/lakutata.cjs +23 -30
- package/lakutata.mjs +14 -18
- package/orm.cjs +1423 -886
- package/orm.mjs +1474 -724
- package/package.json +1 -1
- package/provider/database.cjs +11 -11
- package/provider/database.mjs +11 -11
- package/provider/passwordHash.cjs +4 -2
- package/provider/passwordHash.mjs +4 -2
- package/src/components/Database.cjs +11 -11
- package/src/components/Database.mjs +11 -11
- package/src/components/Logger.cjs +7 -7
- package/src/components/Logger.mjs +7 -7
- package/src/components/cacher/Cacher.cjs +1178 -264
- package/src/components/cacher/Cacher.mjs +1087 -173
- package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +479 -2963
- package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +469 -2947
- package/src/components/docker/ConnectionOptionsBuilder.cjs +15 -17
- package/src/components/docker/ConnectionOptionsBuilder.mjs +13 -15
- package/src/components/docker/Docker.cjs +4884 -4945
- package/src/components/docker/Docker.mjs +4902 -4963
- package/src/components/docker/lib/DockerContainer.cjs +23 -25
- package/src/components/docker/lib/DockerContainer.mjs +17 -19
- package/src/components/docker/lib/DockerContainerTTY.cjs +9 -11
- package/src/components/docker/lib/DockerContainerTTY.mjs +9 -11
- package/src/components/docker/lib/DockerImage.cjs +4 -2
- package/src/components/docker/lib/DockerImage.mjs +4 -2
- package/src/components/entrypoint/Entrypoint.cjs +2170 -1678
- package/src/components/entrypoint/Entrypoint.mjs +2126 -1634
- package/src/components/entrypoint/lib/AccessControl.cjs +4 -2
- package/src/components/entrypoint/lib/AccessControl.mjs +4 -2
- package/src/components/entrypoint/lib/AccessControlRule.cjs +4 -2
- package/src/components/entrypoint/lib/AccessControlRule.mjs +4 -2
- package/src/components/entrypoint/lib/Controller.cjs +4 -2
- package/src/components/entrypoint/lib/Controller.mjs +4 -2
- package/src/components/monitor/AliveMonitor.cjs +4 -2
- package/src/components/monitor/AliveMonitor.mjs +4 -2
- package/src/components/monitor/CpuMonitor.cjs +5 -3
- package/src/components/monitor/CpuMonitor.mjs +5 -3
- package/src/components/monitor/EventLoopMonitor.cjs +4 -2
- package/src/components/monitor/EventLoopMonitor.mjs +4 -2
- package/src/components/monitor/HttpRequestMonitor.cjs +5 -3
- package/src/components/monitor/HttpRequestMonitor.mjs +5 -3
- package/src/components/monitor/MemoryMonitor.cjs +5 -3
- package/src/components/monitor/MemoryMonitor.mjs +5 -3
- package/src/decorators/ctrl/CLIAction.cjs +3 -3
- package/src/decorators/ctrl/CLIAction.mjs +3 -3
- package/src/decorators/ctrl/HTTPAction.cjs +3 -3
- package/src/decorators/ctrl/HTTPAction.mjs +3 -3
- package/src/decorators/ctrl/ServiceAction.cjs +3 -3
- package/src/decorators/ctrl/ServiceAction.mjs +3 -3
- package/src/decorators/ctrl/http/DELETE.cjs +3 -3
- package/src/decorators/ctrl/http/DELETE.mjs +3 -3
- package/src/decorators/ctrl/http/GET.cjs +3 -3
- package/src/decorators/ctrl/http/GET.mjs +3 -3
- package/src/decorators/ctrl/http/HEAD.cjs +3 -3
- package/src/decorators/ctrl/http/HEAD.mjs +3 -3
- package/src/decorators/ctrl/http/OPTIONS.cjs +3 -3
- package/src/decorators/ctrl/http/OPTIONS.mjs +3 -3
- package/src/decorators/ctrl/http/PATCH.cjs +3 -3
- package/src/decorators/ctrl/http/PATCH.mjs +3 -3
- package/src/decorators/ctrl/http/POST.cjs +3 -3
- package/src/decorators/ctrl/http/POST.mjs +3 -3
- package/src/decorators/ctrl/http/PUT.cjs +3 -3
- package/src/decorators/ctrl/http/PUT.mjs +3 -3
- package/src/decorators/orm/AfterInsert.cjs +17 -39
- package/src/decorators/orm/AfterInsert.mjs +18 -38
- package/src/decorators/orm/AfterLoad.cjs +17 -39
- package/src/decorators/orm/AfterLoad.mjs +18 -38
- package/src/decorators/orm/AfterRecover.cjs +17 -39
- package/src/decorators/orm/AfterRecover.mjs +18 -38
- package/src/decorators/orm/AfterRemove.cjs +17 -39
- package/src/decorators/orm/AfterRemove.mjs +18 -38
- package/src/decorators/orm/AfterSoftRemove.cjs +17 -39
- package/src/decorators/orm/AfterSoftRemove.mjs +18 -38
- package/src/decorators/orm/AfterUpdate.cjs +17 -39
- package/src/decorators/orm/AfterUpdate.mjs +18 -38
- package/src/decorators/orm/BeforeInsert.cjs +17 -39
- package/src/decorators/orm/BeforeInsert.mjs +18 -38
- package/src/decorators/orm/BeforeRecover.cjs +17 -39
- package/src/decorators/orm/BeforeRecover.mjs +18 -38
- package/src/decorators/orm/BeforeRemove.cjs +17 -39
- package/src/decorators/orm/BeforeRemove.mjs +18 -38
- package/src/decorators/orm/BeforeSoftRemove.cjs +17 -39
- package/src/decorators/orm/BeforeSoftRemove.mjs +18 -38
- package/src/decorators/orm/BeforeUpdate.cjs +17 -39
- package/src/decorators/orm/BeforeUpdate.mjs +18 -38
- package/src/decorators/orm/Check.cjs +17 -42
- package/src/decorators/orm/Check.mjs +18 -41
- package/src/decorators/orm/ChildEntity.cjs +17 -42
- package/src/decorators/orm/ChildEntity.mjs +18 -41
- package/src/decorators/orm/Column.cjs +17 -74
- package/src/decorators/orm/Column.mjs +19 -74
- package/src/decorators/orm/CreateDateColumn.cjs +17 -38
- package/src/decorators/orm/CreateDateColumn.mjs +18 -37
- package/src/decorators/orm/DeleteDateColumn.cjs +17 -38
- package/src/decorators/orm/DeleteDateColumn.mjs +17 -36
- package/src/decorators/orm/Entity.cjs +17 -48
- package/src/decorators/orm/Entity.mjs +17 -46
- package/src/decorators/orm/EventSubscriber.cjs +17 -35
- package/src/decorators/orm/EventSubscriber.mjs +18 -34
- package/src/decorators/orm/Exclusion.cjs +17 -42
- package/src/decorators/orm/Exclusion.mjs +18 -41
- package/src/decorators/orm/Generated.cjs +17 -37
- package/src/decorators/orm/Generated.mjs +18 -36
- package/src/decorators/orm/Index.cjs +17 -54
- package/src/decorators/orm/Index.mjs +19 -54
- package/src/decorators/orm/JoinColumn.cjs +17 -42
- package/src/decorators/orm/JoinColumn.mjs +18 -41
- package/src/decorators/orm/JoinTable.cjs +17 -43
- package/src/decorators/orm/JoinTable.mjs +17 -41
- package/src/decorators/orm/ManyToMany.cjs +17 -55
- package/src/decorators/orm/ManyToMany.mjs +17 -53
- package/src/decorators/orm/ManyToOne.cjs +17 -55
- package/src/decorators/orm/ManyToOne.mjs +17 -53
- package/src/decorators/orm/ObjectIdColumn.cjs +17 -41
- package/src/decorators/orm/ObjectIdColumn.mjs +18 -40
- package/src/decorators/orm/OneToMany.cjs +17 -47
- package/src/decorators/orm/OneToMany.mjs +19 -47
- package/src/decorators/orm/OneToOne.cjs +17 -55
- package/src/decorators/orm/OneToOne.mjs +17 -53
- package/src/decorators/orm/PrimaryColumn.cjs +17 -62
- package/src/decorators/orm/PrimaryColumn.mjs +19 -62
- package/src/decorators/orm/PrimaryGeneratedColumn.cjs +17 -67
- package/src/decorators/orm/PrimaryGeneratedColumn.mjs +19 -67
- package/src/decorators/orm/RelationId.cjs +17 -39
- package/src/decorators/orm/RelationId.mjs +18 -38
- package/src/decorators/orm/TableInheritance.cjs +17 -39
- package/src/decorators/orm/TableInheritance.mjs +18 -38
- package/src/decorators/orm/Tree.cjs +17 -37
- package/src/decorators/orm/Tree.mjs +18 -36
- package/src/decorators/orm/TreeChildren.cjs +17 -44
- package/src/decorators/orm/TreeChildren.mjs +17 -42
- package/src/decorators/orm/TreeLevelColumn.cjs +17 -38
- package/src/decorators/orm/TreeLevelColumn.mjs +17 -36
- package/src/decorators/orm/TreeParent.cjs +17 -44
- package/src/decorators/orm/TreeParent.mjs +17 -42
- package/src/decorators/orm/Unique.cjs +17 -57
- package/src/decorators/orm/Unique.mjs +19 -57
- package/src/decorators/orm/UpdateDateColumn.cjs +17 -38
- package/src/decorators/orm/UpdateDateColumn.mjs +18 -37
- package/src/decorators/orm/VersionColumn.cjs +17 -38
- package/src/decorators/orm/VersionColumn.mjs +18 -37
- package/src/decorators/orm/ViewColumn.cjs +17 -38
- package/src/decorators/orm/ViewColumn.mjs +18 -37
- package/src/decorators/orm/ViewEntity.cjs +17 -47
- package/src/decorators/orm/ViewEntity.mjs +18 -46
- package/src/decorators/orm/VirtualColumn.cjs +17 -55
- package/src/decorators/orm/VirtualColumn.mjs +17 -53
- package/src/lib/base/BaseObject.cjs +4 -2
- package/src/lib/base/BaseObject.mjs +4 -2
- package/src/lib/base/EventEmitter.cjs +1200 -1193
- package/src/lib/base/EventEmitter.mjs +1201 -1194
- package/src/lib/base/internal/ApplicationConfigLoader.cjs +4 -2
- package/src/lib/base/internal/ApplicationConfigLoader.mjs +4 -2
- package/src/lib/base/internal/ControllerEntrypoint.cjs +3 -3
- package/src/lib/base/internal/ControllerEntrypoint.mjs +3 -3
- package/src/lib/base/internal/DataValidator.cjs +176 -179
- package/src/lib/base/internal/DataValidator.mjs +177 -180
- package/src/lib/base/internal/ModuleConfigLoader.cjs +4 -3
- package/src/lib/base/internal/ModuleConfigLoader.mjs +4 -3
- package/src/lib/base/internal/ObjectType.cjs +4 -2
- package/src/lib/base/internal/ObjectType.mjs +4 -2
- package/src/lib/base/internal/PatternManager.cjs +740 -735
- package/src/lib/base/internal/PatternManager.mjs +745 -740
- package/src/lib/base/internal/StringifyPattern.cjs +1 -1
- package/src/lib/base/internal/StringifyPattern.mjs +1 -1
- package/src/lib/core/Application.cjs +154 -146
- package/src/lib/core/Application.mjs +203 -197
- package/src/lib/core/Component.cjs +4 -2
- package/src/lib/core/Component.mjs +4 -2
- package/src/lib/core/Container.cjs +4 -2
- package/src/lib/core/Container.mjs +4 -2
- package/src/lib/core/Module.cjs +5 -3
- package/src/lib/core/Module.mjs +5 -3
- package/src/lib/core/Provider.cjs +4 -2
- package/src/lib/core/Provider.mjs +4 -2
- package/src/lib/helpers/Glob.cjs +970 -721
- package/src/lib/helpers/Glob.mjs +1036 -787
- package/src/lib/helpers/IsHtml.cjs +7 -13
- package/src/lib/helpers/IsHtml.mjs +7 -13
- package/src/lib/helpers/IsXML.cjs +1158 -1016
- package/src/lib/helpers/IsXML.mjs +871 -729
- package/src/lib/helpers/MD5.cjs +1 -1
- package/src/lib/helpers/MD5.mjs +1 -1
- package/src/lib/helpers/NonceStr.cjs +1 -1
- package/src/lib/helpers/NonceStr.mjs +1 -1
- package/src/lib/helpers/ObjectHash.cjs +379 -372
- package/src/lib/helpers/ObjectHash.mjs +379 -372
- package/src/lib/helpers/RandomString.cjs +168 -147
- package/src/lib/helpers/RandomString.mjs +167 -146
- package/src/lib/helpers/SHA1.cjs +1 -1
- package/src/lib/helpers/SHA1.mjs +1 -1
- package/src/lib/helpers/SHA256.cjs +1 -1
- package/src/lib/helpers/SHA256.mjs +1 -1
- package/src/lib/helpers/SortArray.cjs +1 -1
- package/src/lib/helpers/SortArray.mjs +1 -1
- package/src/lib/helpers/Statistics.cjs +1 -1
- package/src/lib/helpers/Statistics.mjs +1 -1
- package/src/lib/helpers/URLBuilder.cjs +355 -355
- package/src/lib/helpers/URLBuilder.mjs +350 -350
- package/src/lib/helpers/UUID.cjs +1 -1
- package/src/lib/helpers/UUID.mjs +1 -1
- package/src/lib/ioc/DependencyInjectionContainer.cjs +32 -30
- package/src/lib/ioc/DependencyInjectionContainer.mjs +12 -10
- package/src/lib/ioc/ListModules.cjs +5174 -5249
- package/src/lib/ioc/ListModules.mjs +5177 -5252
- package/src/lib/validation/VLD.cjs +4080 -3902
- package/src/lib/validation/VLD.mjs +2970 -2792
- package/src/options/ApplicationOptions.cjs +4 -2
- package/src/options/ApplicationOptions.mjs +4 -2
- package/src/options/LoadAnonymousObjectOptions.cjs +4 -2
- package/src/options/LoadAnonymousObjectOptions.mjs +4 -2
- package/src/options/LoadNamedObjectOptions.cjs +4 -2
- package/src/options/LoadNamedObjectOptions.mjs +4 -2
- package/src/options/LoadObjectOptions.cjs +4 -2
- package/src/options/LoadObjectOptions.mjs +4 -2
- package/src/options/ModuleLoadObjectsOptions.cjs +4 -2
- package/src/options/ModuleLoadObjectsOptions.mjs +4 -2
- package/src/options/ModuleOptions.cjs +4 -4
- package/src/options/ModuleOptions.mjs +4 -4
- package/src/options/OverridableNamedObjectOptions.cjs +4 -2
- package/src/options/OverridableNamedObjectOptions.mjs +4 -2
- package/src/options/OverridableObjectOptions.cjs +4 -2
- package/src/options/OverridableObjectOptions.mjs +4 -2
- package/src/providers/Database.cjs +11 -11
- package/src/providers/Database.mjs +11 -11
- package/src/providers/PasswordHash.cjs +5 -3
- package/src/providers/PasswordHash.mjs +190 -188
- package/src/providers/migration/GenerateMigration.cjs +15 -19
- package/src/providers/migration/GenerateMigration.mjs +15 -19
- package/vendor/Package.10.cjs +2 -8
- package/vendor/Package.10.mjs +2 -8
- package/vendor/Package.11.cjs +5 -83
- package/vendor/Package.11.mjs +5 -77
- package/vendor/Package.112.cjs +48900 -0
- package/vendor/Package.112.mjs +48764 -0
- package/vendor/Package.12.cjs +4 -2
- package/vendor/Package.12.mjs +6 -4
- package/vendor/Package.13.cjs +87 -1
- package/vendor/Package.13.mjs +81 -1
- package/vendor/Package.14.cjs +1 -14057
- package/vendor/Package.14.mjs +1 -14031
- package/vendor/Package.15.cjs +1 -1
- package/vendor/Package.15.mjs +1 -1
- package/vendor/Package.16.cjs +18129 -1935
- package/vendor/Package.16.mjs +18115 -1839
- package/vendor/Package.17.cjs +1922 -47929
- package/vendor/Package.17.mjs +1874 -47948
- package/vendor/Package.18.cjs +35 -1
- package/vendor/Package.18.mjs +35 -1
- package/vendor/Package.19.cjs +37 -0
- package/vendor/Package.19.mjs +35 -0
- package/vendor/Package.2.cjs +5739 -5710
- package/vendor/Package.2.mjs +5733 -5704
- package/vendor/Package.20.cjs +37 -0
- package/vendor/Package.20.mjs +35 -0
- package/vendor/Package.21.cjs +37 -0
- package/vendor/Package.21.mjs +35 -0
- package/vendor/Package.22.cjs +37 -0
- package/vendor/Package.22.mjs +35 -0
- package/vendor/Package.23.cjs +37 -0
- package/vendor/Package.23.mjs +35 -0
- package/vendor/Package.24.cjs +37 -0
- package/vendor/Package.24.mjs +35 -0
- package/vendor/Package.25.cjs +37 -0
- package/vendor/Package.25.mjs +35 -0
- package/vendor/Package.26.cjs +37 -0
- package/vendor/Package.26.mjs +35 -0
- package/vendor/Package.27.cjs +37 -0
- package/vendor/Package.27.mjs +35 -0
- package/vendor/Package.28.cjs +37 -0
- package/vendor/Package.28.mjs +35 -0
- package/vendor/Package.29.cjs +40 -0
- package/vendor/Package.29.mjs +38 -0
- package/vendor/Package.30.cjs +41 -0
- package/vendor/Package.30.mjs +39 -0
- package/vendor/Package.31.cjs +72 -0
- package/vendor/Package.31.mjs +70 -0
- package/vendor/Package.32.cjs +37 -0
- package/vendor/Package.32.mjs +35 -0
- package/vendor/Package.33.cjs +37 -0
- package/vendor/Package.33.mjs +35 -0
- package/vendor/Package.34.cjs +46 -0
- package/vendor/Package.34.mjs +44 -0
- package/vendor/Package.35.cjs +34 -0
- package/vendor/Package.35.mjs +32 -0
- package/vendor/Package.36.cjs +40 -0
- package/vendor/Package.36.mjs +38 -0
- package/vendor/Package.37.cjs +36 -0
- package/vendor/Package.37.mjs +34 -0
- package/vendor/Package.38.cjs +52 -0
- package/vendor/Package.38.mjs +50 -0
- package/vendor/Package.39.cjs +41 -0
- package/vendor/Package.39.mjs +39 -0
- package/vendor/Package.4.cjs +884 -874
- package/vendor/Package.4.mjs +884 -874
- package/vendor/Package.40.cjs +42 -0
- package/vendor/Package.40.mjs +40 -0
- package/vendor/Package.41.cjs +53 -0
- package/vendor/Package.41.mjs +51 -0
- package/vendor/Package.42.cjs +53 -0
- package/vendor/Package.42.mjs +51 -0
- package/vendor/Package.43.cjs +40 -0
- package/vendor/Package.43.mjs +38 -0
- package/vendor/Package.44.cjs +46 -0
- package/vendor/Package.44.mjs +44 -0
- package/vendor/Package.45.cjs +53 -0
- package/vendor/Package.45.mjs +51 -0
- package/vendor/Package.46.cjs +59 -0
- package/vendor/Package.46.mjs +57 -0
- package/vendor/Package.47.cjs +65 -0
- package/vendor/Package.47.mjs +63 -0
- package/vendor/Package.48.cjs +38 -0
- package/vendor/Package.48.mjs +36 -0
- package/vendor/Package.49.cjs +38 -0
- package/vendor/Package.49.mjs +36 -0
- package/vendor/Package.5.cjs +15 -11
- package/vendor/Package.5.mjs +11 -7
- package/vendor/Package.50.cjs +36 -0
- package/vendor/Package.50.mjs +34 -0
- package/vendor/Package.51.cjs +43 -0
- package/vendor/Package.51.mjs +41 -0
- package/vendor/Package.52.cjs +37 -0
- package/vendor/Package.52.mjs +35 -0
- package/vendor/Package.53.cjs +43 -0
- package/vendor/Package.53.mjs +41 -0
- package/vendor/Package.54.cjs +55 -0
- package/vendor/Package.54.mjs +53 -0
- package/vendor/Package.55.cjs +37 -0
- package/vendor/Package.55.mjs +35 -0
- package/vendor/Package.56.cjs +37 -0
- package/vendor/Package.56.mjs +35 -0
- package/vendor/Package.57.cjs +37 -0
- package/vendor/Package.57.mjs +35 -0
- package/vendor/Package.58.cjs +45 -0
- package/vendor/Package.58.mjs +43 -0
- package/vendor/Package.59.cjs +53 -0
- package/vendor/Package.59.mjs +51 -0
- package/vendor/Package.6.cjs +520 -511
- package/vendor/Package.6.mjs +543 -534
- package/vendor/Package.60.cjs +47649 -0
- package/vendor/Package.60.mjs +47606 -0
- package/vendor/Package.610.cjs +11 -11
- package/vendor/Package.610.mjs +11 -11
- package/vendor/Package.611.cjs +33 -23
- package/vendor/Package.611.mjs +19 -9
- package/vendor/Package.612.cjs +42 -36
- package/vendor/Package.612.mjs +35 -29
- package/vendor/Package.613.cjs +5 -4
- package/vendor/Package.613.mjs +5 -4
- package/vendor/Package.62.cjs +92 -89
- package/vendor/Package.62.mjs +185 -182
- package/vendor/Package.63.cjs +509 -166
- package/vendor/Package.63.mjs +490 -165
- package/vendor/Package.64.cjs +139 -511
- package/vendor/Package.64.mjs +139 -491
- package/vendor/Package.65.cjs +4135 -150
- package/vendor/Package.65.mjs +4143 -150
- package/vendor/Package.66.cjs +346 -4150
- package/vendor/Package.66.mjs +346 -4158
- package/vendor/Package.67.cjs +412 -261
- package/vendor/Package.67.mjs +410 -259
- package/vendor/Package.68.cjs +397 -405
- package/vendor/Package.68.mjs +227 -242
- package/vendor/Package.8.cjs +0 -4
- package/vendor/Package.8.mjs +0 -4
- package/vendor/Package.9.cjs +132 -118
- package/vendor/Package.9.mjs +138 -124
- package/vendor/TypeDef.internal.3.d.ts +0 -4
- package/vendor/Package.102.cjs +0 -48773
- package/vendor/Package.102.mjs +0 -48697
- package/vendor/Package.122.cjs +0 -3
- package/vendor/Package.122.mjs +0 -1
package/vendor/Package.610.cjs
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, Symbol.toStringTag, {
|
|
|
4
4
|
value: "Module"
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
const e = require("
|
|
7
|
+
const e = require("buffer");
|
|
8
8
|
|
|
9
|
-
const t = require("
|
|
9
|
+
const t = require("events");
|
|
10
10
|
|
|
11
11
|
const n = require("mongodb");
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ const s = e => e && e.__esModule ? e : {
|
|
|
14
14
|
default: e
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
const o = s(
|
|
17
|
+
const o = s(t);
|
|
18
18
|
|
|
19
19
|
var a = new Set([ "url", "collection", "namespace", "serialize", "deserialize", "uri", "useGridFS", "dialect", "db" ]);
|
|
20
20
|
|
|
@@ -107,25 +107,25 @@ var i = class extends o.default {
|
|
|
107
107
|
}
|
|
108
108
|
}));
|
|
109
109
|
}
|
|
110
|
-
async get(
|
|
110
|
+
async get(t) {
|
|
111
111
|
const n = await this.connect;
|
|
112
112
|
if (this.opts.useGridFS) {
|
|
113
113
|
await n.store.updateOne({
|
|
114
|
-
filename:
|
|
114
|
+
filename: String(t)
|
|
115
115
|
}, {
|
|
116
116
|
$set: {
|
|
117
117
|
"metadata.lastAccessed": new Date
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
|
-
const s = n.bucket.openDownloadStreamByName(
|
|
121
|
-
return new Promise((
|
|
120
|
+
const s = n.bucket.openDownloadStreamByName(t);
|
|
121
|
+
return new Promise((t => {
|
|
122
122
|
const n = [];
|
|
123
123
|
s.on("error", (() => {
|
|
124
|
-
|
|
124
|
+
t(void 0);
|
|
125
125
|
}));
|
|
126
126
|
s.on("end", (() => {
|
|
127
|
-
const s =
|
|
128
|
-
|
|
127
|
+
const s = e.Buffer.concat(n).toString("utf8");
|
|
128
|
+
t(s);
|
|
129
129
|
}));
|
|
130
130
|
s.on("data", (e => {
|
|
131
131
|
n.push(e);
|
|
@@ -134,7 +134,7 @@ var i = class extends o.default {
|
|
|
134
134
|
}
|
|
135
135
|
const s = await n.store.findOne({
|
|
136
136
|
key: {
|
|
137
|
-
$eq:
|
|
137
|
+
$eq: t
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
if (!s) {
|
package/vendor/Package.610.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import t from "
|
|
1
|
+
import { Buffer as t } from "buffer";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import e from "events";
|
|
4
4
|
|
|
5
5
|
import { MongoClient as n, GridFSBucket as s, MongoServerError as a } from "mongodb";
|
|
6
6
|
|
|
7
7
|
var o = new Set([ "url", "collection", "namespace", "serialize", "deserialize", "uri", "useGridFS", "dialect", "db" ]);
|
|
8
8
|
|
|
9
|
-
var i = class extends
|
|
9
|
+
var i = class extends e {
|
|
10
10
|
ttlSupport=false;
|
|
11
11
|
opts;
|
|
12
12
|
connect;
|
|
@@ -95,25 +95,25 @@ var i = class extends t {
|
|
|
95
95
|
}
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
98
|
-
async get(
|
|
98
|
+
async get(e) {
|
|
99
99
|
const n = await this.connect;
|
|
100
100
|
if (this.opts.useGridFS) {
|
|
101
101
|
await n.store.updateOne({
|
|
102
|
-
filename:
|
|
102
|
+
filename: String(e)
|
|
103
103
|
}, {
|
|
104
104
|
$set: {
|
|
105
105
|
"metadata.lastAccessed": new Date
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
|
-
const s = n.bucket.openDownloadStreamByName(
|
|
109
|
-
return new Promise((
|
|
108
|
+
const s = n.bucket.openDownloadStreamByName(e);
|
|
109
|
+
return new Promise((e => {
|
|
110
110
|
const n = [];
|
|
111
111
|
s.on("error", (() => {
|
|
112
|
-
|
|
112
|
+
e(void 0);
|
|
113
113
|
}));
|
|
114
114
|
s.on("end", (() => {
|
|
115
|
-
const s =
|
|
116
|
-
|
|
115
|
+
const s = t.concat(n).toString("utf8");
|
|
116
|
+
e(s);
|
|
117
117
|
}));
|
|
118
118
|
s.on("data", (t => {
|
|
119
119
|
n.push(t);
|
|
@@ -122,7 +122,7 @@ var i = class extends t {
|
|
|
122
122
|
}
|
|
123
123
|
const s = await n.store.findOne({
|
|
124
124
|
key: {
|
|
125
|
-
$eq:
|
|
125
|
+
$eq: e
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
if (!s) {
|
package/vendor/Package.611.cjs
CHANGED
|
@@ -10,21 +10,27 @@ const e = require("util");
|
|
|
10
10
|
|
|
11
11
|
const s = require("./Package.67.cjs");
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const n = require("sqlite3");
|
|
14
14
|
|
|
15
15
|
require("buffer");
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const i = t => t && t.__esModule ? t : {
|
|
18
18
|
default: t
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const a = i(t);
|
|
22
22
|
|
|
23
|
-
const r =
|
|
23
|
+
const r = i(n);
|
|
24
24
|
|
|
25
|
-
var o = t =>
|
|
25
|
+
var o = t => {
|
|
26
|
+
const e = String(t).replace(/[^a-zA-Z0-9_]/g, "");
|
|
27
|
+
if (e.length === 0) {
|
|
28
|
+
throw new Error("Invalid table name: must contain alphanumeric characters");
|
|
29
|
+
}
|
|
30
|
+
return /^[a-zA-Z]/.test(e) ? e : `_${e}`;
|
|
31
|
+
};
|
|
26
32
|
|
|
27
|
-
var c = class extends
|
|
33
|
+
var c = class extends a.default {
|
|
28
34
|
ttlSupport;
|
|
29
35
|
opts;
|
|
30
36
|
namespace;
|
|
@@ -47,14 +53,14 @@ var c = class extends n.default {
|
|
|
47
53
|
}
|
|
48
54
|
s.db = s.uri.replace(/^sqlite:\/\//, "");
|
|
49
55
|
s.connect = async () => new Promise(((t, e) => {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
e(
|
|
56
|
+
const n = new r.default.Database(s.db, (i => {
|
|
57
|
+
if (i) {
|
|
58
|
+
e(i);
|
|
53
59
|
} else {
|
|
54
60
|
if (s.busyTimeout) {
|
|
55
|
-
|
|
61
|
+
n.configure("busyTimeout", s.busyTimeout);
|
|
56
62
|
}
|
|
57
|
-
t(
|
|
63
|
+
t(n);
|
|
58
64
|
}
|
|
59
65
|
}));
|
|
60
66
|
})).then((t => ({
|
|
@@ -67,7 +73,11 @@ var c = class extends n.default {
|
|
|
67
73
|
...s
|
|
68
74
|
};
|
|
69
75
|
this.opts.table = o(this.opts.table);
|
|
70
|
-
const
|
|
76
|
+
const n = Number(this.opts.keySize);
|
|
77
|
+
if (!Number.isFinite(n) || n <= 0 || n > 65535) {
|
|
78
|
+
throw new Error("Invalid keySize: must be a positive number between 1 and 65535");
|
|
79
|
+
}
|
|
80
|
+
const i = `CREATE TABLE IF NOT EXISTS ${this.opts.table}(key VARCHAR(${n}) PRIMARY KEY, value TEXT )`;
|
|
71
81
|
const a = this.opts.connect().then((async t => t.query(i).then((() => t)))).catch((t => this.emit("error", t)));
|
|
72
82
|
this.query = async (t, ...e) => a.then((async s => s.query(t, ...e)));
|
|
73
83
|
this.close = async () => a.then((t => t.close()));
|
|
@@ -75,11 +85,11 @@ var c = class extends n.default {
|
|
|
75
85
|
async get(t) {
|
|
76
86
|
const e = `SELECT * FROM ${this.opts.table} WHERE key = ?`;
|
|
77
87
|
const s = await this.query(e, t);
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
88
|
+
const n = s[0];
|
|
89
|
+
if (n === void 0) {
|
|
80
90
|
return void 0;
|
|
81
91
|
}
|
|
82
|
-
return
|
|
92
|
+
return n.value;
|
|
83
93
|
}
|
|
84
94
|
async getMany(t) {
|
|
85
95
|
const e = `SELECT * FROM ${this.opts.table} WHERE key IN (SELECT value FROM json_each(?))`;
|
|
@@ -96,9 +106,9 @@ var c = class extends n.default {
|
|
|
96
106
|
async delete(t) {
|
|
97
107
|
const e = `SELECT * FROM ${this.opts.table} WHERE key = ?`;
|
|
98
108
|
const s = `DELETE FROM ${this.opts.table} WHERE key = ?`;
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
109
|
+
const n = await this.query(e, t);
|
|
110
|
+
const i = n[0];
|
|
111
|
+
if (i === void 0) {
|
|
102
112
|
return false;
|
|
103
113
|
}
|
|
104
114
|
await this.query(s, t);
|
|
@@ -119,18 +129,18 @@ var c = class extends n.default {
|
|
|
119
129
|
}
|
|
120
130
|
async* iterator(t) {
|
|
121
131
|
const e = Number.parseInt(this.opts.iterationLimit, 10) || 10;
|
|
122
|
-
async function* s(i, a
|
|
123
|
-
const r = `SELECT * FROM ${
|
|
124
|
-
const o = await
|
|
132
|
+
async function* s(n, i, a) {
|
|
133
|
+
const r = `SELECT * FROM ${i.table} WHERE key LIKE ? LIMIT ? OFFSET ?`;
|
|
134
|
+
const o = await a(r, [ `${t ? t + ":" : ""}%`, e, n ]);
|
|
125
135
|
const c = [ ...o ];
|
|
126
136
|
if (c.length === 0) {
|
|
127
137
|
return;
|
|
128
138
|
}
|
|
129
139
|
for (const t of c) {
|
|
130
|
-
|
|
140
|
+
n += 1;
|
|
131
141
|
yield [ t.key, t.value ];
|
|
132
142
|
}
|
|
133
|
-
yield* s(i, a
|
|
143
|
+
yield* s(n, i, a);
|
|
134
144
|
}
|
|
135
145
|
yield* s(0, this.opts, this.query);
|
|
136
146
|
}
|
package/vendor/Package.611.mjs
CHANGED
|
@@ -8,7 +8,13 @@ import a from "sqlite3";
|
|
|
8
8
|
|
|
9
9
|
import "buffer";
|
|
10
10
|
|
|
11
|
-
var i = t =>
|
|
11
|
+
var i = t => {
|
|
12
|
+
const e = String(t).replace(/[^a-zA-Z0-9_]/g, "");
|
|
13
|
+
if (e.length === 0) {
|
|
14
|
+
throw new Error("Invalid table name: must contain alphanumeric characters");
|
|
15
|
+
}
|
|
16
|
+
return /^[a-zA-Z]/.test(e) ? e : `_${e}`;
|
|
17
|
+
};
|
|
12
18
|
|
|
13
19
|
var n = class extends t {
|
|
14
20
|
ttlSupport;
|
|
@@ -53,8 +59,12 @@ var n = class extends t {
|
|
|
53
59
|
...s
|
|
54
60
|
};
|
|
55
61
|
this.opts.table = i(this.opts.table);
|
|
56
|
-
const n =
|
|
57
|
-
|
|
62
|
+
const n = Number(this.opts.keySize);
|
|
63
|
+
if (!Number.isFinite(n) || n <= 0 || n > 65535) {
|
|
64
|
+
throw new Error("Invalid keySize: must be a positive number between 1 and 65535");
|
|
65
|
+
}
|
|
66
|
+
const r = `CREATE TABLE IF NOT EXISTS ${this.opts.table}(key VARCHAR(${n}) PRIMARY KEY, value TEXT )`;
|
|
67
|
+
const o = this.opts.connect().then((async t => t.query(r).then((() => t)))).catch((t => this.emit("error", t)));
|
|
58
68
|
this.query = async (t, ...e) => o.then((async s => s.query(t, ...e)));
|
|
59
69
|
this.close = async () => o.then((t => t.close()));
|
|
60
70
|
}
|
|
@@ -106,9 +116,9 @@ var n = class extends t {
|
|
|
106
116
|
async* iterator(t) {
|
|
107
117
|
const e = Number.parseInt(this.opts.iterationLimit, 10) || 10;
|
|
108
118
|
async function* s(a, i, n) {
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
const c = [ ...
|
|
119
|
+
const r = `SELECT * FROM ${i.table} WHERE key LIKE ? LIMIT ? OFFSET ?`;
|
|
120
|
+
const o = await n(r, [ `${t ? t + ":" : ""}%`, e, a ]);
|
|
121
|
+
const c = [ ...o ];
|
|
112
122
|
if (c.length === 0) {
|
|
113
123
|
return;
|
|
114
124
|
}
|
|
@@ -130,10 +140,10 @@ var n = class extends t {
|
|
|
130
140
|
}
|
|
131
141
|
};
|
|
132
142
|
|
|
133
|
-
var
|
|
143
|
+
var r = t => new s({
|
|
134
144
|
store: new n(t)
|
|
135
145
|
});
|
|
136
146
|
|
|
137
|
-
var
|
|
147
|
+
var o = n;
|
|
138
148
|
|
|
139
|
-
export { n as KeyvSqlite,
|
|
149
|
+
export { n as KeyvSqlite, r as createKeyv, o as default };
|
package/vendor/Package.612.cjs
CHANGED
|
@@ -16,32 +16,32 @@ const a = t => t && t.__esModule ? t : {
|
|
|
16
16
|
default: t
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const o = a(t);
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
var r;
|
|
21
|
+
const i = a(s);
|
|
24
22
|
|
|
25
23
|
var n;
|
|
26
24
|
|
|
25
|
+
var r;
|
|
26
|
+
|
|
27
27
|
var c = (t, e = {}) => {
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
if (r !== t) {
|
|
29
|
+
n = void 0;
|
|
30
|
+
r = t;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
n ??= new i.default.Pool({
|
|
33
33
|
connectionString: t,
|
|
34
34
|
...e
|
|
35
35
|
});
|
|
36
|
-
return
|
|
36
|
+
return n;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
var h = async () => {
|
|
40
|
-
await
|
|
41
|
-
|
|
40
|
+
await (n?.end());
|
|
41
|
+
r = void 0;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
var u = class extends
|
|
44
|
+
var u = class extends o.default {
|
|
45
45
|
ttlSupport;
|
|
46
46
|
opts;
|
|
47
47
|
query;
|
|
@@ -62,26 +62,19 @@ var u = class extends i.default {
|
|
|
62
62
|
...t
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
const e = async () => {
|
|
66
|
-
const e = c(t.uri, t);
|
|
67
|
-
return async (t, s) => {
|
|
68
|
-
const a = await e.query(t, s);
|
|
69
|
-
return a.rows;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
65
|
this.opts = {
|
|
73
66
|
table: "keyv",
|
|
74
67
|
schema: "public",
|
|
75
68
|
keySize: 255,
|
|
76
69
|
...t
|
|
77
70
|
};
|
|
78
|
-
let
|
|
71
|
+
let e = `CREATE${this.opts.useUnloggedTable ? " UNLOGGED " : " "}TABLE IF NOT EXISTS ${this.opts.schema}.${this.opts.table}(key VARCHAR(${Number(this.opts.keySize)}) PRIMARY KEY, value TEXT )`;
|
|
79
72
|
if (this.opts.schema !== "public") {
|
|
80
|
-
|
|
73
|
+
e = `CREATE SCHEMA IF NOT EXISTS ${this.opts.schema}; ${e}`;
|
|
81
74
|
}
|
|
82
|
-
const
|
|
75
|
+
const s = this.connect().then((async t => {
|
|
83
76
|
try {
|
|
84
|
-
await t(
|
|
77
|
+
await t(e);
|
|
85
78
|
} catch (e) {
|
|
86
79
|
if (e.code !== "23505") {
|
|
87
80
|
this.emit("error", e);
|
|
@@ -90,7 +83,7 @@ var u = class extends i.default {
|
|
|
90
83
|
}
|
|
91
84
|
return t;
|
|
92
85
|
})).catch((t => this.emit("error", t)));
|
|
93
|
-
this.query = async (t, e) =>
|
|
86
|
+
this.query = async (t, e) => s.then((s => s(t, e)));
|
|
94
87
|
}
|
|
95
88
|
async get(t) {
|
|
96
89
|
const e = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
|
|
@@ -101,17 +94,23 @@ var u = class extends i.default {
|
|
|
101
94
|
async getMany(t) {
|
|
102
95
|
const e = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = ANY($1)`;
|
|
103
96
|
const s = await this.query(e, [ t ]);
|
|
104
|
-
const a = [];
|
|
105
|
-
|
|
106
|
-
const t = s?.findIndex((t => t.key === e));
|
|
107
|
-
a.push(t > -1 ? s[t].value : void 0);
|
|
108
|
-
}
|
|
109
|
-
return a;
|
|
97
|
+
const a = new Map(s.map((t => [ t.key, t ])));
|
|
98
|
+
return t.map((t => a.get(t)?.value));
|
|
110
99
|
}
|
|
111
100
|
async set(t, e) {
|
|
112
101
|
const s = `INSERT INTO ${this.opts.schema}.${this.opts.table} (key, value)\n VALUES($1, $2) \n ON CONFLICT(key) \n DO UPDATE SET value=excluded.value;`;
|
|
113
102
|
await this.query(s, [ t, e ]);
|
|
114
103
|
}
|
|
104
|
+
async setMany(t) {
|
|
105
|
+
const e = [];
|
|
106
|
+
const s = [];
|
|
107
|
+
for (const {key: a, value: o} of t) {
|
|
108
|
+
e.push(a);
|
|
109
|
+
s.push(o);
|
|
110
|
+
}
|
|
111
|
+
const a = `INSERT INTO ${this.opts.schema}.${this.opts.table} (key, value)\n SELECT * FROM UNNEST($1::text[], $2::text[])\n ON CONFLICT(key)\n DO UPDATE SET value=excluded.value;`;
|
|
112
|
+
await this.query(a, [ e, s ]);
|
|
113
|
+
}
|
|
115
114
|
async delete(t) {
|
|
116
115
|
const e = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
|
|
117
116
|
const s = `DELETE FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
|
|
@@ -138,17 +137,17 @@ var u = class extends i.default {
|
|
|
138
137
|
}
|
|
139
138
|
async* iterator(t) {
|
|
140
139
|
const e = Number.parseInt(String(this.opts.iterationLimit), 10) || 10;
|
|
141
|
-
async function* s(a,
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
if (
|
|
140
|
+
async function* s(a, o, i) {
|
|
141
|
+
const n = `SELECT * FROM ${o.schema}.${o.table} WHERE key LIKE $1 LIMIT $2 OFFSET $3`;
|
|
142
|
+
const r = await i(n, [ `${t ? t + ":" : ""}%`, e, a ]);
|
|
143
|
+
if (r.length === 0) {
|
|
145
144
|
return;
|
|
146
145
|
}
|
|
147
|
-
for (const t of
|
|
146
|
+
for (const t of r) {
|
|
148
147
|
a += 1;
|
|
149
148
|
yield [ t.key, t.value ];
|
|
150
149
|
}
|
|
151
|
-
yield* s(a,
|
|
150
|
+
yield* s(a, o, i);
|
|
152
151
|
}
|
|
153
152
|
yield* s(0, this.opts, this.query);
|
|
154
153
|
}
|
|
@@ -157,6 +156,13 @@ var u = class extends i.default {
|
|
|
157
156
|
const s = await this.query(e, [ t ]);
|
|
158
157
|
return s[0].exists;
|
|
159
158
|
}
|
|
159
|
+
async connect() {
|
|
160
|
+
const t = c(this.opts.uri, this.opts);
|
|
161
|
+
return async (e, s) => {
|
|
162
|
+
const a = await t.query(e, s);
|
|
163
|
+
return a.rows;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
160
166
|
async disconnect() {
|
|
161
167
|
await h();
|
|
162
168
|
}
|
package/vendor/Package.612.mjs
CHANGED
|
@@ -22,12 +22,12 @@ var o = (t, s = {}) => {
|
|
|
22
22
|
return a;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
var
|
|
26
|
-
await a
|
|
25
|
+
var n = async () => {
|
|
26
|
+
await (a?.end());
|
|
27
27
|
i = void 0;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var r = class extends t {
|
|
31
31
|
ttlSupport;
|
|
32
32
|
opts;
|
|
33
33
|
query;
|
|
@@ -48,26 +48,19 @@ var n = class extends t {
|
|
|
48
48
|
...t
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
const s = async () => {
|
|
52
|
-
const s = o(t.uri, t);
|
|
53
|
-
return async (t, e) => {
|
|
54
|
-
const a = await s.query(t, e);
|
|
55
|
-
return a.rows;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
51
|
this.opts = {
|
|
59
52
|
table: "keyv",
|
|
60
53
|
schema: "public",
|
|
61
54
|
keySize: 255,
|
|
62
55
|
...t
|
|
63
56
|
};
|
|
64
|
-
let
|
|
57
|
+
let s = `CREATE${this.opts.useUnloggedTable ? " UNLOGGED " : " "}TABLE IF NOT EXISTS ${this.opts.schema}.${this.opts.table}(key VARCHAR(${Number(this.opts.keySize)}) PRIMARY KEY, value TEXT )`;
|
|
65
58
|
if (this.opts.schema !== "public") {
|
|
66
|
-
|
|
59
|
+
s = `CREATE SCHEMA IF NOT EXISTS ${this.opts.schema}; ${s}`;
|
|
67
60
|
}
|
|
68
|
-
const
|
|
61
|
+
const e = this.connect().then((async t => {
|
|
69
62
|
try {
|
|
70
|
-
await t(
|
|
63
|
+
await t(s);
|
|
71
64
|
} catch (s) {
|
|
72
65
|
if (s.code !== "23505") {
|
|
73
66
|
this.emit("error", s);
|
|
@@ -76,7 +69,7 @@ var n = class extends t {
|
|
|
76
69
|
}
|
|
77
70
|
return t;
|
|
78
71
|
})).catch((t => this.emit("error", t)));
|
|
79
|
-
this.query = async (t, s) =>
|
|
72
|
+
this.query = async (t, s) => e.then((e => e(t, s)));
|
|
80
73
|
}
|
|
81
74
|
async get(t) {
|
|
82
75
|
const s = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
|
|
@@ -87,17 +80,23 @@ var n = class extends t {
|
|
|
87
80
|
async getMany(t) {
|
|
88
81
|
const s = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = ANY($1)`;
|
|
89
82
|
const e = await this.query(s, [ t ]);
|
|
90
|
-
const a = [];
|
|
91
|
-
|
|
92
|
-
const t = e?.findIndex((t => t.key === s));
|
|
93
|
-
a.push(t > -1 ? e[t].value : void 0);
|
|
94
|
-
}
|
|
95
|
-
return a;
|
|
83
|
+
const a = new Map(e.map((t => [ t.key, t ])));
|
|
84
|
+
return t.map((t => a.get(t)?.value));
|
|
96
85
|
}
|
|
97
86
|
async set(t, s) {
|
|
98
87
|
const e = `INSERT INTO ${this.opts.schema}.${this.opts.table} (key, value)\n VALUES($1, $2) \n ON CONFLICT(key) \n DO UPDATE SET value=excluded.value;`;
|
|
99
88
|
await this.query(e, [ t, s ]);
|
|
100
89
|
}
|
|
90
|
+
async setMany(t) {
|
|
91
|
+
const s = [];
|
|
92
|
+
const e = [];
|
|
93
|
+
for (const {key: a, value: i} of t) {
|
|
94
|
+
s.push(a);
|
|
95
|
+
e.push(i);
|
|
96
|
+
}
|
|
97
|
+
const a = `INSERT INTO ${this.opts.schema}.${this.opts.table} (key, value)\n SELECT * FROM UNNEST($1::text[], $2::text[])\n ON CONFLICT(key)\n DO UPDATE SET value=excluded.value;`;
|
|
98
|
+
await this.query(a, [ s, e ]);
|
|
99
|
+
}
|
|
101
100
|
async delete(t) {
|
|
102
101
|
const s = `SELECT * FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
|
|
103
102
|
const e = `DELETE FROM ${this.opts.schema}.${this.opts.table} WHERE key = $1`;
|
|
@@ -125,12 +124,12 @@ var n = class extends t {
|
|
|
125
124
|
async* iterator(t) {
|
|
126
125
|
const s = Number.parseInt(String(this.opts.iterationLimit), 10) || 10;
|
|
127
126
|
async function* e(a, i, o) {
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
if (
|
|
127
|
+
const n = `SELECT * FROM ${i.schema}.${i.table} WHERE key LIKE $1 LIMIT $2 OFFSET $3`;
|
|
128
|
+
const r = await o(n, [ `${t ? t + ":" : ""}%`, s, a ]);
|
|
129
|
+
if (r.length === 0) {
|
|
131
130
|
return;
|
|
132
131
|
}
|
|
133
|
-
for (const t of
|
|
132
|
+
for (const t of r) {
|
|
134
133
|
a += 1;
|
|
135
134
|
yield [ t.key, t.value ];
|
|
136
135
|
}
|
|
@@ -143,15 +142,22 @@ var n = class extends t {
|
|
|
143
142
|
const e = await this.query(s, [ t ]);
|
|
144
143
|
return e[0].exists;
|
|
145
144
|
}
|
|
145
|
+
async connect() {
|
|
146
|
+
const t = o(this.opts.uri, this.opts);
|
|
147
|
+
return async (s, e) => {
|
|
148
|
+
const a = await t.query(s, e);
|
|
149
|
+
return a.rows;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
146
152
|
async disconnect() {
|
|
147
|
-
await
|
|
153
|
+
await n();
|
|
148
154
|
}
|
|
149
155
|
};
|
|
150
156
|
|
|
151
157
|
var c = t => new s({
|
|
152
|
-
store: new
|
|
158
|
+
store: new r(t)
|
|
153
159
|
});
|
|
154
160
|
|
|
155
|
-
var h =
|
|
161
|
+
var h = r;
|
|
156
162
|
|
|
157
|
-
export {
|
|
163
|
+
export { r as KeyvPostgres, c as createKeyv, h as default };
|
package/vendor/Package.613.cjs
CHANGED
|
@@ -133,7 +133,7 @@ var u = class extends a.default {
|
|
|
133
133
|
return n;
|
|
134
134
|
}
|
|
135
135
|
async set(t, e) {
|
|
136
|
-
const s = `INSERT INTO ${this.opts.table} (id, value)\n\t\t\tVALUES(?, ?)
|
|
136
|
+
const s = `INSERT INTO ${this.opts.table} (id, value)\n\t\t\tVALUES(?, ?)\n\t\t\tON DUPLICATE KEY UPDATE value=?;`;
|
|
137
137
|
const a = [ t, e, e ];
|
|
138
138
|
const n = o.default.format(s, a);
|
|
139
139
|
return this.query(n);
|
|
@@ -180,9 +180,10 @@ var u = class extends a.default {
|
|
|
180
180
|
yield* s(0, this.opts, this.query);
|
|
181
181
|
}
|
|
182
182
|
async has(t) {
|
|
183
|
-
const e = `SELECT EXISTS ( SELECT * FROM ${this.opts.table} WHERE id =
|
|
184
|
-
const s =
|
|
185
|
-
|
|
183
|
+
const e = `SELECT EXISTS ( SELECT * FROM ${this.opts.table} WHERE id = ? )`;
|
|
184
|
+
const s = o.default.format(e, [ t ]);
|
|
185
|
+
const a = await this.query(s);
|
|
186
|
+
return Object.values(a[0])[0] === 1;
|
|
186
187
|
}
|
|
187
188
|
async disconnect() {
|
|
188
189
|
E();
|
package/vendor/Package.613.mjs
CHANGED
|
@@ -119,7 +119,7 @@ var c = class extends t {
|
|
|
119
119
|
return i;
|
|
120
120
|
}
|
|
121
121
|
async set(t, s) {
|
|
122
|
-
const a = `INSERT INTO ${this.opts.table} (id, value)\n\t\t\tVALUES(?, ?)
|
|
122
|
+
const a = `INSERT INTO ${this.opts.table} (id, value)\n\t\t\tVALUES(?, ?)\n\t\t\tON DUPLICATE KEY UPDATE value=?;`;
|
|
123
123
|
const o = [ t, s, s ];
|
|
124
124
|
const i = e.format(a, o);
|
|
125
125
|
return this.query(i);
|
|
@@ -166,9 +166,10 @@ var c = class extends t {
|
|
|
166
166
|
yield* a(0, this.opts, this.query);
|
|
167
167
|
}
|
|
168
168
|
async has(t) {
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
|
|
169
|
+
const s = `SELECT EXISTS ( SELECT * FROM ${this.opts.table} WHERE id = ? )`;
|
|
170
|
+
const a = e.format(s, [ t ]);
|
|
171
|
+
const o = await this.query(a);
|
|
172
|
+
return Object.values(o[0])[0] === 1;
|
|
172
173
|
}
|
|
173
174
|
async disconnect() {
|
|
174
175
|
n();
|