Skip to content

Commit c729234

Browse files
author
Sarah Lessner
authored
feat: adds function-invocation to app action type [EXT-5324] (#2423)
* feat: adds function-invocation to app action type [EXT-5324] * adds AppActionType * adds new type to export-types * better comment for appactiontype
1 parent ba137b1 commit c729234

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/entities/app-action.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ type CustomAppActionProps = {
4242
type AppActionCategory = BuiltInCategoriesProps | CustomAppActionProps
4343
export type AppActionCategoryType = AppActionCategory['category']
4444

45+
export type AppActionType = 'endpoint' | 'function' | 'function-invocation'
46+
4547
export type CreateAppActionProps = AppActionCategory & {
4648
url: string
4749
name: string
4850
description?: string
51+
type?: AppActionType
4952
}
5053

5154
export type AppActionProps = AppActionCategory & {
@@ -65,7 +68,13 @@ export type AppActionProps = AppActionCategory & {
6568
* Human readable description of the action
6669
*/
6770
description?: string
68-
type?: 'endpoint' | 'function'
71+
/**
72+
* Type of the action, defaults to endpoint if not provided
73+
* endpoint: action is sent to specified URL
74+
* function: deprecated, use function-invocation instead
75+
* function-invocation: action invokes a contentful function
76+
*/
77+
type?: AppActionType
6978
}
7079

7180
export type AppAction = AppActionProps &

lib/export-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type {
77
AppActionCategoryType,
88
AppActionParameterDefinition,
99
AppActionProps,
10+
AppActionType,
1011
CreateAppActionProps,
1112
} from './entities/app-action'
1213
export type {

0 commit comments

Comments
 (0)