@remotion/lambda 4.0.0-prefetch.11 → 4.0.0-prefetch.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +7 -7
- package/dist/admin/bundle-lambda.d.ts +0 -0
- package/dist/admin/bundle-lambda.js +0 -0
- package/dist/admin/make-layer-public.d.ts +0 -0
- package/dist/admin/make-layer-public.js +0 -0
- package/dist/api/bucket-exists.d.ts +0 -0
- package/dist/api/bucket-exists.js +1 -1
- package/dist/api/clean-items.d.ts +0 -0
- package/dist/api/clean-items.js +1 -1
- package/dist/api/create-bucket.d.ts +0 -0
- package/dist/api/create-bucket.js +1 -1
- package/dist/api/create-function.d.ts +0 -0
- package/dist/api/create-function.js +0 -0
- package/dist/api/delete-function.d.ts +0 -0
- package/dist/api/delete-function.js +0 -0
- package/dist/api/delete-render.d.ts +19 -0
- package/dist/api/delete-render.js +66 -0
- package/dist/api/delete-site.d.ts +0 -0
- package/dist/api/delete-site.js +0 -5
- package/dist/api/deploy-function.d.ts +0 -0
- package/dist/api/deploy-function.js +0 -0
- package/dist/api/deploy-site.d.ts +2 -0
- package/dist/api/deploy-site.js +2 -0
- package/dist/api/download-media.d.ts +13 -0
- package/dist/api/download-media.js +15 -3
- package/dist/api/enable-s3-website.d.ts +0 -0
- package/dist/api/enable-s3-website.js +1 -1
- package/dist/api/estimate-price.d.ts +0 -0
- package/dist/api/estimate-price.js +0 -0
- package/dist/api/get-aws-client.d.ts +4 -2
- package/dist/api/get-aws-client.js +7 -2
- package/dist/api/get-buckets.d.ts +0 -0
- package/dist/api/get-buckets.js +2 -2
- package/dist/api/get-function-info.d.ts +0 -0
- package/dist/api/get-function-info.js +0 -0
- package/dist/api/get-functions.d.ts +0 -0
- package/dist/api/get-functions.js +0 -0
- package/dist/api/get-or-create-bucket.d.ts +0 -0
- package/dist/api/get-or-create-bucket.js +0 -0
- package/dist/api/get-regions.d.ts +0 -0
- package/dist/api/get-regions.js +0 -0
- package/dist/api/get-render-progress.d.ts +4 -1
- package/dist/api/get-render-progress.js +3 -1
- package/dist/api/get-sites.d.ts +0 -0
- package/dist/api/get-sites.js +0 -0
- package/dist/api/iam-validation/role-permissions.d.ts +0 -0
- package/dist/api/iam-validation/role-permissions.js +0 -0
- package/dist/api/iam-validation/simulate-rule.d.ts +0 -0
- package/dist/api/iam-validation/simulate-rule.js +0 -0
- package/dist/api/iam-validation/simulate.d.ts +0 -0
- package/dist/api/iam-validation/simulate.js +0 -0
- package/dist/api/iam-validation/suggested-policy.d.ts +0 -0
- package/dist/api/iam-validation/suggested-policy.js +0 -0
- package/dist/api/iam-validation/user-permissions.d.ts +0 -0
- package/dist/api/iam-validation/user-permissions.js +0 -0
- package/dist/api/mock-functions.d.ts +0 -0
- package/dist/api/mock-functions.js +0 -0
- package/dist/api/presign-url.d.ts +0 -0
- package/dist/api/presign-url.js +1 -1
- package/dist/api/render-media-on-lambda.d.ts +18 -10
- package/dist/api/render-media-on-lambda.js +18 -10
- package/dist/api/render-still-on-lambda.d.ts +0 -0
- package/dist/api/render-still-on-lambda.js +0 -0
- package/dist/api/upload-dir.d.ts +0 -0
- package/dist/api/upload-dir.js +1 -1
- package/dist/api/validate-webhook-signature.d.ts +13 -0
- package/dist/api/validate-webhook-signature.js +32 -0
- package/dist/cli/args.d.ts +4 -2
- package/dist/cli/args.js +1 -5
- package/dist/cli/commands/functions/deploy.d.ts +0 -0
- package/dist/cli/commands/functions/deploy.js +0 -0
- package/dist/cli/commands/functions/index.d.ts +0 -0
- package/dist/cli/commands/functions/index.js +0 -0
- package/dist/cli/commands/functions/ls.d.ts +0 -0
- package/dist/cli/commands/functions/ls.js +0 -0
- package/dist/cli/commands/functions/rm.d.ts +0 -0
- package/dist/cli/commands/functions/rm.js +0 -0
- package/dist/cli/commands/functions/rmall.d.ts +0 -0
- package/dist/cli/commands/functions/rmall.js +0 -0
- package/dist/cli/commands/policies/policies.d.ts +0 -0
- package/dist/cli/commands/policies/policies.js +0 -0
- package/dist/cli/commands/policies/role.d.ts +0 -0
- package/dist/cli/commands/policies/role.js +0 -0
- package/dist/cli/commands/policies/user.d.ts +0 -0
- package/dist/cli/commands/policies/user.js +0 -0
- package/dist/cli/commands/policies/validate.d.ts +0 -0
- package/dist/cli/commands/policies/validate.js +0 -0
- package/dist/cli/commands/quotas/increase.d.ts +0 -0
- package/dist/cli/commands/quotas/increase.js +0 -0
- package/dist/cli/commands/quotas/index.d.ts +0 -0
- package/dist/cli/commands/quotas/index.js +0 -0
- package/dist/cli/commands/quotas/list.d.ts +0 -0
- package/dist/cli/commands/quotas/list.js +0 -0
- package/dist/cli/commands/regions.d.ts +0 -0
- package/dist/cli/commands/regions.js +0 -0
- package/dist/cli/commands/render/progress.d.ts +0 -0
- package/dist/cli/commands/render/progress.js +0 -0
- package/dist/cli/commands/render/render.d.ts +0 -0
- package/dist/cli/commands/render/render.js +24 -8
- package/dist/cli/commands/sites/create.d.ts +0 -0
- package/dist/cli/commands/sites/create.js +0 -0
- package/dist/cli/commands/sites/index.d.ts +0 -0
- package/dist/cli/commands/sites/index.js +0 -0
- package/dist/cli/commands/sites/ls.d.ts +0 -0
- package/dist/cli/commands/sites/ls.js +0 -0
- package/dist/cli/commands/sites/rm.d.ts +0 -0
- package/dist/cli/commands/sites/rm.js +0 -0
- package/dist/cli/commands/sites/rmall.d.ts +0 -0
- package/dist/cli/commands/sites/rmall.js +0 -0
- package/dist/cli/commands/still.d.ts +0 -0
- package/dist/cli/commands/still.js +19 -9
- package/dist/cli/get-aws-region.d.ts +0 -0
- package/dist/cli/get-aws-region.js +0 -0
- package/dist/cli/help.d.ts +0 -0
- package/dist/cli/help.js +0 -0
- package/dist/cli/helpers/confirm.d.ts +0 -0
- package/dist/cli/helpers/confirm.js +0 -0
- package/dist/cli/helpers/date-string.d.ts +0 -0
- package/dist/cli/helpers/date-string.js +0 -0
- package/dist/cli/helpers/find-function-name.d.ts +0 -0
- package/dist/cli/helpers/find-function-name.js +0 -0
- package/dist/cli/helpers/progress-bar.d.ts +0 -0
- package/dist/cli/helpers/progress-bar.js +0 -0
- package/dist/cli/helpers/quit.d.ts +0 -0
- package/dist/cli/helpers/quit.js +0 -0
- package/dist/cli/helpers/yes-or-no.d.ts +0 -0
- package/dist/cli/helpers/yes-or-no.js +0 -0
- package/dist/cli/index.d.ts +0 -0
- package/dist/cli/index.js +1 -1
- package/dist/cli/is-cli.d.ts +0 -0
- package/dist/cli/is-cli.js +0 -0
- package/dist/cli/log.d.ts +0 -0
- package/dist/cli/log.js +0 -0
- package/dist/client.d.ts +4 -2
- package/dist/client.js +3 -1
- package/dist/defaults.d.ts +0 -0
- package/dist/defaults.js +0 -0
- package/dist/functions/chunk-optimization/can-use-optimization.d.ts +0 -0
- package/dist/functions/chunk-optimization/can-use-optimization.js +0 -0
- package/dist/functions/chunk-optimization/collect-data.d.ts +0 -0
- package/dist/functions/chunk-optimization/collect-data.js +0 -0
- package/dist/functions/chunk-optimization/get-frame-ranges-from-profile.d.ts +0 -0
- package/dist/functions/chunk-optimization/get-frame-ranges-from-profile.js +0 -0
- package/dist/functions/chunk-optimization/get-profile-duration.d.ts +0 -0
- package/dist/functions/chunk-optimization/get-profile-duration.js +0 -0
- package/dist/functions/chunk-optimization/is-valid-profile.d.ts +0 -0
- package/dist/functions/chunk-optimization/is-valid-profile.js +0 -0
- package/dist/functions/chunk-optimization/optimize-invocation-order.d.ts +0 -0
- package/dist/functions/chunk-optimization/optimize-invocation-order.js +0 -0
- package/dist/functions/chunk-optimization/optimize-profile.d.ts +0 -0
- package/dist/functions/chunk-optimization/optimize-profile.js +0 -0
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +4 -1
- package/dist/functions/chunk-optimization/plan-frame-ranges.js +0 -0
- package/dist/functions/chunk-optimization/s3-optimization-file.d.ts +0 -0
- package/dist/functions/chunk-optimization/s3-optimization-file.js +1 -0
- package/dist/functions/chunk-optimization/simulate-frame-ranges.d.ts +0 -0
- package/dist/functions/chunk-optimization/simulate-frame-ranges.js +0 -0
- package/dist/functions/chunk-optimization/sort-by-duration.d.ts +0 -0
- package/dist/functions/chunk-optimization/sort-by-duration.js +0 -0
- package/dist/functions/chunk-optimization/types.d.ts +0 -0
- package/dist/functions/chunk-optimization/types.js +0 -0
- package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -0
- package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -0
- package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -0
- package/dist/functions/helpers/calculate-chunk-times.js +0 -0
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -0
- package/dist/functions/helpers/calculate-price-from-bucket.js +0 -0
- package/dist/functions/helpers/check-if-render-exists.d.ts +0 -0
- package/dist/functions/helpers/check-if-render-exists.js +0 -0
- package/dist/functions/helpers/clean-tmpdir.d.ts +0 -0
- package/dist/functions/helpers/clean-tmpdir.js +1 -1
- package/dist/functions/helpers/concat-videos.d.ts +3 -1
- package/dist/functions/helpers/concat-videos.js +25 -9
- package/dist/functions/helpers/create-post-render-data.d.ts +0 -0
- package/dist/functions/helpers/create-post-render-data.js +0 -0
- package/dist/functions/helpers/delete-chunks.d.ts +0 -0
- package/dist/functions/helpers/delete-chunks.js +0 -0
- package/dist/functions/helpers/expected-out-name.d.ts +4 -2
- package/dist/functions/helpers/expected-out-name.js +26 -5
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +3 -1
- package/dist/functions/helpers/find-output-file-in-bucket.js +12 -10
- package/dist/functions/helpers/format-costs-info.d.ts +0 -0
- package/dist/functions/helpers/format-costs-info.js +0 -0
- package/dist/functions/helpers/get-browser-instance.d.ts +0 -0
- package/dist/functions/helpers/get-browser-instance.js +0 -0
- package/dist/functions/helpers/get-chromium-executable-path.d.ts +0 -0
- package/dist/functions/helpers/get-chromium-executable-path.js +0 -0
- package/dist/functions/helpers/get-cleanup-progress.d.ts +0 -0
- package/dist/functions/helpers/get-cleanup-progress.js +0 -0
- package/dist/functions/helpers/get-current-architecture.d.ts +0 -0
- package/dist/functions/helpers/get-current-architecture.js +0 -0
- package/dist/functions/helpers/get-current-region.d.ts +0 -0
- package/dist/functions/helpers/get-current-region.js +0 -0
- package/dist/functions/helpers/get-custom-out-name.d.ts +6 -0
- package/dist/functions/helpers/get-custom-out-name.js +31 -0
- package/dist/functions/helpers/get-encoding-metadata.d.ts +0 -0
- package/dist/functions/helpers/get-encoding-metadata.js +0 -0
- package/dist/functions/helpers/get-files-in-folder.d.ts +0 -0
- package/dist/functions/helpers/get-files-in-folder.js +0 -0
- package/dist/functions/helpers/get-files-to-delete.d.ts +0 -0
- package/dist/functions/helpers/get-files-to-delete.js +0 -0
- package/dist/functions/helpers/get-final-encoding-status.d.ts +0 -0
- package/dist/functions/helpers/get-final-encoding-status.js +0 -0
- package/dist/functions/helpers/get-folder-size.d.ts +0 -0
- package/dist/functions/helpers/get-folder-size.js +0 -0
- package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +0 -0
- package/dist/functions/helpers/get-lambdas-invoked-stats.js +0 -0
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +2 -1
- package/dist/functions/helpers/get-output-url-from-metadata.js +2 -2
- package/dist/functions/helpers/get-overall-progress.d.ts +0 -0
- package/dist/functions/helpers/get-overall-progress.js +0 -0
- package/dist/functions/helpers/get-post-render-data.d.ts +0 -0
- package/dist/functions/helpers/get-post-render-data.js +0 -0
- package/dist/functions/helpers/get-progress.d.ts +4 -2
- package/dist/functions/helpers/get-progress.js +11 -6
- package/dist/functions/helpers/get-render-metadata.d.ts +0 -0
- package/dist/functions/helpers/get-render-metadata.js +0 -0
- package/dist/functions/helpers/get-retry-stats.d.ts +0 -0
- package/dist/functions/helpers/get-retry-stats.js +0 -0
- package/dist/functions/helpers/get-time-to-finish.d.ts +0 -0
- package/dist/functions/helpers/get-time-to-finish.js +0 -0
- package/dist/functions/helpers/inspect-errors.d.ts +0 -0
- package/dist/functions/helpers/inspect-errors.js +0 -0
- package/dist/functions/helpers/io.d.ts +13 -2
- package/dist/functions/helpers/io.js +16 -8
- package/dist/functions/helpers/is-enosp-err.d.ts +0 -0
- package/dist/functions/helpers/is-enosp-err.js +0 -0
- package/dist/functions/helpers/is-warm.d.ts +0 -0
- package/dist/functions/helpers/is-warm.js +0 -0
- package/dist/functions/helpers/min-max.d.ts +0 -0
- package/dist/functions/helpers/min-max.js +0 -0
- package/dist/functions/helpers/print-cloudwatch-helper.d.ts +0 -0
- package/dist/functions/helpers/print-cloudwatch-helper.js +0 -0
- package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -0
- package/dist/functions/helpers/print-concurrency-curve.js +0 -0
- package/dist/functions/helpers/read-with-progress.d.ts +3 -1
- package/dist/functions/helpers/read-with-progress.js +2 -2
- package/dist/functions/helpers/timer.d.ts +0 -0
- package/dist/functions/helpers/timer.js +0 -0
- package/dist/functions/helpers/validate-composition.d.ts +0 -0
- package/dist/functions/helpers/validate-composition.js +0 -0
- package/dist/functions/helpers/write-lambda-error.d.ts +1 -1
- package/dist/functions/helpers/write-lambda-error.js +1 -0
- package/dist/functions/helpers/write-post-render-data.d.ts +0 -0
- package/dist/functions/helpers/write-post-render-data.js +1 -0
- package/dist/functions/index.d.ts +0 -0
- package/dist/functions/index.js +2 -2
- package/dist/functions/info.d.ts +0 -0
- package/dist/functions/info.js +0 -0
- package/dist/functions/launch.d.ts +0 -0
- package/dist/functions/launch.js +206 -5
- package/dist/functions/progress.d.ts +1 -1
- package/dist/functions/progress.js +3 -1
- package/dist/functions/renderer.d.ts +0 -0
- package/dist/functions/renderer.js +17 -1
- package/dist/functions/start.d.ts +0 -0
- package/dist/functions/start.js +5 -0
- package/dist/functions/still.d.ts +0 -0
- package/dist/functions/still.js +9 -3
- package/dist/index.d.ts +7 -2
- package/dist/index.js +5 -1
- package/dist/internals.d.ts +0 -0
- package/dist/internals.js +0 -0
- package/dist/pricing/aws-regions.d.ts +0 -0
- package/dist/pricing/aws-regions.js +0 -0
- package/dist/pricing/price-per-1-s.d.ts +0 -0
- package/dist/pricing/price-per-1-s.js +0 -0
- package/dist/regions.d.ts +0 -0
- package/dist/regions.js +0 -0
- package/dist/shared/await.d.ts +0 -0
- package/dist/shared/await.js +0 -0
- package/dist/shared/aws-clients.d.ts +13 -2
- package/dist/shared/aws-clients.js +56 -26
- package/dist/shared/bundle-site.d.ts +2 -1
- package/dist/shared/bundle-site.js +0 -0
- package/dist/shared/call-lambda.d.ts +0 -0
- package/dist/shared/call-lambda.js +0 -0
- package/dist/shared/check-credentials.d.ts +0 -0
- package/dist/shared/check-credentials.js +0 -0
- package/dist/shared/constants.d.ts +26 -1
- package/dist/shared/constants.js +7 -1
- package/dist/shared/content-disposition-header.d.ts +0 -0
- package/dist/shared/content-disposition-header.js +0 -0
- package/dist/shared/convert-to-serve-url.d.ts +0 -0
- package/dist/shared/convert-to-serve-url.js +0 -0
- package/dist/shared/docs-url.d.ts +0 -0
- package/dist/shared/docs-url.js +0 -0
- package/dist/shared/function-zip-path.d.ts +0 -0
- package/dist/shared/function-zip-path.js +0 -0
- package/dist/shared/get-account-id.d.ts +0 -0
- package/dist/shared/get-account-id.js +0 -0
- package/dist/shared/get-cloudwatch-stream-url.d.ts +0 -0
- package/dist/shared/get-cloudwatch-stream-url.js +0 -0
- package/dist/shared/get-function-version.d.ts +0 -0
- package/dist/shared/get-function-version.js +0 -0
- package/dist/shared/get-most-expensive-chunks.d.ts +0 -0
- package/dist/shared/get-most-expensive-chunks.js +0 -0
- package/dist/shared/hosted-layers.d.ts +0 -0
- package/dist/shared/hosted-layers.js +0 -0
- package/dist/shared/invoke-webhook.d.ts +44 -0
- package/dist/shared/invoke-webhook.js +89 -0
- package/dist/shared/is-in-lambda.d.ts +0 -0
- package/dist/shared/is-in-lambda.js +0 -0
- package/dist/shared/lambda-version-string.d.ts +0 -0
- package/dist/shared/lambda-version-string.js +0 -0
- package/dist/shared/make-s3-key.d.ts +0 -0
- package/dist/shared/make-s3-key.js +0 -0
- package/dist/shared/make-s3-url.d.ts +0 -0
- package/dist/shared/make-s3-url.js +0 -0
- package/dist/shared/p-limit.d.ts +0 -0
- package/dist/shared/p-limit.js +0 -0
- package/dist/shared/parse-lambda-initialized-key.d.ts +0 -0
- package/dist/shared/parse-lambda-initialized-key.js +0 -0
- package/dist/shared/parse-lambda-timings-key.d.ts +0 -0
- package/dist/shared/parse-lambda-timings-key.js +0 -0
- package/dist/shared/random-hash.d.ts +0 -0
- package/dist/shared/random-hash.js +0 -0
- package/dist/shared/return-values.d.ts +0 -0
- package/dist/shared/return-values.js +0 -0
- package/dist/shared/sleep.d.ts +0 -0
- package/dist/shared/sleep.js +0 -0
- package/dist/shared/stream-to-string.d.ts +0 -0
- package/dist/shared/stream-to-string.js +0 -0
- package/dist/shared/truthy.d.ts +0 -0
- package/dist/shared/truthy.js +0 -0
- package/dist/shared/validate-architecture.d.ts +0 -0
- package/dist/shared/validate-architecture.js +0 -0
- package/dist/shared/validate-aws-region.d.ts +0 -0
- package/dist/shared/validate-aws-region.js +0 -0
- package/dist/shared/validate-bucketname.d.ts +0 -0
- package/dist/shared/validate-bucketname.js +0 -0
- package/dist/shared/validate-custom-role-arn.d.ts +0 -0
- package/dist/shared/validate-custom-role-arn.js +0 -0
- package/dist/shared/validate-disk-size-in-mb.d.ts +0 -0
- package/dist/shared/validate-disk-size-in-mb.js +0 -0
- package/dist/shared/validate-download-behavior.d.ts +0 -0
- package/dist/shared/validate-download-behavior.js +0 -0
- package/dist/shared/validate-frames-per-lambda.d.ts +4 -1
- package/dist/shared/validate-frames-per-lambda.js +4 -3
- package/dist/shared/validate-lambda-codec.d.ts +0 -0
- package/dist/shared/validate-lambda-codec.js +0 -0
- package/dist/shared/validate-memory-size.d.ts +0 -0
- package/dist/shared/validate-memory-size.js +0 -0
- package/dist/shared/validate-outname.d.ts +3 -2
- package/dist/shared/validate-outname.js +5 -1
- package/dist/shared/validate-presign-expiration.d.ts +0 -0
- package/dist/shared/validate-presign-expiration.js +0 -0
- package/dist/shared/validate-privacy.d.ts +0 -0
- package/dist/shared/validate-privacy.js +0 -0
- package/dist/shared/validate-retention-period.d.ts +0 -0
- package/dist/shared/validate-retention-period.js +0 -0
- package/dist/shared/validate-retries.d.ts +0 -0
- package/dist/shared/validate-retries.js +0 -0
- package/dist/shared/validate-serveurl.d.ts +0 -0
- package/dist/shared/validate-serveurl.js +0 -0
- package/dist/shared/validate-site-name.d.ts +0 -0
- package/dist/shared/validate-site-name.js +0 -0
- package/dist/shared/validate-timeout.d.ts +0 -0
- package/dist/shared/validate-timeout.js +0 -0
- package/package.json +18 -21
- package/remotionlambda.zip +0 -0
- package/dist/cli/helpers/get-cloudwatch-stream-url.d.ts +0 -8
- package/dist/cli/helpers/get-cloudwatch-stream-url.js +0 -7
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/functions/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const start_1 = require("./start");
|
|
|
14
14
|
const still_1 = require("./still");
|
|
15
15
|
const handler = async (params, context) => {
|
|
16
16
|
process.env.__RESERVED_IS_INSIDE_REMOTION_LAMBDA = 'true';
|
|
17
|
-
const
|
|
17
|
+
const timeoutInMilliseconds = context.getRemainingTimeInMillis();
|
|
18
18
|
if (!context || !context.invokedFunctionArn) {
|
|
19
19
|
throw new Error('Lambda function unexpectedly does not have context.invokedFunctionArn');
|
|
20
20
|
}
|
|
@@ -53,7 +53,7 @@ const handler = async (params, context) => {
|
|
|
53
53
|
});
|
|
54
54
|
return (0, progress_1.progressHandler)(params, {
|
|
55
55
|
expectedBucketOwner: currentUserId,
|
|
56
|
-
|
|
56
|
+
timeoutInMilliseconds,
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
if (params.type === constants_1.LambdaRoutines.renderer) {
|
package/dist/functions/info.d.ts
CHANGED
|
File without changes
|
package/dist/functions/info.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/functions/launch.js
CHANGED
|
@@ -12,6 +12,7 @@ const version_1 = require("remotion/version");
|
|
|
12
12
|
const aws_clients_1 = require("../shared/aws-clients");
|
|
13
13
|
const constants_1 = require("../shared/constants");
|
|
14
14
|
const docs_url_1 = require("../shared/docs-url");
|
|
15
|
+
const invoke_webhook_1 = require("../shared/invoke-webhook");
|
|
15
16
|
const make_s3_url_1 = require("../shared/make-s3-url");
|
|
16
17
|
const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
|
|
17
18
|
const validate_outname_1 = require("../shared/validate-outname");
|
|
@@ -29,6 +30,7 @@ const concat_videos_1 = require("./helpers/concat-videos");
|
|
|
29
30
|
const create_post_render_data_1 = require("./helpers/create-post-render-data");
|
|
30
31
|
const delete_chunks_1 = require("./helpers/delete-chunks");
|
|
31
32
|
const expected_out_name_1 = require("./helpers/expected-out-name");
|
|
33
|
+
const find_output_file_in_bucket_1 = require("./helpers/find-output-file-in-bucket");
|
|
32
34
|
const get_browser_instance_1 = require("./helpers/get-browser-instance");
|
|
33
35
|
const get_current_region_1 = require("./helpers/get-current-region");
|
|
34
36
|
const get_files_to_delete_1 = require("./helpers/get-files-to-delete");
|
|
@@ -62,11 +64,54 @@ const callFunctionWithRetry = async (payload, retries = 0) => {
|
|
|
62
64
|
}
|
|
63
65
|
};
|
|
64
66
|
const innerLaunchHandler = async (params, options) => {
|
|
65
|
-
var _a, _b;
|
|
67
|
+
var _a, _b, _c, _d;
|
|
66
68
|
if (params.type !== constants_1.LambdaRoutines.launch) {
|
|
67
69
|
throw new Error('Expected launch type');
|
|
68
70
|
}
|
|
69
71
|
const startedDate = Date.now();
|
|
72
|
+
let webhookInvoked = false;
|
|
73
|
+
const webhookDueToTimeout = setTimeout(async () => {
|
|
74
|
+
if (params.webhook && !webhookInvoked) {
|
|
75
|
+
try {
|
|
76
|
+
await (0, invoke_webhook_1.invokeWebhook)({
|
|
77
|
+
url: params.webhook.url,
|
|
78
|
+
secret: params.webhook.secret,
|
|
79
|
+
payload: {
|
|
80
|
+
type: 'timeout',
|
|
81
|
+
renderId: params.renderId,
|
|
82
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
83
|
+
bucketName: params.bucketName,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
webhookInvoked = true;
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
if (process.env.NODE_ENV === 'test') {
|
|
90
|
+
throw err;
|
|
91
|
+
}
|
|
92
|
+
await (0, write_lambda_error_1.writeLambdaError)({
|
|
93
|
+
bucketName: params.bucketName,
|
|
94
|
+
errorInfo: {
|
|
95
|
+
type: 'webhook',
|
|
96
|
+
message: err.message,
|
|
97
|
+
name: err.name,
|
|
98
|
+
stack: err.stack,
|
|
99
|
+
tmpDir: null,
|
|
100
|
+
frame: 0,
|
|
101
|
+
chunk: 0,
|
|
102
|
+
isFatal: false,
|
|
103
|
+
attempt: 1,
|
|
104
|
+
willRetry: false,
|
|
105
|
+
totalAttempts: 1,
|
|
106
|
+
},
|
|
107
|
+
renderId: params.renderId,
|
|
108
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
109
|
+
});
|
|
110
|
+
console.log('Failed to invoke webhook:');
|
|
111
|
+
console.log(err);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, Math.max(params.timeoutInMilliseconds - 1000, 1000));
|
|
70
115
|
const [browserInstance, optimization] = await Promise.all([
|
|
71
116
|
(0, get_browser_instance_1.getBrowserInstance)(renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'), params.chromiumOptions),
|
|
72
117
|
(0, s3_optimization_file_1.getOptimization)({
|
|
@@ -95,16 +140,21 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
95
140
|
remotion_1.Internals.validateFps(comp.fps, 'passed to a Lambda render', false);
|
|
96
141
|
remotion_1.Internals.validateDimension(comp.height, 'height', 'passed to a Lambda render');
|
|
97
142
|
remotion_1.Internals.validateDimension(comp.width, 'width', 'passed to a Lambda render');
|
|
143
|
+
renderer_1.RenderInternals.validateBitrate(params.audioBitrate, 'audioBitrate');
|
|
144
|
+
renderer_1.RenderInternals.validateBitrate(params.videoBitrate, 'videoBitrate');
|
|
98
145
|
renderer_1.RenderInternals.validateConcurrency(params.concurrencyPerLambda, 'concurrencyPerLambda');
|
|
99
146
|
const realFrameRange = renderer_1.RenderInternals.getRealFrameRange(comp.durationInFrames, params.frameRange);
|
|
100
147
|
const frameCount = renderer_1.RenderInternals.getFramesToRender(realFrameRange, params.everyNthFrame);
|
|
101
148
|
const framesPerLambda = (_a = params.framesPerLambda) !== null && _a !== void 0 ? _a : (0, best_frames_per_lambda_param_1.bestFramesPerLambdaParam)(frameCount.length);
|
|
102
|
-
(0, validate_frames_per_lambda_1.validateFramesPerLambda)(
|
|
149
|
+
(0, validate_frames_per_lambda_1.validateFramesPerLambda)({
|
|
150
|
+
framesPerLambda,
|
|
151
|
+
durationInFrames: frameCount.length,
|
|
152
|
+
});
|
|
103
153
|
const chunkCount = Math.ceil(frameCount.length / framesPerLambda);
|
|
104
154
|
if (chunkCount > constants_1.MAX_FUNCTIONS_PER_RENDER) {
|
|
105
155
|
throw new Error(`Too many functions: This render would cause ${chunkCount} functions to spawn. We limit this amount to ${constants_1.MAX_FUNCTIONS_PER_RENDER} functions as more would result in diminishing returns. Values set: frameCount = ${frameCount}, framesPerLambda=${framesPerLambda}. See ${docs_url_1.DOCS_URL}/docs/lambda/concurrency for how this parameter is calculated.`);
|
|
106
156
|
}
|
|
107
|
-
(0, validate_outname_1.validateOutname)(params.outName);
|
|
157
|
+
(0, validate_outname_1.validateOutname)(params.outName, params.codec);
|
|
108
158
|
(0, validate_privacy_1.validatePrivacy)(params.privacy);
|
|
109
159
|
renderer_1.RenderInternals.validatePuppeteerTimeout(params.timeoutInMilliseconds);
|
|
110
160
|
const { chunks, didUseOptimization } = (0, plan_frame_ranges_1.planFrameRanges)({
|
|
@@ -150,6 +200,8 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
150
200
|
everyNthFrame: params.everyNthFrame,
|
|
151
201
|
concurrencyPerLambda: params.concurrencyPerLambda,
|
|
152
202
|
muted: params.muted,
|
|
203
|
+
audioBitrate: params.audioBitrate,
|
|
204
|
+
videoBitrate: params.videoBitrate,
|
|
153
205
|
};
|
|
154
206
|
return payload;
|
|
155
207
|
});
|
|
@@ -178,7 +230,31 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
178
230
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
179
231
|
renderId: params.renderId,
|
|
180
232
|
outName: (_b = params.outName) !== null && _b !== void 0 ? _b : undefined,
|
|
233
|
+
privacy: params.privacy,
|
|
181
234
|
};
|
|
235
|
+
const { key, renderBucketName, customCredentials } = (0, expected_out_name_1.getExpectedOutName)(renderMetadata, params.bucketName, typeof params.outName === 'string' || typeof params.outName === 'undefined'
|
|
236
|
+
? null
|
|
237
|
+
: (_d = (_c = params.outName) === null || _c === void 0 ? void 0 : _c.s3OutputProvider) !== null && _d !== void 0 ? _d : null);
|
|
238
|
+
const output = await (0, find_output_file_in_bucket_1.findOutputFileInBucket)({
|
|
239
|
+
bucketName: params.bucketName,
|
|
240
|
+
customCredentials,
|
|
241
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
242
|
+
renderMetadata,
|
|
243
|
+
});
|
|
244
|
+
if (output) {
|
|
245
|
+
if (params.overwrite) {
|
|
246
|
+
console.info('Deleting', { bucketName: renderBucketName, key }, 'because it already existed and will be overwritten');
|
|
247
|
+
await (0, io_1.lambdaDeleteFile)({
|
|
248
|
+
bucketName: renderBucketName,
|
|
249
|
+
customCredentials,
|
|
250
|
+
key,
|
|
251
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
throw new TypeError(`Output file "${key}" in bucket "${renderBucketName}" in region "${(0, get_current_region_1.getCurrentRegionInFunction)()}" already exists. Delete it before re-rendering, or use the overwrite option to delete it before render."`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
182
258
|
await (0, io_1.lambdaWriteFile)({
|
|
183
259
|
bucketName: params.bucketName,
|
|
184
260
|
key: (0, constants_1.renderMetadataKey)(params.renderId),
|
|
@@ -187,6 +263,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
187
263
|
privacy: 'private',
|
|
188
264
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
189
265
|
downloadBehavior: null,
|
|
266
|
+
customCredentials: null,
|
|
190
267
|
});
|
|
191
268
|
await Promise.all(lambdaPayloads.map(async (payload, index) => {
|
|
192
269
|
const callingLambdaTimer = (0, timer_1.timer)('Calling chunk ' + index);
|
|
@@ -220,6 +297,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
220
297
|
privacy: 'private',
|
|
221
298
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
222
299
|
downloadBehavior: null,
|
|
300
|
+
customCredentials: null,
|
|
223
301
|
}).catch((err) => {
|
|
224
302
|
(0, write_lambda_error_1.writeLambdaError)({
|
|
225
303
|
bucketName: params.bucketName,
|
|
@@ -241,6 +319,32 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
241
319
|
});
|
|
242
320
|
});
|
|
243
321
|
};
|
|
322
|
+
const onErrors = async (errors) => {
|
|
323
|
+
var _a;
|
|
324
|
+
console.log('Found Errors', errors);
|
|
325
|
+
if (params.webhook) {
|
|
326
|
+
console.log('Sending webhook with errors');
|
|
327
|
+
await (0, invoke_webhook_1.invokeWebhook)({
|
|
328
|
+
url: params.webhook.url,
|
|
329
|
+
secret: (_a = params.webhook.secret) !== null && _a !== void 0 ? _a : null,
|
|
330
|
+
payload: {
|
|
331
|
+
type: 'error',
|
|
332
|
+
renderId: params.renderId,
|
|
333
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
334
|
+
bucketName: params.bucketName,
|
|
335
|
+
errors: errors.slice(0, 5).map((e) => ({
|
|
336
|
+
message: e.message,
|
|
337
|
+
name: e.name,
|
|
338
|
+
stack: e.stack,
|
|
339
|
+
})),
|
|
340
|
+
},
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
console.log('No webhook specified');
|
|
345
|
+
}
|
|
346
|
+
throw new Error('Stopping Lambda function because error occurred: ' + errors[0].stack);
|
|
347
|
+
};
|
|
244
348
|
const fps = comp.fps / params.everyNthFrame;
|
|
245
349
|
const { outfile, cleanupChunksProm, encodingStart } = await (0, concat_videos_1.concatVideosS3)({
|
|
246
350
|
bucket: params.bucketName,
|
|
@@ -253,11 +357,11 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
253
357
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
254
358
|
fps,
|
|
255
359
|
numberOfGifLoops: params.numberOfGifLoops,
|
|
360
|
+
onErrors,
|
|
256
361
|
});
|
|
257
362
|
if (!encodingStop) {
|
|
258
363
|
encodingStop = Date.now();
|
|
259
364
|
}
|
|
260
|
-
const { key, renderBucketName } = (0, expected_out_name_1.getExpectedOutName)(renderMetadata, params.bucketName);
|
|
261
365
|
const outputSize = fs_1.default.statSync(outfile);
|
|
262
366
|
await (0, io_1.lambdaWriteFile)({
|
|
263
367
|
bucketName: renderBucketName,
|
|
@@ -267,6 +371,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
267
371
|
privacy: params.privacy,
|
|
268
372
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
269
373
|
downloadBehavior: params.downloadBehavior,
|
|
374
|
+
customCredentials,
|
|
270
375
|
});
|
|
271
376
|
let chunkProm = Promise.resolve();
|
|
272
377
|
// TODO: Enable in a later release
|
|
@@ -329,6 +434,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
329
434
|
privacy: 'private',
|
|
330
435
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
331
436
|
downloadBehavior: null,
|
|
437
|
+
customCredentials: null,
|
|
332
438
|
});
|
|
333
439
|
const errorExplanationsProm = (0, inspect_errors_1.inspectErrors)({
|
|
334
440
|
contents,
|
|
@@ -347,6 +453,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
347
453
|
contents,
|
|
348
454
|
jobs,
|
|
349
455
|
});
|
|
456
|
+
const outputUrl = (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, params.bucketName, customCredentials);
|
|
350
457
|
const postRenderData = (0, create_post_render_data_1.createPostRenderData)({
|
|
351
458
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
352
459
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
@@ -360,7 +467,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
360
467
|
outputFile: {
|
|
361
468
|
lastModified: Date.now(),
|
|
362
469
|
size: outputSize.size,
|
|
363
|
-
url:
|
|
470
|
+
url: outputUrl,
|
|
364
471
|
},
|
|
365
472
|
});
|
|
366
473
|
await finalEncodingProgressProm;
|
|
@@ -375,10 +482,57 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
375
482
|
bucketName: params.bucketName,
|
|
376
483
|
key: (0, constants_1.initalizedMetadataKey)(params.renderId),
|
|
377
484
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
485
|
+
customCredentials: null,
|
|
378
486
|
});
|
|
379
487
|
await Promise.all([cleanupChunksProm, fs_1.default.promises.rm(outfile)]);
|
|
488
|
+
clearTimeout(webhookDueToTimeout);
|
|
489
|
+
if (params.webhook && !webhookInvoked) {
|
|
490
|
+
try {
|
|
491
|
+
await (0, invoke_webhook_1.invokeWebhook)({
|
|
492
|
+
url: params.webhook.url,
|
|
493
|
+
secret: params.webhook.secret,
|
|
494
|
+
payload: {
|
|
495
|
+
type: 'success',
|
|
496
|
+
renderId: params.renderId,
|
|
497
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
498
|
+
bucketName: params.bucketName,
|
|
499
|
+
outputUrl,
|
|
500
|
+
lambdaErrors: postRenderData.errors,
|
|
501
|
+
outputFile: postRenderData.outputFile,
|
|
502
|
+
timeToFinish: postRenderData.timeToFinish,
|
|
503
|
+
},
|
|
504
|
+
});
|
|
505
|
+
webhookInvoked = true;
|
|
506
|
+
}
|
|
507
|
+
catch (err) {
|
|
508
|
+
if (process.env.NODE_ENV === 'test') {
|
|
509
|
+
throw err;
|
|
510
|
+
}
|
|
511
|
+
await (0, write_lambda_error_1.writeLambdaError)({
|
|
512
|
+
bucketName: params.bucketName,
|
|
513
|
+
errorInfo: {
|
|
514
|
+
type: 'webhook',
|
|
515
|
+
message: err.message,
|
|
516
|
+
name: err.name,
|
|
517
|
+
stack: err.stack,
|
|
518
|
+
tmpDir: null,
|
|
519
|
+
frame: 0,
|
|
520
|
+
chunk: 0,
|
|
521
|
+
isFatal: false,
|
|
522
|
+
attempt: 1,
|
|
523
|
+
willRetry: false,
|
|
524
|
+
totalAttempts: 1,
|
|
525
|
+
},
|
|
526
|
+
renderId: params.renderId,
|
|
527
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
528
|
+
});
|
|
529
|
+
console.log('Failed to invoke webhook:');
|
|
530
|
+
console.log(err);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
380
533
|
};
|
|
381
534
|
const launchHandler = async (params, options) => {
|
|
535
|
+
var _a, _b;
|
|
382
536
|
if (params.type !== constants_1.LambdaRoutines.launch) {
|
|
383
537
|
throw new Error('Expected launch type');
|
|
384
538
|
}
|
|
@@ -386,6 +540,9 @@ const launchHandler = async (params, options) => {
|
|
|
386
540
|
await innerLaunchHandler(params, options);
|
|
387
541
|
}
|
|
388
542
|
catch (err) {
|
|
543
|
+
if (process.env.NODE_ENV === 'test') {
|
|
544
|
+
throw err;
|
|
545
|
+
}
|
|
389
546
|
console.log('Error occurred', err);
|
|
390
547
|
await (0, write_lambda_error_1.writeLambdaError)({
|
|
391
548
|
bucketName: params.bucketName,
|
|
@@ -405,6 +562,50 @@ const launchHandler = async (params, options) => {
|
|
|
405
562
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
406
563
|
renderId: params.renderId,
|
|
407
564
|
});
|
|
565
|
+
if ((_a = params.webhook) === null || _a === void 0 ? void 0 : _a.url) {
|
|
566
|
+
try {
|
|
567
|
+
await (0, invoke_webhook_1.invokeWebhook)({
|
|
568
|
+
url: params.webhook.url,
|
|
569
|
+
secret: (_b = params.webhook.secret) !== null && _b !== void 0 ? _b : null,
|
|
570
|
+
payload: {
|
|
571
|
+
type: 'error',
|
|
572
|
+
renderId: params.renderId,
|
|
573
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
574
|
+
bucketName: params.bucketName,
|
|
575
|
+
errors: [err].map((e) => ({
|
|
576
|
+
message: e.message,
|
|
577
|
+
name: e.name,
|
|
578
|
+
stack: e.stack,
|
|
579
|
+
})),
|
|
580
|
+
},
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
catch (error) {
|
|
584
|
+
if (process.env.NODE_ENV === 'test') {
|
|
585
|
+
throw error;
|
|
586
|
+
}
|
|
587
|
+
await (0, write_lambda_error_1.writeLambdaError)({
|
|
588
|
+
bucketName: params.bucketName,
|
|
589
|
+
errorInfo: {
|
|
590
|
+
type: 'webhook',
|
|
591
|
+
message: err.message,
|
|
592
|
+
name: err.name,
|
|
593
|
+
stack: err.stack,
|
|
594
|
+
tmpDir: null,
|
|
595
|
+
frame: 0,
|
|
596
|
+
chunk: 0,
|
|
597
|
+
isFatal: false,
|
|
598
|
+
attempt: 1,
|
|
599
|
+
willRetry: false,
|
|
600
|
+
totalAttempts: 1,
|
|
601
|
+
},
|
|
602
|
+
renderId: params.renderId,
|
|
603
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
604
|
+
});
|
|
605
|
+
console.log('Failed to invoke webhook:');
|
|
606
|
+
console.log(error);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
408
609
|
}
|
|
409
610
|
};
|
|
410
611
|
exports.launchHandler = launchHandler;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LambdaPayload, RenderProgress } from '../shared/constants';
|
|
2
2
|
declare type Options = {
|
|
3
3
|
expectedBucketOwner: string;
|
|
4
|
-
|
|
4
|
+
timeoutInMilliseconds: number;
|
|
5
5
|
};
|
|
6
6
|
export declare const progressHandler: (lambdaParams: LambdaPayload, options: Options) => Promise<RenderProgress>;
|
|
7
7
|
export {};
|
|
@@ -6,6 +6,7 @@ const constants_1 = require("../shared/constants");
|
|
|
6
6
|
const get_current_region_1 = require("./helpers/get-current-region");
|
|
7
7
|
const get_progress_1 = require("./helpers/get-progress");
|
|
8
8
|
const progressHandler = (lambdaParams, options) => {
|
|
9
|
+
var _a;
|
|
9
10
|
if (lambdaParams.type !== constants_1.LambdaRoutines.status) {
|
|
10
11
|
throw new TypeError('Expected status type');
|
|
11
12
|
}
|
|
@@ -21,7 +22,8 @@ const progressHandler = (lambdaParams, options) => {
|
|
|
21
22
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
22
23
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
23
24
|
memorySizeInMb: Number(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE),
|
|
24
|
-
|
|
25
|
+
timeoutInMilliseconds: options.timeoutInMilliseconds,
|
|
26
|
+
customCredentials: (_a = lambdaParams.s3OutputProvider) !== null && _a !== void 0 ? _a : null,
|
|
25
27
|
});
|
|
26
28
|
};
|
|
27
29
|
exports.progressHandler = progressHandler;
|
|
File without changes
|
|
@@ -66,7 +66,7 @@ const renderHandler = async (params, options, logs) => {
|
|
|
66
66
|
}
|
|
67
67
|
chunkTimingData.timings[renderedFrames] = Date.now() - start;
|
|
68
68
|
},
|
|
69
|
-
|
|
69
|
+
concurrency: params.concurrencyPerLambda,
|
|
70
70
|
onStart: () => {
|
|
71
71
|
(0, io_1.lambdaWriteFile)({
|
|
72
72
|
privacy: 'private',
|
|
@@ -87,6 +87,7 @@ const renderHandler = async (params, options, logs) => {
|
|
|
87
87
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
88
88
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
89
89
|
downloadBehavior: null,
|
|
90
|
+
customCredentials: null,
|
|
90
91
|
}).catch((err) => reject(err));
|
|
91
92
|
},
|
|
92
93
|
puppeteerInstance: browserInstance,
|
|
@@ -135,6 +136,15 @@ const renderHandler = async (params, options, logs) => {
|
|
|
135
136
|
downloadMap,
|
|
136
137
|
muted: params.muted,
|
|
137
138
|
enforceAudioTrack: true,
|
|
139
|
+
audioBitrate: params.audioBitrate,
|
|
140
|
+
videoBitrate: params.videoBitrate,
|
|
141
|
+
onSlowestFrames: (slowestFrames) => {
|
|
142
|
+
console.log();
|
|
143
|
+
console.log(`Slowest frames:`);
|
|
144
|
+
slowestFrames.forEach(({ frame, time }) => {
|
|
145
|
+
console.log(`Frame ${frame} (${time.toFixed(3)}ms)`);
|
|
146
|
+
});
|
|
147
|
+
},
|
|
138
148
|
})
|
|
139
149
|
.then(() => resolve())
|
|
140
150
|
.catch((err) => reject(err));
|
|
@@ -155,6 +165,7 @@ const renderHandler = async (params, options, logs) => {
|
|
|
155
165
|
privacy: params.privacy,
|
|
156
166
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
157
167
|
downloadBehavior: null,
|
|
168
|
+
customCredentials: null,
|
|
158
169
|
});
|
|
159
170
|
await Promise.all([
|
|
160
171
|
fs_1.default.promises.rm(outputLocation, { recursive: true }),
|
|
@@ -172,6 +183,7 @@ const renderHandler = async (params, options, logs) => {
|
|
|
172
183
|
privacy: 'private',
|
|
173
184
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
174
185
|
downloadBehavior: null,
|
|
186
|
+
customCredentials: null,
|
|
175
187
|
}),
|
|
176
188
|
]);
|
|
177
189
|
};
|
|
@@ -184,6 +196,10 @@ const rendererHandler = async (params, options) => {
|
|
|
184
196
|
await renderHandler(params, options, logs);
|
|
185
197
|
}
|
|
186
198
|
catch (err) {
|
|
199
|
+
if (process.env.NODE_ENV === 'test') {
|
|
200
|
+
console.log({ err });
|
|
201
|
+
throw err;
|
|
202
|
+
}
|
|
187
203
|
// If this error is encountered, we can just retry as it
|
|
188
204
|
// is a very rare error to occur
|
|
189
205
|
const isBrowserError = err.message.includes('FATAL:zygote_communication_linux.cc') ||
|
|
File without changes
|
package/dist/functions/start.js
CHANGED
|
@@ -32,6 +32,7 @@ const startHandler = async (params, options) => {
|
|
|
32
32
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
33
33
|
key: (0, constants_1.initalizedMetadataKey)(renderId),
|
|
34
34
|
privacy: 'private',
|
|
35
|
+
customCredentials: null,
|
|
35
36
|
});
|
|
36
37
|
const payload = {
|
|
37
38
|
type: constants_1.LambdaRoutines.launch,
|
|
@@ -61,6 +62,10 @@ const startHandler = async (params, options) => {
|
|
|
61
62
|
concurrencyPerLambda: params.concurrencyPerLambda,
|
|
62
63
|
downloadBehavior: params.downloadBehavior,
|
|
63
64
|
muted: params.muted,
|
|
65
|
+
overwrite: params.overwrite,
|
|
66
|
+
webhook: params.webhook,
|
|
67
|
+
audioBitrate: params.audioBitrate,
|
|
68
|
+
videoBitrate: params.videoBitrate,
|
|
64
69
|
};
|
|
65
70
|
await (0, aws_clients_1.getLambdaClient)((0, get_current_region_1.getCurrentRegionInFunction)()).send(new client_lambda_1.InvokeCommand({
|
|
66
71
|
FunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
|
File without changes
|
package/dist/functions/still.js
CHANGED
|
@@ -83,6 +83,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
83
83
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
84
84
|
renderId,
|
|
85
85
|
outName: (_b = lambdaParams.outName) !== null && _b !== void 0 ? _b : undefined,
|
|
86
|
+
privacy: lambdaParams.privacy,
|
|
86
87
|
};
|
|
87
88
|
await (0, io_1.lambdaWriteFile)({
|
|
88
89
|
bucketName,
|
|
@@ -92,6 +93,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
92
93
|
privacy: 'private',
|
|
93
94
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
94
95
|
downloadBehavior: null,
|
|
96
|
+
customCredentials: null,
|
|
95
97
|
});
|
|
96
98
|
await (0, renderer_1.renderStill)({
|
|
97
99
|
composition,
|
|
@@ -99,7 +101,10 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
99
101
|
serveUrl: lambdaParams.serveUrl,
|
|
100
102
|
dumpBrowserLogs: false,
|
|
101
103
|
envVariables: lambdaParams.envVariables,
|
|
102
|
-
frame:
|
|
104
|
+
frame: renderer_1.RenderInternals.convertToPositiveFrameIndex({
|
|
105
|
+
frame: lambdaParams.frame,
|
|
106
|
+
durationInFrames: composition.durationInFrames,
|
|
107
|
+
}),
|
|
103
108
|
imageFormat: lambdaParams.imageFormat,
|
|
104
109
|
inputProps: lambdaParams.inputProps,
|
|
105
110
|
overwrite: false,
|
|
@@ -110,7 +115,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
110
115
|
timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,
|
|
111
116
|
downloadMap,
|
|
112
117
|
});
|
|
113
|
-
const { key, renderBucketName } = (0, expected_out_name_1.getExpectedOutName)(renderMetadata, bucketName);
|
|
118
|
+
const { key, renderBucketName, customCredentials } = (0, expected_out_name_1.getExpectedOutName)(renderMetadata, bucketName, (0, expected_out_name_1.getCredentialsFromOutName)(lambdaParams.outName));
|
|
114
119
|
const { size } = await fs_1.default.promises.stat(outputPath);
|
|
115
120
|
await (0, io_1.lambdaWriteFile)({
|
|
116
121
|
bucketName: renderBucketName,
|
|
@@ -120,6 +125,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
120
125
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
121
126
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
122
127
|
downloadBehavior: lambdaParams.downloadBehavior,
|
|
128
|
+
customCredentials,
|
|
123
129
|
});
|
|
124
130
|
await fs_1.default.promises.rm(outputPath, { recursive: true });
|
|
125
131
|
const estimatedPrice = (0, estimate_price_1.estimatePrice)({
|
|
@@ -133,7 +139,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
133
139
|
diskSizeInMb: constants_1.MAX_EPHEMERAL_STORAGE_IN_MB,
|
|
134
140
|
});
|
|
135
141
|
return {
|
|
136
|
-
output: (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, bucketName),
|
|
142
|
+
output: (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, bucketName, customCredentials),
|
|
137
143
|
size,
|
|
138
144
|
bucketName,
|
|
139
145
|
estimatedPrice: (0, format_costs_info_1.formatCostsInfo)(estimatedPrice),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DeleteFunctionInput } from './api/delete-function';
|
|
2
2
|
import { deleteFunction } from './api/delete-function';
|
|
3
|
+
import { deleteRender } from './api/delete-render';
|
|
3
4
|
import type { DeleteSiteInput, DeleteSiteOutput } from './api/delete-site';
|
|
4
5
|
import { deleteSite } from './api/delete-site';
|
|
5
6
|
import type { DeployFunctionInput, DeployFunctionOutput } from './api/deploy-function';
|
|
@@ -31,10 +32,14 @@ import type { RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput } from './api/
|
|
|
31
32
|
import { renderMediaOnLambda, renderVideoOnLambda } from './api/render-media-on-lambda';
|
|
32
33
|
import type { RenderStillOnLambdaInput, RenderStillOnLambdaOutput } from './api/render-still-on-lambda';
|
|
33
34
|
import { renderStillOnLambda } from './api/render-still-on-lambda';
|
|
35
|
+
import { validateWebhookSignature } from './api/validate-webhook-signature';
|
|
34
36
|
import type { LambdaLSInput, LambdaLsReturnType } from './functions/helpers/io';
|
|
37
|
+
import type { EnhancedErrorInfo, LambdaErrorInfo } from './functions/helpers/write-lambda-error';
|
|
35
38
|
import { LambdaInternals } from './internals';
|
|
36
39
|
import type { AwsRegion } from './pricing/aws-regions';
|
|
40
|
+
import type { CustomCredentials } from './shared/aws-clients';
|
|
37
41
|
import type { RenderProgress } from './shared/constants';
|
|
42
|
+
import type { WebhookPayload } from './shared/invoke-webhook';
|
|
38
43
|
import type { LambdaArchitecture } from './shared/validate-architecture';
|
|
39
|
-
export { deleteSite, deployFunction, deploySite, downloadMedia, downloadVideo, getFunctions, getUserPolicy, getRolePolicy, getSites, getOrCreateBucket, getRenderProgress, renderVideoOnLambda, renderMediaOnLambda, simulatePermissions, deleteFunction, getFunctionInfo, estimatePrice, LambdaInternals, renderStillOnLambda, getRegions, getAwsClient, presignUrl, };
|
|
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, };
|
|
44
|
+
export { deleteSite, deployFunction, deploySite, downloadMedia, downloadVideo, getFunctions, getUserPolicy, getRolePolicy, getSites, getOrCreateBucket, getRenderProgress, renderVideoOnLambda, renderMediaOnLambda, simulatePermissions, deleteFunction, getFunctionInfo, estimatePrice, LambdaInternals, renderStillOnLambda, getRegions, getAwsClient, presignUrl, deleteRender, validateWebhookSignature, };
|
|
45
|
+
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, CustomCredentials, WebhookPayload, LambdaErrorInfo, EnhancedErrorInfo, };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.presignUrl = exports.getAwsClient = exports.getRegions = exports.renderStillOnLambda = exports.LambdaInternals = exports.estimatePrice = exports.getFunctionInfo = exports.deleteFunction = exports.simulatePermissions = exports.renderMediaOnLambda = exports.renderVideoOnLambda = exports.getRenderProgress = exports.getOrCreateBucket = exports.getSites = exports.getRolePolicy = exports.getUserPolicy = exports.getFunctions = exports.downloadVideo = exports.downloadMedia = exports.deploySite = exports.deployFunction = exports.deleteSite = void 0;
|
|
3
|
+
exports.validateWebhookSignature = exports.deleteRender = exports.presignUrl = exports.getAwsClient = exports.getRegions = exports.renderStillOnLambda = exports.LambdaInternals = exports.estimatePrice = exports.getFunctionInfo = exports.deleteFunction = exports.simulatePermissions = exports.renderMediaOnLambda = exports.renderVideoOnLambda = exports.getRenderProgress = exports.getOrCreateBucket = exports.getSites = exports.getRolePolicy = exports.getUserPolicy = exports.getFunctions = exports.downloadVideo = exports.downloadMedia = exports.deploySite = exports.deployFunction = exports.deleteSite = void 0;
|
|
4
4
|
const delete_function_1 = require("./api/delete-function");
|
|
5
5
|
Object.defineProperty(exports, "deleteFunction", { enumerable: true, get: function () { return delete_function_1.deleteFunction; } });
|
|
6
|
+
const delete_render_1 = require("./api/delete-render");
|
|
7
|
+
Object.defineProperty(exports, "deleteRender", { enumerable: true, get: function () { return delete_render_1.deleteRender; } });
|
|
6
8
|
const delete_site_1 = require("./api/delete-site");
|
|
7
9
|
Object.defineProperty(exports, "deleteSite", { enumerable: true, get: function () { return delete_site_1.deleteSite; } });
|
|
8
10
|
const deploy_function_1 = require("./api/deploy-function");
|
|
@@ -40,5 +42,7 @@ Object.defineProperty(exports, "renderMediaOnLambda", { enumerable: true, get: f
|
|
|
40
42
|
Object.defineProperty(exports, "renderVideoOnLambda", { enumerable: true, get: function () { return render_media_on_lambda_1.renderVideoOnLambda; } });
|
|
41
43
|
const render_still_on_lambda_1 = require("./api/render-still-on-lambda");
|
|
42
44
|
Object.defineProperty(exports, "renderStillOnLambda", { enumerable: true, get: function () { return render_still_on_lambda_1.renderStillOnLambda; } });
|
|
45
|
+
const validate_webhook_signature_1 = require("./api/validate-webhook-signature");
|
|
46
|
+
Object.defineProperty(exports, "validateWebhookSignature", { enumerable: true, get: function () { return validate_webhook_signature_1.validateWebhookSignature; } });
|
|
43
47
|
const internals_1 = require("./internals");
|
|
44
48
|
Object.defineProperty(exports, "LambdaInternals", { enumerable: true, get: function () { return internals_1.LambdaInternals; } });
|
package/dist/internals.d.ts
CHANGED
|
File without changes
|
package/dist/internals.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/regions.d.ts
CHANGED
|
File without changes
|
package/dist/regions.js
CHANGED
|
File without changes
|
package/dist/shared/await.d.ts
CHANGED
|
File without changes
|
package/dist/shared/await.js
CHANGED
|
File without changes
|