🎥 Make videos programmatically with React
fix lambda warnings
Jonny Burgerb0ec53510d5f
diff --git a/packages/lambda/src/api/__mocks__/get-functions.ts b/packages/lambda/src/api/__mocks__/get-functions.tsindex 5a3ec9c36f..0d40961ef7 100644--- a/packages/lambda/src/api/__mocks__/get-functions.ts+++ b/packages/lambda/src/api/__mocks__/get-functions.ts@@ -2,9 +2,8 @@ import {VERSION} from 'remotion/version';import type {getFunctions as original} from '../get-functions';import {getAllMockFunctions} from '../mock-functions';-export const getFunctions: typeof original = async ({- region,- compatibleOnly,-}) => {- return getAllMockFunctions(region, compatibleOnly ? VERSION : null);+export const getFunctions: typeof original = ({region, compatibleOnly}) => {+ return Promise.resolve(+ getAllMockFunctions(region, compatibleOnly ? VERSION : null)+ );};diff --git a/packages/lambda/src/api/clean-items.ts b/packages/lambda/src/api/clean-items.tsindex f9a559f4dd..709362a5ae 100644--- a/packages/lambda/src/api/clean-items.ts+++ b/packages/lambda/src/api/clean-items.ts@@ -5,7 +5,7 @@ import {pLimit} from '../shared/p-limit';const limit = pLimit(10);-export const cleanItems = async ({+export const cleanItems = ({bucket,onAfterItemDeleted,onBeforeItemDeleted,diff --git a/packages/lambda/src/api/iam-validation/simulate.ts b/packages/lambda/src/api/iam-validation/simulate.tsindex 36b8d6f643..e7c31d52ea 100644--- a/packages/lambda/src/api/iam-validation/simulate.ts+++ b/packages/lambda/src/api/iam-validation/simulate.ts@@ -37,13 +37,17 @@ export type SimulatePermissionsOutput = {export const simulatePermissions = async (options: SimulatePermissionsInput): Promise<SimulatePermissionsOutput> => {- const callerIdentity = await getStsClient(options.region).send(new GetCallerIdentityCommand({}));+ const callerIdentity = await getStsClient(options.region).send(+ new GetCallerIdentityCommand({})+ );if (!callerIdentity || !callerIdentity.Arn) {throw new Error('No valid AWS Caller Identity detected');}- const callerIdentityArnComponents = callerIdentity.Arn!.match(/arn:aws:([^:]+)::(\d+):([^/]+)(.*)/)+ const callerIdentityArnComponents = callerIdentity.Arn.match(+ /arn:aws:([^:]+)::(\d+):([^/]+)(.*)/+ );if (!callerIdentityArnComponents) {throw new Error('Unknown AWS Caller Identity ARN detected');}@@ -51,15 +55,24 @@ export const simulatePermissions = async (const callerIdentityArnType = callerIdentityArnComponents[1];let callerArn;- if (callerIdentityArnType === 'iam' && callerIdentityArnComponents[3] === 'user') {+ if (+ callerIdentityArnType === 'iam' &&+ callerIdentityArnComponents[3] === 'user'+ ) {callerArn = callerIdentity.Arn as string;- } else if (callerIdentityArnType === 'sts' && callerIdentityArnComponents[3] === 'assumed-role') {- const assumedRoleComponents = callerIdentityArnComponents[4].match(/\/([^/]+)\/(.*)/)+ } else if (+ callerIdentityArnType === 'sts' &&+ callerIdentityArnComponents[3] === 'assumed-role'+ ) {+ const assumedRoleComponents =+ callerIdentityArnComponents[4].match(/\/([^/]+)\/(.*)/);if (!assumedRoleComponents) {- throw new Error('Unsupported AWS Caller Identity as Assumed-Role ARN detected');+ throw new Error(+ 'Unsupported AWS Caller Identity as Assumed-Role ARN detected'+ );}- callerArn = `arn:aws:iam::${callerIdentityArnComponents[2]}:role/${assumedRoleComponents[1]}`+ callerArn = `arn:aws:iam::${callerIdentityArnComponents[2]}:role/${assumedRoleComponents[1]}`;} else {throw new Error('Unsupported AWS Caller Identity ARN detected');}diff --git a/packages/lambda/src/functions/index.ts b/packages/lambda/src/functions/index.tsindex 7f1b0e6280..2a57b0a9ed 100644--- a/packages/lambda/src/functions/index.ts+++ b/packages/lambda/src/functions/index.ts@@ -13,7 +13,7 @@ import {rendererHandler} from './renderer';import {startHandler} from './start';import {stillHandler} from './still';-export const handler = async <T extends LambdaRoutines>(+export const handler = <T extends LambdaRoutines>(params: LambdaPayload,context: {invokedFunctionArn: string; getRemainingTimeInMillis: () => number}): Promise<LambdaReturnValues[T]> => {diff --git a/packages/lambda/src/test/integration/renders/old-version.test.ts b/packages/lambda/src/test/integration/renders/old-version.test.tsindex 344f1fb3ad..01b1a6fc31 100644--- a/packages/lambda/src/test/integration/renders/old-version.test.ts+++ b/packages/lambda/src/test/integration/renders/old-version.test.ts@@ -20,7 +20,7 @@ afterAll(async () => {await RenderInternals.killAllBrowsers();});-test('Should fail when using an incompatible version', async () => {+test('Should fail when using an incompatible version', () => {process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE = '2048';expect(() =>