@remotion/lambda 4.0.115 → 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 -3
- package/dist/api/render-still-on-lambda.d.ts +1 -6
- package/dist/cli/commands/compositions/index.d.ts +1 -1
- package/dist/cli/commands/compositions/index.js +15 -11
- 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 +35 -26
- package/dist/cli/commands/sites/create.js +12 -12
- 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 +6 -6
- package/dist/cli/commands/sites/rmall.d.ts +2 -1
- package/dist/cli/commands/sites/rmall.js +3 -3
- package/dist/cli/commands/still.js +34 -29
- 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/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/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 +1 -1
- 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
|
@@ -17,30 +17,32 @@ 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, } = client_1.BrowserSafeApis.options;
|
|
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;
|
|
21
22
|
exports.STILL_COMMAND = 'still';
|
|
22
23
|
const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
23
24
|
var _a, _b, _c, _d, _e;
|
|
24
25
|
const serveUrl = args[0];
|
|
25
26
|
if (!serveUrl) {
|
|
26
|
-
log_1.Log.error('No serve URL passed.');
|
|
27
|
-
log_1.Log.info('Pass an additional argument specifying a URL where your Remotion project is hosted.');
|
|
28
|
-
log_1.Log.info();
|
|
29
|
-
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]`);
|
|
30
31
|
(0, quit_1.quit)(1);
|
|
31
32
|
}
|
|
32
|
-
const { envVariables, inputProps,
|
|
33
|
-
|
|
34
|
-
isLambda: true,
|
|
35
|
-
remotionRoot,
|
|
33
|
+
const { envVariables, inputProps, stillFrame, height, width, browserExecutable, userAgent, disableWebSecurity, ignoreCertificateErrors, } = getCliOptions({
|
|
34
|
+
isStill: true,
|
|
36
35
|
logLevel,
|
|
37
36
|
});
|
|
38
37
|
const region = (0, get_aws_region_1.getAwsRegion)();
|
|
39
38
|
let composition = args[1];
|
|
40
39
|
const enableMultiProcessOnLinux = enableMultiprocessOnLinuxOption.getValue({
|
|
41
|
-
commandLine:
|
|
40
|
+
commandLine: parsedCli,
|
|
41
|
+
}).value;
|
|
42
|
+
const gl = glOption.getValue({ commandLine: parsedCli }).value;
|
|
43
|
+
const headless = headlessOption.getValue({
|
|
44
|
+
commandLine: parsedCli,
|
|
42
45
|
}).value;
|
|
43
|
-
const gl = glOption.getValue({ commandLine: cli_1.CliInternals.parsedCli }).value;
|
|
44
46
|
const chromiumOptions = {
|
|
45
47
|
disableWebSecurity,
|
|
46
48
|
enableMultiProcessOnLinux,
|
|
@@ -49,15 +51,18 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
49
51
|
ignoreCertificateErrors,
|
|
50
52
|
userAgent,
|
|
51
53
|
};
|
|
54
|
+
const timeoutInMilliseconds = delayRenderTimeoutInMillisecondsOption.getValue({
|
|
55
|
+
commandLine: parsedCli,
|
|
56
|
+
}).value;
|
|
57
|
+
const offthreadVideoCacheSizeInBytes = offthreadVideoCacheSizeInBytesOption.getValue({
|
|
58
|
+
commandLine: parsedCli,
|
|
59
|
+
}).value;
|
|
52
60
|
if (!composition) {
|
|
53
|
-
log_1.Log.info('No compositions passed. Fetching compositions...');
|
|
61
|
+
log_1.Log.info({ indent: false, logLevel }, 'No compositions passed. Fetching compositions...');
|
|
54
62
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
55
63
|
if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
|
|
56
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.');
|
|
57
65
|
}
|
|
58
|
-
const offthreadVideoCacheSizeInBytes = offthreadVideoCacheSizeInBytesOption.getValue({
|
|
59
|
-
commandLine: cli_1.CliInternals.parsedCli,
|
|
60
|
-
}).value;
|
|
61
66
|
const server = await renderer_1.RenderInternals.prepareServer({
|
|
62
67
|
concurrency: 1,
|
|
63
68
|
indent: false,
|
|
@@ -67,7 +72,7 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
67
72
|
webpackConfigOrServeUrl: serveUrl,
|
|
68
73
|
offthreadVideoCacheSizeInBytes,
|
|
69
74
|
});
|
|
70
|
-
const { compositionId } = await
|
|
75
|
+
const { compositionId } = await getCompositionWithDimensionOverride({
|
|
71
76
|
args: args.slice(1),
|
|
72
77
|
compositionIdFromUi: null,
|
|
73
78
|
indent: false,
|
|
@@ -83,7 +88,7 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
83
88
|
}).serializedString,
|
|
84
89
|
port: config_1.ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),
|
|
85
90
|
puppeteerInstance: undefined,
|
|
86
|
-
timeoutInMilliseconds
|
|
91
|
+
timeoutInMilliseconds,
|
|
87
92
|
height,
|
|
88
93
|
width,
|
|
89
94
|
server,
|
|
@@ -98,21 +103,21 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
98
103
|
(0, validate_retries_1.validateMaxRetries)(maxRetries);
|
|
99
104
|
const privacy = (_c = args_1.parsedLambdaCli.privacy) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OUTPUT_PRIVACY;
|
|
100
105
|
(0, validate_privacy_1.validatePrivacy)(privacy, true);
|
|
101
|
-
const { format: imageFormat, source: imageFormatReason } =
|
|
106
|
+
const { format: imageFormat, source: imageFormatReason } = determineFinalStillImageFormat({
|
|
102
107
|
downloadName,
|
|
103
108
|
outName: outName !== null && outName !== void 0 ? outName : null,
|
|
104
|
-
cliFlag: (_d =
|
|
109
|
+
cliFlag: (_d = parsedCli['image-format']) !== null && _d !== void 0 ? _d : null,
|
|
105
110
|
isLambda: true,
|
|
106
111
|
fromUi: null,
|
|
107
112
|
configImageFormat: (_e = config_1.ConfigInternals.getUserPreferredStillImageFormat()) !== null && _e !== void 0 ? _e : null,
|
|
108
113
|
});
|
|
109
|
-
log_1.Log.info(cli_1.CliInternals.chalk.gray(`functionName = ${functionName}, imageFormat = ${imageFormat} (${imageFormatReason})`));
|
|
114
|
+
log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`functionName = ${functionName}, imageFormat = ${imageFormat} (${imageFormatReason})`));
|
|
110
115
|
const deleteAfter = args_1.parsedLambdaCli[deleteAfterOption.cliFlag];
|
|
111
116
|
const scale = scaleOption.getValue({
|
|
112
|
-
commandLine:
|
|
117
|
+
commandLine: parsedCli,
|
|
113
118
|
}).value;
|
|
114
119
|
const jpegQuality = jpegQualityOption.getValue({
|
|
115
|
-
commandLine:
|
|
120
|
+
commandLine: parsedCli,
|
|
116
121
|
}).value;
|
|
117
122
|
const res = await (0, render_still_on_lambda_1.renderStillOnLambda)({
|
|
118
123
|
functionName,
|
|
@@ -129,19 +134,19 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
129
134
|
logLevel,
|
|
130
135
|
outName,
|
|
131
136
|
chromiumOptions,
|
|
132
|
-
timeoutInMilliseconds
|
|
137
|
+
timeoutInMilliseconds,
|
|
133
138
|
scale,
|
|
134
139
|
forceHeight: height,
|
|
135
140
|
forceWidth: width,
|
|
136
141
|
onInit: ({ cloudWatchLogs, renderId, lambdaInsightsUrl }) => {
|
|
137
|
-
log_1.Log.info(
|
|
142
|
+
log_1.Log.info({ indent: false, logLevel }, chalk.gray(`Render invoked with ID = ${renderId}`));
|
|
138
143
|
log_1.Log.verbose({ indent: false, logLevel }, `CloudWatch logs (if enabled): ${cloudWatchLogs}`);
|
|
139
144
|
log_1.Log.verbose({ indent: false, logLevel }, `Lambda Insights (if enabled): ${lambdaInsightsUrl}`);
|
|
140
145
|
},
|
|
141
146
|
deleteAfter,
|
|
142
147
|
});
|
|
143
148
|
if (downloadName) {
|
|
144
|
-
log_1.Log.info('Finished rendering. Downloading...');
|
|
149
|
+
log_1.Log.info({ indent: false, logLevel }, 'Finished rendering. Downloading...');
|
|
145
150
|
const { outputPath, sizeInBytes } = await (0, download_media_1.downloadMedia)({
|
|
146
151
|
bucketName: res.bucketName,
|
|
147
152
|
outPath: downloadName,
|
|
@@ -149,12 +154,12 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
|
|
|
149
154
|
renderId: res.renderId,
|
|
150
155
|
logLevel,
|
|
151
156
|
});
|
|
152
|
-
log_1.Log.info('Done!', outputPath,
|
|
157
|
+
log_1.Log.info({ indent: false, logLevel }, 'Done!', outputPath, formatBytes(sizeInBytes));
|
|
153
158
|
}
|
|
154
159
|
else {
|
|
155
|
-
log_1.Log.info(`Finished still!`);
|
|
156
|
-
log_1.Log.info();
|
|
157
|
-
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);
|
|
158
163
|
}
|
|
159
164
|
};
|
|
160
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
|
};
|
|
@@ -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,
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { LogLevel } from '@remotion/renderer';
|
|
1
2
|
import type { LambdaRoutines } from '../../defaults';
|
|
2
|
-
export declare const printCloudwatchHelper: (type: LambdaRoutines, data: Record<string, string | boolean
|
|
3
|
+
export declare const printCloudwatchHelper: (type: LambdaRoutines, data: Record<string, string | boolean>, logLevel: LogLevel) => void;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printCloudwatchHelper = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const printCloudwatchHelper = (type, data) => {
|
|
5
|
+
const printCloudwatchHelper = (type, data, logLevel) => {
|
|
6
6
|
const d = Object.keys(data).reduce((a, b) => {
|
|
7
7
|
return [...a, `${b}=${data[b]}`];
|
|
8
8
|
}, []);
|
|
9
9
|
const msg = [`method=${type}`, ...d].join(',');
|
|
10
|
-
renderer_1.RenderInternals.Log.info(msg);
|
|
10
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, msg);
|
|
11
11
|
};
|
|
12
12
|
exports.printCloudwatchHelper = printCloudwatchHelper;
|