@@ -50,6 +50,7 @@ const models: TsoaRoute.Models = {
5050 "SaveFileRequest" : {
5151 "properties" : {
5252 "path" : { "dataType" : "string" , "required" : true } ,
53+ "name" : { "dataType" : "string" , "required" : true } ,
5354 "content" : { "dataType" : "string" , "required" : true } ,
5455 } ,
5556 } ,
@@ -322,10 +323,10 @@ export function RegisterRoutes(app: express.Express) {
322323 const promise = controller . getStorage . apply ( controller , validatedArgs as any ) ;
323324 promiseHandler ( controller , promise , response , next ) ;
324325 } ) ;
325- app . get ( '/contract/abi' ,
326+ app . post ( '/contract/abi' ,
326327 function ( request : any , response : any , next : any ) {
327328 const args = {
328- source : { "in" : "query " , "name" : "source" , "required" : true , "dataType " : "string " } ,
329+ source : { "in" : "body " , "name" : "source" , "required" : true , "ref " : "StringBodyRequest " } ,
329330 name : { "in" : "query" , "name" : "name" , "required" : true , "dataType" : "string" } ,
330331 path : { "in" : "query" , "name" : "path" , "required" : true , "dataType" : "string" } ,
331332 } ;
@@ -346,6 +347,30 @@ export function RegisterRoutes(app: express.Express) {
346347 const promise = controller . getAbi . apply ( controller , validatedArgs as any ) ;
347348 promiseHandler ( controller , promise , response , next ) ;
348349 } ) ;
350+ app . post ( '/contract/functions' ,
351+ function ( request : any , response : any , next : any ) {
352+ const args = {
353+ source : { "in" : "body" , "name" : "source" , "required" : true , "ref" : "StringBodyRequest" } ,
354+ name : { "in" : "query" , "name" : "name" , "required" : true , "dataType" : "string" } ,
355+ path : { "in" : "query" , "name" : "path" , "required" : true , "dataType" : "string" } ,
356+ } ;
357+
358+ let validatedArgs : any [ ] = [ ] ;
359+ try {
360+ validatedArgs = getValidatedArgs ( args , request ) ;
361+ } catch ( err ) {
362+ return next ( err ) ;
363+ }
364+
365+ const controller = iocContainer . get < ContractController > ( ContractController ) ;
366+ if ( typeof controller [ 'setStatus' ] === 'function' ) {
367+ ( < any > controller ) . setStatus ( undefined ) ;
368+ }
369+
370+
371+ const promise = controller . getFunctions . apply ( controller , validatedArgs as any ) ;
372+ promiseHandler ( controller , promise , response , next ) ;
373+ } ) ;
349374 app . post ( '/contract/deploy' ,
350375 function ( request : any , response : any , next : any ) {
351376 const args = {
0 commit comments