This commit is contained in:
Tobe O 2018-06-27 14:40:43 -04:00
parent 4e6d280b8f
commit 5cb941676f
10 changed files with 211 additions and 142 deletions

View file

@ -313,7 +313,7 @@
<entry key="path">
<value>
<list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/path-1.6.1/lib" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/path-1.6.0/lib" />
</list>
</value>
</entry>
@ -539,7 +539,7 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/node_preamble-1.4.2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/package_config-1.0.3/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/package_resolver-1.0.3/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/path-1.6.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/path-1.6.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/plugin-0.2.0+2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/pool-1.3.5/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/pub_semver-1.4.1/lib" />

View file

@ -2,9 +2,13 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="7b89ff1e-1260-4dcf-9c3d-345de0471ea1" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/libraries/Dart_Packages.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Dart_Packages.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/injection.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/injection.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/map_service.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/map_service.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/response_context.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/response_context.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/hooked_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/test/hooked_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/routing_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/test/routing_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/services_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/test/services_test.dart" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" />
@ -30,17 +34,65 @@
<file leaf-file-name="parameter_meta_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/parameter_meta_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-504">
<state relative-caret-position="32">
<caret line="2" column="54" selection-start-line="2" selection-start-column="54" selection-end-line="2" selection-end-column="54" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="injection.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/src/core/injection.dart">
<file leaf-file-name="response_context.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/src/core/response_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="283">
<caret line="146" column="58" selection-start-line="146" selection-start-column="58" selection-end-line="146" selection-end-column="58" />
<state relative-caret-position="437">
<caret line="50" column="75" selection-start-line="50" selection-start-column="75" selection-end-line="50" selection-end-column="75" />
<folding>
<element signature="e#48#68#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="http.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="18" column="26" selection-start-line="18" selection-start-column="26" selection-end-line="18" selection-end-column="26" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="request_context.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2320">
<caret line="154" column="25" selection-start-line="154" selection-start-column="25" selection-end-line="154" selection-end-column="25" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="angel_http.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="206">
<caret line="319" column="20" lean-forward="true" selection-start-line="319" selection-start-column="20" selection-end-line="319" selection-end-column="20" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="map_service.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/map_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="133" column="36" selection-start-line="133" selection-start-column="36" selection-end-line="133" selection-end-column="36" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="pubspec.yaml" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
<caret line="11" column="25" selection-start-line="11" selection-start-column="25" selection-end-line="11" selection-end-column="25" />
</state>
</provider>
</entry>
@ -57,15 +109,9 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>lazyBody()</find>
<find>addRout</find>
<find>lazyBody</find>
<find />
<find>_body</find>
<find>MID</find>
<find>beforeIndex</find>
<find>read(</find>
<find />
<find>new Trac</find>
<find>frame</find>
<find>logger.</find>
<find>Stopwa</find>
@ -80,26 +126,29 @@
<find>HttpStatus.</find>
<find>JSON</find>
<find>ContentType.JSON.toString()</find>
<find />
<find />
<find>(req, res)</find>
<find>headers: headers,</find>
<find>_</find>
<find>ContentType.HTML.mimeType</find>
<find>ContentType.JSON.mimeType</find>
<find>parameters</find>
<find />
<find>cannot re</find>
<find>cookie</find>
<find>cast</find>
<find>cast(&lt;[^&gt;]+&gt;)\(\)</find>
<find>\.cast(&lt;[^&gt;]+&gt;)\(\)</find>
<find>.cast</find>
<find>serviceP</find>
</findStrings>
<replaceStrings>
<replace>after</replace>
<replace>fatalErrorStream</replace>
<replace>onController</replace>
<replace />
<replace>if (_isClosed &amp;&amp; !_useStream)</replace>
<replace>logger?.warning</replace>
<replace>JSON.decode</replace>
<replace>query</replace>
<replace>cookie</replace>
<replace>req.path</replace>
<replace>req.path`</replace>
<replace />
<replace>autoSnakeCaseNames == false ? $0 : '$1ated_at'</replace>
<replace>appa</replace>
<replace>isClosed</replace>
<replace>useStream</replace>
@ -107,18 +156,21 @@
<replace>!isOpen</replace>
<replace>'server'</replace>
<replace>FutureOr</replace>
<replace />
<replace>var body = await getBody(rs);</replace>
<replace />
<replace>=</replace>
<replace>{</replace>
<replace>'accept'</replace>
<replace>'content-type'</replace>
<replace>403</replace>
<replace />
<replace />
<replace>(RequestContext req, res)</replace>
<replace>headers: headers.cast&lt;String, String&gt;(),</replace>
<replace>this.</replace>
<replace>'text/html'</replace>
<replace>'application/json'</replace>
<replace>as $1</replace>
<replace>as $1</replace>
<replace>as Map$1</replace>
</replaceStrings>
<dirStrings>
<dir>C:\Users\thosa\Source\Angel\framework\lib</dir>
@ -175,10 +227,8 @@
<option value="$PROJECT_DIR$/lib/src/core/anonymous_service.dart" />
<option value="$PROJECT_DIR$/lib/src/core/request_context.dart" />
<option value="$PROJECT_DIR$/lib/src/core/routable.dart" />
<option value="$PROJECT_DIR$/lib/src/core/map_service.dart" />
<option value="$PROJECT_DIR$/test/di_test.dart" />
<option value="$PROJECT_DIR$/lib/src/core/hooked_service.dart" />
<option value="$PROJECT_DIR$/lib/src/core/response_context.dart" />
<option value="$PROJECT_DIR$/test/controller_test.dart" />
<option value="$PROJECT_DIR$/test/hooked_test.dart" />
<option value="$PROJECT_DIR$/test/accepts_test.dart" />
@ -190,9 +240,11 @@
<option value="$PROJECT_DIR$/test/routing_test.dart" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_http_exception-1.0.0/lib/angel_http_exception.dart" />
<option value="$PROJECT_DIR$/test/typed_service_test.dart" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/lib/src/core/injection.dart" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/lib/src/core/map_service.dart" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/lib/src/core/response_context.dart" />
</list>
</option>
</component>
@ -206,8 +258,8 @@
<packageJsonPaths />
</component>
<component name="ProjectFrameBounds">
<option name="x" value="90" />
<option name="y" value="23" />
<option name="x" value="34" />
<option name="y" value="31" />
<option name="width" value="1282" />
<option name="height" value="784" />
</component>
@ -219,6 +271,9 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane" />
<pane id="AndroidView" />
<pane id="PackagesPane" />
<pane id="Scope">
<subPane subId="Project Files">
<expand>
@ -244,6 +299,13 @@
<item name="src" type="cbb8eebc:String" user="src" />
<item name="core" type="cbb8eebc:String" user="core" />
</path>
<path>
<item name="Root" type="cbb8eebc:String" user="Root" />
<item name="framework" type="cbb8eebc:String" user="framework" />
<item name="lib" type="cbb8eebc:String" user="lib" />
<item name="src" type="cbb8eebc:String" user="src" />
<item name="http" type="cbb8eebc:String" user="http" />
</path>
<path>
<item name="Root" type="cbb8eebc:String" user="Root" />
<item name="framework" type="cbb8eebc:String" user="framework" />
@ -253,9 +315,6 @@
<select />
</subPane>
</pane>
<pane id="ProjectPane" />
<pane id="AndroidView" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
@ -578,14 +637,9 @@
<workItem from="1529713102021" duration="161000" />
<workItem from="1529722767717" duration="59000" />
<workItem from="1529722829709" duration="1759000" />
<workItem from="1529724977574" duration="1313000" />
</task>
<task id="LOCAL-00041" summary="+8">
<created>1511026990202</created>
<option name="number" value="00041" />
<option name="presentableId" value="LOCAL-00041" />
<option name="project" value="LOCAL" />
<updated>1511026990202</updated>
<workItem from="1529724977574" duration="1752000" />
<workItem from="1530115464302" duration="135000" />
<workItem from="1530124258733" duration="424000" />
</task>
<task id="LOCAL-00042" summary="+9">
<created>1511892890049</created>
@ -923,7 +977,14 @@
<option name="project" value="LOCAL" />
<updated>1529724578293</updated>
</task>
<option name="localTasksCounter" value="90" />
<task id="LOCAL-00090" summary="+6">
<created>1529726381237</created>
<option name="number" value="00090" />
<option name="presentableId" value="LOCAL-00090" />
<option name="project" value="LOCAL" />
<updated>1529726381237</updated>
</task>
<option name="localTasksCounter" value="91" />
<servers />
</component>
<component name="TestHistory">
@ -959,7 +1020,7 @@
</history-entry>
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="153164000" />
<option name="totallyTimeSpent" value="154162000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -971,7 +1032,7 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1440" height="900" extended-state="0" />
<frame x="34" y="31" width="1282" height="784" extended-state="0" />
<editor active="true" />
<layout>
<window_info anchor="right" id="Palette" order="3" />
@ -979,7 +1040,7 @@
<window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.5035524" side_tool="true" weight="0.34188035" />
<window_info anchor="right" id="Maven Projects" order="3" />
<window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
<window_info anchor="bottom" id="Dart Analysis" order="7" weight="0.31111112" />
<window_info anchor="bottom" id="Dart Analysis" order="7" weight="0.31004366" />
<window_info anchor="right" id="Flutter Outline" order="4" />
<window_info id="Capture Tool" order="2" />
<window_info id="Designer" order="2" />
@ -990,28 +1051,28 @@
<window_info id="UI Designer" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39857143" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32714286" />
<window_info anchor="bottom" id="Messages" order="7" weight="0.33478895" />
<window_info anchor="right" id="Palette&#9;" order="3" />
<window_info id="Image Layers" order="2" />
<window_info anchor="right" id="Capture Analysis" order="3" />
<window_info anchor="bottom" id="Version Control" order="7" weight="0.32905984" />
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.4964476" weight="0.3987879" />
<window_info active="true" anchor="bottom" id="Terminal" order="7" visible="true" weight="0.3927273" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24248926" />
<window_info anchor="bottom" id="Version Control" order="7" weight="0.32905984" />
<window_info anchor="bottom" id="Terminal" order="7" weight="0.45560408" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2814516" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32905984" />
<window_info anchor="right" id="SciView" order="4" />
<window_info anchor="right" id="Theme Preview" order="3" />
<window_info id="Favorites" order="3" side_tool="true" />
<window_info anchor="right" id="Flutter Inspector" order="4" />
<window_info anchor="bottom" id="DB Execution Console" order="8" />
<window_info anchor="right" id="Coverage" order="3" side_tool="true" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info id="DB Browser" order="2" weight="0.32998413" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32905984" />
<window_info anchor="bottom" id="Messages" order="7" weight="0.33478895" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="right" id="Data View" order="4" />
<window_info anchor="bottom" id="Message" order="0" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -1022,7 +1083,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<MESSAGE value="Deprecated `ResponseContext.io`, added HTTP equivalent" />
<MESSAGE value="Removed `HttpHeaders` in `ResponseContext`" />
<MESSAGE value="Deprecated AngelMetrics" />
<MESSAGE value="Export HTTP Req+Res context" />
@ -1047,7 +1107,8 @@
<MESSAGE value="Fix async bugs" />
<MESSAGE value="Fix hooking bug" />
<MESSAGE value="+5" />
<option name="LAST_COMMIT_MESSAGE" value="+5" />
<MESSAGE value="+6" />
<option name="LAST_COMMIT_MESSAGE" value="+6" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -1138,13 +1199,6 @@
<entry file="file://$PROJECT_DIR$/tool/travis.sh">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="18" column="26" selection-start-line="18" selection-start-column="26" selection-end-line="18" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/json_god-2.0.0-beta+1/lib/src/validation.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="96">
@ -1159,13 +1213,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="400">
<caret line="29" column="33" selection-start-line="29" selection-start-column="33" selection-end-line="29" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="168">
@ -1180,13 +1227,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="403">
<caret line="128" column="27" selection-start-line="128" selection-start-column="27" selection-end-line="128" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="130">
@ -1245,13 +1285,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="293">
<caret line="154" column="25" lean-forward="true" selection-start-line="154" selection-start-column="25" selection-end-line="154" selection-end-column="25" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_route-2.0.7/lib/src/router.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="236">
@ -1263,16 +1296,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="325">
<caret line="145" column="66" selection-start-line="145" selection-start-column="66" selection-end-line="145" selection-end-column="66" />
<folding>
<element signature="e#40#60#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/map_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="146">
<caret line="100" column="43" selection-start-line="100" selection-start-column="43" selection-end-line="100" selection-end-column="43" />
</state>
</provider>
</entry>
@ -1290,13 +1313,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/response_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="146">
<caret line="204" column="44" selection-start-line="204" selection-start-column="44" selection-end-line="204" selection-end-column="44" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/controller_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360">
@ -1346,23 +1362,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="16">
<caret line="1" column="53" selection-start-line="1" selection-start-column="53" selection-end-line="1" selection-end-column="53" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="15" column="24" lean-forward="true" selection-start-line="15" selection-start-column="24" selection-end-line="15" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/typed_service_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="109">
@ -1384,17 +1383,79 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/injection.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="235">
<caret line="143" lean-forward="true" selection-start-line="143" selection-end-line="143" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
<caret line="11" column="25" selection-start-line="11" selection-start-column="25" selection-end-line="11" selection-end-column="25" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="18" column="26" selection-start-line="18" selection-start-column="26" selection-end-line="18" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2320">
<caret line="154" column="25" selection-start-line="154" selection-start-column="25" selection-end-line="154" selection-end-column="25" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="206">
<caret line="319" column="20" lean-forward="true" selection-start-line="319" selection-start-column="20" selection-end-line="319" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/map_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="133" column="36" selection-start-line="133" selection-start-column="36" selection-end-line="133" selection-end-column="36" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="58">
<caret line="121" lean-forward="true" selection-start-line="121" selection-end-line="121" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="48">
<caret line="3" column="43" selection-start-line="3" selection-start-column="43" selection-end-line="3" selection-end-column="43" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/parameter_meta_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-504">
<state relative-caret-position="32">
<caret line="2" column="54" selection-start-line="2" selection-start-column="54" selection-end-line="2" selection-end-column="54" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/injection.dart">
<entry file="file://$PROJECT_DIR$/lib/src/core/response_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="283">
<caret line="146" column="58" selection-start-line="146" selection-start-column="58" selection-end-line="146" selection-end-column="58" />
<state relative-caret-position="437">
<caret line="50" column="75" selection-start-line="50" selection-start-column="75" selection-end-line="50" selection-end-column="75" />
<folding>
<element signature="e#48#68#0" expanded="true" />
</folding>
</state>
</provider>
</entry>

View file

@ -1,3 +1,8 @@
# 1.1.4+7
* Remove `cast` for Dart 1.x.
* `RequestContext.injections` is no longer cached or read-only.
* `ResponseContext` now has `renderParams`.
# 1.1.4+6
* Almost 100% working with `2.0.0-dev.64.1`. In said version
of Dart, `dart:mirrors` is broken, and therefore breaks detection of metadata.

View file

@ -85,7 +85,7 @@ class MapService extends Service {
..[autoSnakeCaseNames == false ? 'createdAt' : 'created_at'] = now
..[autoSnakeCaseNames == false ? 'updatedAt' : 'updated_at'] = now;
}
items.add(result.cast<String, dynamic>());
items.add(result as Map<String, dynamic>);
return new Future.value(result);
}
@ -130,7 +130,7 @@ class MapService extends Service {
..[autoSnakeCaseNames == false ? 'updatedAt' : 'updated_at'] =
new DateTime.now().toIso8601String();
}
items.add(result.cast<String, dynamic>());
items.add(result as Map<String, dynamic>);
return new Future.value(result);
});
}

View file

@ -38,10 +38,9 @@ abstract class RequestContext {
String get hostname;
final Map _injections = {};
Map _injectionsCache;
/// A [Map] of singletons injected via [inject]. *Read-only*.
Map get injections => _injectionsCache ??= new Map.unmodifiable(_injections);
/// A [Map] of singletons injected via [inject].
Map get injections => _injections;
/// This feature does not map to other adapters (i.e. HTTP/2), so it will be removed in a future version.
@deprecated
@ -173,7 +172,6 @@ abstract class RequestContext {
}
_injections[type] = value;
_injectionsCache = null;
}
/// Returns `true` if the client's `Accept` header indicates that the given [contentType] is considered a valid response.

View file

@ -46,6 +46,11 @@ abstract class ResponseContext implements StreamSink<List<int>>, StringSink {
/// At most one encoder will ever be used to convert data.
final Map<String, Converter<List<int>, List<int>>> encoders = {};
/// A [Map] of data to inject when `res.render` is called.
///
/// This can be used to reduce boilerplate when using templating engines.
final Map renderParams = {};
/// Points to the [RequestContext] corresponding to this response.
RequestContext get correspondingRequest;
@ -200,7 +205,7 @@ abstract class ResponseContext implements StreamSink<List<int>>, StringSink {
/// Renders a view to the response stream, and closes the response.
Future render(String view, [Map data]) {
if (!isOpen) throw closed();
return app.viewGenerator(view, data).then((content) {
return app.viewGenerator(view, new Map.from(renderParams)..addAll(data ?? {})).then((content) {
write(content);
headers['content-type'] = 'text/html';
end();
@ -260,7 +265,7 @@ abstract class ResponseContext implements StreamSink<List<int>>, StringSink {
Route matched = _findRoute(app);
if (matched != null) {
redirect(matched.makeUri(params.cast<String, dynamic>()), code: code);
redirect(matched.makeUri(params as Map<String, dynamic>), code: code);
return;
}
@ -292,7 +297,7 @@ abstract class ResponseContext implements StreamSink<List<int>>, StringSink {
final head =
controller.findExpose().path.toString().replaceAll(_straySlashes, '');
final tail = matched
.makeUri(params.cast<String, dynamic>())
.makeUri(params as Map<String, dynamic>)
.replaceAll(_straySlashes, '');
redirect('$head/$tail'.replaceAll(_straySlashes, ''), code: code);

View file

@ -1,5 +1,5 @@
name: angel_framework
version: 1.1.4+6
version: 1.1.4+7
description: A high-powered HTTP server with DI, routing and more.
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_framework

View file

@ -72,7 +72,7 @@ main() {
var response = await client.post("$url/todos",
body: god.serialize({"arbitrary": "data"}),
headers: headers.cast<String, String>());
headers: headers as Map<String, String>);
print(response.body);
Map result = god.deserialize(response.body);
expect(result["hello"], equals("hooked world"));

View file

@ -156,7 +156,7 @@ main() {
Map headers = {'Content-Type': 'application/json'};
String postData = json.encode({'it': 'works'});
var response = await client.post("$url/lambda",
headers: headers.cast<String, String>(), body: postData);
headers: headers as Map<String, String>, body: postData);
print('Response: ${response.body}');
expect(json.decode(response.body)['it'], equals('works'));
});

View file

@ -52,7 +52,7 @@ main() {
test('can create data', () async {
String postData = god.serialize({'text': 'Hello, world!'});
var response = await client.post("$url/todos",
headers: headers.cast<String, String>(), body: postData);
headers: headers as Map<String, String>, body: postData);
expect(response.statusCode, 201);
var json = god.deserialize(response.body);
print(json);
@ -62,7 +62,7 @@ main() {
test('can fetch data', () async {
String postData = god.serialize({'text': 'Hello, world!'});
await client.post("$url/todos",
headers: headers.cast<String, String>(), body: postData);
headers: headers as Map<String, String>, body: postData);
var response = await client.get("$url/todos/0");
expect(response.statusCode, 200);
var json = god.deserialize(response.body);
@ -73,10 +73,10 @@ main() {
test('can modify data', () async {
String postData = god.serialize({'text': 'Hello, world!'});
await client.post("$url/todos",
headers: headers.cast<String, String>(), body: postData);
headers: headers as Map<String, String>, body: postData);
postData = god.serialize({'text': 'modified'});
var response = await client.patch("$url/todos/0",
headers: headers.cast<String, String>(), body: postData);
headers: headers as Map<String, String>, body: postData);
expect(response.statusCode, 200);
var json = god.deserialize(response.body);
print(json);
@ -86,10 +86,10 @@ main() {
test('can overwrite data', () async {
String postData = god.serialize({'text': 'Hello, world!'});
await client.post("$url/todos",
headers: headers.cast<String, String>(), body: postData);
headers: headers as Map<String, String>, body: postData);
postData = god.serialize({'over': 'write'});
var response = await client.post("$url/todos/0",
headers: headers.cast<String, String>(), body: postData);
headers: headers as Map<String, String>, body: postData);
expect(response.statusCode, 200);
var json = god.deserialize(response.body);
print(json);
@ -101,7 +101,7 @@ main() {
String postData = god.serialize({'text': 'Hello, world!'});
var created = await client
.post("$url/todos",
headers: headers.cast<String, String>(), body: postData)
headers: headers as Map<String, String>, body: postData)
.then((r) => json.decode(r.body));
var response = await client.delete("$url/todos/${created['id']}");
expect(response.statusCode, 200);