@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,72 @@
|
|
|
1
|
+
import { suite, test } from '@testdeck/mocha'
|
|
2
|
+
import { Handler, Http, Request } from '../../Router/Http'
|
|
3
|
+
import { expect } from 'chai'
|
|
4
|
+
import { Container } from '@Typetron/Container'
|
|
5
|
+
import { Body, Controller, Get } from '../../Router'
|
|
6
|
+
|
|
7
|
+
@suite
|
|
8
|
+
class HttpHandlerTest {
|
|
9
|
+
private container: Container
|
|
10
|
+
|
|
11
|
+
async before() {
|
|
12
|
+
this.container = new Container()
|
|
13
|
+
Container.setInstance(this.container)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@test
|
|
17
|
+
'gives error when two routes have the same path'() {
|
|
18
|
+
|
|
19
|
+
class MyController {
|
|
20
|
+
index() {}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const handler = this.container.get(Handler)
|
|
24
|
+
handler.addRoute('', Http.Method.GET, MyController, 'index', 'index')
|
|
25
|
+
|
|
26
|
+
expect(() => handler.addRoute('', Http.Method.POST, MyController, 'index', 'index'))
|
|
27
|
+
.to.not.throw(`There is already a route with the same url: [GET] ''`)
|
|
28
|
+
expect(() => handler.addRoute('', Http.Method.GET, MyController, 'index', 'index'))
|
|
29
|
+
.to.throw(`There is already a route with the same url: [GET] ''`)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@test
|
|
33
|
+
async 'returns the value from the @Body'() {
|
|
34
|
+
@Controller()
|
|
35
|
+
class MyController {
|
|
36
|
+
@Get('list')
|
|
37
|
+
list(@Body() value: string) {
|
|
38
|
+
return value
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@Get('create')
|
|
42
|
+
create(@Body() value: string) {
|
|
43
|
+
return value
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const router = this.container.get(Handler)
|
|
48
|
+
|
|
49
|
+
const listContent = await router.handle(this.container, new Request('list', Http.Method.GET, undefined, {}, 'test'))
|
|
50
|
+
expect(listContent.body).to.be.equal('test')
|
|
51
|
+
|
|
52
|
+
const createContent = await router.handle(this.container, new Request('create', Http.Method.GET))
|
|
53
|
+
expect(createContent.body).to.be.equal(undefined)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// @test
|
|
57
|
+
// async 'caches route urls'(done: Function) {
|
|
58
|
+
// class Controller {
|
|
59
|
+
// index() {}
|
|
60
|
+
// }
|
|
61
|
+
//
|
|
62
|
+
// const router = new Router()
|
|
63
|
+
// router.add('', Http.Method.GET, Controller, 'index', 'index')
|
|
64
|
+
//
|
|
65
|
+
// expect(router.cachedRoutes).to.be.have.length(0)
|
|
66
|
+
//
|
|
67
|
+
// const app = new Container()
|
|
68
|
+
// const request = new Request('', Http.Method.GET)
|
|
69
|
+
// await router.handle(app as Application, request)
|
|
70
|
+
// expect(router.findRouteIndex).to.be.called.once // ???
|
|
71
|
+
// }
|
|
72
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { suite, test } from '@testdeck/mocha'
|
|
2
|
+
import { expect } from 'chai'
|
|
3
|
+
import { Http, Request } from '../../Router/Http'
|
|
4
|
+
import { IncomingHttpHeaders } from 'http'
|
|
5
|
+
import { File } from '../../Storage'
|
|
6
|
+
|
|
7
|
+
@suite
|
|
8
|
+
class RequestTest {
|
|
9
|
+
|
|
10
|
+
private request: Request
|
|
11
|
+
|
|
12
|
+
before() {
|
|
13
|
+
this.request = new Request('http://example.com/test?name=value', Http.Method.GET)
|
|
14
|
+
this.request.setHeadersLoader(() => {
|
|
15
|
+
return {'content-type': 'text/html'}
|
|
16
|
+
})
|
|
17
|
+
this.request.getHeader = <T extends string | string[] | undefined>(name: keyof IncomingHttpHeaders | string): T => {
|
|
18
|
+
return 'text/html' as T
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@test
|
|
23
|
+
'uri getter should return correct uri'() {
|
|
24
|
+
expect(this.request.uri).to.equal('/test')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@test
|
|
28
|
+
'method getter should return correct method'() {
|
|
29
|
+
expect(this.request.method).to.equal(Http.Method.GET)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Assuming that the commented url getter is uncommented in your code
|
|
33
|
+
@test
|
|
34
|
+
'url getter should return correct url'() {
|
|
35
|
+
expect(this.request.url).to.equal('http://example.com/test?name=value')
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@test
|
|
39
|
+
'query getter should parse and return correct query parameters'() {
|
|
40
|
+
expect(this.request.query).to.deep.equal({name: 'value'})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@test
|
|
44
|
+
'cookies getter should parse and return correct cookies'() {
|
|
45
|
+
expect(this.request.cookies).to.deep.equal({todo: 'parse cookies'})
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@test
|
|
49
|
+
'body getter and setter should return and set body correctly'() {
|
|
50
|
+
this.request.body = {test: 'data'}
|
|
51
|
+
expect(this.request.body).to.deep.equal({test: 'data'})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@test
|
|
55
|
+
'files getter and setter should return and set files correctly'() {
|
|
56
|
+
const dummyFile = { // Just a mock structure based on what you provided
|
|
57
|
+
originalName: 'test.txt',
|
|
58
|
+
directory: '/tmp',
|
|
59
|
+
saved: true,
|
|
60
|
+
path: '/tmp/test.txt'
|
|
61
|
+
} as File
|
|
62
|
+
|
|
63
|
+
this.request.files = {testFile: dummyFile}
|
|
64
|
+
expect(this.request.files).to.deep.equal({testFile: dummyFile})
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@test
|
|
68
|
+
'headers getter should return correct headers'() {
|
|
69
|
+
expect(this.request.headers).to.deep.equal({'content-type': 'text/html'})
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@test
|
|
73
|
+
'header value is returned'() {
|
|
74
|
+
expect(this.request.getHeader('random header')).to.deep.equal('text/html')
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { suite, test } from '@testdeck/mocha'
|
|
2
|
+
import { Handler } from '../../Router/Websockets'
|
|
3
|
+
import { expect } from 'chai'
|
|
4
|
+
import { Container } from '@Typetron/Container'
|
|
5
|
+
import { Action, Body, Controller } from '../../Router'
|
|
6
|
+
import { Request } from '../../Router/Request'
|
|
7
|
+
|
|
8
|
+
@suite
|
|
9
|
+
class WebSocketsHandlerTest {
|
|
10
|
+
|
|
11
|
+
@test
|
|
12
|
+
'gives error when two actions have the same path'() {
|
|
13
|
+
const container = new Container()
|
|
14
|
+
|
|
15
|
+
class Controller {
|
|
16
|
+
list() {}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const router = container.get(Handler)
|
|
20
|
+
router.addAction('list', Controller, 'list')
|
|
21
|
+
|
|
22
|
+
expect(() => router.addAction('list', Controller, 'index')).to.throw(`There is already an action with the same name: 'list'`)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@test
|
|
26
|
+
async 'returns the value from the @Body'() {
|
|
27
|
+
const container = Container.getInstance()
|
|
28
|
+
|
|
29
|
+
@Controller()
|
|
30
|
+
class MyController {
|
|
31
|
+
@Action()
|
|
32
|
+
list(@Body() value: string) {
|
|
33
|
+
return value
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Action()
|
|
37
|
+
create(@Body() value: string) {
|
|
38
|
+
return value
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const router = container.get(Handler)
|
|
43
|
+
|
|
44
|
+
const listContent = await router.handle(container, new Request('list', 'test'))
|
|
45
|
+
expect(listContent.body).to.be.equal('test')
|
|
46
|
+
|
|
47
|
+
const createContent = await router.handle(container, new Request('create'))
|
|
48
|
+
expect(createContent.body).to.be.equal(undefined)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { suite, test } from '@testdeck/mocha'
|
|
2
|
+
import { File, Storage } from '../../Storage'
|
|
3
|
+
import { expect } from 'chai'
|
|
4
|
+
import * as path from 'path'
|
|
5
|
+
|
|
6
|
+
const directory = './tests/Storage/.storage'
|
|
7
|
+
|
|
8
|
+
@suite
|
|
9
|
+
class StorageTest {
|
|
10
|
+
storage = new Storage()
|
|
11
|
+
|
|
12
|
+
@test
|
|
13
|
+
async canReadFiles() {
|
|
14
|
+
const file = new File('testFile.txt')
|
|
15
|
+
file.directory = directory
|
|
16
|
+
// Create the file before trying to save it
|
|
17
|
+
await this.storage.put(path.join(directory, file.name), 'test content')
|
|
18
|
+
|
|
19
|
+
const content = await this.storage.read(path.join(directory, file.name))
|
|
20
|
+
expect(content).to.be.instanceOf(Buffer)
|
|
21
|
+
expect(content.toString()).to.equal('test content')
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@test
|
|
25
|
+
async canCheckIfFileExists() {
|
|
26
|
+
const file = new File('testFile.txt')
|
|
27
|
+
file.directory = directory
|
|
28
|
+
// Create the file before trying to save it
|
|
29
|
+
await this.storage.put(path.join(directory, file.name), 'test content')
|
|
30
|
+
|
|
31
|
+
const exists = await this.storage.exists(path.join(directory, file.name))
|
|
32
|
+
expect(exists).to.be.true
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@test
|
|
36
|
+
async canSaveFiles() {
|
|
37
|
+
const file = new File('testFile.txt')
|
|
38
|
+
file.directory = directory
|
|
39
|
+
// Create the file before trying to save it
|
|
40
|
+
await this.storage.put(path.join(directory, file.name), 'test content')
|
|
41
|
+
const savedFile = await this.storage.save(file, './tests/Storage/.storage/alternative.txt')
|
|
42
|
+
expect(savedFile).to.be.instanceOf(File)
|
|
43
|
+
expect(savedFile.name).to.equal(file.name)
|
|
44
|
+
expect(await this.storage.exists(savedFile.path)).to.be.true
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@test
|
|
48
|
+
async canWriteToFile() {
|
|
49
|
+
const filePath = path.join(directory, 'testFile.txt')
|
|
50
|
+
const file = await this.storage.put(filePath, 'test content')
|
|
51
|
+
expect(file).to.be.instanceOf(File)
|
|
52
|
+
expect(file.name).to.equal('testFile.txt')
|
|
53
|
+
const content = await this.storage.read(path.join(directory, file.name))
|
|
54
|
+
expect(content).to.be.instanceOf(Buffer)
|
|
55
|
+
expect(content.toString()).to.equal('test content')
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@test
|
|
59
|
+
async canCreateDirectory() {
|
|
60
|
+
await this.storage.makeDirectory(directory)
|
|
61
|
+
const exists = await this.storage.exists(directory)
|
|
62
|
+
expect(exists).to.be.true
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@test
|
|
66
|
+
async canDeleteDirectory() {
|
|
67
|
+
await this.storage.makeDirectory(directory)
|
|
68
|
+
await this.storage.deleteDirectory(directory)
|
|
69
|
+
const exists = await this.storage.exists(directory)
|
|
70
|
+
expect(exists).to.be.false
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@test
|
|
74
|
+
async canDeleteFile() {
|
|
75
|
+
const file = new File('testFile.txt')
|
|
76
|
+
file.directory = directory
|
|
77
|
+
// Create the file before trying to save it
|
|
78
|
+
await this.storage.put(path.join(directory, file.name), 'test content')
|
|
79
|
+
|
|
80
|
+
await this.storage.delete(path.join(directory, file.name))
|
|
81
|
+
const exists = await this.storage.exists(path.join(directory, file.name))
|
|
82
|
+
expect(exists).to.be.false
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@test
|
|
86
|
+
async cannotDeleteWithoutFileName() {
|
|
87
|
+
try {
|
|
88
|
+
// Attempt to delete a directory instead of a file
|
|
89
|
+
await this.storage.delete(directory)
|
|
90
|
+
throw new Error('Expected an error to be thrown, but none was thrown.')
|
|
91
|
+
} catch (unknownError) {
|
|
92
|
+
const error = unknownError as Error
|
|
93
|
+
expect(error).to.be.instanceOf(Error)
|
|
94
|
+
expect(error.message).to.equal('Can not delete because this path leads to a directory and not a file.')
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { expect } from 'chai'
|
|
2
|
+
import { suite, test } from '@testdeck/mocha'
|
|
3
|
+
import '../../Support'
|
|
4
|
+
|
|
5
|
+
interface User {
|
|
6
|
+
name: string;
|
|
7
|
+
age: number;
|
|
8
|
+
admin: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@suite
|
|
12
|
+
class ArrayTest {
|
|
13
|
+
|
|
14
|
+
joe = {
|
|
15
|
+
name: 'Joe',
|
|
16
|
+
age: 20,
|
|
17
|
+
admin: false
|
|
18
|
+
}
|
|
19
|
+
doe = {
|
|
20
|
+
name: 'Doe',
|
|
21
|
+
age: 21,
|
|
22
|
+
admin: true
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
users: User[] = []
|
|
26
|
+
|
|
27
|
+
before() {
|
|
28
|
+
this.users = [this.joe, this.doe]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@test
|
|
32
|
+
empty() {
|
|
33
|
+
expect([].empty()).to.be.equal(true)
|
|
34
|
+
expect([1].empty()).to.be.equal(false)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@test
|
|
38
|
+
findWhere() {
|
|
39
|
+
expect(this.users.findWhere('name', 'Joe')).to.be.equal(this.joe)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@test
|
|
43
|
+
pluck() {
|
|
44
|
+
expect(this.users.pluck('name')).to.have.members([this.joe.name, this.doe.name])
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@test
|
|
48
|
+
remove() {
|
|
49
|
+
this.users.remove(this.joe)
|
|
50
|
+
expect(this.users).to.have.members([this.doe])
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@test
|
|
54
|
+
removeMany() {
|
|
55
|
+
this.users.remove(this.joe, this.doe)
|
|
56
|
+
expect(this.users).to.have.length(0)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@test
|
|
60
|
+
where() {
|
|
61
|
+
expect(this.users.where('name', this.joe.name)).to.have.members([this.joe])
|
|
62
|
+
expect([this.joe].where('admin', false)).to.have.length(1)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@test
|
|
66
|
+
whereNot() {
|
|
67
|
+
expect(this.users.whereNot('name', this.joe.name)).to.have.members([this.doe])
|
|
68
|
+
expect([this.doe].whereNot('admin', false)).to.have.length(1)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@test
|
|
72
|
+
whereWithDefaultValue() {
|
|
73
|
+
expect(this.users.where('admin')).to.have.members([this.doe])
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@test
|
|
77
|
+
whereIn() {
|
|
78
|
+
expect(this.users.whereIn('name', [this.joe.name, this.doe.name])).to.have.members([this.joe, this.doe])
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@test
|
|
82
|
+
whereNotIn() {
|
|
83
|
+
expect(this.users.whereNotIn('name', [this.joe.name])).to.have.members([this.doe])
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@test
|
|
87
|
+
first() {
|
|
88
|
+
expect(this.users.first()).to.be.equal(this.joe)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@test
|
|
92
|
+
groupBy() {
|
|
93
|
+
expect(this.users.groupBy('age')).to.deep.equal({
|
|
94
|
+
20: [this.joe],
|
|
95
|
+
21: [this.doe],
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@test
|
|
100
|
+
groupByCallback() {
|
|
101
|
+
expect(this.users.groupBy(user => user.age)).to.deep.equal({
|
|
102
|
+
20: [this.joe],
|
|
103
|
+
21: [this.doe],
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@test
|
|
108
|
+
uniqueValue() {
|
|
109
|
+
const data = [1, 1, 2, 3]
|
|
110
|
+
expect(data.unique()).to.be.deep.equal([1, 2, 3])
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@test
|
|
114
|
+
uniqueValueBasedOnKey() {
|
|
115
|
+
const data = [
|
|
116
|
+
{id: 1},
|
|
117
|
+
{id: 1},
|
|
118
|
+
]
|
|
119
|
+
expect(data.unique('id')).to.be.deep.equal([{id: 1}])
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@test
|
|
123
|
+
uniqueValueBasedOnCallback() {
|
|
124
|
+
const data = [
|
|
125
|
+
{age: 20},
|
|
126
|
+
{age: 20},
|
|
127
|
+
{age: 30},
|
|
128
|
+
]
|
|
129
|
+
expect(data.unique(item => item.age)).to.be.deep.equal([{age: 20}, {age: 30}])
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@test
|
|
133
|
+
sumNumbers() {
|
|
134
|
+
expect([1, 2, 3].sum()).to.be.equal(6)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@test
|
|
138
|
+
sumObjectProperties() {
|
|
139
|
+
expect(this.users.sum('age')).to.be.equal(this.joe.age + this.doe.age)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@test
|
|
143
|
+
sumCallback() {
|
|
144
|
+
expect(this.users.sum(user => user.age)).to.be.equal(this.joe.age + this.doe.age)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@test
|
|
148
|
+
whenNotEmpty() {
|
|
149
|
+
let index = false;
|
|
150
|
+
[1].whenNotEmpty(() => index = true)
|
|
151
|
+
expect(index).to.be.equal(true)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@test
|
|
155
|
+
whenNotEmptyPassesTheArrayInTheCallback() {
|
|
156
|
+
let index = false;
|
|
157
|
+
[1, 2, 3].filter(i => i >= 2).whenNotEmpty(values => index = values.length === 2)
|
|
158
|
+
expect(index).to.be.equal(true)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@test
|
|
162
|
+
whenEmpty() {
|
|
163
|
+
let index = false;
|
|
164
|
+
[].whenEmpty(() => index = true)
|
|
165
|
+
expect(index).to.be.equal(true)
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { expect } from 'chai'
|
|
2
|
+
import { suite, test } from '@testdeck/mocha'
|
|
3
|
+
|
|
4
|
+
@suite
|
|
5
|
+
class StringTest {
|
|
6
|
+
@test
|
|
7
|
+
shouldLimitStringAddingThreeDotsAtTheEnd() {
|
|
8
|
+
expect('text'.limit(3)).to.be.equal('...')
|
|
9
|
+
expect('texts'.limit(4)).to.be.equal('t...')
|
|
10
|
+
expect('text'.limit(5)).to.be.equal('text')
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@test
|
|
14
|
+
shouldLimitStringWithCustomEnding() {
|
|
15
|
+
expect('Testing this text'.limit(12, ' More...')).to.be.equal('Test More...')
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { suite, test } from '@testdeck/mocha'
|
|
2
|
+
import { Email } from '../../Validation'
|
|
3
|
+
import { expect } from 'chai'
|
|
4
|
+
|
|
5
|
+
@suite
|
|
6
|
+
class RulesTest {
|
|
7
|
+
@test
|
|
8
|
+
shouldLimitStringAddingThreeDotsAtTheEnd() {
|
|
9
|
+
const validEmails = [
|
|
10
|
+
'email@example.com',
|
|
11
|
+
'firstname.lastname@example.com',
|
|
12
|
+
'email@subdomain.example.com',
|
|
13
|
+
'firstname+lastname@example.com',
|
|
14
|
+
'email@123.123.123.123',
|
|
15
|
+
'email@[123.123.123.123]',
|
|
16
|
+
'"email"@example.com',
|
|
17
|
+
'1234567890@example.com',
|
|
18
|
+
'email@example-one.com',
|
|
19
|
+
'_______@example.com',
|
|
20
|
+
'email@example.name',
|
|
21
|
+
'email@example.museum',
|
|
22
|
+
'email@example.co.jp',
|
|
23
|
+
'firstname-lastname@example.com',
|
|
24
|
+
]
|
|
25
|
+
const invalidEmails = [
|
|
26
|
+
'plainaddress',
|
|
27
|
+
'#@%^%#$@#$@#.com',
|
|
28
|
+
'@example.com',
|
|
29
|
+
'Joe Smith <email@example.com>',
|
|
30
|
+
'email.example.com',
|
|
31
|
+
'email@example@example.com',
|
|
32
|
+
'.email@example.com',
|
|
33
|
+
'email.@example.com',
|
|
34
|
+
'email..email@example.com',
|
|
35
|
+
'あいうえお@example.com',
|
|
36
|
+
'email@example.com (Joe Smith)',
|
|
37
|
+
'email@example',
|
|
38
|
+
'email@-example.com',
|
|
39
|
+
'email@example..com',
|
|
40
|
+
'Abc..123@example.com',
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
const rule = new (Email())
|
|
44
|
+
|
|
45
|
+
validEmails.forEach(email => {
|
|
46
|
+
expect(rule.passes('', email), email).to.be.equal(true)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
invalidEmails.forEach(email => {
|
|
50
|
+
expect(rule.passes('', email), email).to.be.equal(false)
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"experimentalDecorators": true,
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"strictPropertyInitialization": false,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
// "useDefineForClassFields": true, // TODO some tests fail when using this flag
|
|
14
|
+
"declarationMap": true,
|
|
15
|
+
// "noUnusedLocals": true,
|
|
16
|
+
// "noUnusedParameters": true,
|
|
17
|
+
"outDir": "./build",
|
|
18
|
+
"noImplicitAny": true,
|
|
19
|
+
// "noUncheckedIndexedAccess": true,
|
|
20
|
+
"moduleResolution": "node",
|
|
21
|
+
"lib": [
|
|
22
|
+
"esnext"
|
|
23
|
+
],
|
|
24
|
+
"types": [
|
|
25
|
+
"reflect-metadata",
|
|
26
|
+
"@types/node"
|
|
27
|
+
],
|
|
28
|
+
"baseUrl": ".",
|
|
29
|
+
"paths": {
|
|
30
|
+
"@Typetron/*": [
|
|
31
|
+
"*"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"types.d.ts"
|
|
37
|
+
],
|
|
38
|
+
"include": [
|
|
39
|
+
"Cache",
|
|
40
|
+
"Container",
|
|
41
|
+
"Database",
|
|
42
|
+
"Encryption",
|
|
43
|
+
"Forms",
|
|
44
|
+
"Framework",
|
|
45
|
+
"Models",
|
|
46
|
+
"Mail",
|
|
47
|
+
"Router",
|
|
48
|
+
"Storage",
|
|
49
|
+
"Support",
|
|
50
|
+
"Testing"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
|
package/types.d.ts
ADDED
package/build/Cache/Cache.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare abstract class Cache {
|
|
2
|
-
abstract has(name: string): Promise<boolean>;
|
|
3
|
-
abstract get<T>(name: string, defaultValue?: T | (() => T | Promise<T>)): Promise<T | undefined>;
|
|
4
|
-
abstract remember<T>(name: string, defaultValue?: T | (() => T | Promise<T>), duration?: number): Promise<T | undefined>;
|
|
5
|
-
abstract set(name: string, data: any, duration?: number): Promise<void>;
|
|
6
|
-
abstract delete(name: string): Promise<void>;
|
|
7
|
-
abstract flush(): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=Cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../Cache/Cache.ts"],"names":[],"mappings":"AAAA,8BAAsB,KAAK;IACvB,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAE5C,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAEhG,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAExH,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAEvE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAE5C,QAAQ,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAClC"}
|
package/build/Cache/Cache.js
DELETED
package/build/Cache/Cache.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Cache.js","sourceRoot":"","sources":["../../Cache/Cache.ts"],"names":[],"mappings":";;;AAAA,MAAsB,KAAK;CAY1B;AAZD,sBAYC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Cache } from '@Typetron/Cache';
|
|
2
|
-
export declare class DatabaseStore extends Cache {
|
|
3
|
-
table: string;
|
|
4
|
-
constructor(table: string);
|
|
5
|
-
private get cacheTable();
|
|
6
|
-
private getNameHash;
|
|
7
|
-
has(name: string): Promise<boolean>;
|
|
8
|
-
get<T>(name: string, defaultValue?: T | (() => T | Promise<T>)): Promise<T | undefined>;
|
|
9
|
-
remember<T>(name: string, defaultValue?: T | (() => T | Promise<T>), durationInSeconds?: number): Promise<T | undefined>;
|
|
10
|
-
set(name: string, value: any, durationInSeconds?: number): Promise<void>;
|
|
11
|
-
delete(name: string): Promise<void>;
|
|
12
|
-
flush(): Promise<void>;
|
|
13
|
-
private getDefaultValue;
|
|
14
|
-
private makeSureTheTableExists;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=DatabaseStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseStore.d.ts","sourceRoot":"","sources":["../../../Cache/Stores/DatabaseStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAOvC,qBAAa,aAAc,SAAQ,KAAK;IACjB,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM;IAIhC,OAAO,KAAK,UAAU,GAErB;IAED,OAAO,CAAC,WAAW;IAIb,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKnC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAqBvF,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAYxH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBxE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAId,eAAe;YAQf,sBAAsB;CAwBvC"}
|