| 1 | import type * as sfn from "@distilled.cloud/aws/sfn"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Activity } from "./Activity.ts"; |
| 5 | |
| 6 | export interface SendTaskSuccessRequest extends sfn.SendTaskSuccessInput {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `states:SendTaskSuccess`. |
| 10 | * |
| 11 | * Completes a callback-pattern task (`.waitForTaskToken`) or an |
| 12 | * {@link Activity} task successfully. Bind without arguments for task |
| 13 | * tokens issued by service-integration Task states (IAM cannot scope |
| 14 | * those), or pass an `Activity` to scope access to its tasks. |
| 15 | * ### Callback Pattern |
| 16 | * **Example:** Complete a waiting task |
| 17 | * ```typescript |
| 18 | * const sendTaskSuccess = yield* StepFunctions.SendTaskSuccess(); |
| 19 | * |
| 20 | * yield* sendTaskSuccess({ |
| 21 | * taskToken: token, |
| 22 | * output: JSON.stringify({ approved: true }), |
| 23 | * }); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface SendTaskSuccess extends Binding.Service< |
| 29 | SendTaskSuccess, |
| 30 | "AWS.StepFunctions.SendTaskSuccess", |
| 31 | ( |
| 32 | activity?: Activity, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request: SendTaskSuccessRequest, |
| 36 | ) => Effect.Effect<sfn.SendTaskSuccessOutput, sfn.SendTaskSuccessError> |
| 37 | > |
| 38 | > {} |
| 39 | export const SendTaskSuccess = Binding.Service<SendTaskSuccess>( |
| 40 | "AWS.StepFunctions.SendTaskSuccess", |
| 41 | ); |