@typetron/framework 0.5.22 → 0.5.25
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/build/Cache/Cache.d.ts +9 -0
- package/build/Cache/Cache.d.ts.map +1 -0
- package/build/Cache/Cache.js +7 -0
- package/build/Cache/Cache.js.map +1 -0
- package/build/Cache/Stores/DatabaseStore.d.ts +16 -0
- package/build/Cache/Stores/DatabaseStore.d.ts.map +1 -0
- package/build/Cache/Stores/DatabaseStore.js +105 -0
- package/build/Cache/Stores/DatabaseStore.js.map +1 -0
- package/build/Cache/Stores/FileStore.d.ts +16 -0
- package/build/Cache/Stores/FileStore.d.ts.map +1 -0
- package/build/Cache/Stores/FileStore.js +65 -0
- package/build/Cache/Stores/FileStore.js.map +1 -0
- package/build/Cache/Stores/MemoryStore.d.ts +13 -0
- package/build/Cache/Stores/MemoryStore.d.ts.map +1 -0
- package/build/Cache/Stores/MemoryStore.js +57 -0
- package/build/Cache/Stores/MemoryStore.js.map +1 -0
- package/build/Cache/index.d.ts +6 -0
- package/build/Cache/index.d.ts.map +1 -0
- package/build/Cache/index.js +22 -0
- package/build/Cache/index.js.map +1 -0
- package/build/Cache/types.d.ts +5 -0
- package/build/Cache/types.d.ts.map +1 -0
- package/build/Cache/types.js +3 -0
- package/build/Cache/types.js.map +1 -0
- package/build/Container/ClassResolver.d.ts +9 -0
- package/build/Container/ClassResolver.d.ts.map +1 -0
- package/build/Container/ClassResolver.js +93 -0
- package/build/Container/ClassResolver.js.map +1 -0
- package/build/Container/Container.d.ts +26 -0
- package/build/Container/Container.d.ts.map +1 -0
- package/build/Container/Container.js +132 -0
- package/build/Container/Container.js.map +1 -0
- package/build/Container/Contracts.d.ts +3 -0
- package/build/Container/Contracts.d.ts.map +1 -0
- package/build/Container/Contracts.js +3 -0
- package/build/Container/Contracts.js.map +1 -0
- package/build/Container/Decorators.d.ts +5 -0
- package/build/Container/Decorators.d.ts.map +1 -0
- package/build/Container/Decorators.js +21 -0
- package/build/Container/Decorators.js.map +1 -0
- package/build/Container/Metadata.d.ts +22 -0
- package/build/Container/Metadata.d.ts.map +1 -0
- package/build/Container/Metadata.js +18 -0
- package/build/Container/Metadata.js.map +1 -0
- package/build/Container/Resolver.d.ts +19 -0
- package/build/Container/Resolver.d.ts.map +1 -0
- package/build/Container/Resolver.js +17 -0
- package/build/Container/Resolver.js.map +1 -0
- package/build/Container/index.d.ts +6 -0
- package/build/Container/index.d.ts.map +1 -0
- package/build/Container/index.js +22 -0
- package/build/Container/index.js.map +1 -0
- package/build/Database/Clauses/Where.d.ts +1 -0
- package/build/Database/Clauses/Where.d.ts.map +1 -0
- package/build/Database/Clauses/Where.js +2 -0
- package/build/Database/Clauses/Where.js.map +1 -0
- package/build/Database/Connection.d.ts +21 -0
- package/build/Database/Connection.d.ts.map +1 -0
- package/build/Database/Connection.js +44 -0
- package/build/Database/Connection.js.map +1 -0
- package/build/Database/Decorators.d.ts +36 -0
- package/build/Database/Decorators.d.ts.map +1 -0
- package/build/Database/Decorators.js +116 -0
- package/build/Database/Decorators.js.map +1 -0
- package/build/Database/Drivers/DatabaseDriver.d.ts +29 -0
- package/build/Database/Drivers/DatabaseDriver.d.ts.map +1 -0
- package/build/Database/Drivers/DatabaseDriver.js +7 -0
- package/build/Database/Drivers/DatabaseDriver.js.map +1 -0
- package/build/Database/Drivers/MySQL/Alter/index.d.ts +34 -0
- package/build/Database/Drivers/MySQL/Alter/index.d.ts.map +1 -0
- package/build/Database/Drivers/MySQL/Alter/index.js +70 -0
- package/build/Database/Drivers/MySQL/Alter/index.js.map +1 -0
- package/build/Database/Drivers/MySQL/ColumnDefinition.d.ts +7 -0
- package/build/Database/Drivers/MySQL/ColumnDefinition.d.ts.map +1 -0
- package/build/Database/Drivers/MySQL/ColumnDefinition.js +19 -0
- package/build/Database/Drivers/MySQL/ColumnDefinition.js.map +1 -0
- package/build/Database/Drivers/MySQL/Create.d.ts +10 -0
- package/build/Database/Drivers/MySQL/Create.d.ts.map +1 -0
- package/build/Database/Drivers/MySQL/Create.js +44 -0
- package/build/Database/Drivers/MySQL/Create.js.map +1 -0
- package/build/Database/Drivers/MySQL/MysqlDriver.d.ts +42 -0
- package/build/Database/Drivers/MySQL/MysqlDriver.d.ts.map +1 -0
- package/build/Database/Drivers/MySQL/MysqlDriver.js +93 -0
- package/build/Database/Drivers/MySQL/MysqlDriver.js.map +1 -0
- package/build/Database/Drivers/MySQL/Schema.d.ts +16 -0
- package/build/Database/Drivers/MySQL/Schema.d.ts.map +1 -0
- package/build/Database/Drivers/MySQL/Schema.js +67 -0
- package/build/Database/Drivers/MySQL/Schema.js.map +1 -0
- package/build/Database/Drivers/MySQL/index.d.ts +2 -0
- package/build/Database/Drivers/MySQL/index.d.ts.map +1 -0
- package/build/Database/Drivers/MySQL/index.js +16 -0
- package/build/Database/Drivers/MySQL/index.js.map +1 -0
- package/build/Database/Drivers/SQL/Schema.d.ts +7 -0
- package/build/Database/Drivers/SQL/Schema.d.ts.map +1 -0
- package/build/Database/Drivers/SQL/Schema.js +58 -0
- package/build/Database/Drivers/SQL/Schema.js.map +1 -0
- package/build/Database/Drivers/SQL/Statements/Alter.d.ts +8 -0
- package/build/Database/Drivers/SQL/Statements/Alter.d.ts.map +1 -0
- package/build/Database/Drivers/SQL/Statements/Alter.js +22 -0
- package/build/Database/Drivers/SQL/Statements/Alter.js.map +1 -0
- package/build/Database/Drivers/SQL/Statements/BaseStatement.d.ts +13 -0
- package/build/Database/Drivers/SQL/Statements/BaseStatement.d.ts.map +1 -0
- package/build/Database/Drivers/SQL/Statements/BaseStatement.js +46 -0
- package/build/Database/Drivers/SQL/Statements/BaseStatement.js.map +1 -0
- package/build/Database/Drivers/SQL/Statements/Delete.d.ts +6 -0
- package/build/Database/Drivers/SQL/Statements/Delete.d.ts.map +1 -0
- package/build/Database/Drivers/SQL/Statements/Delete.js +20 -0
- package/build/Database/Drivers/SQL/Statements/Delete.js.map +1 -0
- package/build/Database/Drivers/SQL/Statements/Insert.d.ts +7 -0
- package/build/Database/Drivers/SQL/Statements/Insert.d.ts.map +1 -0
- package/build/Database/Drivers/SQL/Statements/Insert.js +24 -0
- package/build/Database/Drivers/SQL/Statements/Insert.js.map +1 -0
- package/build/Database/Drivers/SQL/Statements/Select.d.ts +8 -0
- package/build/Database/Drivers/SQL/Statements/Select.d.ts.map +1 -0
- package/build/Database/Drivers/SQL/Statements/Select.js +51 -0
- package/build/Database/Drivers/SQL/Statements/Select.js.map +1 -0
- package/build/Database/Drivers/SQL/Statements/Update.d.ts +7 -0
- package/build/Database/Drivers/SQL/Statements/Update.d.ts.map +1 -0
- package/build/Database/Drivers/SQL/Statements/Update.js +33 -0
- package/build/Database/Drivers/SQL/Statements/Update.js.map +1 -0
- package/build/Database/Drivers/SQL/index.d.ts +9 -0
- package/build/Database/Drivers/SQL/index.d.ts.map +1 -0
- package/build/Database/Drivers/SQL/index.js +3 -0
- package/build/Database/Drivers/SQL/index.js.map +1 -0
- package/build/Database/Drivers/SQLite/Create.d.ts +10 -0
- package/build/Database/Drivers/SQLite/Create.d.ts.map +1 -0
- package/build/Database/Drivers/SQLite/Create.js +43 -0
- package/build/Database/Drivers/SQLite/Create.js.map +1 -0
- package/build/Database/Drivers/SQLite/Schema.d.ts +16 -0
- package/build/Database/Drivers/SQLite/Schema.d.ts.map +1 -0
- package/build/Database/Drivers/SQLite/Schema.js +49 -0
- package/build/Database/Drivers/SQLite/Schema.js.map +1 -0
- package/build/Database/Drivers/SQLite/SqliteDriver.d.ts +43 -0
- package/build/Database/Drivers/SQLite/SqliteDriver.d.ts.map +1 -0
- package/build/Database/Drivers/SQLite/SqliteDriver.js +115 -0
- package/build/Database/Drivers/SQLite/SqliteDriver.js.map +1 -0
- package/build/Database/Drivers/SQLite/index.d.ts +3 -0
- package/build/Database/Drivers/SQLite/index.d.ts.map +1 -0
- package/build/Database/Drivers/SQLite/index.js +31 -0
- package/build/Database/Drivers/SQLite/index.js.map +1 -0
- package/build/Database/Drivers/SchemaContract.d.ts +9 -0
- package/build/Database/Drivers/SchemaContract.d.ts.map +1 -0
- package/build/Database/Drivers/SchemaContract.js +11 -0
- package/build/Database/Drivers/SchemaContract.js.map +1 -0
- package/build/Database/Drivers/Statement.d.ts +10 -0
- package/build/Database/Drivers/Statement.d.ts.map +1 -0
- package/build/Database/Drivers/Statement.js +17 -0
- package/build/Database/Drivers/Statement.js.map +1 -0
- package/build/Database/Drivers/index.d.ts +5 -0
- package/build/Database/Drivers/index.d.ts.map +1 -0
- package/build/Database/Drivers/index.js +21 -0
- package/build/Database/Drivers/index.js.map +1 -0
- package/build/Database/Entity.d.ts +64 -0
- package/build/Database/Entity.d.ts.map +1 -0
- package/build/Database/Entity.js +243 -0
- package/build/Database/Entity.js.map +1 -0
- package/build/Database/EntityNotFoundError.d.ts +6 -0
- package/build/Database/EntityNotFoundError.d.ts.map +1 -0
- package/build/Database/EntityNotFoundError.js +12 -0
- package/build/Database/EntityNotFoundError.js.map +1 -0
- package/build/Database/EntityProxyHandler.d.ts +6 -0
- package/build/Database/EntityProxyHandler.d.ts.map +1 -0
- package/build/Database/EntityProxyHandler.js +40 -0
- package/build/Database/EntityProxyHandler.js.map +1 -0
- package/build/Database/EntityQuery.d.ts +29 -0
- package/build/Database/EntityQuery.d.ts.map +1 -0
- package/build/Database/EntityQuery.js +158 -0
- package/build/Database/EntityQuery.js.map +1 -0
- package/build/Database/Expression.d.ts +4 -0
- package/build/Database/Expression.d.ts.map +1 -0
- package/build/Database/Expression.js +7 -0
- package/build/Database/Expression.js.map +1 -0
- package/build/Database/Fields.d.ts +156 -0
- package/build/Database/Fields.d.ts.map +1 -0
- package/build/Database/Fields.js +564 -0
- package/build/Database/Fields.js.map +1 -0
- package/build/Database/Helpers.d.ts +2 -0
- package/build/Database/Helpers.d.ts.map +1 -0
- package/build/Database/Helpers.js +16 -0
- package/build/Database/Helpers.js.map +1 -0
- package/build/Database/List.d.ts +24 -0
- package/build/Database/List.d.ts.map +1 -0
- package/build/Database/List.js +48 -0
- package/build/Database/List.js.map +1 -0
- package/build/Database/Migrations/Migration.d.ts +8 -0
- package/build/Database/Migrations/Migration.d.ts.map +1 -0
- package/build/Database/Migrations/Migration.js +11 -0
- package/build/Database/Migrations/Migration.js.map +1 -0
- package/build/Database/Migrations/MigrationHistory.d.ts +9 -0
- package/build/Database/Migrations/MigrationHistory.d.ts.map +1 -0
- package/build/Database/Migrations/MigrationHistory.js +43 -0
- package/build/Database/Migrations/MigrationHistory.js.map +1 -0
- package/build/Database/Migrations/Migrator.d.ts +21 -0
- package/build/Database/Migrations/Migrator.d.ts.map +1 -0
- package/build/Database/Migrations/Migrator.js +135 -0
- package/build/Database/Migrations/Migrator.js.map +1 -0
- package/build/Database/Migrations/index.d.ts +4 -0
- package/build/Database/Migrations/index.d.ts.map +1 -0
- package/build/Database/Migrations/index.js +20 -0
- package/build/Database/Migrations/index.js.map +1 -0
- package/build/Database/ORM/BaseRelationship.d.ts +8 -0
- package/build/Database/ORM/BaseRelationship.d.ts.map +1 -0
- package/build/Database/ORM/BaseRelationship.js +13 -0
- package/build/Database/ORM/BaseRelationship.js.map +1 -0
- package/build/Database/Query.d.ts +63 -0
- package/build/Database/Query.d.ts.map +1 -0
- package/build/Database/Query.js +264 -0
- package/build/Database/Query.js.map +1 -0
- package/build/Database/Seeders/Seeder.d.ts +4 -0
- package/build/Database/Seeders/Seeder.d.ts.map +1 -0
- package/build/Database/Seeders/Seeder.js +7 -0
- package/build/Database/Seeders/Seeder.js.map +1 -0
- package/build/Database/Seeders/SeederManager.d.ts +9 -0
- package/build/Database/Seeders/SeederManager.d.ts.map +1 -0
- package/build/Database/Seeders/SeederManager.js +27 -0
- package/build/Database/Seeders/SeederManager.js.map +1 -0
- package/build/Database/Seeders/index.d.ts +3 -0
- package/build/Database/Seeders/index.d.ts.map +1 -0
- package/build/Database/Seeders/index.js +19 -0
- package/build/Database/Seeders/index.js.map +1 -0
- package/build/Database/StringExpression.d.ts +7 -0
- package/build/Database/StringExpression.d.ts.map +1 -0
- package/build/Database/StringExpression.js +16 -0
- package/build/Database/StringExpression.js.map +1 -0
- package/build/Database/Types.d.ts +118 -0
- package/build/Database/Types.d.ts.map +1 -0
- package/build/Database/Types.js +106 -0
- package/build/Database/Types.js.map +1 -0
- package/build/Database/index.d.ts +21 -0
- package/build/Database/index.d.ts.map +1 -0
- package/build/Database/index.js +25 -0
- package/build/Database/index.js.map +1 -0
- package/build/Encryption/index.d.ts +15 -0
- package/build/Encryption/index.d.ts.map +1 -0
- package/build/Encryption/index.js +68 -0
- package/build/Encryption/index.js.map +1 -0
- package/build/Forms/Decorators.d.ts +7 -0
- package/build/Forms/Decorators.d.ts.map +1 -0
- package/build/Forms/Decorators.js +29 -0
- package/build/Forms/Decorators.js.map +1 -0
- package/build/Forms/Form.d.ts +18 -0
- package/build/Forms/Form.d.ts.map +1 -0
- package/build/Forms/Form.js +68 -0
- package/build/Forms/Form.js.map +1 -0
- package/build/Forms/FormFields.d.ts +10 -0
- package/build/Forms/FormFields.d.ts.map +1 -0
- package/build/Forms/FormFields.js +39 -0
- package/build/Forms/FormFields.js.map +1 -0
- package/build/Forms/index.d.ts +4 -0
- package/build/Forms/index.d.ts.map +1 -0
- package/build/Forms/index.js +20 -0
- package/build/Forms/index.js.map +1 -0
- package/build/Framework/App.d.ts +7 -0
- package/build/Framework/App.d.ts.map +1 -0
- package/build/Framework/App.js +11 -0
- package/build/Framework/App.js.map +1 -0
- package/build/Framework/Application.d.ts +17 -0
- package/build/Framework/Application.d.ts.map +1 -0
- package/build/Framework/Application.js +94 -0
- package/build/Framework/Application.js.map +1 -0
- package/build/Framework/Auth/Auth.d.ts +24 -0
- package/build/Framework/Auth/Auth.d.ts.map +1 -0
- package/build/Framework/Auth/Auth.js +116 -0
- package/build/Framework/Auth/Auth.js.map +1 -0
- package/build/Framework/Auth/Authenticatable.d.ts +7 -0
- package/build/Framework/Auth/Authenticatable.d.ts.map +1 -0
- package/build/Framework/Auth/Authenticatable.js +3 -0
- package/build/Framework/Auth/Authenticatable.js.map +1 -0
- package/build/Framework/Auth/User.d.ts +11 -0
- package/build/Framework/Auth/User.d.ts.map +1 -0
- package/build/Framework/Auth/User.js +41 -0
- package/build/Framework/Auth/User.js.map +1 -0
- package/build/Framework/Auth/index.d.ts +6 -0
- package/build/Framework/Auth/index.d.ts.map +1 -0
- package/build/Framework/Auth/index.js +44 -0
- package/build/Framework/Auth/index.js.map +1 -0
- package/build/Framework/Config/AppConfig.d.ts +26 -0
- package/build/Framework/Config/AppConfig.d.ts.map +1 -0
- package/build/Framework/Config/AppConfig.js +20 -0
- package/build/Framework/Config/AppConfig.js.map +1 -0
- package/build/Framework/Config/AuthConfig.d.ts +11 -0
- package/build/Framework/Config/AuthConfig.d.ts.map +1 -0
- package/build/Framework/Config/AuthConfig.js +13 -0
- package/build/Framework/Config/AuthConfig.js.map +1 -0
- package/build/Framework/Config/BaseConfig.d.ts +7 -0
- package/build/Framework/Config/BaseConfig.d.ts.map +1 -0
- package/build/Framework/Config/BaseConfig.js +14 -0
- package/build/Framework/Config/BaseConfig.js.map +1 -0
- package/build/Framework/Config/CacheConfig.d.ts +16 -0
- package/build/Framework/Config/CacheConfig.d.ts.map +1 -0
- package/build/Framework/Config/CacheConfig.js +37 -0
- package/build/Framework/Config/CacheConfig.js.map +1 -0
- package/build/Framework/Config/DatabaseConfig.d.ts +11 -0
- package/build/Framework/Config/DatabaseConfig.d.ts.map +1 -0
- package/build/Framework/Config/DatabaseConfig.js +23 -0
- package/build/Framework/Config/DatabaseConfig.js.map +1 -0
- package/build/Framework/Config/MailConfig.d.ts +19 -0
- package/build/Framework/Config/MailConfig.d.ts.map +1 -0
- package/build/Framework/Config/MailConfig.js +11 -0
- package/build/Framework/Config/MailConfig.js.map +1 -0
- package/build/Framework/Config/index.d.ts +7 -0
- package/build/Framework/Config/index.d.ts.map +1 -0
- package/build/Framework/Config/index.js +23 -0
- package/build/Framework/Config/index.js.map +1 -0
- package/build/Framework/Middleware/AuthMiddleware.d.ts +9 -0
- package/build/Framework/Middleware/AuthMiddleware.d.ts.map +1 -0
- package/build/Framework/Middleware/AuthMiddleware.js +78 -0
- package/build/Framework/Middleware/AuthMiddleware.js.map +1 -0
- package/build/Framework/Middleware/CorsMiddleware.d.ts +8 -0
- package/build/Framework/Middleware/CorsMiddleware.d.ts.map +1 -0
- package/build/Framework/Middleware/CorsMiddleware.js +47 -0
- package/build/Framework/Middleware/CorsMiddleware.js.map +1 -0
- package/build/Framework/Middleware/StaticAssetsMiddleware.d.ts +16 -0
- package/build/Framework/Middleware/StaticAssetsMiddleware.d.ts.map +1 -0
- package/build/Framework/Middleware/StaticAssetsMiddleware.js +120 -0
- package/build/Framework/Middleware/StaticAssetsMiddleware.js.map +1 -0
- package/build/Framework/Middleware/index.d.ts +3 -0
- package/build/Framework/Middleware/index.d.ts.map +1 -0
- package/build/Framework/Middleware/index.js +19 -0
- package/build/Framework/Middleware/index.js.map +1 -0
- package/build/Framework/Provider.d.ts +6 -0
- package/build/Framework/Provider.d.ts.map +1 -0
- package/build/Framework/Provider.js +22 -0
- package/build/Framework/Provider.js.map +1 -0
- package/build/Framework/Providers/CacheProvider.d.ts +7 -0
- package/build/Framework/Providers/CacheProvider.d.ts.map +1 -0
- package/build/Framework/Providers/CacheProvider.js +40 -0
- package/build/Framework/Providers/CacheProvider.js.map +1 -0
- package/build/Framework/Providers/DatabaseProvider.d.ts +10 -0
- package/build/Framework/Providers/DatabaseProvider.d.ts.map +1 -0
- package/build/Framework/Providers/DatabaseProvider.js +80 -0
- package/build/Framework/Providers/DatabaseProvider.js.map +1 -0
- package/build/Framework/Providers/MailProvider.d.ts +7 -0
- package/build/Framework/Providers/MailProvider.d.ts.map +1 -0
- package/build/Framework/Providers/MailProvider.js +41 -0
- package/build/Framework/Providers/MailProvider.js.map +1 -0
- package/build/Framework/Providers/WebsocketsProvider.d.ts +12 -0
- package/build/Framework/Providers/WebsocketsProvider.d.ts.map +1 -0
- package/build/Framework/Providers/WebsocketsProvider.js +144 -0
- package/build/Framework/Providers/WebsocketsProvider.js.map +1 -0
- package/build/Framework/Resolvers/AuthResolver.d.ts +6 -0
- package/build/Framework/Resolvers/AuthResolver.d.ts.map +1 -0
- package/build/Framework/Resolvers/AuthResolver.js +19 -0
- package/build/Framework/Resolvers/AuthResolver.js.map +1 -0
- package/build/Framework/Resolvers/EntityResolver.d.ts +10 -0
- package/build/Framework/Resolvers/EntityResolver.d.ts.map +1 -0
- package/build/Framework/Resolvers/EntityResolver.js +40 -0
- package/build/Framework/Resolvers/EntityResolver.js.map +1 -0
- package/build/Framework/Resolvers/FormResolver.d.ts +10 -0
- package/build/Framework/Resolvers/FormResolver.d.ts.map +1 -0
- package/build/Framework/Resolvers/FormResolver.js +34 -0
- package/build/Framework/Resolvers/FormResolver.js.map +1 -0
- package/build/Framework/RootDir.d.ts +3 -0
- package/build/Framework/RootDir.d.ts.map +1 -0
- package/build/Framework/RootDir.js +7 -0
- package/build/Framework/RootDir.js.map +1 -0
- package/build/Framework/index.d.ts +9 -0
- package/build/Framework/index.d.ts.map +1 -0
- package/build/Framework/index.js +25 -0
- package/build/Framework/index.js.map +1 -0
- package/build/Mail/MailAddress.d.ts +5 -0
- package/build/Mail/MailAddress.d.ts.map +1 -0
- package/build/Mail/MailAddress.js +3 -0
- package/build/Mail/MailAddress.js.map +1 -0
- package/build/Mail/MailTransport.d.ts +6 -0
- package/build/Mail/MailTransport.d.ts.map +1 -0
- package/build/Mail/MailTransport.js +7 -0
- package/build/Mail/MailTransport.js.map +1 -0
- package/build/Mail/Mailable.d.ts +18 -0
- package/build/Mail/Mailable.d.ts.map +1 -0
- package/build/Mail/Mailable.js +17 -0
- package/build/Mail/Mailable.js.map +1 -0
- package/build/Mail/Mailer.d.ts +12 -0
- package/build/Mail/Mailer.d.ts.map +1 -0
- package/build/Mail/Mailer.js +27 -0
- package/build/Mail/Mailer.js.map +1 -0
- package/build/Mail/PendingMail.d.ts +30 -0
- package/build/Mail/PendingMail.d.ts.map +1 -0
- package/build/Mail/PendingMail.js +54 -0
- package/build/Mail/PendingMail.js.map +1 -0
- package/build/Mail/SentMessage.d.ts +16 -0
- package/build/Mail/SentMessage.d.ts.map +1 -0
- package/build/Mail/SentMessage.js +20 -0
- package/build/Mail/SentMessage.js.map +1 -0
- package/build/Mail/Transports/MemoryTransport.d.ts +8 -0
- package/build/Mail/Transports/MemoryTransport.d.ts.map +1 -0
- package/build/Mail/Transports/MemoryTransport.js +15 -0
- package/build/Mail/Transports/MemoryTransport.js.map +1 -0
- package/build/Mail/Transports/SendGridTransport.d.ts +11 -0
- package/build/Mail/Transports/SendGridTransport.d.ts.map +1 -0
- package/build/Mail/Transports/SendGridTransport.js +106 -0
- package/build/Mail/Transports/SendGridTransport.js.map +1 -0
- package/build/Mail/index.d.ts +4 -0
- package/build/Mail/index.d.ts.map +1 -0
- package/build/Mail/index.js +20 -0
- package/build/Mail/index.js.map +1 -0
- package/build/Models/Model.d.ts +10 -0
- package/build/Models/Model.d.ts.map +1 -0
- package/build/Models/Model.js +36 -0
- package/build/Models/Model.js.map +1 -0
- package/build/Models/index.d.ts +22 -0
- package/build/Models/index.d.ts.map +1 -0
- package/build/Models/index.js +64 -0
- package/build/Models/index.js.map +1 -0
- package/build/Router/BaseController.d.ts +5 -0
- package/build/Router/BaseController.d.ts.map +1 -0
- package/build/Router/BaseController.js +22 -0
- package/build/Router/BaseController.js.map +1 -0
- package/build/Router/Decorators.d.ts +19 -0
- package/build/Router/Decorators.d.ts.map +1 -0
- package/build/Router/Decorators.js +175 -0
- package/build/Router/Decorators.js.map +1 -0
- package/build/Router/Guard.d.ts +5 -0
- package/build/Router/Guard.d.ts.map +1 -0
- package/build/Router/Guard.js +11 -0
- package/build/Router/Guard.js.map +1 -0
- package/build/Router/Http/Contracts.d.ts +4 -0
- package/build/Router/Http/Contracts.d.ts.map +1 -0
- package/build/Router/Http/Contracts.js +3 -0
- package/build/Router/Http/Contracts.js.map +1 -0
- package/build/Router/Http/ErrorHandler.d.ts +10 -0
- package/build/Router/Http/ErrorHandler.d.ts.map +1 -0
- package/build/Router/Http/ErrorHandler.js +53 -0
- package/build/Router/Http/ErrorHandler.js.map +1 -0
- package/build/Router/Http/ErrorHandlerInterface.d.ts +6 -0
- package/build/Router/Http/ErrorHandlerInterface.d.ts.map +1 -0
- package/build/Router/Http/ErrorHandlerInterface.js +8 -0
- package/build/Router/Http/ErrorHandlerInterface.js.map +1 -0
- package/build/Router/Http/Errors/HttpError.d.ts +8 -0
- package/build/Router/Http/Errors/HttpError.d.ts.map +1 -0
- package/build/Router/Http/Errors/HttpError.js +18 -0
- package/build/Router/Http/Errors/HttpError.js.map +1 -0
- package/build/Router/Http/Handler.d.ts +19 -0
- package/build/Router/Http/Handler.d.ts.map +1 -0
- package/build/Router/Http/Handler.js +164 -0
- package/build/Router/Http/Handler.js.map +1 -0
- package/build/Router/Http/HttpRoute.d.ts +25 -0
- package/build/Router/Http/HttpRoute.d.ts.map +1 -0
- package/build/Router/Http/HttpRoute.js +97 -0
- package/build/Router/Http/HttpRoute.js.map +1 -0
- package/build/Router/Http/Middleware.d.ts +7 -0
- package/build/Router/Http/Middleware.d.ts.map +1 -0
- package/build/Router/Http/Middleware.js +8 -0
- package/build/Router/Http/Middleware.js.map +1 -0
- package/build/Router/Http/Request.d.ts +38 -0
- package/build/Router/Http/Request.d.ts.map +1 -0
- package/build/Router/Http/Request.js +211 -0
- package/build/Router/Http/Request.js.map +1 -0
- package/build/Router/Http/Response.d.ts +14 -0
- package/build/Router/Http/Response.d.ts.map +1 -0
- package/build/Router/Http/Response.js +31 -0
- package/build/Router/Http/Response.js.map +1 -0
- package/build/Router/Http/index.d.ts +84 -0
- package/build/Router/Http/index.d.ts.map +1 -0
- package/build/Router/Http/index.js +104 -0
- package/build/Router/Http/index.js.map +1 -0
- package/build/Router/Metadata.d.ts +41 -0
- package/build/Router/Metadata.d.ts.map +1 -0
- package/build/Router/Metadata.js +33 -0
- package/build/Router/Metadata.js.map +1 -0
- package/build/Router/Middleware.d.ts +13 -0
- package/build/Router/Middleware.d.ts.map +1 -0
- package/build/Router/Middleware.js +7 -0
- package/build/Router/Middleware.js.map +1 -0
- package/build/Router/Request.d.ts +24 -0
- package/build/Router/Request.d.ts.map +1 -0
- package/build/Router/Request.js +44 -0
- package/build/Router/Request.js.map +1 -0
- package/build/Router/Route.d.ts +13 -0
- package/build/Router/Route.d.ts.map +1 -0
- package/build/Router/Route.js +20 -0
- package/build/Router/Route.js.map +1 -0
- package/build/Router/RouteNotFoundError.d.ts +4 -0
- package/build/Router/RouteNotFoundError.d.ts.map +1 -0
- package/build/Router/RouteNotFoundError.js +10 -0
- package/build/Router/RouteNotFoundError.js.map +1 -0
- package/build/Router/Router.d.ts +19 -0
- package/build/Router/Router.d.ts.map +1 -0
- package/build/Router/Router.js +36 -0
- package/build/Router/Router.js.map +1 -0
- package/build/Router/Servers/index.d.ts +5 -0
- package/build/Router/Servers/index.d.ts.map +1 -0
- package/build/Router/Servers/index.js +19 -0
- package/build/Router/Servers/index.js.map +1 -0
- package/build/Router/Servers/node.d.ts +3 -0
- package/build/Router/Servers/node.d.ts.map +1 -0
- package/build/Router/Servers/node.js +41 -0
- package/build/Router/Servers/node.js.map +1 -0
- package/build/Router/Servers/uNetworking.d.ts +3 -0
- package/build/Router/Servers/uNetworking.d.ts.map +1 -0
- package/build/Router/Servers/uNetworking.js +172 -0
- package/build/Router/Servers/uNetworking.js.map +1 -0
- package/build/Router/Websockets/Handler.d.ts +15 -0
- package/build/Router/Websockets/Handler.d.ts.map +1 -0
- package/build/Router/Websockets/Handler.js +70 -0
- package/build/Router/Websockets/Handler.js.map +1 -0
- package/build/Router/Websockets/Middleware.d.ts +7 -0
- package/build/Router/Websockets/Middleware.d.ts.map +1 -0
- package/build/Router/Websockets/Middleware.js +8 -0
- package/build/Router/Websockets/Middleware.js.map +1 -0
- package/build/Router/Websockets/Request.d.ts +4 -0
- package/build/Router/Websockets/Request.d.ts.map +1 -0
- package/build/Router/Websockets/Request.js +8 -0
- package/build/Router/Websockets/Request.js.map +1 -0
- package/build/Router/Websockets/WebsocketRoute.d.ts +7 -0
- package/build/Router/Websockets/WebsocketRoute.d.ts.map +1 -0
- package/build/Router/Websockets/WebsocketRoute.js +47 -0
- package/build/Router/Websockets/WebsocketRoute.js.map +1 -0
- package/build/Router/Websockets/index.d.ts +19 -0
- package/build/Router/Websockets/index.d.ts.map +1 -0
- package/build/Router/Websockets/index.js +68 -0
- package/build/Router/Websockets/index.js.map +1 -0
- package/build/Router/Websockets/types.d.ts +22 -0
- package/build/Router/Websockets/types.d.ts.map +1 -0
- package/build/Router/Websockets/types.js +9 -0
- package/build/Router/Websockets/types.js.map +1 -0
- package/build/Router/index.d.ts +7 -0
- package/build/Router/index.d.ts.map +1 -0
- package/build/Router/index.js +23 -0
- package/build/Router/index.js.map +1 -0
- package/build/Storage/File.d.ts +12 -0
- package/build/Storage/File.d.ts.map +1 -0
- package/build/Storage/File.js +65 -0
- package/build/Storage/File.js.map +1 -0
- package/build/Storage/Image.d.ts +4 -0
- package/build/Storage/Image.d.ts.map +1 -0
- package/build/Storage/Image.js +8 -0
- package/build/Storage/Image.js.map +1 -0
- package/build/Storage/InvalidImage.d.ts +4 -0
- package/build/Storage/InvalidImage.d.ts.map +1 -0
- package/build/Storage/InvalidImage.js +8 -0
- package/build/Storage/InvalidImage.js.map +1 -0
- package/build/Storage/Storage.d.ts +13 -0
- package/build/Storage/Storage.d.ts.map +1 -0
- package/build/Storage/Storage.js +120 -0
- package/build/Storage/Storage.js.map +1 -0
- package/build/Storage/index.d.ts +5 -0
- package/build/Storage/index.d.ts.map +1 -0
- package/build/Storage/index.js +21 -0
- package/build/Storage/index.js.map +1 -0
- package/build/Storage/utils.d.ts +5 -0
- package/build/Storage/utils.d.ts.map +1 -0
- package/build/Storage/utils.js +20 -0
- package/build/Storage/utils.js.map +1 -0
- package/build/Support/Array.d.ts +29 -0
- package/build/Support/Array.d.ts.map +1 -0
- package/build/Support/Array.js +112 -0
- package/build/Support/Array.js.map +1 -0
- package/build/Support/Math.d.ts +7 -0
- package/build/Support/Math.d.ts.map +1 -0
- package/build/Support/Math.js +8 -0
- package/build/Support/Math.js.map +1 -0
- package/build/Support/Metadata.d.ts +16 -0
- package/build/Support/Metadata.d.ts.map +1 -0
- package/build/Support/Metadata.js +33 -0
- package/build/Support/Metadata.js.map +1 -0
- package/build/Support/String.d.ts +12 -0
- package/build/Support/String.d.ts.map +1 -0
- package/build/Support/String.js +24 -0
- package/build/Support/String.js.map +1 -0
- package/build/Support/index.d.ts +16 -0
- package/build/Support/index.d.ts.map +1 -0
- package/build/Support/index.js +7 -0
- package/build/Support/index.js.map +1 -0
- package/build/Support/utils.d.ts +2 -0
- package/build/Support/utils.d.ts.map +1 -0
- package/build/Support/utils.js +12 -0
- package/build/Support/utils.js.map +1 -0
- package/build/Testing/TestCase.d.ts +33 -0
- package/build/Testing/TestCase.d.ts.map +1 -0
- package/build/Testing/TestCase.js +138 -0
- package/build/Testing/TestCase.js.map +1 -0
- package/build/Validation/Rule.d.ts +7 -0
- package/build/Validation/Rule.d.ts.map +1 -0
- package/build/Validation/Rule.js +7 -0
- package/build/Validation/Rule.js.map +1 -0
- package/build/Validation/RuleInterface.d.ts +7 -0
- package/build/Validation/RuleInterface.d.ts.map +1 -0
- package/build/Validation/RuleInterface.js +3 -0
- package/build/Validation/RuleInterface.js.map +1 -0
- package/build/Validation/Rules/Email.d.ts +4 -0
- package/build/Validation/Rules/Email.d.ts.map +1 -0
- package/build/Validation/Rules/Email.js +17 -0
- package/build/Validation/Rules/Email.js.map +1 -0
- package/build/Validation/Rules/FileExtension.d.ts +4 -0
- package/build/Validation/Rules/FileExtension.d.ts.map +1 -0
- package/build/Validation/Rules/FileExtension.js +19 -0
- package/build/Validation/Rules/FileExtension.js.map +1 -0
- package/build/Validation/Rules/MaxLength.d.ts +4 -0
- package/build/Validation/Rules/MaxLength.d.ts.map +1 -0
- package/build/Validation/Rules/MaxLength.js +16 -0
- package/build/Validation/Rules/MaxLength.js.map +1 -0
- package/build/Validation/Rules/MinLength.d.ts +4 -0
- package/build/Validation/Rules/MinLength.d.ts.map +1 -0
- package/build/Validation/Rules/MinLength.js +16 -0
- package/build/Validation/Rules/MinLength.js.map +1 -0
- package/build/Validation/Rules/Optional.d.ts +4 -0
- package/build/Validation/Rules/Optional.d.ts.map +1 -0
- package/build/Validation/Rules/Optional.js +16 -0
- package/build/Validation/Rules/Optional.js.map +1 -0
- package/build/Validation/Rules/Required.d.ts +4 -0
- package/build/Validation/Rules/Required.d.ts.map +1 -0
- package/build/Validation/Rules/Required.js +24 -0
- package/build/Validation/Rules/Required.js.map +1 -0
- package/build/Validation/Validator.d.ts +12 -0
- package/build/Validation/Validator.d.ts.map +1 -0
- package/build/Validation/Validator.js +13 -0
- package/build/Validation/Validator.js.map +1 -0
- package/build/Validation/index.d.ts +11 -0
- package/build/Validation/index.d.ts.map +1 -0
- package/build/Validation/index.js +27 -0
- package/build/Validation/index.js.map +1 -0
- package/package.json +10 -15
- package/.automaker/app_spec.txt +0 -440
- package/.automaker/categories.json +0 -1
- package/.automaker/features/a-b-testing-framework/feature.json +0 -14
- package/.automaker/features/account-lockout-protection/feature.json +0 -14
- package/.automaker/features/api-versioning/feature.json +0 -14
- package/.automaker/features/background-job-processing/feature.json +0 -12
- package/.automaker/features/cloud-storage-integration/feature.json +0 -14
- package/.automaker/features/compression-middleware/feature.json +0 -14
- package/.automaker/features/cors-and-security-headers/feature.json +0 -14
- package/.automaker/features/currency-and-timezone/feature.json +0 -14
- package/.automaker/features/database-backup-restore/feature.json +0 -14
- package/.automaker/features/database-query-logging/feature.json +0 -15
- package/.automaker/features/database-transaction-support/feature.json +0 -14
- package/.automaker/features/discord-notifications-channel/feature.json +0 -14
- package/.automaker/features/eager-loading-optimization/feature.json +0 -14
- package/.automaker/features/email-notifications-channel/feature.json +0 -14
- package/.automaker/features/error-tracking-integration/feature.json +0 -14
- package/.automaker/features/feature-flags/feature.json +0 -12
- package/.automaker/features/file-upload-handling/feature.json +0 -14
- package/.automaker/features/form-builder/feature.json +0 -14
- package/.automaker/features/full-text-search/feature.json +0 -14
- package/.automaker/features/graphql-api-support/feature.json +0 -14
- package/.automaker/features/graphql-documentation/feature.json +0 -14
- package/.automaker/features/graphql-subscriptions/feature.json +0 -15
- package/.automaker/features/html-view-rendering/feature.json +0 -14
- package/.automaker/features/http2-support/feature.json +0 -14
- package/.automaker/features/http3-quic-support/feature.json +0 -14
- package/.automaker/features/image-processing/feature.json +0 -14
- package/.automaker/features/internationalization-i18n/feature.json +0 -12
- package/.automaker/features/job-retries-and-failures/feature.json +0 -14
- package/.automaker/features/job-scheduling/feature.json +0 -14
- package/.automaker/features/locale-detection/feature.json +0 -14
- package/.automaker/features/log-rotation/feature.json +0 -14
- package/.automaker/features/logging-system/feature.json +0 -12
- package/.automaker/features/oauth-authentication/feature.json +0 -14
- package/.automaker/features/pagination-component/feature.json +0 -14
- package/.automaker/features/password-reset-flow/feature.json +0 -14
- package/.automaker/features/performance-monitoring/feature.json +0 -14
- package/.automaker/features/permission-management/feature.json +0 -14
- package/.automaker/features/policy-based-authorization/feature.json +0 -14
- package/.automaker/features/polymorphic-relationships/feature.json +0 -14
- package/.automaker/features/query-scopes/feature.json +0 -14
- package/.automaker/features/rate-limiting/feature.json +0 -14
- package/.automaker/features/request-validation-middleware/feature.json +0 -14
- package/.automaker/features/response-caching-headers/feature.json +0 -14
- package/.automaker/features/rest-api-documentation/feature.json +0 -14
- package/.automaker/features/role-based-access-control/feature.json +0 -14
- package/.automaker/features/session-management/feature.json +0 -14
- package/.automaker/features/session-middleware/feature.json +0 -14
- package/.automaker/features/slack-notifications-channel/feature.json +0 -14
- package/.automaker/features/sms-notifications-channel/feature.json +0 -14
- package/.automaker/features/soft-deletes/feature.json +0 -14
- package/.automaker/features/structured-logging/feature.json +0 -14
- package/.automaker/features/timestamps-and-auditing/feature.json +0 -14
- package/.automaker/features/two-factor-authentication/feature.json +0 -14
- package/.automaker/features/view-helpers-utilities/feature.json +0 -14
- package/.automaker/features/webhook-notifications/feature.json +0 -14
- package/.claude/settings.local.json +0 -10
- package/.editorconfig +0 -11
- package/.mocharc.json +0 -13
- package/CONTRIBUTING.md +0 -9
- package/Cache/Cache.ts +0 -13
- package/Cache/Stores/DatabaseStore.ts +0 -120
- package/Cache/Stores/FileStore.ts +0 -69
- package/Cache/Stores/MemoryStore.ts +0 -71
- package/Cache/index.ts +0 -5
- package/Cache/types.ts +0 -4
- package/Container/ClassResolver.ts +0 -106
- package/Container/Container.ts +0 -144
- package/Container/Contracts.ts +0 -3
- package/Container/Decorators.ts +0 -20
- package/Container/Metadata.ts +0 -16
- package/Container/Resolver.ts +0 -27
- package/Container/index.ts +0 -5
- package/Database/Clauses/Where.ts +0 -0
- package/Database/Connection.ts +0 -52
- package/Database/Decorators.ts +0 -142
- package/Database/Drivers/DatabaseDriver.ts +0 -37
- package/Database/Drivers/MySQL/Alter/index.ts +0 -55
- package/Database/Drivers/MySQL/ColumnDefinition.ts +0 -16
- package/Database/Drivers/MySQL/Create.ts +0 -47
- package/Database/Drivers/MySQL/MysqlDriver.ts +0 -123
- package/Database/Drivers/MySQL/Schema.ts +0 -82
- package/Database/Drivers/MySQL/index.ts +0 -13
- package/Database/Drivers/SQL/Schema.ts +0 -73
- package/Database/Drivers/SQL/Statements/Alter.ts +0 -22
- package/Database/Drivers/SQL/Statements/BaseStatement.ts +0 -55
- package/Database/Drivers/SQL/Statements/Delete.ts +0 -20
- package/Database/Drivers/SQL/Statements/Insert.ts +0 -24
- package/Database/Drivers/SQL/Statements/Select.ts +0 -55
- package/Database/Drivers/SQL/Statements/Update.ts +0 -33
- package/Database/Drivers/SQL/index.ts +0 -8
- package/Database/Drivers/SQLite/Create.ts +0 -45
- package/Database/Drivers/SQLite/Schema.ts +0 -54
- package/Database/Drivers/SQLite/SqliteDriver.ts +0 -144
- package/Database/Drivers/SQLite/index.ts +0 -15
- package/Database/Drivers/SchemaContract.ts +0 -11
- package/Database/Drivers/Statement.ts +0 -16
- package/Database/Drivers/index.ts +0 -4
- package/Database/Entity.ts +0 -377
- package/Database/EntityNotFoundError.ts +0 -5
- package/Database/EntityProxyHandler.ts +0 -43
- package/Database/EntityQuery.ts +0 -197
- package/Database/Expression.ts +0 -3
- package/Database/Fields.ts +0 -816
- package/Database/Helpers.ts +0 -12
- package/Database/List.ts +0 -71
- package/Database/Migrations/Migration.ts +0 -10
- package/Database/Migrations/MigrationHistory.ts +0 -20
- package/Database/Migrations/Migrator.ts +0 -122
- package/Database/Migrations/index.ts +0 -3
- package/Database/ORM/BaseRelationship.ts +0 -10
- package/Database/Query.ts +0 -374
- package/Database/Seeders/Seeder.ts +0 -3
- package/Database/Seeders/SeederManager.ts +0 -27
- package/Database/Seeders/index.ts +0 -2
- package/Database/StringExpression.ts +0 -9
- package/Database/Types.ts +0 -165
- package/Database/index.ts +0 -23
- package/Encryption/index.ts +0 -51
- package/Forms/Decorators.ts +0 -29
- package/Forms/Form.ts +0 -70
- package/Forms/FormFields.ts +0 -36
- package/Forms/index.ts +0 -3
- package/Framework/App.ts +0 -10
- package/Framework/Application.ts +0 -118
- package/Framework/Auth/Auth.ts +0 -122
- package/Framework/Auth/Authenticatable.ts +0 -9
- package/Framework/Auth/User.ts +0 -27
- package/Framework/Auth/index.ts +0 -29
- package/Framework/Config/AppConfig.ts +0 -25
- package/Framework/Config/AuthConfig.ts +0 -11
- package/Framework/Config/BaseConfig.ts +0 -9
- package/Framework/Config/CacheConfig.ts +0 -38
- package/Framework/Config/DatabaseConfig.ts +0 -21
- package/Framework/Config/MailConfig.ts +0 -30
- package/Framework/Config/index.ts +0 -6
- package/Framework/Middleware/AuthMiddleware.ts +0 -31
- package/Framework/Middleware/CorsMiddleware.ts +0 -32
- package/Framework/Middleware/StaticAssetsMiddleware.ts +0 -76
- package/Framework/Middleware/index.ts +0 -2
- package/Framework/Provider.ts +0 -9
- package/Framework/Providers/CacheProvider.ts +0 -28
- package/Framework/Providers/DatabaseProvider.ts +0 -36
- package/Framework/Providers/MailProvider.ts +0 -31
- package/Framework/Providers/WebsocketsProvider.ts +0 -141
- package/Framework/Resolvers/AuthResolver.ts +0 -23
- package/Framework/Resolvers/EntityResolver.ts +0 -41
- package/Framework/Resolvers/FormResolver.ts +0 -37
- package/Framework/RootDir.ts +0 -1
- package/Framework/index.ts +0 -8
- package/Frontend/Angular/Readme.md +0 -7
- package/Frontend/Angular/index.ts +0 -24
- package/Frontend/Angular/package-lock.json +0 -2767
- package/Frontend/Angular/package.json +0 -38
- package/Frontend/Angular/tsconfig.json +0 -20
- package/Frontend/Websockets/Readme.md +0 -86
- package/Frontend/Websockets/index.ts +0 -99
- package/Frontend/Websockets/package-lock.json +0 -4371
- package/Frontend/Websockets/package.json +0 -45
- package/Frontend/Websockets/tsc-alias.config.json +0 -7
- package/Frontend/Websockets/tsconfig.json +0 -20
- package/Mail/MailAddress.ts +0 -4
- package/Mail/MailTransport.ts +0 -6
- package/Mail/Mailable.ts +0 -16
- package/Mail/Mailer.ts +0 -27
- package/Mail/PendingMail.ts +0 -68
- package/Mail/SentMessage.ts +0 -20
- package/Mail/Transports/MemoryTransport.ts +0 -13
- package/Mail/Transports/SendGridTransport.ts +0 -95
- package/Mail/index.ts +0 -3
- package/Models/Model.ts +0 -41
- package/Models/index.ts +0 -54
- package/Router/BaseController.ts +0 -7
- package/Router/Decorators.ts +0 -224
- package/Router/Guard.ts +0 -10
- package/Router/Http/Contracts.ts +0 -4
- package/Router/Http/ErrorHandler.ts +0 -45
- package/Router/Http/ErrorHandlerInterface.ts +0 -6
- package/Router/Http/Errors/HttpError.ts +0 -15
- package/Router/Http/Handler.ts +0 -183
- package/Router/Http/HttpRoute.ts +0 -110
- package/Router/Http/Middleware.ts +0 -7
- package/Router/Http/Request.ts +0 -225
- package/Router/Http/Response.ts +0 -35
- package/Router/Http/index.ts +0 -85
- package/Router/Metadata.ts +0 -34
- package/Router/Middleware.ts +0 -16
- package/Router/Request.ts +0 -65
- package/Router/Route.ts +0 -16
- package/Router/RouteNotFoundError.ts +0 -5
- package/Router/Router.ts +0 -35
- package/Router/Servers/index.ts +0 -6
- package/Router/Servers/node.ts +0 -49
- package/Router/Servers/uNetworking.ts +0 -151
- package/Router/Websockets/Handler.ts +0 -82
- package/Router/Websockets/Middleware.ts +0 -7
- package/Router/Websockets/Request.ts +0 -3
- package/Router/Websockets/WebsocketRoute.ts +0 -61
- package/Router/Websockets/index.ts +0 -59
- package/Router/Websockets/types.ts +0 -24
- package/Router/index.ts +0 -6
- package/Storage/File.ts +0 -30
- package/Storage/Image.ts +0 -19
- package/Storage/InvalidImage.ts +0 -3
- package/Storage/Storage.ts +0 -98
- package/Storage/index.ts +0 -4
- package/Storage/utils.ts +0 -18
- package/Support/Array.ts +0 -184
- package/Support/Math.ts +0 -12
- package/Support/Metadata.ts +0 -31
- package/Support/String.ts +0 -38
- package/Support/index.ts +0 -19
- package/Support/utils.ts +0 -7
- package/Testing/TestCase.ts +0 -193
- package/Validation/Rule.ts +0 -9
- package/Validation/RuleInterface.ts +0 -10
- package/Validation/Rules/Email.ts +0 -20
- package/Validation/Rules/FileExtension.ts +0 -21
- package/Validation/Rules/MaxLength.ts +0 -17
- package/Validation/Rules/MinLength.ts +0 -18
- package/Validation/Rules/Optional.ts +0 -18
- package/Validation/Rules/Required.ts +0 -29
- package/Validation/Validator.ts +0 -7
- package/Validation/index.ts +0 -12
- package/benchmark.ts +0 -47
- package/eslint.config.mjs +0 -78
- package/tests/.nycrc.json +0 -19
- package/tests/Cache/DatabaseStoreTest.ts +0 -110
- package/tests/Cache/FileStoreTest.ts +0 -93
- package/tests/Cache/MemoryStoreTest.ts +0 -92
- package/tests/Container/ContainerTest.ts +0 -336
- package/tests/Database/Drivers/MySQL/AlterTest.ts +0 -100
- package/tests/Database/Drivers/MySQL/CreateTest.ts +0 -39
- package/tests/Database/Drivers/MysqlDriverTest.ts +0 -140
- package/tests/Database/Drivers/SqliteDriverTest.ts +0 -126
- package/tests/Database/Entities/Article.ts +0 -21
- package/tests/Database/Entities/Profile.ts +0 -21
- package/tests/Database/Entities/Role.ts +0 -15
- package/tests/Database/Entities/User.ts +0 -35
- package/tests/Database/EntityRelationshipsTest.ts +0 -475
- package/tests/Database/EntityTest.ts +0 -202
- package/tests/Database/Migrations/RunnerTest.ts +0 -96
- package/tests/Database/Migrations/migrations/1.createUserTable.ts +0 -12
- package/tests/Database/Migrations/migrations/2.createArticlesTable.ts +0 -12
- package/tests/Database/QueryTest.ts +0 -573
- package/tests/Database/SchemaTest.ts +0 -32
- package/tests/Database/Seeders/RunnerTest.ts +0 -30
- package/tests/Database/Seeders/seeders/RandomSeeder.ts +0 -10
- package/tests/Database/utils.ts +0 -16
- package/tests/Forms/FormsTest.ts +0 -59
- package/tests/Framework/Middleware/StaticAssetsMiddlewareTest.ts +0 -129
- package/tests/Framework/Middleware/articles/my-article.html +0 -1
- package/tests/Framework/Middleware/articles/some-directory/index.html +0 -1
- package/tests/Framework/Middleware/assets/styles.css +0 -3
- package/tests/Framework/Resolvers/EntityResolverTest.ts +0 -48
- package/tests/Framework/Router/RouterTest.ts +0 -33
- package/tests/Mail/MailerTest.ts +0 -76
- package/tests/Model/ModelTest.ts +0 -183
- package/tests/Router/HttpHandlerTest.ts +0 -72
- package/tests/Router/RequestTest.ts +0 -77
- package/tests/Router/WebSocketsHandlerTest.ts +0 -51
- package/tests/Storage/StorageTest.ts +0 -97
- package/tests/Support/ArrayTest.ts +0 -167
- package/tests/Support/StringTest.ts +0 -18
- package/tests/Validation/RulesTest.ts +0 -54
- package/tests/tsconfig.json +0 -5
- package/tsconfig.json +0 -53
- package/types.d.ts +0 -8
|
@@ -1,475 +0,0 @@
|
|
|
1
|
-
import { suite, test } from '@testdeck/mocha'
|
|
2
|
-
import { Connection, Entity, EntityConstructor, Query, SqliteDriver } from '../../Database'
|
|
3
|
-
import { User } from './Entities/User'
|
|
4
|
-
import { Article } from './Entities/Article'
|
|
5
|
-
import { Role } from './Entities/Role'
|
|
6
|
-
import { Profile } from './Entities/Profile'
|
|
7
|
-
import { expect } from 'chai'
|
|
8
|
-
import { BelongsTo, BelongsToMany, HasMany, HasOne } from '../../Database/Fields'
|
|
9
|
-
|
|
10
|
-
@suite
|
|
11
|
-
class EntityRelationshipsTest {
|
|
12
|
-
joe = {
|
|
13
|
-
name: 'Joe',
|
|
14
|
-
email: 'joe@example.com',
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
doe = {
|
|
18
|
-
name: 'Doe',
|
|
19
|
-
email: 'doe@example.com',
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
admin = {
|
|
23
|
-
name: 'Admin'
|
|
24
|
-
}
|
|
25
|
-
developer = {
|
|
26
|
-
name: 'Developer'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async before() {
|
|
30
|
-
Query.connection = new Connection(new SqliteDriver(':memory:'))
|
|
31
|
-
// Query.connection = new Connection(new MysqlDriver({
|
|
32
|
-
// host: 'localhost', user: 'root', password: 'root', database: 'typetron_test'
|
|
33
|
-
// }))
|
|
34
|
-
await Query.connection.driver.schema.synchronize([User, Profile, Article, Role].pluck('metadata'))
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
async after() {
|
|
38
|
-
for await (const entity of [User, Profile, Article, Role]) {
|
|
39
|
-
await (entity as EntityConstructor<Entity>).truncate()
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
await Query.table('role_users').truncate()
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@test
|
|
46
|
-
async hydratesEntityWithRelationships() {
|
|
47
|
-
const user = new User()
|
|
48
|
-
|
|
49
|
-
expect(user).to.haveOwnProperty('profile')
|
|
50
|
-
expect(user.profile).to.be.instanceOf(HasOne)
|
|
51
|
-
expect(user).to.haveOwnProperty('articles')
|
|
52
|
-
expect(user.articles).to.be.instanceOf(HasMany)
|
|
53
|
-
expect(user).to.haveOwnProperty('roles')
|
|
54
|
-
expect(user.roles).to.be.instanceOf(BelongsToMany)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@test
|
|
58
|
-
async hasOneSave() {
|
|
59
|
-
const user = await User.create(this.joe)
|
|
60
|
-
|
|
61
|
-
const profile = new Profile().fill({
|
|
62
|
-
address: 'address'
|
|
63
|
-
})
|
|
64
|
-
await user.profile.save(profile)
|
|
65
|
-
|
|
66
|
-
expect(user.profile.get()?.id).to.be.equal(profile.id)
|
|
67
|
-
expect(user.profile.get()?.user.get()?.id).to.be.equal(user.id)
|
|
68
|
-
expect(await Profile.first()).to.be.instanceOf(Profile)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@test
|
|
72
|
-
async hasOneLoad() {
|
|
73
|
-
const user = await User.create(this.joe)
|
|
74
|
-
|
|
75
|
-
const profile = new Profile().fill({
|
|
76
|
-
address: 'address'
|
|
77
|
-
})
|
|
78
|
-
await user.profile.save(profile)
|
|
79
|
-
|
|
80
|
-
const sameUser = await User.findOrFail(user.id)
|
|
81
|
-
expect(sameUser.profile).to.be.instanceOf(HasOne)
|
|
82
|
-
expect(sameUser.profile.get()).to.be.equal(undefined)
|
|
83
|
-
await sameUser.load('profile')
|
|
84
|
-
|
|
85
|
-
expect(sameUser.profile.get()?.id).to.be.equal(user.profile.get()?.id)
|
|
86
|
-
expect(sameUser.profile.get()?.address).to.be.equal('address')
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
@test
|
|
90
|
-
async hasOneEagerLoad() {
|
|
91
|
-
const user = await User.create(this.joe)
|
|
92
|
-
|
|
93
|
-
const profile = new Profile().fill({
|
|
94
|
-
address: 'address'
|
|
95
|
-
})
|
|
96
|
-
await user.profile.save(profile)
|
|
97
|
-
|
|
98
|
-
const sameUser = await User.with('profile').where('id', user.id).first() as User
|
|
99
|
-
expect(sameUser.profile.get()).to.deep.include({
|
|
100
|
-
id: profile.id,
|
|
101
|
-
address: 'address'
|
|
102
|
-
})
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
@test
|
|
106
|
-
async hasManySave() {
|
|
107
|
-
const user = await User.create(this.joe)
|
|
108
|
-
|
|
109
|
-
const article = new Article().fill({
|
|
110
|
-
title: 'title',
|
|
111
|
-
content: 'content',
|
|
112
|
-
})
|
|
113
|
-
await user.articles.save(article)
|
|
114
|
-
|
|
115
|
-
expect(user.articles).to.have.length(1)
|
|
116
|
-
expect(user.articles[0]).to.deep.include({
|
|
117
|
-
id: article.id,
|
|
118
|
-
title: 'title',
|
|
119
|
-
content: 'content',
|
|
120
|
-
})
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
@test
|
|
124
|
-
async hasManySaveUsingPlainObject() {
|
|
125
|
-
const user = await User.create(this.joe)
|
|
126
|
-
|
|
127
|
-
await user.articles.save({
|
|
128
|
-
title: 'title',
|
|
129
|
-
content: 'content',
|
|
130
|
-
} as Article)
|
|
131
|
-
|
|
132
|
-
expect(user.articles).to.have.length(1)
|
|
133
|
-
expect(user.articles[0]).to.deep.include({
|
|
134
|
-
title: 'title',
|
|
135
|
-
content: 'content',
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@test
|
|
140
|
-
async hasManySaveUsingSaveOnUnsavedParent() {
|
|
141
|
-
const user = new User().fill(this.joe)
|
|
142
|
-
|
|
143
|
-
await user.articles.save(new Article().fill({
|
|
144
|
-
title: 'title',
|
|
145
|
-
content: 'content',
|
|
146
|
-
}))
|
|
147
|
-
|
|
148
|
-
expect(user.articles).to.have.length(1)
|
|
149
|
-
expect(user.articles[0]).to.deep.include({
|
|
150
|
-
title: 'title',
|
|
151
|
-
content: 'content',
|
|
152
|
-
})
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
@test
|
|
156
|
-
async hasManyLoad() {
|
|
157
|
-
const user = await User.create(this.joe)
|
|
158
|
-
await Article.create({
|
|
159
|
-
title: 'title',
|
|
160
|
-
content: 'content',
|
|
161
|
-
author: user
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
await user.load('articles')
|
|
165
|
-
expect(user.articles).to.be.instanceOf(HasMany)
|
|
166
|
-
expect(user.articles[0]).to.deep.include({
|
|
167
|
-
title: 'title',
|
|
168
|
-
content: 'content',
|
|
169
|
-
})
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
@test
|
|
173
|
-
async hasManyGet() {
|
|
174
|
-
const user = await User.create(this.joe)
|
|
175
|
-
const article = new Article().fill({
|
|
176
|
-
title: 'title',
|
|
177
|
-
content: 'content',
|
|
178
|
-
})
|
|
179
|
-
await user.articles.save(article)
|
|
180
|
-
await user.articles.load()
|
|
181
|
-
expect(user.articles[0]).to.deep.include({
|
|
182
|
-
title: 'title',
|
|
183
|
-
content: 'content',
|
|
184
|
-
})
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
@test
|
|
188
|
-
async hasManyEagerLoad() {
|
|
189
|
-
const user = new User().fill(this.joe)
|
|
190
|
-
const article = new Article().fill({
|
|
191
|
-
title: 'title',
|
|
192
|
-
content: 'content',
|
|
193
|
-
})
|
|
194
|
-
await user.articles.save(article)
|
|
195
|
-
|
|
196
|
-
const sameUser = await User.with('articles').where('id', user.id).first() as User
|
|
197
|
-
expect(sameUser.articles).to.have.length(1)
|
|
198
|
-
expect(user.articles[0]).to.deep.include({
|
|
199
|
-
id: article.id,
|
|
200
|
-
title: 'title',
|
|
201
|
-
content: 'content',
|
|
202
|
-
})
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
@test
|
|
206
|
-
async hasManyQuery() {
|
|
207
|
-
const user = await User.create(this.joe)
|
|
208
|
-
await user.articles.saveMany(
|
|
209
|
-
{
|
|
210
|
-
title: 'title',
|
|
211
|
-
content: 'joe\'s content',
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
title: 'other title',
|
|
215
|
-
content: 'other content',
|
|
216
|
-
},
|
|
217
|
-
)
|
|
218
|
-
const doe = await User.create(this.doe)
|
|
219
|
-
await doe.articles.save({
|
|
220
|
-
title: 'title',
|
|
221
|
-
content: 'doe\'s content',
|
|
222
|
-
})
|
|
223
|
-
|
|
224
|
-
const articles = await user.articles.where('title', 'title').get()
|
|
225
|
-
expect(articles).to.have.length(1)
|
|
226
|
-
expect(user.articles[0]).to.deep.include({
|
|
227
|
-
title: 'title',
|
|
228
|
-
content: 'joe\'s content',
|
|
229
|
-
})
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
@test
|
|
233
|
-
async belongsToSave() {
|
|
234
|
-
const user = await User.create(this.joe)
|
|
235
|
-
const article = new Article()
|
|
236
|
-
await user.articles.save(article)
|
|
237
|
-
|
|
238
|
-
expect(user.articles).to.have.length(1)
|
|
239
|
-
expect(user.articles[0].author).to.be.instanceof(BelongsTo)
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
@test
|
|
243
|
-
async belongsToEagerLoad() {
|
|
244
|
-
const user = await User.create(this.joe)
|
|
245
|
-
const article = new Article()
|
|
246
|
-
await user.articles.save(article)
|
|
247
|
-
|
|
248
|
-
const articles = await Article.with('author').get()
|
|
249
|
-
|
|
250
|
-
expect(articles).to.have.length(1)
|
|
251
|
-
expect(articles[0].author).to.be.instanceof(BelongsTo)
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
@test
|
|
255
|
-
async belongsToEagerLoadWithCustomQuery() {
|
|
256
|
-
const joe = await User.create(this.joe)
|
|
257
|
-
await joe.articles.save(Article.new({title: 'article1'}))
|
|
258
|
-
await joe.articles.save(Article.new({title: 'article2'}))
|
|
259
|
-
|
|
260
|
-
const user = await User.with(['articles', query => query.where('title', 'article1')]).first() as User
|
|
261
|
-
|
|
262
|
-
expect(user.articles).to.have.length(1)
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// @test
|
|
266
|
-
// async deepBelongsToEagerLoadWithCustomQuery() {
|
|
267
|
-
// const admin = await Role.create(this.admin)
|
|
268
|
-
//
|
|
269
|
-
// const joe = await User.create(this.joe)
|
|
270
|
-
// await joe.profile.save(new Profile({address: 'south address'}))
|
|
271
|
-
// const doe = await User.create(this.doe)
|
|
272
|
-
// await doe.profile.save(new Profile({address: 'east address'}))
|
|
273
|
-
//
|
|
274
|
-
// await admin.users.add(joe, doe)
|
|
275
|
-
//
|
|
276
|
-
// const role = await Role.with(['users.profile', query => query.whereLike('address', '%east%')]).first() as Role
|
|
277
|
-
//
|
|
278
|
-
// expect(role.users).to.have.length(1)
|
|
279
|
-
// expect(role.users[0].name).to.be.equal(doe.name)
|
|
280
|
-
// }
|
|
281
|
-
|
|
282
|
-
@test
|
|
283
|
-
async belongsToLoad() {
|
|
284
|
-
const user = await User.create(this.joe)
|
|
285
|
-
let article = new Article()
|
|
286
|
-
await user.articles.save(article)
|
|
287
|
-
|
|
288
|
-
article = await Article.findOrFail(article.id)
|
|
289
|
-
const a = await Article.get()
|
|
290
|
-
const u = await User.get()
|
|
291
|
-
await article.load('author')
|
|
292
|
-
|
|
293
|
-
expect(article.author).to.be.instanceOf(BelongsTo)
|
|
294
|
-
expect(article.author.get()).to.be.instanceOf(User)
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
@test
|
|
298
|
-
async belongsToReLoad() {
|
|
299
|
-
const user = await User.create(this.joe)
|
|
300
|
-
const article = new Article()
|
|
301
|
-
await user.articles.save(article)
|
|
302
|
-
|
|
303
|
-
await article.load('author')
|
|
304
|
-
|
|
305
|
-
expect(article.author).to.be.instanceOf(BelongsTo)
|
|
306
|
-
expect(article.author.get()).to.be.instanceOf(User)
|
|
307
|
-
expect(article.author.get()?.id).to.be.equal(user.id)
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
@test
|
|
311
|
-
async belongsToManySave() {
|
|
312
|
-
const user = new User().fill(this.joe)
|
|
313
|
-
|
|
314
|
-
const admin = await Role.create(this.admin)
|
|
315
|
-
const developer = await Role.create(this.developer)
|
|
316
|
-
await user.roles.add(admin.id, developer.id)
|
|
317
|
-
|
|
318
|
-
expect(user.roles).to.have.length(2)
|
|
319
|
-
expect(user.roles[0].id).to.be.equal(admin.id)
|
|
320
|
-
expect(user.roles[1].id).to.be.equal(developer.id)
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
@test
|
|
324
|
-
async belongsToManyEagerLoad() {
|
|
325
|
-
const user = await User.create(this.joe)
|
|
326
|
-
|
|
327
|
-
const admin = await Role.create(this.admin)
|
|
328
|
-
const developer = await Role.create(this.developer)
|
|
329
|
-
await user.roles.add(admin.id, developer.id)
|
|
330
|
-
|
|
331
|
-
const sameUser = await User.with('roles').where('id', user.id).first() as User
|
|
332
|
-
|
|
333
|
-
expect(sameUser.roles).to.have.length(2)
|
|
334
|
-
expect(sameUser.roles[0]).to.deep.include({
|
|
335
|
-
id: admin.id,
|
|
336
|
-
name: admin.name
|
|
337
|
-
})
|
|
338
|
-
expect(sameUser.roles[1]).to.deep.include({
|
|
339
|
-
id: developer.id,
|
|
340
|
-
name: developer.name
|
|
341
|
-
})
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
@test
|
|
345
|
-
async belongsToManyClearing() {
|
|
346
|
-
const user = new User().fill(this.joe)
|
|
347
|
-
const admin = await Role.create(this.admin)
|
|
348
|
-
const developer = await Role.create(this.developer)
|
|
349
|
-
await user.roles.add(admin.id, developer.id)
|
|
350
|
-
|
|
351
|
-
expect(user.roles).to.have.length(2)
|
|
352
|
-
await user.roles.clear()
|
|
353
|
-
expect(user.roles).to.have.length(0)
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
@test
|
|
357
|
-
async belongsToManyRemove() {
|
|
358
|
-
const user = new User().fill(this.joe)
|
|
359
|
-
const admin = await Role.create(this.admin)
|
|
360
|
-
const developer = await Role.create(this.developer)
|
|
361
|
-
await user.roles.add(admin.id, developer.id)
|
|
362
|
-
|
|
363
|
-
expect(user.roles).to.have.length(2)
|
|
364
|
-
await user.roles.remove(admin.id)
|
|
365
|
-
expect(user.roles).to.have.length(1)
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
@test
|
|
369
|
-
async belongsToManySync() {
|
|
370
|
-
const user = new User().fill(this.joe)
|
|
371
|
-
const admin = await Role.create(this.admin)
|
|
372
|
-
const developer = await Role.create(this.developer)
|
|
373
|
-
const manager = await Role.create({name: 'Manager'})
|
|
374
|
-
await user.roles.add(admin.id, manager.id)
|
|
375
|
-
|
|
376
|
-
await user.roles.sync(admin.id, developer)
|
|
377
|
-
expect(user.roles).to.have.length(2)
|
|
378
|
-
expect(user.roles[0]).to.have.property('id', admin.id)
|
|
379
|
-
expect(user.roles[1]).to.have.property('id', developer.id)
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
@test
|
|
383
|
-
async belongsToManySyncWithoutDetaching() {
|
|
384
|
-
const user = new User().fill(this.joe)
|
|
385
|
-
const admin = await Role.create(this.admin)
|
|
386
|
-
const developer = await Role.create(this.developer)
|
|
387
|
-
const manager = await Role.create({name: 'manager'})
|
|
388
|
-
await user.roles.add(admin.id, manager.id)
|
|
389
|
-
|
|
390
|
-
await user.roles.syncWithoutDetaching(admin.id, developer)
|
|
391
|
-
expect(user.roles).to.have.length(3)
|
|
392
|
-
expect(user.roles[0]).to.have.property('id', admin.id)
|
|
393
|
-
expect(user.roles[1]).to.have.property('id', manager.id)
|
|
394
|
-
expect(user.roles[2]).to.have.property('id', developer.id)
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
@test
|
|
398
|
-
async belongsToManyToggle() {
|
|
399
|
-
const user = new User().fill(this.joe)
|
|
400
|
-
const admin = await Role.create(this.admin)
|
|
401
|
-
await user.roles.add(admin.id)
|
|
402
|
-
|
|
403
|
-
expect(user.roles).to.have.length(1)
|
|
404
|
-
expect(user.roles[0]).to.have.property('id', admin.id)
|
|
405
|
-
|
|
406
|
-
const developer = await Role.create(this.developer)
|
|
407
|
-
await user.roles.toggle(admin.id, developer.id)
|
|
408
|
-
|
|
409
|
-
expect(user.roles).to.have.length(1)
|
|
410
|
-
expect(user.roles[0]).to.have.property('id', developer.id)
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
@test
|
|
414
|
-
async belongsToManyLoad() {
|
|
415
|
-
const user = new User().fill(this.joe)
|
|
416
|
-
const admin = await Role.create(this.admin)
|
|
417
|
-
await user.roles.add(admin.id)
|
|
418
|
-
|
|
419
|
-
const sameUser = await User.first() as User
|
|
420
|
-
await sameUser.load('roles')
|
|
421
|
-
expect(sameUser.roles[0]).to.deep.include(this.admin)
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
@test
|
|
425
|
-
async belongsToManyQuery() {
|
|
426
|
-
const user = new User().fill(this.joe)
|
|
427
|
-
const admin = await Role.create(this.admin)
|
|
428
|
-
const developer = await Role.create(this.developer)
|
|
429
|
-
await user.roles.add(admin.id, developer.id)
|
|
430
|
-
|
|
431
|
-
expect(user.roles).to.have.length(2)
|
|
432
|
-
const roles = await user.roles.where('name', developer.name).get()
|
|
433
|
-
expect(roles).to.have.length(1)
|
|
434
|
-
expect(roles[0]).to.deep.include(this.developer)
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
@test
|
|
438
|
-
async belongsToManyHas() {
|
|
439
|
-
const user = new User().fill(this.joe)
|
|
440
|
-
const admin = await Role.create(this.admin)
|
|
441
|
-
const developer = await Role.create(this.developer)
|
|
442
|
-
await user.roles.add(admin.id)
|
|
443
|
-
|
|
444
|
-
expect(await user.roles.has(admin)).to.be.equal(true)
|
|
445
|
-
expect(await user.roles.has(developer.id)).to.be.equal(false)
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
@test
|
|
449
|
-
async nestedEagerLoading() {
|
|
450
|
-
let user = await User.create(this.joe)
|
|
451
|
-
await user.articles.save(new Article())
|
|
452
|
-
|
|
453
|
-
user = await User.find(user.id) as User
|
|
454
|
-
await user.load('articles.author')
|
|
455
|
-
|
|
456
|
-
expect(user.articles[0].author.get()?.name).to.be.equal(user.name)
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
@test
|
|
460
|
-
async multipleNestedEagerLoading() {
|
|
461
|
-
let adminRole = await Role.create({name: 'Admin'})
|
|
462
|
-
const joe = await User.create(this.joe)
|
|
463
|
-
await adminRole.users.add(joe)
|
|
464
|
-
await joe.articles.save(new Article().fill({title: 'title'}))
|
|
465
|
-
await joe.profile.save(new Profile().fill({address: 'address'}))
|
|
466
|
-
|
|
467
|
-
adminRole = await Role.find(adminRole.id) as Role
|
|
468
|
-
await adminRole.load('users.articles.author', 'users.profile.user')
|
|
469
|
-
|
|
470
|
-
expect(adminRole.users[0].articles[0].title).to.be.equal('title')
|
|
471
|
-
expect(adminRole.users[0].profile.get()?.address).to.be.equal('address')
|
|
472
|
-
expect(adminRole.users[0].articles[0].author.get()?.name).to.be.equal(joe.name)
|
|
473
|
-
expect(adminRole.users[0].profile.get()?.user.get()?.name).to.be.equal(joe.name)
|
|
474
|
-
}
|
|
475
|
-
}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { suite, test } from '@testdeck/mocha'
|
|
2
|
-
import { expect } from 'chai'
|
|
3
|
-
import { Connection, Entity, EntityConstructor, Query, SqliteDriver } from '../../Database'
|
|
4
|
-
import { User } from './Entities/User'
|
|
5
|
-
import { EntityQuery } from '../../Database/EntityQuery'
|
|
6
|
-
import { Article } from './Entities/Article'
|
|
7
|
-
import { Role } from './Entities/Role'
|
|
8
|
-
|
|
9
|
-
@suite
|
|
10
|
-
class EntityTest {
|
|
11
|
-
joe = {
|
|
12
|
-
id: 1,
|
|
13
|
-
name: 'Joe',
|
|
14
|
-
email: 'joe@example.com',
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
doe = {
|
|
18
|
-
id: 2,
|
|
19
|
-
name: 'Doe',
|
|
20
|
-
email: 'doe@example.com',
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
admin = {
|
|
24
|
-
id: 1,
|
|
25
|
-
name: 'Admin'
|
|
26
|
-
}
|
|
27
|
-
developer = {
|
|
28
|
-
id: 1,
|
|
29
|
-
name: 'Developer'
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
data = {
|
|
33
|
-
users: [this.joe, this.doe],
|
|
34
|
-
roles: [this.admin, this.developer],
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
async before() {
|
|
38
|
-
Query.connection = new Connection(new SqliteDriver(':memory:'))
|
|
39
|
-
// Query.connection = new Connection(new MysqlDriver({
|
|
40
|
-
// host: 'localhost', user: 'root', password: 'root', database: 'typetron_test'
|
|
41
|
-
// }))
|
|
42
|
-
await Query.connection.driver.schema.synchronize([User, Article, Role].pluck('metadata'))
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async after() {
|
|
46
|
-
for await (const entity of [User, Article, Role]) {
|
|
47
|
-
await (entity as EntityConstructor<Entity>).truncate()
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
expectToContain(actual: User, expected: {[key: string]: string | number | Date}) {
|
|
52
|
-
const keys = Object.keys(expected)
|
|
53
|
-
keys.forEach(key => {
|
|
54
|
-
expect(actual).to.have.property(key, expected[key])
|
|
55
|
-
})
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@test
|
|
59
|
-
fillEntityWhenInstantiating() {
|
|
60
|
-
expect(new User().fill({name: 'Joe'})).to.deep.include({name: 'Joe'})
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@test
|
|
64
|
-
getEntityTable() {
|
|
65
|
-
expect(User.getTable()).to.equal('users')
|
|
66
|
-
expect((new User()).getTable()).to.equal('users')
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@test
|
|
70
|
-
async createsNewQuery() {
|
|
71
|
-
expect(User.newQuery()).to.be.an.instanceof(EntityQuery)
|
|
72
|
-
const user = new User()
|
|
73
|
-
expect(user.newQuery()).to.be.an.instanceof(EntityQuery)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@test
|
|
77
|
-
async getEveryRecord() {
|
|
78
|
-
await Query.table(User.getTable()).insert([this.joe, this.doe])
|
|
79
|
-
|
|
80
|
-
const users = await User.get()
|
|
81
|
-
|
|
82
|
-
expect(users).to.have.length(2)
|
|
83
|
-
|
|
84
|
-
users.forEach((user, index) => this.expectToContain(user, this.data.users[index]))
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// @test
|
|
88
|
-
// async where() {
|
|
89
|
-
// const modelMock = mock(User);
|
|
90
|
-
// const user = instance(modelMock);
|
|
91
|
-
//
|
|
92
|
-
// const queryMock = mock(EntityQuery);
|
|
93
|
-
// verify(queryMock.where('name', 'Joe')).once();
|
|
94
|
-
// when(user.newQuery()).thenReturn(instance(queryMock));
|
|
95
|
-
//
|
|
96
|
-
// const users = await User.where('name', 'Joe').get();
|
|
97
|
-
//
|
|
98
|
-
// users.forEach((user, index) => this.expectToContain(user, this.data.users[index]));
|
|
99
|
-
// }
|
|
100
|
-
//
|
|
101
|
-
// @test
|
|
102
|
-
// async whereIn() {
|
|
103
|
-
// when(this.connection.get(anyOfClass(Query))).thenResolve(this.data.users);
|
|
104
|
-
//
|
|
105
|
-
// const users = await User.whereIn('name', ['Joe', 'Doe']).get();
|
|
106
|
-
//
|
|
107
|
-
// users.forEach((user, index) => this.expectToContain(user, this.data.users[index]));
|
|
108
|
-
// }
|
|
109
|
-
//
|
|
110
|
-
@test
|
|
111
|
-
async save() {
|
|
112
|
-
const data = {email: 'tester', name: 'Tester'}
|
|
113
|
-
const user = new User().fill(data)
|
|
114
|
-
|
|
115
|
-
this.expectToContain(user, data)
|
|
116
|
-
expect(user.id).to.be.equal(undefined)
|
|
117
|
-
await user.save()
|
|
118
|
-
expect(user.id).to.be.equal(1)
|
|
119
|
-
expect(user.createdAt).to.be.an.instanceOf(Date)
|
|
120
|
-
expect(user.updatedAt).to.be.an.instanceOf(Date)
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
@test
|
|
124
|
-
async insertMany() {
|
|
125
|
-
await User.insert([this.joe, this.doe])
|
|
126
|
-
|
|
127
|
-
const users = await User.get()
|
|
128
|
-
expect(users).to.have.length(2)
|
|
129
|
-
this.expectToContain(users[0], this.joe)
|
|
130
|
-
this.expectToContain(users[1], this.doe)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// @test
|
|
134
|
-
// async test0() {
|
|
135
|
-
// const users = await User.get();
|
|
136
|
-
// const users = await User.get('id', 'name');
|
|
137
|
-
// const user = await User.first('id');
|
|
138
|
-
// const user = await User.firstOrNew({name: 'John'}, {email: 'john@example.com'});
|
|
139
|
-
// const user = await User.firstOrCreate({name: 'John'}, {email: 'john@example.com'});
|
|
140
|
-
// const user = await User.find(1);
|
|
141
|
-
// const users = await User.with('articles').get();
|
|
142
|
-
// }
|
|
143
|
-
|
|
144
|
-
@test
|
|
145
|
-
async getSpecificColumns() {
|
|
146
|
-
await Query.table(User.getTable()).insert([this.joe])
|
|
147
|
-
|
|
148
|
-
const users = await User.get('id', 'name')
|
|
149
|
-
|
|
150
|
-
expect(users).to.have.length(1)
|
|
151
|
-
expect(users.first()).to.have.property('name', this.joe.name)
|
|
152
|
-
expect(users.first()).and.to.have.property('id', this.joe.id)
|
|
153
|
-
|
|
154
|
-
// TODO with the new JS updates, the Entity properties are initialized to undefined,
|
|
155
|
-
// which means we will always get them in the object and this assert below will fail
|
|
156
|
-
// But, the actual problem is picking what columns to select.
|
|
157
|
-
// User.get(col1, col2) will return an User instance with col1 and col2 values but undefined for other columns
|
|
158
|
-
// This should be invalid because there might be col3 which might be non-optional and should always have a value
|
|
159
|
-
// expect(users.first()).and.to.not.have.property('email')
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
@test
|
|
163
|
-
async getFirstRecord() {
|
|
164
|
-
await Query.table(User.getTable()).insert([this.joe, this.doe])
|
|
165
|
-
|
|
166
|
-
const user = await User.first() as User
|
|
167
|
-
|
|
168
|
-
this.expectToContain(user, this.joe)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
@test
|
|
172
|
-
async getFirstRecordWithSpecificColumns() {
|
|
173
|
-
await Query.table(User.getTable()).insert([this.joe])
|
|
174
|
-
|
|
175
|
-
const user = await User.first('id') as User
|
|
176
|
-
|
|
177
|
-
expect(user).to.have.property('id', this.joe.id)
|
|
178
|
-
|
|
179
|
-
// TODO this has the same issue as the test `getSpecificColumns`
|
|
180
|
-
// expect(user).to.not.have.property('name')
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
@test
|
|
184
|
-
async getFirstRecordOrInstantiateOneIfNot() {
|
|
185
|
-
const john = await User.firstOrNew({name: 'John'}, {email: 'john@example.com'})
|
|
186
|
-
|
|
187
|
-
expect(john).to.have.property('name', 'John')
|
|
188
|
-
expect(john).to.have.property('email', 'john@example.com')
|
|
189
|
-
expect(john.id).to.be.undefined
|
|
190
|
-
expect(await User.get()).to.have.length(0)
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
@test
|
|
194
|
-
async getFirstRecordOrCreateOneIfNot() {
|
|
195
|
-
const john = await User.firstOrCreate({name: 'John'}, {email: 'john@example.com'})
|
|
196
|
-
|
|
197
|
-
expect(john).to.have.property('name', 'John')
|
|
198
|
-
expect(john).to.have.property('email', 'john@example.com')
|
|
199
|
-
expect(john).to.have.property('id')
|
|
200
|
-
expect(await User.get()).to.have.length(1)
|
|
201
|
-
}
|
|
202
|
-
}
|