@typetron/framework 0.5.20 → 0.5.22
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/.automaker/app_spec.txt +440 -0
- package/.automaker/categories.json +1 -0
- package/.automaker/features/a-b-testing-framework/feature.json +14 -0
- package/.automaker/features/account-lockout-protection/feature.json +14 -0
- package/.automaker/features/api-versioning/feature.json +14 -0
- package/.automaker/features/background-job-processing/feature.json +12 -0
- package/.automaker/features/cloud-storage-integration/feature.json +14 -0
- package/.automaker/features/compression-middleware/feature.json +14 -0
- package/.automaker/features/cors-and-security-headers/feature.json +14 -0
- package/.automaker/features/currency-and-timezone/feature.json +14 -0
- package/.automaker/features/database-backup-restore/feature.json +14 -0
- package/.automaker/features/database-query-logging/feature.json +15 -0
- package/.automaker/features/database-transaction-support/feature.json +14 -0
- package/.automaker/features/discord-notifications-channel/feature.json +14 -0
- package/.automaker/features/eager-loading-optimization/feature.json +14 -0
- package/.automaker/features/email-notifications-channel/feature.json +14 -0
- package/.automaker/features/error-tracking-integration/feature.json +14 -0
- package/.automaker/features/feature-flags/feature.json +12 -0
- package/.automaker/features/file-upload-handling/feature.json +14 -0
- package/.automaker/features/form-builder/feature.json +14 -0
- package/.automaker/features/full-text-search/feature.json +14 -0
- package/.automaker/features/graphql-api-support/feature.json +14 -0
- package/.automaker/features/graphql-documentation/feature.json +14 -0
- package/.automaker/features/graphql-subscriptions/feature.json +15 -0
- package/.automaker/features/html-view-rendering/feature.json +14 -0
- package/.automaker/features/http2-support/feature.json +14 -0
- package/.automaker/features/http3-quic-support/feature.json +14 -0
- package/.automaker/features/image-processing/feature.json +14 -0
- package/.automaker/features/internationalization-i18n/feature.json +12 -0
- package/.automaker/features/job-retries-and-failures/feature.json +14 -0
- package/.automaker/features/job-scheduling/feature.json +14 -0
- package/.automaker/features/locale-detection/feature.json +14 -0
- package/.automaker/features/log-rotation/feature.json +14 -0
- package/.automaker/features/logging-system/feature.json +12 -0
- package/.automaker/features/oauth-authentication/feature.json +14 -0
- package/.automaker/features/pagination-component/feature.json +14 -0
- package/.automaker/features/password-reset-flow/feature.json +14 -0
- package/.automaker/features/performance-monitoring/feature.json +14 -0
- package/.automaker/features/permission-management/feature.json +14 -0
- package/.automaker/features/policy-based-authorization/feature.json +14 -0
- package/.automaker/features/polymorphic-relationships/feature.json +14 -0
- package/.automaker/features/query-scopes/feature.json +14 -0
- package/.automaker/features/rate-limiting/feature.json +14 -0
- package/.automaker/features/request-validation-middleware/feature.json +14 -0
- package/.automaker/features/response-caching-headers/feature.json +14 -0
- package/.automaker/features/rest-api-documentation/feature.json +14 -0
- package/.automaker/features/role-based-access-control/feature.json +14 -0
- package/.automaker/features/session-management/feature.json +14 -0
- package/.automaker/features/session-middleware/feature.json +14 -0
- package/.automaker/features/slack-notifications-channel/feature.json +14 -0
- package/.automaker/features/sms-notifications-channel/feature.json +14 -0
- package/.automaker/features/soft-deletes/feature.json +14 -0
- package/.automaker/features/structured-logging/feature.json +14 -0
- package/.automaker/features/timestamps-and-auditing/feature.json +14 -0
- package/.automaker/features/two-factor-authentication/feature.json +14 -0
- package/.automaker/features/view-helpers-utilities/feature.json +14 -0
- package/.automaker/features/webhook-notifications/feature.json +14 -0
- package/.claude/settings.local.json +10 -0
- package/.editorconfig +11 -0
- package/.mocharc.json +13 -0
- package/CONTRIBUTING.md +9 -0
- package/Cache/Cache.ts +13 -0
- package/Cache/Stores/DatabaseStore.ts +120 -0
- package/Cache/Stores/FileStore.ts +69 -0
- package/Cache/Stores/MemoryStore.ts +71 -0
- package/Cache/index.ts +5 -0
- package/Cache/types.ts +4 -0
- package/Container/ClassResolver.ts +106 -0
- package/Container/Container.ts +144 -0
- package/Container/Contracts.ts +3 -0
- package/Container/Decorators.ts +20 -0
- package/Container/Metadata.ts +16 -0
- package/Container/Resolver.ts +27 -0
- package/Container/index.ts +5 -0
- package/Database/Clauses/Where.ts +0 -0
- package/Database/Connection.ts +52 -0
- package/Database/Decorators.ts +142 -0
- package/Database/Drivers/DatabaseDriver.ts +37 -0
- package/Database/Drivers/MySQL/Alter/index.ts +55 -0
- package/Database/Drivers/MySQL/ColumnDefinition.ts +16 -0
- package/Database/Drivers/MySQL/Create.ts +47 -0
- package/Database/Drivers/MySQL/MysqlDriver.ts +123 -0
- package/Database/Drivers/MySQL/Schema.ts +82 -0
- package/Database/Drivers/MySQL/index.ts +13 -0
- package/Database/Drivers/SQL/Schema.ts +73 -0
- package/Database/Drivers/SQL/Statements/Alter.ts +22 -0
- package/Database/Drivers/SQL/Statements/BaseStatement.ts +55 -0
- package/Database/Drivers/SQL/Statements/Delete.ts +20 -0
- package/Database/Drivers/SQL/Statements/Insert.ts +24 -0
- package/Database/Drivers/SQL/Statements/Select.ts +55 -0
- package/Database/Drivers/SQL/Statements/Update.ts +33 -0
- package/Database/Drivers/SQL/index.ts +8 -0
- package/Database/Drivers/SQLite/Create.ts +45 -0
- package/Database/Drivers/SQLite/Schema.ts +54 -0
- package/Database/Drivers/SQLite/SqliteDriver.ts +144 -0
- package/Database/Drivers/SQLite/index.ts +15 -0
- package/Database/Drivers/SchemaContract.ts +11 -0
- package/Database/Drivers/Statement.ts +16 -0
- package/Database/Drivers/index.ts +4 -0
- package/Database/Entity.ts +377 -0
- package/Database/EntityNotFoundError.ts +5 -0
- package/Database/EntityProxyHandler.ts +43 -0
- package/Database/EntityQuery.ts +197 -0
- package/Database/Expression.ts +3 -0
- package/Database/Fields.ts +816 -0
- package/Database/Helpers.ts +12 -0
- package/Database/List.ts +71 -0
- package/Database/Migrations/Migration.ts +10 -0
- package/Database/Migrations/MigrationHistory.ts +20 -0
- package/Database/Migrations/Migrator.ts +122 -0
- package/Database/Migrations/index.ts +3 -0
- package/Database/ORM/BaseRelationship.ts +10 -0
- package/Database/Query.ts +374 -0
- package/Database/Seeders/Seeder.ts +3 -0
- package/Database/Seeders/SeederManager.ts +27 -0
- package/Database/Seeders/index.ts +2 -0
- package/Database/StringExpression.ts +9 -0
- package/Database/Types.ts +165 -0
- package/Database/index.ts +23 -0
- package/Encryption/index.ts +51 -0
- package/Forms/Decorators.ts +29 -0
- package/Forms/Form.ts +70 -0
- package/Forms/FormFields.ts +36 -0
- package/Forms/index.ts +3 -0
- package/Framework/App.ts +10 -0
- package/Framework/Application.ts +118 -0
- package/Framework/Auth/Auth.ts +122 -0
- package/Framework/Auth/Authenticatable.ts +9 -0
- package/Framework/Auth/User.ts +27 -0
- package/Framework/Auth/index.ts +29 -0
- package/Framework/Config/AppConfig.ts +25 -0
- package/Framework/Config/AuthConfig.ts +11 -0
- package/Framework/Config/BaseConfig.ts +9 -0
- package/Framework/Config/CacheConfig.ts +38 -0
- package/Framework/Config/DatabaseConfig.ts +21 -0
- package/Framework/Config/MailConfig.ts +30 -0
- package/Framework/Config/index.ts +6 -0
- package/Framework/Middleware/AuthMiddleware.ts +31 -0
- package/Framework/Middleware/CorsMiddleware.ts +32 -0
- package/Framework/Middleware/StaticAssetsMiddleware.ts +76 -0
- package/Framework/Middleware/index.ts +2 -0
- package/Framework/Provider.ts +9 -0
- package/Framework/Providers/CacheProvider.ts +28 -0
- package/Framework/Providers/DatabaseProvider.ts +36 -0
- package/Framework/Providers/MailProvider.ts +31 -0
- package/Framework/Providers/WebsocketsProvider.ts +141 -0
- package/Framework/Resolvers/AuthResolver.ts +23 -0
- package/Framework/Resolvers/EntityResolver.ts +41 -0
- package/Framework/Resolvers/FormResolver.ts +37 -0
- package/Framework/RootDir.ts +1 -0
- package/Framework/index.ts +8 -0
- package/Frontend/Angular/Readme.md +7 -0
- package/Frontend/Angular/index.ts +24 -0
- package/Frontend/Angular/package-lock.json +2767 -0
- package/Frontend/Angular/package.json +38 -0
- package/Frontend/Angular/tsconfig.json +20 -0
- package/Frontend/Websockets/Readme.md +86 -0
- package/Frontend/Websockets/index.ts +99 -0
- package/Frontend/Websockets/package-lock.json +4371 -0
- package/Frontend/Websockets/package.json +45 -0
- package/Frontend/Websockets/tsc-alias.config.json +7 -0
- package/Frontend/Websockets/tsconfig.json +20 -0
- package/Mail/MailAddress.ts +4 -0
- package/Mail/MailTransport.ts +6 -0
- package/Mail/Mailable.ts +16 -0
- package/Mail/Mailer.ts +27 -0
- package/Mail/PendingMail.ts +68 -0
- package/Mail/SentMessage.ts +20 -0
- package/Mail/Transports/MemoryTransport.ts +13 -0
- package/Mail/Transports/SendGridTransport.ts +95 -0
- package/Mail/index.ts +3 -0
- package/Models/Model.ts +41 -0
- package/Models/index.ts +54 -0
- package/Router/BaseController.ts +7 -0
- package/Router/Decorators.ts +224 -0
- package/Router/Guard.ts +10 -0
- package/Router/Http/Contracts.ts +4 -0
- package/Router/Http/ErrorHandler.ts +45 -0
- package/Router/Http/ErrorHandlerInterface.ts +6 -0
- package/Router/Http/Errors/HttpError.ts +15 -0
- package/Router/Http/Handler.ts +183 -0
- package/Router/Http/HttpRoute.ts +110 -0
- package/Router/Http/Middleware.ts +7 -0
- package/Router/Http/Request.ts +225 -0
- package/Router/Http/Response.ts +35 -0
- package/Router/Http/index.ts +85 -0
- package/Router/Metadata.ts +34 -0
- package/Router/Middleware.ts +16 -0
- package/Router/Request.ts +65 -0
- package/Router/Route.ts +16 -0
- package/Router/RouteNotFoundError.ts +5 -0
- package/Router/Router.ts +35 -0
- package/Router/Servers/index.ts +6 -0
- package/Router/Servers/node.ts +49 -0
- package/Router/Servers/uNetworking.ts +151 -0
- package/Router/Websockets/Handler.ts +82 -0
- package/Router/Websockets/Middleware.ts +7 -0
- package/Router/Websockets/Request.ts +3 -0
- package/Router/Websockets/WebsocketRoute.ts +61 -0
- package/Router/Websockets/index.ts +59 -0
- package/Router/Websockets/types.ts +24 -0
- package/Router/index.ts +6 -0
- package/Storage/File.ts +30 -0
- package/Storage/Image.ts +19 -0
- package/Storage/InvalidImage.ts +3 -0
- package/Storage/Storage.ts +98 -0
- package/Storage/index.ts +4 -0
- package/Storage/utils.ts +18 -0
- package/Support/Array.ts +184 -0
- package/Support/Math.ts +12 -0
- package/Support/Metadata.ts +31 -0
- package/Support/String.ts +38 -0
- package/Support/index.ts +19 -0
- package/Support/utils.ts +7 -0
- package/Testing/TestCase.ts +193 -0
- package/Validation/Rule.ts +9 -0
- package/Validation/RuleInterface.ts +10 -0
- package/Validation/Rules/Email.ts +20 -0
- package/Validation/Rules/FileExtension.ts +21 -0
- package/Validation/Rules/MaxLength.ts +17 -0
- package/Validation/Rules/MinLength.ts +18 -0
- package/Validation/Rules/Optional.ts +18 -0
- package/Validation/Rules/Required.ts +29 -0
- package/Validation/Validator.ts +7 -0
- package/Validation/index.ts +12 -0
- package/benchmark.ts +47 -0
- package/eslint.config.mjs +78 -0
- package/package.json +10 -10
- package/tests/.nycrc.json +19 -0
- package/tests/Cache/DatabaseStoreTest.ts +110 -0
- package/tests/Cache/FileStoreTest.ts +93 -0
- package/tests/Cache/MemoryStoreTest.ts +92 -0
- package/tests/Container/ContainerTest.ts +336 -0
- package/tests/Database/Drivers/MySQL/AlterTest.ts +100 -0
- package/tests/Database/Drivers/MySQL/CreateTest.ts +39 -0
- package/tests/Database/Drivers/MysqlDriverTest.ts +140 -0
- package/tests/Database/Drivers/SqliteDriverTest.ts +126 -0
- package/tests/Database/Entities/Article.ts +21 -0
- package/tests/Database/Entities/Profile.ts +21 -0
- package/tests/Database/Entities/Role.ts +15 -0
- package/tests/Database/Entities/User.ts +35 -0
- package/tests/Database/EntityRelationshipsTest.ts +475 -0
- package/tests/Database/EntityTest.ts +202 -0
- package/tests/Database/Migrations/RunnerTest.ts +96 -0
- package/tests/Database/Migrations/migrations/1.createUserTable.ts +12 -0
- package/tests/Database/Migrations/migrations/2.createArticlesTable.ts +12 -0
- package/tests/Database/QueryTest.ts +573 -0
- package/tests/Database/SchemaTest.ts +32 -0
- package/tests/Database/Seeders/RunnerTest.ts +30 -0
- package/tests/Database/Seeders/seeders/RandomSeeder.ts +10 -0
- package/tests/Database/utils.ts +16 -0
- package/tests/Forms/FormsTest.ts +59 -0
- package/tests/Framework/Middleware/StaticAssetsMiddlewareTest.ts +129 -0
- package/tests/Framework/Middleware/articles/my-article.html +1 -0
- package/tests/Framework/Middleware/articles/some-directory/index.html +1 -0
- package/tests/Framework/Middleware/assets/styles.css +3 -0
- package/tests/Framework/Resolvers/EntityResolverTest.ts +48 -0
- package/tests/Framework/Router/RouterTest.ts +33 -0
- package/tests/Mail/MailerTest.ts +76 -0
- package/tests/Model/ModelTest.ts +183 -0
- package/tests/Router/HttpHandlerTest.ts +72 -0
- package/tests/Router/RequestTest.ts +77 -0
- package/tests/Router/WebSocketsHandlerTest.ts +51 -0
- package/tests/Storage/StorageTest.ts +97 -0
- package/tests/Support/ArrayTest.ts +167 -0
- package/tests/Support/StringTest.ts +18 -0
- package/tests/Validation/RulesTest.ts +54 -0
- package/tests/tsconfig.json +5 -0
- package/tsconfig.json +53 -0
- package/types.d.ts +8 -0
- package/build/Cache/Cache.d.ts +0 -9
- package/build/Cache/Cache.d.ts.map +0 -1
- package/build/Cache/Cache.js +0 -7
- package/build/Cache/Cache.js.map +0 -1
- package/build/Cache/Stores/DatabaseStore.d.ts +0 -16
- package/build/Cache/Stores/DatabaseStore.d.ts.map +0 -1
- package/build/Cache/Stores/DatabaseStore.js +0 -105
- package/build/Cache/Stores/DatabaseStore.js.map +0 -1
- package/build/Cache/Stores/FileStore.d.ts +0 -16
- package/build/Cache/Stores/FileStore.d.ts.map +0 -1
- package/build/Cache/Stores/FileStore.js +0 -65
- package/build/Cache/Stores/FileStore.js.map +0 -1
- package/build/Cache/Stores/MemoryStore.d.ts +0 -13
- package/build/Cache/Stores/MemoryStore.d.ts.map +0 -1
- package/build/Cache/Stores/MemoryStore.js +0 -57
- package/build/Cache/Stores/MemoryStore.js.map +0 -1
- package/build/Cache/index.d.ts +0 -6
- package/build/Cache/index.d.ts.map +0 -1
- package/build/Cache/index.js +0 -22
- package/build/Cache/index.js.map +0 -1
- package/build/Cache/types.d.ts +0 -5
- package/build/Cache/types.d.ts.map +0 -1
- package/build/Cache/types.js +0 -3
- package/build/Cache/types.js.map +0 -1
- package/build/Container/ClassResolver.d.ts +0 -9
- package/build/Container/ClassResolver.d.ts.map +0 -1
- package/build/Container/ClassResolver.js +0 -93
- package/build/Container/ClassResolver.js.map +0 -1
- package/build/Container/Container.d.ts +0 -25
- package/build/Container/Container.d.ts.map +0 -1
- package/build/Container/Container.js +0 -123
- package/build/Container/Container.js.map +0 -1
- package/build/Container/Contracts.d.ts +0 -3
- package/build/Container/Contracts.d.ts.map +0 -1
- package/build/Container/Contracts.js +0 -3
- package/build/Container/Contracts.js.map +0 -1
- package/build/Container/Decorators.d.ts +0 -5
- package/build/Container/Decorators.d.ts.map +0 -1
- package/build/Container/Decorators.js +0 -21
- package/build/Container/Decorators.js.map +0 -1
- package/build/Container/Metadata.d.ts +0 -21
- package/build/Container/Metadata.d.ts.map +0 -1
- package/build/Container/Metadata.js +0 -17
- package/build/Container/Metadata.js.map +0 -1
- package/build/Container/Resolver.d.ts +0 -19
- package/build/Container/Resolver.d.ts.map +0 -1
- package/build/Container/Resolver.js +0 -17
- package/build/Container/Resolver.js.map +0 -1
- package/build/Container/index.d.ts +0 -6
- package/build/Container/index.d.ts.map +0 -1
- package/build/Container/index.js +0 -22
- package/build/Container/index.js.map +0 -1
- package/build/Database/Clauses/Where.d.ts +0 -1
- package/build/Database/Clauses/Where.d.ts.map +0 -1
- package/build/Database/Clauses/Where.js +0 -2
- package/build/Database/Clauses/Where.js.map +0 -1
- package/build/Database/Connection.d.ts +0 -21
- package/build/Database/Connection.d.ts.map +0 -1
- package/build/Database/Connection.js +0 -44
- package/build/Database/Connection.js.map +0 -1
- package/build/Database/Decorators.d.ts +0 -36
- package/build/Database/Decorators.d.ts.map +0 -1
- package/build/Database/Decorators.js +0 -116
- package/build/Database/Decorators.js.map +0 -1
- package/build/Database/Drivers/DatabaseDriver.d.ts +0 -29
- package/build/Database/Drivers/DatabaseDriver.d.ts.map +0 -1
- package/build/Database/Drivers/DatabaseDriver.js +0 -7
- package/build/Database/Drivers/DatabaseDriver.js.map +0 -1
- package/build/Database/Drivers/MySQL/Alter/index.d.ts +0 -34
- package/build/Database/Drivers/MySQL/Alter/index.d.ts.map +0 -1
- package/build/Database/Drivers/MySQL/Alter/index.js +0 -70
- package/build/Database/Drivers/MySQL/Alter/index.js.map +0 -1
- package/build/Database/Drivers/MySQL/ColumnDefinition.d.ts +0 -7
- package/build/Database/Drivers/MySQL/ColumnDefinition.d.ts.map +0 -1
- package/build/Database/Drivers/MySQL/ColumnDefinition.js +0 -19
- package/build/Database/Drivers/MySQL/ColumnDefinition.js.map +0 -1
- package/build/Database/Drivers/MySQL/Create.d.ts +0 -10
- package/build/Database/Drivers/MySQL/Create.d.ts.map +0 -1
- package/build/Database/Drivers/MySQL/Create.js +0 -44
- package/build/Database/Drivers/MySQL/Create.js.map +0 -1
- package/build/Database/Drivers/MySQL/MysqlDriver.d.ts +0 -42
- package/build/Database/Drivers/MySQL/MysqlDriver.d.ts.map +0 -1
- package/build/Database/Drivers/MySQL/MysqlDriver.js +0 -93
- package/build/Database/Drivers/MySQL/MysqlDriver.js.map +0 -1
- package/build/Database/Drivers/MySQL/Schema.d.ts +0 -16
- package/build/Database/Drivers/MySQL/Schema.d.ts.map +0 -1
- package/build/Database/Drivers/MySQL/Schema.js +0 -67
- package/build/Database/Drivers/MySQL/Schema.js.map +0 -1
- package/build/Database/Drivers/MySQL/index.d.ts +0 -2
- package/build/Database/Drivers/MySQL/index.d.ts.map +0 -1
- package/build/Database/Drivers/MySQL/index.js +0 -16
- package/build/Database/Drivers/MySQL/index.js.map +0 -1
- package/build/Database/Drivers/SQL/Schema.d.ts +0 -7
- package/build/Database/Drivers/SQL/Schema.d.ts.map +0 -1
- package/build/Database/Drivers/SQL/Schema.js +0 -58
- package/build/Database/Drivers/SQL/Schema.js.map +0 -1
- package/build/Database/Drivers/SQL/Statements/Alter.d.ts +0 -8
- package/build/Database/Drivers/SQL/Statements/Alter.d.ts.map +0 -1
- package/build/Database/Drivers/SQL/Statements/Alter.js +0 -22
- package/build/Database/Drivers/SQL/Statements/Alter.js.map +0 -1
- package/build/Database/Drivers/SQL/Statements/BaseStatement.d.ts +0 -13
- package/build/Database/Drivers/SQL/Statements/BaseStatement.d.ts.map +0 -1
- package/build/Database/Drivers/SQL/Statements/BaseStatement.js +0 -46
- package/build/Database/Drivers/SQL/Statements/BaseStatement.js.map +0 -1
- package/build/Database/Drivers/SQL/Statements/Delete.d.ts +0 -6
- package/build/Database/Drivers/SQL/Statements/Delete.d.ts.map +0 -1
- package/build/Database/Drivers/SQL/Statements/Delete.js +0 -20
- package/build/Database/Drivers/SQL/Statements/Delete.js.map +0 -1
- package/build/Database/Drivers/SQL/Statements/Insert.d.ts +0 -7
- package/build/Database/Drivers/SQL/Statements/Insert.d.ts.map +0 -1
- package/build/Database/Drivers/SQL/Statements/Insert.js +0 -24
- package/build/Database/Drivers/SQL/Statements/Insert.js.map +0 -1
- package/build/Database/Drivers/SQL/Statements/Select.d.ts +0 -8
- package/build/Database/Drivers/SQL/Statements/Select.d.ts.map +0 -1
- package/build/Database/Drivers/SQL/Statements/Select.js +0 -51
- package/build/Database/Drivers/SQL/Statements/Select.js.map +0 -1
- package/build/Database/Drivers/SQL/Statements/Update.d.ts +0 -7
- package/build/Database/Drivers/SQL/Statements/Update.d.ts.map +0 -1
- package/build/Database/Drivers/SQL/Statements/Update.js +0 -33
- package/build/Database/Drivers/SQL/Statements/Update.js.map +0 -1
- package/build/Database/Drivers/SQL/index.d.ts +0 -9
- package/build/Database/Drivers/SQL/index.d.ts.map +0 -1
- package/build/Database/Drivers/SQL/index.js +0 -3
- package/build/Database/Drivers/SQL/index.js.map +0 -1
- package/build/Database/Drivers/SQLite/Create.d.ts +0 -10
- package/build/Database/Drivers/SQLite/Create.d.ts.map +0 -1
- package/build/Database/Drivers/SQLite/Create.js +0 -43
- package/build/Database/Drivers/SQLite/Create.js.map +0 -1
- package/build/Database/Drivers/SQLite/Schema.d.ts +0 -16
- package/build/Database/Drivers/SQLite/Schema.d.ts.map +0 -1
- package/build/Database/Drivers/SQLite/Schema.js +0 -49
- package/build/Database/Drivers/SQLite/Schema.js.map +0 -1
- package/build/Database/Drivers/SQLite/SqliteDriver.d.ts +0 -43
- package/build/Database/Drivers/SQLite/SqliteDriver.d.ts.map +0 -1
- package/build/Database/Drivers/SQLite/SqliteDriver.js +0 -115
- package/build/Database/Drivers/SQLite/SqliteDriver.js.map +0 -1
- package/build/Database/Drivers/SQLite/index.d.ts +0 -3
- package/build/Database/Drivers/SQLite/index.d.ts.map +0 -1
- package/build/Database/Drivers/SQLite/index.js +0 -31
- package/build/Database/Drivers/SQLite/index.js.map +0 -1
- package/build/Database/Drivers/SchemaContract.d.ts +0 -9
- package/build/Database/Drivers/SchemaContract.d.ts.map +0 -1
- package/build/Database/Drivers/SchemaContract.js +0 -11
- package/build/Database/Drivers/SchemaContract.js.map +0 -1
- package/build/Database/Drivers/Statement.d.ts +0 -10
- package/build/Database/Drivers/Statement.d.ts.map +0 -1
- package/build/Database/Drivers/Statement.js +0 -17
- package/build/Database/Drivers/Statement.js.map +0 -1
- package/build/Database/Drivers/index.d.ts +0 -5
- package/build/Database/Drivers/index.d.ts.map +0 -1
- package/build/Database/Drivers/index.js +0 -21
- package/build/Database/Drivers/index.js.map +0 -1
- package/build/Database/Entity.d.ts +0 -64
- package/build/Database/Entity.d.ts.map +0 -1
- package/build/Database/Entity.js +0 -243
- package/build/Database/Entity.js.map +0 -1
- package/build/Database/EntityNotFoundError.d.ts +0 -6
- package/build/Database/EntityNotFoundError.d.ts.map +0 -1
- package/build/Database/EntityNotFoundError.js +0 -12
- package/build/Database/EntityNotFoundError.js.map +0 -1
- package/build/Database/EntityProxyHandler.d.ts +0 -6
- package/build/Database/EntityProxyHandler.d.ts.map +0 -1
- package/build/Database/EntityProxyHandler.js +0 -40
- package/build/Database/EntityProxyHandler.js.map +0 -1
- package/build/Database/EntityQuery.d.ts +0 -29
- package/build/Database/EntityQuery.d.ts.map +0 -1
- package/build/Database/EntityQuery.js +0 -158
- package/build/Database/EntityQuery.js.map +0 -1
- package/build/Database/Expression.d.ts +0 -4
- package/build/Database/Expression.d.ts.map +0 -1
- package/build/Database/Expression.js +0 -7
- package/build/Database/Expression.js.map +0 -1
- package/build/Database/Fields.d.ts +0 -156
- package/build/Database/Fields.d.ts.map +0 -1
- package/build/Database/Fields.js +0 -564
- package/build/Database/Fields.js.map +0 -1
- package/build/Database/Helpers.d.ts +0 -2
- package/build/Database/Helpers.d.ts.map +0 -1
- package/build/Database/Helpers.js +0 -16
- package/build/Database/Helpers.js.map +0 -1
- package/build/Database/List.d.ts +0 -24
- package/build/Database/List.d.ts.map +0 -1
- package/build/Database/List.js +0 -48
- package/build/Database/List.js.map +0 -1
- package/build/Database/Migrations/Migration.d.ts +0 -8
- package/build/Database/Migrations/Migration.d.ts.map +0 -1
- package/build/Database/Migrations/Migration.js +0 -11
- package/build/Database/Migrations/Migration.js.map +0 -1
- package/build/Database/Migrations/MigrationHistory.d.ts +0 -9
- package/build/Database/Migrations/MigrationHistory.d.ts.map +0 -1
- package/build/Database/Migrations/MigrationHistory.js +0 -43
- package/build/Database/Migrations/MigrationHistory.js.map +0 -1
- package/build/Database/Migrations/Migrator.d.ts +0 -21
- package/build/Database/Migrations/Migrator.d.ts.map +0 -1
- package/build/Database/Migrations/Migrator.js +0 -135
- package/build/Database/Migrations/Migrator.js.map +0 -1
- package/build/Database/Migrations/index.d.ts +0 -4
- package/build/Database/Migrations/index.d.ts.map +0 -1
- package/build/Database/Migrations/index.js +0 -20
- package/build/Database/Migrations/index.js.map +0 -1
- package/build/Database/ORM/BaseRelationship.d.ts +0 -8
- package/build/Database/ORM/BaseRelationship.d.ts.map +0 -1
- package/build/Database/ORM/BaseRelationship.js +0 -13
- package/build/Database/ORM/BaseRelationship.js.map +0 -1
- package/build/Database/Query.d.ts +0 -63
- package/build/Database/Query.d.ts.map +0 -1
- package/build/Database/Query.js +0 -264
- package/build/Database/Query.js.map +0 -1
- package/build/Database/Seeders/Seeder.d.ts +0 -4
- package/build/Database/Seeders/Seeder.d.ts.map +0 -1
- package/build/Database/Seeders/Seeder.js +0 -7
- package/build/Database/Seeders/Seeder.js.map +0 -1
- package/build/Database/Seeders/SeederManager.d.ts +0 -9
- package/build/Database/Seeders/SeederManager.d.ts.map +0 -1
- package/build/Database/Seeders/SeederManager.js +0 -27
- package/build/Database/Seeders/SeederManager.js.map +0 -1
- package/build/Database/Seeders/index.d.ts +0 -3
- package/build/Database/Seeders/index.d.ts.map +0 -1
- package/build/Database/Seeders/index.js +0 -19
- package/build/Database/Seeders/index.js.map +0 -1
- package/build/Database/StringExpression.d.ts +0 -7
- package/build/Database/StringExpression.d.ts.map +0 -1
- package/build/Database/StringExpression.js +0 -16
- package/build/Database/StringExpression.js.map +0 -1
- package/build/Database/Types.d.ts +0 -118
- package/build/Database/Types.d.ts.map +0 -1
- package/build/Database/Types.js +0 -106
- package/build/Database/Types.js.map +0 -1
- package/build/Database/index.d.ts +0 -21
- package/build/Database/index.d.ts.map +0 -1
- package/build/Database/index.js +0 -25
- package/build/Database/index.js.map +0 -1
- package/build/Encryption/index.d.ts +0 -15
- package/build/Encryption/index.d.ts.map +0 -1
- package/build/Encryption/index.js +0 -68
- package/build/Encryption/index.js.map +0 -1
- package/build/Forms/Decorators.d.ts +0 -7
- package/build/Forms/Decorators.d.ts.map +0 -1
- package/build/Forms/Decorators.js +0 -29
- package/build/Forms/Decorators.js.map +0 -1
- package/build/Forms/Form.d.ts +0 -18
- package/build/Forms/Form.d.ts.map +0 -1
- package/build/Forms/Form.js +0 -68
- package/build/Forms/Form.js.map +0 -1
- package/build/Forms/FormFields.d.ts +0 -10
- package/build/Forms/FormFields.d.ts.map +0 -1
- package/build/Forms/FormFields.js +0 -39
- package/build/Forms/FormFields.js.map +0 -1
- package/build/Forms/index.d.ts +0 -4
- package/build/Forms/index.d.ts.map +0 -1
- package/build/Forms/index.js +0 -20
- package/build/Forms/index.js.map +0 -1
- package/build/Framework/App.d.ts +0 -7
- package/build/Framework/App.d.ts.map +0 -1
- package/build/Framework/App.js +0 -11
- package/build/Framework/App.js.map +0 -1
- package/build/Framework/Application.d.ts +0 -17
- package/build/Framework/Application.d.ts.map +0 -1
- package/build/Framework/Application.js +0 -94
- package/build/Framework/Application.js.map +0 -1
- package/build/Framework/Auth/Auth.d.ts +0 -24
- package/build/Framework/Auth/Auth.d.ts.map +0 -1
- package/build/Framework/Auth/Auth.js +0 -116
- package/build/Framework/Auth/Auth.js.map +0 -1
- package/build/Framework/Auth/Authenticatable.d.ts +0 -7
- package/build/Framework/Auth/Authenticatable.d.ts.map +0 -1
- package/build/Framework/Auth/Authenticatable.js +0 -3
- package/build/Framework/Auth/Authenticatable.js.map +0 -1
- package/build/Framework/Auth/User.d.ts +0 -11
- package/build/Framework/Auth/User.d.ts.map +0 -1
- package/build/Framework/Auth/User.js +0 -41
- package/build/Framework/Auth/User.js.map +0 -1
- package/build/Framework/Auth/index.d.ts +0 -6
- package/build/Framework/Auth/index.d.ts.map +0 -1
- package/build/Framework/Auth/index.js +0 -44
- package/build/Framework/Auth/index.js.map +0 -1
- package/build/Framework/Config/AppConfig.d.ts +0 -26
- package/build/Framework/Config/AppConfig.d.ts.map +0 -1
- package/build/Framework/Config/AppConfig.js +0 -20
- package/build/Framework/Config/AppConfig.js.map +0 -1
- package/build/Framework/Config/AuthConfig.d.ts +0 -11
- package/build/Framework/Config/AuthConfig.d.ts.map +0 -1
- package/build/Framework/Config/AuthConfig.js +0 -13
- package/build/Framework/Config/AuthConfig.js.map +0 -1
- package/build/Framework/Config/BaseConfig.d.ts +0 -7
- package/build/Framework/Config/BaseConfig.d.ts.map +0 -1
- package/build/Framework/Config/BaseConfig.js +0 -14
- package/build/Framework/Config/BaseConfig.js.map +0 -1
- package/build/Framework/Config/CacheConfig.d.ts +0 -16
- package/build/Framework/Config/CacheConfig.d.ts.map +0 -1
- package/build/Framework/Config/CacheConfig.js +0 -37
- package/build/Framework/Config/CacheConfig.js.map +0 -1
- package/build/Framework/Config/DatabaseConfig.d.ts +0 -11
- package/build/Framework/Config/DatabaseConfig.d.ts.map +0 -1
- package/build/Framework/Config/DatabaseConfig.js +0 -23
- package/build/Framework/Config/DatabaseConfig.js.map +0 -1
- package/build/Framework/Config/MailConfig.d.ts +0 -19
- package/build/Framework/Config/MailConfig.d.ts.map +0 -1
- package/build/Framework/Config/MailConfig.js +0 -11
- package/build/Framework/Config/MailConfig.js.map +0 -1
- package/build/Framework/Config/index.d.ts +0 -7
- package/build/Framework/Config/index.d.ts.map +0 -1
- package/build/Framework/Config/index.js +0 -23
- package/build/Framework/Config/index.js.map +0 -1
- package/build/Framework/Middleware/AuthMiddleware.d.ts +0 -9
- package/build/Framework/Middleware/AuthMiddleware.d.ts.map +0 -1
- package/build/Framework/Middleware/AuthMiddleware.js +0 -78
- package/build/Framework/Middleware/AuthMiddleware.js.map +0 -1
- package/build/Framework/Middleware/CorsMiddleware.d.ts +0 -8
- package/build/Framework/Middleware/CorsMiddleware.d.ts.map +0 -1
- package/build/Framework/Middleware/CorsMiddleware.js +0 -47
- package/build/Framework/Middleware/CorsMiddleware.js.map +0 -1
- package/build/Framework/Middleware/StaticAssetsMiddleware.d.ts +0 -16
- package/build/Framework/Middleware/StaticAssetsMiddleware.d.ts.map +0 -1
- package/build/Framework/Middleware/StaticAssetsMiddleware.js +0 -120
- package/build/Framework/Middleware/StaticAssetsMiddleware.js.map +0 -1
- package/build/Framework/Middleware/index.d.ts +0 -3
- package/build/Framework/Middleware/index.d.ts.map +0 -1
- package/build/Framework/Middleware/index.js +0 -19
- package/build/Framework/Middleware/index.js.map +0 -1
- package/build/Framework/Provider.d.ts +0 -6
- package/build/Framework/Provider.d.ts.map +0 -1
- package/build/Framework/Provider.js +0 -22
- package/build/Framework/Provider.js.map +0 -1
- package/build/Framework/Providers/CacheProvider.d.ts +0 -7
- package/build/Framework/Providers/CacheProvider.d.ts.map +0 -1
- package/build/Framework/Providers/CacheProvider.js +0 -40
- package/build/Framework/Providers/CacheProvider.js.map +0 -1
- package/build/Framework/Providers/DatabaseProvider.d.ts +0 -10
- package/build/Framework/Providers/DatabaseProvider.d.ts.map +0 -1
- package/build/Framework/Providers/DatabaseProvider.js +0 -80
- package/build/Framework/Providers/DatabaseProvider.js.map +0 -1
- package/build/Framework/Providers/MailProvider.d.ts +0 -7
- package/build/Framework/Providers/MailProvider.d.ts.map +0 -1
- package/build/Framework/Providers/MailProvider.js +0 -41
- package/build/Framework/Providers/MailProvider.js.map +0 -1
- package/build/Framework/Providers/WebsocketsProvider.d.ts +0 -13
- package/build/Framework/Providers/WebsocketsProvider.d.ts.map +0 -1
- package/build/Framework/Providers/WebsocketsProvider.js +0 -145
- package/build/Framework/Providers/WebsocketsProvider.js.map +0 -1
- package/build/Framework/Resolvers/AuthResolver.d.ts +0 -6
- package/build/Framework/Resolvers/AuthResolver.d.ts.map +0 -1
- package/build/Framework/Resolvers/AuthResolver.js +0 -19
- package/build/Framework/Resolvers/AuthResolver.js.map +0 -1
- package/build/Framework/Resolvers/EntityResolver.d.ts +0 -10
- package/build/Framework/Resolvers/EntityResolver.d.ts.map +0 -1
- package/build/Framework/Resolvers/EntityResolver.js +0 -40
- package/build/Framework/Resolvers/EntityResolver.js.map +0 -1
- package/build/Framework/Resolvers/FormResolver.d.ts +0 -10
- package/build/Framework/Resolvers/FormResolver.d.ts.map +0 -1
- package/build/Framework/Resolvers/FormResolver.js +0 -34
- package/build/Framework/Resolvers/FormResolver.js.map +0 -1
- package/build/Framework/RootDir.d.ts +0 -3
- package/build/Framework/RootDir.d.ts.map +0 -1
- package/build/Framework/RootDir.js +0 -7
- package/build/Framework/RootDir.js.map +0 -1
- package/build/Framework/index.d.ts +0 -9
- package/build/Framework/index.d.ts.map +0 -1
- package/build/Framework/index.js +0 -25
- package/build/Framework/index.js.map +0 -1
- package/build/LICENSE.md +0 -21
- package/build/Mail/MailAddress.d.ts +0 -5
- package/build/Mail/MailAddress.d.ts.map +0 -1
- package/build/Mail/MailAddress.js +0 -3
- package/build/Mail/MailAddress.js.map +0 -1
- package/build/Mail/MailTransport.d.ts +0 -6
- package/build/Mail/MailTransport.d.ts.map +0 -1
- package/build/Mail/MailTransport.js +0 -7
- package/build/Mail/MailTransport.js.map +0 -1
- package/build/Mail/Mailable.d.ts +0 -18
- package/build/Mail/Mailable.d.ts.map +0 -1
- package/build/Mail/Mailable.js +0 -17
- package/build/Mail/Mailable.js.map +0 -1
- package/build/Mail/Mailer.d.ts +0 -12
- package/build/Mail/Mailer.d.ts.map +0 -1
- package/build/Mail/Mailer.js +0 -27
- package/build/Mail/Mailer.js.map +0 -1
- package/build/Mail/PendingMail.d.ts +0 -30
- package/build/Mail/PendingMail.d.ts.map +0 -1
- package/build/Mail/PendingMail.js +0 -54
- package/build/Mail/PendingMail.js.map +0 -1
- package/build/Mail/SentMessage.d.ts +0 -16
- package/build/Mail/SentMessage.d.ts.map +0 -1
- package/build/Mail/SentMessage.js +0 -20
- package/build/Mail/SentMessage.js.map +0 -1
- package/build/Mail/Transports/MemoryTransport.d.ts +0 -8
- package/build/Mail/Transports/MemoryTransport.d.ts.map +0 -1
- package/build/Mail/Transports/MemoryTransport.js +0 -15
- package/build/Mail/Transports/MemoryTransport.js.map +0 -1
- package/build/Mail/Transports/SendGridTransport.d.ts +0 -11
- package/build/Mail/Transports/SendGridTransport.d.ts.map +0 -1
- package/build/Mail/Transports/SendGridTransport.js +0 -106
- package/build/Mail/Transports/SendGridTransport.js.map +0 -1
- package/build/Mail/index.d.ts +0 -4
- package/build/Mail/index.d.ts.map +0 -1
- package/build/Mail/index.js +0 -20
- package/build/Mail/index.js.map +0 -1
- package/build/Models/Model.d.ts +0 -10
- package/build/Models/Model.d.ts.map +0 -1
- package/build/Models/Model.js +0 -36
- package/build/Models/Model.js.map +0 -1
- package/build/Models/index.d.ts +0 -22
- package/build/Models/index.d.ts.map +0 -1
- package/build/Models/index.js +0 -64
- package/build/Models/index.js.map +0 -1
- package/build/Readme.md +0 -123
- package/build/Router/BaseController.d.ts +0 -5
- package/build/Router/BaseController.d.ts.map +0 -1
- package/build/Router/BaseController.js +0 -22
- package/build/Router/BaseController.js.map +0 -1
- package/build/Router/Decorators.d.ts +0 -19
- package/build/Router/Decorators.d.ts.map +0 -1
- package/build/Router/Decorators.js +0 -175
- package/build/Router/Decorators.js.map +0 -1
- package/build/Router/Guard.d.ts +0 -5
- package/build/Router/Guard.d.ts.map +0 -1
- package/build/Router/Guard.js +0 -11
- package/build/Router/Guard.js.map +0 -1
- package/build/Router/Http/Contracts.d.ts +0 -4
- package/build/Router/Http/Contracts.d.ts.map +0 -1
- package/build/Router/Http/Contracts.js +0 -3
- package/build/Router/Http/Contracts.js.map +0 -1
- package/build/Router/Http/ErrorHandler.d.ts +0 -10
- package/build/Router/Http/ErrorHandler.d.ts.map +0 -1
- package/build/Router/Http/ErrorHandler.js +0 -53
- package/build/Router/Http/ErrorHandler.js.map +0 -1
- package/build/Router/Http/ErrorHandlerInterface.d.ts +0 -6
- package/build/Router/Http/ErrorHandlerInterface.d.ts.map +0 -1
- package/build/Router/Http/ErrorHandlerInterface.js +0 -8
- package/build/Router/Http/ErrorHandlerInterface.js.map +0 -1
- package/build/Router/Http/Errors/HttpError.d.ts +0 -8
- package/build/Router/Http/Errors/HttpError.d.ts.map +0 -1
- package/build/Router/Http/Errors/HttpError.js +0 -18
- package/build/Router/Http/Errors/HttpError.js.map +0 -1
- package/build/Router/Http/Handler.d.ts +0 -19
- package/build/Router/Http/Handler.d.ts.map +0 -1
- package/build/Router/Http/Handler.js +0 -163
- package/build/Router/Http/Handler.js.map +0 -1
- package/build/Router/Http/HttpRoute.d.ts +0 -25
- package/build/Router/Http/HttpRoute.d.ts.map +0 -1
- package/build/Router/Http/HttpRoute.js +0 -97
- package/build/Router/Http/HttpRoute.js.map +0 -1
- package/build/Router/Http/Middleware.d.ts +0 -7
- package/build/Router/Http/Middleware.d.ts.map +0 -1
- package/build/Router/Http/Middleware.js +0 -8
- package/build/Router/Http/Middleware.js.map +0 -1
- package/build/Router/Http/Request.d.ts +0 -38
- package/build/Router/Http/Request.d.ts.map +0 -1
- package/build/Router/Http/Request.js +0 -211
- package/build/Router/Http/Request.js.map +0 -1
- package/build/Router/Http/Response.d.ts +0 -14
- package/build/Router/Http/Response.d.ts.map +0 -1
- package/build/Router/Http/Response.js +0 -31
- package/build/Router/Http/Response.js.map +0 -1
- package/build/Router/Http/index.d.ts +0 -84
- package/build/Router/Http/index.d.ts.map +0 -1
- package/build/Router/Http/index.js +0 -104
- package/build/Router/Http/index.js.map +0 -1
- package/build/Router/Metadata.d.ts +0 -41
- package/build/Router/Metadata.d.ts.map +0 -1
- package/build/Router/Metadata.js +0 -33
- package/build/Router/Metadata.js.map +0 -1
- package/build/Router/Middleware.d.ts +0 -13
- package/build/Router/Middleware.d.ts.map +0 -1
- package/build/Router/Middleware.js +0 -7
- package/build/Router/Middleware.js.map +0 -1
- package/build/Router/Request.d.ts +0 -24
- package/build/Router/Request.d.ts.map +0 -1
- package/build/Router/Request.js +0 -44
- package/build/Router/Request.js.map +0 -1
- package/build/Router/Route.d.ts +0 -13
- package/build/Router/Route.d.ts.map +0 -1
- package/build/Router/Route.js +0 -20
- package/build/Router/Route.js.map +0 -1
- package/build/Router/RouteNotFoundError.d.ts +0 -4
- package/build/Router/RouteNotFoundError.d.ts.map +0 -1
- package/build/Router/RouteNotFoundError.js +0 -10
- package/build/Router/RouteNotFoundError.js.map +0 -1
- package/build/Router/Router.d.ts +0 -19
- package/build/Router/Router.d.ts.map +0 -1
- package/build/Router/Router.js +0 -36
- package/build/Router/Router.js.map +0 -1
- package/build/Router/Servers/index.d.ts +0 -5
- package/build/Router/Servers/index.d.ts.map +0 -1
- package/build/Router/Servers/index.js +0 -19
- package/build/Router/Servers/index.js.map +0 -1
- package/build/Router/Servers/node.d.ts +0 -3
- package/build/Router/Servers/node.d.ts.map +0 -1
- package/build/Router/Servers/node.js +0 -41
- package/build/Router/Servers/node.js.map +0 -1
- package/build/Router/Servers/uNetworking.d.ts +0 -3
- package/build/Router/Servers/uNetworking.d.ts.map +0 -1
- package/build/Router/Servers/uNetworking.js +0 -172
- package/build/Router/Servers/uNetworking.js.map +0 -1
- package/build/Router/Websockets/Handler.d.ts +0 -15
- package/build/Router/Websockets/Handler.d.ts.map +0 -1
- package/build/Router/Websockets/Handler.js +0 -69
- package/build/Router/Websockets/Handler.js.map +0 -1
- package/build/Router/Websockets/Middleware.d.ts +0 -7
- package/build/Router/Websockets/Middleware.d.ts.map +0 -1
- package/build/Router/Websockets/Middleware.js +0 -8
- package/build/Router/Websockets/Middleware.js.map +0 -1
- package/build/Router/Websockets/Request.d.ts +0 -4
- package/build/Router/Websockets/Request.d.ts.map +0 -1
- package/build/Router/Websockets/Request.js +0 -8
- package/build/Router/Websockets/Request.js.map +0 -1
- package/build/Router/Websockets/WebsocketRoute.d.ts +0 -7
- package/build/Router/Websockets/WebsocketRoute.d.ts.map +0 -1
- package/build/Router/Websockets/WebsocketRoute.js +0 -47
- package/build/Router/Websockets/WebsocketRoute.js.map +0 -1
- package/build/Router/Websockets/index.d.ts +0 -19
- package/build/Router/Websockets/index.d.ts.map +0 -1
- package/build/Router/Websockets/index.js +0 -68
- package/build/Router/Websockets/index.js.map +0 -1
- package/build/Router/Websockets/types.d.ts +0 -22
- package/build/Router/Websockets/types.d.ts.map +0 -1
- package/build/Router/Websockets/types.js +0 -9
- package/build/Router/Websockets/types.js.map +0 -1
- package/build/Router/index.d.ts +0 -7
- package/build/Router/index.d.ts.map +0 -1
- package/build/Router/index.js +0 -23
- package/build/Router/index.js.map +0 -1
- package/build/Storage/File.d.ts +0 -12
- package/build/Storage/File.d.ts.map +0 -1
- package/build/Storage/File.js +0 -65
- package/build/Storage/File.js.map +0 -1
- package/build/Storage/Image.d.ts +0 -4
- package/build/Storage/Image.d.ts.map +0 -1
- package/build/Storage/Image.js +0 -8
- package/build/Storage/Image.js.map +0 -1
- package/build/Storage/InvalidImage.d.ts +0 -4
- package/build/Storage/InvalidImage.d.ts.map +0 -1
- package/build/Storage/InvalidImage.js +0 -8
- package/build/Storage/InvalidImage.js.map +0 -1
- package/build/Storage/Storage.d.ts +0 -13
- package/build/Storage/Storage.d.ts.map +0 -1
- package/build/Storage/Storage.js +0 -120
- package/build/Storage/Storage.js.map +0 -1
- package/build/Storage/index.d.ts +0 -5
- package/build/Storage/index.d.ts.map +0 -1
- package/build/Storage/index.js +0 -21
- package/build/Storage/index.js.map +0 -1
- package/build/Storage/utils.d.ts +0 -5
- package/build/Storage/utils.d.ts.map +0 -1
- package/build/Storage/utils.js +0 -20
- package/build/Storage/utils.js.map +0 -1
- package/build/Support/Array.d.ts +0 -29
- package/build/Support/Array.d.ts.map +0 -1
- package/build/Support/Array.js +0 -112
- package/build/Support/Array.js.map +0 -1
- package/build/Support/Math.d.ts +0 -7
- package/build/Support/Math.d.ts.map +0 -1
- package/build/Support/Math.js +0 -8
- package/build/Support/Math.js.map +0 -1
- package/build/Support/Metadata.d.ts +0 -16
- package/build/Support/Metadata.d.ts.map +0 -1
- package/build/Support/Metadata.js +0 -33
- package/build/Support/Metadata.js.map +0 -1
- package/build/Support/String.d.ts +0 -12
- package/build/Support/String.d.ts.map +0 -1
- package/build/Support/String.js +0 -24
- package/build/Support/String.js.map +0 -1
- package/build/Support/index.d.ts +0 -16
- package/build/Support/index.d.ts.map +0 -1
- package/build/Support/index.js +0 -7
- package/build/Support/index.js.map +0 -1
- package/build/Support/utils.d.ts +0 -2
- package/build/Support/utils.d.ts.map +0 -1
- package/build/Support/utils.js +0 -12
- package/build/Support/utils.js.map +0 -1
- package/build/Testing/TestCase.d.ts +0 -33
- package/build/Testing/TestCase.d.ts.map +0 -1
- package/build/Testing/TestCase.js +0 -138
- package/build/Testing/TestCase.js.map +0 -1
- package/build/Validation/Rule.d.ts +0 -7
- package/build/Validation/Rule.d.ts.map +0 -1
- package/build/Validation/Rule.js +0 -7
- package/build/Validation/Rule.js.map +0 -1
- package/build/Validation/RuleInterface.d.ts +0 -7
- package/build/Validation/RuleInterface.d.ts.map +0 -1
- package/build/Validation/RuleInterface.js +0 -3
- package/build/Validation/RuleInterface.js.map +0 -1
- package/build/Validation/Rules/Email.d.ts +0 -4
- package/build/Validation/Rules/Email.d.ts.map +0 -1
- package/build/Validation/Rules/Email.js +0 -17
- package/build/Validation/Rules/Email.js.map +0 -1
- package/build/Validation/Rules/FileExtension.d.ts +0 -4
- package/build/Validation/Rules/FileExtension.d.ts.map +0 -1
- package/build/Validation/Rules/FileExtension.js +0 -19
- package/build/Validation/Rules/FileExtension.js.map +0 -1
- package/build/Validation/Rules/MaxLength.d.ts +0 -4
- package/build/Validation/Rules/MaxLength.d.ts.map +0 -1
- package/build/Validation/Rules/MaxLength.js +0 -16
- package/build/Validation/Rules/MaxLength.js.map +0 -1
- package/build/Validation/Rules/MinLength.d.ts +0 -4
- package/build/Validation/Rules/MinLength.d.ts.map +0 -1
- package/build/Validation/Rules/MinLength.js +0 -16
- package/build/Validation/Rules/MinLength.js.map +0 -1
- package/build/Validation/Rules/Optional.d.ts +0 -4
- package/build/Validation/Rules/Optional.d.ts.map +0 -1
- package/build/Validation/Rules/Optional.js +0 -16
- package/build/Validation/Rules/Optional.js.map +0 -1
- package/build/Validation/Rules/Required.d.ts +0 -4
- package/build/Validation/Rules/Required.d.ts.map +0 -1
- package/build/Validation/Rules/Required.js +0 -24
- package/build/Validation/Rules/Required.js.map +0 -1
- package/build/Validation/Validator.d.ts +0 -12
- package/build/Validation/Validator.d.ts.map +0 -1
- package/build/Validation/Validator.js +0 -13
- package/build/Validation/Validator.js.map +0 -1
- package/build/Validation/index.d.ts +0 -11
- package/build/Validation/index.d.ts.map +0 -1
- package/build/Validation/index.js +0 -27
- package/build/Validation/index.js.map +0 -1
- package/build/package-lock.json +0 -5764
- package/build/package.json +0 -84
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import '../Support/Math'
|
|
2
|
+
import { ErrorHandlerInterface, Handler as HTTPHandler, Http, HttpError, Request as HttpRequest, Response } from '../Router/Http'
|
|
3
|
+
import { IncomingHttpHeaders } from 'http'
|
|
4
|
+
import { Application, DatabaseProvider } from '../Framework'
|
|
5
|
+
import { Router } from '../Router'
|
|
6
|
+
import { Auth, User } from '../Framework/Auth'
|
|
7
|
+
import { ActionRequest } from '../Router/Websockets/types'
|
|
8
|
+
import { Handler as WebsocketsHandler, WebSocket } from '../Router/Websockets'
|
|
9
|
+
import { Container } from '../Container'
|
|
10
|
+
import { ID } from '@Typetron/Database'
|
|
11
|
+
import { anything, instance, mock, when } from 'ts-mockito'
|
|
12
|
+
import { Crypt } from '@Typetron/Encryption'
|
|
13
|
+
import { Request } from '@Typetron/Router/Request'
|
|
14
|
+
import { HttpRoute } from '@Typetron/Router/Http/HttpRoute'
|
|
15
|
+
|
|
16
|
+
export abstract class TestCase {
|
|
17
|
+
static app: Application
|
|
18
|
+
app: Container
|
|
19
|
+
|
|
20
|
+
// tslint:disable-next-line:no-any
|
|
21
|
+
actionListeners = new Map<string, (response: any) => void>()
|
|
22
|
+
|
|
23
|
+
providersNeedingReboot = [
|
|
24
|
+
DatabaseProvider
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
abstract bootstrapApp(): Promise<Application>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
async before() {
|
|
31
|
+
if (!TestCase.app) {
|
|
32
|
+
TestCase.app = await this.bootstrapApp()
|
|
33
|
+
}
|
|
34
|
+
await TestCase.app.registerProviders(this.providersNeedingReboot)
|
|
35
|
+
this.app = TestCase.app.createChildContainer()
|
|
36
|
+
|
|
37
|
+
const crypt = mock(Crypt)
|
|
38
|
+
when(crypt.hash(anything(), anything())).thenCall(value => `testing-${value}`)
|
|
39
|
+
when(crypt.compare(anything(), anything())).thenCall((first, second) => Promise.resolve(`testing-${first}` === second))
|
|
40
|
+
|
|
41
|
+
this.app.set(Crypt, instance(crypt))
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async after() {}
|
|
45
|
+
|
|
46
|
+
async loginById(id: ID) {
|
|
47
|
+
await this.app.get(Auth).loginById(id)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated
|
|
52
|
+
*/
|
|
53
|
+
async login(user: User) {
|
|
54
|
+
await this.loginById(user.id)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async actingAs(user: User) {
|
|
58
|
+
await this.app.get(Auth).loginUser(user)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
get<T extends string | object | undefined>(routeName: string, content = {}, headers: IncomingHttpHeaders = {}): Promise<Response<T>> {
|
|
62
|
+
return this.request(Http.Method.GET, routeName, content, headers) as Promise<Response<T>>
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
post<T extends string | object | undefined>(
|
|
66
|
+
route: string | [string, Record<string, string | number>],
|
|
67
|
+
content = {},
|
|
68
|
+
headers: IncomingHttpHeaders = {}
|
|
69
|
+
): Promise<Response<T>> {
|
|
70
|
+
return this.request(Http.Method.POST, route, content, headers) as Promise<Response<T>>
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
patch<T extends string | object | undefined>(
|
|
74
|
+
route: string | [string, Record<string, string | number>],
|
|
75
|
+
content = {},
|
|
76
|
+
headers: IncomingHttpHeaders = {}
|
|
77
|
+
): Promise<Response<T>> {
|
|
78
|
+
return this.request(Http.Method.PATCH, route, content, headers) as Promise<Response<T>>
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
put<T extends string | object | undefined>(
|
|
82
|
+
route: string | [string, Record<string, string | number>],
|
|
83
|
+
content = {},
|
|
84
|
+
headers: IncomingHttpHeaders = {}
|
|
85
|
+
): Promise<Response<T>> {
|
|
86
|
+
return this.request(Http.Method.PUT, route, content, headers) as Promise<Response<T>>
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
delete<T extends string | object | undefined>(
|
|
90
|
+
route: string | [string, Record<string, string | number>],
|
|
91
|
+
content = {},
|
|
92
|
+
headers: IncomingHttpHeaders = {}
|
|
93
|
+
): Promise<Response<T>> {
|
|
94
|
+
return this.request(Http.Method.DELETE, route, content, headers) as Promise<Response<T>>
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async action<T extends string | object | undefined>(action: string, content?: ActionRequest['message']): Promise<Response<T>> {
|
|
98
|
+
const socketMock = mock(WebSocket)
|
|
99
|
+
|
|
100
|
+
when(socketMock.publishAndSend(anything(), anything(), anything())).thenCall((topic, calledActon, message) => {
|
|
101
|
+
const callback = this.actionListeners.get(calledActon)
|
|
102
|
+
callback?.(message)
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
when(socketMock.send(anything(), anything())).thenCall((calledActon, message) => {
|
|
106
|
+
const callback = this.actionListeners.get(calledActon)
|
|
107
|
+
callback?.(message)
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const container = this.app.createChildContainer()
|
|
111
|
+
container.set(WebSocket, instance(socketMock))
|
|
112
|
+
|
|
113
|
+
const request = new Request(action, content?.body)
|
|
114
|
+
|
|
115
|
+
// TODO find a way to save parameters so they can be retrieved easily in the Resolvers (check EntityResolver for example)
|
|
116
|
+
content?.parameters?.forEach(parameter => {
|
|
117
|
+
request.parameters[String.random(15)] = parameter
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
try {
|
|
121
|
+
return await this.app.get(WebsocketsHandler).handle(container, request)
|
|
122
|
+
} catch (error) {
|
|
123
|
+
if (error instanceof HttpError) {
|
|
124
|
+
const errorResponse = await this.app.get(ErrorHandlerInterface).handle(error)
|
|
125
|
+
console.error(errorResponse.body)
|
|
126
|
+
return errorResponse as Response<T>
|
|
127
|
+
}
|
|
128
|
+
throw error
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
on<T>(action: string, callback: (response: T) => void) {
|
|
133
|
+
this.actionListeners.set(action, callback)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
private async request(
|
|
137
|
+
method: Http.Method,
|
|
138
|
+
routeName: string | [string, Record<string, string | number>],
|
|
139
|
+
content = {},
|
|
140
|
+
headers: IncomingHttpHeaders = {}
|
|
141
|
+
) {
|
|
142
|
+
let routeParameters = {}
|
|
143
|
+
if (typeof routeName !== 'string') {
|
|
144
|
+
[routeName, routeParameters] = routeName
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const router = this.app.get(Router)
|
|
148
|
+
const route = router.routes.findWhere('name', routeName) as HttpRoute
|
|
149
|
+
if (!route) {
|
|
150
|
+
throw new Error(`Route '${routeName}' not found`)
|
|
151
|
+
}
|
|
152
|
+
const parameters = this.convertRouteParametersToString(routeParameters) || {}
|
|
153
|
+
|
|
154
|
+
const auth = this.app.get(Auth)
|
|
155
|
+
if (auth.identifier) {
|
|
156
|
+
const token = await auth.sign(auth.identifier)
|
|
157
|
+
headers.authorization = `Bearer ${token}`
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const request = new HttpRequest(route.getUrl(parameters), method, {}, {}, content)
|
|
161
|
+
|
|
162
|
+
request.setHeadersLoader(() => {
|
|
163
|
+
return headers
|
|
164
|
+
})
|
|
165
|
+
request.getHeader = <T extends string | string[] | undefined>(name: keyof IncomingHttpHeaders | string): T => {
|
|
166
|
+
return headers[String(name).toLowerCase()] as T
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
let response: Response
|
|
170
|
+
try {
|
|
171
|
+
response = await this.app.get(HTTPHandler).handle(this.app as Application, request)
|
|
172
|
+
|
|
173
|
+
if (response.body instanceof Buffer) {
|
|
174
|
+
response.body = response.body.toString()
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return response
|
|
178
|
+
|
|
179
|
+
} catch (error) {
|
|
180
|
+
if (error instanceof HttpError) {
|
|
181
|
+
return this.app.get(ErrorHandlerInterface).handle(error)
|
|
182
|
+
}
|
|
183
|
+
throw error
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
private convertRouteParametersToString(routeParameters: Record<string, string | number>) {
|
|
188
|
+
Object.keys(routeParameters).forEach(key => {
|
|
189
|
+
routeParameters[key] = String(routeParameters[key])
|
|
190
|
+
})
|
|
191
|
+
return routeParameters as Record<string, string>
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RuleInterface } from './RuleInterface'
|
|
2
|
+
|
|
3
|
+
export abstract class Rule implements RuleInterface {
|
|
4
|
+
abstract identifier: string
|
|
5
|
+
|
|
6
|
+
abstract message(attribute: string, value: string | number | object | boolean | undefined): string;
|
|
7
|
+
|
|
8
|
+
abstract passes(attribute: string, value: string | number | object | boolean | undefined): boolean ;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RuleInterface, RuleValue } from '..'
|
|
2
|
+
import { Rule } from '../Rule'
|
|
3
|
+
import { Type } from '@Typetron/Support'
|
|
4
|
+
|
|
5
|
+
export function Email(message?: string): Type<RuleInterface> {
|
|
6
|
+
return class extends Rule {
|
|
7
|
+
identifier = 'email'
|
|
8
|
+
|
|
9
|
+
private regex = /^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])$/
|
|
10
|
+
|
|
11
|
+
passes(attribute: string, value: RuleValue): boolean {
|
|
12
|
+
return this.regex.test(String(value).trim())
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message(attribute: string): string {
|
|
16
|
+
return message ?? `The ${attribute} must be a valid email address`
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Rule, RuleInterface } from '@Typetron/Validation'
|
|
2
|
+
import { Type } from '@Typetron/Support'
|
|
3
|
+
import { File } from '@Typetron/Storage'
|
|
4
|
+
|
|
5
|
+
export function FileExtension(extensions: string[], message?: string): Type<RuleInterface> {
|
|
6
|
+
return class extends Rule {
|
|
7
|
+
identifier = 'fileExtension'
|
|
8
|
+
|
|
9
|
+
passes(attribute: string, value?: File): boolean {
|
|
10
|
+
return value?.extension ? extensions.includes(value.extension) : false
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message(attribute: string, value?: File): string {
|
|
14
|
+
const messagePart = extensions.length === 1
|
|
15
|
+
? `the '.${extensions.first()}' extension`
|
|
16
|
+
: `these extensions: ${extensions.map(extension => `.${extension}`).join(', ')}`
|
|
17
|
+
|
|
18
|
+
return message ?? `The ${attribute} must have ${messagePart}`
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RuleInterface, RuleValue } from '..'
|
|
2
|
+
import { Rule } from '../Rule'
|
|
3
|
+
import { Type } from '../../Support'
|
|
4
|
+
|
|
5
|
+
export function MaxLength(max: number, message?: string): Type<RuleInterface> {
|
|
6
|
+
return class extends Rule {
|
|
7
|
+
identifier = 'maxLength'
|
|
8
|
+
|
|
9
|
+
passes(attribute: string, value: RuleValue): boolean {
|
|
10
|
+
return Boolean(value && String(value).length <= max)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message(attribute: string): string {
|
|
14
|
+
return message ?? `The ${attribute} must have at most ${max} characters`
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RuleInterface } from '../RuleInterface'
|
|
2
|
+
import { RuleValue } from '..'
|
|
3
|
+
import { Type } from '../../Support'
|
|
4
|
+
import { Rule } from '../Rule'
|
|
5
|
+
|
|
6
|
+
export function MinLength(min: number, message?: string): Type<RuleInterface> {
|
|
7
|
+
return class extends Rule {
|
|
8
|
+
identifier = 'minLength'
|
|
9
|
+
|
|
10
|
+
passes(attribute: string, value: RuleValue): boolean {
|
|
11
|
+
return Boolean(value && String(value).length >= min)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message(attribute: string): string {
|
|
15
|
+
return message ?? `The ${attribute} must have at least ${min} characters`
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RuleInterface, RuleValue } from '..'
|
|
2
|
+
import { Rule } from '../Rule'
|
|
3
|
+
import { Type } from '@Typetron/Support'
|
|
4
|
+
|
|
5
|
+
export function Optional(): Type<RuleInterface> {
|
|
6
|
+
return class extends Rule {
|
|
7
|
+
identifier = 'optional'
|
|
8
|
+
|
|
9
|
+
passes(attribute: string, value: RuleValue): boolean {
|
|
10
|
+
return true // TODO
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message(attribute: string): string {
|
|
14
|
+
return ''
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RuleInterface, RuleValue } from '..'
|
|
2
|
+
import { Type } from '@Typetron/Support'
|
|
3
|
+
|
|
4
|
+
export function Required(message?: string): Type<RuleInterface> {
|
|
5
|
+
return class {
|
|
6
|
+
identifier = 'required'
|
|
7
|
+
|
|
8
|
+
passes(attribute: string, value: RuleValue): boolean {
|
|
9
|
+
|
|
10
|
+
if (value === undefined || value === null) {
|
|
11
|
+
return false
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (typeof value === 'string' && value.trim() === '') {
|
|
15
|
+
return false
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (value.constructor === Array && value.length === 0) {
|
|
19
|
+
return false
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return true
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message(attribute: string): string {
|
|
26
|
+
return message ?? `The ${attribute} is required`
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// tslint:disable-next-line:no-any
|
|
2
|
+
export type RuleValue = any
|
|
3
|
+
export * from './RuleInterface'
|
|
4
|
+
export * from './Validator'
|
|
5
|
+
export * from './Rule'
|
|
6
|
+
export * from './Rules/MaxLength'
|
|
7
|
+
export * from './Rules/MinLength'
|
|
8
|
+
export * from './Rules/FileExtension'
|
|
9
|
+
export * from './Rules/Required'
|
|
10
|
+
export * from './Rules/Email'
|
|
11
|
+
export * from './Rules/Optional'
|
|
12
|
+
// export * from './Rules/FileExtension'
|
package/benchmark.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// clinic flame -- node -r ts-node/register -r tsconfig-paths/register benchmark.js
|
|
2
|
+
|
|
3
|
+
import 'reflect-metadata'
|
|
4
|
+
import '@Typetron/Support'
|
|
5
|
+
import { Handler, Http, Request } from './Router/Http'
|
|
6
|
+
import { Container } from './Container'
|
|
7
|
+
import { Get } from './Router'
|
|
8
|
+
import Method = Http.Method
|
|
9
|
+
|
|
10
|
+
class Controller {
|
|
11
|
+
@Get()
|
|
12
|
+
read() {
|
|
13
|
+
return 'Hello world!!!'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function main() {
|
|
18
|
+
|
|
19
|
+
const app = new Container()
|
|
20
|
+
const handler = app.get(Handler)
|
|
21
|
+
|
|
22
|
+
handler.addRoute('', Method.GET, Controller, 'read', 'read')
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
// const request = await Request.capture({
|
|
27
|
+
// url: 'http://localhost:3000',
|
|
28
|
+
// method: 'GET',
|
|
29
|
+
// headers: {}
|
|
30
|
+
// })
|
|
31
|
+
// await handler.handle(app, request)
|
|
32
|
+
|
|
33
|
+
console.time('test')
|
|
34
|
+
for (let i = 0; i < 1_000_000_0; i++) {
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
const request = await Request.capture({
|
|
38
|
+
url: 'http://localhost:3000',
|
|
39
|
+
method: 'GET',
|
|
40
|
+
headers: {}
|
|
41
|
+
})
|
|
42
|
+
await handler.handle(app, request)
|
|
43
|
+
}
|
|
44
|
+
console.timeEnd('test')
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
main()
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import tsEslint from '@typescript-eslint/eslint-plugin'
|
|
3
|
+
import tsParser from '@typescript-eslint/parser'
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
{
|
|
7
|
+
ignores : ['node_modules/**', 'build/**', '*.js', '*.mjs']
|
|
8
|
+
},
|
|
9
|
+
js.configs.recommended,
|
|
10
|
+
{
|
|
11
|
+
files : ['**/*.ts'],
|
|
12
|
+
languageOptions : {
|
|
13
|
+
parser : tsParser,
|
|
14
|
+
parserOptions : {
|
|
15
|
+
ecmaVersion : 'latest',
|
|
16
|
+
sourceType : 'module'
|
|
17
|
+
},
|
|
18
|
+
globals : {
|
|
19
|
+
console : 'readonly',
|
|
20
|
+
process : 'readonly',
|
|
21
|
+
Buffer : 'readonly',
|
|
22
|
+
__dirname : 'readonly',
|
|
23
|
+
__filename : 'readonly',
|
|
24
|
+
exports : 'readonly',
|
|
25
|
+
module : 'readonly',
|
|
26
|
+
require : 'readonly',
|
|
27
|
+
global : 'readonly',
|
|
28
|
+
setTimeout : 'readonly',
|
|
29
|
+
setInterval : 'readonly',
|
|
30
|
+
clearTimeout : 'readonly',
|
|
31
|
+
clearInterval : 'readonly',
|
|
32
|
+
URL : 'readonly'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
plugins : {
|
|
36
|
+
'@typescript-eslint' : tsEslint
|
|
37
|
+
},
|
|
38
|
+
rules : {
|
|
39
|
+
// Disable conflicting rules
|
|
40
|
+
'no-unused-vars' : 'off',
|
|
41
|
+
'no-shadow' : 'off',
|
|
42
|
+
|
|
43
|
+
// Basic rules
|
|
44
|
+
'max-len' : ['warn', { code : 140, tabWidth : 4 }],
|
|
45
|
+
'no-async-promise-executor' : 'off',
|
|
46
|
+
|
|
47
|
+
// TypeScript rules
|
|
48
|
+
'@typescript-eslint/no-explicit-any' : 'off',
|
|
49
|
+
'@typescript-eslint/no-unused-vars' : 'warn',
|
|
50
|
+
'@typescript-eslint/ban-ts-comment' : 'warn',
|
|
51
|
+
'@typescript-eslint/no-inferrable-types' : 'off',
|
|
52
|
+
'@typescript-eslint/no-empty-interface' : 'error',
|
|
53
|
+
|
|
54
|
+
// Code quality rules derived from tslint config
|
|
55
|
+
'curly' : 'error',
|
|
56
|
+
'eqeqeq' : ['error', 'always', { null : 'ignore' }],
|
|
57
|
+
'no-bitwise' : 'error',
|
|
58
|
+
'no-console' : ['error', { allow : ['warn', 'error', 'info'] }],
|
|
59
|
+
'no-debugger' : 'error',
|
|
60
|
+
'no-eval' : 'error',
|
|
61
|
+
'no-throw-literal' : 'error',
|
|
62
|
+
'no-trailing-spaces' : 'off',
|
|
63
|
+
'no-undef-init' : 'error',
|
|
64
|
+
'no-unsafe-finally' : 'error',
|
|
65
|
+
'quotes' : ['error', 'single', { avoidEscape : true }],
|
|
66
|
+
'radix' : 'error',
|
|
67
|
+
'semi' : ['error', 'never'],
|
|
68
|
+
'prefer-const' : 'error'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
files : ['tests/**/*.ts'],
|
|
73
|
+
rules : {
|
|
74
|
+
'@typescript-eslint/no-unused-vars' : 'off',
|
|
75
|
+
'@typescript-eslint/no-explicit-any' : 'off'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typetron/framework",
|
|
3
3
|
"description": "Modern Node.js framework for modern apps written in Typescript",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.5.
|
|
5
|
+
"version": "0.5.22",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"typetron",
|
|
8
8
|
"framework",
|
|
@@ -15,15 +15,19 @@
|
|
|
15
15
|
"name": "Ionel Lupu"
|
|
16
16
|
},
|
|
17
17
|
|
|
18
|
-
"main": "
|
|
19
|
-
"types": "
|
|
18
|
+
"main": "index.js",
|
|
19
|
+
"types": "index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
-
"types": "./
|
|
23
|
-
"default": "./
|
|
22
|
+
"types": "./index.d.ts",
|
|
23
|
+
"default": "./index.js"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"directory": "build"
|
|
29
|
+
},
|
|
30
|
+
|
|
27
31
|
"scripts": {
|
|
28
32
|
"clean": "rm -rf build",
|
|
29
33
|
"build": "tsc",
|
|
@@ -76,9 +80,5 @@
|
|
|
76
80
|
"repository": {
|
|
77
81
|
"type": "git",
|
|
78
82
|
"url": "https://github.com/typetron/framework.git"
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
"files": [
|
|
82
|
-
"build/**/*"
|
|
83
|
-
]
|
|
83
|
+
}
|
|
84
84
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"check-coverage": true,
|
|
3
|
+
"lines": 80,
|
|
4
|
+
"statements": 80,
|
|
5
|
+
"functions": 80,
|
|
6
|
+
"branches": 80,
|
|
7
|
+
"include": [
|
|
8
|
+
"./**/*.ts"
|
|
9
|
+
],
|
|
10
|
+
"exclude": [
|
|
11
|
+
"./tests/**/*.ts",
|
|
12
|
+
"./dist/**"
|
|
13
|
+
],
|
|
14
|
+
"reporter": [
|
|
15
|
+
"lcov",
|
|
16
|
+
"text-summary"
|
|
17
|
+
],
|
|
18
|
+
"all": true
|
|
19
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { suite, test } from '@testdeck/mocha'
|
|
2
|
+
import { CacheItem, DatabaseStore } from '@Typetron/Cache'
|
|
3
|
+
import { expect } from 'chai'
|
|
4
|
+
import { createHash } from 'crypto'
|
|
5
|
+
import { Connection, Query, SqliteDriver } from '@Typetron/Database'
|
|
6
|
+
import { Storage } from '@Typetron/Storage'
|
|
7
|
+
|
|
8
|
+
const tableName = 'cache'
|
|
9
|
+
const databaseFilePath = './tests/Cache/database.sqlite'
|
|
10
|
+
|
|
11
|
+
@suite
|
|
12
|
+
class DatabaseStoreTest {
|
|
13
|
+
|
|
14
|
+
databaseStore = new DatabaseStore(tableName)
|
|
15
|
+
|
|
16
|
+
static async before() {
|
|
17
|
+
Query.connection = new Connection(new SqliteDriver(databaseFilePath))
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static async after() {
|
|
21
|
+
await new Storage().deleteDirectory(databaseFilePath)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private getCacheRecord(name: string) {
|
|
25
|
+
const cacheKeyHash = createHash('sha1').update(name).digest('hex')
|
|
26
|
+
return Query.table<CacheItem<unknown>>(tableName).where('name', cacheKeyHash).first()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@test
|
|
30
|
+
async returnsUndefinedIfRecordDoesntExist() {
|
|
31
|
+
const value = await this.databaseStore.get('tests')
|
|
32
|
+
expect(value).to.be.undefined
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@test
|
|
36
|
+
async testPutCreatesRecord() {
|
|
37
|
+
const contents = 'test'
|
|
38
|
+
|
|
39
|
+
await this.databaseStore.set('foo', contents)
|
|
40
|
+
|
|
41
|
+
const cacheRecord = await this.getCacheRecord('foo')
|
|
42
|
+
expect(cacheRecord).to.exist
|
|
43
|
+
expect((cacheRecord as CacheItem<any>).value).to.be.equal(JSON.stringify(contents))
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@test
|
|
47
|
+
async testExpirationValueIsWrittenInCacheRecord() {
|
|
48
|
+
const durationInSeconds = 60
|
|
49
|
+
const expirationTime = Date.now() + durationInSeconds * 1000
|
|
50
|
+
|
|
51
|
+
await this.databaseStore.set('expireTest', 'value', durationInSeconds)
|
|
52
|
+
const cacheRecord = await this.getCacheRecord('expireTest')
|
|
53
|
+
|
|
54
|
+
expect(cacheRecord).to.exist
|
|
55
|
+
expect(new Date((cacheRecord as CacheItem<unknown>).date ?? Infinity).getTime()).to.be.closeTo(expirationTime, 1000) // Allowing a 1-second difference
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@test
|
|
59
|
+
async testCacheValueIsUndefinedIfExpired() {
|
|
60
|
+
const durationInSeconds = -60 // Setting a past expiration
|
|
61
|
+
|
|
62
|
+
await this.databaseStore.set('anotherExpiredTest', 'value', durationInSeconds)
|
|
63
|
+
|
|
64
|
+
const value = await this.databaseStore.get('anotherExpiredTest')
|
|
65
|
+
expect(value).to.be.undefined
|
|
66
|
+
|
|
67
|
+
const cacheRecord = await this.getCacheRecord('anotherExpiredTest')
|
|
68
|
+
expect(cacheRecord).to.be.undefined
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@test
|
|
72
|
+
async testDeleteMethodDeletesRecordFromDatabase() {
|
|
73
|
+
await this.databaseStore.set('deleteTest', 'value')
|
|
74
|
+
|
|
75
|
+
await this.databaseStore.delete('deleteTest')
|
|
76
|
+
|
|
77
|
+
const cacheRecord = await this.getCacheRecord('deleteTest')
|
|
78
|
+
expect(cacheRecord).to.be.undefined
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@test
|
|
82
|
+
async testFlushMethodDeletesAllRecords() {
|
|
83
|
+
await this.databaseStore.set('flushTest', 'value')
|
|
84
|
+
|
|
85
|
+
await this.databaseStore.flush()
|
|
86
|
+
|
|
87
|
+
const allRecords = await Query.table(tableName).get()
|
|
88
|
+
expect(allRecords.length).to.be.equal(0)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@test
|
|
92
|
+
async testRememberMethodCreatesRecordIfNotExists() {
|
|
93
|
+
const value = await this.databaseStore.remember('rememberTest', 'defaultValue', 60)
|
|
94
|
+
|
|
95
|
+
expect(value).to.equal('defaultValue')
|
|
96
|
+
|
|
97
|
+
const cacheRecord = await this.getCacheRecord('rememberTest')
|
|
98
|
+
expect(cacheRecord).to.exist
|
|
99
|
+
expect((cacheRecord as CacheItem<any>).value).to.be.equal(JSON.stringify('defaultValue'))
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@test
|
|
103
|
+
async testRememberMethodReturnsExistingValue() {
|
|
104
|
+
await this.databaseStore.set('rememberTest2', 'existingValue')
|
|
105
|
+
|
|
106
|
+
const value = await this.databaseStore.remember('rememberTest2', 'defaultValue', 60)
|
|
107
|
+
|
|
108
|
+
expect(value).to.equal('existingValue')
|
|
109
|
+
}
|
|
110
|
+
}
|