77using Microsoft . Extensions . DependencyInjection ;
88using TypeCache . Web . Filters ;
99using TypeCache . Web . Handlers ;
10+ using static Microsoft . AspNetCore . Http . StatusCodes ;
1011using static System . Net . Mime . MediaTypeNames ;
1112
1213namespace TypeCache . Web . Extensions ;
@@ -24,14 +25,14 @@ public static partial class EndpointRouteBuilderExtensions
2425 /// Maps endpoints that execute SQL commands either atomically or in a single local transaction.<br/>
2526 /// These calls are all POSTs for webhook compatibility. Do <b>NOT</b> expose these publicly.
2627 /// <code>
27- /// POST /api/execute/{dataSource }/{database}/{schema}/{procedure}<br/>
28- /// POST /api/delete/{dataSource }/{database}/{schema}/{table}<br/>
29- /// POST /api/delete-values/{dataSource }/{database}/{schema}/{table}<br/>
30- /// POST /api/insert/{dataSource }/{database}/{schema}/{table}<br/>
31- /// POST /api/insert-values/{dataSource }/{database}/{schema}/{table}<br/>
32- /// POST /api/select/{dataSource }/{database}/{schema}/{table}<br/>
33- /// POST /api/update/{dataSource }/{database}/{schema}/{table}<br/>
34- /// POST /api/update-values/{dataSource }/{database}/{schema}/{table}<br/>
28+ /// POST /api/execute/{source }/{database}/{schema}/{procedure}<br/>
29+ /// POST /api/delete/{source }/{database}/{schema}/{table}<br/>
30+ /// POST /api/delete-values/{source }/{database}/{schema}/{table}<br/>
31+ /// POST /api/insert/{source }/{database}/{schema}/{table}<br/>
32+ /// POST /api/insert-values/{source }/{database}/{schema}/{table}<br/>
33+ /// POST /api/select/{source }/{database}/{schema}/{table}<br/>
34+ /// POST /api/update/{source }/{database}/{schema}/{table}<br/>
35+ /// POST /api/update-values/{source }/{database}/{schema}/{table}<br/>
3536 /// </code>
3637 /// </summary>
3738 public static RouteGroupBuilder MapSqlApi ( this IEndpointRouteBuilder @this , string route = Route . API )
@@ -55,7 +56,7 @@ public static RouteGroupBuilder MapSqlApi(this IEndpointRouteBuilder @this, stri
5556 }
5657
5758 /// <summary>
58- /// <c>POST /api/execute/{dataSource }/{database}/{schema}/{procedure}</c><br/><br/>
59+ /// <c>POST /api/execute/{source }/{database}/{schema}/{procedure}</c><br/><br/>
5960 /// <i><b>Requires calls to:</b></i>
6061 /// <code>
6162 /// MapGroup("/api")<br/>
@@ -70,12 +71,12 @@ public static RouteHandlerBuilder MapSqlApiExecuteProcedure(this IEndpointRouteB
7071 . WithDescription ( "Executes a stored procedure returning any result(s)." )
7172 . WithHttpLogging ( HTTP_LOGGING )
7273 . AddEndpointFilter < SqlApiProcedureEndpointFilter > ( )
73- . Produces ( StatusCodes . Status200OK , contentType : Application . Json )
74- . Produces ( StatusCodes . Status204NoContent )
75- . Produces ( StatusCodes . Status404NotFound , contentType : Text . Plain ) ;
74+ . Produces ( Status200OK , contentType : Application . Json )
75+ . Produces ( Status204NoContent )
76+ . Produces ( Status404NotFound , contentType : Text . Plain ) ;
7677
7778 /// <summary>
78- /// <c>POST /api/delete/{dataSource }/{database}/{schema}/{table}</c><br/><br/>
79+ /// <c>POST /api/delete/{source }/{database}/{schema}/{table}</c><br/><br/>
7980 /// <i><b>Requires calls to:</b></i>
8081 /// <code>
8182 /// MapGroup("/api")<br/>
@@ -90,12 +91,12 @@ public static RouteHandlerBuilder MapSqlApiDelete(this IEndpointRouteBuilder @th
9091 . WithDescription ( "Executes an atomic SQL DELETE command against a table." )
9192 . WithHttpLogging ( HTTP_LOGGING )
9293 . AddEndpointFilter < SqlApiTableEndpointFilter > ( )
93- . Produces ( StatusCodes . Status200OK , contentType : Application . Json )
94- . Produces ( StatusCodes . Status204NoContent )
95- . Produces ( StatusCodes . Status404NotFound , contentType : Text . Plain ) ;
94+ . Produces ( Status200OK , contentType : Application . Json )
95+ . Produces ( Status204NoContent )
96+ . Produces ( Status404NotFound , contentType : Text . Plain ) ;
9697
9798 /// <summary>
98- /// <c>POST /api/delete-values/{dataSource }/{database}/{schema}/{table}</c><br/><br/>
99+ /// <c>POST /api/delete-values/{source }/{database}/{schema}/{table}</c><br/><br/>
99100 /// Body is an array of data whose property names match the primary keys of the table to delete from.<br/><br/>
100101 /// <i><b>Requires calls to:</b></i>
101102 /// <code>
@@ -111,12 +112,12 @@ public static RouteHandlerBuilder MapSqlApiDeleteValues(this IEndpointRouteBuild
111112 . WithDescription ( "Executes a batch of SQL DELETE commands against a table." )
112113 . WithHttpLogging ( HTTP_LOGGING )
113114 . AddEndpointFilter < SqlApiTableEndpointFilter > ( )
114- . Produces ( StatusCodes . Status200OK , contentType : Application . Json )
115- . Produces ( StatusCodes . Status204NoContent )
116- . Produces ( StatusCodes . Status404NotFound , contentType : Text . Plain ) ;
115+ . Produces ( Status200OK , contentType : Application . Json )
116+ . Produces ( Status204NoContent )
117+ . Produces ( Status404NotFound , contentType : Text . Plain ) ;
117118
118119 /// <summary>
119- /// <c>POST /api/insert/{dataSource }/{database}/{schema}/{table}</c><br/><br/>
120+ /// <c>POST /api/insert/{source }/{database}/{schema}/{table}</c><br/><br/>
120121 /// <i><b>Requires calls to:</b></i>
121122 /// <code>
122123 /// MapGroup("/api")<br/>
@@ -131,12 +132,12 @@ public static RouteHandlerBuilder MapSqlApiInsert(this IEndpointRouteBuilder @th
131132 . WithDescription ( "Executes an atomic SQL INSERT command against a table." )
132133 . WithHttpLogging ( HTTP_LOGGING )
133134 . AddEndpointFilter < SqlApiTableEndpointFilter > ( )
134- . Produces ( StatusCodes . Status200OK , contentType : Application . Json )
135- . Produces ( StatusCodes . Status204NoContent )
136- . Produces ( StatusCodes . Status404NotFound , contentType : Text . Plain ) ;
135+ . Produces ( Status200OK , contentType : Application . Json )
136+ . Produces ( Status204NoContent )
137+ . Produces ( Status404NotFound , contentType : Text . Plain ) ;
137138
138139 /// <summary>
139- /// <c>POST /api/insert-values/{dataSource }/{database}/{schema}/{table}</c><br/><br/>
140+ /// <c>POST /api/insert-values/{source }/{database}/{schema}/{table}</c><br/><br/>
140141 /// Body is an array of data whose property names match the primary keys of the table to delete from.<br/><br/>
141142 /// <i><b>Requires calls to:</b></i>
142143 /// <code>
@@ -152,12 +153,12 @@ public static RouteHandlerBuilder MapSqlApiInsertValues(this IEndpointRouteBuild
152153 . WithDescription ( "Executes batch of SQL INSERT commands against a table." )
153154 . WithHttpLogging ( HTTP_LOGGING )
154155 . AddEndpointFilter < SqlApiTableEndpointFilter > ( )
155- . Produces ( StatusCodes . Status200OK , contentType : Application . Json )
156- . Produces ( StatusCodes . Status204NoContent )
157- . Produces ( StatusCodes . Status404NotFound , contentType : Text . Plain ) ;
156+ . Produces ( Status200OK , contentType : Application . Json )
157+ . Produces ( Status204NoContent )
158+ . Produces ( Status404NotFound , contentType : Text . Plain ) ;
158159
159160 /// <summary>
160- /// <c>POST /api/select/{dataSource }/{database}/{schema}/{table}</c><br/><br/>
161+ /// <c>POST /api/select/{source }/{database}/{schema}/{table}</c><br/><br/>
161162 /// Selects, filters, sorts and pages data from a view.<br/><br/>
162163 /// <i><b>Requires calls to:</b></i>
163164 /// <code>
@@ -173,12 +174,12 @@ public static RouteHandlerBuilder MapSqlApiSelect(this IEndpointRouteBuilder @th
173174 . WithDescription ( "Retrieves data from a table or view via a SELECT SQL command." )
174175 . WithHttpLogging ( HTTP_LOGGING )
175176 . AddEndpointFilter < SqlApiTableEndpointFilter > ( )
176- . Produces ( StatusCodes . Status200OK , contentType : Application . Json )
177- . Produces ( StatusCodes . Status204NoContent )
178- . Produces ( StatusCodes . Status404NotFound , contentType : Text . Plain ) ;
177+ . Produces ( Status200OK , contentType : Application . Json )
178+ . Produces ( Status204NoContent )
179+ . Produces ( Status404NotFound , contentType : Text . Plain ) ;
179180
180181 /// <summary>
181- /// <c>POST /api/update/{dataSource }/{database}/{schema}/{table}</c><br/><br/>
182+ /// <c>POST /api/update/{source }/{database}/{schema}/{table}</c><br/><br/>
182183 /// Updates table data.<br/><br/>
183184 /// <i><b>Requires calls to:</b></i>
184185 /// <code>
@@ -194,12 +195,12 @@ public static RouteHandlerBuilder MapSqlApiUpdate(this IEndpointRouteBuilder @th
194195 . WithDescription ( "Executes an atomic SQL UPDATE command against a table." )
195196 . WithHttpLogging ( HTTP_LOGGING )
196197 . AddEndpointFilter < SqlApiTableEndpointFilter > ( )
197- . Produces ( StatusCodes . Status200OK , contentType : Application . Json )
198- . Produces ( StatusCodes . Status204NoContent )
199- . Produces ( StatusCodes . Status404NotFound , contentType : Text . Plain ) ;
198+ . Produces ( Status200OK , contentType : Application . Json )
199+ . Produces ( Status204NoContent )
200+ . Produces ( Status404NotFound , contentType : Text . Plain ) ;
200201
201202 /// <summary>
202- /// <c>POST /api/update-values/{dataSource }/{database}/{schema}/{table}</c><br/><br/>
203+ /// <c>POST /api/update-values/{source }/{database}/{schema}/{table}</c><br/><br/>
203204 /// Updates table data.<br/><br/>
204205 /// Body is an array of data that contains values to update in the table.<br/><br/>
205206 /// <i><b>Requires calls to:</b></i>
@@ -216,7 +217,7 @@ public static RouteHandlerBuilder MapSqlApiUpdateValues(this IEndpointRouteBuild
216217 . WithDescription ( "Executes an atomic SQL UPDATE command against a table." )
217218 . WithHttpLogging ( HTTP_LOGGING )
218219 . AddEndpointFilter < SqlApiTableEndpointFilter > ( )
219- . Produces ( StatusCodes . Status200OK , contentType : Application . Json )
220- . Produces ( StatusCodes . Status204NoContent )
221- . Produces ( StatusCodes . Status404NotFound , contentType : Text . Plain ) ;
220+ . Produces ( Status200OK , contentType : Application . Json )
221+ . Produces ( Status204NoContent )
222+ . Produces ( Status404NotFound , contentType : Text . Plain ) ;
222223}
0 commit comments