aqueduct 2.5.0+1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 96

Aqueduct

Build Status codecov

Slack

Aqueduct is a server-side framework for building and deploying multi-threaded REST applications. It is written in Dart and targets the Dart VM. Its goal is to provide an integrated, consistently styled API. If this is your first time viewing Aqueduct, check out the tour.

The framework contains behavior for routing, OAuth 2.0, a PostgreSQL ORM, testing, and more.

The aqueduct command-line tool serves applications, manages database schemas and OAuth 2.0 clients, and generates OpenAPI specifications.

In-depth documentation is available here.

Getting Started

  1. Install Dart.

  2. Activate Aqueduct

     pub global activate aqueduct
    
  3. Create a new project.

     aqueduct create my_project
    

Open the project directory in an IntelliJ IDE, Atom or Visual Studio Code. All three IDEs have a Dart plugin. IntelliJ IDEA is preferred and has file and code templates specific to Aqueduct.

Tutorials, Documentation and Examples

Step-by-step tutorials for beginners are available here.

You can find the API reference here or you can install it in Dash.

You can find in-depth and conceptual guides here.

An ever-expanding repository of Aqueduct examples is here.

aqueduct changelog

2.5.0

  • Adds aqueduct db schema to print an application's data model.
  • Adds aqueduct document serve that serves the API documentation for an application.
  • Adds --machine flag to aqueduct tool to only emit machine-readable output.
  • Adds defaultDelay to MockHTTPServer. Defaults to null for no delay.
  • Adds defaultResponse to MockHTTPServer. Defaults to a 503 response instead of a 200.
  • Adds option to set a custom delay for a specific response in MockHTTPServer's queueResponse function.
  • Performance improvements

2.4.0

  • Adds HTTPRequestBody.maxSize to limit HTTP request body sizes. Defaults to 10MB.
  • Adds ManagedTableAttributes to configure underlying database table to use multiple columns to test for uniqueness.

2.3.2

  • Adds Request.addResponseModifier to allow middleware to modify responses.

2.3.1

  • Adds Response.bufferOutput to control whether the HTTP response bytes are buffered.
  • Adds whereNot to apply an inverse to other Query.where expression, e.g. whereNot(whereIn(["a", "b"])).
  • Fixes bug where subclassing ManagedObjectController didn't work.
  • Renames ResourceRegistry to ServiceRegistry.
  • Improves feedback and interface for package:aqueduct/test.dart.

2.3.0

  • Adds Request.acceptableContentTypes and Request.acceptsContentType for convenient usage of Accept header.
  • Adds AuthStorage.allowedScopesForAuthenticatable to provide user attribute-based scoping, e.g. roles.
  • Adds Query.forEntity and ManagedObjectController.forEntity to dynamically instantiate these types, i.e. use runtime values to build the query.
  • Adds PersistentStore.newQuery - allows a PersistentStore implementation to provide its own implementation of Query specific to its underlying database.
  • Adds Query.reduce to perform aggregate functions on database tables, e.g. sum, average, maximum, etc.
  • enums may be used as persistent properties in ManagedObject<T>. The underlying database will store them a strings.
  • Speed of generating a template project has been greatly improved.

2.2.2

  • Adds ApplicationMessageHub to send cross-isolate messages.

2.2.1

  • Allow HTTPCodecRepository.add to use specify default charset for Content-Type if a request does not specify one.

2.2.0

  • The default template created by aqueduct create is now mostly empty. Available templates can be listed with aqueduct create list-templates and selected with the command-line option --template.
  • Bug fixes where aqueduct auth would fail to insert new Client IDs.
  • joinMany and joinOne are deprecated, use join(set:) and join(object:) instead.
  • HTTPCodecRepository replaces Response.addEncoder and HTTPBody.addDecoder.
  • Streams may now be Response bodies.
  • Request bodies may be bound in HTTPController with HTTPBody metadata.
  • Adds file serving with HTTPFileController.
  • Adds HTTPCachePolicy to control cache headers for a Response.
  • Request.body has significantly improved behavior and has been optimized.
  • Content-Length is included instead of Transfer-Encoding: chunked when the size of the response body can be determined efficiently.

2.1.1

  • Adds ResourceRegistry: tracks port-consuming resources like database connections to ensure they are closed when an application shuts down during testing.

2.1.0

  • Fixes race condition when stopping an application during test execution
  • Adds validation behavior to ManagedObjects using Validate and ManagedValidator and ManagedObject.validate.
  • ManagedObjects now have callbacks willUpdate and willInsert to modify their values before updating and inserting.
  • Fixes issue with aqueduct serve on Windows.

2.0.3

  • Fixes issue with aqueduct document for routes using listen
  • Fixes issue when using TestClient to execute requests with public OAuth2 client
  • Enables database migrations past the initial aqueduct db generate.
  • CLI tools print tool version, project version (when applicable)

2.0.2

  • Allow binding to system-assigned port so tests can be run in parallel
  • Change aqueduct serve default port to 8081 so can develop in parallel to Angular2 apps that default to 8080
  • Remove SecurityContext reference from ApplicationConfiguration. SSL configured via new aqueduct serve arguments ssl-key-path and ssl-certificate-path, or overriding securityContext in RequestSink.

2.0.1

  • Fixes issue where some types of join queries would access the wrong properties
  • Fixes issue where an object cannot be inserted without values; this matters when the inserted values will be created by the database.

2.0.0

  • Added RequestController.letUncaughtExceptionsEscape for better debugging during tests.
  • Persistent types for ManagedObjects can now have superclasses.
  • ManagedRelationships now have a .deferred() constructor. This allows ManagedObjects to have relationships to ManagedObjects in other packages.
  • Added RequestSink.initializeApplication method to do one-time startup tasks that were previously done in a start script.
  • RequestSink constructor now takes ApplicationConfiguration, instead of Map.
  • Added configurationFilePath to ApplicationConfiguration.
  • Improved error reporting from failed application startups.
  • Automatically lowercase headers in Response objects so that other parts of an application can accurately read their values during processing.
  • Added HTTPBody object to represent HTTP request bodies in Request. Decoders are now added to this type.
  • ORM: Renamed Query.matchOn to Query.where.

  • ORM: Removed includeInResultSet for Query's, instead, added joinOn and joinMany which create subqueries that can be configured further.

  • ORM: Allow Query.where to reference properties in related objects without including related objects in results, i.e. can fetch Parent objects and filter them by values in their Child relationships.

  • ORM: Joins can now be applied to belongsTo relationship properties.

  • ORM: Matchers such as whereNull and whereNotNull can be applied to a relationship property in Query.where.

  • ORM: Renamed ManagedSet.matchOn to ManagedSet.haveAtLeastOneWhere.

  • ORM: Added matchers for case-insensitive string matching, and added case-insensitive option to whereEquals and whereNotEquals.

  • Auth: Added aqueduct/managed_auth library. Implements storage of OAuth 2.0 tokens using ManagedObjects. See API reference for more details.

  • Auth: Improved error and response messaging to better align with the OAuth 2.0 spec, especially with regards to the authorization code flow.

  • Auth: Added distinction between public and confidential clients, as defined by OAuth 2.0 spec.

  • Auth: Improved class and property naming.

  • Tooling: Added aqueduct auth tool to create client ID and secrets and add them to a database for applications using the aqueduct/managed_auth package.

  • Tooling: Added more user-friendly configuration options for aqueduct db tool.

  • Tooling: Added aqueduct setup --heroku for setting up projects to be deployed to Heroku.

  • Tooling: Added aqueduct serve command for running Aqueduct applications without having to write a start script.

  • Tooling: Added aqueduct document command to generate OpenAPI specification for Aqueduct applications, instead of relying on a script that came with the template.

1.0.4

  • BREAKING CHANGE: Added new Response.contentType property. Adding "Content-Type" to the headers of a Response no longer has any effect; use this property instead.
  • ManagedDataModels now scan all libraries for ManagedObject<T> subclasses to generate a data model. Use ManagedDataModel.fromCurrentMirrorSystem to create instances of ManagedDataModel.
  • The last instantiated ManagedContext now becomes the ManagedContext.defaultContext; prior to this change, it was the first instantiated context. Added ManagedContext.standalone to opt out of setting the default context.
  • @HTTPQuery parameters in HTTPController responder method will now only allow multiple keys in the query string if and only if the argument type is a List.

1.0.3

  • Fix to allow Windows user to use aqueduct setup.
  • Fix to CORS processing.
  • HTTPControllers now return 405 if there is no responder method match for a request.

1.0.2

  • Fix type checking for transient map and list properties of ManagedObject.
  • Add flags to Process.runSync that allow Windows user to use aqueduct executable.

1.0.1

  • Change behavior of isolate supervision. If an isolate has an uncaught exception, it logs the exception but does not restart the isolate.

1.0.0

  • Initial stable release.

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  aqueduct: "^2.5.0+1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:aqueduct/aqueduct.dart';
        
Version Uploaded Documentation Archive
2.5.0+1 Dec 1, 2017 Go to the documentation of aqueduct 2.5.0+1 Download aqueduct 2.5.0+1 archive
2.5.0 Oct 12, 2017 Go to the documentation of aqueduct 2.5.0 Download aqueduct 2.5.0 archive
2.4.0 Aug 30, 2017 Go to the documentation of aqueduct 2.4.0 Download aqueduct 2.4.0 archive
2.3.2 Jul 22, 2017 Go to the documentation of aqueduct 2.3.2 Download aqueduct 2.3.2 archive
2.3.1 Jul 20, 2017 Go to the documentation of aqueduct 2.3.1 Download aqueduct 2.3.1 archive
2.3.0 Jun 29, 2017 Go to the documentation of aqueduct 2.3.0 Download aqueduct 2.3.0 archive
2.2.2 Jun 10, 2017 Go to the documentation of aqueduct 2.2.2 Download aqueduct 2.2.2 archive
2.2.1 Jun 2, 2017 Go to the documentation of aqueduct 2.2.1 Download aqueduct 2.2.1 archive
2.2.0 Jun 1, 2017 Go to the documentation of aqueduct 2.2.0 Download aqueduct 2.2.0 archive
2.1.1 Apr 28, 2017 Go to the documentation of aqueduct 2.1.1 Download aqueduct 2.1.1 archive

All 23 versions...

Analysis

This feature is new.
We welcome feedback.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Dec 6, 2017
  • Dart: 2.0.0-dev.8.0
  • pana: 0.7.3+1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
92
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall score:
Weighted score of the above. [more]
96

Platforms

Detected platforms: server

All libraries agree

Dependencies

Package Constraint Resolved Available
Direct dependencies
analyzer >=0.28.0 <1.0.0 0.30.0+4 0.31.0-alpha.2
args ^1.0.0 1.2.0
crypto ^2.0.0 2.0.2+1
logging >=0.11.3 <0.12.0 0.11.3+1
matcher >=0.12.0+2 <0.13.0 0.12.1+4
password_hash ^1.0.0 1.0.0
path ^1.4.1 1.5.1
postgres >=0.9.1 <1.0.0 0.9.6
pub_cache ^0.1.0 0.1.1
pub_semver ^1.0.0 1.3.2
safe_config >=1.1.0 <2.0.0 1.2.1
stack_trace ^1.0.0 1.9.1
test ^0.12.28 0.12.29
yaml >=2.1.9 <3.0.0 2.1.13
Transitive dependencies
async 1.13.3 2.0.1
barback 0.15.2+13
boolean_selector 1.0.2
charcode 1.1.1
cli_util 0.1.2+1
collection 1.14.3
convert 2.0.1
csslib 0.14.1
front_end 0.1.0-alpha.4.1 0.1.0-alpha.7
glob 1.1.5
html 0.13.2
http_multi_server 2.0.4
http_parser 3.1.1
io 0.3.1
isolate 1.1.0
js 0.6.1
kernel 0.3.0-alpha.1.1 0.3.0-alpha.4
meta 1.1.2
mime 0.9.4
multi_server_socket 1.0.0
node_preamble 1.4.0
package_config 1.0.3
package_resolver 1.0.2
plugin 0.2.0+2
pool 1.3.3
shelf 0.7.1
shelf_packages_handler 1.0.3
shelf_static 0.2.6
shelf_web_socket 0.2.2
source_map_stack_trace 1.1.4
source_maps 0.10.4
source_span 1.4.0
stream_channel 1.6.2
string_scanner 1.0.2
term_glyph 1.0.0
typed_data 1.1.5
utf 0.9.0+3
watcher 0.9.7+4
web_socket_channel 1.0.6
Dev dependencies
http >=0.11.3+7 <0.12.0 0.11.3+16