| 1 | import type * as amplify from "@distilled.cloud/aws/amplify"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { App } from "./App.ts"; |
| 5 | |
| 6 | export interface StartDeploymentRequest extends Omit< |
| 7 | amplify.StartDeploymentRequest, |
| 8 | "appId" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `amplify:StartDeployment`. |
| 13 | * |
| 14 | * Bind an {@link App} in the function's init phase to get a callable that |
| 15 | * releases a manual deployment on a branch of an app with no connected |
| 16 | * repository — either a deployment staged with {@link CreateDeployment} |
| 17 | * (`jobId`) or content fetched from a public `sourceUrl` (zip URL or S3 |
| 18 | * prefix). Provide the implementation with |
| 19 | * `Effect.provide(AWS.Amplify.StartDeploymentHttp)`. |
| 20 | * ### Manual Deployments |
| 21 | * **Example:** Release a Staged Deployment |
| 22 | * ```typescript |
| 23 | * // init — bind the operation to the app |
| 24 | * const startDeployment = yield* AWS.Amplify.StartDeployment(app); |
| 25 | * |
| 26 | * // runtime — release the artifact uploaded via CreateDeployment |
| 27 | * const { jobSummary } = yield* startDeployment({ |
| 28 | * branchName: "main", |
| 29 | * jobId, |
| 30 | * }); |
| 31 | * ``` |
| 32 | * |
| 33 | * **Example:** Deploy Directly from an S3 Prefix |
| 34 | * ```typescript |
| 35 | * const { jobSummary } = yield* startDeployment({ |
| 36 | * branchName: "main", |
| 37 | * sourceUrl: "s3://my-site-artifacts/latest/", |
| 38 | * sourceUrlType: "BUCKET_PREFIX", |
| 39 | * }); |
| 40 | * ``` |
| 41 | * |
| 42 | * @binding |
| 43 | */ |
| 44 | export interface StartDeployment extends Binding.Service< |
| 45 | StartDeployment, |
| 46 | "AWS.Amplify.StartDeployment", |
| 47 | ( |
| 48 | app: App, |
| 49 | ) => Effect.Effect< |
| 50 | ( |
| 51 | request: StartDeploymentRequest, |
| 52 | ) => Effect.Effect< |
| 53 | amplify.StartDeploymentResult, |
| 54 | amplify.StartDeploymentError |
| 55 | > |
| 56 | > |
| 57 | > {} |
| 58 | |
| 59 | export const StartDeployment = Binding.Service<StartDeployment>( |
| 60 | "AWS.Amplify.StartDeployment", |
| 61 | ); |