Skip to content

Commit

Permalink
feat: add appaction.call to types (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitelisab authored Sep 3, 2024
1 parent 4423a7d commit 7ea547d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/requests/typings/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const GRAPHQL_QUERY_EVENT = 'graphql.query'
const APP_EVENT_FILTER = 'appevent.filter'
const APP_EVENT_HANDLER = 'appevent.handler'
const APP_EVENT_TRANSFORMATION = 'appevent.transformation'
const APP_ACTION_CALL = 'appaction.call'

type GraphQLFieldTypeMappingRequest = {
type: typeof GRAPHQL_FIELD_MAPPING_EVENT
Expand Down Expand Up @@ -157,6 +158,14 @@ export type AppEventTransformationResponse = {

export type AppEventHandlerResponse = void

export type AppActionRequest = {
headers: Record<string, string | number>
body: Record<string, unknown>
type: typeof APP_ACTION_CALL
}

export type AppActionResponse = void | Record<string, unknown>

/**
* P: Possibility to type app installation parameters
*/
Expand All @@ -176,6 +185,10 @@ type FunctionEventHandlers = {
event: GraphQLQueryRequest
response: GraphQLQueryResponse
}
[APP_ACTION_CALL]: {
event: AppActionRequest
response: AppActionResponse
}
[APP_EVENT_FILTER]: {
event: AppEventRequest
response: AppEventFilterResponse
Expand Down

0 comments on commit 7ea547d

Please sign in to comment.