@typetron/framework 0.3.17 → 0.4.0-rc1
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/Stores/DatabaseStore.d.ts +16 -0
- package/Cache/Stores/DatabaseStore.d.ts.map +1 -0
- package/Cache/Stores/DatabaseStore.js +104 -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 +92 -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 +119 -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/Decorators.js.map +1 -1
- 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 +115 -116
- package/Database/Decorators.js.map +1 -1
- 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 +75 -76
- package/Database/Drivers/MySQL/MysqlDriver.js.map +1 -1
- package/Database/Drivers/MySQL/Schema.d.ts +15 -15
- package/Database/Drivers/MySQL/Schema.js +66 -65
- package/Database/Drivers/MySQL/Schema.js.map +1 -1
- 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 +45 -46
- package/Database/Drivers/SQL/Statements/BaseStatement.js.map +1 -1
- 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 +22 -23
- package/Database/Drivers/SQL/Statements/Insert.js.map +1 -1
- 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 +46 -44
- package/Database/Drivers/SQLite/Schema.js.map +1 -1
- 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 +251 -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 +544 -548
- package/Database/Fields.js.map +1 -1
- 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 +117 -118
- package/Database/Migrations/Migrator.js.map +1 -1
- 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/Encryption/index.js.map +1 -1
- 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 +93 -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 +19 -18
- package/Framework/Config/AppConfig.d.ts.map +1 -1
- package/Framework/Config/AppConfig.js +12 -11
- package/Framework/Config/AppConfig.js.map +1 -1
- 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 +22 -0
- package/Framework/Config/CacheConfig.js.map +1 -0
- package/Framework/Config/DatabaseConfig.d.ts +10 -10
- package/Framework/Config/DatabaseConfig.js +24 -25
- package/Framework/Config/DatabaseConfig.js.map +1 -1
- package/Framework/Config/MailConfig.d.ts +19 -0
- package/Framework/Config/MailConfig.d.ts.map +1 -0
- package/Framework/Config/MailConfig.js +12 -0
- package/Framework/Config/MailConfig.js.map +1 -0
- package/Framework/Config/index.d.ts +6 -4
- package/Framework/Config/index.d.ts.map +1 -1
- package/Framework/Config/index.js +18 -16
- package/Framework/Config/index.js.map +1 -1
- package/Framework/Middleware/AuthMiddleware.d.ts +7 -7
- package/Framework/Middleware/AuthMiddleware.js +62 -63
- package/Framework/Middleware/AuthMiddleware.js.map +1 -1
- package/Framework/Middleware/CorsMiddleware.d.ts +6 -6
- package/Framework/Middleware/CorsMiddleware.d.ts.map +1 -1
- package/Framework/Middleware/CorsMiddleware.js +44 -43
- package/Framework/Middleware/CorsMiddleware.js.map +1 -1
- package/Framework/Middleware/StaticAssetsMiddleware.d.ts +14 -14
- package/Framework/Middleware/StaticAssetsMiddleware.js +103 -104
- package/Framework/Middleware/StaticAssetsMiddleware.js.map +1 -1
- 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/MailProvider.d.ts +7 -0
- package/Framework/Providers/MailProvider.d.ts.map +1 -0
- package/Framework/Providers/MailProvider.js +40 -0
- package/Framework/Providers/MailProvider.js.map +1 -0
- package/Framework/Providers/WebsocketsProvider.d.ts +12 -12
- package/Framework/Providers/WebsocketsProvider.d.ts.map +1 -1
- package/Framework/Providers/WebsocketsProvider.js +118 -122
- package/Framework/Providers/WebsocketsProvider.js.map +1 -1
- 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 +39 -40
- package/Framework/Resolvers/EntityResolver.js.map +1 -1
- 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 +8 -6
- package/Framework/index.d.ts.map +1 -1
- package/Framework/index.js +20 -18
- package/Framework/index.js.map +1 -1
- package/Frontend/Angular/index.d.ts +8 -0
- package/Frontend/Angular/index.d.ts.map +1 -0
- package/Frontend/Angular/index.js +20 -0
- package/Frontend/Angular/index.js.map +1 -0
- package/Frontend/Websockets/index.js +76 -0
- package/Frontend/Websockets/index.js.map +1 -0
- package/LICENSE.md +20 -20
- package/Mail/MailAddress.d.ts +5 -0
- package/Mail/MailAddress.d.ts.map +1 -0
- package/Mail/MailAddress.js +3 -0
- package/Mail/MailAddress.js.map +1 -0
- package/Mail/MailTransport.d.ts +6 -0
- package/Mail/MailTransport.d.ts.map +1 -0
- package/Mail/MailTransport.js +7 -0
- package/Mail/MailTransport.js.map +1 -0
- package/Mail/Mailable.d.ts +18 -0
- package/Mail/Mailable.d.ts.map +1 -0
- package/Mail/Mailable.js +10 -0
- package/Mail/Mailable.js.map +1 -0
- package/Mail/Mailer.d.ts +12 -0
- package/Mail/Mailer.d.ts.map +1 -0
- package/Mail/Mailer.js +25 -0
- package/Mail/Mailer.js.map +1 -0
- package/Mail/PendingMail.d.ts +30 -0
- package/Mail/PendingMail.d.ts.map +1 -0
- package/Mail/PendingMail.js +53 -0
- package/Mail/PendingMail.js.map +1 -0
- package/Mail/SentMessage.d.ts +16 -0
- package/Mail/SentMessage.d.ts.map +1 -0
- package/Mail/SentMessage.js +13 -0
- package/Mail/SentMessage.js.map +1 -0
- package/Mail/Transports/MemoryTransport.d.ts +8 -0
- package/Mail/Transports/MemoryTransport.d.ts.map +1 -0
- package/Mail/Transports/MemoryTransport.js +18 -0
- package/Mail/Transports/MemoryTransport.js.map +1 -0
- package/Mail/Transports/SendGridTransport.d.ts +11 -0
- package/Mail/Transports/SendGridTransport.d.ts.map +1 -0
- package/Mail/Transports/SendGridTransport.js +59 -0
- package/Mail/Transports/SendGridTransport.js.map +1 -0
- package/Mail/index.d.ts +4 -0
- package/Mail/index.d.ts.map +1 -0
- package/Mail/index.js +16 -0
- package/Mail/index.js.map +1 -0
- package/Models/Model.d.ts +9 -9
- package/Models/Model.js +35 -35
- package/Models/Model.js.map +1 -1
- 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.d.ts.map +1 -1
- package/Router/Http/Handler.js +131 -131
- package/Router/Http/Handler.js.map +1 -1
- package/Router/Http/Request.d.ts +27 -22
- package/Router/Http/Request.d.ts.map +1 -1
- package/Router/Http/Request.js +185 -151
- package/Router/Http/Request.js.map +1 -1
- package/Router/Http/Response.d.ts +18 -17
- package/Router/Http/Response.d.ts.map +1 -1
- package/Router/Http/Response.js +42 -51
- package/Router/Http/Response.js.map +1 -1
- 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/Servers/index.d.ts +5 -0
- package/Router/Servers/index.d.ts.map +1 -0
- package/Router/Servers/index.js +15 -0
- package/Router/Servers/index.js.map +1 -0
- package/Router/Servers/node.d.ts +3 -0
- package/Router/Servers/node.d.ts.map +1 -0
- package/Router/Servers/node.js +15 -0
- package/Router/Servers/node.js.map +1 -0
- package/Router/Servers/uNetworking.d.ts +3 -0
- package/Router/Servers/uNetworking.d.ts.map +1 -0
- package/Router/Servers/uNetworking.js +33 -0
- package/Router/Servers/uNetworking.js.map +1 -0
- package/Router/Websockets/Handler.d.ts +12 -12
- package/Router/Websockets/Handler.d.ts.map +1 -1
- package/Router/Websockets/Handler.js +59 -59
- package/Router/Websockets/Handler.js.map +1 -1
- package/Router/Websockets/WebsocketEvent.d.ts +15 -15
- package/Router/Websockets/WebsocketEvent.js +52 -53
- package/Router/Websockets/WebsocketEvent.js.map +1 -1
- 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.d.ts.map +1 -1
- package/Router/Websockets/types.js +8 -8
- package/Router/index.d.ts +6 -6
- package/Router/index.js +18 -18
- package/Router/micro.d.ts +3 -0
- package/Router/micro.d.ts.map +1 -0
- package/Router/micro.js +44 -0
- package/Router/micro.js.map +1 -0
- 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 +111 -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 +15 -14
- package/Support/Metadata.d.ts.map +1 -1
- package/Support/Metadata.js +31 -20
- package/Support/Metadata.js.map +1 -1
- 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 +129 -130
- package/Testing/TestCase.js.map +1 -1
- 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/Email.js.map +1 -1
- package/Validation/Rules/FileExtension.d.ts +3 -3
- package/Validation/Rules/FileExtension.js +22 -22
- package/Validation/Rules/FileExtension.js.map +1 -1
- package/Validation/Rules/MaxLength.d.ts +3 -3
- package/Validation/Rules/MaxLength.js +19 -19
- package/Validation/Rules/MaxLength.js.map +1 -1
- package/Validation/Rules/MinLength.d.ts +3 -3
- package/Validation/Rules/MinLength.js +19 -19
- package/Validation/Rules/MinLength.js.map +1 -1
- 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/Rules/Required.js.map +1 -1
- 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/benchmark-index.js.map +1 -0
- package/benchmark.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -0
- package/index.js +41 -0
- package/index.js.map +1 -0
- package/package.json +70 -64
- package/test.js.map +1 -0
- package/tests/Cache/DatabaseStoreTest.d.ts +2 -0
- package/tests/Cache/DatabaseStoreTest.d.ts.map +1 -0
- package/tests/Cache/DatabaseStoreTest.js +137 -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 +547 -552
- package/tests/Database/EntityRelationshipsTest.js.map +1 -1
- 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/RunnerTest.js.map +1 -1
- 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/Mail/MailerTest.d.ts +2 -0
- package/tests/Mail/MailerTest.d.ts.map +1 -0
- package/tests/Mail/MailerTest.js +98 -0
- package/tests/Mail/MailerTest.js.map +1 -0
- 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/Database/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./Query"), exports);
|
|
14
|
-
__exportStar(require("./Entity"), exports);
|
|
15
|
-
__exportStar(require("./Decorators"), exports);
|
|
16
|
-
__exportStar(require("./StringExpression"), exports);
|
|
17
|
-
__exportStar(require("./Expression"), exports);
|
|
18
|
-
__exportStar(require("./Drivers"), exports);
|
|
19
|
-
__exportStar(require("./Fields"), exports);
|
|
20
|
-
__exportStar(require("./Connection"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./Query"), exports);
|
|
14
|
+
__exportStar(require("./Entity"), exports);
|
|
15
|
+
__exportStar(require("./Decorators"), exports);
|
|
16
|
+
__exportStar(require("./StringExpression"), exports);
|
|
17
|
+
__exportStar(require("./Expression"), exports);
|
|
18
|
+
__exportStar(require("./Drivers"), exports);
|
|
19
|
+
__exportStar(require("./Fields"), exports);
|
|
20
|
+
__exportStar(require("./Connection"), exports);
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
package/Encryption/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { GetPublicKeyOrSecret, Secret, SignOptions, VerifyOptions } from 'jsonwebtoken';
|
|
3
|
-
export declare class Crypt {
|
|
4
|
-
hash(value: string, saltRounds: number): Promise<string>;
|
|
5
|
-
compare(value: string, encrypted: string): Promise<boolean>;
|
|
6
|
-
}
|
|
7
|
-
export interface JWToken<T> {
|
|
8
|
-
sub: T;
|
|
9
|
-
iat: number;
|
|
10
|
-
exp: number;
|
|
11
|
-
}
|
|
12
|
-
export declare class JWT {
|
|
13
|
-
sign(payload: string | Buffer | object, secretOrPrivateKey: Secret, options?: SignOptions): Promise<string>;
|
|
14
|
-
verify<T>(token: string, secretOrPrivateKey: Secret | GetPublicKeyOrSecret, options?: VerifyOptions): Promise<JWToken<T>>;
|
|
15
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { GetPublicKeyOrSecret, Secret, SignOptions, VerifyOptions } from 'jsonwebtoken';
|
|
3
|
+
export declare class Crypt {
|
|
4
|
+
hash(value: string, saltRounds: number): Promise<string>;
|
|
5
|
+
compare(value: string, encrypted: string): Promise<boolean>;
|
|
6
|
+
}
|
|
7
|
+
export interface JWToken<T> {
|
|
8
|
+
sub: T;
|
|
9
|
+
iat: number;
|
|
10
|
+
exp: number;
|
|
11
|
+
}
|
|
12
|
+
export declare class JWT {
|
|
13
|
+
sign(payload: string | Buffer | object, secretOrPrivateKey: Secret, options?: SignOptions): Promise<string>;
|
|
14
|
+
verify<T>(token: string, secretOrPrivateKey: Secret | GetPublicKeyOrSecret, options?: VerifyOptions): Promise<JWToken<T>>;
|
|
15
|
+
}
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/Encryption/index.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.JWT = exports.Crypt = void 0;
|
|
23
|
-
const bcryptjs_1 = require("bcryptjs");
|
|
24
|
-
const jwt = __importStar(require("jsonwebtoken"));
|
|
25
|
-
class Crypt {
|
|
26
|
-
hash(value, saltRounds) {
|
|
27
|
-
return bcryptjs_1.hash(value, saltRounds);
|
|
28
|
-
}
|
|
29
|
-
compare(value, encrypted) {
|
|
30
|
-
return bcryptjs_1.compare(value, encrypted);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.Crypt = Crypt;
|
|
34
|
-
class JWT {
|
|
35
|
-
sign(payload, secretOrPrivateKey, options) {
|
|
36
|
-
return new Promise((resolve, reject) => {
|
|
37
|
-
jwt.sign(payload, secretOrPrivateKey, options
|
|
38
|
-
error ? reject(error) : resolve(encoded);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
verify(token, secretOrPrivateKey, options) {
|
|
43
|
-
return new Promise((resolve, reject) => {
|
|
44
|
-
jwt.verify(token, secretOrPrivateKey, {
|
|
45
|
-
...options,
|
|
46
|
-
complete: true
|
|
47
|
-
}, (error, decoded) => {
|
|
48
|
-
error ? reject(error) : resolve(decoded);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.JWT = JWT;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.JWT = exports.Crypt = void 0;
|
|
23
|
+
const bcryptjs_1 = require("bcryptjs");
|
|
24
|
+
const jwt = __importStar(require("jsonwebtoken"));
|
|
25
|
+
class Crypt {
|
|
26
|
+
hash(value, saltRounds) {
|
|
27
|
+
return bcryptjs_1.hash(value, saltRounds);
|
|
28
|
+
}
|
|
29
|
+
compare(value, encrypted) {
|
|
30
|
+
return bcryptjs_1.compare(value, encrypted);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.Crypt = Crypt;
|
|
34
|
+
class JWT {
|
|
35
|
+
sign(payload, secretOrPrivateKey, options) {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
jwt.sign(payload, secretOrPrivateKey, options ?? {}, (error, encoded) => {
|
|
38
|
+
error ? reject(error) : resolve(encoded);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
verify(token, secretOrPrivateKey, options) {
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
44
|
+
jwt.verify(token, secretOrPrivateKey, {
|
|
45
|
+
...options,
|
|
46
|
+
complete: true
|
|
47
|
+
}, (error, decoded) => {
|
|
48
|
+
error ? reject(error) : resolve(decoded);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.JWT = JWT;
|
|
54
54
|
//# sourceMappingURL=index.js.map
|
package/Encryption/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Encryption/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwC;AACxC,kDAAmC;AAGnC,MAAa,KAAK;IACd,IAAI,CAAC,KAAa,EAAE,UAAkB;QAClC,OAAO,eAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IAClC,CAAC;IAED,OAAO,CAAC,KAAa,EAAE,SAAiB;QACpC,OAAO,kBAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IACpC,CAAC;CACJ;AARD,sBAQC;AAQD,MAAa,GAAG;IACZ,IAAI,CAAC,OAAiC,EAAE,kBAA0B,EAAE,OAAqB;QACrF,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,GAAG,CAAC,IAAI,CACJ,OAAO,EACP,kBAAkB,EAClB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Encryption/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwC;AACxC,kDAAmC;AAGnC,MAAa,KAAK;IACd,IAAI,CAAC,KAAa,EAAE,UAAkB;QAClC,OAAO,eAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IAClC,CAAC;IAED,OAAO,CAAC,KAAa,EAAE,SAAiB;QACpC,OAAO,kBAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IACpC,CAAC;CACJ;AARD,sBAQC;AAQD,MAAa,GAAG;IACZ,IAAI,CAAC,OAAiC,EAAE,kBAA0B,EAAE,OAAqB;QACrF,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,GAAG,CAAC,IAAI,CACJ,OAAO,EACP,kBAAkB,EAClB,OAAO,IAAI,EAAE,EACb,CAAC,KAAmB,EAAE,OAAgB,EAAE,EAAE;gBACtC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAiB,CAAC,CAAA;YACtD,CAAC,CACJ,CAAA;QACL,CAAC,CAAC,CAAA;IACN,CAAC;IAED,MAAM,CAAI,KAAa,EAAE,kBAAiD,EAAE,OAAuB;QAC/F,OAAO,IAAI,OAAO,CAAa,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC/C,GAAG,CAAC,MAAM,CACN,KAAK,EACL,kBAAkB,EAClB;gBACI,GAAG,OAAO;gBACV,QAAQ,EAAE,IAAI;aACjB,EACD,CAAC,KAA0B,EAAE,OAAgB,EAAE,EAAE;gBAC7C,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAqB,CAAC,CAAA;YAC1D,CAAC,CACJ,CAAA;QACL,CAAC,CAAC,CAAA;IACN,CAAC;CAEJ;AA9BD,kBA8BC"}
|
package/Forms/Decorators.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RuleInterface } from '../Validation';
|
|
2
|
-
import { Type } from '../Support';
|
|
3
|
-
import { Form } from './Form';
|
|
4
|
-
export declare const FormMetadataKey = "form:fields";
|
|
5
|
-
export declare function Field<T extends Form>(name?: string): (target: T, property: string) => void;
|
|
6
|
-
export declare function Rules(...rules: (Type<RuleInterface> | ((...args: any[]) => Type<RuleInterface>))[]): (target: Object, property: string) => void;
|
|
1
|
+
import { RuleInterface } from '../Validation';
|
|
2
|
+
import { Type } from '../Support';
|
|
3
|
+
import { Form } from './Form';
|
|
4
|
+
export declare const FormMetadataKey = "form:fields";
|
|
5
|
+
export declare function Field<T extends Form>(name?: string): (target: T, property: string) => void;
|
|
6
|
+
export declare function Rules(...rules: (Type<RuleInterface> | ((...args: any[]) => Type<RuleInterface>))[]): (target: Object, property: string) => void;
|
|
7
7
|
//# sourceMappingURL=Decorators.d.ts.map
|
package/Forms/Decorators.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Rules = exports.Field = exports.FormMetadataKey = void 0;
|
|
4
|
-
const FormFields_1 = require("./FormFields");
|
|
5
|
-
exports.FormMetadataKey = 'form:fields';
|
|
6
|
-
function Field(name) {
|
|
7
|
-
return function (target, property) {
|
|
8
|
-
const fields = Reflect.getMetadata(exports.FormMetadataKey, target.constructor) || {};
|
|
9
|
-
const type = Reflect.getMetadata('design:type', target, property);
|
|
10
|
-
const field = fields[property] || new FormFields_1.FormField(name || property, type);
|
|
11
|
-
field.name = name || property;
|
|
12
|
-
fields[property] = field;
|
|
13
|
-
Reflect.defineMetadata(exports.FormMetadataKey, fields, target.constructor);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
exports.Field = Field;
|
|
17
|
-
// tslint:disable-next-line:no-any
|
|
18
|
-
function Rules(...rules) {
|
|
19
|
-
return function (target, property) {
|
|
20
|
-
const fields = Reflect.getMetadata(exports.FormMetadataKey, target.constructor) || {};
|
|
21
|
-
const type = Reflect.getMetadata('design:type', target, property);
|
|
22
|
-
const field = fields[property] || new FormFields_1.FormField(property, type);
|
|
23
|
-
field.rules = rules;
|
|
24
|
-
fields[property] = field;
|
|
25
|
-
Reflect.defineMetadata(exports.FormMetadataKey, fields, target.constructor);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
exports.Rules = Rules;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Rules = exports.Field = exports.FormMetadataKey = void 0;
|
|
4
|
+
const FormFields_1 = require("./FormFields");
|
|
5
|
+
exports.FormMetadataKey = 'form:fields';
|
|
6
|
+
function Field(name) {
|
|
7
|
+
return function (target, property) {
|
|
8
|
+
const fields = Reflect.getMetadata(exports.FormMetadataKey, target.constructor) || {};
|
|
9
|
+
const type = Reflect.getMetadata('design:type', target, property);
|
|
10
|
+
const field = fields[property] || new FormFields_1.FormField(name || property, type);
|
|
11
|
+
field.name = name || property;
|
|
12
|
+
fields[property] = field;
|
|
13
|
+
Reflect.defineMetadata(exports.FormMetadataKey, fields, target.constructor);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
exports.Field = Field;
|
|
17
|
+
// tslint:disable-next-line:no-any
|
|
18
|
+
function Rules(...rules) {
|
|
19
|
+
return function (target, property) {
|
|
20
|
+
const fields = Reflect.getMetadata(exports.FormMetadataKey, target.constructor) || {};
|
|
21
|
+
const type = Reflect.getMetadata('design:type', target, property);
|
|
22
|
+
const field = fields[property] || new FormFields_1.FormField(property, type);
|
|
23
|
+
field.rules = rules;
|
|
24
|
+
fields[property] = field;
|
|
25
|
+
Reflect.defineMetadata(exports.FormMetadataKey, fields, target.constructor);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.Rules = Rules;
|
|
29
29
|
//# sourceMappingURL=Decorators.js.map
|
package/Forms/Form.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ChildKeys, ChildObject, Constructor } from '../Support';
|
|
2
|
-
import { FormField } from './FormFields';
|
|
3
|
-
export declare type FormFields<T> = ChildObject<T, Form>;
|
|
4
|
-
export declare abstract class Form {
|
|
5
|
-
readonly errors: {
|
|
6
|
-
[key: string]: Record<string, string>;
|
|
7
|
-
};
|
|
8
|
-
static fields<T extends Form>(this: Constructor<T>): Record<ChildKeys<T, Form>, FormField>;
|
|
9
|
-
fields(): Record<never, FormField>;
|
|
10
|
-
valid(): boolean;
|
|
11
|
-
validated(): {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
};
|
|
14
|
-
value(): Record<string, any>;
|
|
15
|
-
fill(data: Partial<FormFields<this>>): void;
|
|
16
|
-
toJSON(): Record<string, any>;
|
|
17
|
-
}
|
|
1
|
+
import { ChildKeys, ChildObject, Constructor } from '../Support';
|
|
2
|
+
import { FormField } from './FormFields';
|
|
3
|
+
export declare type FormFields<T> = ChildObject<T, Form>;
|
|
4
|
+
export declare abstract class Form {
|
|
5
|
+
readonly errors: {
|
|
6
|
+
[key: string]: Record<string, string>;
|
|
7
|
+
};
|
|
8
|
+
static fields<T extends Form>(this: Constructor<T>): Record<ChildKeys<T, Form>, FormField>;
|
|
9
|
+
fields(): Record<never, FormField>;
|
|
10
|
+
valid(): boolean;
|
|
11
|
+
validated(): {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
value(): Record<string, any>;
|
|
15
|
+
fill(data: Partial<FormFields<this>>): void;
|
|
16
|
+
toJSON(): Record<string, any>;
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=Form.d.ts.map
|
package/Forms/Form.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var Form_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.Form = void 0;
|
|
11
|
-
const Decorators_1 = require("./Decorators");
|
|
12
|
-
const Container_1 = require("../Container");
|
|
13
|
-
let Form = Form_1 = class Form {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.errors = {};
|
|
16
|
-
}
|
|
17
|
-
static fields() {
|
|
18
|
-
return Reflect.getMetadata(Decorators_1.FormMetadataKey, this);
|
|
19
|
-
}
|
|
20
|
-
fields() {
|
|
21
|
-
return this.constructor.fields();
|
|
22
|
-
}
|
|
23
|
-
valid() {
|
|
24
|
-
const fields = Object.values(this.fields());
|
|
25
|
-
fields.forEach(field => {
|
|
26
|
-
const errors = field.validate(this[field.name]);
|
|
27
|
-
if (errors) {
|
|
28
|
-
this.errors[field.name] = errors;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return !Object.keys(this.errors).length;
|
|
32
|
-
}
|
|
33
|
-
validated() {
|
|
34
|
-
const fields = Object.values(this.fields());
|
|
35
|
-
return fields.filter(field => !this.errors[field.name])
|
|
36
|
-
.reduce((obj, field) => {
|
|
37
|
-
const value = this[field.name];
|
|
38
|
-
if (value) {
|
|
39
|
-
obj[field.name] = value;
|
|
40
|
-
}
|
|
41
|
-
return obj;
|
|
42
|
-
}, {});
|
|
43
|
-
}
|
|
44
|
-
value() {
|
|
45
|
-
const fields = Object.values(this.fields());
|
|
46
|
-
// tslint:disable-next-line:no-any
|
|
47
|
-
const value = {};
|
|
48
|
-
fields.forEach(field => {
|
|
49
|
-
value[field.name] = this[field.name];
|
|
50
|
-
});
|
|
51
|
-
return value;
|
|
52
|
-
}
|
|
53
|
-
fill(data) {
|
|
54
|
-
const fields = Object.values(this.fields());
|
|
55
|
-
fields.forEach(field => {
|
|
56
|
-
if (field.name in data) {
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
this[field.name] = data[field.name];
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
toJSON() {
|
|
63
|
-
return this.value();
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
Form = Form_1 = __decorate([
|
|
67
|
-
Container_1.Injectable(Container_1.Scope.TRANSIENT)
|
|
68
|
-
], Form);
|
|
69
|
-
exports.Form = Form;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var Form_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Form = void 0;
|
|
11
|
+
const Decorators_1 = require("./Decorators");
|
|
12
|
+
const Container_1 = require("../Container");
|
|
13
|
+
let Form = Form_1 = class Form {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.errors = {};
|
|
16
|
+
}
|
|
17
|
+
static fields() {
|
|
18
|
+
return Reflect.getMetadata(Decorators_1.FormMetadataKey, this);
|
|
19
|
+
}
|
|
20
|
+
fields() {
|
|
21
|
+
return this.constructor.fields();
|
|
22
|
+
}
|
|
23
|
+
valid() {
|
|
24
|
+
const fields = Object.values(this.fields());
|
|
25
|
+
fields.forEach(field => {
|
|
26
|
+
const errors = field.validate(this[field.name]);
|
|
27
|
+
if (errors) {
|
|
28
|
+
this.errors[field.name] = errors;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return !Object.keys(this.errors).length;
|
|
32
|
+
}
|
|
33
|
+
validated() {
|
|
34
|
+
const fields = Object.values(this.fields());
|
|
35
|
+
return fields.filter(field => !this.errors[field.name])
|
|
36
|
+
.reduce((obj, field) => {
|
|
37
|
+
const value = this[field.name];
|
|
38
|
+
if (value) {
|
|
39
|
+
obj[field.name] = value;
|
|
40
|
+
}
|
|
41
|
+
return obj;
|
|
42
|
+
}, {});
|
|
43
|
+
}
|
|
44
|
+
value() {
|
|
45
|
+
const fields = Object.values(this.fields());
|
|
46
|
+
// tslint:disable-next-line:no-any
|
|
47
|
+
const value = {};
|
|
48
|
+
fields.forEach(field => {
|
|
49
|
+
value[field.name] = this[field.name];
|
|
50
|
+
});
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
fill(data) {
|
|
54
|
+
const fields = Object.values(this.fields());
|
|
55
|
+
fields.forEach(field => {
|
|
56
|
+
if (field.name in data) {
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
this[field.name] = data[field.name];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
toJSON() {
|
|
63
|
+
return this.value();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
Form = Form_1 = __decorate([
|
|
67
|
+
Container_1.Injectable(Container_1.Scope.TRANSIENT)
|
|
68
|
+
], Form);
|
|
69
|
+
exports.Form = Form;
|
|
70
70
|
//# sourceMappingURL=Form.js.map
|
package/Forms/FormFields.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Type } from '../Support';
|
|
2
|
-
import { RuleInterface } from '../Validation';
|
|
3
|
-
export declare class FormField {
|
|
4
|
-
name: string;
|
|
5
|
-
type: any;
|
|
6
|
-
rules: (Type<RuleInterface> | ((...args: any[]) => Type<RuleInterface>))[];
|
|
7
|
-
constructor(name: string, type: any, rules?: (Type<RuleInterface> | ((...args: any[]) => Type<RuleInterface>))[]);
|
|
8
|
-
validate(value: any): Record<string, string> | undefined;
|
|
9
|
-
}
|
|
1
|
+
import { Type } from '../Support';
|
|
2
|
+
import { RuleInterface } from '../Validation';
|
|
3
|
+
export declare class FormField {
|
|
4
|
+
name: string;
|
|
5
|
+
type: any;
|
|
6
|
+
rules: (Type<RuleInterface> | ((...args: any[]) => Type<RuleInterface>))[];
|
|
7
|
+
constructor(name: string, type: any, rules?: (Type<RuleInterface> | ((...args: any[]) => Type<RuleInterface>))[]);
|
|
8
|
+
validate(value: any): Record<string, string> | undefined;
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=FormFields.d.ts.map
|
package/Forms/FormFields.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormField = void 0;
|
|
4
|
-
const Validation_1 = require("../Validation");
|
|
5
|
-
class FormField {
|
|
6
|
-
constructor(name,
|
|
7
|
-
// tslint:disable-next-line:no-any
|
|
8
|
-
type,
|
|
9
|
-
// tslint:disable-next-line:no-any
|
|
10
|
-
rules = []) {
|
|
11
|
-
this.name = name;
|
|
12
|
-
this.type = type;
|
|
13
|
-
this.rules = rules;
|
|
14
|
-
}
|
|
15
|
-
// tslint:disable-next-line:no-any
|
|
16
|
-
validate(value) {
|
|
17
|
-
const errors = {};
|
|
18
|
-
let hasErrors = false;
|
|
19
|
-
if (this.rules.includes(Validation_1.Optional) && (value === undefined || value === null)) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
this.rules.forEach(rule => {
|
|
23
|
-
if (!rule.prototype.passes) {
|
|
24
|
-
rule = rule();
|
|
25
|
-
}
|
|
26
|
-
const instance = new rule;
|
|
27
|
-
if (!instance.passes(this.name, value)) {
|
|
28
|
-
hasErrors = true;
|
|
29
|
-
errors[instance.identifier] = instance.message(this.name, value);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
return hasErrors ? errors : undefined;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.FormField = FormField;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormField = void 0;
|
|
4
|
+
const Validation_1 = require("../Validation");
|
|
5
|
+
class FormField {
|
|
6
|
+
constructor(name,
|
|
7
|
+
// tslint:disable-next-line:no-any
|
|
8
|
+
type,
|
|
9
|
+
// tslint:disable-next-line:no-any
|
|
10
|
+
rules = []) {
|
|
11
|
+
this.name = name;
|
|
12
|
+
this.type = type;
|
|
13
|
+
this.rules = rules;
|
|
14
|
+
}
|
|
15
|
+
// tslint:disable-next-line:no-any
|
|
16
|
+
validate(value) {
|
|
17
|
+
const errors = {};
|
|
18
|
+
let hasErrors = false;
|
|
19
|
+
if (this.rules.includes(Validation_1.Optional) && (value === undefined || value === null)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
this.rules.forEach(rule => {
|
|
23
|
+
if (!rule.prototype.passes) {
|
|
24
|
+
rule = rule();
|
|
25
|
+
}
|
|
26
|
+
const instance = new rule;
|
|
27
|
+
if (!instance.passes(this.name, value)) {
|
|
28
|
+
hasErrors = true;
|
|
29
|
+
errors[instance.identifier] = instance.message(this.name, value);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return hasErrors ? errors : undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.FormField = FormField;
|
|
36
36
|
//# sourceMappingURL=FormFields.js.map
|
package/Forms/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Form';
|
|
2
|
-
export * from './Decorators';
|
|
3
|
-
export * from './FormFields';
|
|
1
|
+
export * from './Form';
|
|
2
|
+
export * from './Decorators';
|
|
3
|
+
export * from './FormFields';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/Forms/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./Form"), exports);
|
|
14
|
-
__exportStar(require("./Decorators"), exports);
|
|
15
|
-
__exportStar(require("./FormFields"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./Form"), exports);
|
|
14
|
+
__exportStar(require("./Decorators"), exports);
|
|
15
|
+
__exportStar(require("./FormFields"), exports);
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/Framework/App.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Application } from './Application';
|
|
2
|
-
import { ServiceIdentifier } from '../Container/Contracts';
|
|
3
|
-
export declare class App {
|
|
4
|
-
static instance: Application;
|
|
5
|
-
static get<T>(service: ServiceIdentifier<T> | string): T;
|
|
6
|
-
}
|
|
1
|
+
import { Application } from './Application';
|
|
2
|
+
import { ServiceIdentifier } from '../Container/Contracts';
|
|
3
|
+
export declare class App {
|
|
4
|
+
static instance: Application;
|
|
5
|
+
static get<T>(service: ServiceIdentifier<T> | string): T;
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=App.d.ts.map
|
package/Framework/App.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.App = void 0;
|
|
4
|
-
class App {
|
|
5
|
-
static get(service) {
|
|
6
|
-
return App.instance.get(service);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.App = App;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.App = void 0;
|
|
4
|
+
class App {
|
|
5
|
+
static get(service) {
|
|
6
|
+
return App.instance.get(service);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.App = App;
|
|
10
10
|
//# sourceMappingURL=App.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Container } from '../Container';
|
|
2
|
-
import { Type } from '../Support';
|
|
3
|
-
import { Provider } from './Provider';
|
|
4
|
-
export declare class Application extends Container {
|
|
5
|
-
directory: string;
|
|
6
|
-
configDirectory: string;
|
|
7
|
-
static defaultConfigDirectory: string;
|
|
8
|
-
config: Map<Function, object>;
|
|
9
|
-
constructor(directory: string, configDirectory?: string);
|
|
10
|
-
static create(directory: string, configDirectory?: string): Promise<Application>;
|
|
11
|
-
startServer(): Promise<void>;
|
|
12
|
-
registerProviders(providers: Type<Provider>[]): Promise<void>;
|
|
13
|
-
private loadConfig;
|
|
14
|
-
private registerResolvers;
|
|
15
|
-
private bootstrap;
|
|
16
|
-
private checkAppSecret;
|
|
17
|
-
}
|
|
1
|
+
import { Container } from '../Container';
|
|
2
|
+
import { Type } from '../Support';
|
|
3
|
+
import { Provider } from './Provider';
|
|
4
|
+
export declare class Application extends Container {
|
|
5
|
+
directory: string;
|
|
6
|
+
configDirectory: string;
|
|
7
|
+
static defaultConfigDirectory: string;
|
|
8
|
+
config: Map<Function, object>;
|
|
9
|
+
constructor(directory: string, configDirectory?: string);
|
|
10
|
+
static create(directory: string, configDirectory?: string): Promise<Application>;
|
|
11
|
+
startServer(): Promise<void>;
|
|
12
|
+
registerProviders(providers: Type<Provider>[]): Promise<void>;
|
|
13
|
+
private loadConfig;
|
|
14
|
+
private registerResolvers;
|
|
15
|
+
private bootstrap;
|
|
16
|
+
private checkAppSecret;
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=Application.d.ts.map
|