Skip to content

Commit 2a8f022

Browse files
author
Diler Zaza
committed
Reverting changes
1 parent ea965d9 commit 2a8f022

File tree

4 files changed

+54
-67
lines changed

4 files changed

+54
-67
lines changed

packages/core/src/shared/clients/stepFunctions.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,34 @@ import {
77
CreateStateMachineCommand,
88
CreateStateMachineCommandInput,
99
CreateStateMachineCommandOutput,
10+
DescribeExecutionCommand,
11+
DescribeExecutionCommandInput,
12+
DescribeExecutionCommandOutput,
13+
DescribeMapRunCommand,
14+
DescribeMapRunCommandInput,
15+
DescribeMapRunCommandOutput,
1016
DescribeStateMachineCommand,
1117
DescribeStateMachineCommandInput,
1218
DescribeStateMachineCommandOutput,
19+
DescribeStateMachineForExecutionCommand,
20+
DescribeStateMachineForExecutionCommandInput,
21+
DescribeStateMachineForExecutionCommandOutput,
22+
GetExecutionHistoryCommand,
23+
GetExecutionHistoryCommandInput,
24+
GetExecutionHistoryCommandOutput,
1325
ListStateMachinesCommand,
1426
ListStateMachinesCommandInput,
1527
ListStateMachinesCommandOutput,
28+
RedriveExecutionCommand,
29+
RedriveExecutionCommandInput,
30+
RedriveExecutionCommandOutput,
1631
SFNClient,
1732
StartExecutionCommand,
1833
StartExecutionCommandInput,
1934
StartExecutionCommandOutput,
2035
StateMachineListItem,
36+
StopExecutionCommand,
37+
StopExecutionCommandInput,
2138
TestStateCommand,
2239
TestStateCommandInput,
2340
TestStateCommandOutput,
@@ -26,6 +43,7 @@ import {
2643
UpdateStateMachineCommandOutput,
2744
} from '@aws-sdk/client-sfn'
2845
import { ClientWrapper } from './clientWrapper'
46+
import { StopAccessLoggingOutput } from 'aws-sdk/clients/mediastore'
2947
// import { StopExecutionInput } from 'aws-sdk/clients/stepfunctions'
3048

3149
export class StepFunctionsClient extends ClientWrapper<SFNClient> {
@@ -51,10 +69,38 @@ export class StepFunctionsClient extends ClientWrapper<SFNClient> {
5169
return this.makeRequest(DescribeStateMachineCommand, request)
5270
}
5371

72+
public async getStateMachineDetailsForExecution(
73+
request: DescribeStateMachineForExecutionCommandInput
74+
): Promise<DescribeStateMachineForExecutionCommandOutput> {
75+
return this.makeRequest(DescribeStateMachineForExecutionCommand, request)
76+
}
77+
78+
public async getExecutionDetails(request: DescribeExecutionCommandInput): Promise<DescribeExecutionCommandOutput> {
79+
return this.makeRequest(DescribeExecutionCommand, request)
80+
}
81+
82+
public async getMapRunDetails(request: DescribeMapRunCommandInput): Promise<DescribeMapRunCommandOutput> {
83+
return this.makeRequest(DescribeMapRunCommand, request)
84+
}
85+
86+
public async getExecutionHistory(
87+
request: GetExecutionHistoryCommandInput
88+
): Promise<GetExecutionHistoryCommandOutput> {
89+
return this.makeRequest(GetExecutionHistoryCommand, request)
90+
}
91+
92+
public async reDriveExecution(request: RedriveExecutionCommandInput): Promise<RedriveExecutionCommandOutput> {
93+
return this.makeRequest(RedriveExecutionCommand, request)
94+
}
95+
5496
public async executeStateMachine(request: StartExecutionCommandInput): Promise<StartExecutionCommandOutput> {
5597
return this.makeRequest(StartExecutionCommand, request)
5698
}
5799

100+
public async stopExecution(request: StopExecutionCommandInput): Promise<StopAccessLoggingOutput> {
101+
return this.makeRequest(StopExecutionCommand, request)
102+
}
103+
58104
public async createStateMachine(request: CreateStateMachineCommandInput): Promise<CreateStateMachineCommandOutput> {
59105
return this.makeRequest(CreateStateMachineCommand, request)
60106
}

packages/core/src/stepFunctions/executionDetails/executionDetailProvider.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,6 @@ export class ExecutionDetailProvider {
108108
executionArn,
109109
}
110110

111-
// Create execution details context
112-
const context: ExecutionDetailsContext = {
113-
stateMachineName: executionArn.split(':').pop() || 'Unknown',
114-
mode: WorkflowMode.Readonly, // Execution details are typically read-only
115-
panel,
116-
textDocument: {} as vscode.TextDocument, // Not applicable for execution details
117-
disposables: [],
118-
workSpacePath: '',
119-
defaultTemplatePath: '',
120-
defaultTemplateName: '',
121-
fileStates: {},
122-
loaderNotification: undefined,
123-
fileId: executionArn,
124-
executionArn,
125-
}
126-
127111
// Handle messages from the webview
128112
panel.webview.onDidReceiveMessage(async (message) => {
129113
this.logger.debug('Received message from execution details webview: %O', message)

packages/core/src/stepFunctions/executionDetails/handleMessage.ts

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -73,46 +73,3 @@ async function initMessageHandler(context: ExecutionDetailsContext) {
7373
} as InitResponseMessage)
7474
}
7575
}
76-
<<<<<<< HEAD
77-
78-
/**
79-
* Handler for managing webview stage load, which updates load notifications.
80-
* @param context The context object containing the necessary information for the webview.
81-
*/
82-
async function loadStageMessageHandler(context: ExecutionDetailsContext) {
83-
context.loaderNotification?.progress.report({ increment: 25 })
84-
setTimeout(() => {
85-
context.loaderNotification?.resolve()
86-
}, 100)
87-
}
88-
89-
/**
90-
* Handler for making API calls from the webview and returning the response.
91-
* @param request The request message containing the API to call and the parameters
92-
* @param context The webview context used for returning the API response to the webview
93-
*/
94-
function apiCallMessageHandler(request: ApiCallRequestMessage, context: WebviewContext) {
95-
const logger = getLogger('stepfunctions')
96-
const apiHandler = new WorkflowStudioApiHandler(globals.awsContext.getCredentialDefaultRegion(), context)
97-
apiHandler.performApiCall(request).catch((error) => logger.error('%s API call failed: %O', request.apiName, error))
98-
}
99-
100-
/**
101-
* Handles unsupported or unrecognized messages by sending a response to the webview. Ensures compatibility with future
102-
* commands and message types, preventing issues if the user has an outdated extension version.
103-
* @param context The context object containing information about the webview environment
104-
* @param originalMessage The original message that was not supported
105-
*/
106-
async function handleUnsupportedMessage(context: ExecutionDetailsContext, originalMessage: Message) {
107-
const logger = getLogger('stepfunctions')
108-
109-
logger.warn('Received unsupported message: %O', originalMessage)
110-
111-
await context.panel.webview.postMessage({
112-
messageType: MessageType.RESPONSE,
113-
command: Command.UNSUPPORTED_COMMAND,
114-
originalMessage,
115-
} as UnsupportedMessage)
116-
}
117-
=======
118-
>>>>>>> 5aa458d7d (feat(stepfunctions): enable hardcoded execution details page)

packages/core/src/stepFunctions/messageHandlers/stepFunctionApiHandler.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,28 @@ export class stepFunctionApiHandler {
4141
response = await this.testState(params)
4242
break
4343
case ApiAction.SFNDescribeStateMachine:
44-
response = await this.clients.sfn.getStateMachineDetails(params.stateMachineArn)
44+
response = await this.clients.sfn.getStateMachineDetails(params)
4545
break
4646
case ApiAction.SFNDescribeStateMachineForExecution:
47-
response = await this.clients.sfn.getStateMachineDetailsForExecution(params.executionArn)
47+
response = await this.clients.sfn.getStateMachineDetailsForExecution(params)
4848
break
4949
case ApiAction.SFNDescribeExecution:
50-
response = await this.clients.sfn.getExecutionDetails(params.executionArn)
50+
response = await this.clients.sfn.getExecutionDetails(params)
5151
break
5252
case ApiAction.SFNDescribeMapRun:
53-
response = await this.clients.sfn.getMapRunDetails(params.mapRunArn)
53+
response = await this.clients.sfn.getMapRunDetails(params)
5454
break
5555
case ApiAction.SFNGetExecutionHistory:
56-
response = await this.clients.sfn.getExecutionHistory(params.executionArn)
56+
response = await this.clients.sfn.getExecutionHistory(params)
5757
break
5858
case ApiAction.SFNRedriveExecution:
59-
response = await this.clients.sfn.reDriveExecution(params.executionArn)
59+
response = await this.clients.sfn.reDriveExecution(params)
6060
break
6161
case ApiAction.SFNStartExecution:
62-
response = await this.clients.sfn.executeStateMachine(params.stateMachineArn, params.input)
62+
response = await this.clients.sfn.executeStateMachine(params)
6363
break
6464
case ApiAction.SFNStopExecution:
65-
response = await this.clients.sfn.stopExecution(params.executionArn)
65+
response = await this.clients.sfn.stopExecution(params)
6666
break
6767
default:
6868
throw new Error(`Unknown API: ${apiName}`)

0 commit comments

Comments
 (0)