@@ -54,6 +54,7 @@ import {
5454 SlashCommand ,
5555 WorkflowStepEdit ,
5656 SlackOptions ,
57+ FunctionInputs ,
5758} from './types' ;
5859import { IncomingEventType , getTypeAndConversation , assertNever , isBodyWithTypeEnterpriseInstall , isEventTypeToSkipAuthorize } from './helpers' ;
5960import { CodedError , asCodedError , AppInitializationError , MultipleListenerError , ErrorCode , InvalidCustomPropertyError } from './errors' ;
@@ -964,9 +965,12 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed>
964965 retryReason : event . retryReason ,
965966 } ;
966967
967- // Extract function-related information and augment to context
968- const { functionExecutionId, functionBotAccessToken } = extractFunctionContext ( body ) ;
969- if ( functionExecutionId ) { context . functionExecutionId = functionExecutionId ; }
968+ // Extract function-related information and augment context
969+ const { functionExecutionId, functionBotAccessToken, functionInputs } = extractFunctionContext ( body ) ;
970+ if ( functionExecutionId ) {
971+ context . functionExecutionId = functionExecutionId ;
972+ if ( functionInputs ) { context . functionInputs = functionInputs ; }
973+ }
970974
971975 if ( this . attachFunctionToken ) {
972976 if ( functionBotAccessToken ) { context . functionBotAccessToken = functionBotAccessToken ; }
@@ -1029,6 +1033,7 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed>
10291033 ack ?: AckFn < any > ;
10301034 complete ?: FunctionCompleteFn ;
10311035 fail ?: FunctionFailFn ;
1036+ inputs ?: FunctionInputs ;
10321037 } = {
10331038 body : bodyArg ,
10341039 payload,
@@ -1088,6 +1093,7 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed>
10881093 if ( type === IncomingEventType . Action && context . functionExecutionId !== undefined ) {
10891094 listenerArgs . complete = CustomFunction . createFunctionComplete ( context , client ) ;
10901095 listenerArgs . fail = CustomFunction . createFunctionFail ( context , client ) ;
1096+ listenerArgs . inputs = context . functionInputs ;
10911097 }
10921098
10931099 if ( token !== undefined ) {
@@ -1599,6 +1605,7 @@ function escapeHtml(input: string | undefined | null): string {
15991605function extractFunctionContext ( body : StringIndexed ) {
16001606 let functionExecutionId ;
16011607 let functionBotAccessToken ;
1608+ let functionInputs ;
16021609
16031610 // function_executed event
16041611 if ( body . event && body . event . type === 'function_executed' && body . event . function_execution_id ) {
@@ -1610,9 +1617,10 @@ function extractFunctionContext(body: StringIndexed) {
16101617 if ( body . function_data ) {
16111618 functionExecutionId = body . function_data . execution_id ;
16121619 functionBotAccessToken = body . bot_access_token ;
1620+ functionInputs = body . function_data . inputs ;
16131621 }
16141622
1615- return { functionExecutionId, functionBotAccessToken } ;
1623+ return { functionExecutionId, functionBotAccessToken, functionInputs } ;
16161624}
16171625
16181626// ----------------------------
0 commit comments