@remotion/lambda 3.3.96 → 3.3.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/delete-function.d.ts +2 -2
- package/dist/api/delete-function.js +2 -2
- package/dist/api/delete-site.d.ts +4 -4
- package/dist/api/delete-site.js +4 -4
- package/dist/api/deploy-function.d.ts +8 -8
- package/dist/api/deploy-function.js +29 -29
- package/dist/api/deploy-site.d.ts +2 -1
- package/dist/api/deploy-site.js +5 -2
- package/dist/api/download-media.d.ts +1 -1
- package/dist/api/download-media.js +1 -1
- package/dist/api/get-functions.d.ts +3 -3
- package/dist/api/get-functions.js +7 -7
- package/dist/api/get-or-create-bucket.d.ts +2 -2
- package/dist/api/get-or-create-bucket.js +8 -8
- package/dist/api/get-render-progress.d.ts +1 -1
- package/dist/api/get-render-progress.js +5 -10
- package/dist/api/make-lambda-payload.d.ts +4 -40
- package/dist/api/make-lambda-payload.js +15 -3
- package/dist/api/render-media-on-lambda.js +1 -1
- package/dist/api/speculate-function-name.d.ts +3 -3
- package/dist/api/speculate-function-name.js +3 -3
- package/dist/cli/commands/render/render.js +1 -1
- package/dist/cli/commands/sites/create.js +1 -0
- package/dist/cli/commands/still.js +1 -1
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/io.d.ts +7 -1
- package/dist/functions/helpers/io.js +22 -2
- package/dist/functions/launch.js +1 -1
- package/dist/functions/still.js +1 -1
- package/dist/internals.d.ts +2 -40
- package/dist/internals.js +2 -1
- package/dist/shared/constants.d.ts +47 -45
- package/dist/shared/validate-privacy.d.ts +1 -1
- package/dist/shared/validate-privacy.js +4 -1
- package/package.json +9 -9
- package/remotionlambda-arm64.zip +0 -0
- package/remotionlambda-x64.zip +0 -0
|
@@ -6,8 +6,8 @@ export declare type DeleteFunctionInput = {
|
|
|
6
6
|
/**
|
|
7
7
|
* @description Deletes a function from AWS Lambda.
|
|
8
8
|
* @see [Documentation](https://remotion.dev/docs/lambda/deletefunction)
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
9
|
+
* @param params.region The region the function was deployed to.
|
|
10
|
+
* @param params.functionName The name of the function.
|
|
11
11
|
* @returns {Promise<void>} Nothing. Throws if the function failed to delete.
|
|
12
12
|
*/
|
|
13
13
|
export declare const deleteFunction: ({ region, functionName, }: DeleteFunctionInput) => Promise<void>;
|
|
@@ -6,8 +6,8 @@ const aws_clients_1 = require("../shared/aws-clients");
|
|
|
6
6
|
/**
|
|
7
7
|
* @description Deletes a function from AWS Lambda.
|
|
8
8
|
* @see [Documentation](https://remotion.dev/docs/lambda/deletefunction)
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
9
|
+
* @param params.region The region the function was deployed to.
|
|
10
|
+
* @param params.functionName The name of the function.
|
|
11
11
|
* @returns {Promise<void>} Nothing. Throws if the function failed to delete.
|
|
12
12
|
*/
|
|
13
13
|
const deleteFunction = async ({ region, functionName, }) => {
|
|
@@ -15,10 +15,10 @@ export declare type DeleteSiteOutput = {
|
|
|
15
15
|
*
|
|
16
16
|
* @description Deletes a deployed site from your S3 bucket. The opposite of deploySite().
|
|
17
17
|
* @see [Documentation](https://remotion.dev/docs/lambda/deletesite)
|
|
18
|
-
* @param
|
|
19
|
-
* @param
|
|
20
|
-
* @param {AwsRegion}
|
|
21
|
-
* @param
|
|
18
|
+
* @param params.bucketName The S3 bucket name where the site resides in.
|
|
19
|
+
* @param params.siteName The ID of the site that you want to delete.
|
|
20
|
+
* @param {AwsRegion} params.region The region in where the S3 bucket resides in.
|
|
21
|
+
* @param params.onAfterItemDeleted Function that gets called after each file that gets deleted, useful for showing progress.
|
|
22
22
|
* @returns {Promise<DeleteSiteOutput>} Object containing info about how much space was freed.
|
|
23
23
|
*/
|
|
24
24
|
export declare const deleteSite: ({ bucketName, siteName, region, onAfterItemDeleted, }: DeleteSiteInput) => Promise<DeleteSiteOutput>;
|
package/dist/api/delete-site.js
CHANGED
|
@@ -9,10 +9,10 @@ const clean_items_1 = require("./clean-items");
|
|
|
9
9
|
*
|
|
10
10
|
* @description Deletes a deployed site from your S3 bucket. The opposite of deploySite().
|
|
11
11
|
* @see [Documentation](https://remotion.dev/docs/lambda/deletesite)
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @param {AwsRegion}
|
|
15
|
-
* @param
|
|
12
|
+
* @param params.bucketName The S3 bucket name where the site resides in.
|
|
13
|
+
* @param params.siteName The ID of the site that you want to delete.
|
|
14
|
+
* @param {AwsRegion} params.region The region in where the S3 bucket resides in.
|
|
15
|
+
* @param params.onAfterItemDeleted Function that gets called after each file that gets deleted, useful for showing progress.
|
|
16
16
|
* @returns {Promise<DeleteSiteOutput>} Object containing info about how much space was freed.
|
|
17
17
|
*/
|
|
18
18
|
const deleteSite = async ({ bucketName, siteName, region, onAfterItemDeleted, }) => {
|
|
@@ -17,13 +17,13 @@ export declare type DeployFunctionOutput = {
|
|
|
17
17
|
/**
|
|
18
18
|
* @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
|
|
19
19
|
* @see [Documentation](https://www.remotion.dev/docs/lambda/deployfunction)
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
20
|
+
* @param params.createCloudWatchLogGroup Whether you'd like to create a CloudWatch Log Group to store the logs for this function.
|
|
21
|
+
* @param params.cloudWatchLogRetentionPeriodInDays (optional) The number of days to retain the CloudWatch logs for this function. Default is 14 days.
|
|
22
|
+
* @param params.region The region you want to deploy your function to.
|
|
23
|
+
* @param params.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
|
|
24
|
+
* @param params.memorySizeInMb How much memory should be allocated to the Lambda function.
|
|
25
|
+
* @param params.architecture The architecture Lambda should run on. One of x86_64 and x64
|
|
26
|
+
* @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
|
|
27
27
|
* @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
|
|
28
28
|
*/
|
|
29
|
-
export declare const deployFunction: (
|
|
29
|
+
export declare const deployFunction: (params: DeployFunctionInput) => Promise<DeployFunctionOutput>;
|
|
@@ -18,55 +18,55 @@ const create_function_1 = require("./create-function");
|
|
|
18
18
|
/**
|
|
19
19
|
* @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
|
|
20
20
|
* @see [Documentation](https://www.remotion.dev/docs/lambda/deployfunction)
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
21
|
+
* @param params.createCloudWatchLogGroup Whether you'd like to create a CloudWatch Log Group to store the logs for this function.
|
|
22
|
+
* @param params.cloudWatchLogRetentionPeriodInDays (optional) The number of days to retain the CloudWatch logs for this function. Default is 14 days.
|
|
23
|
+
* @param params.region The region you want to deploy your function to.
|
|
24
|
+
* @param params.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
|
|
25
|
+
* @param params.memorySizeInMb How much memory should be allocated to the Lambda function.
|
|
26
|
+
* @param params.architecture The architecture Lambda should run on. One of x86_64 and x64
|
|
27
|
+
* @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
|
|
28
28
|
* @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
|
|
29
29
|
*/
|
|
30
|
-
const deployFunction = async (
|
|
30
|
+
const deployFunction = async (params) => {
|
|
31
31
|
var _a, _b;
|
|
32
|
-
const diskSizeInMb = (_a =
|
|
33
|
-
(0, validate_memory_size_1.validateMemorySize)(
|
|
34
|
-
(0, validate_timeout_1.validateTimeout)(
|
|
35
|
-
(0, validate_aws_region_1.validateAwsRegion)(
|
|
36
|
-
(0, validate_retention_period_1.validateCloudWatchRetentionPeriod)(
|
|
37
|
-
(0, validate_architecture_1.validateArchitecture)(
|
|
32
|
+
const diskSizeInMb = (_a = params.diskSizeInMb) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB;
|
|
33
|
+
(0, validate_memory_size_1.validateMemorySize)(params.memorySizeInMb);
|
|
34
|
+
(0, validate_timeout_1.validateTimeout)(params.timeoutInSeconds);
|
|
35
|
+
(0, validate_aws_region_1.validateAwsRegion)(params.region);
|
|
36
|
+
(0, validate_retention_period_1.validateCloudWatchRetentionPeriod)(params.cloudWatchLogRetentionPeriodInDays);
|
|
37
|
+
(0, validate_architecture_1.validateArchitecture)(params.architecture);
|
|
38
38
|
(0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(diskSizeInMb);
|
|
39
|
-
(0, validate_custom_role_arn_1.validateCustomRoleArn)(
|
|
39
|
+
(0, validate_custom_role_arn_1.validateCustomRoleArn)(params.customRoleArn);
|
|
40
40
|
const fnNameRender = [
|
|
41
41
|
`${constants_1.RENDER_FN_PREFIX}${lambda_version_string_1.LAMBDA_VERSION_STRING}`,
|
|
42
|
-
`mem${
|
|
42
|
+
`mem${params.memorySizeInMb}mb`,
|
|
43
43
|
`disk${diskSizeInMb}mb`,
|
|
44
|
-
`${
|
|
44
|
+
`${params.timeoutInSeconds}sec`,
|
|
45
45
|
].join('-');
|
|
46
|
-
const accountId = await (0, get_account_id_1.getAccountId)({ region:
|
|
46
|
+
const accountId = await (0, get_account_id_1.getAccountId)({ region: params.region });
|
|
47
47
|
const fns = await (0, get_functions_1.getFunctions)({
|
|
48
48
|
compatibleOnly: true,
|
|
49
|
-
region:
|
|
49
|
+
region: params.region,
|
|
50
50
|
});
|
|
51
51
|
const alreadyDeployed = fns.find((f) => f.version === version_1.VERSION &&
|
|
52
|
-
f.memorySizeInMb ===
|
|
53
|
-
f.timeoutInSeconds ===
|
|
52
|
+
f.memorySizeInMb === params.memorySizeInMb &&
|
|
53
|
+
f.timeoutInSeconds === params.timeoutInSeconds &&
|
|
54
54
|
f.diskSizeInMb === diskSizeInMb);
|
|
55
55
|
const created = await (0, create_function_1.createFunction)({
|
|
56
|
-
createCloudWatchLogGroup:
|
|
57
|
-
region:
|
|
58
|
-
zipFile:
|
|
56
|
+
createCloudWatchLogGroup: params.createCloudWatchLogGroup,
|
|
57
|
+
region: params.region,
|
|
58
|
+
zipFile: params.architecture === 'arm64'
|
|
59
59
|
? function_zip_path_1.FUNCTION_ZIP_ARM64
|
|
60
60
|
: function_zip_path_1.FUNCTION_ZIP_X86_64,
|
|
61
61
|
functionName: fnNameRender,
|
|
62
62
|
accountId,
|
|
63
|
-
memorySizeInMb:
|
|
64
|
-
timeoutInSeconds:
|
|
65
|
-
retentionInDays: (_b =
|
|
63
|
+
memorySizeInMb: params.memorySizeInMb,
|
|
64
|
+
timeoutInSeconds: params.timeoutInSeconds,
|
|
65
|
+
retentionInDays: (_b = params.cloudWatchLogRetentionPeriodInDays) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_CLOUDWATCH_RETENTION_PERIOD,
|
|
66
66
|
alreadyCreated: Boolean(alreadyDeployed),
|
|
67
|
-
architecture:
|
|
67
|
+
architecture: params.architecture,
|
|
68
68
|
ephemerealStorageInMb: diskSizeInMb,
|
|
69
|
-
customRoleArn:
|
|
69
|
+
customRoleArn: params.customRoleArn,
|
|
70
70
|
});
|
|
71
71
|
if (!created.FunctionName) {
|
|
72
72
|
throw new Error('Lambda was created but has no name');
|
|
@@ -16,6 +16,7 @@ export declare type DeploySiteInput = {
|
|
|
16
16
|
rootDir?: string;
|
|
17
17
|
bypassBucketNameValidation?: boolean;
|
|
18
18
|
};
|
|
19
|
+
privacy?: 'public' | 'no-acl';
|
|
19
20
|
};
|
|
20
21
|
export declare type DeploySiteOutput = Promise<{
|
|
21
22
|
serveUrl: string;
|
|
@@ -35,4 +36,4 @@ export declare type DeploySiteOutput = Promise<{
|
|
|
35
36
|
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
36
37
|
* @param {object} params.options Further options, see documentation page for this function.
|
|
37
38
|
*/
|
|
38
|
-
export declare const deploySite: ({ bucketName, entryPoint, siteName, options, region, }: DeploySiteInput) => DeploySiteOutput;
|
|
39
|
+
export declare const deploySite: ({ bucketName, entryPoint, siteName, options, region, privacy: passedPrivacy, }: DeploySiteInput) => DeploySiteOutput;
|
package/dist/api/deploy-site.js
CHANGED
|
@@ -14,6 +14,7 @@ const make_s3_url_1 = require("../shared/make-s3-url");
|
|
|
14
14
|
const random_hash_1 = require("../shared/random-hash");
|
|
15
15
|
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
16
16
|
const validate_bucketname_1 = require("../shared/validate-bucketname");
|
|
17
|
+
const validate_privacy_1 = require("../shared/validate-privacy");
|
|
17
18
|
const validate_site_name_1 = require("../shared/validate-site-name");
|
|
18
19
|
const bucket_exists_1 = require("./bucket-exists");
|
|
19
20
|
const upload_dir_1 = require("./upload-dir");
|
|
@@ -26,7 +27,7 @@ const upload_dir_1 = require("./upload-dir");
|
|
|
26
27
|
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
27
28
|
* @param {object} params.options Further options, see documentation page for this function.
|
|
28
29
|
*/
|
|
29
|
-
const deploySite = async ({ bucketName, entryPoint, siteName, options, region, }) => {
|
|
30
|
+
const deploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy: passedPrivacy, }) => {
|
|
30
31
|
var _a, _b, _c, _d;
|
|
31
32
|
(0, validate_aws_region_1.validateAwsRegion)(region);
|
|
32
33
|
(0, validate_bucketname_1.validateBucketName)(bucketName, {
|
|
@@ -34,6 +35,8 @@ const deploySite = async ({ bucketName, entryPoint, siteName, options, region, }
|
|
|
34
35
|
});
|
|
35
36
|
const siteId = siteName !== null && siteName !== void 0 ? siteName : (0, random_hash_1.randomHash)();
|
|
36
37
|
(0, validate_site_name_1.validateSiteName)(siteId);
|
|
38
|
+
const privacy = passedPrivacy !== null && passedPrivacy !== void 0 ? passedPrivacy : 'public';
|
|
39
|
+
(0, validate_privacy_1.validatePrivacy)(privacy, false);
|
|
37
40
|
const accountId = await (0, get_account_id_1.getAccountId)({ region });
|
|
38
41
|
const bucketExists = await (0, bucket_exists_1.bucketExistsInRegion)({
|
|
39
42
|
bucketName,
|
|
@@ -74,7 +77,7 @@ const deploySite = async ({ bucketName, entryPoint, siteName, options, region, }
|
|
|
74
77
|
localDir: bundled,
|
|
75
78
|
onProgress: (_d = options === null || options === void 0 ? void 0 : options.onUploadProgress) !== null && _d !== void 0 ? _d : (() => undefined),
|
|
76
79
|
keyPrefix: subFolder,
|
|
77
|
-
privacy: 'public',
|
|
80
|
+
privacy: privacy !== null && privacy !== void 0 ? privacy : 'public',
|
|
78
81
|
toUpload,
|
|
79
82
|
}),
|
|
80
83
|
Promise.all(toDelete.map((d) => {
|
|
@@ -14,7 +14,7 @@ export declare type DownloadMediaOutput = {
|
|
|
14
14
|
sizeInBytes: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* @description
|
|
17
|
+
* @description Downloads a rendered video, audio or still to the disk of the machine this API is called from.
|
|
18
18
|
* @see [Documentation](https://remotion.dev/docs/lambda/downloadmedia)
|
|
19
19
|
* @param params.region The AWS region in which the media resides.
|
|
20
20
|
* @param params.bucketName The `bucketName` that was specified during the render.
|
|
@@ -11,7 +11,7 @@ const get_render_metadata_1 = require("../functions/helpers/get-render-metadata"
|
|
|
11
11
|
const read_with_progress_1 = require("../functions/helpers/read-with-progress");
|
|
12
12
|
const get_account_id_1 = require("../shared/get-account-id");
|
|
13
13
|
/**
|
|
14
|
-
* @description
|
|
14
|
+
* @description Downloads a rendered video, audio or still to the disk of the machine this API is called from.
|
|
15
15
|
* @see [Documentation](https://remotion.dev/docs/lambda/downloadmedia)
|
|
16
16
|
* @param params.region The AWS region in which the media resides.
|
|
17
17
|
* @param params.bucketName The `bucketName` that was specified during the render.
|
|
@@ -7,8 +7,8 @@ export declare type GetFunctionsInput = {
|
|
|
7
7
|
/**
|
|
8
8
|
* @description Lists Remotion Lambda render functions deployed to AWS Lambda.
|
|
9
9
|
* @see [Documentation](https://remotion.dev/docs/lambda/getfunctions)
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
10
|
+
* @param params.region The region of which the functions should be listed.
|
|
11
|
+
* @param params.compatibleOnly Whether only functions compatible with the installed version of Remotion Lambda should be returned.
|
|
12
12
|
* @returns {Promise<FunctionInfo[]>} An array with the objects containing information about the deployed functions.
|
|
13
13
|
*/
|
|
14
|
-
export declare const getFunctions: (
|
|
14
|
+
export declare const getFunctions: (params: GetFunctionsInput) => Promise<FunctionInfo[]>;
|
|
@@ -29,15 +29,15 @@ const getAllFunctions = async ({ existing, nextMarker, region, }) => {
|
|
|
29
29
|
/**
|
|
30
30
|
* @description Lists Remotion Lambda render functions deployed to AWS Lambda.
|
|
31
31
|
* @see [Documentation](https://remotion.dev/docs/lambda/getfunctions)
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
32
|
+
* @param params.region The region of which the functions should be listed.
|
|
33
|
+
* @param params.compatibleOnly Whether only functions compatible with the installed version of Remotion Lambda should be returned.
|
|
34
34
|
* @returns {Promise<FunctionInfo[]>} An array with the objects containing information about the deployed functions.
|
|
35
35
|
*/
|
|
36
|
-
const getFunctions = async (
|
|
36
|
+
const getFunctions = async (params) => {
|
|
37
37
|
const lambdas = await getAllFunctions({
|
|
38
38
|
existing: [],
|
|
39
39
|
nextMarker: null,
|
|
40
|
-
region:
|
|
40
|
+
region: params.region,
|
|
41
41
|
});
|
|
42
42
|
const remotionLambdas = lambdas.filter((f) => {
|
|
43
43
|
var _a;
|
|
@@ -47,7 +47,7 @@ const getFunctions = async (options) => {
|
|
|
47
47
|
try {
|
|
48
48
|
const version = await (0, get_function_version_1.getFunctionVersion)({
|
|
49
49
|
functionName: fn.FunctionName,
|
|
50
|
-
region:
|
|
50
|
+
region: params.region,
|
|
51
51
|
});
|
|
52
52
|
return version;
|
|
53
53
|
}
|
|
@@ -65,11 +65,11 @@ const getFunctions = async (options) => {
|
|
|
65
65
|
diskSizeInMb: (_b = (_a = lambda.EphemeralStorage) === null || _a === void 0 ? void 0 : _a.Size) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB,
|
|
66
66
|
};
|
|
67
67
|
});
|
|
68
|
-
if (!
|
|
68
|
+
if (!params.compatibleOnly) {
|
|
69
69
|
return list;
|
|
70
70
|
}
|
|
71
71
|
return list.filter((l) => {
|
|
72
|
-
if (!
|
|
72
|
+
if (!params.compatibleOnly) {
|
|
73
73
|
return true;
|
|
74
74
|
}
|
|
75
75
|
return l.version === version_1.VERSION;
|
|
@@ -10,7 +10,7 @@ export declare type GetOrCreateBucketOutput = {
|
|
|
10
10
|
/**
|
|
11
11
|
* @description Creates a bucket for Remotion Lambda in your S3 account. If one already exists, it will get returned instead.
|
|
12
12
|
* @see [Documentation](https://remotion.dev/docs/lambda/getorcreatebucket)
|
|
13
|
-
* @param
|
|
13
|
+
* @param params.region The region in which you want your S3 bucket to reside in.
|
|
14
14
|
* @returns {Promise<GetOrCreateBucketOutput>} An object containing the `bucketName`.
|
|
15
15
|
*/
|
|
16
|
-
export declare const getOrCreateBucket: (
|
|
16
|
+
export declare const getOrCreateBucket: (params: GetOrCreateBucketInput) => Promise<GetOrCreateBucketOutput>;
|
|
@@ -8,25 +8,25 @@ const get_buckets_1 = require("./get-buckets");
|
|
|
8
8
|
/**
|
|
9
9
|
* @description Creates a bucket for Remotion Lambda in your S3 account. If one already exists, it will get returned instead.
|
|
10
10
|
* @see [Documentation](https://remotion.dev/docs/lambda/getorcreatebucket)
|
|
11
|
-
* @param
|
|
11
|
+
* @param params.region The region in which you want your S3 bucket to reside in.
|
|
12
12
|
* @returns {Promise<GetOrCreateBucketOutput>} An object containing the `bucketName`.
|
|
13
13
|
*/
|
|
14
|
-
const getOrCreateBucket = async (
|
|
14
|
+
const getOrCreateBucket = async (params) => {
|
|
15
15
|
var _a, _b;
|
|
16
|
-
const { remotionBuckets } = await (0, get_buckets_1.getRemotionS3Buckets)(
|
|
16
|
+
const { remotionBuckets } = await (0, get_buckets_1.getRemotionS3Buckets)(params.region);
|
|
17
17
|
if (remotionBuckets.length > 1) {
|
|
18
|
-
throw new Error(`You have multiple buckets (${remotionBuckets.map((b) => b.name)}) in your S3 region (${
|
|
18
|
+
throw new Error(`You have multiple buckets (${remotionBuckets.map((b) => b.name)}) in your S3 region (${params.region}) starting with "${constants_1.REMOTION_BUCKET_PREFIX}". Please see https://remotion.dev/docs/lambda/multiple-buckets.`);
|
|
19
19
|
}
|
|
20
20
|
if (remotionBuckets.length === 1) {
|
|
21
|
-
(_a =
|
|
21
|
+
(_a = params.onBucketEnsured) === null || _a === void 0 ? void 0 : _a.call(params);
|
|
22
22
|
return { bucketName: remotionBuckets[0].name, alreadyExisted: true };
|
|
23
23
|
}
|
|
24
|
-
const bucketName = (0, validate_bucketname_1.makeBucketName)(
|
|
24
|
+
const bucketName = (0, validate_bucketname_1.makeBucketName)(params.region);
|
|
25
25
|
await (0, create_bucket_1.createBucket)({
|
|
26
26
|
bucketName,
|
|
27
|
-
region:
|
|
27
|
+
region: params.region,
|
|
28
28
|
});
|
|
29
|
-
(_b =
|
|
29
|
+
(_b = params.onBucketEnsured) === null || _b === void 0 ? void 0 : _b.call(params);
|
|
30
30
|
return { bucketName, alreadyExisted: false };
|
|
31
31
|
};
|
|
32
32
|
exports.getOrCreateBucket = getOrCreateBucket;
|
|
@@ -18,4 +18,4 @@ export declare type GetRenderInput = {
|
|
|
18
18
|
* @param {CustomCredentials} params.s3OutputProvider? Endpoint and credentials if the output file is stored outside of AWS.
|
|
19
19
|
* @returns {Promise<RenderProgress>} See documentation for this function to see all properties on the return object.
|
|
20
20
|
*/
|
|
21
|
-
export declare const getRenderProgress: (
|
|
21
|
+
export declare const getRenderProgress: (input: GetRenderInput) => Promise<RenderProgress>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRenderProgress = void 0;
|
|
4
|
-
const version_1 = require("remotion/version");
|
|
5
4
|
const call_lambda_1 = require("../shared/call-lambda");
|
|
6
5
|
const constants_1 = require("../shared/constants");
|
|
6
|
+
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
7
7
|
/**
|
|
8
8
|
* @description Gets the current status of a render originally triggered via renderMediaOnLambda().
|
|
9
9
|
* @see [Documentation](https://remotion.dev/docs/lambda/getrenderprogress)
|
|
@@ -14,17 +14,12 @@ const constants_1 = require("../shared/constants");
|
|
|
14
14
|
* @param {CustomCredentials} params.s3OutputProvider? Endpoint and credentials if the output file is stored outside of AWS.
|
|
15
15
|
* @returns {Promise<RenderProgress>} See documentation for this function to see all properties on the return object.
|
|
16
16
|
*/
|
|
17
|
-
const getRenderProgress = async (
|
|
17
|
+
const getRenderProgress = async (input) => {
|
|
18
18
|
const result = await (0, call_lambda_1.callLambda)({
|
|
19
|
-
functionName,
|
|
19
|
+
functionName: input.functionName,
|
|
20
20
|
type: constants_1.LambdaRoutines.status,
|
|
21
|
-
payload:
|
|
22
|
-
|
|
23
|
-
renderId,
|
|
24
|
-
version: version_1.VERSION,
|
|
25
|
-
s3OutputProvider,
|
|
26
|
-
},
|
|
27
|
-
region,
|
|
21
|
+
payload: (0, make_lambda_payload_1.getRenderProgressPayload)(input),
|
|
22
|
+
region: input.region,
|
|
28
23
|
});
|
|
29
24
|
return result;
|
|
30
25
|
};
|
|
@@ -1,41 +1,5 @@
|
|
|
1
|
+
import type { LambdaStartPayload, LambdaStatusPayload } from '../defaults';
|
|
2
|
+
import type { GetRenderInput } from './get-render-progress';
|
|
1
3
|
import type { RenderMediaOnLambdaInput } from './render-media-on-lambda';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
framesPerLambda: number | null;
|
|
5
|
-
composition: string;
|
|
6
|
-
serveUrl: string;
|
|
7
|
-
inputProps: import("../defaults").SerializedInputProps;
|
|
8
|
-
codec: "h264" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "gif";
|
|
9
|
-
imageFormat: "png" | "jpeg" | "none";
|
|
10
|
-
crf: number | undefined;
|
|
11
|
-
envVariables: Record<string, string> | undefined;
|
|
12
|
-
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le" | undefined;
|
|
13
|
-
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
14
|
-
quality: number | undefined;
|
|
15
|
-
maxRetries: number;
|
|
16
|
-
privacy: import("../defaults").Privacy;
|
|
17
|
-
logLevel: "verbose" | "info" | "warn" | "error";
|
|
18
|
-
frameRange: import("@remotion/renderer").FrameRange | null;
|
|
19
|
-
outName: import("../defaults").OutNameInput | null;
|
|
20
|
-
timeoutInMilliseconds: number;
|
|
21
|
-
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
22
|
-
scale: number;
|
|
23
|
-
everyNthFrame: number;
|
|
24
|
-
numberOfGifLoops: number;
|
|
25
|
-
concurrencyPerLambda: number;
|
|
26
|
-
downloadBehavior: import("../shared/content-disposition-header").DownloadBehavior;
|
|
27
|
-
muted: boolean;
|
|
28
|
-
version: string;
|
|
29
|
-
overwrite: boolean;
|
|
30
|
-
audioBitrate: string | null;
|
|
31
|
-
videoBitrate: string | null;
|
|
32
|
-
webhook: {
|
|
33
|
-
url: string;
|
|
34
|
-
secret: string | null;
|
|
35
|
-
} | null;
|
|
36
|
-
forceHeight: number | null;
|
|
37
|
-
forceWidth: number | null;
|
|
38
|
-
bucketName: string | null;
|
|
39
|
-
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
40
|
-
dumpBrowserLogs: boolean;
|
|
41
|
-
}>;
|
|
4
|
+
export declare const makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, quality, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, downloadBehavior, muted, overwrite, dumpBrowserLogs, }: RenderMediaOnLambdaInput) => Promise<LambdaStartPayload>;
|
|
5
|
+
export declare const getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, }: GetRenderInput) => LambdaStatusPayload;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getRenderProgressPayload = exports.makeLambdaRenderMediaPayload = void 0;
|
|
4
4
|
const version_1 = require("remotion/version");
|
|
5
|
+
const defaults_1 = require("../defaults");
|
|
5
6
|
const serialize_input_props_1 = require("../shared/serialize-input-props");
|
|
6
7
|
const validate_download_behavior_1 = require("../shared/validate-download-behavior");
|
|
7
8
|
const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
|
|
8
9
|
const validate_lambda_codec_1 = require("../shared/validate-lambda-codec");
|
|
9
10
|
const validate_serveurl_1 = require("../shared/validate-serveurl");
|
|
10
|
-
const
|
|
11
|
+
const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, quality, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, downloadBehavior, muted, overwrite, dumpBrowserLogs, }) => {
|
|
11
12
|
const actualCodec = (0, validate_lambda_codec_1.validateLambdaCodec)(codec);
|
|
12
13
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
13
14
|
(0, validate_frames_per_lambda_1.validateFramesPerLambda)({
|
|
@@ -57,6 +58,17 @@ const makeLambdaPayload = async ({ rendererFunctionName, frameRange, framesPerLa
|
|
|
57
58
|
bucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
58
59
|
audioCodec: audioCodec !== null && audioCodec !== void 0 ? audioCodec : null,
|
|
59
60
|
dumpBrowserLogs: dumpBrowserLogs !== null && dumpBrowserLogs !== void 0 ? dumpBrowserLogs : false,
|
|
61
|
+
type: defaults_1.LambdaRoutines.start,
|
|
60
62
|
};
|
|
61
63
|
};
|
|
62
|
-
exports.
|
|
64
|
+
exports.makeLambdaRenderMediaPayload = makeLambdaRenderMediaPayload;
|
|
65
|
+
const getRenderProgressPayload = ({ bucketName, renderId, s3OutputProvider, }) => {
|
|
66
|
+
return {
|
|
67
|
+
type: defaults_1.LambdaRoutines.status,
|
|
68
|
+
bucketName,
|
|
69
|
+
renderId,
|
|
70
|
+
version: version_1.VERSION,
|
|
71
|
+
s3OutputProvider,
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
exports.getRenderProgressPayload = getRenderProgressPayload;
|
|
@@ -32,7 +32,7 @@ const renderMediaOnLambda = async (input) => {
|
|
|
32
32
|
const res = await (0, call_lambda_1.callLambda)({
|
|
33
33
|
functionName,
|
|
34
34
|
type: constants_1.LambdaRoutines.start,
|
|
35
|
-
payload: await (0, make_lambda_payload_1.
|
|
35
|
+
payload: await (0, make_lambda_payload_1.makeLambdaRenderMediaPayload)(input),
|
|
36
36
|
region,
|
|
37
37
|
});
|
|
38
38
|
return {
|
|
@@ -6,9 +6,9 @@ export declare type SpeculateFunctionNameInput = {
|
|
|
6
6
|
/**
|
|
7
7
|
* @description Speculate the name of a lambda function that will be created when you call `deployFunction`, based on the function configuration.
|
|
8
8
|
* @see [Documentation](https://www.remotion.dev/docs/lambda/speculatefunctionname)
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
9
|
+
* @param params.memorySizeInMb How much memory is allocated to the Lambda function.
|
|
10
|
+
* @param params.diskSizeInMb The amount of storage the function is allocated.
|
|
11
|
+
* @param params.timeoutInSeconds Time in seconds until the function times out.
|
|
12
12
|
* @returns {string} The speculated lambda function name
|
|
13
13
|
*/
|
|
14
14
|
export declare const speculateFunctionName: ({ memorySizeInMb, diskSizeInMb, timeoutInSeconds, }: SpeculateFunctionNameInput) => string;
|
|
@@ -6,9 +6,9 @@ const lambda_version_string_1 = require("../shared/lambda-version-string");
|
|
|
6
6
|
/**
|
|
7
7
|
* @description Speculate the name of a lambda function that will be created when you call `deployFunction`, based on the function configuration.
|
|
8
8
|
* @see [Documentation](https://www.remotion.dev/docs/lambda/speculatefunctionname)
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
9
|
+
* @param params.memorySizeInMb How much memory is allocated to the Lambda function.
|
|
10
|
+
* @param params.diskSizeInMb The amount of storage the function is allocated.
|
|
11
|
+
* @param params.timeoutInSeconds Time in seconds until the function times out.
|
|
12
12
|
* @returns {string} The speculated lambda function name
|
|
13
13
|
*/
|
|
14
14
|
const speculateFunctionName = ({ memorySizeInMb, diskSizeInMb, timeoutInSeconds, }) => {
|
|
@@ -54,7 +54,7 @@ const renderCommand = async (args, remotionRoot) => {
|
|
|
54
54
|
const maxRetries = (_b = args_1.parsedLambdaCli['max-retries']) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_MAX_RETRIES;
|
|
55
55
|
(0, validate_retries_1.validateMaxRetries)(maxRetries);
|
|
56
56
|
const privacy = (_c = args_1.parsedLambdaCli.privacy) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OUTPUT_PRIVACY;
|
|
57
|
-
(0, validate_privacy_1.validatePrivacy)(privacy);
|
|
57
|
+
(0, validate_privacy_1.validatePrivacy)(privacy, true);
|
|
58
58
|
const framesPerLambda = (_d = args_1.parsedLambdaCli['frames-per-lambda']) !== null && _d !== void 0 ? _d : undefined;
|
|
59
59
|
(0, validate_frames_per_lambda_1.validateFramesPerLambda)({ framesPerLambda, durationInFrames: 1 });
|
|
60
60
|
const res = await (0, render_media_on_lambda_1.renderMediaOnLambda)({
|
|
@@ -90,6 +90,7 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
|
|
|
90
90
|
webpackOverride: (_c = cli_1.ConfigInternals.getWebpackOverrideFn()) !== null && _c !== void 0 ? _c : ((f) => f),
|
|
91
91
|
},
|
|
92
92
|
region: (0, get_aws_region_1.getAwsRegion)(),
|
|
93
|
+
privacy: args_1.parsedLambdaCli.privacy,
|
|
93
94
|
});
|
|
94
95
|
const uploadDuration = Date.now() - uploadStart;
|
|
95
96
|
multiProgress.deployProgress = {
|
|
@@ -45,7 +45,7 @@ const stillCommand = async (args, remotionRoot) => {
|
|
|
45
45
|
const maxRetries = (_b = args_1.parsedLambdaCli['max-retries']) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_MAX_RETRIES;
|
|
46
46
|
(0, validate_retries_1.validateMaxRetries)(maxRetries);
|
|
47
47
|
const privacy = (_c = args_1.parsedLambdaCli.privacy) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OUTPUT_PRIVACY;
|
|
48
|
-
(0, validate_privacy_1.validatePrivacy)(privacy);
|
|
48
|
+
(0, validate_privacy_1.validatePrivacy)(privacy, true);
|
|
49
49
|
const { format: imageFormat, source: imageFormatReason } = cli_1.CliInternals.determineFinalImageFormat({
|
|
50
50
|
downloadName,
|
|
51
51
|
outName: outName !== null && outName !== void 0 ? outName : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-
|
|
1
|
+
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "sa-east-1" | "eu-south-1" | "af-south-1" | "ap-east-1" | "me-south-1";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import type { _Object } from '@aws-sdk/client-s3';
|
|
2
3
|
import type { ReadStream } from 'fs';
|
|
3
4
|
import type { Readable } from 'stream';
|
|
@@ -20,7 +21,7 @@ export declare const lambdaDeleteFile: ({ bucketName, key, region, customCredent
|
|
|
20
21
|
key: string;
|
|
21
22
|
customCredentials: CustomCredentials | null;
|
|
22
23
|
}) => Promise<void>;
|
|
23
|
-
|
|
24
|
+
declare type LambdaWriteFileInput = {
|
|
24
25
|
bucketName: string;
|
|
25
26
|
key: string;
|
|
26
27
|
body: ReadStream | string;
|
|
@@ -29,6 +30,10 @@ export declare const lambdaWriteFile: ({ bucketName, key, body, region, privacy,
|
|
|
29
30
|
expectedBucketOwner: string | null;
|
|
30
31
|
downloadBehavior: DownloadBehavior | null;
|
|
31
32
|
customCredentials: CustomCredentials | null;
|
|
33
|
+
};
|
|
34
|
+
export declare const tryLambdaWriteFile: ({ bucketName, key, body, region, privacy, expectedBucketOwner, downloadBehavior, customCredentials, }: LambdaWriteFileInput) => Promise<void>;
|
|
35
|
+
export declare const lambdaWriteFile: (params: LambdaWriteFileInput & {
|
|
36
|
+
retries?: number;
|
|
32
37
|
}) => Promise<void>;
|
|
33
38
|
export declare const lambdaReadFile: ({ bucketName, key, region, expectedBucketOwner, }: {
|
|
34
39
|
bucketName: string;
|
|
@@ -44,3 +49,4 @@ export declare const lambdaHeadCommand: ({ bucketName, key, region, }: {
|
|
|
44
49
|
LastModified?: Date | undefined;
|
|
45
50
|
ContentLength?: number | undefined;
|
|
46
51
|
}>;
|
|
52
|
+
export {};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.lambdaHeadCommand = exports.lambdaReadFile = exports.lambdaWriteFile = exports.lambdaDeleteFile = exports.lambdaLs = void 0;
|
|
6
|
+
exports.lambdaHeadCommand = exports.lambdaReadFile = exports.lambdaWriteFile = exports.tryLambdaWriteFile = exports.lambdaDeleteFile = exports.lambdaLs = void 0;
|
|
7
7
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
8
8
|
const mime_types_1 = __importDefault(require("mime-types"));
|
|
9
9
|
const aws_clients_1 = require("../../shared/aws-clients");
|
|
@@ -54,7 +54,7 @@ const lambdaDeleteFile = async ({ bucketName, key, region, customCredentials, })
|
|
|
54
54
|
}));
|
|
55
55
|
};
|
|
56
56
|
exports.lambdaDeleteFile = lambdaDeleteFile;
|
|
57
|
-
const
|
|
57
|
+
const tryLambdaWriteFile = async ({ bucketName, key, body, region, privacy, expectedBucketOwner, downloadBehavior, customCredentials, }) => {
|
|
58
58
|
await (0, aws_clients_1.getS3Client)(region, customCredentials).send(new client_s3_1.PutObjectCommand({
|
|
59
59
|
Bucket: bucketName,
|
|
60
60
|
Key: key,
|
|
@@ -71,6 +71,26 @@ const lambdaWriteFile = async ({ bucketName, key, body, region, privacy, expecte
|
|
|
71
71
|
ContentDisposition: (0, content_disposition_header_1.getContentDispositionHeader)(downloadBehavior),
|
|
72
72
|
}));
|
|
73
73
|
};
|
|
74
|
+
exports.tryLambdaWriteFile = tryLambdaWriteFile;
|
|
75
|
+
const lambdaWriteFile = async (params) => {
|
|
76
|
+
var _a;
|
|
77
|
+
const remainingRetries = (_a = params.retries) !== null && _a !== void 0 ? _a : 2;
|
|
78
|
+
try {
|
|
79
|
+
await (0, exports.tryLambdaWriteFile)(params);
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
if (remainingRetries === 0) {
|
|
83
|
+
throw err;
|
|
84
|
+
}
|
|
85
|
+
console.warn('Failed to write file to Lambda:');
|
|
86
|
+
console.warn(err);
|
|
87
|
+
console.warn(`Retrying (${remainingRetries} retries remaining)...`);
|
|
88
|
+
return (0, exports.lambdaWriteFile)({
|
|
89
|
+
...params,
|
|
90
|
+
retries: (remainingRetries !== null && remainingRetries !== void 0 ? remainingRetries : 0) - 1,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
74
94
|
exports.lambdaWriteFile = lambdaWriteFile;
|
|
75
95
|
const lambdaReadFile = async ({ bucketName, key, region, expectedBucketOwner, }) => {
|
|
76
96
|
const { Body } = await (0, aws_clients_1.getS3Client)(region, null).send(new client_s3_1.GetObjectCommand({
|
package/dist/functions/launch.js
CHANGED
|
@@ -181,7 +181,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
181
181
|
throw new Error(`Too many functions: This render would cause ${chunkCount} functions to spawn. We limit this amount to ${constants_1.MAX_FUNCTIONS_PER_RENDER} functions as more would result in diminishing returns. Values set: frameCount = ${frameCount}, framesPerLambda=${framesPerLambda}. See ${docs_url_1.DOCS_URL}/docs/lambda/concurrency#too-many-functions for help.`);
|
|
182
182
|
}
|
|
183
183
|
(0, validate_outname_1.validateOutname)(params.outName, params.codec, params.audioCodec);
|
|
184
|
-
(0, validate_privacy_1.validatePrivacy)(params.privacy);
|
|
184
|
+
(0, validate_privacy_1.validatePrivacy)(params.privacy, true);
|
|
185
185
|
renderer_1.RenderInternals.validatePuppeteerTimeout(params.timeoutInMilliseconds);
|
|
186
186
|
const { chunks } = (0, plan_frame_ranges_1.planFrameRanges)({
|
|
187
187
|
framesPerLambda,
|
package/dist/functions/still.js
CHANGED
|
@@ -43,7 +43,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
43
43
|
throw new Error(`Version mismatch: When calling renderStillOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${version_1.VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call renderStillOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
44
44
|
}
|
|
45
45
|
(0, validate_download_behavior_1.validateDownloadBehavior)(lambdaParams.downloadBehavior);
|
|
46
|
-
(0, validate_privacy_1.validatePrivacy)(lambdaParams.privacy);
|
|
46
|
+
(0, validate_privacy_1.validatePrivacy)(lambdaParams.privacy, true);
|
|
47
47
|
(0, validate_outname_1.validateOutname)(lambdaParams.outName, null, null);
|
|
48
48
|
const start = Date.now();
|
|
49
49
|
const [bucketName, browserInstance] = await Promise.all([
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,43 +1,5 @@
|
|
|
1
1
|
export declare const LambdaInternals: {
|
|
2
2
|
executeCommand: (args: string[], remotionRoot: string) => Promise<void>;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
framesPerLambda: number | null;
|
|
6
|
-
composition: string;
|
|
7
|
-
serveUrl: string;
|
|
8
|
-
inputProps: import("./defaults").SerializedInputProps;
|
|
9
|
-
codec: "h264" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "gif";
|
|
10
|
-
imageFormat: "png" | "jpeg" | "none";
|
|
11
|
-
crf: number | undefined;
|
|
12
|
-
envVariables: Record<string, string> | undefined;
|
|
13
|
-
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le" | undefined;
|
|
14
|
-
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
15
|
-
quality: number | undefined;
|
|
16
|
-
maxRetries: number;
|
|
17
|
-
privacy: import("./defaults").Privacy;
|
|
18
|
-
logLevel: "verbose" | "info" | "warn" | "error";
|
|
19
|
-
frameRange: import("@remotion/renderer").FrameRange | null;
|
|
20
|
-
outName: import("./defaults").OutNameInput | null;
|
|
21
|
-
timeoutInMilliseconds: number;
|
|
22
|
-
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
23
|
-
scale: number;
|
|
24
|
-
everyNthFrame: number;
|
|
25
|
-
numberOfGifLoops: number;
|
|
26
|
-
concurrencyPerLambda: number;
|
|
27
|
-
downloadBehavior: import("./shared/content-disposition-header").DownloadBehavior;
|
|
28
|
-
muted: boolean;
|
|
29
|
-
version: string;
|
|
30
|
-
overwrite: boolean;
|
|
31
|
-
audioBitrate: string | null;
|
|
32
|
-
videoBitrate: string | null;
|
|
33
|
-
webhook: {
|
|
34
|
-
url: string;
|
|
35
|
-
secret: string | null;
|
|
36
|
-
} | null;
|
|
37
|
-
forceHeight: number | null;
|
|
38
|
-
forceWidth: number | null;
|
|
39
|
-
bucketName: string | null;
|
|
40
|
-
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
41
|
-
dumpBrowserLogs: boolean;
|
|
42
|
-
}>;
|
|
3
|
+
makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, quality, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, downloadBehavior, muted, overwrite, dumpBrowserLogs, }: import(".").RenderMediaOnLambdaInput) => Promise<import("./defaults").LambdaStartPayload>;
|
|
4
|
+
getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, }: import(".").GetRenderInput) => import("./defaults").LambdaStatusPayload;
|
|
43
5
|
};
|
package/dist/internals.js
CHANGED
|
@@ -5,5 +5,6 @@ const make_lambda_payload_1 = require("./api/make-lambda-payload");
|
|
|
5
5
|
const index_1 = require("./cli/index");
|
|
6
6
|
exports.LambdaInternals = {
|
|
7
7
|
executeCommand: index_1.executeCommand,
|
|
8
|
-
|
|
8
|
+
makeLambdaRenderMediaPayload: make_lambda_payload_1.makeLambdaRenderMediaPayload,
|
|
9
|
+
getRenderProgressPayload: make_lambda_payload_1.getRenderProgressPayload,
|
|
9
10
|
};
|
|
@@ -106,48 +106,56 @@ export declare type SerializedInputProps = {
|
|
|
106
106
|
type: 'payload';
|
|
107
107
|
payload: unknown;
|
|
108
108
|
};
|
|
109
|
+
export declare type LambdaStartPayload = {
|
|
110
|
+
rendererFunctionName: string | null;
|
|
111
|
+
type: LambdaRoutines.start;
|
|
112
|
+
serveUrl: string;
|
|
113
|
+
composition: string;
|
|
114
|
+
framesPerLambda: number | null;
|
|
115
|
+
inputProps: SerializedInputProps;
|
|
116
|
+
codec: LambdaCodec;
|
|
117
|
+
audioCodec: AudioCodec | null;
|
|
118
|
+
imageFormat: ImageFormat;
|
|
119
|
+
crf: number | undefined;
|
|
120
|
+
envVariables: Record<string, string> | undefined;
|
|
121
|
+
pixelFormat: PixelFormat | undefined;
|
|
122
|
+
proResProfile: ProResProfile | undefined;
|
|
123
|
+
quality: number | undefined;
|
|
124
|
+
maxRetries: number;
|
|
125
|
+
privacy: Privacy;
|
|
126
|
+
logLevel: LogLevel;
|
|
127
|
+
frameRange: FrameRange | null;
|
|
128
|
+
outName: OutNameInput | null;
|
|
129
|
+
timeoutInMilliseconds: number;
|
|
130
|
+
chromiumOptions: ChromiumOptions;
|
|
131
|
+
scale: number;
|
|
132
|
+
everyNthFrame: number;
|
|
133
|
+
numberOfGifLoops: number | null;
|
|
134
|
+
concurrencyPerLambda: number;
|
|
135
|
+
downloadBehavior: DownloadBehavior;
|
|
136
|
+
muted: boolean;
|
|
137
|
+
version: string;
|
|
138
|
+
overwrite: boolean;
|
|
139
|
+
audioBitrate: string | null;
|
|
140
|
+
videoBitrate: string | null;
|
|
141
|
+
webhook: WebhookOption;
|
|
142
|
+
forceHeight: number | null;
|
|
143
|
+
forceWidth: number | null;
|
|
144
|
+
bucketName: string | null;
|
|
145
|
+
dumpBrowserLogs: boolean;
|
|
146
|
+
};
|
|
147
|
+
export declare type LambdaStatusPayload = {
|
|
148
|
+
type: LambdaRoutines.status;
|
|
149
|
+
bucketName: string;
|
|
150
|
+
renderId: string;
|
|
151
|
+
version: string;
|
|
152
|
+
s3OutputProvider?: CustomCredentials;
|
|
153
|
+
};
|
|
109
154
|
export declare type LambdaPayloads = {
|
|
110
155
|
info: {
|
|
111
156
|
type: LambdaRoutines.info;
|
|
112
157
|
};
|
|
113
|
-
start:
|
|
114
|
-
rendererFunctionName: string | null;
|
|
115
|
-
type: LambdaRoutines.start;
|
|
116
|
-
serveUrl: string;
|
|
117
|
-
composition: string;
|
|
118
|
-
framesPerLambda: number | null;
|
|
119
|
-
inputProps: SerializedInputProps;
|
|
120
|
-
codec: LambdaCodec;
|
|
121
|
-
audioCodec: AudioCodec | null;
|
|
122
|
-
imageFormat: ImageFormat;
|
|
123
|
-
crf: number | undefined;
|
|
124
|
-
envVariables: Record<string, string> | undefined;
|
|
125
|
-
pixelFormat: PixelFormat | undefined;
|
|
126
|
-
proResProfile: ProResProfile | undefined;
|
|
127
|
-
quality: number | undefined;
|
|
128
|
-
maxRetries: number;
|
|
129
|
-
privacy: Privacy;
|
|
130
|
-
logLevel: LogLevel;
|
|
131
|
-
frameRange: FrameRange | null;
|
|
132
|
-
outName: OutNameInput | null;
|
|
133
|
-
timeoutInMilliseconds: number;
|
|
134
|
-
chromiumOptions: ChromiumOptions;
|
|
135
|
-
scale: number;
|
|
136
|
-
everyNthFrame: number;
|
|
137
|
-
numberOfGifLoops: number | null;
|
|
138
|
-
concurrencyPerLambda: number;
|
|
139
|
-
downloadBehavior: DownloadBehavior;
|
|
140
|
-
muted: boolean;
|
|
141
|
-
version: string;
|
|
142
|
-
overwrite: boolean;
|
|
143
|
-
audioBitrate: string | null;
|
|
144
|
-
videoBitrate: string | null;
|
|
145
|
-
webhook: WebhookOption;
|
|
146
|
-
forceHeight: number | null;
|
|
147
|
-
forceWidth: number | null;
|
|
148
|
-
bucketName: string | null;
|
|
149
|
-
dumpBrowserLogs: boolean;
|
|
150
|
-
};
|
|
158
|
+
start: LambdaStartPayload;
|
|
151
159
|
launch: {
|
|
152
160
|
rendererFunctionName: string | null;
|
|
153
161
|
type: LambdaRoutines.launch;
|
|
@@ -186,13 +194,7 @@ export declare type LambdaPayloads = {
|
|
|
186
194
|
forceWidth: number | null;
|
|
187
195
|
dumpBrowserLogs: boolean;
|
|
188
196
|
};
|
|
189
|
-
status:
|
|
190
|
-
type: LambdaRoutines.status;
|
|
191
|
-
bucketName: string;
|
|
192
|
-
renderId: string;
|
|
193
|
-
version: string;
|
|
194
|
-
s3OutputProvider?: CustomCredentials;
|
|
195
|
-
};
|
|
197
|
+
status: LambdaStatusPayload;
|
|
196
198
|
renderer: {
|
|
197
199
|
concurrencyPerLambda: number;
|
|
198
200
|
type: LambdaRoutines.renderer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Privacy } from './constants';
|
|
2
|
-
export declare function validatePrivacy(privacy: unknown): asserts privacy is Privacy;
|
|
2
|
+
export declare function validatePrivacy(privacy: unknown, allowPrivate: boolean): asserts privacy is Privacy;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validatePrivacy = void 0;
|
|
4
|
-
function validatePrivacy(privacy) {
|
|
4
|
+
function validatePrivacy(privacy, allowPrivate) {
|
|
5
5
|
if (typeof privacy !== 'string') {
|
|
6
6
|
throw new TypeError('Privacy must be a string');
|
|
7
7
|
}
|
|
8
|
+
if (!allowPrivate && privacy === 'private') {
|
|
9
|
+
throw new TypeError('Privacy must be either "public" or "no-acl"');
|
|
10
|
+
}
|
|
8
11
|
if (privacy !== 'private' && privacy !== 'public' && privacy !== 'no-acl') {
|
|
9
12
|
throw new TypeError('Privacy must be either "private", "public" or "no-acl"');
|
|
10
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.97",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"@aws-sdk/credential-providers": "3.338.0",
|
|
24
24
|
"@aws-sdk/lib-storage": "3.338.0",
|
|
25
25
|
"@aws-sdk/s3-request-presigner": "3.338.0",
|
|
26
|
-
"@remotion/bundler": "3.3.
|
|
27
|
-
"@remotion/cli": "3.3.
|
|
28
|
-
"@remotion/renderer": "3.3.
|
|
26
|
+
"@remotion/bundler": "3.3.97",
|
|
27
|
+
"@remotion/cli": "3.3.97",
|
|
28
|
+
"@remotion/renderer": "3.3.97",
|
|
29
29
|
"aws-policies": "^1.0.1",
|
|
30
30
|
"mime-types": "2.1.34",
|
|
31
|
-
"remotion": "3.3.
|
|
31
|
+
"remotion": "3.3.97"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@jonny/eslint-config": "3.0.266",
|
|
35
|
-
"@remotion/bundler": "3.3.
|
|
36
|
-
"@remotion/compositor-linux-arm64-musl": "3.3.
|
|
37
|
-
"@remotion/compositor-linux-x64-musl": "3.3.
|
|
35
|
+
"@remotion/bundler": "3.3.97",
|
|
36
|
+
"@remotion/compositor-linux-arm64-musl": "3.3.97",
|
|
37
|
+
"@remotion/compositor-linux-x64-musl": "3.3.97",
|
|
38
38
|
"@types/mime-types": "2.1.1",
|
|
39
39
|
"@types/minimist": "1.2.2",
|
|
40
40
|
"@types/node": "^14.14.14",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"zip-lib": "^0.7.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@remotion/bundler": "3.3.
|
|
51
|
+
"@remotion/bundler": "3.3.97"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|
package/remotionlambda-x64.zip
CHANGED
|
Binary file
|