lakutata 2.0.80 → 2.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/com/cacher.cjs +8 -10
- package/com/cacher.d.ts +83 -14
- package/com/cacher.mjs +8 -10
- package/com/database.cjs +11 -11
- package/com/database.mjs +11 -11
- package/com/docker.cjs +17 -19
- package/com/docker.d.ts +3 -141
- package/com/docker.mjs +13 -15
- package/com/entrypoint.cjs +7 -5
- package/com/entrypoint.mjs +7 -5
- package/com/logger.cjs +7 -7
- package/com/logger.mjs +7 -7
- package/com/monitor.cjs +5 -3
- package/com/monitor.mjs +5 -3
- package/decorator/ctrl.cjs +3 -3
- package/decorator/ctrl.mjs +3 -3
- package/decorator/orm.cjs +98 -98
- package/decorator/orm.mjs +142 -56
- package/helper.cjs +9 -11
- package/helper.mjs +5 -7
- package/lakutata.cjs +23 -30
- package/lakutata.mjs +14 -18
- package/orm.cjs +1423 -886
- package/orm.mjs +1474 -724
- package/package.json +1 -1
- package/provider/database.cjs +11 -11
- package/provider/database.mjs +11 -11
- package/provider/passwordHash.cjs +4 -2
- package/provider/passwordHash.mjs +4 -2
- package/src/components/Database.cjs +11 -11
- package/src/components/Database.mjs +11 -11
- package/src/components/Logger.cjs +7 -7
- package/src/components/Logger.mjs +7 -7
- package/src/components/cacher/Cacher.cjs +1178 -264
- package/src/components/cacher/Cacher.mjs +1087 -173
- package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +479 -2963
- package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +469 -2947
- package/src/components/docker/ConnectionOptionsBuilder.cjs +15 -17
- package/src/components/docker/ConnectionOptionsBuilder.mjs +13 -15
- package/src/components/docker/Docker.cjs +4884 -4945
- package/src/components/docker/Docker.mjs +4902 -4963
- package/src/components/docker/lib/DockerContainer.cjs +23 -25
- package/src/components/docker/lib/DockerContainer.mjs +17 -19
- package/src/components/docker/lib/DockerContainerTTY.cjs +9 -11
- package/src/components/docker/lib/DockerContainerTTY.mjs +9 -11
- package/src/components/docker/lib/DockerImage.cjs +4 -2
- package/src/components/docker/lib/DockerImage.mjs +4 -2
- package/src/components/entrypoint/Entrypoint.cjs +2170 -1678
- package/src/components/entrypoint/Entrypoint.mjs +2126 -1634
- package/src/components/entrypoint/lib/AccessControl.cjs +4 -2
- package/src/components/entrypoint/lib/AccessControl.mjs +4 -2
- package/src/components/entrypoint/lib/AccessControlRule.cjs +4 -2
- package/src/components/entrypoint/lib/AccessControlRule.mjs +4 -2
- package/src/components/entrypoint/lib/Controller.cjs +4 -2
- package/src/components/entrypoint/lib/Controller.mjs +4 -2
- package/src/components/monitor/AliveMonitor.cjs +4 -2
- package/src/components/monitor/AliveMonitor.mjs +4 -2
- package/src/components/monitor/CpuMonitor.cjs +5 -3
- package/src/components/monitor/CpuMonitor.mjs +5 -3
- package/src/components/monitor/EventLoopMonitor.cjs +4 -2
- package/src/components/monitor/EventLoopMonitor.mjs +4 -2
- package/src/components/monitor/HttpRequestMonitor.cjs +5 -3
- package/src/components/monitor/HttpRequestMonitor.mjs +5 -3
- package/src/components/monitor/MemoryMonitor.cjs +5 -3
- package/src/components/monitor/MemoryMonitor.mjs +5 -3
- package/src/decorators/ctrl/CLIAction.cjs +3 -3
- package/src/decorators/ctrl/CLIAction.mjs +3 -3
- package/src/decorators/ctrl/HTTPAction.cjs +3 -3
- package/src/decorators/ctrl/HTTPAction.mjs +3 -3
- package/src/decorators/ctrl/ServiceAction.cjs +3 -3
- package/src/decorators/ctrl/ServiceAction.mjs +3 -3
- package/src/decorators/ctrl/http/DELETE.cjs +3 -3
- package/src/decorators/ctrl/http/DELETE.mjs +3 -3
- package/src/decorators/ctrl/http/GET.cjs +3 -3
- package/src/decorators/ctrl/http/GET.mjs +3 -3
- package/src/decorators/ctrl/http/HEAD.cjs +3 -3
- package/src/decorators/ctrl/http/HEAD.mjs +3 -3
- package/src/decorators/ctrl/http/OPTIONS.cjs +3 -3
- package/src/decorators/ctrl/http/OPTIONS.mjs +3 -3
- package/src/decorators/ctrl/http/PATCH.cjs +3 -3
- package/src/decorators/ctrl/http/PATCH.mjs +3 -3
- package/src/decorators/ctrl/http/POST.cjs +3 -3
- package/src/decorators/ctrl/http/POST.mjs +3 -3
- package/src/decorators/ctrl/http/PUT.cjs +3 -3
- package/src/decorators/ctrl/http/PUT.mjs +3 -3
- package/src/decorators/orm/AfterInsert.cjs +17 -39
- package/src/decorators/orm/AfterInsert.mjs +18 -38
- package/src/decorators/orm/AfterLoad.cjs +17 -39
- package/src/decorators/orm/AfterLoad.mjs +18 -38
- package/src/decorators/orm/AfterRecover.cjs +17 -39
- package/src/decorators/orm/AfterRecover.mjs +18 -38
- package/src/decorators/orm/AfterRemove.cjs +17 -39
- package/src/decorators/orm/AfterRemove.mjs +18 -38
- package/src/decorators/orm/AfterSoftRemove.cjs +17 -39
- package/src/decorators/orm/AfterSoftRemove.mjs +18 -38
- package/src/decorators/orm/AfterUpdate.cjs +17 -39
- package/src/decorators/orm/AfterUpdate.mjs +18 -38
- package/src/decorators/orm/BeforeInsert.cjs +17 -39
- package/src/decorators/orm/BeforeInsert.mjs +18 -38
- package/src/decorators/orm/BeforeRecover.cjs +17 -39
- package/src/decorators/orm/BeforeRecover.mjs +18 -38
- package/src/decorators/orm/BeforeRemove.cjs +17 -39
- package/src/decorators/orm/BeforeRemove.mjs +18 -38
- package/src/decorators/orm/BeforeSoftRemove.cjs +17 -39
- package/src/decorators/orm/BeforeSoftRemove.mjs +18 -38
- package/src/decorators/orm/BeforeUpdate.cjs +17 -39
- package/src/decorators/orm/BeforeUpdate.mjs +18 -38
- package/src/decorators/orm/Check.cjs +17 -42
- package/src/decorators/orm/Check.mjs +18 -41
- package/src/decorators/orm/ChildEntity.cjs +17 -42
- package/src/decorators/orm/ChildEntity.mjs +18 -41
- package/src/decorators/orm/Column.cjs +17 -74
- package/src/decorators/orm/Column.mjs +19 -74
- package/src/decorators/orm/CreateDateColumn.cjs +17 -38
- package/src/decorators/orm/CreateDateColumn.mjs +18 -37
- package/src/decorators/orm/DeleteDateColumn.cjs +17 -38
- package/src/decorators/orm/DeleteDateColumn.mjs +17 -36
- package/src/decorators/orm/Entity.cjs +17 -48
- package/src/decorators/orm/Entity.mjs +17 -46
- package/src/decorators/orm/EventSubscriber.cjs +17 -35
- package/src/decorators/orm/EventSubscriber.mjs +18 -34
- package/src/decorators/orm/Exclusion.cjs +17 -42
- package/src/decorators/orm/Exclusion.mjs +18 -41
- package/src/decorators/orm/Generated.cjs +17 -37
- package/src/decorators/orm/Generated.mjs +18 -36
- package/src/decorators/orm/Index.cjs +17 -54
- package/src/decorators/orm/Index.mjs +19 -54
- package/src/decorators/orm/JoinColumn.cjs +17 -42
- package/src/decorators/orm/JoinColumn.mjs +18 -41
- package/src/decorators/orm/JoinTable.cjs +17 -43
- package/src/decorators/orm/JoinTable.mjs +17 -41
- package/src/decorators/orm/ManyToMany.cjs +17 -55
- package/src/decorators/orm/ManyToMany.mjs +17 -53
- package/src/decorators/orm/ManyToOne.cjs +17 -55
- package/src/decorators/orm/ManyToOne.mjs +17 -53
- package/src/decorators/orm/ObjectIdColumn.cjs +17 -41
- package/src/decorators/orm/ObjectIdColumn.mjs +18 -40
- package/src/decorators/orm/OneToMany.cjs +17 -47
- package/src/decorators/orm/OneToMany.mjs +19 -47
- package/src/decorators/orm/OneToOne.cjs +17 -55
- package/src/decorators/orm/OneToOne.mjs +17 -53
- package/src/decorators/orm/PrimaryColumn.cjs +17 -62
- package/src/decorators/orm/PrimaryColumn.mjs +19 -62
- package/src/decorators/orm/PrimaryGeneratedColumn.cjs +17 -67
- package/src/decorators/orm/PrimaryGeneratedColumn.mjs +19 -67
- package/src/decorators/orm/RelationId.cjs +17 -39
- package/src/decorators/orm/RelationId.mjs +18 -38
- package/src/decorators/orm/TableInheritance.cjs +17 -39
- package/src/decorators/orm/TableInheritance.mjs +18 -38
- package/src/decorators/orm/Tree.cjs +17 -37
- package/src/decorators/orm/Tree.mjs +18 -36
- package/src/decorators/orm/TreeChildren.cjs +17 -44
- package/src/decorators/orm/TreeChildren.mjs +17 -42
- package/src/decorators/orm/TreeLevelColumn.cjs +17 -38
- package/src/decorators/orm/TreeLevelColumn.mjs +17 -36
- package/src/decorators/orm/TreeParent.cjs +17 -44
- package/src/decorators/orm/TreeParent.mjs +17 -42
- package/src/decorators/orm/Unique.cjs +17 -57
- package/src/decorators/orm/Unique.mjs +19 -57
- package/src/decorators/orm/UpdateDateColumn.cjs +17 -38
- package/src/decorators/orm/UpdateDateColumn.mjs +18 -37
- package/src/decorators/orm/VersionColumn.cjs +17 -38
- package/src/decorators/orm/VersionColumn.mjs +18 -37
- package/src/decorators/orm/ViewColumn.cjs +17 -38
- package/src/decorators/orm/ViewColumn.mjs +18 -37
- package/src/decorators/orm/ViewEntity.cjs +17 -47
- package/src/decorators/orm/ViewEntity.mjs +18 -46
- package/src/decorators/orm/VirtualColumn.cjs +17 -55
- package/src/decorators/orm/VirtualColumn.mjs +17 -53
- package/src/lib/base/BaseObject.cjs +4 -2
- package/src/lib/base/BaseObject.mjs +4 -2
- package/src/lib/base/EventEmitter.cjs +1200 -1193
- package/src/lib/base/EventEmitter.mjs +1201 -1194
- package/src/lib/base/internal/ApplicationConfigLoader.cjs +4 -2
- package/src/lib/base/internal/ApplicationConfigLoader.mjs +4 -2
- package/src/lib/base/internal/ControllerEntrypoint.cjs +3 -3
- package/src/lib/base/internal/ControllerEntrypoint.mjs +3 -3
- package/src/lib/base/internal/DataValidator.cjs +176 -179
- package/src/lib/base/internal/DataValidator.mjs +177 -180
- package/src/lib/base/internal/ModuleConfigLoader.cjs +4 -3
- package/src/lib/base/internal/ModuleConfigLoader.mjs +4 -3
- package/src/lib/base/internal/ObjectType.cjs +4 -2
- package/src/lib/base/internal/ObjectType.mjs +4 -2
- package/src/lib/base/internal/PatternManager.cjs +740 -735
- package/src/lib/base/internal/PatternManager.mjs +745 -740
- package/src/lib/base/internal/StringifyPattern.cjs +1 -1
- package/src/lib/base/internal/StringifyPattern.mjs +1 -1
- package/src/lib/core/Application.cjs +151 -147
- package/src/lib/core/Application.mjs +199 -197
- package/src/lib/core/Component.cjs +4 -2
- package/src/lib/core/Component.mjs +4 -2
- package/src/lib/core/Container.cjs +4 -2
- package/src/lib/core/Container.mjs +4 -2
- package/src/lib/core/Module.cjs +5 -3
- package/src/lib/core/Module.mjs +5 -3
- package/src/lib/core/Provider.cjs +4 -2
- package/src/lib/core/Provider.mjs +4 -2
- package/src/lib/helpers/Glob.cjs +970 -721
- package/src/lib/helpers/Glob.mjs +1036 -787
- package/src/lib/helpers/IsHtml.cjs +7 -13
- package/src/lib/helpers/IsHtml.mjs +7 -13
- package/src/lib/helpers/IsXML.cjs +1158 -1016
- package/src/lib/helpers/IsXML.mjs +871 -729
- package/src/lib/helpers/MD5.cjs +1 -1
- package/src/lib/helpers/MD5.mjs +1 -1
- package/src/lib/helpers/NonceStr.cjs +1 -1
- package/src/lib/helpers/NonceStr.mjs +1 -1
- package/src/lib/helpers/ObjectHash.cjs +379 -372
- package/src/lib/helpers/ObjectHash.mjs +379 -372
- package/src/lib/helpers/RandomString.cjs +168 -147
- package/src/lib/helpers/RandomString.mjs +167 -146
- package/src/lib/helpers/SHA1.cjs +1 -1
- package/src/lib/helpers/SHA1.mjs +1 -1
- package/src/lib/helpers/SHA256.cjs +1 -1
- package/src/lib/helpers/SHA256.mjs +1 -1
- package/src/lib/helpers/SortArray.cjs +1 -1
- package/src/lib/helpers/SortArray.mjs +1 -1
- package/src/lib/helpers/Statistics.cjs +1 -1
- package/src/lib/helpers/Statistics.mjs +1 -1
- package/src/lib/helpers/URLBuilder.cjs +355 -355
- package/src/lib/helpers/URLBuilder.mjs +350 -350
- package/src/lib/helpers/UUID.cjs +1 -1
- package/src/lib/helpers/UUID.mjs +1 -1
- package/src/lib/ioc/DependencyInjectionContainer.cjs +32 -30
- package/src/lib/ioc/DependencyInjectionContainer.mjs +12 -10
- package/src/lib/ioc/ListModules.cjs +5174 -5249
- package/src/lib/ioc/ListModules.mjs +5177 -5252
- package/src/lib/validation/VLD.cjs +4080 -3902
- package/src/lib/validation/VLD.mjs +2970 -2792
- package/src/options/ApplicationOptions.cjs +4 -2
- package/src/options/ApplicationOptions.mjs +4 -2
- package/src/options/LoadAnonymousObjectOptions.cjs +4 -2
- package/src/options/LoadAnonymousObjectOptions.mjs +4 -2
- package/src/options/LoadNamedObjectOptions.cjs +4 -2
- package/src/options/LoadNamedObjectOptions.mjs +4 -2
- package/src/options/LoadObjectOptions.cjs +4 -2
- package/src/options/LoadObjectOptions.mjs +4 -2
- package/src/options/ModuleLoadObjectsOptions.cjs +4 -2
- package/src/options/ModuleLoadObjectsOptions.mjs +4 -2
- package/src/options/ModuleOptions.cjs +4 -4
- package/src/options/ModuleOptions.mjs +4 -4
- package/src/options/OverridableNamedObjectOptions.cjs +4 -2
- package/src/options/OverridableNamedObjectOptions.mjs +4 -2
- package/src/options/OverridableObjectOptions.cjs +4 -2
- package/src/options/OverridableObjectOptions.mjs +4 -2
- package/src/providers/Database.cjs +11 -11
- package/src/providers/Database.mjs +11 -11
- package/src/providers/PasswordHash.cjs +5 -3
- package/src/providers/PasswordHash.mjs +190 -188
- package/src/providers/migration/GenerateMigration.cjs +15 -19
- package/src/providers/migration/GenerateMigration.mjs +15 -19
- package/vendor/Package.10.cjs +2 -8
- package/vendor/Package.10.mjs +2 -8
- package/vendor/Package.11.cjs +5 -83
- package/vendor/Package.11.mjs +5 -77
- package/vendor/Package.112.cjs +48900 -0
- package/vendor/Package.112.mjs +48764 -0
- package/vendor/Package.12.cjs +4 -2
- package/vendor/Package.12.mjs +6 -4
- package/vendor/Package.13.cjs +87 -1
- package/vendor/Package.13.mjs +81 -1
- package/vendor/Package.14.cjs +1 -14057
- package/vendor/Package.14.mjs +1 -14031
- package/vendor/Package.15.cjs +1 -1
- package/vendor/Package.15.mjs +1 -1
- package/vendor/Package.16.cjs +18129 -1935
- package/vendor/Package.16.mjs +18115 -1839
- package/vendor/Package.17.cjs +1922 -47918
- package/vendor/Package.17.mjs +1874 -47937
- package/vendor/Package.18.cjs +35 -1
- package/vendor/Package.18.mjs +35 -1
- package/vendor/Package.19.cjs +37 -0
- package/vendor/Package.19.mjs +35 -0
- package/vendor/Package.2.cjs +5739 -5710
- package/vendor/Package.2.mjs +5733 -5704
- package/vendor/Package.20.cjs +37 -0
- package/vendor/Package.20.mjs +35 -0
- package/vendor/Package.21.cjs +37 -0
- package/vendor/Package.21.mjs +35 -0
- package/vendor/Package.22.cjs +37 -0
- package/vendor/Package.22.mjs +35 -0
- package/vendor/Package.23.cjs +37 -0
- package/vendor/Package.23.mjs +35 -0
- package/vendor/Package.24.cjs +37 -0
- package/vendor/Package.24.mjs +35 -0
- package/vendor/Package.25.cjs +37 -0
- package/vendor/Package.25.mjs +35 -0
- package/vendor/Package.26.cjs +37 -0
- package/vendor/Package.26.mjs +35 -0
- package/vendor/Package.27.cjs +37 -0
- package/vendor/Package.27.mjs +35 -0
- package/vendor/Package.28.cjs +37 -0
- package/vendor/Package.28.mjs +35 -0
- package/vendor/Package.29.cjs +40 -0
- package/vendor/Package.29.mjs +38 -0
- package/vendor/Package.30.cjs +41 -0
- package/vendor/Package.30.mjs +39 -0
- package/vendor/Package.31.cjs +72 -0
- package/vendor/Package.31.mjs +70 -0
- package/vendor/Package.32.cjs +37 -0
- package/vendor/Package.32.mjs +35 -0
- package/vendor/Package.33.cjs +37 -0
- package/vendor/Package.33.mjs +35 -0
- package/vendor/Package.34.cjs +46 -0
- package/vendor/Package.34.mjs +44 -0
- package/vendor/Package.35.cjs +34 -0
- package/vendor/Package.35.mjs +32 -0
- package/vendor/Package.36.cjs +40 -0
- package/vendor/Package.36.mjs +38 -0
- package/vendor/Package.37.cjs +36 -0
- package/vendor/Package.37.mjs +34 -0
- package/vendor/Package.38.cjs +52 -0
- package/vendor/Package.38.mjs +50 -0
- package/vendor/Package.39.cjs +41 -0
- package/vendor/Package.39.mjs +39 -0
- package/vendor/Package.4.cjs +884 -874
- package/vendor/Package.4.mjs +884 -874
- package/vendor/Package.40.cjs +42 -0
- package/vendor/Package.40.mjs +40 -0
- package/vendor/Package.41.cjs +53 -0
- package/vendor/Package.41.mjs +51 -0
- package/vendor/Package.42.cjs +53 -0
- package/vendor/Package.42.mjs +51 -0
- package/vendor/Package.43.cjs +40 -0
- package/vendor/Package.43.mjs +38 -0
- package/vendor/Package.44.cjs +46 -0
- package/vendor/Package.44.mjs +44 -0
- package/vendor/Package.45.cjs +53 -0
- package/vendor/Package.45.mjs +51 -0
- package/vendor/Package.46.cjs +59 -0
- package/vendor/Package.46.mjs +57 -0
- package/vendor/Package.47.cjs +65 -0
- package/vendor/Package.47.mjs +63 -0
- package/vendor/Package.48.cjs +38 -0
- package/vendor/Package.48.mjs +36 -0
- package/vendor/Package.49.cjs +38 -0
- package/vendor/Package.49.mjs +36 -0
- package/vendor/Package.5.cjs +15 -11
- package/vendor/Package.5.mjs +11 -7
- package/vendor/Package.50.cjs +36 -0
- package/vendor/Package.50.mjs +34 -0
- package/vendor/Package.51.cjs +43 -0
- package/vendor/Package.51.mjs +41 -0
- package/vendor/Package.52.cjs +37 -0
- package/vendor/Package.52.mjs +35 -0
- package/vendor/Package.53.cjs +43 -0
- package/vendor/Package.53.mjs +41 -0
- package/vendor/Package.54.cjs +55 -0
- package/vendor/Package.54.mjs +53 -0
- package/vendor/Package.55.cjs +37 -0
- package/vendor/Package.55.mjs +35 -0
- package/vendor/Package.56.cjs +37 -0
- package/vendor/Package.56.mjs +35 -0
- package/vendor/Package.57.cjs +37 -0
- package/vendor/Package.57.mjs +35 -0
- package/vendor/Package.58.cjs +45 -0
- package/vendor/Package.58.mjs +43 -0
- package/vendor/Package.59.cjs +53 -0
- package/vendor/Package.59.mjs +51 -0
- package/vendor/Package.6.cjs +520 -511
- package/vendor/Package.6.mjs +543 -534
- package/vendor/Package.60.cjs +47649 -0
- package/vendor/Package.60.mjs +47606 -0
- package/vendor/Package.610.cjs +11 -11
- package/vendor/Package.610.mjs +11 -11
- package/vendor/Package.611.cjs +33 -23
- package/vendor/Package.611.mjs +19 -9
- package/vendor/Package.612.cjs +42 -36
- package/vendor/Package.612.mjs +35 -29
- package/vendor/Package.613.cjs +5 -4
- package/vendor/Package.613.mjs +5 -4
- package/vendor/Package.62.cjs +92 -89
- package/vendor/Package.62.mjs +185 -182
- package/vendor/Package.63.cjs +509 -166
- package/vendor/Package.63.mjs +490 -165
- package/vendor/Package.64.cjs +139 -511
- package/vendor/Package.64.mjs +139 -491
- package/vendor/Package.65.cjs +4135 -150
- package/vendor/Package.65.mjs +4143 -150
- package/vendor/Package.66.cjs +346 -4150
- package/vendor/Package.66.mjs +346 -4158
- package/vendor/Package.67.cjs +412 -261
- package/vendor/Package.67.mjs +410 -259
- package/vendor/Package.68.cjs +397 -405
- package/vendor/Package.68.mjs +227 -242
- package/vendor/Package.8.cjs +0 -4
- package/vendor/Package.8.mjs +0 -4
- package/vendor/Package.9.cjs +132 -118
- package/vendor/Package.9.mjs +138 -124
- package/vendor/TypeDef.internal.3.d.ts +0 -4
- package/vendor/Package.102.cjs +0 -48773
- package/vendor/Package.102.mjs +0 -48697
- package/vendor/Package.122.cjs +0 -3
- package/vendor/Package.122.mjs +0 -1
|
@@ -2,57 +2,55 @@ import { _ as t, a as e } from "../../../vendor/Package.1.mjs";
|
|
|
2
2
|
|
|
3
3
|
import { Provider as o } from "./Provider.mjs";
|
|
4
4
|
|
|
5
|
-
import { Configurable as
|
|
5
|
+
import { Configurable as i } from "../../decorators/di/Configurable.mjs";
|
|
6
6
|
|
|
7
|
-
import { D as
|
|
7
|
+
import { D as r } from "../../../vendor/Package.2.mjs";
|
|
8
8
|
|
|
9
9
|
import n from "path";
|
|
10
10
|
|
|
11
|
-
import { D as s } from "../../../vendor/Package.
|
|
11
|
+
import { D as s } from "../../../vendor/Package.11.mjs";
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { g as a } from "../../../vendor/Package.5.mjs";
|
|
14
14
|
|
|
15
|
-
import { g as d } from "../../../vendor/Package.
|
|
15
|
+
import { a as c, b as p, c as m, d as l, e as u, f as h, g as d } from "../../../vendor/Package.112.mjs";
|
|
16
16
|
|
|
17
17
|
import { r as g } from "../../../vendor/Package.12.mjs";
|
|
18
18
|
|
|
19
19
|
import "../../../vendor/Package.8.mjs";
|
|
20
20
|
|
|
21
|
-
import
|
|
21
|
+
import f from "fs/promises";
|
|
22
22
|
|
|
23
|
-
import {
|
|
23
|
+
import { Transient as j } from "../../decorators/di/Lifetime.mjs";
|
|
24
24
|
|
|
25
|
-
import { Module as
|
|
25
|
+
import { Module as y, MODULE_INITIALIZED as b, MODULE_INITIALIZE_ERROR as v } from "./Module.mjs";
|
|
26
26
|
|
|
27
|
-
import { C as
|
|
27
|
+
import { C as x } from "../../../vendor/Package.3.mjs";
|
|
28
28
|
|
|
29
|
-
import { ApplicationConfigLoader as
|
|
29
|
+
import { ApplicationConfigLoader as E } from "../base/internal/ApplicationConfigLoader.mjs";
|
|
30
30
|
|
|
31
|
-
import { ApplicationOptions as
|
|
31
|
+
import { ApplicationOptions as w } from "../../options/ApplicationOptions.mjs";
|
|
32
32
|
|
|
33
|
-
import { Alias as
|
|
33
|
+
import { Alias as O } from "./Alias.mjs";
|
|
34
34
|
|
|
35
35
|
import { GetBasicInfo as C } from "../base/internal/BasicInfo.mjs";
|
|
36
36
|
|
|
37
|
-
import { Entrypoint as
|
|
37
|
+
import { Entrypoint as P } from "../../components/entrypoint/Entrypoint.mjs";
|
|
38
38
|
|
|
39
|
-
import { L as
|
|
39
|
+
import { L as A } from "../../../vendor/Package.16.mjs";
|
|
40
40
|
|
|
41
|
-
import { Accept as
|
|
41
|
+
import { Accept as S } from "../../decorators/dto/Accept.mjs";
|
|
42
42
|
|
|
43
|
-
import { mkdirSync as
|
|
43
|
+
import { mkdirSync as k } from "fs";
|
|
44
44
|
|
|
45
|
-
import
|
|
45
|
+
import I from "node:path";
|
|
46
46
|
|
|
47
|
-
import { existsSync as
|
|
47
|
+
import { existsSync as D } from "node:fs";
|
|
48
48
|
|
|
49
|
-
import { As as
|
|
49
|
+
import { As as R } from "../helpers/As.mjs";
|
|
50
50
|
|
|
51
|
-
import { EventEmitter as
|
|
51
|
+
import { EventEmitter as N } from "../base/EventEmitter.mjs";
|
|
52
52
|
|
|
53
|
-
import { DatabaseSymbol as
|
|
54
|
-
|
|
55
|
-
import { Inject as L } from "../../decorators/di/Inject.mjs";
|
|
53
|
+
import { DatabaseSymbol as B } from "../base/internal/DatabaseSymbol.mjs";
|
|
56
54
|
|
|
57
55
|
import "../base/async-constructor/AsyncConstructor.mjs";
|
|
58
56
|
|
|
@@ -130,6 +128,8 @@ import "../ioc/ListModules.mjs";
|
|
|
130
128
|
|
|
131
129
|
import "os";
|
|
132
130
|
|
|
131
|
+
import "../../../vendor/Package.10.mjs";
|
|
132
|
+
|
|
133
133
|
import "stream";
|
|
134
134
|
|
|
135
135
|
import "events";
|
|
@@ -174,9 +174,9 @@ import "../helpers/IsEmptyObject.mjs";
|
|
|
174
174
|
|
|
175
175
|
import "../../../vendor/Package.62.mjs";
|
|
176
176
|
|
|
177
|
-
import "../../../vendor/Package.
|
|
177
|
+
import "../../../vendor/Package.13.mjs";
|
|
178
178
|
|
|
179
|
-
import "../../../vendor/Package.
|
|
179
|
+
import "../../../vendor/Package.14.mjs";
|
|
180
180
|
|
|
181
181
|
import "buffer";
|
|
182
182
|
|
|
@@ -184,12 +184,10 @@ import "module";
|
|
|
184
184
|
|
|
185
185
|
import "tty";
|
|
186
186
|
|
|
187
|
-
import "../../../vendor/Package.
|
|
187
|
+
import "../../../vendor/Package.15.mjs";
|
|
188
188
|
|
|
189
189
|
import "crypto";
|
|
190
190
|
|
|
191
|
-
import "../../../vendor/Package.63.mjs";
|
|
192
|
-
|
|
193
191
|
import "node:url";
|
|
194
192
|
|
|
195
193
|
import "node:fs/promises";
|
|
@@ -242,11 +240,11 @@ import "../helpers/GetObjectNestingDepth.mjs";
|
|
|
242
240
|
|
|
243
241
|
import "../../exceptions/InvalidActionPatternDepthException.mjs";
|
|
244
242
|
|
|
245
|
-
import "../../../vendor/Package.
|
|
243
|
+
import "../../../vendor/Package.63.mjs";
|
|
246
244
|
|
|
247
245
|
import "../base/internal/StringifyPattern.mjs";
|
|
248
246
|
|
|
249
|
-
import "../../../vendor/Package.
|
|
247
|
+
import "../../../vendor/Package.64.mjs";
|
|
250
248
|
|
|
251
249
|
import "../base/internal/PatternManager.mjs";
|
|
252
250
|
|
|
@@ -282,105 +280,114 @@ import "../../components/entrypoint/exceptions/InvalidActionGroupException.mjs";
|
|
|
282
280
|
|
|
283
281
|
import "worker_threads";
|
|
284
282
|
|
|
285
|
-
import "../../../vendor/Package.15.mjs";
|
|
286
|
-
|
|
287
283
|
import "assert";
|
|
288
284
|
|
|
289
285
|
import "string_decoder";
|
|
290
286
|
|
|
291
|
-
var
|
|
292
|
-
|
|
293
|
-
"use strict";
|
|
294
|
-
|
|
295
|
-
Object.defineProperty(T, "__esModule", {
|
|
296
|
-
value: true
|
|
297
|
-
});
|
|
287
|
+
var M = c();
|
|
298
288
|
|
|
299
|
-
|
|
289
|
+
const L = a(M);
|
|
300
290
|
|
|
301
|
-
|
|
291
|
+
var T = p();
|
|
302
292
|
|
|
303
|
-
const
|
|
293
|
+
const q = a(T);
|
|
304
294
|
|
|
305
|
-
|
|
295
|
+
var F = m();
|
|
306
296
|
|
|
307
|
-
const
|
|
297
|
+
const $ = a(F);
|
|
308
298
|
|
|
309
|
-
|
|
299
|
+
var U = {};
|
|
310
300
|
|
|
311
|
-
|
|
301
|
+
var G;
|
|
312
302
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
303
|
+
function Q() {
|
|
304
|
+
if (G) return U;
|
|
305
|
+
G = 1;
|
|
306
|
+
"use strict";
|
|
307
|
+
Object.defineProperty(U, "__esModule", {
|
|
308
|
+
value: true
|
|
309
|
+
});
|
|
310
|
+
U.CommandUtils = void 0;
|
|
311
|
+
const t = g;
|
|
312
|
+
const e = t.__importDefault(f);
|
|
313
|
+
const o = t.__importDefault(n);
|
|
314
|
+
const i = l();
|
|
315
|
+
const r = u();
|
|
316
|
+
const s = h();
|
|
317
|
+
class CommandUtils {
|
|
318
|
+
static async loadDataSource(t) {
|
|
319
|
+
let e;
|
|
320
|
+
try {
|
|
321
|
+
[e] = await (0, s.importOrRequireFile)(t);
|
|
322
|
+
} catch (e) {
|
|
323
|
+
throw new Error(`Unable to open file: "${t}". ${e.message}`);
|
|
324
|
+
}
|
|
325
|
+
if (!e || typeof e !== "object") {
|
|
326
|
+
throw new Error(`Given data source file must contain export of a DataSource instance`);
|
|
327
|
+
}
|
|
328
|
+
if (r.InstanceChecker.isDataSource(e)) {
|
|
329
|
+
return e;
|
|
333
330
|
}
|
|
331
|
+
const o = [];
|
|
332
|
+
for (const t in e) {
|
|
333
|
+
const i = e[t];
|
|
334
|
+
const n = await i;
|
|
335
|
+
if (r.InstanceChecker.isDataSource(n)) {
|
|
336
|
+
o.push(n);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
if (o.length === 0) {
|
|
340
|
+
throw new Error(`Given data source file must contain export of a DataSource instance`);
|
|
341
|
+
}
|
|
342
|
+
if (o.length > 1) {
|
|
343
|
+
throw new Error(`Given data source file must contain only one export of DataSource instance`);
|
|
344
|
+
}
|
|
345
|
+
return o[0];
|
|
334
346
|
}
|
|
335
|
-
|
|
336
|
-
|
|
347
|
+
static async createDirectories(t) {
|
|
348
|
+
await e.default.mkdir(t, {
|
|
349
|
+
recursive: true
|
|
350
|
+
});
|
|
337
351
|
}
|
|
338
|
-
|
|
339
|
-
|
|
352
|
+
static async createFile(t, i, r = true) {
|
|
353
|
+
await CommandUtils.createDirectories(o.default.dirname(t));
|
|
354
|
+
if (r === false && await CommandUtils.fileExists(t)) {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
await e.default.writeFile(t, i);
|
|
340
358
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
await $.default.mkdir(t, {
|
|
345
|
-
recursive: true
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
static async createFile(t, e, o = true) {
|
|
349
|
-
await CommandUtils.createDirectories(U.default.dirname(t));
|
|
350
|
-
if (o === false && await CommandUtils.fileExists(t)) {
|
|
351
|
-
return;
|
|
359
|
+
static async readFile(t) {
|
|
360
|
+
const o = await e.default.readFile(t);
|
|
361
|
+
return o.toString();
|
|
352
362
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
try {
|
|
361
|
-
await $.default.access(t, $.default.constants.F_OK);
|
|
362
|
-
return true;
|
|
363
|
-
} catch {
|
|
364
|
-
return false;
|
|
363
|
+
static async fileExists(t) {
|
|
364
|
+
try {
|
|
365
|
+
await e.default.access(t, e.default.constants.F_OK);
|
|
366
|
+
return true;
|
|
367
|
+
} catch {
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
365
370
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
371
|
+
static getTimestamp(t) {
|
|
372
|
+
if (t && (isNaN(t) || t < 0)) {
|
|
373
|
+
throw new i.TypeORMError(`timestamp option should be a non-negative number. received: ${t}`);
|
|
374
|
+
}
|
|
375
|
+
return t ? new Date(Number(t)).getTime() : Date.now();
|
|
370
376
|
}
|
|
371
|
-
return t ? new Date(Number(t)).getTime() : Date.now();
|
|
372
377
|
}
|
|
378
|
+
U.CommandUtils = CommandUtils;
|
|
379
|
+
return U;
|
|
373
380
|
}
|
|
374
381
|
|
|
375
|
-
|
|
382
|
+
var _ = Q();
|
|
376
383
|
|
|
377
|
-
|
|
384
|
+
const J = a(_);
|
|
378
385
|
|
|
379
|
-
|
|
386
|
+
var V = d();
|
|
380
387
|
|
|
381
|
-
const
|
|
388
|
+
const H = a(V);
|
|
382
389
|
|
|
383
|
-
|
|
390
|
+
const {Ansis: z, ansi256: W, fg: K, bgAnsi256: X, bg: Y, rgb: Z, bgRgb: tt, hex: et, bgHex: ot, reset: it, inverse: rt, hidden: nt, visible: st, bold: at, dim: ct, italic: pt, underline: mt, strikethrough: lt, strike: ut, black: ht, red: dt, green: gt, yellow: ft, blue: jt, magenta: yt, cyan: bt, white: vt, grey: xt, gray: Et, blackBright: wt, redBright: Ot, greenBright: Ct, yellowBright: Pt, blueBright: At, magentaBright: St, cyanBright: kt, whiteBright: It, bgBlack: Dt, bgRed: Rt, bgGreen: Nt, bgYellow: Bt, bgBlue: Mt, bgMagenta: Lt, bgCyan: Tt, bgWhite: qt, bgGrey: Ft, bgGray: $t, bgBlackBright: Ut, bgRedBright: Gt, bgGreenBright: Qt, bgYellowBright: _t, bgBlueBright: Jt, bgMagentaBright: Vt, bgCyanBright: Ht, bgWhiteBright: zt} = H;
|
|
384
391
|
|
|
385
392
|
var Wt;
|
|
386
393
|
|
|
@@ -391,27 +398,24 @@ var Wt;
|
|
|
391
398
|
t["FatalException"] = "FATAL_EXCEPTION";
|
|
392
399
|
})(Wt || (Wt = {}));
|
|
393
400
|
|
|
394
|
-
|
|
401
|
+
class Application extends y {
|
|
395
402
|
constructor() {
|
|
396
403
|
super(...arguments);
|
|
397
|
-
this.ConfigLoader =
|
|
404
|
+
this.ConfigLoader = E;
|
|
398
405
|
this.options = {
|
|
399
406
|
components: {
|
|
400
407
|
log: {
|
|
401
|
-
class:
|
|
408
|
+
class: A
|
|
402
409
|
},
|
|
403
410
|
entrypoint: {
|
|
404
|
-
class:
|
|
411
|
+
class: P
|
|
405
412
|
}
|
|
406
413
|
},
|
|
407
414
|
bootstrap: [ "log" ]
|
|
408
415
|
};
|
|
409
416
|
}
|
|
410
417
|
static {
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
static {
|
|
414
|
-
this.eventEmitter = new B;
|
|
418
|
+
this.eventEmitter = new N;
|
|
415
419
|
}
|
|
416
420
|
static {
|
|
417
421
|
this.environmentVariableMap = new Map;
|
|
@@ -420,7 +424,7 @@ let Kt = class Application extends b {
|
|
|
420
424
|
this.aliasDeclarations = [];
|
|
421
425
|
}
|
|
422
426
|
static async getLogger() {
|
|
423
|
-
return this.appInstance ? await this.appInstance.getObject("log") : await (new
|
|
427
|
+
return this.appInstance ? await this.appInstance.getObject("log") : await (new x).set(A);
|
|
424
428
|
}
|
|
425
429
|
static env(t) {
|
|
426
430
|
Object.keys(t).forEach((e => this.environmentVariableMap.set(e, t[e])));
|
|
@@ -451,9 +455,9 @@ let Kt = class Application extends b {
|
|
|
451
455
|
static onFatalException(t) {
|
|
452
456
|
this.eventEmitter.once(Wt.FatalException, (async e => {
|
|
453
457
|
const o = await this.getLogger();
|
|
454
|
-
let
|
|
455
|
-
if (typeof
|
|
456
|
-
return process.exit(
|
|
458
|
+
let i = await t(e, o);
|
|
459
|
+
if (typeof i !== "number") i = 1;
|
|
460
|
+
return process.exit(i);
|
|
457
461
|
}));
|
|
458
462
|
return this.launch();
|
|
459
463
|
}
|
|
@@ -501,16 +505,16 @@ let Kt = class Application extends b {
|
|
|
501
505
|
}
|
|
502
506
|
}));
|
|
503
507
|
this.environmentVariableMap.forEach(((t, e) => process.env[e] = t));
|
|
504
|
-
const t =
|
|
508
|
+
const t = O.getAliasInstance();
|
|
505
509
|
t.set("@runtime", process.cwd());
|
|
506
510
|
this.aliasDeclarations.forEach((e => {
|
|
507
511
|
const o = e.alias;
|
|
508
|
-
const
|
|
512
|
+
const i = e.createIfNotExist;
|
|
509
513
|
Object.keys(o).forEach((e => {
|
|
510
514
|
t.set(e, o[e]);
|
|
511
|
-
if (
|
|
512
|
-
const t =
|
|
513
|
-
if (!
|
|
515
|
+
if (i) {
|
|
516
|
+
const t = I.resolve(e);
|
|
517
|
+
if (!D(t)) k(I.resolve(e), {
|
|
514
518
|
recursive: true
|
|
515
519
|
});
|
|
516
520
|
}
|
|
@@ -526,29 +530,29 @@ let Kt = class Application extends b {
|
|
|
526
530
|
this.eventEmitter.removeAllListeners(Wt.UncaughtException);
|
|
527
531
|
this.eventEmitter.removeAllListeners(Wt.FatalException);
|
|
528
532
|
const o = process.env[t];
|
|
529
|
-
const
|
|
533
|
+
const i = t => {
|
|
530
534
|
const e = [];
|
|
531
535
|
for (const o in t) {
|
|
532
|
-
if (t[o] && t[o].class && t[o].class.databaseSymbol && t[o].class.databaseSymbol ===
|
|
533
|
-
const
|
|
534
|
-
if (!
|
|
535
|
-
Reflect.set(
|
|
536
|
-
e.push(
|
|
536
|
+
if (t[o] && t[o].class && t[o].class.databaseSymbol && t[o].class.databaseSymbol === B) {
|
|
537
|
+
const i = t[o].options;
|
|
538
|
+
if (!i) continue;
|
|
539
|
+
Reflect.set(i, "dataSourceName", o);
|
|
540
|
+
e.push(i);
|
|
537
541
|
}
|
|
538
542
|
}
|
|
539
543
|
return e;
|
|
540
544
|
};
|
|
541
|
-
const
|
|
542
|
-
if (!
|
|
545
|
+
const r = [ ...e.components ? i(e.components) : [], ...e.providers ? i(e.providers) : [] ];
|
|
546
|
+
if (!r.length) process.exit(0);
|
|
543
547
|
e.bootstrap = [];
|
|
544
|
-
|
|
545
|
-
const n = `GenerateMigration${
|
|
548
|
+
r.forEach(((t, i) => {
|
|
549
|
+
const n = `GenerateMigration${i}${Date.now()}`;
|
|
546
550
|
if (!e.providers) e.providers = {};
|
|
547
551
|
e.providers[n] = {
|
|
548
|
-
class:
|
|
552
|
+
class: Xt,
|
|
549
553
|
path: o,
|
|
550
554
|
outputJs: false,
|
|
551
|
-
exitProcess:
|
|
555
|
+
exitProcess: i === r.length - 1,
|
|
552
556
|
dataSourceName: Reflect.get(t, "dataSourceName"),
|
|
553
557
|
dataSource: t
|
|
554
558
|
};
|
|
@@ -558,25 +562,25 @@ let Kt = class Application extends b {
|
|
|
558
562
|
break;
|
|
559
563
|
}
|
|
560
564
|
}
|
|
561
|
-
const o = new
|
|
562
|
-
return new Promise(((t,
|
|
563
|
-
|
|
565
|
+
const o = new x;
|
|
566
|
+
return new Promise(((t, i) => {
|
|
567
|
+
w.validateAsync(e).then((e => {
|
|
564
568
|
e.bootstrap?.push((async t => {
|
|
565
569
|
const e = function() {
|
|
566
570
|
this.options.bootstrap?.pop();
|
|
567
|
-
|
|
571
|
+
R(Reflect.getOwnMetadata("#bootstrap", this))?.pop();
|
|
568
572
|
};
|
|
569
|
-
e.bind(
|
|
570
|
-
this.eventEmitter.emit(Wt.Launched,
|
|
573
|
+
e.bind(R(t))();
|
|
574
|
+
this.eventEmitter.emit(Wt.Launched, R(t));
|
|
571
575
|
}));
|
|
572
|
-
o.set(
|
|
576
|
+
o.set(Application, {
|
|
573
577
|
options: e
|
|
574
|
-
}).then((e => e.once(
|
|
575
|
-
})).catch(
|
|
578
|
+
}).then((e => e.once(b, (() => t(e))).once(v, (t => this.processFatalException(t))))).catch(i);
|
|
579
|
+
})).catch(i);
|
|
576
580
|
}));
|
|
577
581
|
}
|
|
578
582
|
get alias() {
|
|
579
|
-
return
|
|
583
|
+
return O.getAliasInstance();
|
|
580
584
|
}
|
|
581
585
|
get appId() {
|
|
582
586
|
return C().appId;
|
|
@@ -594,20 +598,18 @@ let Kt = class Application extends b {
|
|
|
594
598
|
if (typeof t === "boolean" && t) {
|
|
595
599
|
return process.exit(2);
|
|
596
600
|
} else {
|
|
597
|
-
|
|
601
|
+
Application.eventEmitter.emit("exit", this, t ? t : 0);
|
|
598
602
|
}
|
|
599
603
|
}
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
t([ A(i.Object().pattern(i.String(), i.String()).required()), e("design:type", Function), e("design:paramtypes", [ Object ]), e("design:returntype", Object) ], Kt, "env", null);
|
|
604
|
+
}
|
|
603
605
|
|
|
604
|
-
t([
|
|
606
|
+
t([ S(r.Object().pattern(r.String(), r.String()).required()), e("design:type", Function), e("design:paramtypes", [ Object ]), e("design:returntype", Object) ], Application, "env", null);
|
|
605
607
|
|
|
606
|
-
|
|
608
|
+
t([ S(r.Object().pattern(r.String(), r.String()).required(), r.Boolean().optional().default(false)), e("design:type", Function), e("design:paramtypes", [ Object, Boolean ]), e("design:returntype", Object) ], Application, "alias", null);
|
|
607
609
|
|
|
608
|
-
var
|
|
610
|
+
var Kt;
|
|
609
611
|
|
|
610
|
-
let
|
|
612
|
+
let Xt = Kt = class GenerateMigration extends o {
|
|
611
613
|
get extension() {
|
|
612
614
|
return this.outputJs ? ".js" : ".ts";
|
|
613
615
|
}
|
|
@@ -615,86 +617,88 @@ let Yt = Xt = class GenerateMigration extends o {
|
|
|
615
617
|
return this.timestamp + "-" + (this.dataSourceName ? this.dataSourceName : n.basename(this.path)) + this.extension;
|
|
616
618
|
}
|
|
617
619
|
#t;
|
|
620
|
+
#e;
|
|
618
621
|
async init() {
|
|
619
|
-
this.#t =
|
|
620
|
-
this.#
|
|
622
|
+
this.#t = await this.getObject(Application);
|
|
623
|
+
this.#e = new s.DataSource(this.dataSource);
|
|
624
|
+
this.#e.setOptions({
|
|
621
625
|
synchronize: false,
|
|
622
626
|
migrationsRun: false,
|
|
623
627
|
dropSchema: false,
|
|
624
628
|
logging: false
|
|
625
629
|
});
|
|
626
|
-
this.#
|
|
630
|
+
this.#e = await this.#e.initialize();
|
|
627
631
|
await this.handle();
|
|
628
632
|
}
|
|
629
633
|
async destroy() {
|
|
630
|
-
await (this.#
|
|
634
|
+
await (this.#e?.destroy());
|
|
631
635
|
}
|
|
632
636
|
async handle() {
|
|
633
637
|
try {
|
|
634
638
|
const t = [], e = [];
|
|
635
639
|
try {
|
|
636
|
-
const o = await this.#
|
|
640
|
+
const o = await this.#e.driver.createSchemaBuilder().log();
|
|
637
641
|
if (this.pretty) {
|
|
638
642
|
o.upQueries.forEach((t => {
|
|
639
|
-
t.query =
|
|
643
|
+
t.query = Kt.prettifyQuery(t.query);
|
|
640
644
|
}));
|
|
641
645
|
o.downQueries.forEach((t => {
|
|
642
|
-
t.query =
|
|
646
|
+
t.query = Kt.prettifyQuery(t.query);
|
|
643
647
|
}));
|
|
644
648
|
}
|
|
645
649
|
o.upQueries.forEach((e => {
|
|
646
|
-
t.push(" await queryRunner.query(`" + e.query.replaceAll("`", "\\`") + "`" +
|
|
650
|
+
t.push(" await queryRunner.query(`" + e.query.replaceAll("`", "\\`") + "`" + Kt.queryParams(e.parameters) + ");");
|
|
647
651
|
}));
|
|
648
652
|
o.downQueries.forEach((t => {
|
|
649
|
-
e.push(" await queryRunner.query(`" + t.query.replaceAll("`", "\\`") + "`" +
|
|
653
|
+
e.push(" await queryRunner.query(`" + t.query.replaceAll("`", "\\`") + "`" + Kt.queryParams(t.parameters) + ");");
|
|
650
654
|
}));
|
|
651
655
|
} finally {
|
|
652
|
-
await this.#
|
|
656
|
+
await this.#e.destroy();
|
|
653
657
|
}
|
|
654
658
|
if (!t.length) {
|
|
655
659
|
if (this.check) {
|
|
656
|
-
console.log(
|
|
660
|
+
console.log(H.green`No changes in database schema were found`);
|
|
657
661
|
if (this.exitProcess) {
|
|
658
|
-
return this.
|
|
662
|
+
return this.#t.exit(0);
|
|
659
663
|
} else {
|
|
660
664
|
return;
|
|
661
665
|
}
|
|
662
666
|
} else {
|
|
663
|
-
console.log(
|
|
667
|
+
console.log(H.yellow`No changes in database schema were found`);
|
|
664
668
|
if (this.exitProcess) {
|
|
665
|
-
return this.
|
|
669
|
+
return this.#t.exit(1);
|
|
666
670
|
} else {
|
|
667
671
|
return;
|
|
668
672
|
}
|
|
669
673
|
}
|
|
670
674
|
} else if (!this.path) {
|
|
671
|
-
console.log(
|
|
672
|
-
return this.
|
|
675
|
+
console.log(H.yellow`Please specify a migration path`);
|
|
676
|
+
return this.#t.exit(1);
|
|
673
677
|
}
|
|
674
|
-
const o = this.outputJs ?
|
|
678
|
+
const o = this.outputJs ? Kt.getJavascriptTemplate(n.basename(this.path), this.timestamp, t, e.reverse(), this.esm) : Kt.getTemplate(n.basename(this.path), this.timestamp, t, e.reverse());
|
|
675
679
|
if (this.check) {
|
|
676
|
-
console.log(
|
|
680
|
+
console.log(H.yellow`Unexpected changes in database schema were found in check mode:\n\n${H.white(o)}`);
|
|
677
681
|
if (this.exitProcess) {
|
|
678
|
-
return this.
|
|
682
|
+
return this.#t.exit(0);
|
|
679
683
|
} else {
|
|
680
684
|
return;
|
|
681
685
|
}
|
|
682
686
|
}
|
|
683
687
|
if (this.dryRun) {
|
|
684
|
-
console.log(
|
|
688
|
+
console.log(H.green(`Migration ${H.blue(this.path + this.extension)} has content:\n\n${H.white(o)}`));
|
|
685
689
|
} else {
|
|
686
690
|
const t = n.isAbsolute(this.path) ? n.join(this.path, this.filename) : n.join(process.cwd(), this.path, this.filename);
|
|
687
|
-
await
|
|
688
|
-
console.log(
|
|
691
|
+
await _.CommandUtils.createFile(t, o);
|
|
692
|
+
console.log(H.green`Migration ${H.blue(t)} has been generated successfully.`);
|
|
689
693
|
if (this.exitProcess) {
|
|
690
|
-
return this.
|
|
694
|
+
return this.#t.exit(0);
|
|
691
695
|
} else {
|
|
692
696
|
return;
|
|
693
697
|
}
|
|
694
698
|
}
|
|
695
699
|
} catch (t) {
|
|
696
|
-
|
|
697
|
-
return this.
|
|
700
|
+
F.PlatformTools.logCmdErr("Error during migration generation:", t);
|
|
701
|
+
return this.#t.exit(1);
|
|
698
702
|
}
|
|
699
703
|
}
|
|
700
704
|
static queryParams(t) {
|
|
@@ -703,45 +707,43 @@ let Yt = Xt = class GenerateMigration extends o {
|
|
|
703
707
|
}
|
|
704
708
|
return `, ${JSON.stringify(t)}`;
|
|
705
709
|
}
|
|
706
|
-
static getTemplate(t, e, o,
|
|
707
|
-
const
|
|
708
|
-
return `import { MigrationInterface, QueryRunner } from "lakutata/orm";\n\nexport class ${
|
|
710
|
+
static getTemplate(t, e, o, i) {
|
|
711
|
+
const r = `${T.camelCase(t, true)}${e}`;
|
|
712
|
+
return `import { MigrationInterface, QueryRunner } from "lakutata/orm";\n\nexport class ${r} implements MigrationInterface {\n name = '${r}'\n\n public async up(queryRunner: QueryRunner): Promise<void> {\n${o.join(`\n`)}\n }\n\n public async down(queryRunner: QueryRunner): Promise<void> {\n${i.join(`\n`)}\n }\n\n}\n`;
|
|
709
713
|
}
|
|
710
|
-
static getJavascriptTemplate(t, e, o,
|
|
711
|
-
const n = `${
|
|
712
|
-
const s =
|
|
713
|
-
return `/**\n * @typedef {import('lakutata/orm').MigrationInterface} MigrationInterface\n * @typedef {import('lakutata/orm').QueryRunner} QueryRunner\n */\n\n/**\n * @class\n * @implements {MigrationInterface}\n */\n${s} class ${n} {\n name = '${n}'\n\n /**\n * @param {QueryRunner} queryRunner\n */\n async up(queryRunner) {\n${o.join(`\n`)}\n }\n\n /**\n * @param {QueryRunner} queryRunner\n */\n async down(queryRunner) {\n${
|
|
714
|
+
static getJavascriptTemplate(t, e, o, i, r) {
|
|
715
|
+
const n = `${T.camelCase(t, true)}${e}`;
|
|
716
|
+
const s = r ? "export" : "module.exports =";
|
|
717
|
+
return `/**\n * @typedef {import('lakutata/orm').MigrationInterface} MigrationInterface\n * @typedef {import('lakutata/orm').QueryRunner} QueryRunner\n */\n\n/**\n * @class\n * @implements {MigrationInterface}\n */\n${s} class ${n} {\n name = '${n}'\n\n /**\n * @param {QueryRunner} queryRunner\n */\n async up(queryRunner) {\n${o.join(`\n`)}\n }\n\n /**\n * @param {QueryRunner} queryRunner\n */\n async down(queryRunner) {\n${i.join(`\n`)}\n }\n}\n`;
|
|
714
718
|
}
|
|
715
719
|
static prettifyQuery(t) {
|
|
716
|
-
const e =
|
|
720
|
+
const e = M.format(t, {
|
|
717
721
|
indent: " "
|
|
718
722
|
});
|
|
719
723
|
return "\n" + e.replace(/^/gm, " ") + "\n ";
|
|
720
724
|
}
|
|
721
725
|
};
|
|
722
726
|
|
|
723
|
-
t([
|
|
724
|
-
|
|
725
|
-
t([ r(i.String().required()), e("design:type", String) ], Yt.prototype, "path", void 0);
|
|
727
|
+
t([ i(r.String().required()), e("design:type", String) ], Xt.prototype, "path", void 0);
|
|
726
728
|
|
|
727
|
-
t([ r
|
|
729
|
+
t([ i(r.String().allow("").optional().default("")), e("design:type", String) ], Xt.prototype, "dataSourceName", void 0);
|
|
728
730
|
|
|
729
|
-
t([
|
|
731
|
+
t([ i(), e("design:type", Object) ], Xt.prototype, "dataSource", void 0);
|
|
730
732
|
|
|
731
|
-
t([ r
|
|
733
|
+
t([ i(r.Boolean().optional().default(true)), e("design:type", Boolean) ], Xt.prototype, "pretty", void 0);
|
|
732
734
|
|
|
733
|
-
t([ r
|
|
735
|
+
t([ i(r.Boolean().optional().default(false)), e("design:type", Boolean) ], Xt.prototype, "outputJs", void 0);
|
|
734
736
|
|
|
735
|
-
t([ r
|
|
737
|
+
t([ i(r.Boolean().optional().default(false)), e("design:type", Boolean) ], Xt.prototype, "esm", void 0);
|
|
736
738
|
|
|
737
|
-
t([ r
|
|
739
|
+
t([ i(r.Boolean().optional().default(false)), e("design:type", Boolean) ], Xt.prototype, "dryRun", void 0);
|
|
738
740
|
|
|
739
|
-
t([ r
|
|
741
|
+
t([ i(r.Boolean().optional().default(false)), e("design:type", Boolean) ], Xt.prototype, "check", void 0);
|
|
740
742
|
|
|
741
|
-
t([ r
|
|
743
|
+
t([ i(r.Number().optional().default((() => Date.now()))), e("design:type", Number) ], Xt.prototype, "timestamp", void 0);
|
|
742
744
|
|
|
743
|
-
t([ r
|
|
745
|
+
t([ i(r.Boolean().optional().default(true)), e("design:type", Boolean) ], Xt.prototype, "exitProcess", void 0);
|
|
744
746
|
|
|
745
|
-
|
|
747
|
+
Xt = Kt = t([ j() ], Xt);
|
|
746
748
|
|
|
747
|
-
export {
|
|
749
|
+
export { Application, Wt as ApplicationState, Xt as G };
|