@@ -488,6 +488,22 @@ export default class MicroserviceType {
488488 requirements [ 'snsPublish' ] = true ;
489489 return ` ${ conditionCode || '' } await snsPublish(${ this . stringifyForHook ( config [ 'topic' ] , options ) } , ${ args ? ( Array . isArray ( args ) ? ( < any > args ) . join ( ', ' ) : args ) : '{}' } );`
490490 }
491+ if ( '%message' === type ) {
492+ requirements [ 'message' ] = true ;
493+ switch ( options [ 'position' ] ) {
494+ case 'before' : return ` ${ conditionCode || '' } await message(${ this . stringifyForHook ( config [ 'topic' ] , options ) } , ${ args ? ( Array . isArray ( args ) ? ( < any > args ) . join ( ', ' ) : args ) : '{}' } , undefined, query);` ;
495+ case 'after' : return ` ${ conditionCode || '' } await message(${ this . stringifyForHook ( config [ 'topic' ] , options ) } , ${ args ? ( Array . isArray ( args ) ? ( < any > args ) . join ( ', ' ) : args ) : '{}' } , result, query);` ;
496+ default : return undefined ;
497+ }
498+ }
499+ if ( '%message:' === type . slice ( 0 , 9 ) ) {
500+ requirements [ 'message' ] = true ;
501+ switch ( options [ 'position' ] ) {
502+ case 'before' : return ` ${ conditionCode || '' } await message(${ this . stringifyForHook ( type . slice ( 9 ) , options ) } , ${ args ? ( Array . isArray ( args ) ? ( < any > args ) . join ( ', ' ) : args ) : '{}' } , undefined, query);` ;
503+ case 'after' : return ` ${ conditionCode || '' } await message(${ this . stringifyForHook ( type . slice ( 9 ) , options ) } , ${ args ? ( Array . isArray ( args ) ? ( < any > args ) . join ( ', ' ) : args ) : '{}' } , result, query);` ;
504+ default : return undefined ;
505+ }
506+ }
491507 if ( '%event' === type ) {
492508 requirements [ 'event' ] = true ;
493509 return ` ${ conditionCode || '' } await event(${ this . stringifyForHook ( config [ 'name' ] || options [ 'operationName' ] , options ) } , result, query);`
0 commit comments