@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.
Files changed (71) hide show
  1. package/dist/api/get-compositions-on-lambda.d.ts +2 -4
  2. package/dist/api/get-function-info.d.ts +3 -1
  3. package/dist/api/get-function-info.js +2 -1
  4. package/dist/api/get-functions.d.ts +2 -0
  5. package/dist/api/get-functions.js +2 -0
  6. package/dist/api/get-render-progress.d.ts +2 -0
  7. package/dist/api/make-lambda-payload.d.ts +1 -1
  8. package/dist/api/make-lambda-payload.js +2 -1
  9. package/dist/api/render-media-on-lambda.d.ts +1 -12
  10. package/dist/api/render-still-on-lambda.d.ts +2 -8
  11. package/dist/cli/args.d.ts +1 -1
  12. package/dist/cli/commands/compositions/index.d.ts +1 -1
  13. package/dist/cli/commands/compositions/index.js +28 -10
  14. package/dist/cli/commands/functions/deploy.d.ts +2 -1
  15. package/dist/cli/commands/functions/deploy.js +3 -3
  16. package/dist/cli/commands/functions/index.d.ts +2 -1
  17. package/dist/cli/commands/functions/index.js +24 -24
  18. package/dist/cli/commands/functions/ls.d.ts +2 -1
  19. package/dist/cli/commands/functions/ls.js +7 -8
  20. package/dist/cli/commands/functions/rm.d.ts +2 -1
  21. package/dist/cli/commands/functions/rm.js +6 -7
  22. package/dist/cli/commands/functions/rmall.d.ts +2 -1
  23. package/dist/cli/commands/functions/rmall.js +2 -3
  24. package/dist/cli/commands/policies/policies.d.ts +2 -1
  25. package/dist/cli/commands/policies/policies.js +20 -20
  26. package/dist/cli/commands/policies/role.d.ts +2 -1
  27. package/dist/cli/commands/policies/role.js +2 -2
  28. package/dist/cli/commands/policies/user.d.ts +2 -1
  29. package/dist/cli/commands/policies/user.js +2 -2
  30. package/dist/cli/commands/policies/validate.d.ts +2 -1
  31. package/dist/cli/commands/policies/validate.js +4 -4
  32. package/dist/cli/commands/quotas/increase.js +8 -8
  33. package/dist/cli/commands/quotas/index.js +10 -10
  34. package/dist/cli/commands/quotas/list.js +10 -10
  35. package/dist/cli/commands/regions.d.ts +2 -1
  36. package/dist/cli/commands/regions.js +2 -2
  37. package/dist/cli/commands/render/render.js +92 -27
  38. package/dist/cli/commands/sites/create.js +16 -14
  39. package/dist/cli/commands/sites/index.js +21 -21
  40. package/dist/cli/commands/sites/ls.js +8 -8
  41. package/dist/cli/commands/sites/rm.d.ts +2 -1
  42. package/dist/cli/commands/sites/rm.js +8 -9
  43. package/dist/cli/commands/sites/rmall.d.ts +2 -1
  44. package/dist/cli/commands/sites/rmall.js +5 -6
  45. package/dist/cli/commands/still.js +49 -22
  46. package/dist/cli/help.d.ts +2 -1
  47. package/dist/cli/help.js +27 -27
  48. package/dist/cli/helpers/find-function-name.js +21 -21
  49. package/dist/cli/helpers/get-webhook-custom-data.js +3 -3
  50. package/dist/cli/index.js +27 -28
  51. package/dist/cli/log.d.ts +2 -4
  52. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
  53. package/dist/functions/helpers/concat-videos.d.ts +2 -1
  54. package/dist/functions/helpers/concat-videos.js +2 -2
  55. package/dist/functions/helpers/get-browser-instance.js +8 -8
  56. package/dist/functions/helpers/lifecycle.js +1 -1
  57. package/dist/functions/helpers/merge-chunks.js +2 -1
  58. package/dist/functions/helpers/print-cloudwatch-helper.d.ts +2 -1
  59. package/dist/functions/helpers/print-cloudwatch-helper.js +2 -2
  60. package/dist/functions/index.js +8 -13
  61. package/dist/functions/launch.js +23 -23
  62. package/dist/functions/merge.js +3 -3
  63. package/dist/functions/renderer.js +3 -3
  64. package/dist/internals.d.ts +1 -1
  65. package/dist/shared/constants.d.ts +2 -0
  66. package/dist/shared/get-function-version.d.ts +3 -1
  67. package/dist/shared/get-function-version.js +2 -2
  68. package/dist/shared/invoke-webhook.d.ts +4 -1
  69. package/dist/shared/invoke-webhook.js +5 -5
  70. package/package.json +8 -8
  71. package/remotionlambda-arm64.zip +0 -0
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const VALIDATE_SUBCOMMAND = "validate";
2
- export declare const validateSubcommand: () => Promise<void>;
3
+ export declare const validateSubcommand: (logLevel: LogLevel) => Promise<void>;
@@ -5,18 +5,18 @@ const simulate_1 = require("../../../api/iam-validation/simulate");
5
5
  const get_aws_region_1 = require("../../get-aws-region");
6
6
  const log_1 = require("../../log");
7
7
  exports.VALIDATE_SUBCOMMAND = 'validate';
8
- const validateSubcommand = async () => {
8
+ const validateSubcommand = async (logLevel) => {
9
9
  try {
10
10
  await (0, simulate_1.simulatePermissions)({
11
11
  region: (0, get_aws_region_1.getAwsRegion)(),
12
12
  onSimulation: (res) => {
13
- log_1.Log.info((0, simulate_1.logPermissionOutput)(res));
13
+ log_1.Log.info({ indent: false, logLevel }, (0, simulate_1.logPermissionOutput)(res));
14
14
  },
15
15
  });
16
16
  }
17
17
  catch (err) {
18
- log_1.Log.error('Did not have the required permissions on AWS:');
19
- log_1.Log.error(err);
18
+ log_1.Log.error({ indent: false, logLevel }, 'Did not have the required permissions on AWS:');
19
+ log_1.Log.error({ indent: false, logLevel }, err);
20
20
  }
21
21
  };
22
22
  exports.validateSubcommand = validateSubcommand;
@@ -46,14 +46,14 @@ const quotasIncreaseCommand = async (logLevel) => {
46
46
  const defaultConcurrency = (_c = defaultConcurrencyLimit.Quota) === null || _c === void 0 ? void 0 : _c.Value;
47
47
  const increaseRecommended = concurrencyCurrent <= defaultConcurrency;
48
48
  if (!increaseRecommended && !args_1.forceFlagProvided) {
49
- log_1.Log.error(`Current limit of ${concurrencyCurrent} is already increased over the default (${defaultConcurrency}).`);
50
- log_1.Log.info('You can force the increase with the --force flag.');
51
- log_1.Log.info('You are more likely to get an increase if you attach a reason. Go so by going to the AWS console:');
52
- log_1.Log.info(makeQuotaUrl({ quotaId: defaults_1.LAMBDA_CONCURRENCY_LIMIT_QUOTA, region }));
49
+ log_1.Log.error({ indent: false, logLevel }, `Current limit of ${concurrencyCurrent} is already increased over the default (${defaultConcurrency}).`);
50
+ log_1.Log.info({ indent: false, logLevel }, 'You can force the increase with the --force flag.');
51
+ log_1.Log.info({ indent: false, logLevel }, 'You are more likely to get an increase if you attach a reason. Go so by going to the AWS console:');
52
+ log_1.Log.info({ indent: false, logLevel }, makeQuotaUrl({ quotaId: defaults_1.LAMBDA_CONCURRENCY_LIMIT_QUOTA, region }));
53
53
  (0, quit_1.quit)(1);
54
54
  }
55
55
  const newLimit = Math.floor(concurrencyCurrent / 5000) * 5000 + 5000;
56
- log_1.Log.info(`Sending request to AWS to increase concurrency limit from ${concurrencyCurrent} to ${newLimit}.`);
56
+ log_1.Log.info({ indent: false, logLevel }, `Sending request to AWS to increase concurrency limit from ${concurrencyCurrent} to ${newLimit}.`);
57
57
  if (!(await (0, confirm_1.confirmCli)({
58
58
  allowForceFlag: true,
59
59
  delMessage: 'Send? (Y/n)',
@@ -69,8 +69,8 @@ const quotasIncreaseCommand = async (logLevel) => {
69
69
  }
70
70
  catch (err) {
71
71
  if (err.name === 'DependencyAccessDeniedException') {
72
- log_1.Log.error('Could not request increase because this is a sub-account of another AWS account.');
73
- log_1.Log.error(`Please go to ${makeQuotaUrl({
72
+ log_1.Log.error({ indent: false, logLevel }, 'Could not request increase because this is a sub-account of another AWS account.');
73
+ log_1.Log.error({ indent: false, logLevel }, `Please go to ${makeQuotaUrl({
74
74
  quotaId: defaults_1.LAMBDA_CONCURRENCY_LIMIT_QUOTA,
75
75
  region,
76
76
  })} to request the increase via the AWS console.`);
@@ -78,6 +78,6 @@ const quotasIncreaseCommand = async (logLevel) => {
78
78
  }
79
79
  throw err;
80
80
  }
81
- log_1.Log.info(`Requested increase successfully. Run "${defaults_1.BINARY_NAME} ${_1.QUOTAS_COMMAND}" to check whether your request was approved.`);
81
+ log_1.Log.info({ indent: false, logLevel }, `Requested increase successfully. Run "${defaults_1.BINARY_NAME} ${_1.QUOTAS_COMMAND}" to check whether your request was approved.`);
82
82
  };
83
83
  exports.quotasIncreaseCommand = quotasIncreaseCommand;
@@ -6,14 +6,14 @@ const defaults_1 = require("../../../defaults");
6
6
  const increase_1 = require("./increase");
7
7
  const list_1 = require("./list");
8
8
  exports.QUOTAS_COMMAND = 'quotas';
9
- const printHelp = () => {
10
- cli_1.CliInternals.Log.info('Available commands:');
11
- cli_1.CliInternals.Log.info();
12
- cli_1.CliInternals.Log.info(`npx ${defaults_1.BINARY_NAME} ${exports.QUOTAS_COMMAND}`);
13
- cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray('List relevant AWS Lambda quotas.'));
14
- cli_1.CliInternals.Log.info();
15
- cli_1.CliInternals.Log.info(`npx ${defaults_1.BINARY_NAME} ${exports.QUOTAS_COMMAND} ${increase_1.INCREASE_SUBCOMMAND}`);
16
- cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray('Increase Lambda quotas.'));
9
+ const printHelp = (logLevel) => {
10
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, 'Available commands:');
11
+ cli_1.CliInternals.Log.info({ indent: false, logLevel });
12
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, `npx ${defaults_1.BINARY_NAME} ${exports.QUOTAS_COMMAND}`);
13
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('List relevant AWS Lambda quotas.'));
14
+ cli_1.CliInternals.Log.info({ indent: false, logLevel });
15
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, `npx ${defaults_1.BINARY_NAME} ${exports.QUOTAS_COMMAND} ${increase_1.INCREASE_SUBCOMMAND}`);
16
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Increase Lambda quotas.'));
17
17
  };
18
18
  const quotasCommand = (args, logLevel) => {
19
19
  if (args.filter(Boolean).length === 0) {
@@ -22,7 +22,7 @@ const quotasCommand = (args, logLevel) => {
22
22
  if (args[0] === increase_1.INCREASE_SUBCOMMAND) {
23
23
  return (0, increase_1.quotasIncreaseCommand)(logLevel);
24
24
  }
25
- cli_1.CliInternals.Log.error('Subcommand ' + args[0] + ' not found.');
26
- printHelp();
25
+ cli_1.CliInternals.Log.error({ indent: false, logLevel }, 'Subcommand ' + args[0] + ' not found.');
26
+ printHelp(logLevel);
27
27
  };
28
28
  exports.quotasCommand = quotasCommand;
@@ -12,8 +12,8 @@ const increase_1 = require("./increase");
12
12
  const quotasListCommand = async (logLevel) => {
13
13
  var _a, _b, _c, _d;
14
14
  const region = (0, get_aws_region_1.getAwsRegion)();
15
- log_1.Log.info(cli_1.CliInternals.chalk.gray(`Region = ${region}`));
16
- log_1.Log.info();
15
+ log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`Region = ${region}`));
16
+ log_1.Log.info({ indent: false, logLevel });
17
17
  const [concurrencyLimit, defaultConcurrencyLimit, burstLimit, changes] = await Promise.all([
18
18
  (0, aws_clients_1.getServiceQuotasClient)(region).send(new client_service_quotas_1.GetServiceQuotaCommand({
19
19
  QuotaCode: defaults_1.LAMBDA_CONCURRENCY_LIMIT_QUOTA,
@@ -39,26 +39,26 @@ const quotasListCommand = async (logLevel) => {
39
39
  const increaseRecommended = concurrencyCurrent <= defaultConcurrency;
40
40
  const effectiveBurstConcurrency = Math.min(burstDefault, defaultConcurrency);
41
41
  if (increaseRecommended) {
42
- log_1.Log.info(`Concurrency limit: ${concurrencyCurrent} - ${increaseRecommended
42
+ log_1.Log.info({ indent: false, logLevel }, `Concurrency limit: ${concurrencyCurrent} - ${increaseRecommended
43
43
  ? cli_1.CliInternals.chalk.greenBright('Increase recommended!')
44
44
  : ''}`);
45
45
  }
46
46
  else {
47
- log_1.Log.info(`Concurrency limit: ${concurrencyCurrent}`);
47
+ log_1.Log.info({ indent: false, logLevel }, `Concurrency limit: ${concurrencyCurrent}`);
48
48
  }
49
49
  if (openCase) {
50
50
  log_1.Log.warn({ indent: false, logLevel }, `A request to increase it to ${openCase.DesiredValue} is pending:`);
51
51
  log_1.Log.warn({ indent: false, logLevel }, `https://${region}.console.aws.amazon.com/support/home#/case/?displayId=${openCase.CaseId}`);
52
52
  }
53
- log_1.Log.info(cli_1.CliInternals.chalk.gray('The maximum amount of Lambda functions which can concurrently execute.'));
54
- log_1.Log.info(cli_1.CliInternals.chalk.gray(`Run \`npx ${defaults_1.BINARY_NAME} ${_1.QUOTAS_COMMAND} ${increase_1.INCREASE_SUBCOMMAND}\` to ask AWS to increase your limit.`));
55
- log_1.Log.info();
53
+ log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('The maximum amount of Lambda functions which can concurrently execute.'));
54
+ log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`Run \`npx ${defaults_1.BINARY_NAME} ${_1.QUOTAS_COMMAND} ${increase_1.INCREASE_SUBCOMMAND}\` to ask AWS to increase your limit.`));
55
+ log_1.Log.info({ indent: false, logLevel });
56
56
  if (effectiveBurstConcurrency === burstDefault) {
57
- log_1.Log.info(`Burst concurrency: ${burstDefault}`);
57
+ log_1.Log.info({ indent: false, logLevel }, `Burst concurrency: ${burstDefault}`);
58
58
  }
59
59
  else {
60
- log_1.Log.info(`Burst concurrency: ${burstDefault}, but only ${effectiveBurstConcurrency} effective because of concurrency limit`);
60
+ log_1.Log.info({ indent: false, logLevel }, `Burst concurrency: ${burstDefault}, but only ${effectiveBurstConcurrency} effective because of concurrency limit`);
61
61
  }
62
- log_1.Log.info(cli_1.CliInternals.chalk.gray('The maximum amount of concurrency increase in 10 seconds'));
62
+ log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('The maximum amount of concurrency increase in 10 seconds'));
63
63
  };
64
64
  exports.quotasListCommand = quotasListCommand;
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const REGIONS_COMMAND = "regions";
2
- export declare const regionsCommand: () => void;
3
+ export declare const regionsCommand: (logLevel: LogLevel) => void;
@@ -5,9 +5,9 @@ const cli_1 = require("@remotion/cli");
5
5
  const get_regions_1 = require("../../api/get-regions");
6
6
  const args_1 = require("../args");
7
7
  exports.REGIONS_COMMAND = 'regions';
8
- const regionsCommand = () => {
8
+ const regionsCommand = (logLevel) => {
9
9
  var _a;
10
- cli_1.CliInternals.Log.info((0, get_regions_1.getRegions)({
10
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, (0, get_regions_1.getRegions)({
11
11
  enabledByDefaultOnly: (_a = args_1.parsedLambdaCli['default-only']) !== null && _a !== void 0 ? _a : false,
12
12
  }).join(' '));
13
13
  };
@@ -4,6 +4,7 @@ exports.renderCommand = exports.RENDER_COMMAND = void 0;
4
4
  const cli_1 = require("@remotion/cli");
5
5
  const config_1 = require("@remotion/cli/config");
6
6
  const renderer_1 = require("@remotion/renderer");
7
+ const client_1 = require("@remotion/renderer/client");
7
8
  const no_react_1 = require("remotion/no-react");
8
9
  const download_media_1 = require("../../../api/download-media");
9
10
  const get_render_progress_1 = require("../../../api/get-render-progress");
@@ -27,26 +28,87 @@ function getTotalFrames(status) {
27
28
  ? renderer_1.RenderInternals.getFramesToRender(status.renderMetadata.frameRange, status.renderMetadata.everyNthFrame).length
28
29
  : null;
29
30
  }
31
+ const { x264Option, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, mutedOption, colorSpaceOption, deleteAfterOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, numberOfGifLoopsOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, overwriteOption, } = client_1.BrowserSafeApis.options;
30
32
  const renderCommand = async (args, remotionRoot, logLevel) => {
31
33
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
32
34
  const serveUrl = args[0];
33
35
  if (!serveUrl) {
34
- log_1.Log.error('No serve URL passed.');
35
- log_1.Log.info('Pass an additional argument specifying a URL where your Remotion project is hosted.');
36
- log_1.Log.info();
37
- log_1.Log.info(`${constants_1.BINARY_NAME} ${exports.RENDER_COMMAND} <serve-url> <composition-id> [output-location]`);
36
+ log_1.Log.error({ indent: false, logLevel }, 'No serve URL passed.');
37
+ log_1.Log.info({ indent: false, logLevel }, 'Pass an additional argument specifying a URL where your Remotion project is hosted.');
38
+ log_1.Log.info({ indent: false, logLevel });
39
+ log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${exports.RENDER_COMMAND} <serve-url> <composition-id> [output-location]`);
38
40
  (0, quit_1.quit)(1);
39
41
  }
40
42
  const region = (0, get_aws_region_1.getAwsRegion)();
41
- const { chromiumOptions, crf, envVariables, frameRange, inputProps, pixelFormat, proResProfile, puppeteerTimeout, jpegQuality, scale, everyNthFrame, numberOfGifLoops, muted, overwrite, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, height, width, browserExecutable, offthreadVideoCacheSizeInBytes, colorSpace, deleteAfter, x264Preset, } = cli_1.CliInternals.getCliOptions({
42
- type: 'series',
43
- isLambda: true,
44
- remotionRoot,
43
+ const { envVariables, frameRange, inputProps, pixelFormat, proResProfile, everyNthFrame, height, width, browserExecutable, ignoreCertificateErrors, userAgent, disableWebSecurity, } = cli_1.CliInternals.getCliOptions({
44
+ isStill: false,
45
45
  logLevel,
46
46
  });
47
+ const x264Preset = x264Option.getValue({
48
+ commandLine: cli_1.CliInternals.parsedCli,
49
+ }).value;
50
+ const audioBitrate = audioBitrateOption.getValue({
51
+ commandLine: cli_1.CliInternals.parsedCli,
52
+ }).value;
53
+ const offthreadVideoCacheSizeInBytes = offthreadVideoCacheSizeInBytesOption.getValue({
54
+ commandLine: cli_1.CliInternals.parsedCli,
55
+ }).value;
56
+ const scale = scaleOption.getValue({
57
+ commandLine: cli_1.CliInternals.parsedCli,
58
+ }).value;
59
+ const crf = crfOption.getValue({
60
+ commandLine: cli_1.CliInternals.parsedCli,
61
+ }).value;
62
+ const jpegQuality = jpegQualityOption.getValue({
63
+ commandLine: cli_1.CliInternals.parsedCli,
64
+ }).value;
65
+ const videoBitrate = videoBitrateOption.getValue({
66
+ commandLine: cli_1.CliInternals.parsedCli,
67
+ }).value;
68
+ const muted = mutedOption.getValue({
69
+ commandLine: cli_1.CliInternals.parsedCli,
70
+ }).value;
71
+ const colorSpace = colorSpaceOption.getValue({
72
+ commandLine: cli_1.CliInternals.parsedCli,
73
+ }).value;
74
+ const deleteAfter = deleteAfterOption.getValue({
75
+ commandLine: cli_1.CliInternals.parsedCli,
76
+ }).value;
77
+ const enableMultiProcessOnLinux = enableMultiprocessOnLinuxOption.getValue({
78
+ commandLine: cli_1.CliInternals.parsedCli,
79
+ }).value;
80
+ const gl = glOption.getValue({
81
+ commandLine: cli_1.CliInternals.parsedCli,
82
+ }).value;
83
+ const headless = headlessOption.getValue({
84
+ commandLine: cli_1.CliInternals.parsedCli,
85
+ }).value;
86
+ const numberOfGifLoops = numberOfGifLoopsOption.getValue({
87
+ commandLine: cli_1.CliInternals.parsedCli,
88
+ }).value;
89
+ const encodingMaxRate = encodingMaxRateOption.getValue({
90
+ commandLine: cli_1.CliInternals.parsedCli,
91
+ }).value;
92
+ const encodingBufferSize = encodingBufferSizeOption.getValue({
93
+ commandLine: cli_1.CliInternals.parsedCli,
94
+ }).value;
95
+ const timeoutInMilliseconds = delayRenderTimeoutInMillisecondsOption.getValue({
96
+ commandLine: cli_1.CliInternals.parsedCli,
97
+ }).value;
98
+ const overwrite = overwriteOption.getValue({
99
+ commandLine: cli_1.CliInternals.parsedCli,
100
+ }, false).value;
101
+ const chromiumOptions = {
102
+ disableWebSecurity,
103
+ enableMultiProcessOnLinux,
104
+ gl,
105
+ headless,
106
+ ignoreCertificateErrors,
107
+ userAgent,
108
+ };
47
109
  let composition = args[1];
48
110
  if (!composition) {
49
- log_1.Log.info('No compositions passed. Fetching compositions...');
111
+ log_1.Log.info({ indent: false, logLevel }, 'No compositions passed. Fetching compositions...');
50
112
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
51
113
  if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
52
114
  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.');
@@ -76,7 +138,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
76
138
  port: config_1.ConfigInternals.getRendererPortFromConfigFileAndCliFlag(),
77
139
  puppeteerInstance: undefined,
78
140
  serveUrlOrWebpackUrl: serveUrl,
79
- timeoutInMilliseconds: puppeteerTimeout,
141
+ timeoutInMilliseconds,
80
142
  logLevel,
81
143
  width,
82
144
  server,
@@ -86,8 +148,9 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
86
148
  }
87
149
  const outName = args_1.parsedLambdaCli['out-name'];
88
150
  const downloadName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
89
- const { codec, reason } = cli_1.CliInternals.getFinalOutputCodec({
90
- cliFlag: cli_1.CliInternals.parsedCli.codec,
151
+ const { value: codec, source: reason } = client_1.BrowserSafeApis.options.videoCodecOption.getValue({
152
+ commandLine: cli_1.CliInternals.parsedCli,
153
+ }, {
91
154
  downloadName,
92
155
  outName: outName !== null && outName !== void 0 ? outName : null,
93
156
  configFile: (_b = config_1.ConfigInternals.getOutputCodecOrUndefined()) !== null && _b !== void 0 ? _b : null,
@@ -125,7 +188,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
125
188
  logLevel,
126
189
  frameRange: frameRange !== null && frameRange !== void 0 ? frameRange : null,
127
190
  outName: (_f = args_1.parsedLambdaCli['out-name']) !== null && _f !== void 0 ? _f : null,
128
- timeoutInMilliseconds: puppeteerTimeout,
191
+ timeoutInMilliseconds,
129
192
  chromiumOptions,
130
193
  scale,
131
194
  numberOfGifLoops,
@@ -163,8 +226,8 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
163
226
  updatesDontOverwrite: false,
164
227
  indent: false,
165
228
  });
166
- log_1.Log.info(cli_1.CliInternals.chalk.gray(`bucket = ${res.bucketName}, function = ${functionName}`));
167
- log_1.Log.info(cli_1.CliInternals.chalk.gray(`renderId = ${res.renderId}, codec = ${codec} (${reason})`));
229
+ log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`bucket = ${res.bucketName}, function = ${functionName}`));
230
+ log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`renderId = ${res.renderId}, codec = ${codec} (${reason})`));
168
231
  log_1.Log.verbose({ indent: false, logLevel }, `CloudWatch logs (if enabled): ${res.cloudWatchLogs}`);
169
232
  log_1.Log.verbose({ indent: false, logLevel }, `Lambda insights (if enabled): ${res.lambdaInsightsLogs}`);
170
233
  log_1.Log.verbose({ indent: false, logLevel }, `Render folder: ${res.folderInS3Console}`);
@@ -173,6 +236,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
173
236
  bucketName: res.bucketName,
174
237
  renderId: res.renderId,
175
238
  region: (0, get_aws_region_1.getAwsRegion)(),
239
+ logLevel,
176
240
  });
177
241
  const multiProgress = (0, progress_1.makeMultiProgressFromStatus)(status);
178
242
  progressBar.update((0, progress_1.makeProgressString)({
@@ -192,6 +256,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
192
256
  bucketName: res.bucketName,
193
257
  renderId: res.renderId,
194
258
  region: (0, get_aws_region_1.getAwsRegion)(),
259
+ logLevel,
195
260
  });
196
261
  const newProgress = (0, progress_1.makeMultiProgressFromStatus)(newStatus);
197
262
  progressBar.update((0, progress_1.makeProgressString)({
@@ -250,16 +315,16 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
250
315
  timeToEncode: newStatus.timeToEncode,
251
316
  totalFrames: getTotalFrames(newStatus),
252
317
  }), false);
253
- log_1.Log.info();
254
- log_1.Log.info();
255
- log_1.Log.info('Done!', outputPath, cli_1.CliInternals.formatBytes(sizeInBytes));
318
+ log_1.Log.info({ indent: false, logLevel });
319
+ log_1.Log.info({ indent: false, logLevel });
320
+ log_1.Log.info({ indent: false, logLevel }, 'Done!', outputPath, cli_1.CliInternals.formatBytes(sizeInBytes));
256
321
  }
257
322
  else {
258
- log_1.Log.info();
259
- log_1.Log.info();
260
- log_1.Log.info('Done! ' + newStatus.outputFile);
323
+ log_1.Log.info({ indent: false, logLevel });
324
+ log_1.Log.info({ indent: false, logLevel });
325
+ log_1.Log.info({ indent: false, logLevel }, 'Done! ' + newStatus.outputFile);
261
326
  }
262
- log_1.Log.info([
327
+ log_1.Log.info({ indent: false, logLevel }, [
263
328
  newStatus.renderMetadata
264
329
  ? `${newStatus.renderMetadata.estimatedTotalLambdaInvokations} λ's used`
265
330
  : null,
@@ -281,7 +346,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
281
346
  (0, quit_1.quit)(0);
282
347
  }
283
348
  if (newStatus.fatalErrorEncountered) {
284
- log_1.Log.error('\n');
349
+ log_1.Log.error({ indent: false, logLevel }, '\n');
285
350
  const uniqueErrors = [];
286
351
  for (const err of newStatus.errors) {
287
352
  if (uniqueErrors.find((e) => e.stack === err.stack)) {
@@ -289,7 +354,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
289
354
  }
290
355
  uniqueErrors.push(err);
291
356
  if (err.explanation) {
292
- log_1.Log.error(err.explanation);
357
+ log_1.Log.error({ indent: false, logLevel }, err.explanation);
293
358
  }
294
359
  const frames = renderer_1.RenderInternals.parseStack(err.stack.split('\n'));
295
360
  const errorWithStackFrame = new renderer_1.RenderInternals.SymbolicateableError({
@@ -301,9 +366,9 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
301
366
  });
302
367
  await cli_1.CliInternals.printError(errorWithStackFrame, logLevel);
303
368
  }
304
- log_1.Log.info();
305
- log_1.Log.info(`Accrued costs until error was thrown: ${newStatus.costs.displayCost}.`);
306
- log_1.Log.info('This is an estimate and continuing Lambda functions may incur additional costs.');
369
+ log_1.Log.info({ indent: false, logLevel });
370
+ log_1.Log.info({ indent: false, logLevel }, `Accrued costs until error was thrown: ${newStatus.costs.displayCost}.`);
371
+ log_1.Log.info({ indent: false, logLevel }, 'This is an estimate and continuing Lambda functions may incur additional costs.');
307
372
  (0, quit_1.quit)(1);
308
373
  }
309
374
  }
@@ -19,10 +19,10 @@ const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
19
19
  var _a, _b, _c;
20
20
  const { file, reason } = cli_1.CliInternals.findEntryPoint(args, remotionRoot, logLevel);
21
21
  if (!file) {
22
- log_1.Log.error('No entry file passed.');
23
- log_1.Log.info('Pass an additional argument specifying the entry file of your Remotion project:');
24
- log_1.Log.info();
25
- log_1.Log.info(`${constants_1.BINARY_NAME} deploy <entry-file.ts>`);
22
+ log_1.Log.error({ indent: false, logLevel }, 'No entry file passed.');
23
+ log_1.Log.info({ indent: false, logLevel }, 'Pass an additional argument specifying the entry file of your Remotion project:');
24
+ log_1.Log.info({ indent: false, logLevel });
25
+ log_1.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} deploy <entry-file.ts>`);
26
26
  (0, quit_1.quit)(1);
27
27
  return;
28
28
  }
@@ -61,11 +61,13 @@ const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
61
61
  ].join('\n'), false);
62
62
  };
63
63
  const bucketStart = Date.now();
64
- const enableFolderExpiry = args_1.parsedLambdaCli[client_1.BrowserSafeApis.options.folderExpiryOption.cliFlag];
64
+ const enableFolderExpiry = client_1.BrowserSafeApis.options.folderExpiryOption.getValue({
65
+ commandLine: cli_1.CliInternals.parsedCli,
66
+ }).value;
65
67
  const cliBucketName = (_b = args_1.parsedLambdaCli['force-bucket-name']) !== null && _b !== void 0 ? _b : null;
66
68
  const bucketName = cliBucketName !== null && cliBucketName !== void 0 ? cliBucketName : (await (0, get_or_create_bucket_1.internalGetOrCreateBucket)({
67
69
  region: (0, get_aws_region_1.getAwsRegion)(),
68
- enableFolderExpiry: enableFolderExpiry !== null && enableFolderExpiry !== void 0 ? enableFolderExpiry : null,
70
+ enableFolderExpiry,
69
71
  customCredentials: null,
70
72
  })).bucketName;
71
73
  multiProgress.bucketProgress.doneIn = Date.now() - bucketStart;
@@ -116,14 +118,14 @@ const sitesCreateSubcommand = async (args, remotionRoot, logLevel) => {
116
118
  },
117
119
  };
118
120
  updateProgress();
119
- log_1.Log.info();
120
- log_1.Log.info();
121
- log_1.Log.info('Deployed to S3!');
122
- log_1.Log.info(`Serve URL: ${serveUrl}`);
123
- log_1.Log.info(`Site Name: ${siteName}`);
124
- log_1.Log.info();
125
- log_1.Log.info(cli_1.CliInternals.chalk.blueBright('ℹ️ If you make changes to your code, you need to redeploy the site. You can overwrite the existing site by running:'));
126
- log_1.Log.info(cli_1.CliInternals.chalk.blueBright(['npx remotion lambda sites create', args[0], `--site-name=${siteName}`]
121
+ log_1.Log.info({ indent: false, logLevel });
122
+ log_1.Log.info({ indent: false, logLevel });
123
+ log_1.Log.info({ indent: false, logLevel }, 'Deployed to S3!');
124
+ log_1.Log.info({ indent: false, logLevel }, `Serve URL: ${serveUrl}`);
125
+ log_1.Log.info({ indent: false, logLevel }, `Site Name: ${siteName}`);
126
+ log_1.Log.info({ indent: false, logLevel });
127
+ log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.blueBright('ℹ️ If you make changes to your code, you need to redeploy the site. You can overwrite the existing site by running:'));
128
+ log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.blueBright(['npx remotion lambda sites create', args[0], `--site-name=${siteName}`]
127
129
  .filter(no_react_1.NoReactInternals.truthy)
128
130
  .join(' ')));
129
131
  };
@@ -9,41 +9,41 @@ const ls_1 = require("./ls");
9
9
  const rm_1 = require("./rm");
10
10
  const rmall_1 = require("./rmall");
11
11
  exports.SITES_COMMAND = 'sites';
12
- const printSitesHelp = () => {
13
- cli_1.CliInternals.Log.info(`${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} <subcommand>`);
14
- cli_1.CliInternals.Log.info();
15
- cli_1.CliInternals.Log.info('Available subcommands:');
16
- cli_1.CliInternals.Log.info();
17
- cli_1.CliInternals.Log.info(`${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} ${create_1.SITES_CREATE_SUBCOMMAND} <entry-point>`);
18
- cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray('Creates a new site based on a Remotion project'));
19
- cli_1.CliInternals.Log.info();
20
- cli_1.CliInternals.Log.info(`${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} ${ls_1.SITES_LS_SUBCOMMAND}`);
21
- cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray('Lists the sites currently deployed'));
22
- cli_1.CliInternals.Log.info();
23
- cli_1.CliInternals.Log.info(`${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} ${rm_1.SITES_RM_COMMAND} <site-id>`);
24
- cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray('Remove a site from the S3 bucket.'));
25
- cli_1.CliInternals.Log.info();
26
- cli_1.CliInternals.Log.info(`${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} ${rmall_1.SITES_RMALL_COMMAND}`);
27
- cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray('Remove all sites from the S3 bucket.'));
12
+ const printSitesHelp = (logLevel) => {
13
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} <subcommand>`);
14
+ cli_1.CliInternals.Log.info({ indent: false, logLevel });
15
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, 'Available subcommands:');
16
+ cli_1.CliInternals.Log.info({ indent: false, logLevel });
17
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} ${create_1.SITES_CREATE_SUBCOMMAND} <entry-point>`);
18
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Creates a new site based on a Remotion project'));
19
+ cli_1.CliInternals.Log.info({ indent: false, logLevel });
20
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} ${ls_1.SITES_LS_SUBCOMMAND}`);
21
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Lists the sites currently deployed'));
22
+ cli_1.CliInternals.Log.info({ indent: false, logLevel });
23
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} ${rm_1.SITES_RM_COMMAND} <site-id>`);
24
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Remove a site from the S3 bucket.'));
25
+ cli_1.CliInternals.Log.info({ indent: false, logLevel });
26
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, `${constants_1.BINARY_NAME} ${exports.SITES_COMMAND} ${rmall_1.SITES_RMALL_COMMAND}`);
27
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray('Remove all sites from the S3 bucket.'));
28
28
  };
29
29
  const sitesCommand = (args, remotionRoot, logLevel) => {
30
30
  if (args[0] === ls_1.SITES_LS_SUBCOMMAND) {
31
31
  return (0, ls_1.sitesLsSubcommand)(logLevel);
32
32
  }
33
33
  if (args[0] === rm_1.SITES_RM_COMMAND) {
34
- return (0, rm_1.sitesRmSubcommand)(args.slice(1));
34
+ return (0, rm_1.sitesRmSubcommand)(args.slice(1), logLevel);
35
35
  }
36
36
  if (args[0] === rmall_1.SITES_RMALL_COMMAND) {
37
- return (0, rmall_1.sitesRmallSubcommand)();
37
+ return (0, rmall_1.sitesRmallSubcommand)(logLevel);
38
38
  }
39
39
  if (args[0] === create_1.SITES_CREATE_SUBCOMMAND) {
40
40
  return (0, create_1.sitesCreateSubcommand)(args.slice(1), remotionRoot, logLevel);
41
41
  }
42
42
  if (args[0]) {
43
- cli_1.CliInternals.Log.error(`Subcommand ${args[0]} not found.`);
44
- printSitesHelp();
43
+ cli_1.CliInternals.Log.error({ indent: false, logLevel }, `Subcommand ${args[0]} not found.`);
44
+ printSitesHelp(logLevel);
45
45
  (0, quit_1.quit)(1);
46
46
  }
47
- printSitesHelp();
47
+ printSitesHelp(logLevel);
48
48
  };
49
49
  exports.sitesCommand = sitesCommand;
@@ -23,26 +23,26 @@ const sitesLsSubcommand = async (logLevel) => {
23
23
  }
24
24
  const sitesPluralized = sites.length === 1 ? 'site' : 'sites';
25
25
  if (!cli_1.CliInternals.quietFlagProvided()) {
26
- cli_1.CliInternals.Log.info(`${sites.length} ${sitesPluralized} in the ${region} region.`);
26
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, `${sites.length} ${sitesPluralized} in the ${region} region.`);
27
27
  }
28
28
  if (cli_1.CliInternals.quietFlagProvided()) {
29
29
  if (sites.length === 0) {
30
- cli_1.CliInternals.Log.info('()');
30
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, '()');
31
31
  return;
32
32
  }
33
- return cli_1.CliInternals.Log.info(sites.map((s) => s.id).join(' '));
33
+ return cli_1.CliInternals.Log.info({ indent: false, logLevel }, sites.map((s) => s.id).join(' '));
34
34
  }
35
- cli_1.CliInternals.Log.info();
36
- cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray(logRow(['Site Name', 'Bucket', 'Size', 'Last updated'])));
35
+ cli_1.CliInternals.Log.info({ indent: false, logLevel });
36
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(logRow(['Site Name', 'Bucket', 'Size', 'Last updated'])));
37
37
  for (const site of sites) {
38
- cli_1.CliInternals.Log.info(logRow([
38
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, logRow([
39
39
  site.id,
40
40
  site.bucketName,
41
41
  cli_1.CliInternals.formatBytes(site.sizeInBytes),
42
42
  site.lastModified ? (0, date_string_1.dateString)(new Date(site.lastModified)) : 'n/a',
43
43
  ]));
44
- cli_1.CliInternals.Log.info(site.serveUrl);
45
- cli_1.CliInternals.Log.info();
44
+ cli_1.CliInternals.Log.info({ indent: false, logLevel }, site.serveUrl);
45
+ cli_1.CliInternals.Log.info({ indent: false, logLevel });
46
46
  }
47
47
  };
48
48
  exports.sitesLsSubcommand = sitesLsSubcommand;
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const SITES_RM_COMMAND = "rm";
2
- export declare const sitesRmSubcommand: (args: string[]) => Promise<undefined>;
3
+ export declare const sitesRmSubcommand: (args: string[], logLevel: LogLevel) => Promise<undefined>;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sitesRmSubcommand = exports.SITES_RM_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");
@@ -12,14 +11,14 @@ const confirm_1 = require("../../helpers/confirm");
12
11
  const quit_1 = require("../../helpers/quit");
13
12
  const log_1 = require("../../log");
14
13
  exports.SITES_RM_COMMAND = 'rm';
15
- const sitesRmSubcommand = async (args) => {
16
- var _a, _b;
14
+ const sitesRmSubcommand = async (args, logLevel) => {
15
+ var _a;
17
16
  if (args.length === 0) {
18
- log_1.Log.error('No site name was passed. Run the command again and pass another argument <site-name>.');
17
+ log_1.Log.error({ indent: false, logLevel }, 'No site name was passed. Run the command again and pass another argument <site-name>.');
19
18
  (0, quit_1.quit)(1);
20
19
  }
21
20
  if (args[0] === '()') {
22
- log_1.Log.info('No sites to remove.');
21
+ log_1.Log.info({ indent: false, logLevel }, 'No sites to remove.');
23
22
  return;
24
23
  }
25
24
  const region = (0, get_aws_region_1.getAwsRegion)();
@@ -29,13 +28,13 @@ const sitesRmSubcommand = async (args) => {
29
28
  });
30
29
  const bucketName = (_a = args_1.parsedLambdaCli['force-bucket-name']) !== null && _a !== void 0 ? _a : (await (0, get_or_create_bucket_1.internalGetOrCreateBucket)({
31
30
  region,
32
- enableFolderExpiry: (_b = args_1.parsedLambdaCli[client_1.BrowserSafeApis.options.folderExpiryOption.cliFlag]) !== null && _b !== void 0 ? _b : null,
31
+ enableFolderExpiry: false,
33
32
  customCredentials: null,
34
33
  })).bucketName;
35
34
  for (const siteName of args) {
36
35
  const site = deployedSites.sites.find((s) => s.id === siteName.trim());
37
36
  if (!site) {
38
- log_1.Log.error(`No site ${siteName.trim()} was found in your bucket ${bucketName}.`);
37
+ log_1.Log.error({ indent: false, logLevel }, `No site ${siteName.trim()} was found in your bucket ${bucketName}.`);
39
38
  return (0, quit_1.quit)(1);
40
39
  }
41
40
  if (!(await (0, confirm_1.confirmCli)({
@@ -49,10 +48,10 @@ const sitesRmSubcommand = async (args) => {
49
48
  siteName,
50
49
  region,
51
50
  onAfterItemDeleted: ({ itemName }) => {
52
- log_1.Log.info(cli_1.CliInternals.chalk.gray(`Deleted ${itemName}`));
51
+ log_1.Log.info({ indent: false, logLevel }, cli_1.CliInternals.chalk.gray(`Deleted ${itemName}`));
53
52
  },
54
53
  });
55
- log_1.Log.info(`Deleted site ${siteName} and freed up ${cli_1.CliInternals.formatBytes(totalSize)}.`);
54
+ log_1.Log.info({ indent: false, logLevel }, `Deleted site ${siteName} and freed up ${cli_1.CliInternals.formatBytes(totalSize)}.`);
56
55
  }
57
56
  };
58
57
  exports.sitesRmSubcommand = sitesRmSubcommand;
@@ -1,2 +1,3 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  export declare const SITES_RMALL_COMMAND = "rmall";
2
- export declare const sitesRmallSubcommand: () => Promise<void>;
3
+ export declare const sitesRmallSubcommand: (logLevel: LogLevel) => Promise<void>;