@remotion/lambda 4.0.114 → 4.0.116
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/get-compositions-on-lambda.d.ts +2 -4
- package/dist/api/get-function-info.d.ts +3 -1
- package/dist/api/get-function-info.js +2 -1
- package/dist/api/get-functions.d.ts +2 -0
- package/dist/api/get-functions.js +2 -0
- package/dist/api/get-render-progress.d.ts +2 -0
- package/dist/api/make-lambda-payload.d.ts +1 -1
- package/dist/api/make-lambda-payload.js +2 -1
- package/dist/api/render-media-on-lambda.d.ts +1 -12
- package/dist/api/render-still-on-lambda.d.ts +2 -8
- package/dist/cli/args.d.ts +1 -1
- package/dist/cli/commands/compositions/index.d.ts +1 -1
- package/dist/cli/commands/compositions/index.js +28 -10
- package/dist/cli/commands/functions/deploy.d.ts +2 -1
- package/dist/cli/commands/functions/deploy.js +3 -3
- package/dist/cli/commands/functions/index.d.ts +2 -1
- package/dist/cli/commands/functions/index.js +24 -24
- package/dist/cli/commands/functions/ls.d.ts +2 -1
- package/dist/cli/commands/functions/ls.js +7 -8
- package/dist/cli/commands/functions/rm.d.ts +2 -1
- package/dist/cli/commands/functions/rm.js +6 -7
- package/dist/cli/commands/functions/rmall.d.ts +2 -1
- package/dist/cli/commands/functions/rmall.js +2 -3
- package/dist/cli/commands/policies/policies.d.ts +2 -1
- package/dist/cli/commands/policies/policies.js +20 -20
- package/dist/cli/commands/policies/role.d.ts +2 -1
- package/dist/cli/commands/policies/role.js +2 -2
- package/dist/cli/commands/policies/user.d.ts +2 -1
- package/dist/cli/commands/policies/user.js +2 -2
- package/dist/cli/commands/policies/validate.d.ts +2 -1
- package/dist/cli/commands/policies/validate.js +4 -4
- package/dist/cli/commands/quotas/increase.js +8 -8
- package/dist/cli/commands/quotas/index.js +10 -10
- package/dist/cli/commands/quotas/list.js +10 -10
- package/dist/cli/commands/regions.d.ts +2 -1
- package/dist/cli/commands/regions.js +2 -2
- package/dist/cli/commands/render/render.js +92 -27
- package/dist/cli/commands/sites/create.js +16 -14
- package/dist/cli/commands/sites/index.js +21 -21
- package/dist/cli/commands/sites/ls.js +8 -8
- package/dist/cli/commands/sites/rm.d.ts +2 -1
- package/dist/cli/commands/sites/rm.js +8 -9
- package/dist/cli/commands/sites/rmall.d.ts +2 -1
- package/dist/cli/commands/sites/rmall.js +5 -6
- package/dist/cli/commands/still.js +49 -22
- package/dist/cli/help.d.ts +2 -1
- package/dist/cli/help.js +27 -27
- package/dist/cli/helpers/find-function-name.js +21 -21
- package/dist/cli/helpers/get-webhook-custom-data.js +3 -3
- package/dist/cli/index.js +27 -28
- package/dist/cli/log.d.ts +2 -4
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
- package/dist/functions/helpers/concat-videos.d.ts +2 -1
- package/dist/functions/helpers/concat-videos.js +2 -2
- package/dist/functions/helpers/get-browser-instance.js +8 -8
- package/dist/functions/helpers/lifecycle.js +1 -1
- package/dist/functions/helpers/merge-chunks.js +2 -1
- package/dist/functions/helpers/print-cloudwatch-helper.d.ts +2 -1
- package/dist/functions/helpers/print-cloudwatch-helper.js +2 -2
- package/dist/functions/index.js +8 -13
- package/dist/functions/launch.js +23 -23
- package/dist/functions/merge.js +3 -3
- package/dist/functions/renderer.js +3 -3
- package/dist/internals.d.ts +1 -1
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/get-function-version.d.ts +3 -1
- package/dist/shared/get-function-version.js +2 -2
- package/dist/shared/invoke-webhook.d.ts +4 -1
- package/dist/shared/invoke-webhook.js +5 -5
- package/package.json +8 -8
- package/remotionlambda-arm64.zip +0 -0
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sitesRmallSubcommand = exports.SITES_RMALL_COMMAND = void 0;
|
|
4
4
|
const cli_1 = require("@remotion/cli");
|
|
5
|
-
const client_1 = require("@remotion/renderer/client");
|
|
6
5
|
const delete_site_1 = require("../../../api/delete-site");
|
|
7
6
|
const get_or_create_bucket_1 = require("../../../api/get-or-create-bucket");
|
|
8
7
|
const get_sites_1 = require("../../../api/get-sites");
|
|
@@ -11,15 +10,15 @@ const get_aws_region_1 = require("../../get-aws-region");
|
|
|
11
10
|
const confirm_1 = require("../../helpers/confirm");
|
|
12
11
|
const log_1 = require("../../log");
|
|
13
12
|
exports.SITES_RMALL_COMMAND = 'rmall';
|
|
14
|
-
const sitesRmallSubcommand = async () => {
|
|
15
|
-
var _a
|
|
13
|
+
const sitesRmallSubcommand = async (logLevel) => {
|
|
14
|
+
var _a;
|
|
16
15
|
const region = (0, get_aws_region_1.getAwsRegion)();
|
|
17
16
|
const deployedSites = await (0, get_sites_1.getSites)({
|
|
18
17
|
region,
|
|
19
18
|
});
|
|
20
19
|
const bucketName = (_a = args_1.parsedLambdaCli['force-bucket-name']) !== null && _a !== void 0 ? _a : (await (0, get_or_create_bucket_1.internalGetOrCreateBucket)({
|
|
21
20
|
region,
|
|
22
|
-
enableFolderExpiry:
|
|
21
|
+
enableFolderExpiry: false,
|
|
23
22
|
customCredentials: null,
|
|
24
23
|
})).bucketName;
|
|
25
24
|
for (const site of deployedSites.sites) {
|
|
@@ -34,10 +33,10 @@ const sitesRmallSubcommand = async () => {
|
|
|
34
33
|
siteName: site.id,
|
|
35
34
|
region,
|
|
36
35
|
onAfterItemDeleted: ({ itemName }) => {
|
|
37
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray(`Deleted ${itemName}`));
|
|
36
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`Deleted ${itemName}`));
|
|
38
37
|
},
|
|
39
38
|
});
|
|
40
|
-
log_1.Log.info(`Deleted site ${site.id} and freed up ${cli_1.CliInternals.formatBytes(totalSize)}.`);
|
|
39
|
+
log_1.Log.info({ indent: false, logLevel }, `Deleted site ${site.id} and freed up ${cli_1.CliInternals.formatBytes(totalSize)}.`);
|
|
41
40
|
}
|
|
42
41
|
};
|
|
43
42
|
exports.sitesRmallSubcommand = sitesRmallSubcommand;
|
|
@@ -17,27 +17,48 @@ const get_aws_region_1 = require("../get-aws-region");
|
|
|
17
17
|
const find_function_name_1 = require("../helpers/find-function-name");
|
|
18
18
|
const quit_1 = require("../helpers/quit");
|
|
19
19
|
const log_1 = require("../log");
|
|
20
|
+
const { offthreadVideoCacheSizeInBytesOption, scaleOption, deleteAfterOption, jpegQualityOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, delayRenderTimeoutInMillisecondsOption, } = client_1.BrowserSafeApis.options;
|
|
21
|
+
const { parsedCli, determineFinalStillImageFormat, chalk, getCliOptions, formatBytes, getCompositionWithDimensionOverride, } = cli_1.CliInternals;
|
|
20
22
|
exports.STILL_COMMAND = 'still';
|
|
21
23
|
const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
22
24
|
var _a, _b, _c, _d, _e;
|
|
23
25
|
const serveUrl = args[0];
|
|
24
26
|
if (!serveUrl) {
|
|
25
|
-
log_1.Log.error('No serve URL passed.');
|
|
26
|
-
log_1.Log.info('Pass an additional argument specifying a URL where your Remotion project is hosted.');
|
|
27
|
-
log_1.Log.info();
|
|
28
|
-
log_1.Log.info(`${constants_1.BINARY_NAME} ${exports.STILL_COMMAND} <serve-url> <composition-id> [output-location]`);
|
|
27
|
+
log_1.Log.error({ indent: false, logLevel }, 'No serve URL passed.');
|
|
28
|
+
log_1.Log.info({ indent: false, logLevel }, 'Pass an additional argument specifying a URL where your Remotion project is hosted.');
|
|
29
|
+
log_1.Log.info({ indent: false, logLevel });
|
|
30
|
+
log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${exports.STILL_COMMAND} <serve-url> <composition-id> [output-location]`);
|
|
29
31
|
(0, quit_1.quit)(1);
|
|
30
32
|
}
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
isLambda: true,
|
|
34
|
-
remotionRoot,
|
|
33
|
+
const { envVariables, inputProps, stillFrame, height, width, browserExecutable, userAgent, disableWebSecurity, ignoreCertificateErrors, } = getCliOptions({
|
|
34
|
+
isStill: true,
|
|
35
35
|
logLevel,
|
|
36
36
|
});
|
|
37
37
|
const region = (0, get_aws_region_1.getAwsRegion)();
|
|
38
38
|
let composition = args[1];
|
|
39
|
+
const enableMultiProcessOnLinux = enableMultiprocessOnLinuxOption.getValue({
|
|
40
|
+
commandLine: parsedCli,
|
|
41
|
+
}).value;
|
|
42
|
+
const gl = glOption.getValue({ commandLine: parsedCli }).value;
|
|
43
|
+
const headless = headlessOption.getValue({
|
|
44
|
+
commandLine: parsedCli,
|
|
45
|
+
}).value;
|
|
46
|
+
const chromiumOptions = {
|
|
47
|
+
disableWebSecurity,
|
|
48
|
+
enableMultiProcessOnLinux,
|
|
49
|
+
gl,
|
|
50
|
+
headless,
|
|
51
|
+
ignoreCertificateErrors,
|
|
52
|
+
userAgent,
|
|
53
|
+
};
|
|
54
|
+
const timeoutInMilliseconds = delayRenderTimeoutInMillisecondsOption.getValue({
|
|
55
|
+
commandLine: parsedCli,
|
|
56
|
+
}).value;
|
|
57
|
+
const offthreadVideoCacheSizeInBytes = offthreadVideoCacheSizeInBytesOption.getValue({
|
|
58
|
+
commandLine: parsedCli,
|
|
59
|
+
}).value;
|
|
39
60
|
if (!composition) {
|
|
40
|
-
log_1.Log.info('No compositions passed. Fetching compositions...');
|
|
61
|
+
log_1.Log.info({ indent: false, logLevel }, 'No compositions passed. Fetching compositions...');
|
|
41
62
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
42
63
|
if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
|
|
43
64
|
throw Error('Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.');
|
|
@@ -51,7 +72,7 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
51
72
|
webpackConfigOrServeUrl: serveUrl,
|
|
52
73
|
offthreadVideoCacheSizeInBytes,
|
|
53
74
|
});
|
|
54
|
-
const { compositionId } = await
|
|
75
|
+
const { compositionId } = await getCompositionWithDimensionOverride({
|
|
55
76
|
args: args.slice(1),
|
|
56
77
|
compositionIdFromUi: null,
|
|
57
78
|
indent: false,
|
|
@@ -67,7 +88,7 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
67
88
|
}).serializedString,
|
|
68
89
|
port: config_1.ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),
|
|
69
90
|
puppeteerInstance: undefined,
|
|
70
|
-
timeoutInMilliseconds
|
|
91
|
+
timeoutInMilliseconds,
|
|
71
92
|
height,
|
|
72
93
|
width,
|
|
73
94
|
server,
|
|
@@ -82,16 +103,22 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
82
103
|
(0, validate_retries_1.validateMaxRetries)(maxRetries);
|
|
83
104
|
const privacy = (_c = args_1.parsedLambdaCli.privacy) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OUTPUT_PRIVACY;
|
|
84
105
|
(0, validate_privacy_1.validatePrivacy)(privacy, true);
|
|
85
|
-
const { format: imageFormat, source: imageFormatReason } =
|
|
106
|
+
const { format: imageFormat, source: imageFormatReason } = determineFinalStillImageFormat({
|
|
86
107
|
downloadName,
|
|
87
108
|
outName: outName !== null && outName !== void 0 ? outName : null,
|
|
88
|
-
cliFlag: (_d =
|
|
109
|
+
cliFlag: (_d = parsedCli['image-format']) !== null && _d !== void 0 ? _d : null,
|
|
89
110
|
isLambda: true,
|
|
90
111
|
fromUi: null,
|
|
91
112
|
configImageFormat: (_e = config_1.ConfigInternals.getUserPreferredStillImageFormat()) !== null && _e !== void 0 ? _e : null,
|
|
92
113
|
});
|
|
93
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray(`functionName = ${functionName}, imageFormat = ${imageFormat} (${imageFormatReason})`));
|
|
94
|
-
const deleteAfter = args_1.parsedLambdaCli[
|
|
114
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`functionName = ${functionName}, imageFormat = ${imageFormat} (${imageFormatReason})`));
|
|
115
|
+
const deleteAfter = args_1.parsedLambdaCli[deleteAfterOption.cliFlag];
|
|
116
|
+
const scale = scaleOption.getValue({
|
|
117
|
+
commandLine: parsedCli,
|
|
118
|
+
}).value;
|
|
119
|
+
const jpegQuality = jpegQualityOption.getValue({
|
|
120
|
+
commandLine: parsedCli,
|
|
121
|
+
}).value;
|
|
95
122
|
const res = await (0, render_still_on_lambda_1.renderStillOnLambda)({
|
|
96
123
|
functionName,
|
|
97
124
|
serveUrl,
|
|
@@ -107,19 +134,19 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
107
134
|
logLevel,
|
|
108
135
|
outName,
|
|
109
136
|
chromiumOptions,
|
|
110
|
-
timeoutInMilliseconds
|
|
137
|
+
timeoutInMilliseconds,
|
|
111
138
|
scale,
|
|
112
139
|
forceHeight: height,
|
|
113
140
|
forceWidth: width,
|
|
114
141
|
onInit: ({ cloudWatchLogs, renderId, lambdaInsightsUrl }) => {
|
|
115
|
-
log_1.Log.info(
|
|
142
|
+
log_1.Log.info({ indent: false, logLevel }, chalk.gray(`Render invoked with ID = ${renderId}`));
|
|
116
143
|
log_1.Log.verbose({ indent: false, logLevel }, `CloudWatch logs (if enabled): ${cloudWatchLogs}`);
|
|
117
144
|
log_1.Log.verbose({ indent: false, logLevel }, `Lambda Insights (if enabled): ${lambdaInsightsUrl}`);
|
|
118
145
|
},
|
|
119
146
|
deleteAfter,
|
|
120
147
|
});
|
|
121
148
|
if (downloadName) {
|
|
122
|
-
log_1.Log.info('Finished rendering. Downloading...');
|
|
149
|
+
log_1.Log.info({ indent: false, logLevel }, 'Finished rendering. Downloading...');
|
|
123
150
|
const { outputPath, sizeInBytes } = await (0, download_media_1.downloadMedia)({
|
|
124
151
|
bucketName: res.bucketName,
|
|
125
152
|
outPath: downloadName,
|
|
@@ -127,12 +154,12 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
127
154
|
renderId: res.renderId,
|
|
128
155
|
logLevel,
|
|
129
156
|
});
|
|
130
|
-
log_1.Log.info('Done!', outputPath,
|
|
157
|
+
log_1.Log.info({ indent: false, logLevel }, 'Done!', outputPath, formatBytes(sizeInBytes));
|
|
131
158
|
}
|
|
132
159
|
else {
|
|
133
|
-
log_1.Log.info(`Finished still!`);
|
|
134
|
-
log_1.Log.info();
|
|
135
|
-
log_1.Log.info(res.url);
|
|
160
|
+
log_1.Log.info({ indent: false, logLevel }, `Finished still!`);
|
|
161
|
+
log_1.Log.info({ indent: false, logLevel });
|
|
162
|
+
log_1.Log.info({ indent: false, logLevel }, res.url);
|
|
136
163
|
}
|
|
137
164
|
};
|
|
138
165
|
exports.stillCommand = stillCommand;
|
package/dist/cli/help.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
+
export declare const printHelp: (logLevel: LogLevel) => void;
|
package/dist/cli/help.js
CHANGED
|
@@ -13,32 +13,32 @@ const sites_1 = require("./commands/sites");
|
|
|
13
13
|
const still_1 = require("./commands/still");
|
|
14
14
|
const log_1 = require("./log");
|
|
15
15
|
const packagejson = require('../../package.json');
|
|
16
|
-
const printHelp = () => {
|
|
17
|
-
log_1.Log.info(`${constants_1.BINARY_NAME} ${packagejson.version} © ${new Date().getFullYear()} The Remotion developers`);
|
|
18
|
-
log_1.Log.info();
|
|
19
|
-
log_1.Log.info('Available commands:');
|
|
20
|
-
log_1.Log.info('');
|
|
21
|
-
log_1.Log.info(`${constants_1.BINARY_NAME} ${render_1.RENDER_COMMAND} <s3-url> <composition-id>`);
|
|
22
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray('Render a video in the cloud.'));
|
|
23
|
-
log_1.Log.info(`${constants_1.BINARY_NAME} ${still_1.STILL_COMMAND} <s3-url> <composition-id>`);
|
|
24
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray('Render a still image in the cloud.'));
|
|
25
|
-
log_1.Log.info();
|
|
26
|
-
log_1.Log.info(`${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND}`);
|
|
27
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray('Deploy and manage AWS Lambda functions.'));
|
|
28
|
-
log_1.Log.info();
|
|
29
|
-
log_1.Log.info(`${constants_1.BINARY_NAME} ${sites_1.SITES_COMMAND}`);
|
|
30
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray('Deploy and manage Remotion projects.'));
|
|
31
|
-
log_1.Log.info();
|
|
32
|
-
log_1.Log.info(`${constants_1.BINARY_NAME} ${compositions_1.COMPOSITIONS_COMMAND}`);
|
|
33
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray('Print list of composition IDs from a serve URL.'));
|
|
34
|
-
log_1.Log.info();
|
|
35
|
-
log_1.Log.info(`${constants_1.BINARY_NAME} ${policies_1.POLICIES_COMMAND}`);
|
|
36
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray('View and validate AWS policy files.'));
|
|
37
|
-
log_1.Log.info();
|
|
38
|
-
log_1.Log.info(`${constants_1.BINARY_NAME} ${regions_1.REGIONS_COMMAND}`);
|
|
39
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray('Show the list of AWS regions supported.'));
|
|
40
|
-
log_1.Log.info();
|
|
41
|
-
log_1.Log.info(`${constants_1.BINARY_NAME} ${quotas_1.QUOTAS_COMMAND}`);
|
|
42
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray('Shows AWS quotas and allows to increase them.'));
|
|
16
|
+
const printHelp = (logLevel) => {
|
|
17
|
+
log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${packagejson.version} © ${new Date().getFullYear()} The Remotion developers`);
|
|
18
|
+
log_1.Log.info({ indent: false, logLevel });
|
|
19
|
+
log_1.Log.info({ indent: false, logLevel }, 'Available commands:');
|
|
20
|
+
log_1.Log.info({ indent: false, logLevel }, '');
|
|
21
|
+
log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${render_1.RENDER_COMMAND} <s3-url> <composition-id>`);
|
|
22
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Render a video in the cloud.'));
|
|
23
|
+
log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${still_1.STILL_COMMAND} <s3-url> <composition-id>`);
|
|
24
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Render a still image in the cloud.'));
|
|
25
|
+
log_1.Log.info({ indent: false, logLevel });
|
|
26
|
+
log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND}`);
|
|
27
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Deploy and manage AWS Lambda functions.'));
|
|
28
|
+
log_1.Log.info({ indent: false, logLevel });
|
|
29
|
+
log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${sites_1.SITES_COMMAND}`);
|
|
30
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Deploy and manage Remotion projects.'));
|
|
31
|
+
log_1.Log.info({ indent: false, logLevel });
|
|
32
|
+
log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${compositions_1.COMPOSITIONS_COMMAND}`);
|
|
33
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Print list of composition IDs from a serve URL.'));
|
|
34
|
+
log_1.Log.info({ indent: false, logLevel });
|
|
35
|
+
log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${policies_1.POLICIES_COMMAND}`);
|
|
36
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('View and validate AWS policy files.'));
|
|
37
|
+
log_1.Log.info({ indent: false, logLevel });
|
|
38
|
+
log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${regions_1.REGIONS_COMMAND}`);
|
|
39
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Show the list of AWS regions supported.'));
|
|
40
|
+
log_1.Log.info({ indent: false, logLevel });
|
|
41
|
+
log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${quotas_1.QUOTAS_COMMAND}`);
|
|
42
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Shows AWS quotas and allows to increase them.'));
|
|
43
43
|
};
|
|
44
44
|
exports.printHelp = printHelp;
|
|
@@ -23,13 +23,13 @@ const findFunctionName = async (logLevel) => {
|
|
|
23
23
|
logLevel,
|
|
24
24
|
};
|
|
25
25
|
if (lambdasWithMatchingVersion.length === 0) {
|
|
26
|
-
log_1.Log.error(`No Lambda functions with version ${version_1.VERSION} found in your account.`);
|
|
26
|
+
log_1.Log.error({ indent: false, logLevel }, `No Lambda functions with version ${version_1.VERSION} found in your account.`);
|
|
27
27
|
if (remotionLambdas.length > 0) {
|
|
28
|
-
log_1.Log.error('Other functions were found, but are not compatible with this version of the CLI.');
|
|
28
|
+
log_1.Log.error({ indent: false, logLevel }, 'Other functions were found, but are not compatible with this version of the CLI.');
|
|
29
29
|
}
|
|
30
|
-
log_1.Log.
|
|
31
|
-
log_1.Log.
|
|
32
|
-
log_1.Log.
|
|
30
|
+
log_1.Log.info(logOptions, 'Run');
|
|
31
|
+
log_1.Log.info(logOptions, ` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${deploy_1.FUNCTIONS_DEPLOY_SUBCOMMAND}`);
|
|
32
|
+
log_1.Log.info(logOptions, `to deploy a new Lambda function.`);
|
|
33
33
|
(0, quit_1.quit)(1);
|
|
34
34
|
}
|
|
35
35
|
if (lambdasWithMatchingVersion.length > 1) {
|
|
@@ -37,32 +37,32 @@ const findFunctionName = async (logLevel) => {
|
|
|
37
37
|
const prevFunctions = [...lambdasWithMatchingVersion];
|
|
38
38
|
lambdasWithMatchingVersion = lambdasWithMatchingVersion.filter((l) => l.functionName === args_1.parsedLambdaCli['function-name']);
|
|
39
39
|
if (lambdasWithMatchingVersion.length === 0) {
|
|
40
|
-
log_1.Log.error(`No Lambda function with name "${args_1.parsedLambdaCli['function-name']}" and version ${version_1.VERSION} found in your account.`);
|
|
41
|
-
log_1.Log.
|
|
40
|
+
log_1.Log.error({ indent: false, logLevel }, `No Lambda function with name "${args_1.parsedLambdaCli['function-name']}" and version ${version_1.VERSION} found in your account.`);
|
|
41
|
+
log_1.Log.info(logOptions);
|
|
42
42
|
if (prevFunctions.length === 0) {
|
|
43
|
-
log_1.Log.
|
|
44
|
-
log_1.Log.
|
|
43
|
+
log_1.Log.info(logOptions, `No functions for version ${version_1.VERSION} were found, deploy one using:`);
|
|
44
|
+
log_1.Log.info(logOptions, ` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${deploy_1.FUNCTIONS_DEPLOY_SUBCOMMAND}`);
|
|
45
45
|
(0, quit_1.quit)(1);
|
|
46
46
|
}
|
|
47
|
-
log_1.Log.
|
|
47
|
+
log_1.Log.info(logOptions, 'The following functions were found:');
|
|
48
48
|
for (const l of prevFunctions) {
|
|
49
|
-
log_1.Log.
|
|
49
|
+
log_1.Log.info(logOptions, `- ${l.functionName} (v${l.version})`);
|
|
50
50
|
}
|
|
51
|
-
log_1.Log.
|
|
51
|
+
log_1.Log.info(logOptions, 'Remove the `--function-name` parameter use one of them.');
|
|
52
52
|
(0, quit_1.quit)(1);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
log_1.Log.error('More than 1 lambda function found in your account. Unsure which one to use.');
|
|
57
|
-
log_1.Log.
|
|
58
|
-
log_1.Log.
|
|
59
|
-
log_1.Log.
|
|
60
|
-
log_1.Log.
|
|
61
|
-
log_1.Log.
|
|
62
|
-
log_1.Log.
|
|
63
|
-
log_1.Log.
|
|
56
|
+
log_1.Log.error({ indent: false, logLevel }, 'More than 1 lambda function found in your account. Unsure which one to use.');
|
|
57
|
+
log_1.Log.info(logOptions);
|
|
58
|
+
log_1.Log.info(logOptions, 'Possible solutions:');
|
|
59
|
+
log_1.Log.info(logOptions, '- Define using `--function-name` which function you want to use.');
|
|
60
|
+
log_1.Log.info(logOptions, `- Delete extraneous lambda functions in your AWS console or using:`);
|
|
61
|
+
log_1.Log.info(logOptions, ` npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${rm_1.FUNCTIONS_RM_SUBCOMMAND} $(npx ${constants_1.BINARY_NAME} ${functions_1.FUNCTIONS_COMMAND} ${ls_1.FUNCTIONS_LS_SUBCOMMAND} -q) -y`);
|
|
62
|
+
log_1.Log.info(logOptions);
|
|
63
|
+
log_1.Log.info(logOptions, `The following functions were found (only showing v${version_1.VERSION}):`);
|
|
64
64
|
for (const l of lambdasWithMatchingVersion) {
|
|
65
|
-
log_1.Log.
|
|
65
|
+
log_1.Log.info(logOptions, `- ${l.functionName}`);
|
|
66
66
|
}
|
|
67
67
|
(0, quit_1.quit)(1);
|
|
68
68
|
}
|
|
@@ -25,9 +25,9 @@ const getWebhookCustomData = (logLevel) => {
|
|
|
25
25
|
return JSON.parse(webhookFlag);
|
|
26
26
|
}
|
|
27
27
|
catch (err) {
|
|
28
|
-
log_1.Log.error(`You passed --${flagName} but it was neither valid JSON nor a file path to a valid JSON file. Provided value: ${webhookFlag}`);
|
|
29
|
-
log_1.Log.info('Got the following value:', webhookFlag);
|
|
30
|
-
log_1.Log.error('Check that your input is parseable using `JSON.parse` and try again.');
|
|
28
|
+
log_1.Log.error({ indent: false, logLevel }, `You passed --${flagName} but it was neither valid JSON nor a file path to a valid JSON file. Provided value: ${webhookFlag}`);
|
|
29
|
+
log_1.Log.info({ indent: false, logLevel }, 'Got the following value:', webhookFlag);
|
|
30
|
+
log_1.Log.error({ indent: false, logLevel }, 'Check that your input is parseable using `JSON.parse` and try again.');
|
|
31
31
|
if (node_os_1.default.platform() === 'win32') {
|
|
32
32
|
const logOptions = {
|
|
33
33
|
indent: false,
|
package/dist/cli/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cli = exports.executeCommand = void 0;
|
|
4
4
|
const cli_1 = require("@remotion/cli");
|
|
5
|
-
const config_1 = require("@remotion/cli/config");
|
|
6
5
|
const renderer_1 = require("@remotion/renderer");
|
|
7
6
|
const suggested_policy_1 = require("../api/iam-validation/suggested-policy");
|
|
8
7
|
const defaults_1 = require("../defaults");
|
|
@@ -39,7 +38,7 @@ const requiresCredentials = (args) => {
|
|
|
39
38
|
};
|
|
40
39
|
const matchCommand = (args, remotionRoot, logLevel) => {
|
|
41
40
|
if (args_1.parsedLambdaCli.help || args.length === 0) {
|
|
42
|
-
(0, help_1.printHelp)();
|
|
41
|
+
(0, help_1.printHelp)(logLevel);
|
|
43
42
|
(0, quit_1.quit)(0);
|
|
44
43
|
}
|
|
45
44
|
if (requiresCredentials(args)) {
|
|
@@ -52,49 +51,49 @@ const matchCommand = (args, remotionRoot, logLevel) => {
|
|
|
52
51
|
return (0, still_1.stillCommand)(args.slice(1), remotionRoot, logLevel);
|
|
53
52
|
}
|
|
54
53
|
if (args[0] === compositions_1.COMPOSITIONS_COMMAND) {
|
|
55
|
-
return (0, compositions_1.compositionsCommand)(args.slice(1),
|
|
54
|
+
return (0, compositions_1.compositionsCommand)(args.slice(1), logLevel);
|
|
56
55
|
}
|
|
57
56
|
if (args[0] === functions_1.FUNCTIONS_COMMAND) {
|
|
58
|
-
return (0, functions_1.functionsCommand)(args.slice(1));
|
|
57
|
+
return (0, functions_1.functionsCommand)(args.slice(1), logLevel);
|
|
59
58
|
}
|
|
60
59
|
if (args[0] === quotas_1.QUOTAS_COMMAND) {
|
|
61
60
|
return (0, quotas_1.quotasCommand)(args.slice(1), logLevel);
|
|
62
61
|
}
|
|
63
62
|
if (args[0] === policies_1.POLICIES_COMMAND) {
|
|
64
|
-
return (0, policies_1.policiesCommand)(args.slice(1));
|
|
63
|
+
return (0, policies_1.policiesCommand)(args.slice(1), logLevel);
|
|
65
64
|
}
|
|
66
65
|
if (args[0] === regions_1.REGIONS_COMMAND) {
|
|
67
|
-
return (0, regions_1.regionsCommand)();
|
|
66
|
+
return (0, regions_1.regionsCommand)(logLevel);
|
|
68
67
|
}
|
|
69
68
|
if (args[0] === sites_1.SITES_COMMAND) {
|
|
70
69
|
return (0, sites_1.sitesCommand)(args.slice(1), remotionRoot, logLevel);
|
|
71
70
|
}
|
|
72
71
|
if (args[0] === 'upload') {
|
|
73
|
-
log_1.Log.info('The command has been renamed.');
|
|
74
|
-
log_1.Log.info('Before: remotion-lambda upload <entry-point>');
|
|
75
|
-
log_1.Log.info('After: remotion lambda sites create <entry-point>');
|
|
72
|
+
log_1.Log.info({ indent: false, logLevel }, 'The command has been renamed.');
|
|
73
|
+
log_1.Log.info({ indent: false, logLevel }, 'Before: remotion-lambda upload <entry-point>');
|
|
74
|
+
log_1.Log.info({ indent: false, logLevel }, 'After: remotion lambda sites create <entry-point>');
|
|
76
75
|
(0, quit_1.quit)(1);
|
|
77
76
|
}
|
|
78
77
|
if (args[0] === 'deploy') {
|
|
79
|
-
log_1.Log.info('The command has been renamed.');
|
|
80
|
-
log_1.Log.info('Before: remotion-lambda deploy');
|
|
81
|
-
log_1.Log.info('After: remotion lambda functions deploy');
|
|
78
|
+
log_1.Log.info({ indent: false, logLevel }, 'The command has been renamed.');
|
|
79
|
+
log_1.Log.info({ indent: false, logLevel }, 'Before: remotion-lambda deploy');
|
|
80
|
+
log_1.Log.info({ indent: false, logLevel }, 'After: remotion lambda functions deploy');
|
|
82
81
|
(0, quit_1.quit)(1);
|
|
83
82
|
}
|
|
84
83
|
if (args[0] === 'ls') {
|
|
85
|
-
log_1.Log.info(`The "ls" command does not exist.`);
|
|
86
|
-
log_1.Log.info(`Did you mean "functions ls" or "sites ls"?`);
|
|
84
|
+
log_1.Log.info({ indent: false, logLevel }, `The "ls" command does not exist.`);
|
|
85
|
+
log_1.Log.info({ indent: false, logLevel }, `Did you mean "functions ls" or "sites ls"?`);
|
|
87
86
|
}
|
|
88
87
|
if (args[0] === 'rm') {
|
|
89
|
-
log_1.Log.info(`The "rm" command does not exist.`);
|
|
90
|
-
log_1.Log.info(`Did you mean "functions rm" or "sites rm"?`);
|
|
88
|
+
log_1.Log.info({ indent: false, logLevel }, `The "rm" command does not exist.`);
|
|
89
|
+
log_1.Log.info({ indent: false, logLevel }, `Did you mean "functions rm" or "sites rm"?`);
|
|
91
90
|
}
|
|
92
91
|
if (args[0] === 'deploy') {
|
|
93
|
-
log_1.Log.info(`The "deploy" command does not exist.`);
|
|
94
|
-
log_1.Log.info(`Did you mean "functions deploy"?`);
|
|
92
|
+
log_1.Log.info({ indent: false, logLevel }, `The "deploy" command does not exist.`);
|
|
93
|
+
log_1.Log.info({ indent: false, logLevel }, `Did you mean "functions deploy"?`);
|
|
95
94
|
}
|
|
96
|
-
log_1.Log.error(`Command ${args[0]} not found.`);
|
|
97
|
-
(0, help_1.printHelp)();
|
|
95
|
+
log_1.Log.error({ indent: false, logLevel }, `Command ${args[0]} not found.`);
|
|
96
|
+
(0, help_1.printHelp)(logLevel);
|
|
98
97
|
(0, quit_1.quit)(1);
|
|
99
98
|
};
|
|
100
99
|
const executeCommand = async (args, remotionRoot, logLevel) => {
|
|
@@ -107,7 +106,7 @@ const executeCommand = async (args, remotionRoot, logLevel) => {
|
|
|
107
106
|
const error = err;
|
|
108
107
|
if (error.message.includes('The role defined for the function cannot be assumed by Lambda')) {
|
|
109
108
|
if (args_1.parsedLambdaCli['custom-role-arn']) {
|
|
110
|
-
log_1.Log.error(`
|
|
109
|
+
log_1.Log.error({ indent: false, logLevel }, `
|
|
111
110
|
The role "${args_1.parsedLambdaCli['custom-role-arn']}" does not exist or has the wrong policy assigned to it. Do either:
|
|
112
111
|
- Remove the "--custom-role-arn" parameter and set up Remotion Lambda according to the setup guide
|
|
113
112
|
- Make sure the role has the same policy assigned as the one returned by "npx ${defaults_1.BINARY_NAME} ${policies_1.POLICIES_COMMAND} ${role_1.ROLE_SUBCOMMAND}"
|
|
@@ -115,7 +114,7 @@ const executeCommand = async (args, remotionRoot, logLevel) => {
|
|
|
115
114
|
Revisit ${docs_url_1.DOCS_URL}/docs/lambda/setup and make sure you set up the role and role policy correctly. Also see the troubleshooting page: ${docs_url_1.DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is:
|
|
116
115
|
`.trim());
|
|
117
116
|
}
|
|
118
|
-
log_1.Log.error(`
|
|
117
|
+
log_1.Log.error({ indent: false, logLevel }, `
|
|
119
118
|
The role "${suggested_policy_1.ROLE_NAME}" does not exist in your AWS account or has the wrong policy assigned to it. Common reasons:
|
|
120
119
|
- The name of the role is not "${suggested_policy_1.ROLE_NAME}"
|
|
121
120
|
- The policy is not exactly as specified in the setup guide
|
|
@@ -124,12 +123,12 @@ Revisit ${docs_url_1.DOCS_URL}/docs/lambda/setup and make sure you set up the ro
|
|
|
124
123
|
`.trim());
|
|
125
124
|
}
|
|
126
125
|
if ((_a = error.stack) === null || _a === void 0 ? void 0 : _a.includes('AccessDenied')) {
|
|
127
|
-
log_1.Log.error(`
|
|
126
|
+
log_1.Log.error({ indent: false, logLevel }, `
|
|
128
127
|
AWS returned an "AccessDenied" error message meaning a permission is missing. Read the permissions troubleshooting page: ${docs_url_1.DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is:
|
|
129
128
|
`.trim());
|
|
130
129
|
}
|
|
131
130
|
if ((_b = error.stack) === null || _b === void 0 ? void 0 : _b.includes('TooManyRequestsException')) {
|
|
132
|
-
log_1.Log.error(`
|
|
131
|
+
log_1.Log.error({ indent: false, logLevel }, `
|
|
133
132
|
AWS returned an "TooManyRequestsException" error message which could mean you reached the concurrency limit of AWS Lambda. You can increase the limit - read this troubleshooting page: ${docs_url_1.DOCS_URL}/docs/lambda/troubleshooting/rate-limit. The original error message is:
|
|
134
133
|
`.trim());
|
|
135
134
|
}
|
|
@@ -139,18 +138,18 @@ AWS returned an "TooManyRequestsException" error message which could mean you re
|
|
|
139
138
|
const pureKeyButDoesntStartWithAki = process.env.AWS_ACCESS_KEY_ID &&
|
|
140
139
|
!process.env.AWS_ACCESS_KEY_ID.startsWith('AKI');
|
|
141
140
|
if (keyButDoesntStartWithAki || pureKeyButDoesntStartWithAki) {
|
|
142
|
-
log_1.Log.error(`
|
|
141
|
+
log_1.Log.error({ indent: false, logLevel }, `
|
|
143
142
|
AWS returned an error message "The security token included in the request is invalid". A possible reason is that your AWS Access key ID is set but doesn't start with "AKI", which it usually should. The original message is:
|
|
144
143
|
`);
|
|
145
144
|
}
|
|
146
145
|
else {
|
|
147
|
-
log_1.Log.error(`
|
|
146
|
+
log_1.Log.error({ indent: false, logLevel }, `
|
|
148
147
|
AWS returned an error message "The security token included in the request is invalid". A possible reason for this is that you did not enable the region in your AWS account under "Account". The original message is:
|
|
149
148
|
`);
|
|
150
149
|
}
|
|
151
150
|
}
|
|
152
151
|
if (error instanceof renderer_1.RenderInternals.SymbolicateableError) {
|
|
153
|
-
await cli_1.CliInternals.printError(error,
|
|
152
|
+
await cli_1.CliInternals.printError(error, logLevel);
|
|
154
153
|
}
|
|
155
154
|
else {
|
|
156
155
|
const frames = renderer_1.RenderInternals.parseStack((_e = (_d = error.stack) === null || _d === void 0 ? void 0 : _d.split('\n')) !== null && _e !== void 0 ? _e : []);
|
|
@@ -161,7 +160,7 @@ AWS returned an error message "The security token included in the request is inv
|
|
|
161
160
|
stack: error.stack,
|
|
162
161
|
stackFrame: frames,
|
|
163
162
|
});
|
|
164
|
-
await cli_1.CliInternals.printError(errorWithStackFrame,
|
|
163
|
+
await cli_1.CliInternals.printError(errorWithStackFrame, logLevel);
|
|
165
164
|
}
|
|
166
165
|
(0, quit_1.quit)(1);
|
|
167
166
|
}
|
package/dist/cli/log.d.ts
CHANGED
|
@@ -2,11 +2,9 @@ export declare const Log: {
|
|
|
2
2
|
verbose: (options: import("@remotion/renderer").LogOptions & {
|
|
3
3
|
tag?: string | undefined;
|
|
4
4
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
5
|
-
info: (message?: any, ...optionalParams: any[]) => void;
|
|
6
|
-
infoAdvanced: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
5
|
+
info: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
7
6
|
warn: (options: import("@remotion/renderer").LogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
8
|
-
error: (
|
|
9
|
-
errorAdvanced: (options: import("@remotion/renderer").LogOptions & {
|
|
7
|
+
error: (options: import("@remotion/renderer").LogOptions & {
|
|
10
8
|
tag?: string | undefined;
|
|
11
9
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
12
10
|
};
|
|
@@ -2,7 +2,7 @@ import type { AudioCodec, LogLevel } from '@remotion/renderer';
|
|
|
2
2
|
import type { AwsRegion } from '../../pricing/aws-regions';
|
|
3
3
|
import type { LambdaCodec } from '../../shared/validate-lambda-codec';
|
|
4
4
|
import type { EnhancedErrorInfo } from './write-lambda-error';
|
|
5
|
-
export declare const getAllFilesS3: ({ bucket, expectedFiles, outdir, renderId, region, expectedBucketOwner, onErrors, }: {
|
|
5
|
+
export declare const getAllFilesS3: ({ bucket, expectedFiles, outdir, renderId, region, expectedBucketOwner, onErrors, logLevel, }: {
|
|
6
6
|
bucket: string;
|
|
7
7
|
expectedFiles: number;
|
|
8
8
|
outdir: string;
|
|
@@ -10,6 +10,7 @@ export declare const getAllFilesS3: ({ bucket, expectedFiles, outdir, renderId,
|
|
|
10
10
|
region: AwsRegion;
|
|
11
11
|
expectedBucketOwner: string;
|
|
12
12
|
onErrors: (errors: EnhancedErrorInfo[]) => void;
|
|
13
|
+
logLevel: LogLevel;
|
|
13
14
|
}) => Promise<string[]>;
|
|
14
15
|
export declare const concatVideosS3: ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, audioBitrate, logLevel, }: {
|
|
15
16
|
onProgress: (frames: number) => void;
|
|
@@ -51,7 +51,7 @@ const downloadS3File = async ({ bucket, key, outdir, region, expectedBucketOwner
|
|
|
51
51
|
.on('close', () => resolve());
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
|
-
const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expectedBucketOwner, onErrors, }) => {
|
|
54
|
+
const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expectedBucketOwner, onErrors, logLevel, }) => {
|
|
55
55
|
const alreadyDownloading = {};
|
|
56
56
|
const downloaded = {};
|
|
57
57
|
const getFiles = async () => {
|
|
@@ -113,7 +113,7 @@ const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expect
|
|
|
113
113
|
region,
|
|
114
114
|
expectedBucketOwner,
|
|
115
115
|
});
|
|
116
|
-
renderer_1.RenderInternals.Log.info('Successfully downloaded', key);
|
|
116
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Successfully downloaded', key);
|
|
117
117
|
downloadTimer.end();
|
|
118
118
|
downloaded[key] = true;
|
|
119
119
|
checkFinish();
|
|
@@ -33,7 +33,7 @@ const waitForLaunched = () => {
|
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
const forgetBrowserEventLoop = (logLevel) => {
|
|
36
|
-
renderer_1.RenderInternals.Log.
|
|
36
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Keeping browser open for next invocation');
|
|
37
37
|
_browserInstance === null || _browserInstance === void 0 ? void 0 : _browserInstance.instance.forgetEventLoop();
|
|
38
38
|
};
|
|
39
39
|
exports.forgetBrowserEventLoop = forgetBrowserEventLoop;
|
|
@@ -45,16 +45,16 @@ const getBrowserInstance = async (logLevel, indent, chromiumOptions) => {
|
|
|
45
45
|
gl: (_a = chromiumOptions.gl) !== null && _a !== void 0 ? _a : 'swangle',
|
|
46
46
|
};
|
|
47
47
|
const configurationString = makeConfigurationString(actualChromiumOptions, logLevel);
|
|
48
|
-
renderer_1.RenderInternals.Log.info(`Rendering with Remotion v${version_1.VERSION}.`);
|
|
48
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `Rendering with Remotion v${version_1.VERSION}.`);
|
|
49
49
|
if (launching) {
|
|
50
|
-
renderer_1.RenderInternals.Log.info('Already waiting for browser launch...');
|
|
50
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Already waiting for browser launch...');
|
|
51
51
|
await waitForLaunched();
|
|
52
52
|
if (!_browserInstance) {
|
|
53
53
|
throw new Error('expected to launch');
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
if (!_browserInstance) {
|
|
57
|
-
renderer_1.RenderInternals.Log.info('Cold Lambda function, launching new browser instance');
|
|
57
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Cold Lambda function, launching new browser instance');
|
|
58
58
|
launching = true;
|
|
59
59
|
const execPath = (0, get_chromium_executable_path_1.executablePath)();
|
|
60
60
|
const instance = await renderer_1.RenderInternals.internalOpenBrowser({
|
|
@@ -68,10 +68,10 @@ const getBrowserInstance = async (logLevel, indent, chromiumOptions) => {
|
|
|
68
68
|
});
|
|
69
69
|
instance.on('disconnected', () => {
|
|
70
70
|
var _a;
|
|
71
|
-
renderer_1.RenderInternals.Log.info('Browser disconnected or crashed.');
|
|
71
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Browser disconnected or crashed.');
|
|
72
72
|
(0, exports.forgetBrowserEventLoop)(logLevel);
|
|
73
73
|
(_a = _browserInstance === null || _browserInstance === void 0 ? void 0 : _browserInstance.instance) === null || _a === void 0 ? void 0 : _a.close(true, logLevel, indent).catch((err) => {
|
|
74
|
-
renderer_1.RenderInternals.Log.info('Could not close browser instance', err);
|
|
74
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Could not close browser instance', err);
|
|
75
75
|
});
|
|
76
76
|
_browserInstance = null;
|
|
77
77
|
});
|
|
@@ -83,13 +83,13 @@ const getBrowserInstance = async (logLevel, indent, chromiumOptions) => {
|
|
|
83
83
|
return _browserInstance;
|
|
84
84
|
}
|
|
85
85
|
if (_browserInstance.configurationString !== configurationString) {
|
|
86
|
-
renderer_1.RenderInternals.Log.info('Warm Lambda function, but Browser configuration changed. Killing old browser instance.');
|
|
86
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Warm Lambda function, but Browser configuration changed. Killing old browser instance.');
|
|
87
87
|
_browserInstance.instance.rememberEventLoop();
|
|
88
88
|
await _browserInstance.instance.close(true, logLevel, indent);
|
|
89
89
|
_browserInstance = null;
|
|
90
90
|
return (0, exports.getBrowserInstance)(logLevel, indent, chromiumOptions);
|
|
91
91
|
}
|
|
92
|
-
renderer_1.RenderInternals.Log.info('Warm Lambda function, reusing browser instance');
|
|
92
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Warm Lambda function, reusing browser instance');
|
|
93
93
|
_browserInstance.instance.rememberEventLoop();
|
|
94
94
|
return _browserInstance;
|
|
95
95
|
};
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.validateDeleteAfter = exports.generateRandomHashWithLifeCycleRule = exports.getLifeCycleRules = exports.getEnabledLifeCycleRule = void 0;
|
|
4
4
|
const random_hash_1 = require("../../shared/random-hash");
|
|
5
5
|
const truthy_1 = require("../../shared/truthy");
|
|
6
|
-
// Needs to be in sync with
|
|
6
|
+
// Needs to be in sync with renderer/src/options/delete-after.ts#L7
|
|
7
7
|
const expiryDays = {
|
|
8
8
|
'1-day': 1,
|
|
9
9
|
'3-days': 3,
|
|
@@ -59,7 +59,7 @@ const mergeChunksAndFinishRender = async (options) => {
|
|
|
59
59
|
});
|
|
60
60
|
};
|
|
61
61
|
const onErrors = (errors) => {
|
|
62
|
-
renderer_1.RenderInternals.Log.error('Found Errors', errors);
|
|
62
|
+
renderer_1.RenderInternals.Log.error({ indent: false, logLevel: options.logLevel }, 'Found Errors', errors);
|
|
63
63
|
const firstError = errors[0];
|
|
64
64
|
if (firstError.chunk !== null) {
|
|
65
65
|
throw new Error(`Stopping Lambda function because error occurred while rendering chunk ${firstError.chunk}:\n${errors[0].stack
|
|
@@ -84,6 +84,7 @@ const mergeChunksAndFinishRender = async (options) => {
|
|
|
84
84
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
85
85
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
86
86
|
onErrors,
|
|
87
|
+
logLevel: options.logLevel,
|
|
87
88
|
});
|
|
88
89
|
options.onAllChunks({
|
|
89
90
|
inputProps: options.inputProps,
|