🎥 Make videos programmatically with React
jsdoc
Jonny Burger26ee717afb98
diff --git a/packages/lambda/src/api/create-function.ts b/packages/lambda/src/api/create-function.tsindex d192f84a37..7f1402d3c7 100644--- a/packages/lambda/src/api/create-function.ts+++ b/packages/lambda/src/api/create-function.ts@@ -66,19 +66,12 @@ export const createFunction = async ({),}));- // TODO: Remove try catch in future versions- try {- await getLambdaClient(region).send(- new PutFunctionEventInvokeConfigCommand({- MaximumRetryAttempts: 0,- FunctionName,- })- );- } catch (err) {- Log.warn(- '\nWe now require the lambda:PutFunctionEventInvokeConfig permissions for your user. Please run `npx remotion lambda policies user` update your user policy. This will be required for the final version of Remotion Lambda.'- );- }+ await getLambdaClient(region).send(+ new PutFunctionEventInvokeConfigCommand({+ MaximumRetryAttempts: 0,+ FunctionName,+ })+ );return {FunctionName};};diff --git a/packages/lambda/src/api/delete-function.ts b/packages/lambda/src/api/delete-function.tsindex 94ee173ec1..ae58373100 100644--- a/packages/lambda/src/api/delete-function.ts+++ b/packages/lambda/src/api/delete-function.ts@@ -4,7 +4,7 @@ import {getLambdaClient} from '../shared/aws-clients';/*** @description Deletes a function from AWS Lambda.- * @link https://remotion.dev/docs/lambda/deletefunction+ * @link https://remotion-lambda-alpha.netlify.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.diff --git a/packages/lambda/src/api/delete-site.ts b/packages/lambda/src/api/delete-site.tsindex f9e3c20c4e..78502ddccd 100644--- a/packages/lambda/src/api/delete-site.ts+++ b/packages/lambda/src/api/delete-site.ts@@ -4,23 +4,34 @@ import {lambdaLs} from '../functions/helpers/io';import {getAccountId} from '../shared/get-account-id';import {cleanItems} from './clean-items';-type DeleteSiteReturnData = {+export type DeleteSiteInputData = {+ bucketName: string;+ // TODO: Make siteName / siteId consistent+ siteName: string;+ region: AwsRegion;+ onAfterItemDeleted?: (data: {bucketName: string; itemName: string}) => void;+};++export type DeleteSiteReturnData = {totalSizeInBytes: number;};-// TODO: Write JSDoc annotations+/**+ *+ * @description Deletes a deployed site from your S3 bucket. The opposite of deploySite().+ * @link https://remotion-lambda-alpha.netlify.app/docs/lambda/deletesite+ * @param options.bucketName The S3 bucket name where the site resides in.+ * @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.+ */export const deleteSite = async ({bucketName,siteName,region,onAfterItemDeleted,-}: {- bucketName: string;- // TODO: Make siteName / siteId consistent- siteName: string;- region: AwsRegion;- onAfterItemDeleted?: (data: {bucketName: string; itemName: string}) => void;-}): Promise<DeleteSiteReturnData> => {+}: DeleteSiteInputData): Promise<DeleteSiteReturnData> => {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.tsindex 775bf78921..010e5ceb86 100644--- a/packages/lambda/src/api/deploy-function.ts+++ b/packages/lambda/src/api/deploy-function.ts@@ -12,7 +12,7 @@ import {createFunction} from './create-function';/*** @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.- * @link https://remotion.dev/docs/lambda/deployfunction+ * @link https://remotion-lambda-alpha.netlify.app/docs/lambda/deployfunction* @param options.createCloudWatchLogGroup Whether you'd like to create a CloudWatch Log Group to store the logs for this 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.diff --git a/packages/lambda/src/api/deploy-site.ts b/packages/lambda/src/api/deploy-site.tsindex c0ffbe7872..815adf93f6 100644--- a/packages/lambda/src/api/deploy-site.ts+++ b/packages/lambda/src/api/deploy-site.ts@@ -31,7 +31,7 @@ export type DeploySiteReturnType = Promise<{/*** @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.- * @link https://remotion.dev/docs/lambda/deploysite+ * @link https://remotion-lambda-alpha.netlify.app/docs/lambda/deploysite* @param {AwsRegion} params.region The region in which the S3 bucket resides in.* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.* @param {string} params.bucketName The name of the bucket to deploy your project into.diff --git a/packages/lambda/src/api/get-function-info.ts b/packages/lambda/src/api/get-function-info.tsindex 0364c16848..a598cbf714 100644--- a/packages/lambda/src/api/get-function-info.ts+++ b/packages/lambda/src/api/get-function-info.ts@@ -19,7 +19,7 @@ type GetFunctionInfoArgs = {/*** @description Given a region and function name, returns information about the function such as version, memory size and timeout.- * @link https://remotion.dev/docs/lambda/getfunctioninfo+ * @link https://remotion-lambda-alpha.netlify.app/docs/lambda/getfunctioninfo* @param {AwsRegion} options.region The region in which the function resides in.* @param {string} options.functionName The name of the function* @return {Promise<FunctionInfo>} Promise resolving to information about the function.diff --git a/packages/lambda/src/api/get-functions.ts b/packages/lambda/src/api/get-functions.tsindex 6525a4bfb5..de987f74a0 100644--- a/packages/lambda/src/api/get-functions.ts+++ b/packages/lambda/src/api/get-functions.ts@@ -9,7 +9,7 @@ import {FunctionInfo} from './get-function-info';*** @description Lists Remotion Lambda render functions deployed to AWS Lambda.- * @link https://remotion.dev/docs/lambda/getfunctions+ * @link https://remotion-lambda-alpha.netlify.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.diff --git a/packages/lambda/src/api/get-render-progress.ts b/packages/lambda/src/api/get-render-progress.tsindex 3004728e11..fdfc063247 100644--- a/packages/lambda/src/api/get-render-progress.ts+++ b/packages/lambda/src/api/get-render-progress.ts@@ -4,7 +4,7 @@ import {LambdaRoutines} from '../shared/constants';/*** @description Gets the current status of a render originally triggered via renderVideoOnLambda().- * @link https://remotion.dev/docs/lambda/getrenderprogress+ * @link https://remotion-lambda-alpha.netlify.app/docs/lambda/getrenderprogress* @param {string} params.functionName The name of the function used to trigger the render.* @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 `renderVideoOnLambda()`.diff --git a/packages/lambda/src/api/iam-validation/suggested-policy.ts b/packages/lambda/src/api/iam-validation/suggested-policy.tsindex 98c74d4e85..3349b7ab8b 100644--- a/packages/lambda/src/api/iam-validation/suggested-policy.ts+++ b/packages/lambda/src/api/iam-validation/suggested-policy.ts@@ -31,7 +31,7 @@ const suggestedRolePolicy = {/*** @description Returns an inline JSON policy to be assigned to the AWS user whose credentials are being used for excuting CLI commands or calling Node.JS functions.- * @link https://remotion.dev/docs/lambda/getuserpolicy+ * @link https://remotion-lambda-alpha.netlify.app/docs/lambda/getuserpolicy*/export const getUserPolicy = () => JSON.stringify(suggestedPolicy, null, 2);@@ -40,6 +40,6 @@ export const ROLE_NAME = 'remotion-lambda-role';/*** @description Returns an inline JSON policy to be assigned to the 'remotion-lambda-role' role that needs to be created in your AWS account.- * @link https://remotion.dev/docs/lambda/getrolepolicy+ * @link https://remotion-lambda-alpha.netlify.app/docs/lambda/getrolepolicy*/export const getRolePolicy = () => JSON.stringify(suggestedRolePolicy, null, 2);diff --git a/packages/lambda/src/api/render-still-on-lambda.ts b/packages/lambda/src/api/render-still-on-lambda.tsindex f97093916d..774eedbbfb 100644--- a/packages/lambda/src/api/render-still-on-lambda.ts+++ b/packages/lambda/src/api/render-still-on-lambda.ts@@ -4,7 +4,7 @@ import {callLambda} from '../shared/call-lambda';import {LambdaRoutines} from '../shared/constants';/*** @description Renders a still frame on Lambda- * @link https://remotion.dev/docs/lambda/renderstillonlambda+ * @link https://remotion-lambda-alpha.netlify.app/docs/lambda/renderstillonlambda* @param params.functionName The name of the Lambda function that should be used* @param params.serveUrl The URL of the deployed project* @param params.composition The ID of the composition which should be rendered.diff --git a/packages/lambda/src/api/render-video-on-lambda.ts b/packages/lambda/src/api/render-video-on-lambda.tsindex 9486287be4..ccd3f017a6 100644--- a/packages/lambda/src/api/render-video-on-lambda.ts+++ b/packages/lambda/src/api/render-video-on-lambda.ts@@ -10,7 +10,7 @@ import {validateFramesPerLambda} from './validate-frames-per-lambda';/*** @description Triggers a render on a lambda given a composition and a lambda function.- * @link https://remotion.dev/docs/lambda/rendervideoonlambda+ * @link https://remotion-lambda-alpha.netlify.app/docs/lambda/rendervideoonlambda* @param params.functionName The name of the Lambda function that should be used* @param params.serveUrl The URL of the deployed project* @param params.composition The ID of the composition which should be rendered.diff --git a/packages/lambda/src/index.ts b/packages/lambda/src/index.tsindex c5037ffefd..a5392e6a18 100644--- a/packages/lambda/src/index.ts+++ b/packages/lambda/src/index.ts@@ -1,5 +1,9 @@import {deleteFunction} from './api/delete-function';-import {deleteSite} from './api/delete-site';+import {+ deleteSite,+ DeleteSiteInputData,+ DeleteSiteReturnData,+} from './api/delete-site';import {deployFunction} from './api/deploy-function';import {deploySite,@@ -51,4 +55,6 @@ export type {DeploySiteReturnType,LambdaLsReturnType,LambdaLSInput,+ DeleteSiteInputData,+ DeleteSiteReturnData,};diff --git a/packages/lambda/src/pricing/calculate-price.ts b/packages/lambda/src/pricing/calculate-price.tsindex 7f8b81cada..8a7612ae30 100644--- a/packages/lambda/src/pricing/calculate-price.ts+++ b/packages/lambda/src/pricing/calculate-price.ts@@ -11,7 +11,7 @@ type EstimatePriceInput = {/**** @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.- * @link https://remotion.dev/docs/lambda/estimateprice+ * @link https://remotion-lambda-alpha.netlify.app/docs/lambda/estimateprice* @returns `number` Price in USD*/export const estimatePrice = ({