diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 9c503c7b..01d9d475 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 6.0.0 + +* Updated to min SDK 2.15.x + +## 5.0.0 + +* No release. Skipped + ## 4.1.2 * Fixed `requireAuthentication` to work correctly with null-safety type diff --git a/packages/auth/lib/src/plugin.dart b/packages/auth/lib/src/plugin.dart index 25831f8d..1ff5a4a5 100644 --- a/packages/auth/lib/src/plugin.dart +++ b/packages/auth/lib/src/plugin.dart @@ -107,13 +107,14 @@ class AngelAuth { throw StateError( 'An `AngelAuth` plug-in was called without its `deserializer` being set. All authentication will fail.'); } - */ + if (app.container == null) { _log.severe('Angel3 container is null'); throw StateError( 'Angel.container is null. All authentication will fail.'); } - var appContainer = app.container!; + */ + var appContainer = app.container; appContainer.registerSingleton(this); if (runtimeType != AngelAuth) { diff --git a/packages/auth/pubspec.yaml b/packages/auth/pubspec.yaml index 90e1a582..6359e2f7 100644 --- a/packages/auth/pubspec.yaml +++ b/packages/auth/pubspec.yaml @@ -1,12 +1,12 @@ name: angel3_auth description: A complete authentication plugin for Angel3. Includes support for stateless JWT tokens, Basic Auth, and more. -version: 4.1.2 +version: 6.0.0 homepage: https://angel3-framework.web.app/ repository: https://github.com/dukefirehawk/angel/tree/master/packages/auth environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.15.0 <3.0.0' dependencies: - angel3_framework: ^4.2.0 + angel3_framework: ^6.0.0 charcode: ^1.2.0 collection: ^1.15.0 crypto: ^3.0.0 @@ -15,8 +15,21 @@ dependencies: quiver: ^3.0.0 logging: ^1.0.0 dev_dependencies: - angel3_container: ^3.1.0 + angel3_container: ^6.0.0 http: ^0.13.1 io: ^1.0.0 test: ^1.17.4 lints: ^1.0.0 +dependency_overrides: + angel3_container: + path: ../container/angel_container + angel3_framework: + path: ../framework + angel3_http_exception: + path: ../http_exception + angel3_model: + path: ../model + angel3_route: + path: ../route + angel3_mock_request: + path: ../mock_request \ No newline at end of file diff --git a/packages/auth/test/callback_test.dart b/packages/auth/test/callback_test.dart index ffdf6a0e..9609fcd1 100644 --- a/packages/auth/test/callback_test.dart +++ b/packages/auth/test/callback_test.dart @@ -50,7 +50,7 @@ void main() { var oldErrorHandler = app.errorHandler; app.errorHandler = (e, req, res) { - app.logger?.severe(e.message, e, e.stackTrace ?? StackTrace.current); + app.logger.severe(e.message, e, e.stackTrace ?? StackTrace.current); return oldErrorHandler(e, req, res); }; diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 95995872..7dba9f1f 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 6.0.0 + +* Updated to min SDK 2.15.x + +## 5.0.0 + +* No release. Skipped + ## 4.2.0 * Updated `package:build_runner` diff --git a/packages/client/lib/angel3_client.dart b/packages/client/lib/angel3_client.dart index 8f166c21..853dc903 100644 --- a/packages/client/lib/angel3_client.dart +++ b/packages/client/lib/angel3_client.dart @@ -33,10 +33,6 @@ abstract class Angel extends http.BaseClient { Angel(baseUrl) : baseUrl = baseUrl is Uri ? baseUrl : Uri.parse(baseUrl.toString()); - /// Prefer to use [baseUrl] instead. - @deprecated - String get basePath => baseUrl.toString(); - /// Fired whenever a WebSocket is successfully authenticated. Stream get onAuthenticated; @@ -48,10 +44,7 @@ abstract class Angel extends http.BaseClient { /// /// The given [credentials] are sent to server as-is; the request body is sent as JSON. Future authenticate( - {required String type, - credentials, - String authEndpoint = '/auth', - @deprecated String reviveEndpoint = '/auth/token'}); + {required String type, credentials, String authEndpoint = '/auth'}); /// Shorthand for authenticating via a JWT string. Future reviveJwt(String token, @@ -87,7 +80,7 @@ abstract class Angel extends http.BaseClient { /// You can pass a custom [deserializer], which is typically necessary in cases where /// `dart:mirrors` does not exist. Service service(String path, - {@deprecated Type? type, AngelDeserializer? deserializer}); + {AngelDeserializer? deserializer}); //@override //Future delete(url, {Map headers}); diff --git a/packages/client/lib/auth_types.dart b/packages/client/lib/auth_types.dart index 5b98fe57..afca9abd 100644 --- a/packages/client/lib/auth_types.dart +++ b/packages/client/lib/auth_types.dart @@ -1,4 +1 @@ -@deprecated -library auth_types; - const String local = 'local', token = 'token'; diff --git a/packages/client/lib/base_angel_client.dart b/packages/client/lib/base_angel_client.dart index 30dbb6b3..8eb5bfd7 100644 --- a/packages/client/lib/base_angel_client.dart +++ b/packages/client/lib/base_angel_client.dart @@ -1,6 +1,4 @@ import 'dart:async'; -import 'dart:convert' show Encoding; -import 'package:angel3_http_exception/angel3_http_exception.dart'; import 'dart:convert'; import 'package:http/src/base_client.dart' as http; import 'package:http/src/base_request.dart' as http; @@ -32,14 +30,14 @@ AngelHttpException failure(http.Response response, if (v is Map && (v['is_error'] == true) || v['isError'] == true) { return AngelHttpException.fromMap(v as Map); } else { - return AngelHttpException(error, + return AngelHttpException( message: message ?? 'Unhandled exception while connecting to Angel backend.', statusCode: response.statusCode, stackTrace: stack); } } catch (e, st) { - return AngelHttpException(error ?? e, + return AngelHttpException( message: message ?? 'Angel backend did not return JSON - an error likely occurred.', statusCode: response.statusCode, @@ -63,10 +61,7 @@ abstract class BaseAngelClient extends Angel { @override Future authenticate( - {String? type, - credentials, - String authEndpoint = '/auth', - @deprecated String reviveEndpoint = '/auth/token'}) async { + {String? type, credentials, String authEndpoint = '/auth'}) async { type ??= 'token'; var segments = baseUrl.pathSegments @@ -258,10 +253,6 @@ class BaseAngelService extends Service { BaseAngelService(this.client, this.app, baseUrl, {this.deserializer}) : baseUrl = baseUrl is Uri ? baseUrl : Uri.parse(baseUrl.toString()); - /// Use [baseUrl] instead. - @deprecated - String get basePath => baseUrl.toString(); - Data? deserialize(x) { return deserializer != null ? deserializer!(x) : x as Data?; } @@ -296,12 +287,12 @@ class BaseAngelService extends Service { var v = json.decode(response.body) as List; //var r = v.map(deserialize).toList(); var r = []; - v.forEach((element) { + for (var element in v) { var a = deserialize(element); if (a != null) { r.add(a); } - }); + } _onIndexed.add(r); return r; } catch (e, st) { diff --git a/packages/client/lib/browser.dart b/packages/client/lib/browser.dart index 1ae5336b..941fbbb7 100644 --- a/packages/client/lib/browser.dart +++ b/packages/client/lib/browser.dart @@ -17,10 +17,7 @@ class Rest extends BaseAngelClient { @override Future authenticate( - {String? type, - credentials, - String authEndpoint = '/auth', - @deprecated String reviveEndpoint = '/auth/token'}) async { + {String? type, credentials, String authEndpoint = '/auth'}) async { if (type == null || type == 'token') { if (!window.localStorage.containsKey('token')) { throw Exception( diff --git a/packages/client/pubspec.yaml b/packages/client/pubspec.yaml index 69748ef2..23bb1a83 100644 --- a/packages/client/pubspec.yaml +++ b/packages/client/pubspec.yaml @@ -1,12 +1,12 @@ name: angel3_client -version: 4.2.0 +version: 6.0.0 description: A browser, mobile and command line based client that supports querying Angel3 servers homepage: https://angel3-framework.web.app/ repository: https://github.com/dukefirehawk/angel/tree/master/packages/client environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.15.0 <3.0.0' dependencies: - angel3_http_exception: ^3.0.0 + angel3_http_exception: ^6.0.0 belatuk_json_serializer: ^5.0.0 collection: ^1.15.0 http: ^0.13.1 @@ -14,13 +14,28 @@ dependencies: path: ^1.8.0 logging: ^1.0.0 dev_dependencies: - angel3_framework: ^4.2.0 - angel3_model: ^3.1.0 - angel3_mock_request: ^2.0.0 - angel3_container: ^3.1.0 - angel3_auth: ^4.1.0 + angel3_framework: ^6.0.0 + angel3_model: ^6.0.0 + angel3_mock_request: ^6.0.0 + angel3_container: ^6.0.0 + angel3_auth: ^6.0.0 async: ^2.6.1 build_runner: ^2.1.2 build_web_compilers: ^3.2.1 test: ^1.17.5 lints: ^1.0.0 +dependency_overrides: + angel3_container: + path: ../container/angel_container + angel3_framework: + path: ../framework + angel3_http_exception: + path: ../http_exception + angel3_model: + path: ../model + angel3_route: + path: ../route + angel3_mock_request: + path: ../mock_request + angel3_auth: + path: ../auth \ No newline at end of file diff --git a/packages/static/pubspec.yaml b/packages/static/pubspec.yaml index 19cfcba5..9a5c8538 100644 --- a/packages/static/pubspec.yaml +++ b/packages/static/pubspec.yaml @@ -1,10 +1,10 @@ name: angel3_static -version: 4.1.0 +version: 6.0.0 description: This library provides a virtual directory to serve static files for Angel3 framework. homepage: https://angel3-framework.web.app/ repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/static environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.15.0 <3.0.0' dependencies: angel3_framework: ^4.1.0 belatuk_range_header: ^4.0.0 diff --git a/packages/test/pubspec.yaml b/packages/test/pubspec.yaml index d4c14424..97dcb9f2 100644 --- a/packages/test/pubspec.yaml +++ b/packages/test/pubspec.yaml @@ -1,10 +1,10 @@ name: angel3_test -version: 4.1.1 +version: 6.0.0 description: Testing utility library for the Angel3 framework. Use with package:test. homepage: https://angel3-framework.web.app/ repository: https://github.com/dukefirehawk/angel/tree/master/packages/test environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.15.0 <3.0.0' dependencies: angel3_client: ^4.1.0 angel3_framework: ^4.2.0 diff --git a/packages/validate/CHANGELOG.md b/packages/validate/CHANGELOG.md index c7c76137..6a71361f 100644 --- a/packages/validate/CHANGELOG.md +++ b/packages/validate/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 6.0.0 + +* Updated to min SDK 2.15.x + +## 5.0.0 + +* No release. Skipped + ## 4.1.0 * Updated linter to `package:lints` diff --git a/packages/validate/lib/src/async.dart b/packages/validate/lib/src/async.dart index b3a12435..043d3e71 100644 --- a/packages/validate/lib/src/async.dart +++ b/packages/validate/lib/src/async.dart @@ -1,6 +1,5 @@ import 'dart:async'; import 'package:angel3_framework/angel3_framework.dart'; -import 'package:angel3_http_exception/angel3_http_exception.dart'; import 'package:matcher/matcher.dart'; import 'context_aware.dart'; diff --git a/packages/validate/lib/src/matchers.dart b/packages/validate/lib/src/matchers.dart index 6870d70b..f69eb19b 100644 --- a/packages/validate/lib/src/matchers.dart +++ b/packages/validate/lib/src/matchers.dart @@ -69,10 +69,6 @@ final Matcher isUrl = predicate( (dynamic value) => value is String && _url.hasMatch(value), 'a valid url, starting with http:// or https://'); -/// Use [isUrl] instead. -@deprecated -final Matcher isurl = isUrl; - /// Enforces a minimum length on a string. Matcher minLength(int length) => predicate( (dynamic value) => value is String && value.length >= length, diff --git a/packages/validate/lib/src/validator.dart b/packages/validate/lib/src/validator.dart index 22532452..37afb723 100644 --- a/packages/validate/lib/src/validator.dart +++ b/packages/validate/lib/src/validator.dart @@ -325,7 +325,9 @@ class Validator extends Matcher { /// Adds all given [rules]. void addRules(String key, Iterable rules) { - rules.forEach((rule) => addRule(key, rule)); + for (var rule in rules) { + addRule(key, rule); + } } /// Removes a [rule]. @@ -337,7 +339,9 @@ class Validator extends Matcher { /// Removes all given [rules]. void removeRules(String key, Iterable rules) { - rules.forEach((rule) => removeRule(key, rule)); + for (var rule in rules) { + removeRule(key, rule); + } } @override @@ -367,11 +371,13 @@ class ValidationResult { /// This is empty if validation was successful. List get errors => List.unmodifiable(_errors); - ValidationResult withData(Map data) => - ValidationResult().._data.addAll(data).._errors.addAll(_errors); + ValidationResult withData(Map data) => ValidationResult() + .._data.addAll(data) + .._errors.addAll(_errors); - ValidationResult withErrors(Iterable errors) => - ValidationResult().._data.addAll(_data).._errors.addAll(errors); + ValidationResult withErrors(Iterable errors) => ValidationResult() + .._data.addAll(_data) + .._errors.addAll(errors); } /// Occurs when user-provided data is invalid. @@ -385,7 +391,8 @@ class ValidationException extends AngelHttpException { final String message; ValidationException(this.message, {Iterable errors = const []}) - : super(FormatException(message), + : super( + message: message, statusCode: 400, errors: (errors).toSet().toList(), stackTrace: StackTrace.current) { diff --git a/packages/validate/pubspec.yaml b/packages/validate/pubspec.yaml index fc250135..3e639f12 100644 --- a/packages/validate/pubspec.yaml +++ b/packages/validate/pubspec.yaml @@ -1,19 +1,31 @@ name: angel3_validate description: Cross-platform request body validation library based on `matcher`. -version: 4.1.0 +version: 6.0.0 homepage: https://angel3-framework.web.app/ repository: https://github.com/dukefirehawk/angel/tree/master/packages/validate environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.15.0 <3.0.0' dependencies: - angel3_framework: ^4.2.0 - angel3_http_exception: ^3.0.0 + angel3_framework: ^6.0.0 + angel3_http_exception: ^6.0.0 matcher: ^0.12.0 dev_dependencies: - #angel3_test: - angel3_mock_request: ^2.0.0 + angel3_mock_request: ^6.0.0 build_runner: ^2.1.0 build_web_compilers: ^3.2.0 logging: ^1.0.1 lints: ^1.0.0 - test: ^1.17.4 \ No newline at end of file + test: ^1.17.4 +dependency_overrides: + angel3_container: + path: ../container/angel_container + angel3_framework: + path: ../framework + angel3_http_exception: + path: ../http_exception + angel3_model: + path: ../model + angel3_route: + path: ../route + angel3_mock_request: + path: ../mock_request \ No newline at end of file