feat: Step Function + hardning
This commit is contained in:
@@ -234,6 +234,27 @@ export interface PublishNotificationResult {
|
||||
messageId: string | null;
|
||||
}
|
||||
|
||||
export interface WorkflowExecutionSummary {
|
||||
executionArn: string;
|
||||
name: string;
|
||||
status: string;
|
||||
startDate: string;
|
||||
stopDate?: string;
|
||||
}
|
||||
|
||||
export interface WorkflowExecutionDetail extends WorkflowExecutionSummary {
|
||||
stateMachineArn: string;
|
||||
input?: string;
|
||||
output?: string;
|
||||
error?: string;
|
||||
cause?: string;
|
||||
}
|
||||
|
||||
export interface WorkflowExecutionHistoryPage {
|
||||
events: Array<Record<string, unknown>>;
|
||||
nextToken?: string;
|
||||
}
|
||||
|
||||
export interface CreateApiGatewayLambdaRouteInput {
|
||||
path: string;
|
||||
method: string;
|
||||
@@ -768,6 +789,53 @@ export async function invokeCloudResource(
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function startWorkflowExecution(
|
||||
stateMachineArn: string,
|
||||
input: {input: string; name?: string},
|
||||
): Promise<{executionArn: string; startDate: string}> {
|
||||
const res = await apiClient.call<{executionArn: string; startDate: string}, {input: string; name?: string}>(
|
||||
apiEndpointKeys.clouds.resources.startWorkflowExecution,
|
||||
requestOptions("aws", "workflows", {body: input}),
|
||||
{cloud: "aws", id: stateMachineArn},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function listWorkflowExecutions(stateMachineArn: string, signal?: AbortSignal): Promise<WorkflowExecutionSummary[]> {
|
||||
const res = await apiClient.call<WorkflowExecutionSummary[]>(
|
||||
apiEndpointKeys.clouds.resources.listWorkflowExecutions,
|
||||
requestOptions("aws", "workflows", {signal}),
|
||||
{cloud: "aws", id: stateMachineArn},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function describeWorkflowExecution(stateMachineArn: string, executionArn: string, signal?: AbortSignal): Promise<WorkflowExecutionDetail> {
|
||||
const res = await apiClient.call<WorkflowExecutionDetail>(
|
||||
apiEndpointKeys.clouds.resources.describeWorkflowExecution,
|
||||
requestOptions("aws", "workflows", {signal}),
|
||||
{cloud: "aws", id: stateMachineArn, executionArn},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function getWorkflowExecutionHistory(stateMachineArn: string, executionArn: string, nextToken?: string, signal?: AbortSignal): Promise<WorkflowExecutionHistoryPage> {
|
||||
const res = await apiClient.call<WorkflowExecutionHistoryPage>(
|
||||
apiEndpointKeys.clouds.resources.getWorkflowExecutionHistory,
|
||||
requestOptions("aws", "workflows", {signal, params: {nextToken}}),
|
||||
{cloud: "aws", id: stateMachineArn, executionArn},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function stopWorkflowExecution(stateMachineArn: string, executionArn: string): Promise<void> {
|
||||
await apiClient.call<void>(
|
||||
apiEndpointKeys.clouds.resources.stopWorkflowExecution,
|
||||
requestOptions("aws", "workflows"),
|
||||
{cloud: "aws", id: stateMachineArn, executionArn},
|
||||
);
|
||||
}
|
||||
|
||||
export async function publishNotification(
|
||||
cloud: CloudProvider,
|
||||
topicArn: string,
|
||||
|
||||
Reference in New Issue
Block a user