@remotion/lambda 4.0.6 → 4.0.7

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.
@@ -39,12 +39,12 @@ const renderMediaOnLambda = async (input) => {
39
39
  return {
40
40
  renderId: res.renderId,
41
41
  bucketName: res.bucketName,
42
- cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchStreamUrl)({
42
+ cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchRendererUrl)({
43
43
  functionName,
44
- method: constants_1.LambdaRoutines.renderer,
45
44
  region,
46
45
  renderId: res.renderId,
47
46
  rendererFunctionName: rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : null,
47
+ chunk: null,
48
48
  }),
49
49
  folderInS3Console: (0, get_aws_urls_1.getS3RenderUrl)({
50
50
  bucketName: res.bucketName,
@@ -66,7 +66,7 @@ const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFo
66
66
  if (payload.type === 'render-id-determined') {
67
67
  onInit === null || onInit === void 0 ? void 0 : onInit({
68
68
  renderId: payload.renderId,
69
- cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchStreamUrl)({
69
+ cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
70
70
  functionName,
71
71
  method: constants_1.LambdaRoutines.still,
72
72
  region,
@@ -84,7 +84,7 @@ const renderStillOnLambda = async ({ functionName, serveUrl, inputProps, imageFo
84
84
  sizeInBytes: res.size,
85
85
  bucketName: res.bucketName,
86
86
  renderId: res.renderId,
87
- cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchStreamUrl)({
87
+ cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
88
88
  functionName,
89
89
  method: constants_1.LambdaRoutines.still,
90
90
  region,
package/dist/cli/log.d.ts CHANGED
@@ -2,24 +2,24 @@ export declare const Log: {
2
2
  verbose: (message?: any, ...optionalParams: any[]) => void;
3
3
  verboseAdvanced: (options: {
4
4
  indent: boolean;
5
- logLevel: "verbose" | "info" | "warn" | "error";
5
+ logLevel: "error" | "verbose" | "info" | "warn";
6
6
  } & {
7
7
  tag?: string | undefined;
8
8
  }, message?: any, ...optionalParams: any[]) => void;
9
9
  info: (message?: any, ...optionalParams: any[]) => void;
10
10
  infoAdvanced: (options: {
11
11
  indent: boolean;
12
- logLevel: "verbose" | "info" | "warn" | "error";
12
+ logLevel: "error" | "verbose" | "info" | "warn";
13
13
  }, message?: any, ...optionalParams: any[]) => void;
14
14
  warn: (message?: any, ...optionalParams: any[]) => void;
15
15
  warnAdvanced: (options: {
16
16
  indent: boolean;
17
- logLevel: "verbose" | "info" | "warn" | "error";
17
+ logLevel: "error" | "verbose" | "info" | "warn";
18
18
  }, message?: any, ...optionalParams: any[]) => void;
19
19
  error: (message?: any, ...optionalParams: any[]) => void;
20
20
  errorAdvanced: (options: {
21
21
  indent: boolean;
22
- logLevel: "verbose" | "info" | "warn" | "error";
22
+ logLevel: "error" | "verbose" | "info" | "warn";
23
23
  } & {
24
24
  tag?: string | undefined;
25
25
  }, message?: any, ...optionalParams: any[]) => void;
@@ -3,8 +3,5 @@ export declare const planFrameRanges: ({ framesPerLambda, frameRange, everyNthFr
3
3
  frameRange: [number, number];
4
4
  everyNthFrame: number;
5
5
  }) => {
6
- chunks: [
7
- number,
8
- number
9
- ][];
6
+ chunks: [number, number][];
10
7
  };
@@ -1 +1 @@
1
- export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-south-1" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "af-south-1" | "ap-south-1" | "ap-east-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "me-south-1" | "sa-east-1";
1
+ export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "sa-east-1" | "eu-south-1" | "af-south-1" | "ap-east-1" | "me-south-1";
@@ -172,7 +172,12 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
172
172
  Date.now() > renderMetadata.startedDate + timeoutInMilliseconds + 20000;
173
173
  const allErrors = [
174
174
  isBeyondTimeout
175
- ? (0, make_timeout_error_1.makeTimeoutError)({ timeoutInMilliseconds, renderMetadata, chunks })
175
+ ? (0, make_timeout_error_1.makeTimeoutError)({
176
+ timeoutInMilliseconds,
177
+ renderMetadata,
178
+ chunks,
179
+ renderId,
180
+ })
176
181
  : null,
177
182
  ...errorExplanations,
178
183
  ].filter(remotion_1.Internals.truthy);
@@ -1,8 +1,9 @@
1
1
  import type { _Object } from '@aws-sdk/client-s3';
2
2
  import type { RenderMetadata } from '../../defaults';
3
3
  import type { EnhancedErrorInfo } from './write-lambda-error';
4
- export declare const makeTimeoutError: ({ timeoutInMilliseconds, chunks, renderMetadata, }: {
4
+ export declare const makeTimeoutError: ({ timeoutInMilliseconds, chunks, renderMetadata, renderId, }: {
5
5
  timeoutInMilliseconds: number;
6
6
  chunks: _Object[];
7
7
  renderMetadata: RenderMetadata;
8
+ renderId: string;
8
9
  }) => EnhancedErrorInfo;
@@ -3,23 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeTimeoutError = void 0;
4
4
  const parse_chunk_key_1 = require("../../shared/parse-chunk-key");
5
5
  const make_timeout_message_1 = require("./make-timeout-message");
6
- const makeTimeoutError = ({ timeoutInMilliseconds, chunks, renderMetadata, }) => {
6
+ const makeTimeoutError = ({ timeoutInMilliseconds, chunks, renderMetadata, renderId, }) => {
7
7
  const availableChunks = chunks.map((c) => (0, parse_chunk_key_1.parseLambdaChunkKey)(c.Key));
8
8
  const missingChunks = new Array(renderMetadata.totalChunks)
9
9
  .fill(true)
10
- .filter((_, i) => {
11
- return !availableChunks.find((c) => c.chunk === i);
12
- })
13
- .map((_, i) => i);
10
+ .map((_, i) => i)
11
+ .filter((index) => {
12
+ return !availableChunks.find((c) => c.chunk === index);
13
+ });
14
14
  const message = (0, make_timeout_message_1.makeTimeoutMessage)({
15
15
  missingChunks,
16
16
  renderMetadata,
17
17
  timeoutInMilliseconds,
18
+ renderId,
18
19
  });
19
20
  return {
20
21
  attempt: 1,
21
22
  chunk: null,
22
- explanation: message,
23
+ explanation: null,
23
24
  frame: null,
24
25
  isFatal: true,
25
26
  s3Location: '',
@@ -1,6 +1,7 @@
1
1
  import type { RenderMetadata } from '../../defaults';
2
- export declare const makeTimeoutMessage: ({ timeoutInMilliseconds, missingChunks, renderMetadata, }: {
2
+ export declare const makeTimeoutMessage: ({ timeoutInMilliseconds, missingChunks, renderMetadata, renderId, }: {
3
3
  timeoutInMilliseconds: number;
4
4
  missingChunks: number[];
5
5
  renderMetadata: RenderMetadata;
6
+ renderId: string;
6
7
  }) => string;
@@ -1,31 +1,68 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeTimeoutMessage = void 0;
4
+ const defaults_1 = require("../../defaults");
4
5
  const docs_url_1 = require("../../shared/docs-url");
6
+ const get_aws_urls_1 = require("../../shared/get-aws-urls");
7
+ const get_current_region_1 = require("./get-current-region");
8
+ const MAX_MISSING_CHUNKS = 5;
5
9
  const makeChunkMissingMessage = ({ missingChunks, renderMetadata, }) => {
6
- const missingChunksMessageList = missingChunks
7
- .map((ch) => {
8
- const isLastChunk = ch === renderMetadata.totalChunks - 1;
9
- const start = ch * renderMetadata.framesPerLambda;
10
- const end = isLastChunk
11
- ? renderMetadata.frameRange[1]
12
- : (ch + 1) * renderMetadata.framesPerLambda - 1;
13
- return `Chunk ${ch} (Frames ${start} - ${end})`;
14
- })
15
- .slice(0, 5);
16
- if (missingChunksMessageList.length === 0) {
10
+ if (missingChunks.length === 0) {
17
11
  return 'All chunks have been successfully rendered, but the main function has timed out.';
18
12
  }
19
- return `The following chunks are missing (showing ${missingChunksMessageList.length} out of ${missingChunks.length}): ${missingChunksMessageList.join(', ')}.`;
13
+ return [
14
+ `The following chunks are missing (showing ${Math.min(MAX_MISSING_CHUNKS, missingChunks.length)} out of ${missingChunks.length}):`,
15
+ ...missingChunks
16
+ .map((ch) => {
17
+ const isLastChunk = ch === renderMetadata.totalChunks - 1;
18
+ const start = ch * renderMetadata.framesPerLambda;
19
+ const end = isLastChunk
20
+ ? renderMetadata.frameRange[1]
21
+ : (ch + 1) * renderMetadata.framesPerLambda - 1;
22
+ const msg = `Chunk ${ch} (Frames ${start} - ${end})`;
23
+ return [
24
+ msg,
25
+ `▸ Logs for chunk ${ch}: ${(0, get_aws_urls_1.getCloudwatchRendererUrl)({
26
+ functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
27
+ region: (0, get_current_region_1.getCurrentRegionInFunction)(),
28
+ rendererFunctionName: null,
29
+ renderId: renderMetadata.renderId,
30
+ chunk: ch,
31
+ })}`,
32
+ ].join('\n');
33
+ })
34
+ .slice(0, 5),
35
+ ].join('\n');
20
36
  };
21
- const makeTimeoutMessage = ({ timeoutInMilliseconds, missingChunks, renderMetadata, }) => {
37
+ const makeTimeoutMessage = ({ timeoutInMilliseconds, missingChunks, renderMetadata, renderId, }) => {
38
+ const cloudWatchRendererUrl = (0, get_aws_urls_1.getCloudwatchRendererUrl)({
39
+ renderId,
40
+ functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
41
+ region: (0, get_current_region_1.getCurrentRegionInFunction)(),
42
+ rendererFunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
43
+ chunk: null,
44
+ });
45
+ const cloudWatchLaunchUrl = (0, get_aws_urls_1.getCloudwatchMethodUrl)({
46
+ renderId,
47
+ functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
48
+ method: defaults_1.LambdaRoutines.launch,
49
+ region: (0, get_current_region_1.getCurrentRegionInFunction)(),
50
+ rendererFunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
51
+ });
22
52
  const message = [
23
53
  `The main function timed out after ${timeoutInMilliseconds}ms.`,
24
- `Consider increasing the timeout of your function.`,
25
54
  makeChunkMissingMessage({ missingChunks, renderMetadata }),
26
- `You can use the "--timeout" parameter when deploying a function via CLI, or the "timeoutInSeconds" parameter when using the deployFunction() API.`,
55
+ '',
56
+ `Consider increasing the timeout of your function.`,
57
+ `▸ You can use the "--timeout" parameter when deploying a function via CLI, or the "timeoutInSeconds" parameter when using the deployFunction() API.`,
27
58
  `${docs_url_1.DOCS_URL}/docs/lambda/cli/functions#deploy`,
28
- 'Get help on debugging this error:',
59
+ '',
60
+ '▸ Visit the logs for the main function:',
61
+ cloudWatchLaunchUrl,
62
+ '▸ Visit the logs for the renderer functions:',
63
+ cloudWatchRendererUrl,
64
+ '',
65
+ '▸ Get help on debugging this error:',
29
66
  `${docs_url_1.DOCS_URL}/docs/lambda/troubleshooting/debug`,
30
67
  ].join('\n');
31
68
  return message;
@@ -33,6 +33,7 @@ const innerHandler = async (params, responseStream, context) => {
33
33
  inputProps: JSON.stringify(params.inputProps),
34
34
  isWarm,
35
35
  });
36
+ renderer_1.RenderInternals.setLogLevel(params.logLevel);
36
37
  const renderIdDetermined = {
37
38
  type: 'render-id-determined',
38
39
  renderId,
@@ -52,6 +53,7 @@ const innerHandler = async (params, responseStream, context) => {
52
53
  inputProps: JSON.stringify(params.inputProps),
53
54
  isWarm,
54
55
  });
56
+ renderer_1.RenderInternals.setLogLevel(params.logLevel);
55
57
  const response = await (0, start_1.startHandler)(params, {
56
58
  expectedBucketOwner: currentUserId,
57
59
  });
@@ -65,6 +67,7 @@ const innerHandler = async (params, responseStream, context) => {
65
67
  inputProps: JSON.stringify(params.inputProps),
66
68
  isWarm,
67
69
  });
70
+ renderer_1.RenderInternals.setLogLevel(params.logLevel);
68
71
  const response = await (0, launch_1.launchHandler)(params, {
69
72
  expectedBucketOwner: currentUserId,
70
73
  getRemainingTimeInMillis: context.getRemainingTimeInMillis,
@@ -94,6 +97,7 @@ const innerHandler = async (params, responseStream, context) => {
94
97
  resolvedProps: JSON.stringify(params.resolvedProps),
95
98
  isWarm,
96
99
  });
100
+ renderer_1.RenderInternals.setLogLevel(params.logLevel);
97
101
  const response = await (0, renderer_2.rendererHandler)(params, {
98
102
  expectedBucketOwner: currentUserId,
99
103
  isWarm,
@@ -137,5 +141,12 @@ const routine = async (params, responseStream, context) => {
137
141
  responseStream.write(JSON.stringify(res));
138
142
  responseStream.end();
139
143
  }
144
+ finally {
145
+ responseStream.on('close', () => {
146
+ if (!process.env.VITEST) {
147
+ process.exit(0);
148
+ }
149
+ });
150
+ }
140
151
  };
141
152
  exports.handler = (0, streamify_response_1.streamifyResponse)(routine);
@@ -24,12 +24,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.launchHandler = void 0;
27
+ const client_lambda_1 = require("@aws-sdk/client-lambda");
27
28
  const renderer_1 = require("@remotion/renderer");
28
29
  const node_fs_1 = __importStar(require("node:fs"));
29
30
  const node_path_1 = require("node:path");
30
31
  const remotion_1 = require("remotion");
31
32
  const version_1 = require("remotion/version");
32
- const call_lambda_1 = require("../shared/call-lambda");
33
+ const aws_clients_1 = require("../shared/aws-clients");
33
34
  const cleanup_serialized_input_props_1 = require("../shared/cleanup-serialized-input-props");
34
35
  const compress_props_1 = require("../shared/compress-props");
35
36
  const constants_1 = require("../shared/constants");
@@ -58,14 +59,11 @@ const write_lambda_error_1 = require("./helpers/write-lambda-error");
58
59
  const write_post_render_data_1 = require("./helpers/write-post-render-data");
59
60
  const callFunctionWithRetry = async ({ payload, retries, functionName, }) => {
60
61
  try {
61
- await (0, call_lambda_1.callLambda)({
62
- functionName,
63
- payload,
64
- region: (0, get_current_region_1.getCurrentRegionInFunction)(),
65
- type: constants_1.LambdaRoutines.renderer,
66
- receivedStreamingPayload: () => undefined,
67
- timeoutInTest: 120000,
68
- });
62
+ await (0, aws_clients_1.getLambdaClient)((0, get_current_region_1.getCurrentRegionInFunction)()).send(new client_lambda_1.InvokeCommand({
63
+ FunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
64
+ Payload: JSON.stringify(payload),
65
+ InvocationType: 'Event',
66
+ }));
69
67
  }
70
68
  catch (err) {
71
69
  if (err.name === 'ResourceConflictException') {
@@ -89,7 +89,10 @@ const renderHandler = async (params, options, logs) => {
89
89
  expectedBucketOwner: options.expectedBucketOwner,
90
90
  framesRendered: renderedFrames,
91
91
  renderId: params.renderId,
92
- }).catch((err) => reject(err));
92
+ }).catch((err) => {
93
+ console.log(err);
94
+ return reject(err);
95
+ });
93
96
  }
94
97
  const allFrames = renderer_1.RenderInternals.getFramesToRender(params.frameRange, params.everyNthFrame);
95
98
  if (renderedFrames === allFrames.length) {
@@ -181,6 +184,8 @@ const renderHandler = async (params, options, logs) => {
181
184
  ...chunkTimingData,
182
185
  timings: Object.values(chunkTimingData.timings),
183
186
  };
187
+ renderer_1.RenderInternals.Log.verbose('Writing chunk to S3');
188
+ const writeStart = Date.now();
184
189
  await (0, io_1.lambdaWriteFile)({
185
190
  bucketName: params.bucketName,
186
191
  key: (0, constants_1.chunkKeyForIndex)({
@@ -194,6 +199,10 @@ const renderHandler = async (params, options, logs) => {
194
199
  downloadBehavior: null,
195
200
  customCredentials: null,
196
201
  });
202
+ renderer_1.RenderInternals.Log.verbose('Wrote chunk to S3', {
203
+ time: Date.now() - writeStart,
204
+ });
205
+ renderer_1.RenderInternals.Log.verbose('Cleaning up and writing timings');
197
206
  await Promise.all([
198
207
  node_fs_1.default.promises.rm(outputLocation, { recursive: true }),
199
208
  node_fs_1.default.promises.rm(outputPath, { recursive: true }),
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.startHandler = void 0;
4
+ const client_lambda_1 = require("@aws-sdk/client-lambda");
4
5
  const version_1 = require("remotion/version");
5
6
  const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
6
- const call_lambda_1 = require("../shared/call-lambda");
7
+ const aws_clients_1 = require("../shared/aws-clients");
7
8
  const constants_1 = require("../shared/constants");
8
9
  const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
9
10
  const random_hash_1 = require("../shared/random-hash");
@@ -77,14 +78,12 @@ const startHandler = async (params, options) => {
77
78
  rendererFunctionName: params.rendererFunctionName,
78
79
  audioCodec: params.audioCodec,
79
80
  };
80
- await (0, call_lambda_1.callLambda)({
81
- payload,
82
- functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
83
- region: (0, get_current_region_1.getCurrentRegionInFunction)(),
84
- type: constants_1.LambdaRoutines.launch,
85
- receivedStreamingPayload: () => undefined,
86
- timeoutInTest: 120000,
87
- });
81
+ // Don't replace with callLambda(), we want to return before the render is snone
82
+ await (0, aws_clients_1.getLambdaClient)((0, get_current_region_1.getCurrentRegionInFunction)()).send(new client_lambda_1.InvokeCommand({
83
+ FunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
84
+ Payload: JSON.stringify(payload),
85
+ InvocationType: 'Event',
86
+ }));
88
87
  await initialFile;
89
88
  return {
90
89
  type: 'success',
@@ -7,7 +7,6 @@ const aws_clients_1 = require("./aws-clients");
7
7
  const callLambda = async ({ functionName, type, payload, region, receivedStreamingPayload, timeoutInTest, }) => {
8
8
  const res = await (0, aws_clients_1.getLambdaClient)(region, timeoutInTest).send(new client_lambda_1.InvokeWithResponseStreamCommand({
9
9
  FunctionName: functionName,
10
- // @ts-expect-error
11
10
  Payload: JSON.stringify({ type, ...payload }),
12
11
  }));
13
12
  const events = res.EventStream;
@@ -28,7 +27,11 @@ const callLambda = async ({ functionName, type, payload, region, receivedStreami
28
27
  }
29
28
  if (event.InvokeComplete) {
30
29
  if (event.InvokeComplete.ErrorCode) {
31
- throw new Error(`Lambda function ${functionName} failed with error code ${event.InvokeComplete.ErrorCode}: ${event.InvokeComplete.ErrorDetails}`);
30
+ const logs = `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-3600~timeType~'RELATIVE~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40requestId*2c*20*40message*0a*7c*20filter*20*40requestId*20like*20*${res.$metadata.requestId}*22*0a*7c*20sort*20*40timestamp*20asc~source~(~'*2faws*2flambda*2f${functionName}))`;
31
+ if (event.InvokeComplete.ErrorCode === 'Unhandled') {
32
+ throw new Error(`Lambda function ${functionName} failed with an unhandled error. See ${logs} to see the logs of this invocation.`);
33
+ }
34
+ throw new Error(`Lambda function ${functionName} failed with error code ${event.InvokeComplete.ErrorCode}: ${event.InvokeComplete.ErrorDetails}. See ${logs} to see the logs of this invocation.`);
32
35
  }
33
36
  }
34
37
  }
@@ -0,0 +1 @@
1
+ export declare const encodeAwsUrlParams: (input: string) => string;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encodeAwsUrlParams = void 0;
4
+ const encodeAwsUrlParams = (input) => {
5
+ return encodeURIComponent(input).replace(/%/g, '$25');
6
+ };
7
+ exports.encodeAwsUrlParams = encodeAwsUrlParams;
@@ -1,11 +1,18 @@
1
1
  import type { AwsRegion } from '../client';
2
2
  import type { LambdaRoutines } from './constants';
3
- export declare const getCloudwatchStreamUrl: ({ region, functionName, method, renderId, rendererFunctionName, }: {
3
+ export declare const getCloudwatchMethodUrl: ({ region, functionName, renderId, rendererFunctionName, method, }: {
4
4
  region: AwsRegion;
5
5
  functionName: string;
6
- rendererFunctionName: string | null;
7
6
  method: LambdaRoutines;
7
+ rendererFunctionName: string | null;
8
+ renderId: string;
9
+ }) => string;
10
+ export declare const getCloudwatchRendererUrl: ({ region, functionName, renderId, rendererFunctionName, chunk, }: {
11
+ region: AwsRegion;
12
+ functionName: string;
13
+ rendererFunctionName: string | null;
8
14
  renderId: string;
15
+ chunk: null | number;
9
16
  }) => string;
10
17
  export declare const getS3RenderUrl: ({ renderId, region, bucketName, }: {
11
18
  renderId: string;
@@ -1,11 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getS3RenderUrl = exports.getCloudwatchStreamUrl = void 0;
4
- const getCloudwatchStreamUrl = ({ region, functionName, method, renderId, rendererFunctionName, }) => {
3
+ exports.getS3RenderUrl = exports.getCloudwatchRendererUrl = exports.getCloudwatchMethodUrl = void 0;
4
+ const encode_aws_url_params_1 = require("./encode-aws-url-params");
5
+ const getCloudwatchMethodUrl = ({ region, functionName, renderId, rendererFunctionName, method, }) => {
5
6
  const functionNameToUse = rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : functionName;
6
- return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logsV2:log-groups/log-group/$252Faws$252Flambda$252F${functionNameToUse}/log-events$3FfilterPattern$3D$2522method$253D${method}$252CrenderId$253D${renderId}$2522`;
7
+ const query = `"method=${method},renderId=${renderId}"`;
8
+ return cloudWatchUrlWithQuery({ region, functionNameToUse, query });
9
+ };
10
+ exports.getCloudwatchMethodUrl = getCloudwatchMethodUrl;
11
+ const getCloudwatchRendererUrl = ({ region, functionName, renderId, rendererFunctionName, chunk, }) => {
12
+ const functionNameToUse = rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : functionName;
13
+ const query = `"method=renderer,renderId=${renderId}${chunk === null ? '' : `,chunk=${chunk},`}"`;
14
+ return cloudWatchUrlWithQuery({ region, functionNameToUse, query });
15
+ };
16
+ exports.getCloudwatchRendererUrl = getCloudwatchRendererUrl;
17
+ const cloudWatchUrlWithQuery = ({ region, functionNameToUse, query, }) => {
18
+ return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logsV2:log-groups/log-group/$252Faws$252Flambda$252F${functionNameToUse}/log-events$3FfilterPattern$3D${(0, encode_aws_url_params_1.encodeAwsUrlParams)(query)}`;
7
19
  };
8
- exports.getCloudwatchStreamUrl = getCloudwatchStreamUrl;
9
20
  const getS3RenderUrl = ({ renderId, region, bucketName, }) => {
10
21
  return `https://s3.console.aws.amazon.com/s3/buckets/${bucketName}?region=${region}&prefix=renders/${renderId}/`;
11
22
  };
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import https from 'https';
2
4
  import http from 'node:http';
3
5
  import type { EnhancedErrorInfo } from '../functions/helpers/write-lambda-error';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "4.0.6",
3
+ "version": "4.0.7",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -13,22 +13,22 @@
13
13
  "url": "https://github.com/JonnyBurger/remotion"
14
14
  },
15
15
  "dependencies": {
16
- "@aws-sdk/abort-controller": "3.338.0",
17
- "@aws-sdk/client-cloudwatch-logs": "3.338.0",
18
- "@aws-sdk/client-iam": "3.338.0",
19
- "@aws-sdk/client-lambda": "3.338.0",
20
- "@aws-sdk/client-s3": "3.338.0",
21
- "@aws-sdk/client-service-quotas": "3.338.0",
22
- "@aws-sdk/client-sts": "3.338.0",
23
- "@aws-sdk/credential-providers": "3.338.0",
24
- "@aws-sdk/lib-storage": "3.338.0",
25
- "@aws-sdk/s3-request-presigner": "3.338.0",
16
+ "@aws-sdk/abort-controller": "3.370.0",
17
+ "@aws-sdk/client-cloudwatch-logs": "3.370.0",
18
+ "@aws-sdk/client-iam": "3.370.0",
19
+ "@aws-sdk/client-lambda": "3.370.0",
20
+ "@aws-sdk/client-s3": "3.370.0",
21
+ "@aws-sdk/client-service-quotas": "3.370.0",
22
+ "@aws-sdk/client-sts": "3.370.0",
23
+ "@aws-sdk/credential-providers": "3.370.0",
24
+ "@aws-sdk/lib-storage": "3.370.0",
25
+ "@aws-sdk/s3-request-presigner": "3.370.0",
26
26
  "aws-policies": "^1.0.1",
27
27
  "mime-types": "2.1.34",
28
- "remotion": "4.0.6",
29
- "@remotion/bundler": "4.0.6",
30
- "@remotion/renderer": "4.0.6",
31
- "@remotion/cli": "4.0.6"
28
+ "@remotion/bundler": "4.0.7",
29
+ "@remotion/cli": "4.0.7",
30
+ "@remotion/renderer": "4.0.7",
31
+ "remotion": "4.0.7"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@jonny/eslint-config": "3.0.266",
@@ -44,11 +44,11 @@
44
44
  "vitest": "0.31.1",
45
45
  "zip-lib": "^0.7.2",
46
46
  "zod": "3.21.4",
47
- "@remotion/bundler": "4.0.6",
48
- "@remotion/compositor-linux-arm64-gnu": "4.0.6"
47
+ "@remotion/bundler": "4.0.7",
48
+ "@remotion/compositor-linux-arm64-gnu": "4.0.7"
49
49
  },
50
50
  "peerDependencies": {
51
- "@remotion/bundler": "4.0.6"
51
+ "@remotion/bundler": "4.0.7"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
Binary file
Binary file