-
Notifications
You must be signed in to change notification settings - Fork 99
feat: add new endpoints for AppActionCall to fetch structured results [EXT-6593] #2722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6c8aa0c
to
bd7f20a
Compare
860720c
to
685f951
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good 🚀
We'll continue to look into the integration test failures related to taxonomies as it seems it's affected master right now too. Otherwise, sounds like a good plan to merge this after the improved app actions are live on prod!
685f951
to
3d94752
Compare
… and raw responses - Introduced `get` endpoint to retrieve structured AppActionCall details including status and result/error. - Added `getResponse` endpoint to fetch raw response data for completed AppActionCalls. - Implemented `createWithResult` method to create an AppActionCall and poll for its completion. - Updated types and interfaces to support new functionality, including error handling and response structures.
- Added `get` method to retrieve AppActionCall details. - Introduced `createWithResult` method for creating AppActionCalls with immediate results. - Updated type definitions to include new properties for error handling and response structures.
- Added `get` method for retrieving AppActionCall details. - Introduced `createWithResult` method for creating AppActionCalls with immediate results. - Implemented `getResponse` method to fetch raw response data for completed AppActionCalls.
- Added dynamic creation of an AppAction in the `beforeAll` hook for integration tests. - Updated tests to utilize the created AppAction instead of a hardcoded ID. - Ensured cleanup of the created AppAction in the `afterAll` hook.
- Implemented `getAppActionCallResponse` method in the `createEnvironmentApi` to retrieve the raw response (headers/body) for completed App Action Calls. - Updated unit tests to validate the new API call functionality, ensuring correct request parameters and response handling.
3d94752
to
04cbf61
Compare
🎉 This PR is included in version 11.55.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Add structured App Action Call support and a convenient polling-abstracting method:
get
(structured call),getResponse
(raw response),createWithResult
(create + poll).Description
Types
AppActionCallProps
with:status: 'processing' | 'succeeded' | 'failed'
result?: unknown
error?: { sys: { type: 'Error'; id: string }, message: string, details?: Record<string, unknown>, statusCode?: number }
AppActionCallSys
withappActionCallResponse?: SysLink
.AppActionCallRawResponseProps
(raw headers/body envelope).CreateAppActionCallProps.parameters
to{ [key: string]: unknown }
.REST adapter (
lib/adapters/REST/endpoints/app-action-call.ts
)get
: GET new route (includes app installation id) returning structuredAppActionCall
:/spaces/{spaceId}/environments/{environmentId}/app_installations/{appDefinitionId}/actions/{appActionId}/calls/{callId}
getResponse
: GET raw response for a call:/spaces/{spaceId}/environments/{environmentId}/app_installations/{appDefinitionId}/actions/{appActionId}/calls/{callId}/response
createWithResult
: POST create + pollget
until terminal status, returning completedAppActionCall
.retries
/retryInterval
.Common types (
lib/common-types.ts
)GetAppActionCallParamsWithId
(new route includescallId
).CreateWithResponseParams
with optionalretries
andretryInterval
.MRActions
/MRInternal
overloads for:AppActionCall.get
,AppActionCall.getResponse
,AppActionCall.createWithResult
.Plain client (
lib/plain/entities/app-action-call.ts
,lib/plain/plain-client.ts
)get(params): Promise<AppActionCallProps>
createWithResult(params, payload): Promise<AppActionCallProps>
getResponse(params): Promise<AppActionCallRawResponseProps>
create
,getCallDetails
,createWithResponse
remain available.Default client
lib/entities/app-action-call.ts
)get(): Promise<AppActionCallProps>
createWithResult(): Promise<AppActionCallProps>
createWithResponse()
andgetCallDetails()
remain available.lib/create-environment-api.ts
)getAppActionCallResponse(appDefinitionId, appActionId, callId): Promise<AppActionCallRawResponseProps>
makeRequest({ entityType: 'AppActionCall', action: 'getResponse', ... })
.Exports (
lib/export-types.ts
)AppActionCallErrorProps
AppActionCallRawResponseProps
AppActionCallStatus
Tests
get
,getResponse
) and pollinggetAppActionCallResponse
calls correct endpointtest/integration/app-action-call-structured-integration.test.ts
)get
to handle eventual consistencyAppSigningSecret
and creates anAppAction
to satisfy backend requirementsMotivation and Context
This change provides a simple, predictable way for developers and Automations/Workflows to invoke App Actions and work with structured outcomes without manual polling, and to retrieve the raw executor response when needed.
Checklist (check all before merging)
doc-app
(separate PR to be opened)When adding a new method:
get
,createWithResult
,getResponse
get
,createWithResult
getAppActionCallResponse
./lib/export-types.ts
AppActionCallRawResponseProps
,AppActionCallErrorProps
,AppActionCallStatus
doc-app
; to be merged separately