Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make "SafeCqrs" the default CQRS client (#148)
* Add cqrs_wrapper package * Add cqrs dependency * Add CqrsWrapper class * Add CqrsError classes * Add equatable dependency * Update readme * Add CqrsResult classes * Implement CqrsResult sealed classes * Add isInvalid check to CqrsResult * Differentiate command and query results * Implement noThrowGet and noThrowRun * Make cqrs results more generic * Rewrite Cqrs errors * Rewrite CqrsResult * Simplify Cqrs errors to just enums * Add missing error handlers to CqrsWrapper * Add isFailure getter to CqrsCommandResult * Implement missing cases for error handling in CqrsWrapper * Add initial library docs * Move CqrsWrapper to cqrs library * Add initial docs for CqrsWrapper and make logger optional * Add docs for CqrsWrapper.noThrowGet * Add headers argument to noThrowGet and noThrowRun * Add docs for CqrsWrapper * Add initial docs for CqrsResult * Make error argument in CqrsCommandResult.nonValidationError non nullable * Refactor CqrsResult * Refactor CqrsWrapper * Make CqrsWrapper implement Cqrs * Add docs for CqrsResult * Add CqrsCommandResultValidationErrorExtension * Add connectivity_plus to deps * Reimplement Cqrs.get * Specify error differentiation * Remove old files * Add cqrs exports * Add cqrs result classes * Reimplement Cqrs.run * Fix docs for CqrsError * Update docs for Cqrs.run * Add missing docs for Cqrs * Add middleware mechanism to Cqrs * Add default value of headers argument in Cqrs.run * Add tests for Cqrs.get * Remove connectivity_plus from deps * Update main docs * Organize file of CqrsError * Add default middleware method bodies * Add license docs to result classes * Organize imports * Add missing authentication and forbiddenAccess error cases in Cqrs.run * Make ValidationError extend Equatable * Add Cqrs.run tests * Add CQRS operation result * Reimplement Cqrs.perform * Add default implementation of CqrsMiddleware.handleOperationResult * Update Cqrs tests for methods get, run and perform * Revert entry doc change * Add extension with isInvalid getter for CqrsCommandResult<CqrsError> specifically * Fix Cqrs logging strings * Add tests for Cqrs result classes * Revert entry do change v2 * Remove cqrs_exception_test.dart * Add CqrsCommandResult tests * Revert unwanted change in docs * Update Cqrs.addMiddleware docs * Add tests ensuring Cqrs middlewares handled porperly * Add tests for CqrsMiddleware * Fix tests for CqrsMiddleware.handleOperationResult * Implement Equatable correctly * Update CqrsCommandSuccess field tests * Remove CqrsException * Remove CqrsException from exports * Make error not generic in Cqrs result classes * Fix props override in CqrsCommandSuccess * Rename CqrsQueryResult to QResult * Rename CqrsCommandResult to CResult * Rename CqrsOperationResult to OResult * Update main docs * Add missing tests for CSuccess * Simplify result classes getters * Update result classes tests * Update CqrsError docs * Fix typo in docs * Exhaust case with Operation() * Exhaust all the rest _ResultType in case explicitly * Return early from _log * Rename CommandResult to CommandResponse * Reimplement cqrs result classes * Make base result classes private * Refactor result classes * Simplify CqrsMiddleware.handleResult * Remove CqrsError * Refactor Cqrs._log * Add ValidationError.props test * Update test for ValidationError.props * Fix docs for result classes * Revert making result classes a typedef of one base result class * Move ValidationError to separate file and make CommandResponse package private * Rename command_result.dart to command_response.dart * Rename OResult to OperationResult * Rename CResult to CommandResult * Rename QResult to QueryResult * Fix tests of CommandResponse * Add null check on logger in Cqrs._log method * Split CqrsError into Query Command and Operation Error * Make CqrsMethod a sealed class * Fix docs typos from code review Co-authored-by: Marcin Wojnarowski <xmarcinmarcin@gmail.com> * Update CHANGELOG.md * Remove blank space in CHANGELOG.md * Update README.md * Update versions of dependencies in CHANGELOG.md Co-authored-by: Marcin Wojnarowski <xmarcinmarcin@gmail.com> --------- Co-authored-by: Marcin Wojnarowski <xmarcinmarcin@gmail.com>
- Loading branch information