Skip to content

🎥 Make videos programmatically with React

refactor

Jonny Burger309678b49e7c
diff --git a/packages/docs/docs/lambda/getorcreatebucket.md b/packages/docs/docs/lambda/getorcreatebucket.md
index 8a2c3b9327..0e14ca2db8 100644
--- a/packages/docs/docs/lambda/getorcreatebucket.md
+++ b/packages/docs/docs/lambda/getorcreatebucket.md
@@ -11,11 +11,11 @@ Creates a bucket for Remotion Lambda in your S3 account. If one already exists,
```ts twoslash
// @module: ESNext
// @target: ESNext
-import {getOrCreateBucket} from '@remotion/lambda';
+import { getOrCreateBucket } from "@remotion/lambda";
-const {bucketName} = await getOrCreateBucket({region: 'us-east-1'})
+const { bucketName } = await getOrCreateBucket({ region: "us-east-1" });
-console.log(bucketName) // "remtionlambda-32df3p"
+console.log(bucketName); // "remotionlambda-32df3p"
```
## Arguments
@@ -26,6 +26,12 @@ An object with the following property:
The [AWS region](/docs/lambda/region-selection) which you want to create a bucket in.
+### `onBucketEnsured?`
+
+_optional_
+
+Allows to pass a callback after the bucket was created and before the S3 website option was enabled. This option exists so the CLI can better visualize the progress.
+
## Return value
A promise resolving to an object with the following property:
diff --git a/packages/lambda/src/api/delete-function.ts b/packages/lambda/src/api/delete-function.ts
index edd82f3a90..be51646196 100644
--- a/packages/lambda/src/api/delete-function.ts
+++ b/packages/lambda/src/api/delete-function.ts
@@ -2,20 +2,22 @@ import {DeleteFunctionCommand} from '@aws-sdk/client-lambda';
import {AwsRegion} from '../pricing/aws-regions';
import {getLambdaClient} from '../shared/aws-clients';
+export type DeleteFunctionInput = {
+ region: AwsRegion;
+ functionName: string;
+};
+
/**
* @description Deletes a function from AWS Lambda.
* @link https://remotion-3.vercel.app/docs/lambda/deletefunction
* @param options.region The region the function was deployed to.
* @param options.functionName The name of the function.
- * @returns Nothing. Throws if the function failed to delete.
+ * @returns {Promise<undefined>} Nothing. Throws if the function failed to delete.
*/
export const deleteFunction = async ({
region,
functionName,
-}: {
- region: AwsRegion;
- functionName: string;
-}): Promise<void> => {
+}: DeleteFunctionInput): Promise<void> => {
await getLambdaClient(region).send(
new DeleteFunctionCommand({
FunctionName: functionName,
diff --git a/packages/lambda/src/api/delete-site.ts b/packages/lambda/src/api/delete-site.ts
index 70a344a4dc..665365fbdd 100644
--- a/packages/lambda/src/api/delete-site.ts
+++ b/packages/lambda/src/api/delete-site.ts
@@ -4,14 +4,14 @@ import {AwsRegion} from '../pricing/aws-regions';
import {getAccountId} from '../shared/get-account-id';
import {cleanItems} from './clean-items';
-export type DeleteSiteInputData = {
+export type DeleteSiteInput = {
bucketName: string;
siteName: string;
region: AwsRegion;
onAfterItemDeleted?: (data: {bucketName: string; itemName: string}) => void;
};
-export type DeleteSiteReturnData = {
+export type DeleteSiteOutput = {
totalSizeInBytes: number;
};
@@ -23,14 +23,14 @@ export type DeleteSiteReturnData = {
* @param options.siteName The ID of the site that you want to delete.
* @param {AwsRegion} options.region The region in where the S3 bucket resides in.
* @param options.onAfterItemDeleted Function that gets called after each file that gets deleted, useful for showing progress.
- * @returns `Promise<{totalSizeInBytes: number}>` How much space was freed.
+ * @returns {Promise<DeleteSiteOutput>} Object containing info about how much space was freed.
*/
export const deleteSite = async ({
bucketName,
siteName,
region,
onAfterItemDeleted,
-}: DeleteSiteInputData): Promise<DeleteSiteReturnData> => {
+}: DeleteSiteInput): Promise<DeleteSiteOutput> => {
const accountId = await getAccountId({region});
let files = await lambdaLs({
diff --git a/packages/lambda/src/api/deploy-function.ts b/packages/lambda/src/api/deploy-function.ts
index 23e590b82e..ca77097e3b 100644
--- a/packages/lambda/src/api/deploy-function.ts
+++ b/packages/lambda/src/api/deploy-function.ts
@@ -8,6 +8,18 @@ import {validateMemorySize} from '../shared/validate-memory-size';
import {validateTimeout} from '../shared/validate-timeout';
import {createFunction} from './create-function';
+export type DeployFunctionInput = {
+ createCloudWatchLogGroup: boolean;
+ region: AwsRegion;
+ timeoutInSeconds: number;
+ memorySizeInMb: number;
+};
+
+export type DeployFunctionOutput = {
+ functionName: string;
+ alreadyExisted: boolean;
+};
+
/**
* @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
* @link https://remotion-3.vercel.app/docs/lambda/deployfunction
@@ -15,17 +27,11 @@ import {createFunction} from './create-function';
* @param options.region The region you want to deploy your function to.
* @param options.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
* @param options.memorySizeInMb How much memory should be allocated to the Lambda function.
- * @returns An object that contains the `functionName` property
+ * @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
*/
-export const deployFunction = async (options: {
- createCloudWatchLogGroup: boolean;
- region: AwsRegion;
- timeoutInSeconds: number;
- memorySizeInMb: number;
-}): Promise<{
- functionName: string;
- alreadyExisted: boolean;
-}> => {
+export const deployFunction = async (
+ options: DeployFunctionInput
+): Promise<DeployFunctionOutput> => {
validateMemorySize(options.memorySizeInMb);
validateTimeout(options.timeoutInSeconds);
validateAwsRegion(options.region);
diff --git a/packages/lambda/src/api/deploy-site.ts b/packages/lambda/src/api/deploy-site.ts
index 58587d9c9a..b14d6193b4 100644
--- a/packages/lambda/src/api/deploy-site.ts
+++ b/packages/lambda/src/api/deploy-site.ts
@@ -25,7 +25,7 @@ export type DeploySiteInput = {
};
};
-export type DeploySiteReturnType = Promise<{
+export type DeploySiteOutput = Promise<{
serveUrl: string;
siteName: string;
}>;
@@ -45,7 +45,7 @@ export const deploySite = async ({
siteName,
options,
region,
-}: DeploySiteInput): DeploySiteReturnType => {
+}: DeploySiteInput): DeploySiteOutput => {
validateAwsRegion(region);
if (!bucketName.startsWith(REMOTION_BUCKET_PREFIX)) {
throw new Error(
diff --git a/packages/lambda/src/api/download-video.ts b/packages/lambda/src/api/download-media.ts
similarity index 96%
rename from packages/lambda/src/api/download-video.ts
rename to packages/lambda/src/api/download-media.ts
index 7e9c073fc8..863ee835d8 100644
--- a/packages/lambda/src/api/download-video.ts
+++ b/packages/lambda/src/api/download-media.ts
@@ -10,7 +10,7 @@ import {
import {AwsRegion} from '../pricing/aws-regions';
import {getAccountId} from '../shared/get-account-id';
-type DownloadMediaInput = {
+export type DownloadMediaInput = {
region: AwsRegion;
bucketName: string;
renderId: string;
@@ -18,7 +18,7 @@ type DownloadMediaInput = {
onProgress?: LambdaReadFileProgress;
};
-type DownloadMediaOutput = {
+export type DownloadMediaOutput = {
outputPath: string;
sizeInBytes: number;
};
diff --git a/packages/lambda/src/api/estimate-price.ts b/packages/lambda/src/api/estimate-price.ts
index 7293edc90b..b1783936ad 100644
--- a/packages/lambda/src/api/estimate-price.ts
+++ b/packages/lambda/src/api/estimate-price.ts
@@ -3,7 +3,7 @@ import {pricing} from '../pricing/price-per-1-s';
import {validateAwsRegion} from '../shared/validate-aws-region';
import {validateMemorySize} from '../shared/validate-memory-size';
-type EstimatePriceInput = {
+export type EstimatePriceInput = {
region: AwsRegion;
durationInMiliseconds: number;
memorySizeInMb: number;
@@ -12,13 +12,13 @@ type EstimatePriceInput = {
*
* @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.
* @link https://remotion-3.vercel.app/docs/lambda/estimateprice
- * @returns `number` Price in USD
+ * @returns {number} Price in USD
*/
export const estimatePrice = ({
region,
durationInMiliseconds,
memorySizeInMb,
-}: EstimatePriceInput) => {
+}: EstimatePriceInput): number => {
validateMemorySize(memorySizeInMb);
validateAwsRegion(region);
if (typeof durationInMiliseconds !== 'number') {
diff --git a/packages/lambda/src/api/get-function-info.ts b/packages/lambda/src/api/get-function-info.ts
index 9455af0c94..1ef5a6c511 100644
--- a/packages/lambda/src/api/get-function-info.ts
+++ b/packages/lambda/src/api/get-function-info.ts
@@ -12,7 +12,7 @@ export type FunctionInfo = {
version: LambdaVersions | null;
};
-type GetFunctionInfoArgs = {
+export type GetFunctionInfoInput = {
region: AwsRegion;
functionName: string;
};
@@ -27,7 +27,7 @@ type GetFunctionInfoArgs = {
export const getFunctionInfo = async ({
region,
functionName,
-}: GetFunctionInfoArgs): Promise<FunctionInfo> => {
+}: GetFunctionInfoInput): Promise<FunctionInfo> => {
validateAwsRegion(region);
const [functionInfo, version] = await Promise.all([
diff --git a/packages/lambda/src/api/get-functions.ts b/packages/lambda/src/api/get-functions.ts
index a705816414..7021f4b15b 100644
--- a/packages/lambda/src/api/get-functions.ts
+++ b/packages/lambda/src/api/get-functions.ts
@@ -5,6 +5,11 @@ import {CURRENT_VERSION, RENDER_FN_PREFIX} from '../shared/constants';
import {getFunctionVersion} from '../shared/get-function-version';
import {FunctionInfo} from './get-function-info';
+export type GetFunctionsInput = {
+ region: AwsRegion;
+ compatibleOnly: boolean;
+};
+
/**
*
*
@@ -12,12 +17,11 @@ import {FunctionInfo} from './get-function-info';
* @link https://remotion-3.vercel.app/docs/lambda/getfunctions
* @param options.region The region of which the functions should be listed.
* @param options.compatibleOnly Whether only functions compatible with the installed version of Remotion Lambda should be returned.
- * @returns An array with the objects containing information about the deployed functions.
+ * @returns {Promise<FunctionInfo[]>} An array with the objects containing information about the deployed functions.
*/
-export const getFunctions = async (options: {
- region: AwsRegion;
- compatibleOnly: boolean;
-}): Promise<FunctionInfo[]> => {
+export const getFunctions = async (
+ options: GetFunctionsInput
+): Promise<FunctionInfo[]> => {
const lambdas = await getLambdaClient(options.region).send(
new ListFunctionsCommand({})
);
diff --git a/packages/lambda/src/api/get-or-create-bucket.ts b/packages/lambda/src/api/get-or-create-bucket.ts
index 2d28d9787d..52b3b24087 100644
--- a/packages/lambda/src/api/get-or-create-bucket.ts
+++ b/packages/lambda/src/api/get-or-create-bucket.ts
@@ -5,24 +5,23 @@ import {createBucket} from './create-bucket';
import {enableS3Website} from './enable-s3-website';
import {getRemotionS3Buckets} from './get-buckets';
-type GetOrCreateBucketInput = {
+export type GetOrCreateBucketInput = {
region: AwsRegion;
- // TODO: Not documented
onBucketEnsured?: () => void;
};
-type GetOrCreateBucketResult = {
+export type GetOrCreateBucketOutput = {
bucketName: string;
};
/**
* @description Creates a bucket for Remotion Lambda in your S3 account. If one already exists, it will get returned instead.
- * @link http://remotion.dev/docs/lambda/getorcreatebucket
+ * @link https://remotion-3.vercel.app/docs/lambda/getorcreatebucket
* @param options.region The region in which you want your S3 bucket to reside in.
- * @returns `Promise<{region: AwsRegion}>`
+ * @returns {Promise<GetOrCreateBucketOutput>} An object containing the `bucketName`.
*/
export const getOrCreateBucket = async (
options: GetOrCreateBucketInput
-): Promise<GetOrCreateBucketResult> => {
+): Promise<GetOrCreateBucketOutput> => {
const {remotionBuckets} = await getRemotionS3Buckets(options.region);
if (remotionBuckets.length > 1) {
throw new Error(
diff --git a/packages/lambda/src/api/get-render-progress.ts b/packages/lambda/src/api/get-render-progress.ts
index 3409a7e3a0..486160123f 100644
--- a/packages/lambda/src/api/get-render-progress.ts
+++ b/packages/lambda/src/api/get-render-progress.ts
@@ -1,6 +1,13 @@
import {AwsRegion} from '../pricing/aws-regions';
import {callLambda} from '../shared/call-lambda';
-import {LambdaRoutines} from '../shared/constants';
+import {LambdaRoutines, RenderProgress} from '../shared/constants';
+
+export type GetRenderInput = {
+ functionName: string;
+ bucketName: string;
+ renderId: string;
+ region: AwsRegion;
+};
/**
* @description Gets the current status of a render originally triggered via renderMediaOnLambda().
@@ -9,19 +16,14 @@ import {LambdaRoutines} from '../shared/constants';
* @param {string} params.bucketName The name of the bucket that was used in the render.
* @param {string} params.renderId The ID of the render that was returned by `renderMediaOnLambda()`.
* @param {AwsRegion} params.region The region in which the render was triggered.
- * @returns See documentation for this function to see all properties on the return object.
+ * @returns {Promise<RenderProgress>} See documentation for this function to see all properties on the return object.
*/
export const getRenderProgress = async ({
functionName,
bucketName,
renderId,
region,
-}: {
- functionName: string;
- bucketName: string;
- renderId: string;
- region: AwsRegion;
-}) => {
+}: GetRenderInput): Promise<RenderProgress> => {
return callLambda({
functionName,
type: LambdaRoutines.status,
diff --git a/packages/lambda/src/api/get-sites.ts b/packages/lambda/src/api/get-sites.ts
index e3b6a85bb2..b3f0c9b9a4 100644
--- a/packages/lambda/src/api/get-sites.ts
+++ b/packages/lambda/src/api/get-sites.ts
@@ -13,7 +13,11 @@ type Site = {
serveUrl: string;
};
-type GetSitesReturnValue = {
+export type GetSitesInput = {
+ region: AwsRegion;
+};
+
+export type GetSitesOutput = {
sites: Site[];
buckets: BucketWithLocation[];
};
@@ -23,13 +27,11 @@ type GetSitesReturnValue = {
* @description Gets all the deployed sites for a certain AWS region.
* @link https://remotion-3.vercel.app/docs/lambda/getsites
* @param {AwsRegion} params.region The AWS region that you want to query for.
- * @returns A Promise containing an object with `sites` and `bucket` keys. Consult documentation for details.
+ * @returns {Promise<GetSitesOutput>} A Promise containing an object with `sites` and `bucket` keys. Consult documentation for details.
*/
export const getSites = async ({
region,
-}: {
- region: AwsRegion;
-}): Promise<GetSitesReturnValue> => {
+}: GetSitesInput): Promise<GetSitesOutput> => {
const {remotionBuckets} = await getRemotionS3Buckets(region);
const accountId = await getAccountId({region});
diff --git a/packages/lambda/src/api/iam-validation/simulate.ts b/packages/lambda/src/api/iam-validation/simulate.ts
index 84b03b5233..cf7ac32de2 100644
--- a/packages/lambda/src/api/iam-validation/simulate.ts
+++ b/packages/lambda/src/api/iam-validation/simulate.ts
@@ -17,12 +17,25 @@ export const logPermissionOutput = (output: SimulationResult) => {
return [getEmojiForStatus(output.decision), output.name].join(' ');
};
-export const simulatePermissions = async (options: {
+export type SimulatePermissionsInput = {
region: AwsRegion;
onSimulation?: (result: SimulationResult) => void;
-}): Promise<{
+};
+
+export type SimulatePermissionsOutput = {
results: SimulationResult[];
-}> => {
+};
+
+/**
+ * @description Simulates calls using the AWS Simulator to validate the correct permissions.
+ * @link http://remotion-3.vercel.app/docs/lambda/simulatepermissions
+ * @param {AwsRegion} options.region The region which you would like to validate
+ * @param {(result: SimulationResult) => void} options.onSimulation The region which you would like to validate
+ * @returns {Promise<SimulatePermissionsOutput>} See documentation for detailed response structure.
+ */
+export const simulatePermissions = async (
+ options: SimulatePermissionsInput
+): Promise<SimulatePermissionsOutput> => {
const user = await getIamClient(options.region).send(new GetUserCommand({}));
if (!user || !user.User) {
diff --git a/packages/lambda/src/api/render-video-on-lambda.ts b/packages/lambda/src/api/render-media-on-lambda.ts
similarity index 92%
rename from packages/lambda/src/api/render-video-on-lambda.ts
rename to packages/lambda/src/api/render-media-on-lambda.ts
index 82cd1df09b..55e4098594 100644
--- a/packages/lambda/src/api/render-video-on-lambda.ts
+++ b/packages/lambda/src/api/render-media-on-lambda.ts
@@ -16,6 +16,32 @@ import {
import {convertToServeUrl} from '../shared/convert-to-serve-url';
import {validateFramesPerLambda} from '../shared/validate-frames-per-lambda';
+export type RenderMediaOnLambdaInput = {
+ region: AwsRegion;
+ functionName: string;
+ serveUrl: string;
+ composition: string;
+ inputProps: unknown;
+ codec: 'h264-mkv' | 'mp3' | 'aac' | 'wav';
+ imageFormat: ImageFormat;
+ crf?: number | undefined;
+ envVariables?: Record<string, string>;
+ pixelFormat?: PixelFormat;
+ proResProfile?: ProResProfile;
+ privacy: Privacy;
+ quality?: number;
+ maxRetries: number;
+ framesPerLambda?: number;
+ enableChunkOptimization?: boolean;
+ logLevel?: LogLevel;
+ frameRange?: FrameRange;
+};
+
+export type RenderMediaOnLambdaOutput = {
+ renderId: string;
+ bucketName: string;
+};
+
/**
* @description Triggers a render on a lambda given a composition and a lambda function.
* @link https://remotion-3.vercel.app/docs/lambda/rendermediaonlambda
@@ -33,7 +59,7 @@ import {validateFramesPerLambda} from '../shared/validate-frames-per-lambda';
* @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
* @param params.enableChunkOptimization Whether Remotion should restructure and optimize chunks for subsequent renders. Default true.
* @param params.logLevel Level of logging that Lambda function should perform. Default "info".
- * @returns `Promise<{renderId: string; bucketName: string}>`
+ * @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
*/
export const renderMediaOnLambda = async ({
@@ -55,26 +81,7 @@ export const renderMediaOnLambda = async ({
enableChunkOptimization,
logLevel,
frameRange,
-}: {
- region: AwsRegion;
- functionName: string;
- serveUrl: string;
- composition: string;
- inputProps: unknown;
- codec: 'h264-mkv' | 'mp3' | 'aac' | 'wav';
- imageFormat: ImageFormat;
- crf?: number | undefined;
- envVariables?: Record<string, string>;
- pixelFormat?: PixelFormat;
- proResProfile?: ProResProfile;
- privacy: Privacy;
- quality?: number;
- maxRetries: number;
- framesPerLambda?: number;
- enableChunkOptimization?: boolean;
- logLevel?: LogLevel;
- frameRange?: FrameRange;
-}) => {
+}: RenderMediaOnLambdaInput): Promise<RenderMediaOnLambdaOutput> => {
validateFramesPerLambda(framesPerLambda);
const realServeUrl = await convertToServeUrl(serveUrl, region);
const res = await callLambda({
diff --git a/packages/lambda/src/api/render-still-on-lambda.ts b/packages/lambda/src/api/render-still-on-lambda.ts
index 24ee74b345..bf65f99412 100644
--- a/packages/lambda/src/api/render-still-on-lambda.ts
+++ b/packages/lambda/src/api/render-still-on-lambda.ts
@@ -1,8 +1,36 @@
import {LogLevel, StillImageFormat} from 'remotion';
import {AwsRegion} from '../pricing/aws-regions';
import {callLambda} from '../shared/call-lambda';
-import {DEFAULT_MAX_RETRIES, LambdaRoutines} from '../shared/constants';
+import {
+ CostsInfo,
+ DEFAULT_MAX_RETRIES,
+ LambdaRoutines,
+} from '../shared/constants';
import {convertToServeUrl} from '../shared/convert-to-serve-url';
+
+export type RenderStillOnLambdaInput = {
+ region: AwsRegion;
+ functionName: string;
+ serveUrl: string;
+ composition: string;
+ inputProps: unknown;
+ imageFormat: StillImageFormat;
+ privacy: 'private' | 'public';
+ maxRetries?: number;
+ envVariables?: Record<string, string>;
+ quality?: number;
+ frame?: number;
+ logLevel?: LogLevel;
+};
+
+export type RenderStillOnLambdaOutput = {
+ estimatedPrice: CostsInfo;
+ url: string;
+ sizeInBytes: number;
+ bucketName: string;
+ renderId: string;
+};
+
/**
* @description Renders a still frame on Lambda
* @link https://remotion-3.vercel.app/docs/lambda/renderstillonlambda
@@ -17,7 +45,7 @@ import {convertToServeUrl} from '../shared/convert-to-serve-url';
* @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
* @param params.frame Which frame should be used for the still image. Default 0.
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
- * @returns `Promise<{estimatedPrice: CostsInfo; url: string; size: number}>`
+ * @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
*/
export const renderStillOnLambda = async ({
@@ -33,20 +61,7 @@ export const renderStillOnLambda = async ({
privacy,
frame,
logLevel,
-}: {
- region: AwsRegion;
- functionName: string;
- serveUrl: string;
- composition: string;
- inputProps: unknown;
- imageFormat: StillImageFormat;
- privacy: 'private' | 'public';
- maxRetries?: number;
- envVariables?: Record<string, string>;
- quality?: number;
- frame?: number;
- logLevel?: LogLevel;
-}) => {
+}: RenderStillOnLambdaInput): Promise<RenderStillOnLambdaOutput> => {
const realServeUrl = await convertToServeUrl(serveUrl, region);
const res = await callLambda({
@@ -70,7 +85,7 @@ export const renderStillOnLambda = async ({
return {
estimatedPrice: res.estimatedPrice,
url: res.output,
- size: res.size,
+ sizeInBytes: res.size,
bucketName: res.bucketName,
renderId: res.renderId,
};
diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.ts
index 81e41cff88..f7fef25869 100644
--- a/packages/lambda/src/cli/commands/render/render.ts
+++ b/packages/lambda/src/cli/commands/render/render.ts
@@ -1,7 +1,7 @@
import {CliInternals} from '@remotion/cli';
-import {downloadMedia} from '../../../api/download-video';
+import {downloadMedia} from '../../../api/download-media';
import {getRenderProgress} from '../../../api/get-render-progress';
-import {renderMediaOnLambda} from '../../../api/render-video-on-lambda';
+import {renderMediaOnLambda} from '../../../api/render-media-on-lambda';
import {
BINARY_NAME,
DEFAULT_FRAMES_PER_LAMBDA,
diff --git a/packages/lambda/src/cli/commands/still.ts b/packages/lambda/src/cli/commands/still.ts
index 2eb09b43f1..82dd9b446a 100644
--- a/packages/lambda/src/cli/commands/still.ts
+++ b/packages/lambda/src/cli/commands/still.ts
@@ -1,6 +1,6 @@
import {CliInternals} from '@remotion/cli';
import {StillImageFormat} from 'remotion';
-import {downloadMedia} from '../../api/download-video';
+import {downloadMedia} from '../../api/download-media';
import {renderStillOnLambda} from '../../api/render-still-on-lambda';
import {
BINARY_NAME,
diff --git a/packages/lambda/src/client.ts b/packages/lambda/src/client.ts
index bfba1453cf..52969a7b63 100644
--- a/packages/lambda/src/client.ts
+++ b/packages/lambda/src/client.ts
@@ -1,10 +1,10 @@
import {getFunctions} from './api/get-functions';
import {getRenderProgress} from './api/get-render-progress';
-import {renderStillOnLambda} from './api/render-still-on-lambda';
import {
renderMediaOnLambda,
renderVideoOnLambda,
-} from './api/render-video-on-lambda';
+} from './api/render-media-on-lambda';
+import {renderStillOnLambda} from './api/render-still-on-lambda';
import type {AwsRegion} from './pricing/aws-regions';
import type {RenderProgress} from './shared/constants';
diff --git a/packages/lambda/src/functions/helpers/calculate-price-from-bucket.ts b/packages/lambda/src/functions/helpers/calculate-price-from-bucket.ts
index 4bc38d8262..a4db4825b9 100644
--- a/packages/lambda/src/functions/helpers/calculate-price-from-bucket.ts
+++ b/packages/lambda/src/functions/helpers/calculate-price-from-bucket.ts
@@ -1,5 +1,5 @@
import {_Object} from '@aws-sdk/client-s3';
-import {estimatePrice} from '../..';
+import {estimatePrice} from '../../api/estimate-price';
import {lambdaTimingsPrefix, RenderMetadata} from '../../shared/constants';
import {parseLambdaTimingsKey} from '../../shared/parse-lambda-timings-key';
import {calculateChunkTimes} from './calculate-chunk-times';
diff --git a/packages/lambda/src/functions/helpers/delete-chunks.ts b/packages/lambda/src/functions/helpers/delete-chunks.ts
index d60cd0709e..7707434234 100644
--- a/packages/lambda/src/functions/helpers/delete-chunks.ts
+++ b/packages/lambda/src/functions/helpers/delete-chunks.ts
@@ -1,6 +1,6 @@
import {_Object} from '@aws-sdk/client-s3';
-import {AwsRegion} from '../..';
import {cleanItems} from '../../api/clean-items';
+import {AwsRegion} from '../../pricing/aws-regions';
import {CleanupJob} from './get-files-to-delete';
export const cleanupFiles = async ({
diff --git a/packages/lambda/src/functions/helpers/get-post-render-data.ts b/packages/lambda/src/functions/helpers/get-post-render-data.ts
index 9a48f40a5b..ca831c08ce 100644
--- a/packages/lambda/src/functions/helpers/get-post-render-data.ts
+++ b/packages/lambda/src/functions/helpers/get-post-render-data.ts
@@ -1,4 +1,4 @@
-import {AwsRegion} from '../..';
+import {AwsRegion} from '../../pricing/aws-regions';
import {PostRenderData, postRenderDataKey} from '../../shared/constants';
import {streamToString} from '../../shared/stream-to-string';
import {lambdaReadFile} from './io';
diff --git a/packages/lambda/src/index.ts b/packages/lambda/src/index.ts
index 96fedd5e6e..73b22e44f8 100644
--- a/packages/lambda/src/index.ts
+++ b/packages/lambda/src/index.ts
@@ -1,33 +1,52 @@
-import {deleteFunction} from './api/delete-function';
+import {deleteFunction, DeleteFunctionInput} from './api/delete-function';
+import {deleteSite, DeleteSiteInput, DeleteSiteOutput} from './api/delete-site';
import {
- deleteSite,
- DeleteSiteInputData,
- DeleteSiteReturnData,
-} from './api/delete-site';
-import {deployFunction} from './api/deploy-function';
+ deployFunction,
+ DeployFunctionInput,
+ DeployFunctionOutput,
+} from './api/deploy-function';
+import {deploySite, DeploySiteInput, DeploySiteOutput} from './api/deploy-site';
import {
- deploySite,
- DeploySiteInput,
- DeploySiteReturnType,
-} from './api/deploy-site';
-import {downloadMedia, downloadVideo} from './api/download-video';
-import {estimatePrice} from './api/estimate-price';
-import {getFunctionInfo} from './api/get-function-info';
-import {getFunctions} from './api/get-functions';
-import {getOrCreateBucket} from './api/get-or-create-bucket';
+ downloadMedia,
+ DownloadMediaInput,
+ DownloadMediaOutput,
+ downloadVideo,
+} from './api/download-media';
+import {estimatePrice, EstimatePriceInput} from './api/estimate-price';
+import {
+ FunctionInfo,
+ getFunctionInfo,
+ GetFunctionInfoInput,
+} from './api/get-function-info';
+import {getFunctions, GetFunctionsInput} from './api/get-functions';
+import {
+ getOrCreateBucket,
+ GetOrCreateBucketInput,
+ GetOrCreateBucketOutput,
+} from './api/get-or-create-bucket';
import {getRegions} from './api/get-regions';
-import {getRenderProgress} from './api/get-render-progress';
-import {getSites} from './api/get-sites';
-import {simulatePermissions} from './api/iam-validation/simulate';
+import {GetRenderInput, getRenderProgress} from './api/get-render-progress';
+import {getSites, GetSitesInput, GetSitesOutput} from './api/get-sites';
+import {
+ simulatePermissions,
+ SimulatePermissionsInput,
+ SimulatePermissionsOutput,
+} from './api/iam-validation/simulate';
import {
getRolePolicy,
getUserPolicy,
} from './api/iam-validation/suggested-policy';
-import {renderStillOnLambda} from './api/render-still-on-lambda';
import {
renderMediaOnLambda,
+ RenderMediaOnLambdaInput,
+ RenderMediaOnLambdaOutput,
renderVideoOnLambda,
-} from './api/render-video-on-lambda';
+} from './api/render-media-on-lambda';
+import {
+ renderStillOnLambda,
+ RenderStillOnLambdaInput,
+ RenderStillOnLambdaOutput,
+} from './api/render-still-on-lambda';
import {LambdaLSInput, LambdaLsReturnType} from './functions/helpers/io';
import {LambdaInternals} from './internals';
import {AwsRegion} from './pricing/aws-regions';
@@ -59,9 +78,29 @@ export type {
AwsRegion,
RenderProgress,
DeploySiteInput,
- DeploySiteReturnType,
+ DeploySiteOutput,
LambdaLsReturnType,
LambdaLSInput,
- DeleteSiteInputData,
- DeleteSiteReturnData,
+ DeleteSiteInput,
+ DeleteSiteOutput,
+ EstimatePriceInput,
+ DeployFunctionInput,
+ DeployFunctionOutput,
+ DeleteFunctionInput,
+ GetFunctionInfoInput,
+ FunctionInfo,
+ GetFunctionsInput,
+ GetSitesInput,
+ GetSitesOutput,
+ DownloadMediaInput,
+ DownloadMediaOutput,
+ GetOrCreateBucketInput,
+ GetOrCreateBucketOutput,
+ GetRenderInput,
+ RenderMediaOnLambdaInput,
+ RenderMediaOnLambdaOutput,
+ RenderStillOnLambdaInput,
+ RenderStillOnLambdaOutput,
+ SimulatePermissionsInput,
+ SimulatePermissionsOutput,
};