@remotion/lambda 3.0.20 → 3.0.23

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 (101) hide show
  1. package/dist/api/bucket-exists.d.ts +1 -1
  2. package/dist/api/clean-items.d.ts +1 -1
  3. package/dist/api/create-bucket.d.ts +1 -1
  4. package/dist/api/create-function.d.ts +2 -2
  5. package/dist/api/delete-function.d.ts +1 -1
  6. package/dist/api/delete-site.d.ts +1 -1
  7. package/dist/api/deploy-function.d.ts +2 -2
  8. package/dist/api/deploy-site.d.ts +3 -3
  9. package/dist/api/download-media.d.ts +2 -2
  10. package/dist/api/enable-s3-website.d.ts +1 -1
  11. package/dist/api/estimate-price.d.ts +2 -2
  12. package/dist/api/get-aws-client.d.ts +2 -2
  13. package/dist/api/get-buckets.d.ts +1 -1
  14. package/dist/api/get-function-info.d.ts +2 -2
  15. package/dist/api/get-functions.d.ts +2 -2
  16. package/dist/api/get-or-create-bucket.d.ts +1 -1
  17. package/dist/api/get-regions.d.ts +1 -1
  18. package/dist/api/get-render-progress.d.ts +2 -2
  19. package/dist/api/get-sites.d.ts +2 -2
  20. package/dist/api/iam-validation/role-permissions.d.ts +2 -1
  21. package/dist/api/iam-validation/simulate-rule.d.ts +1 -1
  22. package/dist/api/iam-validation/simulate.d.ts +2 -2
  23. package/dist/api/mock-functions.d.ts +3 -3
  24. package/dist/api/presign-url.d.ts +1 -1
  25. package/dist/api/render-media-on-lambda.d.ts +3 -3
  26. package/dist/api/render-still-on-lambda.d.ts +4 -4
  27. package/dist/api/upload-dir.d.ts +2 -2
  28. package/dist/cli/args.d.ts +3 -3
  29. package/dist/cli/commands/render/progress.d.ts +2 -2
  30. package/dist/cli/commands/render/render.js +8 -0
  31. package/dist/cli/get-aws-region.d.ts +1 -1
  32. package/dist/cli/helpers/get-cloudwatch-stream-url.d.ts +2 -2
  33. package/dist/functions/chunk-optimization/can-use-optimization.d.ts +1 -1
  34. package/dist/functions/chunk-optimization/collect-data.d.ts +1 -1
  35. package/dist/functions/chunk-optimization/get-frame-ranges-from-profile.d.ts +1 -1
  36. package/dist/functions/chunk-optimization/get-profile-duration.d.ts +1 -1
  37. package/dist/functions/chunk-optimization/is-valid-profile.d.ts +1 -1
  38. package/dist/functions/chunk-optimization/optimize-invocation-order.d.ts +1 -1
  39. package/dist/functions/chunk-optimization/optimize-profile.d.ts +1 -1
  40. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -1
  41. package/dist/functions/chunk-optimization/s3-optimization-file.d.ts +2 -2
  42. package/dist/functions/chunk-optimization/simulate-frame-ranges.d.ts +1 -1
  43. package/dist/functions/chunk-optimization/sort-by-duration.d.ts +1 -1
  44. package/dist/functions/chunk-optimization/types.d.ts +1 -1
  45. package/dist/functions/helpers/calculate-chunk-times.d.ts +1 -1
  46. package/dist/functions/helpers/calculate-price-from-bucket.d.ts +4 -4
  47. package/dist/functions/helpers/concat-videos.d.ts +2 -2
  48. package/dist/functions/helpers/create-post-render-data.d.ts +6 -6
  49. package/dist/functions/helpers/create-post-render-data.js +5 -5
  50. package/dist/functions/helpers/delete-chunks.d.ts +3 -3
  51. package/dist/functions/helpers/expected-out-name.d.ts +1 -1
  52. package/dist/functions/helpers/find-output-file-in-bucket.d.ts +2 -2
  53. package/dist/functions/helpers/format-costs-info.d.ts +1 -1
  54. package/dist/functions/helpers/get-browser-instance.d.ts +2 -1
  55. package/dist/functions/helpers/get-cleanup-progress.d.ts +2 -2
  56. package/dist/functions/helpers/get-current-architecture.d.ts +1 -1
  57. package/dist/functions/helpers/get-encoding-metadata.d.ts +2 -2
  58. package/dist/functions/helpers/get-final-encoding-status.d.ts +2 -2
  59. package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +1 -1
  60. package/dist/functions/helpers/get-output-url-from-metadata.d.ts +1 -1
  61. package/dist/functions/helpers/get-post-render-data.d.ts +2 -2
  62. package/dist/functions/helpers/get-progress.d.ts +2 -2
  63. package/dist/functions/helpers/get-progress.js +12 -10
  64. package/dist/functions/helpers/get-render-metadata.d.ts +2 -2
  65. package/dist/functions/helpers/get-retry-stats.d.ts +1 -1
  66. package/dist/functions/helpers/get-time-to-finish.d.ts +1 -1
  67. package/dist/functions/helpers/inspect-errors.d.ts +3 -3
  68. package/dist/functions/helpers/io.d.ts +5 -5
  69. package/dist/functions/helpers/print-cloudwatch-helper.d.ts +1 -1
  70. package/dist/functions/helpers/read-with-progress.d.ts +1 -1
  71. package/dist/functions/helpers/validate-composition.d.ts +3 -3
  72. package/dist/functions/helpers/write-lambda-error.d.ts +1 -1
  73. package/dist/functions/helpers/write-post-render-data.d.ts +2 -2
  74. package/dist/functions/index.d.ts +3 -2
  75. package/dist/functions/info.d.ts +1 -1
  76. package/dist/functions/launch.d.ts +1 -1
  77. package/dist/functions/progress.d.ts +1 -1
  78. package/dist/functions/renderer.d.ts +1 -1
  79. package/dist/functions/start.d.ts +1 -1
  80. package/dist/functions/still.d.ts +1 -1
  81. package/dist/index.d.ts +33 -18
  82. package/dist/pricing/price-per-1-s.d.ts +1 -1
  83. package/dist/shared/aws-clients.d.ts +1 -1
  84. package/dist/shared/call-lambda.d.ts +3 -3
  85. package/dist/shared/constants.d.ts +10 -7
  86. package/dist/shared/constants.js +1 -1
  87. package/dist/shared/convert-to-serve-url.d.ts +1 -1
  88. package/dist/shared/get-account-id.d.ts +1 -1
  89. package/dist/shared/get-function-version.d.ts +2 -2
  90. package/dist/shared/get-most-expensive-chunks.d.ts +8 -0
  91. package/dist/shared/get-most-expensive-chunks.js +25 -0
  92. package/dist/shared/hosted-layers.d.ts +2 -2
  93. package/dist/shared/make-s3-url.d.ts +1 -1
  94. package/dist/shared/return-values.d.ts +7 -7
  95. package/dist/shared/return-values.js +0 -1
  96. package/dist/shared/stream-to-string.d.ts +1 -1
  97. package/dist/shared/validate-aws-region.d.ts +1 -1
  98. package/dist/shared/validate-outname.d.ts +1 -1
  99. package/dist/shared/validate-privacy.d.ts +1 -1
  100. package/package.json +7 -7
  101. package/remotionlambda.zip +0 -0
@@ -23,7 +23,7 @@ const get_time_to_finish_1 = require("./get-time-to-finish");
23
23
  const inspect_errors_1 = require("./inspect-errors");
24
24
  const io_1 = require("./io");
25
25
  const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region, memorySizeInMb, timeoutInMiliseconds, }) => {
26
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
26
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
27
27
  const postRenderData = await (0, get_post_render_data_1.getPostRenderData)({
28
28
  bucketName,
29
29
  region,
@@ -68,6 +68,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
68
68
  retriesInfo: postRenderData.retriesInfo,
69
69
  outKey: outData.key,
70
70
  outBucket: outData.renderBucketName,
71
+ mostExpensiveFrameRanges: (_a = postRenderData.mostExpensiveFrameRanges) !== null && _a !== void 0 ? _a : null,
71
72
  };
72
73
  }
73
74
  const contents = await (0, io_1.lambdaLs)({
@@ -114,27 +115,27 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
114
115
  memorySizeInMb,
115
116
  outputFileMetadata: outputFile,
116
117
  architecture: (0, get_current_architecture_1.getCurrentArchitecture)(),
117
- lambdasInvoked: (_a = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.estimatedRenderLambdaInvokations) !== null && _a !== void 0 ? _a : 0,
118
+ lambdasInvoked: (_b = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.estimatedRenderLambdaInvokations) !== null && _b !== void 0 ? _b : 0,
118
119
  // We cannot determine the ephemeral storage size, so we
119
120
  // overestimate the price, but will only have a miniscule effect (~0.2%)
120
121
  diskSizeInMb: constants_1.MAX_EPHEMERAL_STORAGE_IN_MB,
121
122
  }));
122
123
  const cleanup = (0, get_cleanup_progress_1.getCleanupProgress)({
123
- chunkCount: (_b = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _b !== void 0 ? _b : 0,
124
+ chunkCount: (_c = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _c !== void 0 ? _c : 0,
124
125
  contents,
125
- output: (_c = outputFile === null || outputFile === void 0 ? void 0 : outputFile.url) !== null && _c !== void 0 ? _c : null,
126
+ output: (_d = outputFile === null || outputFile === void 0 ? void 0 : outputFile.url) !== null && _d !== void 0 ? _d : null,
126
127
  renderId,
127
128
  });
128
129
  const timeToFinish = (0, get_time_to_finish_1.getTimeToFinish)({
129
- lastModified: (_d = outputFile === null || outputFile === void 0 ? void 0 : outputFile.lastModified) !== null && _d !== void 0 ? _d : null,
130
+ lastModified: (_e = outputFile === null || outputFile === void 0 ? void 0 : outputFile.lastModified) !== null && _e !== void 0 ? _e : null,
130
131
  renderMetadata,
131
132
  });
132
133
  const chunks = contents.filter((c) => { var _a; return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith((0, constants_1.chunkKey)(renderId)); });
133
- const allChunks = chunks.length === ((_e = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _e !== void 0 ? _e : Infinity);
134
+ const allChunks = chunks.length === ((_f = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _f !== void 0 ? _f : Infinity);
134
135
  const renderSize = contents
135
136
  .map((c) => { var _a; return (_a = c.Size) !== null && _a !== void 0 ? _a : 0; })
136
137
  .reduce((a, b) => a + b, 0);
137
- const lambdasInvokedStats = (0, get_lambdas_invoked_stats_1.getLambdasInvokedStats)(contents, renderId, (_f = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.estimatedRenderLambdaInvokations) !== null && _f !== void 0 ? _f : null, (_g = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.startedDate) !== null && _g !== void 0 ? _g : null);
138
+ const lambdasInvokedStats = (0, get_lambdas_invoked_stats_1.getLambdasInvokedStats)(contents, renderId, (_g = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.estimatedRenderLambdaInvokations) !== null && _g !== void 0 ? _g : null, (_h = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.startedDate) !== null && _h !== void 0 ? _h : null);
138
139
  const retriesInfo = (0, get_retry_stats_1.getRetryStats)({
139
140
  contents,
140
141
  renderId,
@@ -146,7 +147,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
146
147
  lambdaInvokeStatus: lambdasInvokedStats,
147
148
  });
148
149
  const chunkCount = outputFile
149
- ? (_h = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _h !== void 0 ? _h : 0
150
+ ? (_j = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _j !== void 0 ? _j : 0
150
151
  : chunks.length;
151
152
  // We add a 20 second buffer for it, since AWS timeshifts can be quite a lot. Once it's 20sec over the limit, we consider it timed out
152
153
  const isBeyondTimeout = renderMetadata &&
@@ -177,7 +178,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
177
178
  renderId,
178
179
  renderMetadata,
179
180
  bucket: bucketName,
180
- outputFile: (_j = outputFile === null || outputFile === void 0 ? void 0 : outputFile.url) !== null && _j !== void 0 ? _j : null,
181
+ outputFile: (_k = outputFile === null || outputFile === void 0 ? void 0 : outputFile.url) !== null && _k !== void 0 ? _k : null,
181
182
  timeToFinish,
182
183
  errors: allErrors,
183
184
  fatalErrorEncountered: allErrors.some((f) => f.isFatal && !f.willRetry),
@@ -192,7 +193,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
192
193
  type: 'absolute-time',
193
194
  })
194
195
  : null,
195
- timeToInvokeLambdas: (_k = encodingStatus === null || encodingStatus === void 0 ? void 0 : encodingStatus.timeToInvoke) !== null && _k !== void 0 ? _k : lambdasInvokedStats.timeToInvokeLambdas,
196
+ timeToInvokeLambdas: (_l = encodingStatus === null || encodingStatus === void 0 ? void 0 : encodingStatus.timeToInvoke) !== null && _l !== void 0 ? _l : lambdasInvokedStats.timeToInvokeLambdas,
196
197
  overallProgress: (0, get_overall_progress_1.getOverallProgress)({
197
198
  cleanup: cleanup ? cleanup.filesDeleted / cleanup.minFilesToDelete : 0,
198
199
  encoding: finalEncodingStatus && renderMetadata
@@ -212,6 +213,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
212
213
  outBucket: outputFile && renderMetadata
213
214
  ? (0, expected_out_name_1.getExpectedOutName)(renderMetadata, bucketName).renderBucketName
214
215
  : null,
216
+ mostExpensiveFrameRanges: null,
215
217
  };
216
218
  };
217
219
  exports.getProgress = getProgress;
@@ -1,5 +1,5 @@
1
- import { AwsRegion } from '../../pricing/aws-regions';
2
- import { RenderMetadata } from '../../shared/constants';
1
+ import type { AwsRegion } from '../../pricing/aws-regions';
2
+ import type { RenderMetadata } from '../../shared/constants';
3
3
  export declare const getRenderMetadata: ({ bucketName, renderId, region, expectedBucketOwner, }: {
4
4
  bucketName: string;
5
5
  renderId: string;
@@ -1,4 +1,4 @@
1
- import { _Object } from '@aws-sdk/client-s3';
1
+ import type { _Object } from '@aws-sdk/client-s3';
2
2
  export declare type ChunkRetry = {
3
3
  chunk: number;
4
4
  attempt: number;
@@ -1,4 +1,4 @@
1
- import { RenderMetadata } from '../../defaults';
1
+ import type { RenderMetadata } from '../../defaults';
2
2
  export declare const getTimeToFinish: ({ renderMetadata, lastModified, }: {
3
3
  renderMetadata: RenderMetadata | null;
4
4
  lastModified: number | null;
@@ -1,6 +1,6 @@
1
- import { _Object } from '@aws-sdk/client-s3';
2
- import { AwsRegion } from '../../pricing/aws-regions';
3
- import { EnhancedErrorInfo } from './write-lambda-error';
1
+ import type { _Object } from '@aws-sdk/client-s3';
2
+ import type { AwsRegion } from '../../pricing/aws-regions';
3
+ import type { EnhancedErrorInfo } from './write-lambda-error';
4
4
  export declare const inspectErrors: ({ contents, bucket, region, renderId, expectedBucketOwner, }: {
5
5
  contents: _Object[];
6
6
  bucket: string;
@@ -1,8 +1,8 @@
1
- import { _Object } from '@aws-sdk/client-s3';
2
- import { ReadStream } from 'fs';
3
- import { Readable } from 'stream';
4
- import { AwsRegion } from '../../pricing/aws-regions';
5
- import { Privacy } from '../../shared/constants';
1
+ import type { _Object } from '@aws-sdk/client-s3';
2
+ import type { ReadStream } from 'fs';
3
+ import type { Readable } from 'stream';
4
+ import type { AwsRegion } from '../../pricing/aws-regions';
5
+ import type { Privacy } from '../../shared/constants';
6
6
  export declare type LambdaLSInput = {
7
7
  bucketName: string;
8
8
  prefix: string;
@@ -1,2 +1,2 @@
1
- import { LambdaRoutines } from '../../defaults';
1
+ import type { LambdaRoutines } from '../../defaults';
2
2
  export declare const printCloudwatchHelper: (type: LambdaRoutines, data: Record<string, string>) => void;
@@ -1,4 +1,4 @@
1
- import { AwsRegion } from '../../pricing/aws-regions';
1
+ import type { AwsRegion } from '../../pricing/aws-regions';
2
2
  export declare type LambdaReadFileProgress = (progress: {
3
3
  totalSize: number;
4
4
  downloaded: number;
@@ -1,6 +1,6 @@
1
- import { ChromiumOptions, openBrowser } from '@remotion/renderer';
2
- import { FfmpegExecutable, TCompMetadata } from 'remotion';
3
- import { Await } from '../../shared/await';
1
+ import type { ChromiumOptions, openBrowser } from '@remotion/renderer';
2
+ import type { FfmpegExecutable, TCompMetadata } from 'remotion';
3
+ import type { Await } from '../../shared/await';
4
4
  declare type ValidateCompositionOptions = {
5
5
  serveUrl: string;
6
6
  composition: string;
@@ -1,4 +1,4 @@
1
- import { FileNameAndSize } from './get-files-in-folder';
1
+ import type { FileNameAndSize } from './get-files-in-folder';
2
2
  export declare type LambdaErrorInfo = {
3
3
  type: 'renderer' | 'browser' | 'stitcher';
4
4
  message: string;
@@ -1,5 +1,5 @@
1
- import { AwsRegion } from '../../pricing/aws-regions';
2
- import { PostRenderData } from '../../shared/constants';
1
+ import type { AwsRegion } from '../../pricing/aws-regions';
2
+ import type { PostRenderData } from '../../shared/constants';
3
3
  export declare const writePostRenderData: ({ bucketName, renderId, postRenderData, expectedBucketOwner, region, }: {
4
4
  bucketName: string;
5
5
  renderId: string;
@@ -1,5 +1,6 @@
1
- import { LambdaPayload, LambdaRoutines } from '../shared/constants';
2
- import { LambdaReturnValues } from '../shared/return-values';
1
+ import type { LambdaPayload } from '../shared/constants';
2
+ import { LambdaRoutines } from '../shared/constants';
3
+ import type { LambdaReturnValues } from '../shared/return-values';
3
4
  export declare const handler: <T extends LambdaRoutines>(params: LambdaPayload, context: {
4
5
  invokedFunctionArn: string;
5
6
  getRemainingTimeInMillis: () => number;
@@ -1,4 +1,4 @@
1
- import { LambdaPayload, LambdaVersions } from '../shared/constants';
1
+ import type { LambdaPayload, LambdaVersions } from '../shared/constants';
2
2
  export declare const infoHandler: (lambdaParams: LambdaPayload) => Promise<{
3
3
  version: LambdaVersions;
4
4
  }>;
@@ -1,4 +1,4 @@
1
- import { LambdaPayload } from '../shared/constants';
1
+ import type { LambdaPayload } from '../shared/constants';
2
2
  declare type Options = {
3
3
  expectedBucketOwner: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { LambdaPayload, RenderProgress } from '../shared/constants';
1
+ import type { LambdaPayload, RenderProgress } from '../shared/constants';
2
2
  declare type Options = {
3
3
  expectedBucketOwner: string;
4
4
  timeoutInMiliseconds: number;
@@ -1,4 +1,4 @@
1
- import { LambdaPayload } from '../shared/constants';
1
+ import type { LambdaPayload } from '../shared/constants';
2
2
  declare type Options = {
3
3
  expectedBucketOwner: string;
4
4
  isWarm: boolean;
@@ -1,4 +1,4 @@
1
- import { LambdaPayload } from '../shared/constants';
1
+ import type { LambdaPayload } from '../shared/constants';
2
2
  export declare const startHandler: (params: LambdaPayload) => Promise<{
3
3
  bucketName: string;
4
4
  renderId: string;
@@ -1,4 +1,4 @@
1
- import { LambdaPayload } from '../shared/constants';
1
+ import type { LambdaPayload } from '../shared/constants';
2
2
  declare type Options = {
3
3
  expectedBucketOwner: string;
4
4
  };
package/dist/index.d.ts CHANGED
@@ -1,25 +1,40 @@
1
- import { deleteFunction, DeleteFunctionInput } from './api/delete-function';
2
- import { deleteSite, DeleteSiteInput, DeleteSiteOutput } from './api/delete-site';
3
- import { deployFunction, DeployFunctionInput, DeployFunctionOutput } from './api/deploy-function';
4
- import { deploySite, DeploySiteInput, DeploySiteOutput } from './api/deploy-site';
5
- import { downloadMedia, DownloadMediaInput, DownloadMediaOutput, downloadVideo } from './api/download-media';
6
- import { estimatePrice, EstimatePriceInput } from './api/estimate-price';
7
- import { getAwsClient, GetAwsClientInput, GetAwsClientOutput } from './api/get-aws-client';
8
- import { FunctionInfo, getFunctionInfo, GetFunctionInfoInput } from './api/get-function-info';
9
- import { getFunctions, GetFunctionsInput } from './api/get-functions';
10
- import { getOrCreateBucket, GetOrCreateBucketInput, GetOrCreateBucketOutput } from './api/get-or-create-bucket';
1
+ import type { DeleteFunctionInput } from './api/delete-function';
2
+ import { deleteFunction } from './api/delete-function';
3
+ import type { DeleteSiteInput, DeleteSiteOutput } from './api/delete-site';
4
+ import { deleteSite } from './api/delete-site';
5
+ import type { DeployFunctionInput, DeployFunctionOutput } from './api/deploy-function';
6
+ import { deployFunction } from './api/deploy-function';
7
+ import type { DeploySiteInput, DeploySiteOutput } from './api/deploy-site';
8
+ import { deploySite } from './api/deploy-site';
9
+ import type { DownloadMediaInput, DownloadMediaOutput } from './api/download-media';
10
+ import { downloadMedia, downloadVideo } from './api/download-media';
11
+ import type { EstimatePriceInput } from './api/estimate-price';
12
+ import { estimatePrice } from './api/estimate-price';
13
+ import type { GetAwsClientInput, GetAwsClientOutput } from './api/get-aws-client';
14
+ import { getAwsClient } from './api/get-aws-client';
15
+ import type { FunctionInfo, GetFunctionInfoInput } from './api/get-function-info';
16
+ import { getFunctionInfo } from './api/get-function-info';
17
+ import type { GetFunctionsInput } from './api/get-functions';
18
+ import { getFunctions } from './api/get-functions';
19
+ import type { GetOrCreateBucketInput, GetOrCreateBucketOutput } from './api/get-or-create-bucket';
20
+ import { getOrCreateBucket } from './api/get-or-create-bucket';
11
21
  import { getRegions } from './api/get-regions';
12
- import { GetRenderInput, getRenderProgress } from './api/get-render-progress';
13
- import { getSites, GetSitesInput, GetSitesOutput } from './api/get-sites';
14
- import { simulatePermissions, SimulatePermissionsInput, SimulatePermissionsOutput } from './api/iam-validation/simulate';
22
+ import type { GetRenderInput } from './api/get-render-progress';
23
+ import { getRenderProgress } from './api/get-render-progress';
24
+ import type { GetSitesInput, GetSitesOutput } from './api/get-sites';
25
+ import { getSites } from './api/get-sites';
26
+ import type { SimulatePermissionsInput, SimulatePermissionsOutput } from './api/iam-validation/simulate';
27
+ import { simulatePermissions } from './api/iam-validation/simulate';
15
28
  import { getRolePolicy, getUserPolicy } from './api/iam-validation/suggested-policy';
16
29
  import { presignUrl } from './api/presign-url';
17
- import { renderMediaOnLambda, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, renderVideoOnLambda } from './api/render-media-on-lambda';
18
- import { renderStillOnLambda, RenderStillOnLambdaInput, RenderStillOnLambdaOutput } from './api/render-still-on-lambda';
19
- import { LambdaLSInput, LambdaLsReturnType } from './functions/helpers/io';
30
+ import type { RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput } from './api/render-media-on-lambda';
31
+ import { renderMediaOnLambda, renderVideoOnLambda } from './api/render-media-on-lambda';
32
+ import type { RenderStillOnLambdaInput, RenderStillOnLambdaOutput } from './api/render-still-on-lambda';
33
+ import { renderStillOnLambda } from './api/render-still-on-lambda';
34
+ import type { LambdaLSInput, LambdaLsReturnType } from './functions/helpers/io';
20
35
  import { LambdaInternals } from './internals';
21
- import { AwsRegion } from './pricing/aws-regions';
36
+ import type { AwsRegion } from './pricing/aws-regions';
22
37
  import type { RenderProgress } from './shared/constants';
23
- import { LambdaArchitecture } from './shared/validate-architecture';
38
+ import type { LambdaArchitecture } from './shared/validate-architecture';
24
39
  export { deleteSite, deployFunction, deploySite, downloadMedia, downloadVideo, getFunctions, getUserPolicy, getRolePolicy, getSites, getOrCreateBucket, getRenderProgress, renderVideoOnLambda, renderMediaOnLambda, simulatePermissions, deleteFunction, getFunctionInfo, estimatePrice, LambdaInternals, renderStillOnLambda, getRegions, getAwsClient, presignUrl, };
25
40
  export type { AwsRegion, RenderProgress, DeploySiteInput, DeploySiteOutput, LambdaLsReturnType, LambdaLSInput, DeleteSiteInput, DeleteSiteOutput, EstimatePriceInput, DeployFunctionInput, DeployFunctionOutput, DeleteFunctionInput, GetFunctionInfoInput, FunctionInfo, GetFunctionsInput, GetSitesInput, GetSitesOutput, DownloadMediaInput, DownloadMediaOutput, GetOrCreateBucketInput, GetOrCreateBucketOutput, GetRenderInput, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, SimulatePermissionsInput, SimulatePermissionsOutput, GetAwsClientInput, GetAwsClientOutput, LambdaArchitecture, };
@@ -1,4 +1,4 @@
1
- import { AwsRegion } from './aws-regions';
1
+ import type { AwsRegion } from './aws-regions';
2
2
  export declare const pricing: {
3
3
  [key in AwsRegion]: {
4
4
  'Lambda Duration': {
@@ -3,7 +3,7 @@ import { IAMClient } from '@aws-sdk/client-iam';
3
3
  import { LambdaClient } from '@aws-sdk/client-lambda';
4
4
  import { S3Client } from '@aws-sdk/client-s3';
5
5
  import { ServiceQuotasClient } from '@aws-sdk/client-service-quotas';
6
- import { AwsRegion } from '../pricing/aws-regions';
6
+ import type { AwsRegion } from '../pricing/aws-regions';
7
7
  export declare type ServiceMapping = {
8
8
  s3: S3Client;
9
9
  cloudwatch: CloudWatchLogsClient;
@@ -1,6 +1,6 @@
1
- import { AwsRegion } from '../pricing/aws-regions';
2
- import { LambdaPayloads, LambdaRoutines } from './constants';
3
- import { LambdaReturnValues } from './return-values';
1
+ import type { AwsRegion } from '../pricing/aws-regions';
2
+ import type { LambdaPayloads, LambdaRoutines } from './constants';
3
+ import type { LambdaReturnValues } from './return-values';
4
4
  export declare const callLambda: <T extends LambdaRoutines>({ functionName, type, payload, region, }: {
5
5
  functionName: string;
6
6
  type: T;
@@ -1,9 +1,10 @@
1
- import { ChromiumOptions } from '@remotion/renderer';
2
- import { Codec, FrameRange, ImageFormat, LogLevel, PixelFormat, ProResProfile, VideoConfig } from 'remotion';
3
- import { ChunkRetry } from '../functions/helpers/get-retry-stats';
4
- import { EnhancedErrorInfo } from '../functions/helpers/write-lambda-error';
5
- import { AwsRegion } from '../pricing/aws-regions';
6
- import { LambdaArchitecture } from './validate-architecture';
1
+ import type { ChromiumOptions } from '@remotion/renderer';
2
+ import type { Codec, FrameRange, ImageFormat, LogLevel, PixelFormat, ProResProfile, VideoConfig } from 'remotion';
3
+ import type { ChunkRetry } from '../functions/helpers/get-retry-stats';
4
+ import type { EnhancedErrorInfo } from '../functions/helpers/write-lambda-error';
5
+ import type { AwsRegion } from '../pricing/aws-regions';
6
+ import type { ExpensiveChunk } from './get-most-expensive-chunks';
7
+ import type { LambdaArchitecture } from './validate-architecture';
7
8
  export declare const MIN_MEMORY = 512;
8
9
  export declare const MAX_MEMORY = 10240;
9
10
  export declare const DEFAULT_MEMORY_SIZE = 2048;
@@ -210,7 +211,7 @@ export declare type RenderMetadata = {
210
211
  renderId: string;
211
212
  outName: OutNameInput | undefined;
212
213
  };
213
- export declare type LambdaVersions = '2022-06-21' | '2022-06-14' | '2022-06-08' | '2022-06-07' | '2022-06-02' | '2022-05-31' | '2022-05-28' | '2022-05-27' | '2022-05-19' | '2022-05-16' | '2022-05-11' | '2022-05-07' | '2022-05-06' | '2022-05-03' | '2022-04-20' | '2022-04-19' | '2022-04-18' | '2022-04-09' | '2022-04-08' | '2022-04-05' | '2022-04-02' | '2022-03-29' | '2022-03-17' | '2022-03-02' | '2022-03-01' | '2022-02-27' | '2022-02-14' | '2022-02-12' | '2022-02-09' | '2022-02-08' | '2022-02-07' | '2022-02-06' | '2022-02-05' | '2022-02-04' | '2022-02-03' | '2022-01-23' | '2022-01-19' | '2022-01-11' | '2022-01-10' | '2022-01-09' | '2022-01-06' | '2022-01-05' | '2021-12-22' | '2021-12-17' | '2021-12-16' | '2021-12-15' | '2021-12-14' | '2021-12-13' | '2021-12-11' | '2021-12-10' | '2021-12-04' | '2021-11-29' | '2021-11-27' | '2021-11-24' | '2021-11-22' | '2021-11-19' | '2021-11-18' | '2021-11-15' | '2021-11-12' | '2021-11-10' | '2021-11-01' | '2021-10-29' | '2021-10-27' | '2021-10-21' | '2021-10-19' | '2021-10-07' | '2021-10-03' | '2021-10-01' | '2021-09-15' | '2021-09-06' | '2021-08-06' | '2021-07-14' | '2021-07-05' | '2021-07-02' | '2021-06-23' | 'n/a';
214
+ export declare type LambdaVersions = '2022-06-25' | '2022-06-22' | '2022-06-21' | '2022-06-14' | '2022-06-08' | '2022-06-07' | '2022-06-02' | '2022-05-31' | '2022-05-28' | '2022-05-27' | '2022-05-19' | '2022-05-16' | '2022-05-11' | '2022-05-07' | '2022-05-06' | '2022-05-03' | '2022-04-20' | '2022-04-19' | '2022-04-18' | '2022-04-09' | '2022-04-08' | '2022-04-05' | '2022-04-02' | '2022-03-29' | '2022-03-17' | '2022-03-02' | '2022-03-01' | '2022-02-27' | '2022-02-14' | '2022-02-12' | '2022-02-09' | '2022-02-08' | '2022-02-07' | '2022-02-06' | '2022-02-05' | '2022-02-04' | '2022-02-03' | '2022-01-23' | '2022-01-19' | '2022-01-11' | '2022-01-10' | '2022-01-09' | '2022-01-06' | '2022-01-05' | '2021-12-22' | '2021-12-17' | '2021-12-16' | '2021-12-15' | '2021-12-14' | '2021-12-13' | '2021-12-11' | '2021-12-10' | '2021-12-04' | '2021-11-29' | '2021-11-27' | '2021-11-24' | '2021-11-22' | '2021-11-19' | '2021-11-18' | '2021-11-15' | '2021-11-12' | '2021-11-10' | '2021-11-01' | '2021-10-29' | '2021-10-27' | '2021-10-21' | '2021-10-19' | '2021-10-07' | '2021-10-03' | '2021-10-01' | '2021-09-15' | '2021-09-06' | '2021-08-06' | '2021-07-14' | '2021-07-05' | '2021-07-02' | '2021-06-23' | 'n/a';
214
215
  export declare const CURRENT_VERSION: LambdaVersions;
215
216
  export declare type PostRenderData = {
216
217
  cost: {
@@ -233,6 +234,7 @@ export declare type PostRenderData = {
233
234
  timeToRenderChunks: number;
234
235
  timeToInvokeLambdas: number;
235
236
  retriesInfo: ChunkRetry[];
237
+ mostExpensiveFrameRanges: ExpensiveChunk[] | undefined;
236
238
  };
237
239
  export declare type CostsInfo = {
238
240
  accruedSoFar: number;
@@ -267,6 +269,7 @@ export declare type RenderProgress = {
267
269
  timeToInvokeLambdas: number | null;
268
270
  overallProgress: number;
269
271
  retriesInfo: ChunkRetry[];
272
+ mostExpensiveFrameRanges: ExpensiveChunk[] | null;
270
273
  };
271
274
  export declare type Privacy = 'public' | 'private';
272
275
  export declare const LAMBDA_CONCURRENCY_LIMIT_QUOTA = "L-B99A9384";
@@ -84,6 +84,6 @@ var LambdaRoutines;
84
84
  LambdaRoutines["renderer"] = "renderer";
85
85
  LambdaRoutines["still"] = "still";
86
86
  })(LambdaRoutines = exports.LambdaRoutines || (exports.LambdaRoutines = {}));
87
- exports.CURRENT_VERSION = '2022-06-21';
87
+ exports.CURRENT_VERSION = '2022-06-25';
88
88
  exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = 'L-B99A9384';
89
89
  exports.LAMBDA_BURST_LIMIT_QUOTA = 'L-548AE339';
@@ -1,2 +1,2 @@
1
- import { AwsRegion } from '../pricing/aws-regions';
1
+ import type { AwsRegion } from '../pricing/aws-regions';
2
2
  export declare const convertToServeUrl: (urlOrId: string, region: AwsRegion) => Promise<string>;
@@ -1,4 +1,4 @@
1
- import { AwsRegion } from '../pricing/aws-regions';
1
+ import type { AwsRegion } from '../pricing/aws-regions';
2
2
  export declare const getAccountId: (options: {
3
3
  region: AwsRegion;
4
4
  }) => Promise<string>;
@@ -1,5 +1,5 @@
1
- import { AwsRegion } from '../pricing/aws-regions';
2
- import { LambdaVersions } from './constants';
1
+ import type { AwsRegion } from '../pricing/aws-regions';
2
+ import type { LambdaVersions } from './constants';
3
3
  export declare const getFunctionVersion: ({ functionName, region, }: {
4
4
  functionName: string;
5
5
  region: AwsRegion;
@@ -0,0 +1,8 @@
1
+ import type { ParsedTiming } from './parse-lambda-timings-key';
2
+ export declare const OVERHEAD_TIME_PER_LAMBDA = 100;
3
+ export declare type ExpensiveChunk = {
4
+ chunk: number;
5
+ frameRange: [number, number];
6
+ timeInMilliseconds: number;
7
+ };
8
+ export declare const getMostExpensiveChunks: (parsedTimings: ParsedTiming[], framesPerLambda: number) => ExpensiveChunk[];
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMostExpensiveChunks = exports.OVERHEAD_TIME_PER_LAMBDA = void 0;
4
+ exports.OVERHEAD_TIME_PER_LAMBDA = 100;
5
+ const getMostExpensiveChunks = (parsedTimings, framesPerLambda) => {
6
+ const mostExpensiveChunks = parsedTimings
7
+ .slice(0)
8
+ .sort((a, b) => {
9
+ const durA = a.rendered - a.start;
10
+ const durB = b.rendered - b.start;
11
+ return durB - durA;
12
+ })
13
+ .slice(0, 5);
14
+ return mostExpensiveChunks.map((c) => {
15
+ return {
16
+ timeInMilliseconds: c.rendered - c.start,
17
+ chunk: c.chunk,
18
+ frameRange: [
19
+ framesPerLambda * c.chunk,
20
+ framesPerLambda * (c.chunk + 1) - 1,
21
+ ],
22
+ };
23
+ });
24
+ };
25
+ exports.getMostExpensiveChunks = getMostExpensiveChunks;
@@ -1,5 +1,5 @@
1
- import { AwsRegion } from '../pricing/aws-regions';
2
- import { LambdaArchitecture } from './validate-architecture';
1
+ import type { AwsRegion } from '../pricing/aws-regions';
2
+ import type { LambdaArchitecture } from './validate-architecture';
3
3
  export declare const REMOTION_HOSTED_LAYER_ARN = "arn:aws:lambda:*:678892195805:layer:remotion-binaries-*";
4
4
  export declare type HostedLayers = {
5
5
  [architecture in LambdaArchitecture]: {
@@ -1,4 +1,4 @@
1
- import { AwsRegion } from '../pricing/aws-regions';
1
+ import type { AwsRegion } from '../pricing/aws-regions';
2
2
  export declare const makeS3ServeUrl: ({ bucketName, subFolder, region, }: {
3
3
  bucketName: string;
4
4
  subFolder: string;
@@ -1,10 +1,10 @@
1
- import { infoHandler } from '../functions/info';
2
- import { launchHandler } from '../functions/launch';
3
- import { progressHandler } from '../functions/progress';
4
- import { rendererHandler } from '../functions/renderer';
5
- import { startHandler } from '../functions/start';
6
- import { stillHandler } from '../functions/still';
7
- import { LambdaRoutines } from './constants';
1
+ import type { infoHandler } from '../functions/info';
2
+ import type { launchHandler } from '../functions/launch';
3
+ import type { progressHandler } from '../functions/progress';
4
+ import type { rendererHandler } from '../functions/renderer';
5
+ import type { startHandler } from '../functions/start';
6
+ import type { stillHandler } from '../functions/still';
7
+ import type { LambdaRoutines } from './constants';
8
8
  export interface LambdaReturnValues {
9
9
  [LambdaRoutines.start]: ReturnType<typeof startHandler>;
10
10
  [LambdaRoutines.launch]: ReturnType<typeof launchHandler>;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const constants_1 = require("./constants");
@@ -1,4 +1,4 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import { Readable } from 'stream';
3
+ import type { Readable } from 'stream';
4
4
  export declare function streamToString(stream: Readable | Buffer): string | Promise<string>;
@@ -1,2 +1,2 @@
1
- import { AwsRegion } from '../pricing/aws-regions';
1
+ import type { AwsRegion } from '../pricing/aws-regions';
2
2
  export declare function validateAwsRegion(region: unknown): asserts region is AwsRegion;
@@ -1,2 +1,2 @@
1
- import { OutNameInput } from './constants';
1
+ import type { OutNameInput } from './constants';
2
2
  export declare const validateOutname: (outName: OutNameInput | undefined | null) => void;
@@ -1,2 +1,2 @@
1
- import { Privacy } from './constants';
1
+ import type { Privacy } from './constants';
2
2
  export declare function validatePrivacy(privacy: unknown): asserts privacy is Privacy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "3.0.20",
3
+ "version": "3.0.23",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -31,19 +31,19 @@
31
31
  "@aws-sdk/client-service-quotas": "3.58.0",
32
32
  "@aws-sdk/lib-storage": "3.58.0",
33
33
  "@aws-sdk/s3-request-presigner": "3.58.0",
34
- "@remotion/bundler": "3.0.20",
35
- "@remotion/cli": "3.0.20",
36
- "@remotion/renderer": "3.0.20",
34
+ "@remotion/bundler": "3.0.23",
35
+ "@remotion/cli": "3.0.23",
36
+ "@remotion/renderer": "3.0.23",
37
37
  "aws-policies": "^1.0.1",
38
38
  "mime-types": "2.1.34",
39
- "remotion": "3.0.20"
39
+ "remotion": "3.0.23"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8.0",
43
43
  "react-dom": ">=16.8.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@jonny/eslint-config": "3.0.259",
46
+ "@jonny/eslint-config": "3.0.266",
47
47
  "@types/jest": "^27.0.2",
48
48
  "@types/mime-types": "2.1.1",
49
49
  "@types/minimist": "1.2.2",
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "0652aafea4415577e6259a9d334aba785c911e7e"
64
+ "gitHead": "34ed74cec020662252ce42ec52223d9f66a0252b"
65
65
  }
Binary file