@typetron/framework 0.3.17 → 0.3.18
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/Cache/Cache.d.ts +9 -0
- package/Cache/Cache.d.ts.map +1 -0
- package/Cache/Cache.js +7 -0
- package/Cache/Cache.js.map +1 -0
- package/Cache/CacheLoader.d.ts +8 -0
- package/Cache/CacheLoader.d.ts.map +1 -0
- package/Cache/CacheLoader.js +55 -0
- package/Cache/CacheLoader.js.map +1 -0
- package/Cache/Consumers/Cache.d.ts +18 -0
- package/Cache/Consumers/Cache.d.ts.map +1 -0
- package/Cache/Consumers/Cache.js +99 -0
- package/Cache/Consumers/Cache.js.map +1 -0
- package/Cache/Contracts/CacheInterface.d.ts +14 -0
- package/Cache/Contracts/CacheInterface.d.ts.map +1 -0
- package/Cache/Contracts/CacheInterface.js +3 -0
- package/Cache/Contracts/CacheInterface.js.map +1 -0
- package/Cache/Contracts/EngineInterface.d.ts +8 -0
- package/Cache/Contracts/EngineInterface.d.ts.map +1 -0
- package/Cache/Contracts/EngineInterface.js +3 -0
- package/Cache/Contracts/EngineInterface.js.map +1 -0
- package/Cache/Contracts/ServiceInterface.d.ts +8 -0
- package/Cache/Contracts/ServiceInterface.d.ts.map +1 -0
- package/Cache/Contracts/ServiceInterface.js +3 -0
- package/Cache/Contracts/ServiceInterface.js.map +1 -0
- package/Cache/Engines/DatabaseCache.d.ts +11 -0
- package/Cache/Engines/DatabaseCache.d.ts.map +1 -0
- package/Cache/Engines/DatabaseCache.js +40 -0
- package/Cache/Engines/DatabaseCache.js.map +1 -0
- package/Cache/Engines/FileCache.d.ts +22 -0
- package/Cache/Engines/FileCache.d.ts.map +1 -0
- package/Cache/Engines/FileCache.js +107 -0
- package/Cache/Engines/FileCache.js.map +1 -0
- package/Cache/Services/DatabaseCacheService.d.ts +13 -0
- package/Cache/Services/DatabaseCacheService.d.ts.map +1 -0
- package/Cache/Services/DatabaseCacheService.js +74 -0
- package/Cache/Services/DatabaseCacheService.js.map +1 -0
- package/Cache/Services/FileCacheService.d.ts +13 -0
- package/Cache/Services/FileCacheService.d.ts.map +1 -0
- package/Cache/Services/FileCacheService.js +60 -0
- package/Cache/Services/FileCacheService.js.map +1 -0
- package/Cache/Stores/DatabaseStore.d.ts +16 -0
- package/Cache/Stores/DatabaseStore.d.ts.map +1 -0
- package/Cache/Stores/DatabaseStore.js +208 -0
- package/Cache/Stores/DatabaseStore.js.map +1 -0
- package/Cache/Stores/FileStore.d.ts +16 -0
- package/Cache/Stores/FileStore.d.ts.map +1 -0
- package/Cache/Stores/FileStore.js +63 -0
- package/Cache/Stores/FileStore.js.map +1 -0
- package/Cache/Stores/MemoryStore.d.ts +13 -0
- package/Cache/Stores/MemoryStore.d.ts.map +1 -0
- package/Cache/Stores/MemoryStore.js +60 -0
- package/Cache/Stores/MemoryStore.js.map +1 -0
- package/Cache/index.d.ts +6 -0
- package/Cache/index.d.ts.map +1 -0
- package/Cache/index.js +18 -0
- package/Cache/index.js.map +1 -0
- package/Cache/types.d.ts +5 -0
- package/Cache/types.d.ts.map +1 -0
- package/Cache/types.js +3 -0
- package/Cache/types.js.map +1 -0
- package/Container/ClassResolver.d.ts +8 -8
- package/Container/ClassResolver.d.ts.map +1 -1
- package/Container/ClassResolver.js +89 -87
- package/Container/ClassResolver.js.map +1 -1
- package/Container/Container.d.ts +24 -24
- package/Container/Container.d.ts.map +1 -1
- package/Container/Container.js +118 -118
- package/Container/Container.js.map +1 -1
- package/Container/Contracts.d.ts +2 -2
- package/Container/Contracts.js +2 -2
- package/Container/Decorators.d.ts +4 -4
- package/Container/Decorators.js +21 -21
- package/Container/Metadata.d.ts +20 -20
- package/Container/Metadata.js +18 -18
- package/Container/Resolver.d.ts +18 -18
- package/Container/Resolver.js +15 -15
- package/Container/index.d.ts +5 -5
- package/Container/index.js +17 -17
- package/Database/Clauses/Where.js +1 -1
- package/Database/Connection.d.ts +20 -20
- package/Database/Connection.js +42 -42
- package/Database/Decorators.d.ts +36 -36
- package/Database/Decorators.js +116 -116
- package/Database/Drivers/DatabaseDriver.d.ts +28 -28
- package/Database/Drivers/DatabaseDriver.js +6 -6
- package/Database/Drivers/MySQL/Alter/index.d.ts +33 -33
- package/Database/Drivers/MySQL/Alter/index.js +61 -61
- package/Database/Drivers/MySQL/ColumnDefinition.d.ts +6 -6
- package/Database/Drivers/MySQL/ColumnDefinition.js +17 -17
- package/Database/Drivers/MySQL/Create.d.ts +9 -9
- package/Database/Drivers/MySQL/Create.js +37 -37
- package/Database/Drivers/MySQL/MysqlDriver.d.ts +41 -41
- package/Database/Drivers/MySQL/MysqlDriver.js +76 -76
- package/Database/Drivers/MySQL/Schema.d.ts +15 -15
- package/Database/Drivers/MySQL/Schema.js +65 -65
- package/Database/Drivers/MySQL/index.d.ts +1 -1
- package/Database/Drivers/MySQL/index.js +15 -15
- package/Database/Drivers/SQL/Schema.d.ts +6 -6
- package/Database/Drivers/SQL/Schema.js +57 -57
- package/Database/Drivers/SQL/Statements/Alter.d.ts +7 -7
- package/Database/Drivers/SQL/Statements/Alter.js +17 -17
- package/Database/Drivers/SQL/Statements/BaseStatement.d.ts +12 -12
- package/Database/Drivers/SQL/Statements/BaseStatement.js +46 -46
- package/Database/Drivers/SQL/Statements/Delete.d.ts +5 -5
- package/Database/Drivers/SQL/Statements/Delete.js +16 -16
- package/Database/Drivers/SQL/Statements/Insert.d.ts +6 -6
- package/Database/Drivers/SQL/Statements/Insert.js +23 -23
- package/Database/Drivers/SQL/Statements/Select.d.ts +7 -7
- package/Database/Drivers/SQL/Statements/Select.js +44 -44
- package/Database/Drivers/SQL/Statements/Update.d.ts +6 -6
- package/Database/Drivers/SQL/Statements/Update.js +27 -27
- package/Database/Drivers/SQL/index.d.ts +8 -8
- package/Database/Drivers/SQL/index.js +2 -2
- package/Database/Drivers/SQLite/Create.d.ts +9 -9
- package/Database/Drivers/SQLite/Create.js +36 -36
- package/Database/Drivers/SQLite/Schema.d.ts +15 -15
- package/Database/Drivers/SQLite/Schema.js +44 -44
- package/Database/Drivers/SQLite/SqliteDriver.d.ts +42 -42
- package/Database/Drivers/SQLite/SqliteDriver.d.ts.map +1 -1
- package/Database/Drivers/SQLite/SqliteDriver.js +102 -102
- package/Database/Drivers/SQLite/SqliteDriver.js.map +1 -1
- package/Database/Drivers/SQLite/index.d.ts +2 -2
- package/Database/Drivers/SQLite/index.js +26 -26
- package/Database/Drivers/SchemaContract.d.ts +8 -8
- package/Database/Drivers/SchemaContract.js +9 -9
- package/Database/Drivers/Statement.d.ts +9 -9
- package/Database/Drivers/Statement.js +15 -15
- package/Database/Drivers/index.d.ts +4 -4
- package/Database/Drivers/index.js +16 -16
- package/Database/Entity.d.ts +64 -64
- package/Database/Entity.d.ts.map +1 -1
- package/Database/Entity.js +252 -252
- package/Database/Entity.js.map +1 -1
- package/Database/EntityNotFoundError.d.ts +5 -5
- package/Database/EntityNotFoundError.js +10 -10
- package/Database/EntityProxyHandler.d.ts +5 -5
- package/Database/EntityProxyHandler.js +30 -30
- package/Database/EntityQuery.d.ts +28 -28
- package/Database/EntityQuery.js +156 -156
- package/Database/Expression.d.ts +3 -3
- package/Database/Expression.js +6 -6
- package/Database/Fields.d.ts +155 -155
- package/Database/Fields.js +548 -548
- package/Database/Helpers.d.ts +1 -1
- package/Database/Helpers.js +16 -16
- package/Database/List.d.ts +24 -24
- package/Database/List.d.ts.map +1 -1
- package/Database/List.js +49 -49
- package/Database/List.js.map +1 -1
- package/Database/Migrations/Migration.d.ts +7 -7
- package/Database/Migrations/Migration.js +9 -9
- package/Database/Migrations/MigrationHistory.d.ts +8 -8
- package/Database/Migrations/MigrationHistory.js +38 -38
- package/Database/Migrations/Migrator.d.ts +20 -20
- package/Database/Migrations/Migrator.js +118 -118
- package/Database/Migrations/index.d.ts +3 -3
- package/Database/Migrations/index.js +15 -15
- package/Database/ORM/BaseRelationship.d.ts +7 -7
- package/Database/ORM/BaseRelationship.js +10 -10
- package/Database/Query.d.ts +62 -62
- package/Database/Query.d.ts.map +1 -1
- package/Database/Query.js +265 -264
- package/Database/Query.js.map +1 -1
- package/Database/Seeders/Seeder.d.ts +3 -3
- package/Database/Seeders/Seeder.js +6 -6
- package/Database/Seeders/SeederManager.d.ts +8 -8
- package/Database/Seeders/SeederManager.js +24 -24
- package/Database/Seeders/index.d.ts +2 -2
- package/Database/Seeders/index.js +14 -14
- package/Database/StringExpression.d.ts +6 -6
- package/Database/StringExpression.js +14 -14
- package/Database/Types.d.ts +117 -117
- package/Database/Types.d.ts.map +1 -1
- package/Database/Types.js +94 -94
- package/Database/Types.js.map +1 -1
- package/Database/index.d.ts +20 -20
- package/Database/index.js +20 -20
- package/Encryption/index.d.ts +15 -15
- package/Encryption/index.js +53 -53
- package/Forms/Decorators.d.ts +6 -6
- package/Forms/Decorators.js +28 -28
- package/Forms/Form.d.ts +17 -17
- package/Forms/Form.js +69 -69
- package/Forms/FormFields.d.ts +9 -9
- package/Forms/FormFields.js +35 -35
- package/Forms/index.d.ts +3 -3
- package/Forms/index.js +15 -15
- package/Framework/App.d.ts +6 -6
- package/Framework/App.js +9 -9
- package/Framework/Application.d.ts +17 -17
- package/Framework/Application.d.ts.map +1 -1
- package/Framework/Application.js +94 -93
- package/Framework/Application.js.map +1 -1
- package/Framework/Auth/Auth.d.ts +24 -24
- package/Framework/Auth/Auth.js +108 -108
- package/Framework/Auth/Authenticatable.d.ts +6 -6
- package/Framework/Auth/Authenticatable.js +2 -2
- package/Framework/Auth/User.d.ts +10 -10
- package/Framework/Auth/User.js +37 -37
- package/Framework/Auth/index.d.ts +5 -5
- package/Framework/Auth/index.d.ts.map +1 -1
- package/Framework/Auth/index.js +45 -45
- package/Framework/Auth/index.js.map +1 -1
- package/Framework/Config/AppConfig.d.ts +18 -18
- package/Framework/Config/AppConfig.js +11 -11
- package/Framework/Config/AuthConfig.d.ts +8 -8
- package/Framework/Config/AuthConfig.js +7 -7
- package/Framework/Config/BaseConfig.d.ts +6 -6
- package/Framework/Config/BaseConfig.js +12 -12
- package/Framework/Config/CacheConfig.d.ts +16 -0
- package/Framework/Config/CacheConfig.d.ts.map +1 -0
- package/Framework/Config/CacheConfig.js +23 -0
- package/Framework/Config/CacheConfig.js.map +1 -0
- package/Framework/Config/DatabaseConfig.d.ts +10 -10
- package/Framework/Config/DatabaseConfig.js +25 -25
- package/Framework/Config/index.d.ts +5 -4
- package/Framework/Config/index.d.ts.map +1 -1
- package/Framework/Config/index.js +17 -16
- package/Framework/Config/index.js.map +1 -1
- package/Framework/Middleware/AuthMiddleware.d.ts +7 -7
- package/Framework/Middleware/AuthMiddleware.js +63 -63
- package/Framework/Middleware/CorsMiddleware.d.ts +6 -6
- package/Framework/Middleware/CorsMiddleware.js +43 -43
- package/Framework/Middleware/StaticAssetsMiddleware.d.ts +14 -14
- package/Framework/Middleware/StaticAssetsMiddleware.js +104 -104
- package/Framework/Middleware/index.d.ts +2 -2
- package/Framework/Middleware/index.js +14 -14
- package/Framework/Provider.d.ts +5 -5
- package/Framework/Provider.js +20 -20
- package/Framework/Providers/CacheProvider.d.ts +7 -0
- package/Framework/Providers/CacheProvider.d.ts.map +1 -0
- package/Framework/Providers/CacheProvider.js +39 -0
- package/Framework/Providers/CacheProvider.js.map +1 -0
- package/Framework/Providers/DatabaseProvider.d.ts +9 -9
- package/Framework/Providers/DatabaseProvider.js +63 -63
- package/Framework/Providers/WebsocketsProvider.d.ts +12 -12
- package/Framework/Providers/WebsocketsProvider.js +122 -122
- package/Framework/Resolvers/AuthResolver.d.ts +5 -5
- package/Framework/Resolvers/AuthResolver.js +14 -14
- package/Framework/Resolvers/EntityResolver.d.ts +9 -9
- package/Framework/Resolvers/EntityResolver.js +40 -40
- package/Framework/Resolvers/FormResolver.d.ts +9 -9
- package/Framework/Resolvers/FormResolver.js +32 -32
- package/Framework/RootDir.d.ts +2 -2
- package/Framework/RootDir.js +6 -6
- package/Framework/index.d.ts +7 -6
- package/Framework/index.d.ts.map +1 -1
- package/Framework/index.js +19 -18
- package/Framework/index.js.map +1 -1
- package/Models/Model.d.ts +9 -9
- package/Models/Model.js +35 -35
- package/Models/index.d.ts +21 -21
- package/Models/index.d.ts.map +1 -1
- package/Models/index.js +58 -58
- package/Models/index.js.map +1 -1
- package/Router/BaseController.d.ts +4 -4
- package/Router/BaseController.js +20 -20
- package/Router/Decorators.d.ts +21 -21
- package/Router/Decorators.js +170 -170
- package/Router/Guard.d.ts +4 -4
- package/Router/Guard.js +10 -10
- package/Router/Http/Contracts.d.ts +3 -3
- package/Router/Http/Contracts.js +2 -2
- package/Router/Http/ErrorHandler.d.ts +9 -9
- package/Router/Http/ErrorHandler.js +51 -51
- package/Router/Http/ErrorHandlerInterface.d.ts +5 -5
- package/Router/Http/ErrorHandlerInterface.js +6 -6
- package/Router/Http/Errors/HttpError.d.ts +7 -7
- package/Router/Http/Errors/HttpError.js +15 -15
- package/Router/Http/Handler.d.ts +15 -15
- package/Router/Http/Handler.js +131 -131
- package/Router/Http/Request.d.ts +22 -22
- package/Router/Http/Request.js +151 -151
- package/Router/Http/Response.d.ts +17 -17
- package/Router/Http/Response.js +51 -51
- package/Router/Http/index.d.ts +83 -83
- package/Router/Http/index.js +99 -99
- package/Router/Metadata.d.ts +31 -31
- package/Router/Metadata.js +25 -25
- package/Router/Middleware.d.ts +5 -5
- package/Router/Middleware.js +2 -2
- package/Router/Route.d.ts +23 -23
- package/Router/Route.js +110 -110
- package/Router/RouteNotFoundError.d.ts +3 -3
- package/Router/RouteNotFoundError.js +9 -9
- package/Router/Router.d.ts +12 -12
- package/Router/Router.js +32 -32
- package/Router/Websockets/Handler.d.ts +12 -12
- package/Router/Websockets/Handler.js +59 -59
- package/Router/Websockets/WebsocketEvent.d.ts +15 -15
- package/Router/Websockets/WebsocketEvent.js +53 -53
- package/Router/Websockets/index.d.ts +16 -16
- package/Router/Websockets/index.d.ts.map +1 -1
- package/Router/Websockets/index.js +57 -57
- package/Router/Websockets/index.js.map +1 -1
- package/Router/Websockets/types.d.ts +20 -20
- package/Router/Websockets/types.js +8 -8
- package/Router/index.d.ts +6 -6
- package/Router/index.js +18 -18
- package/Storage/File.d.ts +11 -11
- package/Storage/File.js +46 -46
- package/Storage/Image.d.ts +3 -3
- package/Storage/Image.js +7 -7
- package/Storage/InvalidImage.d.ts +3 -3
- package/Storage/InvalidImage.js +7 -7
- package/Storage/Storage.d.ts +13 -12
- package/Storage/Storage.d.ts.map +1 -1
- package/Storage/Storage.js +104 -110
- package/Storage/Storage.js.map +1 -1
- package/Storage/index.d.ts +4 -4
- package/Storage/index.js +16 -16
- package/Storage/utils.d.ts +5 -5
- package/Storage/utils.js +20 -20
- package/Support/Array.d.ts +28 -28
- package/Support/Array.d.ts.map +1 -1
- package/Support/Array.js +108 -108
- package/Support/Array.js.map +1 -1
- package/Support/Math.d.ts +6 -6
- package/Support/Math.js +7 -7
- package/Support/Metadata.d.ts +14 -14
- package/Support/Metadata.js +20 -20
- package/Support/String.d.ts +11 -11
- package/Support/String.js +23 -23
- package/Support/index.d.ts +14 -13
- package/Support/index.d.ts.map +1 -1
- package/Support/index.js +6 -5
- package/Support/index.js.map +1 -1
- package/Support/utils.d.ts +2 -0
- package/Support/utils.d.ts.map +1 -0
- package/Support/utils.js +13 -0
- package/Support/utils.js.map +1 -0
- package/Testing/TestCase.d.ts +32 -32
- package/Testing/TestCase.js +130 -130
- package/Validation/Rule.d.ts +6 -6
- package/Validation/Rule.js +6 -6
- package/Validation/RuleInterface.d.ts +6 -6
- package/Validation/RuleInterface.js +2 -2
- package/Validation/Rules/Email.d.ts +3 -3
- package/Validation/Rules/Email.js +20 -20
- package/Validation/Rules/FileExtension.d.ts +3 -3
- package/Validation/Rules/FileExtension.js +22 -22
- package/Validation/Rules/MaxLength.d.ts +3 -3
- package/Validation/Rules/MaxLength.js +19 -19
- package/Validation/Rules/MinLength.d.ts +3 -3
- package/Validation/Rules/MinLength.js +19 -19
- package/Validation/Rules/Optional.d.ts +3 -3
- package/Validation/Rules/Optional.js +19 -19
- package/Validation/Rules/Required.d.ts +3 -3
- package/Validation/Rules/Required.js +26 -26
- package/Validation/Validator.d.ts +11 -11
- package/Validation/Validator.js +10 -10
- package/Validation/index.d.ts +9 -9
- package/Validation/index.js +21 -21
- package/package.json +9 -5
- package/tests/Cache/DatabaseStoreTest.d.ts +2 -0
- package/tests/Cache/DatabaseStoreTest.d.ts.map +1 -0
- package/tests/Cache/DatabaseStoreTest.js +138 -0
- package/tests/Cache/DatabaseStoreTest.js.map +1 -0
- package/tests/Cache/FileStoreTest.d.ts +2 -0
- package/tests/Cache/FileStoreTest.d.ts.map +1 -0
- package/tests/Cache/FileStoreTest.js +142 -0
- package/tests/Cache/FileStoreTest.js.map +1 -0
- package/tests/Cache/MemoryStoreTest.d.ts +2 -0
- package/tests/Cache/MemoryStoreTest.d.ts.map +1 -0
- package/tests/Cache/MemoryStoreTest.js +141 -0
- package/tests/Cache/MemoryStoreTest.js.map +1 -0
- package/tests/Container/ContainerTest.d.ts +1 -1
- package/tests/Container/ContainerTest.js +395 -395
- package/tests/Database/Drivers/MySQL/AlterTest.d.ts +1 -1
- package/tests/Database/Drivers/MySQL/AlterTest.js +135 -135
- package/tests/Database/Drivers/MySQL/CreateTest.d.ts +1 -1
- package/tests/Database/Drivers/MySQL/CreateTest.js +57 -57
- package/tests/Database/Drivers/MysqlDriverTest.d.ts +1 -1
- package/tests/Database/Drivers/MysqlDriverTest.js +149 -149
- package/tests/Database/Drivers/SqliteDriverTest.d.ts +1 -1
- package/tests/Database/Drivers/SqliteDriverTest.js +135 -135
- package/tests/Database/Entities/Article.d.ts +10 -10
- package/tests/Database/Entities/Article.js +42 -42
- package/tests/Database/Entities/Profile.d.ts +10 -10
- package/tests/Database/Entities/Profile.js +38 -38
- package/tests/Database/Entities/Role.d.ts +8 -8
- package/tests/Database/Entities/Role.js +30 -30
- package/tests/Database/Entities/User.d.ts +15 -15
- package/tests/Database/Entities/User.js +57 -57
- package/tests/Database/EntityRelationshipsTest.d.ts +1 -1
- package/tests/Database/EntityRelationshipsTest.js +552 -552
- package/tests/Database/EntityTest.d.ts +1 -1
- package/tests/Database/EntityTest.js +233 -233
- package/tests/Database/Migrations/RunnerTest.d.ts +1 -1
- package/tests/Database/Migrations/RunnerTest.js +111 -111
- package/tests/Database/Migrations/migrations/1.createUserTable.d.ts +5 -5
- package/tests/Database/Migrations/migrations/1.createUserTable.js +13 -13
- package/tests/Database/Migrations/migrations/2.createArticlesTable.d.ts +5 -5
- package/tests/Database/Migrations/migrations/2.createArticlesTable.js +13 -13
- package/tests/Database/QueryTest.d.ts +1 -1
- package/tests/Database/QueryTest.js +622 -622
- package/tests/Database/SchemaTest.d.ts +1 -1
- package/tests/Database/SchemaTest.js +45 -45
- package/tests/Database/Seeders/RunnerTest.d.ts +1 -1
- package/tests/Database/Seeders/RunnerTest.js +43 -43
- package/tests/Database/Seeders/seeders/RandomSeeder.d.ts +4 -4
- package/tests/Database/Seeders/seeders/RandomSeeder.js +13 -13
- package/tests/Database/utils.d.ts +5 -5
- package/tests/Database/utils.js +18 -18
- package/tests/Forms/FormsTest.d.ts +1 -1
- package/tests/Forms/FormsTest.js +79 -79
- package/tests/Framework/Middleware/StaticAssetsMiddlewareTest.d.ts +1 -1
- package/tests/Framework/Middleware/StaticAssetsMiddlewareTest.js +165 -165
- package/tests/Framework/Resolvers/EntityResolverTest.d.ts +1 -1
- package/tests/Framework/Resolvers/EntityResolverTest.js +59 -59
- package/tests/Model/ModelTest.d.ts +1 -1
- package/tests/Model/ModelTest.js +233 -233
- package/tests/Router/HttpHandlerTest.d.ts +1 -1
- package/tests/Router/HttpHandlerTest.js +36 -36
- package/tests/Router/WebSocketsHandlerTest.d.ts +1 -1
- package/tests/Router/WebSocketsHandlerTest.js +35 -35
- package/tests/Support/ArrayTest.d.ts +1 -1
- package/tests/Support/ArrayTest.js +258 -258
- package/tests/Support/StringTest.d.ts +1 -1
- package/tests/Support/StringTest.js +38 -38
- package/tests/Validation/RulesTest.d.ts +1 -1
- package/tests/Validation/RulesTest.js +67 -67
- package/Database/Drivers/SQL/Statements/Create.d.ts +0 -7
- package/Database/Drivers/SQL/Statements/Create.d.ts.map +0 -1
- package/Database/Drivers/SQL/Statements/Create.js +0 -22
- package/Database/Drivers/SQL/Statements/Create.js.map +0 -1
- package/LICENSE.md +0 -21
- package/Readme.md +0 -123
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityProxyHandler = void 0;
|
|
4
|
-
const EntityQuery_1 = require("./EntityQuery");
|
|
5
|
-
class EntityProxyHandler {
|
|
6
|
-
set(target, property, value) {
|
|
7
|
-
target[property] = value;
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
get(target, property) {
|
|
11
|
-
if (!(property in target)) {
|
|
12
|
-
const targetConstructor = target.constructor;
|
|
13
|
-
const query = new EntityQuery_1.EntityQuery(targetConstructor);
|
|
14
|
-
const queryProperty = query[property];
|
|
15
|
-
if (typeof queryProperty === 'function') {
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
query.table(target.constructor.getTable());
|
|
18
|
-
return (...args) => {
|
|
19
|
-
return queryProperty.apply(query, args);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return target[property];
|
|
24
|
-
// if (typeof value === 'function') {
|
|
25
|
-
// return value.bind(target);
|
|
26
|
-
// }
|
|
27
|
-
// return value;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.EntityProxyHandler = EntityProxyHandler;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityProxyHandler = void 0;
|
|
4
|
+
const EntityQuery_1 = require("./EntityQuery");
|
|
5
|
+
class EntityProxyHandler {
|
|
6
|
+
set(target, property, value) {
|
|
7
|
+
target[property] = value;
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
get(target, property) {
|
|
11
|
+
if (!(property in target)) {
|
|
12
|
+
const targetConstructor = target.constructor;
|
|
13
|
+
const query = new EntityQuery_1.EntityQuery(targetConstructor);
|
|
14
|
+
const queryProperty = query[property];
|
|
15
|
+
if (typeof queryProperty === 'function') {
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
query.table(target.constructor.getTable());
|
|
18
|
+
return (...args) => {
|
|
19
|
+
return queryProperty.apply(query, args);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return target[property];
|
|
24
|
+
// if (typeof value === 'function') {
|
|
25
|
+
// return value.bind(target);
|
|
26
|
+
// }
|
|
27
|
+
// return value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.EntityProxyHandler = EntityProxyHandler;
|
|
31
31
|
//# sourceMappingURL=EntityProxyHandler.js.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { Query } from './Query';
|
|
2
|
-
import { Entity } from './Entity';
|
|
3
|
-
import { DotNotationProperties, EntityConstructor, EntityObject, StringExpression } from './index';
|
|
4
|
-
import { KeysOfType } from '@Typetron/Support';
|
|
5
|
-
import { BelongsTo, BelongsToMany, HasMany, HasOne } from './Fields';
|
|
6
|
-
import { List } from './List';
|
|
7
|
-
import { RelationsTreeQuery } from './Types';
|
|
8
|
-
export declare class EntityQuery<T extends Entity> extends Query<T> {
|
|
9
|
-
entity: EntityConstructor<T>;
|
|
10
|
-
eagerLoad: (string | [string, RelationsTreeQuery])[];
|
|
11
|
-
eagerLoadCount: (string | [string, RelationsTreeQuery])[];
|
|
12
|
-
constructor(entity: EntityConstructor<T>);
|
|
13
|
-
get<K extends keyof T>(...columns: (K | string | StringExpression)[]): Promise<T[]>;
|
|
14
|
-
eagerLoadRelationships(entities: T[]): Promise<T[]>;
|
|
15
|
-
eagerLoadRelationshipsCounts(entities: T[]): Promise<T[]>;
|
|
16
|
-
first<K extends keyof T>(...columns: (K | string | StringExpression)[]): Promise<T | undefined>;
|
|
17
|
-
firstOrNew<K extends keyof T>(properties: Partial<EntityObject<T> | Record<string, any>>, values?: Partial<EntityObject<T>>): Promise<T>;
|
|
18
|
-
with(...relations: (KeysOfType<T, BelongsTo<any> | HasOne<any> | HasMany<any> | BelongsToMany<any>> | DotNotationProperties<this> | [
|
|
19
|
-
KeysOfType<T, BelongsTo<any> | HasOne<any> | HasMany<any> | BelongsToMany<any>> | DotNotationProperties<this>,
|
|
20
|
-
RelationsTreeQuery
|
|
21
|
-
])[]): this;
|
|
22
|
-
withCount<K extends KeysOfType<T, List<Entity>>>(...relations: (KeysOfType<T, BelongsTo<any> | HasOne<any> | HasMany<any> | BelongsToMany<any>> | DotNotationProperties<this> | [
|
|
23
|
-
KeysOfType<T, BelongsTo<any> | HasOne<any> | HasMany<any> | BelongsToMany<any>> | DotNotationProperties<this>,
|
|
24
|
-
RelationsTreeQuery
|
|
25
|
-
])[]): this;
|
|
26
|
-
private tree;
|
|
27
|
-
private treeBack;
|
|
28
|
-
}
|
|
1
|
+
import { Query } from './Query';
|
|
2
|
+
import { Entity } from './Entity';
|
|
3
|
+
import { DotNotationProperties, EntityConstructor, EntityObject, StringExpression } from './index';
|
|
4
|
+
import { KeysOfType } from '@Typetron/Support';
|
|
5
|
+
import { BelongsTo, BelongsToMany, HasMany, HasOne } from './Fields';
|
|
6
|
+
import { List } from './List';
|
|
7
|
+
import { RelationsTreeQuery } from './Types';
|
|
8
|
+
export declare class EntityQuery<T extends Entity> extends Query<T> {
|
|
9
|
+
entity: EntityConstructor<T>;
|
|
10
|
+
eagerLoad: (string | [string, RelationsTreeQuery])[];
|
|
11
|
+
eagerLoadCount: (string | [string, RelationsTreeQuery])[];
|
|
12
|
+
constructor(entity: EntityConstructor<T>);
|
|
13
|
+
get<K extends keyof T>(...columns: (K | string | StringExpression)[]): Promise<T[]>;
|
|
14
|
+
eagerLoadRelationships(entities: T[]): Promise<T[]>;
|
|
15
|
+
eagerLoadRelationshipsCounts(entities: T[]): Promise<T[]>;
|
|
16
|
+
first<K extends keyof T>(...columns: (K | string | StringExpression)[]): Promise<T | undefined>;
|
|
17
|
+
firstOrNew<K extends keyof T>(properties: Partial<EntityObject<T> | Record<string, any>>, values?: Partial<EntityObject<T>>): Promise<T>;
|
|
18
|
+
with(...relations: (KeysOfType<T, BelongsTo<any> | HasOne<any> | HasMany<any> | BelongsToMany<any>> | DotNotationProperties<this> | [
|
|
19
|
+
KeysOfType<T, BelongsTo<any> | HasOne<any> | HasMany<any> | BelongsToMany<any>> | DotNotationProperties<this>,
|
|
20
|
+
RelationsTreeQuery
|
|
21
|
+
])[]): this;
|
|
22
|
+
withCount<K extends KeysOfType<T, List<Entity>>>(...relations: (KeysOfType<T, BelongsTo<any> | HasOne<any> | HasMany<any> | BelongsToMany<any>> | DotNotationProperties<this> | [
|
|
23
|
+
KeysOfType<T, BelongsTo<any> | HasOne<any> | HasMany<any> | BelongsToMany<any>> | DotNotationProperties<this>,
|
|
24
|
+
RelationsTreeQuery
|
|
25
|
+
])[]): this;
|
|
26
|
+
private tree;
|
|
27
|
+
private treeBack;
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=EntityQuery.d.ts.map
|
package/Database/EntityQuery.js
CHANGED
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityQuery = void 0;
|
|
4
|
-
const Query_1 = require("./Query");
|
|
5
|
-
const Entity_1 = require("./Entity");
|
|
6
|
-
class EntityQuery extends Query_1.Query {
|
|
7
|
-
constructor(entity) {
|
|
8
|
-
super();
|
|
9
|
-
this.entity = entity;
|
|
10
|
-
// tslint:disable-next-line:no-any
|
|
11
|
-
this.eagerLoad = [];
|
|
12
|
-
// tslint:disable-next-line:no-any
|
|
13
|
-
this.eagerLoadCount = [];
|
|
14
|
-
}
|
|
15
|
-
async get(...columns) {
|
|
16
|
-
let entities = await super.get(...columns);
|
|
17
|
-
entities = this.entity.hydrate(this.entity, entities, true);
|
|
18
|
-
entities = await this.eagerLoadRelationships(entities);
|
|
19
|
-
return await this.eagerLoadRelationshipsCounts(entities);
|
|
20
|
-
}
|
|
21
|
-
async eagerLoadRelationships(entities) {
|
|
22
|
-
const relationsTree = this.tree(this.eagerLoad);
|
|
23
|
-
await Object.keys(relationsTree).forEachAsync(async (relationName) => {
|
|
24
|
-
const relationValue = relationsTree[relationName];
|
|
25
|
-
const relation = this.entity.metadata.allRelationships[relationName];
|
|
26
|
-
if (!relation) {
|
|
27
|
-
throw new Error(`Relation '${relationName}' doesn't not exist on entity '${this.entity.name}'`);
|
|
28
|
-
}
|
|
29
|
-
// tslint:disable-next-line:no-any
|
|
30
|
-
let fieldQueryFunction;
|
|
31
|
-
let otherRelations = [];
|
|
32
|
-
if (relationValue instanceof Function) {
|
|
33
|
-
fieldQueryFunction = relationValue;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
otherRelations = this.treeBack(relationValue);
|
|
37
|
-
}
|
|
38
|
-
const results = await relation.getRelatedValue(entities, otherRelations, fieldQueryFunction);
|
|
39
|
-
if (results.length) {
|
|
40
|
-
entities = relation.match(entities, results);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
// await this.eagerLoad.forEachAsync(async (field) => {
|
|
44
|
-
// // tslint:disable-next-line:no-any
|
|
45
|
-
// let fieldName: string, fieldQueryFunction: undefined | RelationsTreeQuery
|
|
46
|
-
// if (field instanceof Array) {
|
|
47
|
-
// fieldName = field[0]
|
|
48
|
-
// fieldQueryFunction = field[1]
|
|
49
|
-
// } else {
|
|
50
|
-
// fieldName = field
|
|
51
|
-
// }
|
|
52
|
-
// const [first, ...rest] = fieldName.split('.')
|
|
53
|
-
// const relation = this.entity.metadata.allRelationships[first]
|
|
54
|
-
// const results = await relation.getRelatedValue(entities, [rest.join('.')], fieldQueryFunction as (query: Query) => void)
|
|
55
|
-
// if (results.length) {
|
|
56
|
-
// entities = relation.match(entities, results) as T[]
|
|
57
|
-
// }
|
|
58
|
-
// })
|
|
59
|
-
return entities;
|
|
60
|
-
}
|
|
61
|
-
async eagerLoadRelationshipsCounts(entities) {
|
|
62
|
-
await this.eagerLoadCount.forEachAsync(async (field) => {
|
|
63
|
-
// tslint:disable-next-line:no-any
|
|
64
|
-
let fieldName, fieldQueryFunction;
|
|
65
|
-
if (field instanceof Array) {
|
|
66
|
-
fieldName = field[0];
|
|
67
|
-
fieldQueryFunction = field[1];
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
fieldName = field;
|
|
71
|
-
}
|
|
72
|
-
const relation = this.entity.metadata.allRelationships[fieldName];
|
|
73
|
-
const results = await relation.getRelatedCount(entities, fieldQueryFunction);
|
|
74
|
-
if (results.length) {
|
|
75
|
-
entities = relation.matchCounts(entities, results);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
return entities;
|
|
79
|
-
}
|
|
80
|
-
async first(...columns) {
|
|
81
|
-
const entityData = await super.first(...columns);
|
|
82
|
-
if (!entityData) {
|
|
83
|
-
return undefined;
|
|
84
|
-
}
|
|
85
|
-
let entity = this.entity.new(entityData, true);
|
|
86
|
-
entity = (await this.eagerLoadRelationships([entity])).first();
|
|
87
|
-
return (await this.eagerLoadRelationshipsCounts([entity])).first();
|
|
88
|
-
}
|
|
89
|
-
async firstOrNew(
|
|
90
|
-
// tslint:disable-next-line:no-any
|
|
91
|
-
properties, values) {
|
|
92
|
-
Object.entries(properties).forEach(([property, value]) => {
|
|
93
|
-
const field = this.entity.metadata.columns[property] || this.entity.metadata.relationships[property];
|
|
94
|
-
const finalValue = value instanceof Entity_1.Entity ? value[value.getPrimaryKey()] : value;
|
|
95
|
-
if (finalValue === undefined) {
|
|
96
|
-
this.andWhereNull(field.column);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
this.andWhere(field.column, finalValue);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
const instance = await this.first();
|
|
103
|
-
if (!instance) {
|
|
104
|
-
return this.entity.new({ ...properties, ...values });
|
|
105
|
-
}
|
|
106
|
-
instance.exists = true;
|
|
107
|
-
return instance;
|
|
108
|
-
}
|
|
109
|
-
with(...relations) {
|
|
110
|
-
relations = relations.filter(Boolean);
|
|
111
|
-
if (relations.length) {
|
|
112
|
-
// tslint:disable-next-line:no-any
|
|
113
|
-
this.eagerLoad = this.eagerLoad.concat(relations).unique();
|
|
114
|
-
}
|
|
115
|
-
return this;
|
|
116
|
-
}
|
|
117
|
-
withCount(...relations) {
|
|
118
|
-
// @ts-ignore
|
|
119
|
-
this.eagerLoadCount = this.eagerLoadCount.concat(relations);
|
|
120
|
-
return this;
|
|
121
|
-
}
|
|
122
|
-
tree(relations) {
|
|
123
|
-
const tree = {};
|
|
124
|
-
relations.forEach(relation => {
|
|
125
|
-
let relationName;
|
|
126
|
-
let relationValue = {};
|
|
127
|
-
if (relation instanceof Array) {
|
|
128
|
-
relationName = relation[0];
|
|
129
|
-
relationValue = relation[1];
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
relationName = relation;
|
|
133
|
-
}
|
|
134
|
-
let container = tree;
|
|
135
|
-
const relationStringParts = relationName.split('.');
|
|
136
|
-
relationStringParts.forEach((part, index) => {
|
|
137
|
-
const value = index === relationStringParts.length - 1 ? relationValue : {};
|
|
138
|
-
// @ts-ignore
|
|
139
|
-
container = (container[part] ? container[part] : container[part] = value);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
return tree;
|
|
143
|
-
}
|
|
144
|
-
treeBack(relationsTree) {
|
|
145
|
-
return Object.keys(relationsTree).map(relationName => {
|
|
146
|
-
const item = relationsTree[relationName];
|
|
147
|
-
if (item instanceof Function) {
|
|
148
|
-
return [relationName, item];
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
return [relationName, this.treeBack(item)].filter(Boolean).join('.');
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
exports.EntityQuery = EntityQuery;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityQuery = void 0;
|
|
4
|
+
const Query_1 = require("./Query");
|
|
5
|
+
const Entity_1 = require("./Entity");
|
|
6
|
+
class EntityQuery extends Query_1.Query {
|
|
7
|
+
constructor(entity) {
|
|
8
|
+
super();
|
|
9
|
+
this.entity = entity;
|
|
10
|
+
// tslint:disable-next-line:no-any
|
|
11
|
+
this.eagerLoad = [];
|
|
12
|
+
// tslint:disable-next-line:no-any
|
|
13
|
+
this.eagerLoadCount = [];
|
|
14
|
+
}
|
|
15
|
+
async get(...columns) {
|
|
16
|
+
let entities = await super.get(...columns);
|
|
17
|
+
entities = this.entity.hydrate(this.entity, entities, true);
|
|
18
|
+
entities = await this.eagerLoadRelationships(entities);
|
|
19
|
+
return await this.eagerLoadRelationshipsCounts(entities);
|
|
20
|
+
}
|
|
21
|
+
async eagerLoadRelationships(entities) {
|
|
22
|
+
const relationsTree = this.tree(this.eagerLoad);
|
|
23
|
+
await Object.keys(relationsTree).forEachAsync(async (relationName) => {
|
|
24
|
+
const relationValue = relationsTree[relationName];
|
|
25
|
+
const relation = this.entity.metadata.allRelationships[relationName];
|
|
26
|
+
if (!relation) {
|
|
27
|
+
throw new Error(`Relation '${relationName}' doesn't not exist on entity '${this.entity.name}'`);
|
|
28
|
+
}
|
|
29
|
+
// tslint:disable-next-line:no-any
|
|
30
|
+
let fieldQueryFunction;
|
|
31
|
+
let otherRelations = [];
|
|
32
|
+
if (relationValue instanceof Function) {
|
|
33
|
+
fieldQueryFunction = relationValue;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
otherRelations = this.treeBack(relationValue);
|
|
37
|
+
}
|
|
38
|
+
const results = await relation.getRelatedValue(entities, otherRelations, fieldQueryFunction);
|
|
39
|
+
if (results.length) {
|
|
40
|
+
entities = relation.match(entities, results);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
// await this.eagerLoad.forEachAsync(async (field) => {
|
|
44
|
+
// // tslint:disable-next-line:no-any
|
|
45
|
+
// let fieldName: string, fieldQueryFunction: undefined | RelationsTreeQuery
|
|
46
|
+
// if (field instanceof Array) {
|
|
47
|
+
// fieldName = field[0]
|
|
48
|
+
// fieldQueryFunction = field[1]
|
|
49
|
+
// } else {
|
|
50
|
+
// fieldName = field
|
|
51
|
+
// }
|
|
52
|
+
// const [first, ...rest] = fieldName.split('.')
|
|
53
|
+
// const relation = this.entity.metadata.allRelationships[first]
|
|
54
|
+
// const results = await relation.getRelatedValue(entities, [rest.join('.')], fieldQueryFunction as (query: Query) => void)
|
|
55
|
+
// if (results.length) {
|
|
56
|
+
// entities = relation.match(entities, results) as T[]
|
|
57
|
+
// }
|
|
58
|
+
// })
|
|
59
|
+
return entities;
|
|
60
|
+
}
|
|
61
|
+
async eagerLoadRelationshipsCounts(entities) {
|
|
62
|
+
await this.eagerLoadCount.forEachAsync(async (field) => {
|
|
63
|
+
// tslint:disable-next-line:no-any
|
|
64
|
+
let fieldName, fieldQueryFunction;
|
|
65
|
+
if (field instanceof Array) {
|
|
66
|
+
fieldName = field[0];
|
|
67
|
+
fieldQueryFunction = field[1];
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
fieldName = field;
|
|
71
|
+
}
|
|
72
|
+
const relation = this.entity.metadata.allRelationships[fieldName];
|
|
73
|
+
const results = await relation.getRelatedCount(entities, fieldQueryFunction);
|
|
74
|
+
if (results.length) {
|
|
75
|
+
entities = relation.matchCounts(entities, results);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return entities;
|
|
79
|
+
}
|
|
80
|
+
async first(...columns) {
|
|
81
|
+
const entityData = await super.first(...columns);
|
|
82
|
+
if (!entityData) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
let entity = this.entity.new(entityData, true);
|
|
86
|
+
entity = (await this.eagerLoadRelationships([entity])).first();
|
|
87
|
+
return (await this.eagerLoadRelationshipsCounts([entity])).first();
|
|
88
|
+
}
|
|
89
|
+
async firstOrNew(
|
|
90
|
+
// tslint:disable-next-line:no-any
|
|
91
|
+
properties, values) {
|
|
92
|
+
Object.entries(properties).forEach(([property, value]) => {
|
|
93
|
+
const field = this.entity.metadata.columns[property] || this.entity.metadata.relationships[property];
|
|
94
|
+
const finalValue = value instanceof Entity_1.Entity ? value[value.getPrimaryKey()] : value;
|
|
95
|
+
if (finalValue === undefined) {
|
|
96
|
+
this.andWhereNull(field.column);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
this.andWhere(field.column, finalValue);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const instance = await this.first();
|
|
103
|
+
if (!instance) {
|
|
104
|
+
return this.entity.new({ ...properties, ...values });
|
|
105
|
+
}
|
|
106
|
+
instance.exists = true;
|
|
107
|
+
return instance;
|
|
108
|
+
}
|
|
109
|
+
with(...relations) {
|
|
110
|
+
relations = relations.filter(Boolean);
|
|
111
|
+
if (relations.length) {
|
|
112
|
+
// tslint:disable-next-line:no-any
|
|
113
|
+
this.eagerLoad = this.eagerLoad.concat(relations).unique();
|
|
114
|
+
}
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
withCount(...relations) {
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
this.eagerLoadCount = this.eagerLoadCount.concat(relations);
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
tree(relations) {
|
|
123
|
+
const tree = {};
|
|
124
|
+
relations.forEach(relation => {
|
|
125
|
+
let relationName;
|
|
126
|
+
let relationValue = {};
|
|
127
|
+
if (relation instanceof Array) {
|
|
128
|
+
relationName = relation[0];
|
|
129
|
+
relationValue = relation[1];
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
relationName = relation;
|
|
133
|
+
}
|
|
134
|
+
let container = tree;
|
|
135
|
+
const relationStringParts = relationName.split('.');
|
|
136
|
+
relationStringParts.forEach((part, index) => {
|
|
137
|
+
const value = index === relationStringParts.length - 1 ? relationValue : {};
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
container = (container[part] ? container[part] : container[part] = value);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
return tree;
|
|
143
|
+
}
|
|
144
|
+
treeBack(relationsTree) {
|
|
145
|
+
return Object.keys(relationsTree).map(relationName => {
|
|
146
|
+
const item = relationsTree[relationName];
|
|
147
|
+
if (item instanceof Function) {
|
|
148
|
+
return [relationName, item];
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
return [relationName, this.treeBack(item)].filter(Boolean).join('.');
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.EntityQuery = EntityQuery;
|
|
157
157
|
//# sourceMappingURL=EntityQuery.js.map
|
package/Database/Expression.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare abstract class Expression {
|
|
2
|
-
abstract toSQL(): string;
|
|
3
|
-
}
|
|
1
|
+
export declare abstract class Expression {
|
|
2
|
+
abstract toSQL(): string;
|
|
3
|
+
}
|
|
4
4
|
//# sourceMappingURL=Expression.d.ts.map
|
package/Database/Expression.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Expression = void 0;
|
|
4
|
-
class Expression {
|
|
5
|
-
}
|
|
6
|
-
exports.Expression = Expression;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Expression = void 0;
|
|
4
|
+
class Expression {
|
|
5
|
+
}
|
|
6
|
+
exports.Expression = Expression;
|
|
7
7
|
//# sourceMappingURL=Expression.js.map
|