Merge pull request #77 from dukefirehawk/feature/v7

Feature/v7
This commit is contained in:
Thomas Hii 2022-08-27 18:16:04 +08:00 committed by GitHub
commit 6416811dea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
171 changed files with 2244 additions and 1924 deletions

View file

@ -21,7 +21,7 @@ jobs:
- uses: dart-lang/setup-dart@v1
with:
sdk: "2.16.2"
sdk: "2.17.0"
- id: angel3_container_upgrade
name: angel3_container; Upgrade depedencies
@ -87,7 +87,7 @@ jobs:
- uses: dart-lang/setup-dart@v1
with:
sdk: "2.16.2"
sdk: "2.17.0"
# Angel3 ORM
- id: angel3_orm_upgrade

View file

@ -1,5 +1,18 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Require Dart >= 2.16
* Added ORM MySQL
## 5.0.0
* Skipped version
## 4.1.x
* Refactored the framework internal to use [Belatuk Common Utilities](<https://github.com/dart-backend/belatuk-common-utilities>)

View file

@ -143,3 +143,7 @@ You can also view the [Angel3 API](http://www.dartdocs.org/documentation/angel_f
## Contributing
Interested in contributing to Angel3? See the contribution guide [here](CONTRIBUTING.md).
## Donation & Support
If you like this project and want to support its development, you can make a [donation](https://paypal.me/dukefirehawk?country.x=MY&locale.x=en_US) via paypal service.

View file

@ -1,5 +1,9 @@
# 2.0.0
* Migrated to support Dart SDK 2.12.x NNBD
# Change Log
# 1.0.0
* Created package + tests
## 2.0.0
* Migrated to support Dart >= 2.12 NNBD
## 1.0.0
* Created package + tests

View file

@ -1,5 +1,9 @@
# 2.0.0
* Migrated to support Dart SDK 2.12.x NNBD
# Change Log
# 1.0.0
* Initial checkin
## 2.0.0
* Migrated to support Dart >= 2.12 NNBD
## 1.0.0
* Initial checkin

View file

@ -1,6 +1,10 @@
# 2.0.0
* Migrated to support Dart SDK 2.12.x NNBD
# Change Log
## 2.0.0
* Migrated to support Dart >= 2.12 NNBD
## 1.1.0
# 1.1.0
* Moved to `package:rethinkdb_driver`
* Fixed references to old hooked event names.
* Fixed references to old hooked event names

View file

@ -1,5 +1,9 @@
# 2.0.0
* Migrated to support Dart SDK 2.12.x NNBD
# Change Log
# 1.0.0
* Initial checkin
## 2.0.0
* Migrated to support Dart >= 2.12 NNBD
## 1.0.0
* Initial checkin

View file

@ -1,11 +1,16 @@
# 2.0.0
* Migrated to support Dart SDK 2.12.x NNBD
# Change Log
## 2.0.0
* Migrated to support Dart >= 2.12 NNBD
## 1.0.1
# 1.0.1
* Explicitly extend `Service<Id, T>`.
* Override `readData`.
* Use `Service<Id, Map<String, dynamic>>` for `inner`, instead of just
`Service<Id, Map>`.
# 1.0.0
* Initial version.
## 1.0.0
* Initial version.

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -47,11 +51,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.1.5+1

View file

@ -17,6 +17,7 @@ void main() async {
// If authentication succeeds, return a User object.
//
// Otherwise, return `null`.
return null;
});
app.post('/auth/local', auth.authenticate('local'));

View file

@ -86,7 +86,7 @@ class AuthToken {
// var headerString = decodeBase64(split[0]);
var payloadString = decodeBase64(split[1]);
var data = split[0] + '.' + split[1];
var data = '${split[0]}.${split[1]}';
var signature = base64Url.encode(hmac.convert(data.codeUnits).bytes);
if (signature != split[2]) {
@ -102,9 +102,9 @@ class AuthToken {
String serialize(Hmac hmac) {
var headerString = base64Url.encode(json.encode(_header).codeUnits);
var payloadString = base64Url.encode(json.encode(toJson()).codeUnits);
var data = headerString + '.' + payloadString;
var data = '$headerString.$payloadString';
var signature = hmac.convert(data.codeUnits).bytes;
return data + '.' + base64Url.encode(signature);
return '$data.${base64Url.encode(signature)}';
}
Map<String, dynamic> toJson() {

View file

@ -39,7 +39,7 @@ class LocalAuthStrategy<User> extends AuthStrategy<User> {
@override
Future<User?> authenticate(RequestContext req, ResponseContext res,
[AngelAuthOptions? options]) async {
var _options = options ?? AngelAuthOptions();
var localOptions = options ?? AngelAuthOptions();
User? verificationResult;
if (allowBasic) {
@ -88,9 +88,9 @@ class LocalAuthStrategy<User> extends AuthStrategy<User> {
if (verificationResult == null ||
(verificationResult is Map && verificationResult.isEmpty)) {
if (_options.failureRedirect != null &&
_options.failureRedirect!.isNotEmpty) {
await res.redirect(_options.failureRedirect, code: 401);
if (localOptions.failureRedirect != null &&
localOptions.failureRedirect!.isNotEmpty) {
await res.redirect(localOptions.failureRedirect, code: 401);
return null;
}

View file

@ -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: 6.0.0
version: 7.0.0
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/auth
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
angel3_framework: ^7.0.0
charcode: ^1.2.0
collection: ^1.15.0
crypto: ^3.0.0
@ -15,21 +15,21 @@ dependencies:
quiver: ^3.0.0
logging: ^1.0.0
dev_dependencies:
angel3_container: ^6.0.0
angel3_container: ^7.0.0
http: ^0.13.1
io: ^1.0.0
test: ^1.21.0
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
lints: ^2.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

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -22,11 +26,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12.x Non NNBD
## 2.1.0

View file

@ -1,15 +1,30 @@
name: angel3_auth_oauth2
version: 6.0.0
version: 7.0.0
description: Angel3 library for authenticating users with external identity providers via OAuth2.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/auth_oauth2
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_auth: ^6.0.0
angel3_framework: ^6.0.0
angel3_auth: ^7.0.0
angel3_framework: ^7.0.0
http_parser: ^4.0.0
oauth2: ^2.0.0
dev_dependencies:
logging: ^1.0.1
lints: ^1.0.0
lints: ^2.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

View file

@ -1,8 +1,12 @@
# Change Log
## 6.0.0-beta.1
## 7.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.17
## 6.0.0
* Require Dart >= 2.16
## 5.0.0
@ -10,11 +14,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.0

View file

@ -1,14 +1,14 @@
name: "angel3_auth_twitter"
description: Angel3 authentication strategy for Twitter login. Auto-signs requests.
version: 3.0.0
version: 7.0.0
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/auth_twitter
publish_to: none
environment:
sdk: ">=2.16.0 <3.0.0"
sdk: ">=2.17.0 <3.0.0"
dependencies:
angel3_auth: ^6.0.0
angel3_framework: ^6.0.0
angel3_auth: ^7.0.0
angel3_framework: ^7.0.0
http: ^0.13.0
path: ^1.0.0
oauth1: ^2.0.0
@ -16,3 +16,18 @@ dependencies:
dev_dependencies:
logging: ^1.0.0
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

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -26,11 +30,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.1

View file

@ -120,7 +120,7 @@ class CacheService<Id, Data> extends Service<Id, Data> {
}
class _CachedItem<Data> {
final params;
final dynamic params;
final DateTime timestamp;
final Data? data;

View file

@ -1,19 +1,42 @@
name: angel3_cache
version: 6.0.0
version: 7.0.0
description: A service that provides HTTP caching to the response data for Angel3
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/cache
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
angel3_framework: ^7.0.0
collection: ^1.15.0
meta: ^1.4.0
pool: ^1.5.0
logging: ^1.0.0
dev_dependencies:
angel3_test: ^6.0.0
angel3_test: ^7.0.0
glob: ^2.0.1
http: ^0.13.3
test: ^1.21.0
lints: ^1.0.0
lints: ^2.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_test:
path: ../test
angel3_websocket:
path: ../websocket
angel3_client:
path: ../client
angel3_auth:
path: ../auth
angel3_validate:
path: ../validate

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -32,11 +36,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.2

View file

@ -1,10 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'package:http/src/base_client.dart' as http;
import 'package:http/src/base_request.dart' as http;
import 'package:http/src/request.dart' as http;
import 'package:http/src/response.dart' as http;
import 'package:http/src/streamed_response.dart' as http;
import 'package:http/http.dart';
import 'package:path/path.dart';
import 'package:logging/logging.dart';
import 'angel3_client.dart';
@ -19,10 +15,10 @@ Map<String, String> _buildQuery(Map<String, dynamic>? params) {
return params?.map((k, v) => MapEntry(k, v.toString())) ?? {};
}
bool _invalid(http.Response response) =>
bool _invalid(Response response) =>
response.statusCode < 200 || response.statusCode >= 300;
AngelHttpException failure(http.Response response,
AngelHttpException failure(Response response,
{error, String? message, StackTrace? stack}) {
try {
var v = json.decode(response.body);
@ -50,7 +46,7 @@ abstract class BaseAngelClient extends Angel {
final StreamController<AngelAuthResult> _onAuthenticated =
StreamController<AngelAuthResult>();
final List<Service> _services = [];
final http.BaseClient client;
final BaseClient client;
final Context _p = Context(style: Style.url);
@ -71,7 +67,7 @@ abstract class BaseAngelClient extends Angel {
//var p1 = p.joinAll(segments).replaceAll('\\', '/');
var url = baseUrl.replace(path: _p.joinAll(segments));
http.Response response;
Response response;
if (credentials != null) {
response = await post(url,
@ -121,7 +117,7 @@ abstract class BaseAngelClient extends Angel {
}
@override
Future<http.StreamedResponse> send(http.BaseRequest request) async {
Future<StreamedResponse> send(BaseRequest request) async {
if (authToken?.isNotEmpty == true) {
request.headers['authorization'] ??= 'Bearer $authToken';
}
@ -129,11 +125,10 @@ abstract class BaseAngelClient extends Angel {
}
/// Sends a non-streaming [Request] and returns a non-streaming [Response].
Future<http.Response> sendUnstreamed(
Future<Response> sendUnstreamed(
String method, url, Map<String, String>? headers,
[body, Encoding? encoding]) async {
var request =
http.Request(method, url is Uri ? url : Uri.parse(url.toString()));
var request = Request(method, url is Uri ? url : Uri.parse(url.toString()));
if (headers != null) request.headers.addAll(headers);
@ -153,7 +148,7 @@ abstract class BaseAngelClient extends Angel {
}
}
return http.Response.fromStream(await send(request));
return Response.fromStream(await send(request));
}
@override
@ -173,34 +168,34 @@ abstract class BaseAngelClient extends Angel {
}
//@override
//Future<http.Response> delete(url, {Map<String, String> headers}) async {
//Future<Response> delete(url, {Map<String, String> headers}) async {
// return sendUnstreamed('DELETE', _join(url), headers);
//}
@override
Future<http.Response> get(url, {Map<String, String>? headers}) async {
Future<Response> get(url, {Map<String, String>? headers}) async {
return sendUnstreamed('GET', _join(url), headers);
}
@override
Future<http.Response> head(url, {Map<String, String>? headers}) async {
Future<Response> head(url, {Map<String, String>? headers}) async {
return sendUnstreamed('HEAD', _join(url), headers);
}
@override
Future<http.Response> patch(url,
Future<Response> patch(url,
{body, Map<String, String>? headers, Encoding? encoding}) async {
return sendUnstreamed('PATCH', _join(url), headers, body, encoding);
}
@override
Future<http.Response> post(url,
Future<Response> post(url,
{body, Map<String, String>? headers, Encoding? encoding}) async {
return sendUnstreamed('POST', _join(url), headers, body, encoding);
}
@override
Future<http.Response> put(url,
Future<Response> put(url,
{body, Map<String, String>? headers, Encoding? encoding}) async {
return sendUnstreamed('PUT', _join(url), headers, body, encoding);
}
@ -210,7 +205,7 @@ class BaseAngelService<Id, Data> extends Service<Id, Data?> {
@override
final BaseAngelClient app;
final Uri baseUrl;
final http.BaseClient client;
final BaseClient client;
final AngelDeserializer<Data>? deserializer;
final Context _p = Context(style: Style.url);
@ -262,7 +257,7 @@ class BaseAngelService<Id, Data> extends Service<Id, Data?> {
return jsonEncode(x);
}
Future<http.StreamedResponse> send(http.BaseRequest request) {
Future<StreamedResponse> send(BaseRequest request) {
if (app.authToken != null && app.authToken!.isNotEmpty) {
request.headers['Authorization'] = 'Bearer ${app.authToken}';
}

View file

@ -1,41 +1,41 @@
name: angel3_client
version: 6.0.0
version: 7.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.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_http_exception: ^6.0.0
belatuk_json_serializer: ^5.0.0
angel3_http_exception: ^7.0.0
belatuk_json_serializer: ^6.0.0
collection: ^1.15.0
http: ^0.13.1
meta: ^1.3.0
path: ^1.8.0
logging: ^1.0.0
dev_dependencies:
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
angel3_framework: ^7.0.0
angel3_model: ^7.0.0
angel3_mock_request: ^7.0.0
angel3_container: ^7.0.0
angel3_auth: ^7.0.0
async: ^2.6.1
build_runner: ^2.1.2
build_web_compilers: ^3.2.1
test: ^1.21.0
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
lints: ^2.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

View file

@ -5,7 +5,7 @@ import 'package:angel3_framework/http.dart';
import 'package:logging/logging.dart';
import 'package:test/test.dart';
const Map<String, String> USER = {'username': 'foo', 'password': 'bar'};
const Map<String, String> user = {'username': 'foo', 'password': 'bar'};
var localOpts = AngelAuthOptions<Map<String, String>>(canRespondWithJson: true);
void main() {
@ -17,12 +17,12 @@ void main() {
app = Angel();
http = AngelHttp(app, useZone: false);
var auth = AngelAuth(
serializer: (_) async => 'baz', deserializer: (_) async => USER);
serializer: (_) async => 'baz', deserializer: (_) async => user);
auth.strategies['local'] = LocalAuthStrategy(
(username, password) async {
if (username == 'foo' && password == 'bar') {
return USER;
return user;
}
return {};
@ -50,10 +50,10 @@ void main() {
});
test('auth event fires', () async {
var localAuth = await client.authenticate(type: 'local', credentials: USER);
var localAuth = await client.authenticate(type: 'local', credentials: user);
print('JWT: ${localAuth.token}');
print('Data: ${localAuth.data}');
expect(localAuth.data, USER);
expect(localAuth.data, user);
});
}

View file

@ -15,7 +15,7 @@ class Postcard extends Model {
@override
bool operator ==(other) {
if (!(other is Postcard)) return false;
if (other is! Postcard) return false;
return id == other.id &&
location == other.location &&

View file

@ -1,8 +1,13 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
* Updated `dotenv` to 4.0.x
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -21,11 +26,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.2.0

View file

@ -3,13 +3,13 @@ library angel3_configuration;
import 'dart:async';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:dotenv/dotenv.dart' as dotenv;
import 'package:dotenv/dotenv.dart';
import 'package:file/file.dart';
import 'package:belatuk_merge_map/belatuk_merge_map.dart';
import 'package:yaml/yaml.dart';
Future<void> _loadYamlFile(Map map, File yamlFile, Map<String, String> env,
void Function(String msg) warn) async {
Future<void> _loadYamlFile(
Map map, File yamlFile, DotEnv env, void Function(String msg) warn) async {
if (await yamlFile.exists()) {
var config = loadYaml(await yamlFile.readAsString());
@ -58,12 +58,11 @@ Future<void> _loadYamlFile(Map map, File yamlFile, Map<String, String> env,
}
}
Object? _applyEnv(
var v, Map<String, String> env, void Function(String msg) warn) {
Object? _applyEnv(var v, DotEnv env, void Function(String msg) warn) {
if (v is String) {
if (v.startsWith(r'$') && v.length > 1) {
var key = v.substring(1);
if (env.containsKey(key)) {
if (env.isDefined(key)) {
return env[key];
} else {
warn(
@ -92,11 +91,11 @@ Future<Map> loadStandaloneConfiguration(FileSystem fileSystem,
String? envPath,
void Function(String message)? onWarning}) async {
var sourceDirectory = fileSystem.directory(directoryPath);
var env = dotenv.env;
var env = DotEnv(includePlatformEnvironment: true);
var envFile = sourceDirectory.childFile(envPath ?? '.env');
if (await envFile.exists()) {
dotenv.load(envFile.absolute.uri.toFilePath());
env.load([envFile.absolute.uri.toFilePath()]);
}
var environmentName = env['ANGEL_ENV'] ?? 'development';

View file

@ -1,32 +1,32 @@
name: angel3_configuration
version: 6.0.0
version: 7.0.0
description: Automatic YAML application configuration loader for Angel 3, with .env support.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/configuration
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
belatuk_merge_map: ^3.0.0
dotenv: ^3.0.0
angel3_framework: ^7.0.0
belatuk_merge_map: ^4.0.0
dotenv: ^4.0.0
file: ^6.1.0
yaml: ^3.1.0
dev_dependencies:
io: ^1.0.0
logging: ^1.0.1
lints: ^1.0.0
belatuk_pretty_logging: ^4.0.0
lints: ^2.0.0
belatuk_pretty_logging: ^5.0.0
test: ^1.21.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
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

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
* Removed `error`
## 5.0.0
@ -32,11 +36,11 @@
## 3.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 2.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 1.1.0

View file

@ -1,13 +1,13 @@
name: angel3_container
version: 6.0.0
version: 7.0.0
description: Angel3 hierarchical DI container, and pluggable backends for reflection.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/container/angel_container
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
collection: ^1.15.0
quiver: ^3.0.1
dev_dependencies:
test: ^1.21.0
lints: ^1.0.0
lints: ^2.0.0

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -23,13 +27,13 @@
## 3.0.0-beta.1
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
* Updated linter to `package:lints`
* Updated to use `angel3_` packages
## 2.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 1.0.1

View file

@ -1,18 +1,18 @@
name: angel3_container_generator
version: 6.0.0
version: 7.0.0
description: Codegen support for using pkg:reflectable with pkg:angel3_container.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/container/angel_container_generator
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_container: ^6.0.0
angel3_container: ^7.0.0
reflectable: ^3.0.4
dev_dependencies:
build_runner: ^2.1.2
build_test: ^2.1.3
test: ^1.21.0
lints: ^1.0.1
# dependency_overrides:
# angel3_container:
# path: ../angel_container
dependency_overrides:
angel3_container:
path: ../angel_container

View file

@ -1,12 +1,16 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.1
* Fixed analyze error
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -23,11 +27,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.0

View file

@ -1,37 +1,37 @@
name: angel3_cors
version: 6.0.1
version: 7.0.0
description: Angel3 CORS middleware. Ported from expressjs/cors to Angel3 framework.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/cors
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
angel3_framework: ^7.0.0
dev_dependencies:
angel3_test: ^6.0.0
angel3_test: ^7.0.0
http: ^0.13.3
lints: ^1.0.0
lints: ^2.0.0
test: ^1.21.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
# angel3_client:
# path: ../client
# angel3_websocket:
# path: ../websocket
# angel3_validate:
# path: ../validate
# angel3_test:
# path: ../test
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
angel3_client:
path: ../client
angel3_websocket:
path: ../websocket
angel3_validate:
path: ../validate
angel3_test:
path: ../test

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -23,11 +27,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.1

View file

@ -1,27 +1,27 @@
name: angel3_file_service
version: 6.0.0
version: 7.0.0
description: Angel service that persists data to a file on disk, stored as a JSON list.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/file_service
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
angel3_framework: ^7.0.0
file: ^6.1.1
pool: ^1.5.0
dev_dependencies:
test: ^1.21.0
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
lints: ^2.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

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
* Updated `container` to non nullable
* Updated `angel` to non nullable
* Updated `logger` to non nullable
@ -73,11 +77,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.1.1

View file

@ -345,7 +345,7 @@ class HookedService<Id, Data, T extends Service<Id, Data>>
.then((after) => after.result as Data);
}
return inner.create(before.data!, localParams).then((result) {
return inner.create(before.data as Data, localParams).then((result) {
return afterCreated
._emit(HookedServiceEvent(true, _getRequest(params),
_getResponse(params), inner, HookedServiceEvent.created,
@ -374,7 +374,7 @@ class HookedService<Id, Data, T extends Service<Id, Data>>
.then((after) => after.result as Data);
}
return inner.modify(id, before.data!, localParams).then((result) {
return inner.modify(id, before.data as Data, localParams).then((result) {
return afterModified
._emit(HookedServiceEvent(true, _getRequest(params),
_getResponse(params), inner, HookedServiceEvent.created,
@ -403,7 +403,7 @@ class HookedService<Id, Data, T extends Service<Id, Data>>
.then((after) => after.result as Data);
}
return inner.update(id, before.data!, localParams).then((result) {
return inner.update(id, before.data as Data, localParams).then((result) {
return afterUpdated
._emit(HookedServiceEvent(true, _getRequest(params),
_getResponse(params), inner, HookedServiceEvent.updated,
@ -546,6 +546,7 @@ class HookedServiceEvent<Id, Data, T extends Service<Id, Data>> {
HookedServiceEvent(this._isAfter, this._request, this._response, this.service,
this._eventName,
{Id? id, this.data, Map<String, dynamic>? params, this.result}) {
//_data = data;
_id = id;
_params = params ?? {};
}

View file

@ -12,7 +12,7 @@ class HostnameSyntaxParser {
FormatException _formatExc(String message) {
var span = _scanner.lastSpan ?? _scanner.emptySpan;
return FormatException(
'${span.start.toolString}: $message\n' + span.highlight(color: true));
'${span.start.toolString}: $message\n${span.highlight(color: true)}');
}
RegExp parse() {
@ -38,7 +38,7 @@ class HostnameSyntaxParser {
if (_scanner.scan('.')) {
var subPart = _parseHostnamePart(shouldThrow: false);
while (subPart.isNotEmpty) {
part += '\\.' + subPart;
part += '\\.$subPart';
if (_scanner.scan('.')) {
subPart = _parseHostnamePart(shouldThrow: false);
} else {

View file

@ -169,10 +169,9 @@ InjectionRequest preInject(Function handler, Reflector reflector) {
var name = parameter.name;
var type = parameter.type.reflectedType;
var _parameter = reflector.reflectType(Parameter);
var p = parameter.annotations
.firstWhereOrNull((m) => m.type.isAssignableTo(_parameter))
.firstWhereOrNull(
(m) => m.type.isAssignableTo(reflector.reflectType(Parameter)))
?.reflectee as Parameter?;
//print(p);
if (p != null) {

View file

@ -388,7 +388,7 @@ class Angel extends Routable {
}
static const String _reflectionErrorMessage =
ThrowingReflector.defaultErrorMessage + ' ' + _reflectionInfo;
'${ThrowingReflector.defaultErrorMessage} $_reflectionInfo';
static const String _reflectionInfo =
'Features like controllers, constructor dependency injection, and `ioc` require reflection, '
@ -412,8 +412,7 @@ class Angel extends Routable {
if (reflector is EmptyReflector || reflector is ThrowingReflector) {
var msg =
'No `reflector` was passed to the Angel constructor, so reflection will not be available.\n' +
_reflectionInfo;
'No `reflector` was passed to the Angel constructor, so reflection will not be available.\n$_reflectionInfo';
this.logger.warning(msg);
}

View file

@ -1,19 +1,19 @@
name: angel3_framework
version: 6.0.0
version: 7.0.0
description: A high-powered HTTP server extensible framework with dependency injection, routing and much more.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/framework
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_container: ^6.0.0
angel3_http_exception: ^6.0.0
angel3_model: ^6.0.0
angel3_route: ^6.0.0
angel3_mock_request: ^6.0.0
belatuk_merge_map: ^3.0.0
belatuk_combinator: ^3.0.0
belatuk_http_server: ^2.1.0
angel3_container: ^7.0.0
angel3_http_exception: ^7.0.0
angel3_model: ^7.0.0
angel3_route: ^7.0.0
angel3_mock_request: ^7.0.0
belatuk_merge_map: ^4.0.0
belatuk_combinator: ^4.0.0
belatuk_http_server: ^3.0.0
charcode: ^1.2.0
file: ^6.1.0
http_parser: ^4.0.0
@ -34,15 +34,16 @@ dev_dependencies:
http: ^0.13.1
io: ^1.0.0
test: ^1.21.0
lints: ^1.0.0
# dependency_overrides:
# angel3_container:
# path: ../container/angel_container
# angel3_http_exception:
# path: ../http_exception
# angel3_model:
# path: ../model
# angel3_route:
# path: ../route
# angel3_mock_request:
# path: ../mock_request
lints: ^2.0.0
dependency_overrides:
angel3_container:
path: ../container/angel_container
angel3_http_exception:
path: ../http_exception
angel3_model:
path: ../model
angel3_route:
path: ../route
angel3_mock_request:
path: ../mock_request

View file

@ -6,7 +6,7 @@ import 'package:angel3_framework/http.dart';
import 'package:angel3_mock_request/angel3_mock_request.dart';
import 'package:test/test.dart';
final Uri ENDPOINT = Uri.parse('http://example.com/accept');
final Uri endpoint = Uri.parse('http://example.com/accept');
void main() {
test('no content type', () async {
@ -61,7 +61,7 @@ Future<RequestContext> acceptContentTypes(
[Iterable<String> contentTypes = const []]) {
var headerString =
contentTypes.isEmpty ? ContentType.text : contentTypes.join(',');
var rq = MockHttpRequest('GET', ENDPOINT, persistentConnection: false);
var rq = MockHttpRequest('GET', endpoint, persistentConnection: false);
rq.headers.set('accept', headerString);
rq.close();
var app = Angel(reflector: MirrorsReflector());

View file

@ -1,6 +1,6 @@
import 'dart:io';
import 'package:io/ansi.dart';
import '404_hole_test.dart' as hole404;
import 'http_404_hole_test.dart' as hole404;
import 'accepts_test.dart' as accepts;
import 'anonymous_service_test.dart' as anonymous_service;
import 'body_test.dart' as body;
@ -32,7 +32,7 @@ import 'package:test/test.dart';
/// For running with coverage
void main() {
print(cyan.wrap('Running tests on ${Platform.version}'));
group('404_hole', hole404.main);
group('http_404_hole', hole404.main);
group('accepts', accepts.main);
group('anonymous service', anonymous_service.main);
group('body', body.main);

View file

@ -29,12 +29,12 @@ class BookService extends Service {
}
void incrementTodoTimes(e) {
IncrementService.TIMES++;
IncrementService.times++;
}
@Hooks(before: [incrementTodoTimes])
class IncrementService extends Service {
static int TIMES = 0;
static int times = 0;
@override
@Hooks(after: [incrementTodoTimes])

View file

@ -11,8 +11,8 @@ import 'package:test/test.dart';
import 'common.dart';
final String TEXT = 'make your bed';
final String OVER = 'never';
final String sampleText = 'make your bed';
final String sampleOver = 'never';
void main() {
late Angel app;
@ -25,7 +25,7 @@ void main() {
client = http.Client();
// Inject some todos
app.container.registerSingleton(Todo(text: TEXT, over: OVER));
app.container.registerSingleton(Todo(text: sampleText, over: sampleOver));
app.container.registerFactory<Future<Foo>>((container) async {
var req = container.make<RequestContext>();
var text = await utf8.decoder.bind(req.body!).join();
@ -79,13 +79,13 @@ void main() {
test('make in route', () async {
var response = await client.get(Uri.parse('$url/errands3'));
var text = await json.decode(response.body) as String?;
expect(text, equals(TEXT));
expect(text, equals(sampleText));
});
test('make in controller', () async {
var response = await client.get(Uri.parse('$url/errands4'));
var text = await json.decode(response.body) as String?;
expect(text, equals(TEXT));
expect(text, equals(sampleText));
});
test('resolve from future in controller', () async {
@ -103,8 +103,8 @@ void main() {
void validateTodoSingleton(response) {
var todo = json.decode(response.body.toString()) as Map;
expect(todo['id'], equals(null));
expect(todo['text'], equals(TEXT));
expect(todo['over'], equals(OVER));
expect(todo['text'], equals(sampleText));
expect(todo['over'], equals(sampleOver));
}
@Expose('/errands2')

View file

@ -5,7 +5,7 @@ import 'package:angel3_framework/http.dart';
import 'package:angel3_mock_request/angel3_mock_request.dart';
import 'package:test/test.dart';
final Uri ENDPOINT = Uri.parse('http://example.com');
final Uri endpoint = Uri.parse('http://example.com');
void main() {
test('single extension', () async {
@ -25,7 +25,7 @@ void main() {
}
Future<RequestContext> makeRequest(String path) {
var rq = MockHttpRequest('GET', ENDPOINT.replace(path: path))..close();
var rq = MockHttpRequest('GET', endpoint.replace(path: path))..close();
var app = Angel(reflector: MirrorsReflector());
var http = AngelHttp(app);
return http.createRequestContext(rq, rq.response);

View file

@ -105,9 +105,9 @@ void main() {
test('metadata', () async {
final service = HookedService(IncrementService())..addHooks(app);
expect(service.inner, isNot(const IsInstanceOf<MapService>()));
IncrementService.TIMES = 0;
IncrementService.times = 0;
await service.index();
expect(IncrementService.TIMES, equals(2));
expect(IncrementService.times, equals(2));
});
test('inject request + response', () async {

View file

@ -24,7 +24,7 @@ class Http2Client extends BaseClient {
Header.ascii(
':path',
request.url.path +
(request.url.hasQuery ? ('?' + request.url.query) : '')),
(request.url.hasQuery ? ('?${request.url.query}') : '')),
Header.ascii(':scheme', request.url.scheme),
];

View file

@ -16,7 +16,7 @@ void main() {
client = http.IOClient();
hierarchicalLoggingEnabled = true;
logger = Logger.detached('404_hole')
logger = Logger.detached('http_404_hole')
..level = Level.ALL
..onRecord.listen(prettyLog);

View file

@ -9,7 +9,7 @@ void prettyLog(LogRecord record) {
if (record.error != null) {
var err = record.error;
print(code.wrap(record.toString() + '\n'));
print(code.wrap('$record\n'));
print(code.wrap(err.toString()));
if (record.stackTrace != null) {

View file

@ -127,7 +127,7 @@ void main() {
group('getHandlerResult', () {
test('return request handler', () async {
var handler = (req, res) => (req, res) async {
handler(req, res) => (req, res) async {
return 2;
};
var r = await app.getHandlerResult(handler, req, res);
@ -142,12 +142,12 @@ void main() {
group('executeHandler', () {
test('return Stream', () async {
var handler = (req, res) => Stream.fromIterable([2, 3]);
handler(req, res) => Stream.fromIterable([2, 3]);
expect(await app.executeHandler(handler, req, res), isFalse);
});
test('end response', () async {
var handler = (req, ResponseContext res) => res.close();
handler(req, ResponseContext res) => res.close();
expect(await app.executeHandler(handler, req, res), isFalse);
});
});

View file

@ -1,5 +1,6 @@
import 'package:angel3_framework/angel3_framework.dart';
import 'package:test/test.dart';
import 'package:quiver/core.dart';
void main() {
MapService inner;
@ -77,4 +78,7 @@ class Todo {
@override
String toString() => '$id:$text($complete)';
@override
int get hashCode => hash2(text.hashCode, complete.hashCode);
}

View file

@ -1,8 +1,13 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
* Updated `vm_service` to 9.3.0
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -36,11 +41,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.6

View file

@ -1,41 +1,41 @@
name: angel3_hot
version: 6.0.0
version: 7.0.0
description: Supports hot reloading/hot code push of Angel3 servers on file changes.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/hot
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
angel3_websocket: ^6.0.0
belatuk_html_builder: ^3.0.0
angel3_framework: ^7.0.0
angel3_websocket: ^7.0.0
belatuk_html_builder: ^4.0.0
charcode: ^1.2.0
glob: ^2.0.1
io: ^1.0.0
path: ^1.8.0
vm_service: ^8.1.0
vm_service: ^9.3.0
watcher: ^1.0.0
dev_dependencies:
http: ^0.13.2
logging: ^1.0.1
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
# angel3_client:
# path: ../client
# angel3_websocket:
# path: ../websocket
lints: ^2.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
angel3_client:
path: ../client
angel3_websocket:
path: ../websocket

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -14,7 +18,7 @@
## 3.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 2.0.0

View file

@ -1,39 +1,39 @@
name: angel3_html
version: 6.0.0
version: 7.0.0
description: Support for rendering html_builder AST's as responses in Angel.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/html_builder
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
belatuk_html_builder: ^3.0.0
angel3_framework: ^7.0.0
belatuk_html_builder: ^4.0.0
dev_dependencies:
angel3_test: ^6.0.0
angel3_test: ^7.0.0
html: ^0.15.0
logging: ^1.0.1
test: ^1.21.0
lints: ^1.0.0
# dependency_overrides:
# angel3_container:
# path: ../container/angel_container
# angel3_framework:
# path: ../framework
# angel3_test:
# path: ../test
# angel3_websocket:
# path: ../websocket
# angel3_http_exception:
# path: ../http_exception
# angel3_client:
# path: ../client
# angel3_auth:
# path: ../auth
# angel3_validate:
# path: ../validate
# angel3_mock_request:
# path: ../mock_request
# angel3_model:
# path: ../model
# angel3_route:
# path: ../route
lints: ^2.0.0
dependency_overrides:
angel3_container:
path: ../container/angel_container
angel3_framework:
path: ../framework
angel3_test:
path: ../test
angel3_websocket:
path: ../websocket
angel3_http_exception:
path: ../http_exception
angel3_client:
path: ../client
angel3_auth:
path: ../auth
angel3_validate:
path: ../validate
angel3_mock_request:
path: ../mock_request
angel3_model:
path: ../model
angel3_route:
path: ../route

View file

@ -1,13 +1,17 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.1
* Updated README
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
* [**Breaking**] `error` for `AngelHttpException` is no longer mandatory
## 5.0.0
@ -32,11 +36,11 @@
## 3.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 2.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 1.1.0

View file

@ -1,9 +1,9 @@
name: angel3_http_exception
version: 6.0.1
version: 7.0.0
description: Exception class that can be serialized to JSON and serialized to clients.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/http_exception
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dev_dependencies:
lints: ^1.0.0
lints: ^2.0.0

View file

@ -1,5 +1,9 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.1
* Updated `jael3`
@ -7,7 +11,7 @@
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -44,11 +48,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.0

View file

@ -1,47 +1,47 @@
name: angel3_jael
version: 6.0.1
version: 7.0.0
description: Angel support for the Jael templating engine, similar to Blade or Liquid.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/jael/angel_jael
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
jael3: ^6.0.0
jael3_preprocessor: ^6.0.0
belatuk_code_buffer: ^3.0.0
belatuk_symbol_table: ^3.0.0
angel3_framework: ^7.0.0
jael3: ^7.0.0
jael3_preprocessor: ^7.0.0
belatuk_code_buffer: ^4.0.0
belatuk_symbol_table: ^4.0.0
file: ^6.0.0
logging: ^1.0.1
dev_dependencies:
angel3_test: ^6.0.0
angel3_test: ^7.0.0
html: ^0.15.0
test: ^1.21.0
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
# angel3_client:
# path: ../../client
# angel3_websocket:
# path: ../../websocket
# angel3_validate:
# path: ../../validate
# angel3_test:
# path: ../../test
# jael3:
# path: ../jael
# jael3_preprocessor:
# path: ../jael_preprocessor
lints: ^2.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
angel3_client:
path: ../../client
angel3_websocket:
path: ../../websocket
angel3_validate:
path: ../../validate
angel3_test:
path: ../../test
jael3:
path: ../jael
jael3_preprocessor:
path: ../jael_preprocessor

View file

@ -1,12 +1,16 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.1
* Fixed analyze errors
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -23,11 +27,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.2

View file

@ -1,21 +1,21 @@
name: jael3
version: 6.0.1
version: 7.0.0
description: A simple server-side HTML templating engine for Dart. Comparable to Blade or Liquid.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/jael/jael
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
args: ^2.0.0
charcode: ^1.0.0
belatuk_code_buffer: ^3.0.0
belatuk_symbol_table: ^3.0.0
belatuk_code_buffer: ^4.0.0
belatuk_symbol_table: ^4.0.0
source_span: ^1.0.0
string_scanner: ^1.0.0
collection: ^1.15.0
matcher: ^0.12.10
dev_dependencies:
lints: ^1.0.0
lints: ^2.0.0
test: ^1.21.0
executables:
jaelfmt: jaelfmt

View file

@ -1,24 +1,28 @@
name: jael3_language_server
version: 6.0.0
version: 7.0.0
description: Language Server Protocol implementation for the Jael templating engine.
homepage: https://github.com/angel-dart/vscode
publish_to: none
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
args: ^2.1.1
# dart_language_server: ^0.1.16
file: ^6.1.2
io: ^1.0.0
jael3: ^6.0.0
jael3_preprocessor: ^6.0.0
jael3: ^7.0.0
jael3_preprocessor: ^7.0.0
json_rpc_2: ^3.0.1
logging: ^1.0.1
path: ^1.8.0
source_span: ^1.8.1
string_scanner: ^1.1.0
belatuk_symbol_table: ^3.0.0
lints: ^1.0.0
belatuk_symbol_table: ^4.0.0
lints: ^2.0.0
executables:
jael3_language_server: jael3_language_server
dependency_overrides:
jael3:
path: ../jael
jael3_preprocessor:
path: ../jael_preprocessor

View file

@ -1,12 +1,16 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.1
* Fixed `jael3` version
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -27,11 +31,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.1

View file

@ -1,19 +1,19 @@
name: jael3_preprocessor
version: 6.0.1
version: 7.0.0
description: A pre-processor for resolving blocks and includes within Jael templates.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/jael/jael_preprocessor
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
file: ^6.1.0
jael3: ^6.0.0
belatuk_symbol_table: ^3.0.0
jael3: ^7.0.0
belatuk_symbol_table: ^4.0.0
collection: ^1.15.0
dev_dependencies:
belatuk_code_buffer: ^3.0.0
belatuk_code_buffer: ^4.0.0
test: ^1.21.0
lints: ^1.0.0
# dependency_overrides:
# jael3:
# path: ../jael
lints: ^2.0.0
dependency_overrides:
jael3:
path: ../jael

View file

@ -11,8 +11,8 @@ import 'package:path/src/context.dart';
/// Converts a [DartType] to a [TypeReference].
TypeReference convertTypeReference(DartType? t) {
return new TypeReference((b) {
b..symbol = t?.getDisplayString(withNullability: false);
return TypeReference((b) {
b.symbol = t?.getDisplayString(withNullability: false);
if (t is InterfaceType) {
b.types.addAll(t.typeArguments.map(convertTypeReference));
@ -49,6 +49,7 @@ class BuildFileSystem extends FileSystem {
BuildFileSystem(this.reader, this.package);
@override
Context get path => _path;
@override
@ -56,6 +57,7 @@ class BuildFileSystem extends FileSystem {
return BuildSystemDirectory(this, reader, package, _path.current);
}
@override
set currentDirectory(value) {
if (value is Directory) {
_path = Context(current: value.path);
@ -69,28 +71,30 @@ class BuildFileSystem extends FileSystem {
@override
Directory directory(path) {
late String p;
if (path is String)
if (path is String) {
p = path;
else if (path is Uri)
p = path.toString(); //p.toString();
else if (path is FileSystemEntity)
} else if (path is Uri) {
p = path.toString();
} else if (path is FileSystemEntity) {
p = path.path;
else
} else {
throw ArgumentError();
}
return BuildSystemDirectory(this, reader, package, p);
}
@override
File file(path) {
late String p;
if (path is String)
if (path is String) {
p = path;
else if (path is Uri)
p = path.toString(); // p.toString();
else if (path is FileSystemEntity)
} else if (path is Uri) {
p = path.toString();
} else if (path is FileSystemEntity) {
p = path.path;
else
} else {
throw ArgumentError();
}
return BuildSystemFile(this, reader, package, p);
}
@ -125,13 +129,16 @@ class BuildFileSystem extends FileSystem {
}
class BuildSystemFile extends File {
@override
final BuildFileSystem fileSystem;
final AssetReader reader;
final String package;
@override
final String path;
BuildSystemFile(this.fileSystem, this.reader, this.package, this.path);
@override
Uri get uri => fileSystem.path.toUri(path);
@override
@ -147,7 +154,8 @@ class BuildSystemFile extends File {
File copySync(String newPath) => throw _unsupported();
@override
Future<File> create({bool recursive = false}) => throw _unsupported();
Future<File> create({bool exclusive = false, bool recursive = false}) =>
throw _unsupported();
@override
void createSync({bool recursive = false}) => throw _unsupported();
@ -312,9 +320,11 @@ class BuildSystemFile extends File {
}
class BuildSystemDirectory extends Directory {
@override
final BuildFileSystem fileSystem;
final AssetReader reader;
final String package;
@override
final String path;
BuildSystemDirectory(this.fileSystem, this.reader, this.package, this.path);

View file

@ -9,7 +9,5 @@ abstract class Component<State> extends DomNode {
void beforeDestroy() {}
void setState(State newState) {
// TODO:
}
void setState(State newState) {}
}

File diff suppressed because it is too large Load diff

View file

@ -1,22 +1,22 @@
name: jael3_web
version: 6.0.0
version: 7.0.0
description: Experimental virtual DOM/SPA engine built on Jael3. Supports SSR.
publish_to: none
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
build: ^2.0.2
build_config: ^1.0.0
code_builder: ^4.0.0
jael3: ^6.0.0
jael3_preprocessor: ^6.0.0
jael3: ^7.0.0
jael3_preprocessor: ^7.0.0
source_gen: ^1.0.2
dev_dependencies:
build_runner: ^2.0.4
build_web_compilers: ^3.0.0
lints: ^1.0.0
# dependency_overrides:
# jael3:
# path: ../jael
# jael3_preprocessor:
# path: ../jael_preprocessor
lints: ^2.0.0
dependency_overrides:
jael3:
path: ../jael
jael3_preprocessor:
path: ../jael_preprocessor

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -23,7 +27,7 @@
## 2.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 1.0.0

View file

@ -1,14 +1,37 @@
name: angel3_jinja
version: 6.0.0
version: 7.0.0
description: A service that renders Jinja2 template into HTML view for Angel3. Ported from Python to Dart.
homepage: https://github.com/dukefirehawk/angel/tree/master/packages/jinja
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
angel3_framework: ^7.0.0
jinja: ^0.3.4
dev_dependencies:
angel3_test: ^6.0.0
angel3_test: ^7.0.0
path: ^1.8.0
test: ^1.21.0
lints: ^1.0.0
lints: ^2.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_test:
path: ../test
angel3_websocket:
path: ../websocket
angel3_client:
path: ../client
angel3_auth:
path: ../auth
angel3_validate:
path: ../validate

View file

@ -1,12 +1,17 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
* Updated `markdown` to 6.0.x
## 6.1.0
* Updated `markdown` to 5.x.x
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -18,11 +23,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to support Dart SDK 2.12.x non NNBD
* Migrated to support Dart >= 2.12 Non NNBD
## 2.0.0

View file

@ -1,15 +1,38 @@
name: angel3_markdown
version: 6.1.0
version: 7.0.0
description: Angel3 Markdown view generator. Write static sites, with no build step.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/markdown
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
angel3_framework: ^7.0.0
file: ^6.1.2
markdown: ^5.0.0
markdown: ^6.0.0
dev_dependencies:
angel3_test: ^6.0.0
lints: ^1.0.0
angel3_test: ^7.0.0
lints: ^2.0.0
test: ^1.21.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_test:
path: ../test
angel3_websocket:
path: ../websocket
angel3_client:
path: ../client
angel3_auth:
path: ../auth
angel3_validate:
path: ../validate

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -31,7 +35,7 @@
## 2.0.0
* Migrated to work with Dart SDK 2.12.x NNBD
* Migrated to work with Dart >= 2.12 NNBD
## 1.0.7

View file

@ -1,17 +1,25 @@
name: angel3_mock_request
version: 6.0.0
version: 7.0.0
description: Manufacture dart:io HttpRequests, HttpResponses, HttpHeaders, etc.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/mock_request
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
charcode: ^1.2.0
dev_dependencies:
angel3_framework: ^6.0.0
angel3_framework: ^7.0.0
http: ^0.13.2
test: ^1.21.0
lints: ^1.0.0
# dependency_overrides:
# angel3_framework:
# path: ../framework
lints: ^2.0.0
dependency_overrides:
angel3_framework:
path: ../framework
angel3_route:
path: ../route
angel3_model:
path: ../model
angel3_http_exception:
path: ../http_exception
angel3_container:
path: ../container/angel_container

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -31,11 +35,11 @@
## 3.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 2.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 1.0.3

View file

@ -1,9 +1,9 @@
name: angel3_model
version: 6.0.0
version: 7.0.0
description: Angel3 basic data model class, no longer with the added weight of the whole framework.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/model
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dev_dependencies:
lints: ^1.0.0
lints: ^2.0.0

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -20,7 +24,7 @@
## 3.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 2.0.3

View file

@ -1,29 +1,29 @@
name: angel3_mongo
version: 6.0.0
version: 7.0.0
description: MongoDB-enabled services for the Angel3 framework. Well-tested.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/mongo
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
belatuk_json_serializer: ^5.0.0
belatuk_merge_map: ^3.0.0
angel3_framework: ^7.0.0
belatuk_json_serializer: ^6.0.0
belatuk_merge_map: ^4.0.0
mongo_dart: ^0.7.0
dev_dependencies:
http: ^0.13.0
test: ^1.21.0
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
lints: ^2.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

View file

@ -1,8 +1,12 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -22,7 +26,7 @@
## 3.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
* Replaced `mustache4dart` with `mustache_template`
## 2.0.0

View file

@ -1,16 +1,29 @@
name: angel3_mustache
version: 6.0.0
version: 7.0.0
description: A service that renders Mustache template into HTML view for Angel3
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/mustache
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
angel3_framework: ^7.0.0
file: ^6.1.2
mustache_template: ^2.0.0
path: ^1.8.0
dev_dependencies:
http: ^0.13.3
test: ^1.21.0
lints: ^1.0.0
lints: ^2.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

View file

@ -1,5 +1,9 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.0.1
* Fixed AngelHttpException error
@ -7,7 +11,7 @@
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -23,11 +27,11 @@
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.3.0

View file

@ -6,7 +6,7 @@ import 'package:angel3_oauth2/angel3_oauth2.dart';
void main() async {
var app = Angel();
var oauth2 = _ExampleAuthorizationServer();
var _rgxBearer = RegExp(r'^[Bb]earer ([^\n\s]+)$');
var rgxBearer = RegExp(r'^[Bb]earer ([^\n\s]+)$');
app.group('/auth', (router) {
router
@ -17,7 +17,7 @@ void main() async {
// Assume that all other requests must be authenticated...
app.fallback((req, res) {
var authToken =
req.headers!.value('authorization')?.replaceAll(_rgxBearer, '').trim();
req.headers!.value('authorization')?.replaceAll(rgxBearer, '').trim();
if (authToken == null) {
throw AngelHttpException.forbidden();

View file

@ -234,7 +234,7 @@ abstract class AuthorizationServer<Client, User> {
if (buf.isNotEmpty) buf.write('&');
return buf
..write(
'$k=' + Uri.encodeComponent(queryParameters[k]!),
'$k=${Uri.encodeComponent(queryParameters[k]!)}',
);
}).toString();

View file

@ -1,20 +1,43 @@
name: angel3_oauth2
version: 6.0.1
version: 7.0.0
description: A class containing handlers that can be used within Angel to build a spec-compliant OAuth 2.0 server.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/oauth2
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_framework: ^6.0.0
angel3_http_exception: ^6.0.0
angel3_framework: ^7.0.0
angel3_http_exception: ^7.0.0
crypto: ^3.0.1
collection: ^1.15.0
dev_dependencies:
angel3_validate: ^6.0.0
angel3_test: ^6.0.0
angel3_validate: ^7.0.0
angel3_test: ^7.0.0
logging: ^1.0.1
oauth2: ^2.0.0
lints: ^1.0.0
lints: ^2.0.0
test: ^1.21.0
uuid: ^3.0.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
angel3_test:
path: ../test
angel3_validate:
path: ../validate
angel3_websocket:
path: ../websocket
angel3_client:
path: ../client
angel3_auth:
path: ../auth

View file

@ -100,7 +100,7 @@ void main() {
var authCode = json.decode(response.body)['code'].toString();
var client = await grant.handleAuthorizationCode(authCode);
expect(client.credentials.accessToken, authCode + '_access');
expect(client.credentials.accessToken, '${authCode}_access');
});
test('can send refresh token', () async {
@ -111,9 +111,9 @@ void main() {
var authCode = json.decode(response.body)['code'].toString();
var client = await grant.handleAuthorizationCode(authCode);
expect(client.credentials.accessToken, authCode + '_access');
expect(client.credentials.accessToken, '${authCode}_access');
expect(client.credentials.canRefresh, isTrue);
expect(client.credentials.refreshToken, authCode + '_refresh');
expect(client.credentials.refreshToken, '${authCode}_refresh');
});
});
}

View file

@ -32,7 +32,7 @@ void main() {
var response = await client.post(
Uri.parse('oauth2/token'),
headers: {
'Authorization': 'Basic ' + base64Url.encode('foo:bar'.codeUnits),
'Authorization': 'Basic ${base64Url.encode('foo:bar'.codeUnits)}',
},
body: {
'grant_type': 'client_credentials',
@ -60,7 +60,7 @@ void main() {
var response = await client.post(
Uri.parse('/oauth2/token'),
headers: {
'Authorization': 'Basic ' + base64Url.encode('fooa:bar'.codeUnits),
'Authorization': 'Basic ${base64Url.encode('fooa:bar'.codeUnits)}',
},
body: {
'grant_type': 'client_credentials',
@ -75,7 +75,7 @@ void main() {
var response = await client.post(
Uri.parse('/oauth2/token'),
headers: {
'Authorization': 'Basic ' + base64Url.encode('foo:bara'.codeUnits),
'Authorization': 'Basic ${base64Url.encode('foo:bara'.codeUnits)}',
},
body: {
'grant_type': 'client_credentials',

View file

@ -2,7 +2,6 @@ import 'dart:async';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_test/angel3_test.dart';
import 'package:angel3_oauth2/angel3_oauth2.dart';
import 'package:angel3_validate/angel3_validate.dart';
import 'package:logging/logging.dart';
import 'package:test/test.dart';
import 'common.dart';

View file

@ -2,7 +2,6 @@ import 'dart:async';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_test/angel3_test.dart';
import 'package:angel3_oauth2/angel3_oauth2.dart';
import 'package:angel3_validate/angel3_validate.dart';
import 'package:test/test.dart';
import 'common.dart';

View file

@ -1,12 +1,16 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.1.0
* Updated temporal fields
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -44,11 +48,11 @@
## 4.0.0-beta.1
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.0

View file

@ -1,14 +1,14 @@
name: angel3_migration
version: 6.1.0
version: 7.0.0
description: Database migration runtime for Angel3 ORM. Use this package to define schemas.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/orm/angel_migration
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_orm: ^6.0.0
angel3_orm: ^7.0.0
dev_dependencies:
lints: ^1.0.0
# dependency_overrides:
# angel3_orm:
# path: ../angel_orm
lints: ^2.0.0
dependency_overrides:
angel3_orm:
path: ../angel_orm

View file

@ -1,5 +1,9 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.1.0
* Fixed issue #70. Incorrectly generated SQL for `defaultsTo('Default Value')`
@ -14,7 +18,7 @@
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
* Updated to use `mysql_client` package
## 5.0.0
@ -64,11 +68,11 @@
## 4.0.0-beta.1
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.0.0

View file

@ -1,13 +1,13 @@
name: angel3_migration_runner
version: 6.1.0
version: 7.0.0
description: Command-line based database migration runner for Angel3's ORM.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/orm/angel_migration_runner
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
angel3_migration: ^6.0.0
angel3_orm: ^6.0.0
angel3_migration: ^7.0.0
angel3_orm: ^7.0.0
args: ^2.1.0
charcode: ^1.2.0
postgres: ^2.4.0
@ -15,9 +15,9 @@ dependencies:
mysql1: ^0.20.0
logging: ^1.0.0
dev_dependencies:
lints: ^1.0.0
# dependency_overrides:
# angel3_orm:
# path: ../angel_orm
# angel3_migration:
# path: ../angel_migration
lints: ^2.0.0
dependency_overrides:
angel3_orm:
path: ../angel_orm
angel3_migration:
path: ../angel_migration

View file

@ -1,5 +1,9 @@
# Change Log
## 7.0.0
* Require Dart >= 2.17
## 6.1.0
* Fixed issue #68: Support for non-nullable type
@ -11,7 +15,7 @@
## 6.0.0
* Updated to SDK 2.16.x
* Require Dart >= 2.16
## 5.0.0
@ -70,11 +74,11 @@
## 4.0.0-beta.1
* Migrated to support Dart SDK 2.12.x NNBD
* Migrated to support Dart >= 2.12 NNBD
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
* Migrated to work with Dart >= 2.12 Non NNBD
## 2.1.0-beta.3

View file

@ -106,12 +106,12 @@ class NumericSqlExpressionBuilder<T extends num>
}
void isIn(Iterable<T> values) {
_raw = 'IN (' + values.join(', ') + ')';
_raw = 'IN (${values.join(', ')})';
_hasValue = true;
}
void isNotIn(Iterable<T> values) {
_raw = 'NOT IN (' + values.join(', ') + ')';
_raw = 'NOT IN (${values.join(', ')})';
_hasValue = true;
}
}
@ -173,12 +173,12 @@ class EnumSqlExpressionBuilder<T> extends SqlExpressionBuilder<T> {
void isNotBetween(T lower, T upper) => throw _unsupported();
void isIn(Iterable<T> values) {
_raw = 'IN (' + values.map(_getValue).join(', ') + ')';
_raw = 'IN (${values.map(_getValue).join(', ')})';
_hasValue = true;
}
void isNotIn(Iterable<T> values) {
_raw = 'NOT IN (' + values.map(_getValue).join(', ') + ')';
_raw = 'NOT IN (${values.map(_getValue).join(', ')})';
_hasValue = true;
}
}
@ -237,7 +237,7 @@ class StringSqlExpressionBuilder extends SqlExpressionBuilder<String> {
/// ```
void like(String pattern, {String Function(String)? sanitize}) {
sanitize ??= (s) => pattern;
_raw = 'LIKE \'' + sanitize('@$substitution') + '\'';
_raw = 'LIKE \'${sanitize('@$substitution')}\'';
//query.substitutionValues[substitution] = pattern;
_hasValue = true;
_value = null;
@ -268,13 +268,11 @@ class StringSqlExpressionBuilder extends SqlExpressionBuilder<String> {
}
String _in(Iterable<String> values) {
return 'IN (' +
values.map((v) {
var name = query.reserveName('${columnName}_in_value');
query.substitutionValues[name] = v;
return '@$name';
}).join(', ') +
')';
return 'IN (${values.map((v) {
var name = query.reserveName('${columnName}_in_value');
query.substitutionValues[name] = v;
return '@$name';
}).join(', ')})';
}
void isIn(Iterable<String> values) {
@ -283,7 +281,7 @@ class StringSqlExpressionBuilder extends SqlExpressionBuilder<String> {
}
void isNotIn(Iterable<String> values) {
_raw = 'NOT ' + _in(values);
_raw = 'NOT ${_in(values)}';
_hasValue = true;
}
}
@ -374,9 +372,9 @@ class DateTimeSqlExpressionBuilder extends SqlExpressionBuilder<DateTime> {
_minute?.hasValue == true ||
_second?.hasValue == true;
bool _change(String _op, DateTime dt, bool time) {
bool _change(String op, DateTime dt, bool time) {
var dateString = time ? dateYmdHms.format(dt) : dateYmd.format(dt);
_raw = '$columnName $_op \'$dateString\'';
_raw = '$columnName $op \'$dateString\'';
return true;
}
@ -409,15 +407,13 @@ class DateTimeSqlExpressionBuilder extends SqlExpressionBuilder<DateTime> {
}
void isIn(Iterable<DateTime> values) {
_raw = '$columnName IN (' +
values.map(dateYmdHms.format).map((s) => '$s').join(', ') +
')';
_raw =
'$columnName IN (${values.map(dateYmdHms.format).map((s) => s).join(', ')})';
}
void isNotIn(Iterable<DateTime> values) {
_raw = '$columnName NOT IN (' +
values.map(dateYmdHms.format).map((s) => '$s').join(', ') +
')';
_raw =
'$columnName NOT IN (${values.map(dateYmdHms.format).map((s) => s).join(', ')})';
}
void isBetween(DateTime lower, DateTime upper) {
@ -624,7 +620,7 @@ class JsonSqlExpressionBuilderProperty {
var r = builder._raw;
if (r != null) {
builder._raw = r + '$nameString IS NOT NULL';
builder._raw = '$r$nameString IS NOT NULL';
} else {
builder._raw = '$nameString IS NOT NULL';
}
@ -637,7 +633,7 @@ class JsonSqlExpressionBuilderProperty {
var r = builder._raw;
if (r != null) {
builder._raw = r + '$nameString IS NULL';
builder._raw = '$r$nameString IS NULL';
} else {
builder._raw = '$nameString IS NULL';
}

View file

@ -1,10 +1,10 @@
name: angel3_orm
version: 6.1.0
version: 7.0.0
description: Runtime support for Angel3 ORM. Includes base classes for queries.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/orm/angel_orm
environment:
sdk: '>=2.16.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
charcode: ^1.2.0
intl: ^0.17.0
@ -13,16 +13,16 @@ dependencies:
optional: ^6.0.0
logging: ^1.0.0
dev_dependencies:
angel3_model: ^6.0.0
angel3_serialize: ^6.0.0
angel3_serialize_generator: ^6.0.0
angel3_model: ^7.0.0
angel3_serialize: ^7.0.0
angel3_serialize_generator: ^7.0.0
build_runner: ^2.1.1
test: ^1.17.4
lints: ^1.0.0
# dependency_overrides:
# angel3_serialize:
# path: ../../serialize/angel_serialize
# angel3_serialize_generator:
# path: ../../serialize/angel_serialize_generator
# angel3_model:
# path: ../../model
lints: ^2.0.0
dependency_overrides:
angel3_serialize:
path: ../../serialize/angel_serialize
angel3_serialize_generator:
path: ../../serialize/angel_serialize_generator
angel3_model:
path: ../../model

Some files were not shown because too many files have changed in this diff Show more