@@ -44,7 +44,7 @@ api.get("/project", async (c) => {
4444} ) ;
4545
4646api . post ( "/project/run-task" , async ( c ) => {
47- const body = await c . req . json < { task ?: string } > ( ) . catch ( ( ) => ( { } ) ) ;
47+ const body : { task ?: string } = await c . req . json < { task ?: string } > ( ) . catch ( ( ) => ( { } ) ) ;
4848 const task = body . task ;
4949 if ( ! task || ! / ^ [ A - Z a - z 0 - 9 _ - ] + $ / . test ( task ) ) {
5050 return c . json ( { error : "invalid task name" } , 400 ) ;
@@ -60,7 +60,7 @@ api.post("/project/run-task", async (c) => {
6060} ) ;
6161
6262api . post ( "/project/run-lane" , async ( c ) => {
63- const body = await c . req . json < { lane ?: string } > ( ) . catch ( ( ) => ( { } ) ) ;
63+ const body : { lane ?: string } = await c . req . json < { lane ?: string } > ( ) . catch ( ( ) => ( { } ) ) ;
6464 const lane = body . lane ;
6565 if ( ! lane || ! / ^ [ A - Z a - z 0 - 9 _ - ] + $ / . test ( lane ) ) {
6666 return c . json ( { error : "invalid lane name" } , 400 ) ;
@@ -103,7 +103,10 @@ api.get("/plugins/search", async (c) => {
103103} ) ;
104104
105105api . post ( "/plugins/install" , async ( c ) => {
106- const body = await c . req . json < { source ?: string ; force ?: boolean } > ( ) . catch ( ( ) => ( { } ) ) ;
106+ const body : { source ?: string ; force ?: boolean } = await c
107+ . req
108+ . json < { source ?: string ; force ?: boolean } > ( )
109+ . catch ( ( ) => ( { } ) ) ;
107110 if ( ! body . source ) return c . json ( { error : "source required" } , 400 ) ;
108111 // --yes is required because FLEDGE_NON_INTERACTIVE is set in the env and
109112 // install would otherwise bail on the trust-prompt.
@@ -119,7 +122,7 @@ api.post("/plugins/install", async (c) => {
119122} ) ;
120123
121124api . post ( "/plugins/remove" , async ( c ) => {
122- const body = await c . req . json < { name ?: string } > ( ) . catch ( ( ) => ( { } ) ) ;
125+ const body : { name ?: string } = await c . req . json < { name ?: string } > ( ) . catch ( ( ) => ( { } ) ) ;
123126 if ( ! body . name ) return c . json ( { error : "name required" } , 400 ) ;
124127 const result = await fledge ( [ "plugins" , "remove" , body . name , "--json" ] ) ;
125128 return c . json ( {
@@ -131,7 +134,7 @@ api.post("/plugins/remove", async (c) => {
131134} ) ;
132135
133136api . post ( "/plugins/update" , async ( c ) => {
134- const body = await c . req . json < { name ?: string } > ( ) . catch ( ( ) => ( { } ) ) ;
137+ const body : { name ?: string } = await c . req . json < { name ?: string } > ( ) . catch ( ( ) => ( { } ) ) ;
135138 const args = [ "plugins" , "update" ] ;
136139 if ( body . name ) args . push ( body . name ) ;
137140 args . push ( "--json" ) ;
0 commit comments