@remotion/lambda 4.0.0-webhook.26 → 4.1.0-alpha2
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 +8 -8
- package/dist/admin/bundle-lambda.d.ts +0 -0
- package/dist/admin/bundle-lambda.js +24 -13
- package/dist/admin/generate-etag-list.d.ts +1 -0
- package/dist/admin/generate-etag-list.js +14 -0
- package/dist/admin/make-layer-public.d.ts +0 -0
- package/dist/admin/make-layer-public.js +59 -65
- package/dist/api/bucket-exists.d.ts +0 -0
- package/dist/api/bucket-exists.js +0 -0
- 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 +34 -1
- package/dist/api/create-function.d.ts +1 -3
- package/dist/api/create-function.js +27 -6
- package/dist/api/delete-function.d.ts +4 -4
- package/dist/api/delete-function.js +3 -3
- package/dist/api/delete-render.d.ts +2 -2
- package/dist/api/delete-render.js +1 -1
- package/dist/api/delete-site.d.ts +7 -7
- package/dist/api/delete-site.js +9 -7
- package/dist/api/deploy-function.d.ts +11 -13
- package/dist/api/deploy-function.js +28 -31
- package/dist/api/deploy-site.d.ts +13 -5
- package/dist/api/deploy-site.js +61 -25
- package/dist/api/download-media.d.ts +4 -8
- package/dist/api/download-media.js +5 -9
- package/dist/api/estimate-price.d.ts +3 -5
- package/dist/api/estimate-price.js +4 -10
- package/dist/api/get-aws-client.d.ts +6 -4
- package/dist/api/get-aws-client.js +3 -1
- package/dist/api/get-buckets.d.ts +1 -1
- package/dist/api/get-buckets.js +26 -9
- package/dist/api/get-compositions-on-lambda.d.ts +31 -0
- package/dist/api/get-compositions-on-lambda.js +56 -0
- package/dist/api/get-function-info.d.ts +3 -3
- package/dist/api/get-function-info.js +1 -1
- package/dist/api/get-functions.d.ts +5 -7
- package/dist/api/get-functions.js +8 -10
- package/dist/api/get-or-create-bucket.d.ts +6 -6
- package/dist/api/get-or-create-bucket.js +10 -18
- package/dist/api/get-regions.d.ts +6 -2
- package/dist/api/get-regions.js +6 -3
- package/dist/api/get-render-progress.d.ts +3 -3
- package/dist/api/get-render-progress.js +6 -11
- package/dist/api/get-sites.d.ts +4 -5
- package/dist/api/get-sites.js +1 -2
- 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 +2 -2
- package/dist/api/iam-validation/simulate-rule.js +0 -22
- package/dist/api/iam-validation/simulate.d.ts +3 -3
- package/dist/api/iam-validation/simulate.js +27 -6
- 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 +1 -1
- package/dist/api/iam-validation/user-permissions.js +3 -8
- package/dist/api/make-lambda-payload.d.ts +5 -0
- package/dist/api/make-lambda-payload.js +77 -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 +4 -5
- package/dist/api/presign-url.js +3 -3
- package/dist/api/render-media-on-lambda.d.ts +25 -11
- package/dist/api/render-media-on-lambda.js +16 -49
- package/dist/api/render-still-on-lambda.d.ts +15 -6
- package/dist/api/render-still-on-lambda.js +23 -9
- package/dist/api/speculate-function-name.d.ts +14 -0
- package/dist/api/speculate-function-name.js +22 -0
- package/dist/api/upload-dir.d.ts +6 -5
- package/dist/api/upload-dir.js +54 -51
- package/dist/api/validate-webhook-signature.d.ts +2 -2
- package/dist/api/validate-webhook-signature.js +1 -1
- package/dist/cli/args.d.ts +7 -5
- package/dist/cli/args.js +1 -5
- package/dist/cli/commands/compositions/index.d.ts +2 -0
- package/dist/cli/commands/compositions/index.js +44 -0
- package/dist/cli/commands/functions/deploy.d.ts +0 -0
- package/dist/cli/commands/functions/deploy.js +15 -15
- package/dist/cli/commands/functions/index.d.ts +0 -0
- package/dist/cli/commands/functions/index.js +16 -17
- package/dist/cli/commands/functions/ls.d.ts +0 -0
- package/dist/cli/commands/functions/ls.js +17 -10
- package/dist/cli/commands/functions/rm.d.ts +0 -0
- package/dist/cli/commands/functions/rm.js +20 -7
- package/dist/cli/commands/functions/rmall.d.ts +0 -0
- package/dist/cli/commands/functions/rmall.js +20 -8
- 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 +30 -10
- package/dist/cli/commands/quotas/index.d.ts +0 -0
- package/dist/cli/commands/quotas/index.js +8 -9
- 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 +6 -2
- package/dist/cli/commands/render/progress.d.ts +11 -7
- package/dist/cli/commands/render/progress.js +55 -45
- package/dist/cli/commands/render/render.d.ts +1 -1
- package/dist/cli/commands/render/render.js +99 -27
- package/dist/cli/commands/sites/create.d.ts +1 -1
- package/dist/cli/commands/sites/create.js +36 -33
- package/dist/cli/commands/sites/index.d.ts +1 -1
- package/dist/cli/commands/sites/index.js +18 -16
- package/dist/cli/commands/sites/ls.d.ts +0 -0
- package/dist/cli/commands/sites/ls.js +9 -10
- package/dist/cli/commands/sites/rm.d.ts +0 -0
- package/dist/cli/commands/sites/rm.js +6 -16
- package/dist/cli/commands/sites/rmall.d.ts +0 -0
- package/dist/cli/commands/sites/rmall.js +5 -16
- package/dist/cli/commands/still.d.ts +1 -1
- package/dist/cli/commands/still.js +49 -20
- 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 +4 -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 +35 -6
- package/dist/cli/helpers/progress-bar.d.ts +12 -7
- package/dist/cli/helpers/progress-bar.js +20 -11
- 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 +1 -1
- package/dist/cli/index.js +23 -12
- package/dist/cli/is-cli.d.ts +0 -0
- package/dist/cli/is-cli.js +0 -0
- package/dist/cli/log.d.ts +15 -0
- package/dist/cli/log.js +0 -0
- package/dist/client.d.ts +8 -2
- package/dist/client.js +9 -1
- package/dist/defaults.d.ts +0 -0
- package/dist/defaults.js +0 -0
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -5
- package/dist/functions/chunk-optimization/plan-frame-ranges.js +2 -15
- package/dist/functions/chunk-optimization/types.d.ts +2 -13
- package/dist/functions/chunk-optimization/types.js +0 -0
- package/dist/functions/compositions.d.ts +8 -0
- package/dist/functions/compositions.js +60 -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 +1 -3
- package/dist/functions/helpers/calculate-price-from-bucket.js +1 -2
- 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 +8 -8
- package/dist/functions/helpers/concat-videos.d.ts +13 -5
- package/dist/functions/helpers/concat-videos.js +38 -39
- package/dist/functions/helpers/create-post-render-data.d.ts +0 -0
- package/dist/functions/helpers/create-post-render-data.js +1 -15
- 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 +0 -0
- package/dist/functions/helpers/expected-out-name.js +2 -2
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +1 -1
- package/dist/functions/helpers/find-output-file-in-bucket.js +0 -0
- 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 +1 -2
- package/dist/functions/helpers/get-browser-instance.js +7 -3
- package/dist/functions/helpers/get-chromium-executable-path.d.ts +1 -1
- package/dist/functions/helpers/get-chromium-executable-path.js +8 -6
- 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-region.d.ts +1 -1
- package/dist/functions/helpers/get-current-region.js +0 -0
- package/dist/functions/helpers/get-custom-out-name.d.ts +0 -0
- package/dist/functions/helpers/get-custom-out-name.js +1 -1
- package/dist/functions/helpers/get-encoding-metadata.d.ts +5 -8
- package/dist/functions/helpers/get-encoding-metadata.js +7 -17
- package/dist/functions/helpers/get-files-in-folder.d.ts +1 -1
- package/dist/functions/helpers/get-files-in-folder.js +5 -5
- package/dist/functions/helpers/get-files-to-delete.d.ts +1 -1
- package/dist/functions/helpers/get-files-to-delete.js +0 -0
- package/dist/functions/helpers/get-final-encoding-status.d.ts +2 -4
- package/dist/functions/helpers/get-final-encoding-status.js +1 -4
- 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 +2 -6
- package/dist/functions/helpers/get-lambdas-invoked-stats.js +1 -9
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +0 -0
- package/dist/functions/helpers/get-output-url-from-metadata.js +0 -0
- package/dist/functions/helpers/get-overall-progress.d.ts +2 -1
- package/dist/functions/helpers/get-overall-progress.js +7 -5
- 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 +0 -0
- package/dist/functions/helpers/get-progress.js +43 -42
- 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-rendered-frames-progress.d.ts +8 -0
- package/dist/functions/helpers/get-rendered-frames-progress.js +37 -0
- package/dist/functions/helpers/get-retry-stats.d.ts +1 -1
- 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 +10 -4
- package/dist/functions/helpers/io.js +25 -3
- package/dist/functions/helpers/is-enosp-err.d.ts +0 -0
- package/dist/functions/helpers/is-enosp-err.js +1 -1
- package/dist/functions/helpers/is-warm.d.ts +0 -0
- package/dist/functions/helpers/is-warm.js +0 -0
- package/dist/functions/helpers/make-timeout-error.d.ts +8 -0
- package/dist/functions/helpers/make-timeout-error.js +35 -0
- package/dist/functions/helpers/make-timeout-message.d.ts +6 -0
- package/dist/functions/helpers/make-timeout-message.js +31 -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 +1 -1
- package/dist/functions/helpers/read-with-progress.js +1 -1
- package/dist/functions/helpers/streamify-response.d.ts +16 -0
- package/dist/functions/helpers/streamify-response.js +67 -0
- 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 +10 -9
- package/dist/functions/helpers/validate-composition.js +16 -13
- package/dist/functions/helpers/write-lambda-error.d.ts +2 -2
- package/dist/functions/helpers/write-lambda-error.js +0 -0
- package/dist/functions/helpers/write-post-render-data.d.ts +0 -0
- package/dist/functions/helpers/write-post-render-data.js +0 -0
- package/dist/functions/index.d.ts +1 -7
- package/dist/functions/index.js +43 -10
- package/dist/functions/info.d.ts +0 -0
- package/dist/functions/info.js +0 -0
- package/dist/functions/launch.d.ts +2 -1
- package/dist/functions/launch.js +152 -134
- package/dist/functions/progress.d.ts +1 -1
- package/dist/functions/progress.js +2 -2
- package/dist/functions/renderer.d.ts +1 -1
- package/dist/functions/renderer.js +73 -42
- package/dist/functions/start.d.ts +1 -1
- package/dist/functions/start.js +22 -8
- package/dist/functions/still.d.ts +1 -1
- package/dist/functions/still.js +80 -37
- package/dist/index.d.ts +24 -8
- package/dist/index.js +23 -6
- package/dist/internals.d.ts +3 -1
- package/dist/internals.js +3 -0
- package/dist/pricing/aws-regions.d.ts +3 -2
- package/dist/pricing/aws-regions.js +31 -1
- package/dist/pricing/price-per-1-s.d.ts +0 -0
- package/dist/pricing/price-per-1-s.js +413 -39
- package/dist/regions.d.ts +0 -0
- package/dist/regions.js +0 -0
- package/dist/shared/await.d.ts +1 -1
- package/dist/shared/await.js +0 -0
- package/dist/shared/aws-clients.d.ts +6 -3
- package/dist/shared/aws-clients.js +75 -13
- package/dist/shared/bundle-site.d.ts +0 -0
- package/dist/shared/bundle-site.js +0 -0
- package/dist/shared/call-lambda.d.ts +0 -0
- package/dist/shared/call-lambda.js +27 -2
- package/dist/shared/check-credentials.d.ts +0 -0
- package/dist/shared/check-credentials.js +3 -0
- package/dist/shared/chunk-progress.d.ts +9 -0
- package/dist/shared/chunk-progress.js +2034 -0
- package/dist/shared/cleanup-serialized-input-props.d.ts +7 -0
- package/dist/shared/cleanup-serialized-input-props.js +19 -0
- package/dist/shared/constants.d.ts +140 -89
- package/dist/shared/constants.js +7 -4
- package/dist/shared/content-disposition-header.d.ts +1 -1
- package/dist/shared/content-disposition-header.js +0 -0
- package/dist/shared/convert-to-serve-url.d.ts +5 -1
- package/dist/shared/convert-to-serve-url.js +1 -5
- package/dist/shared/deserialize-input-props.d.ts +8 -0
- package/dist/shared/deserialize-input-props.js +26 -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 +1 -1
- package/dist/shared/function-zip-path.js +3 -3
- package/dist/shared/get-account-id.d.ts +0 -0
- package/dist/shared/get-account-id.js +4 -6
- package/dist/shared/{get-cloudwatch-stream-url.d.ts → get-aws-urls.d.ts} +7 -1
- package/dist/shared/get-aws-urls.js +12 -0
- package/dist/shared/get-etag.d.ts +1 -0
- package/dist/shared/get-etag.js +24 -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 +2 -2
- package/dist/shared/get-most-expensive-chunks.js +3 -2
- package/dist/shared/get-s3-operations.d.ts +10 -0
- package/dist/shared/get-s3-operations.js +36 -0
- package/dist/shared/hosted-layers.d.ts +5 -8
- package/dist/shared/hosted-layers.js +210 -284
- package/dist/shared/invoke-webhook.d.ts +5 -18
- package/dist/shared/invoke-webhook.js +5 -19
- 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 +2 -2
- package/dist/shared/make-s3-url.d.ts +0 -0
- package/dist/shared/make-s3-url.js +2 -2
- package/dist/shared/p-limit.d.ts +0 -0
- package/dist/shared/p-limit.js +0 -0
- package/dist/shared/parse-chunk-key.d.ts +4 -0
- package/dist/shared/parse-chunk-key.js +14 -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 +1 -1
- 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/read-dir.d.ts +9 -0
- package/dist/shared/read-dir.js +57 -0
- package/dist/shared/return-values.d.ts +7 -0
- package/dist/shared/return-values.js +0 -0
- package/dist/shared/serialize-input-props.d.ts +8 -0
- package/dist/shared/serialize-input-props.js +42 -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 +1 -1
- package/dist/shared/truthy.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 +5 -0
- package/dist/shared/validate-bucketname.js +19 -1
- 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 +0 -0
- package/dist/shared/validate-frames-per-lambda.js +0 -0
- package/dist/shared/validate-lambda-codec.d.ts +2 -2
- package/dist/shared/validate-lambda-codec.js +1 -1
- 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 +2 -2
- package/dist/shared/validate-outname.js +16 -10
- 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 +1 -1
- package/dist/shared/validate-privacy.js +5 -2
- 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 +89 -65
- package/remotionlambda-arm64.zip +0 -0
- package/.prettierrc.js +0 -14
- package/client.d.ts +0 -1
- package/client.js +0 -1
- package/dist/api/enable-s3-website.d.ts +0 -5
- package/dist/api/enable-s3-website.js +0 -16
- package/dist/cli/helpers/determine-image-format.d.ts +0 -10
- package/dist/cli/helpers/determine-image-format.js +0 -47
- package/dist/cli/helpers/get-cloudwatch-stream-url.d.ts +0 -8
- package/dist/cli/helpers/get-cloudwatch-stream-url.js +0 -7
- package/dist/cli/helpers/webhook-types.d.ts +0 -6
- package/dist/cli/helpers/webhook-types.js +0 -2
- package/dist/functions/chunk-optimization/can-use-optimization.d.ts +0 -6
- package/dist/functions/chunk-optimization/can-use-optimization.js +0 -23
- package/dist/functions/chunk-optimization/collect-data.d.ts +0 -9
- package/dist/functions/chunk-optimization/collect-data.js +0 -27
- package/dist/functions/chunk-optimization/get-frame-ranges-from-profile.d.ts +0 -3
- package/dist/functions/chunk-optimization/get-frame-ranges-from-profile.js +0 -11
- package/dist/functions/chunk-optimization/get-profile-duration.d.ts +0 -3
- package/dist/functions/chunk-optimization/get-profile-duration.js +0 -18
- package/dist/functions/chunk-optimization/is-valid-profile.d.ts +0 -2
- package/dist/functions/chunk-optimization/is-valid-profile.js +0 -12
- package/dist/functions/chunk-optimization/optimize-invocation-order.d.ts +0 -2
- package/dist/functions/chunk-optimization/optimize-invocation-order.js +0 -19
- package/dist/functions/chunk-optimization/optimize-profile.d.ts +0 -9
- package/dist/functions/chunk-optimization/optimize-profile.js +0 -74
- package/dist/functions/chunk-optimization/s3-optimization-file.d.ts +0 -17
- package/dist/functions/chunk-optimization/s3-optimization-file.js +0 -47
- package/dist/functions/chunk-optimization/simulate-frame-ranges.d.ts +0 -7
- package/dist/functions/chunk-optimization/simulate-frame-ranges.js +0 -47
- package/dist/functions/chunk-optimization/sort-by-duration.d.ts +0 -2
- package/dist/functions/chunk-optimization/sort-by-duration.js +0 -25
- package/dist/functions/helpers/get-current-architecture.d.ts +0 -2
- package/dist/functions/helpers/get-current-architecture.js +0 -11
- package/dist/shared/get-cloudwatch-stream-url.js +0 -7
- package/dist/shared/validate-architecture.d.ts +0 -4
- package/dist/shared/validate-architecture.js +0 -14
- package/remotionlambda.zip +0 -0
- package/tsconfig.json +0 -16
|
@@ -7,7 +7,6 @@ const constants_1 = require("../shared/constants");
|
|
|
7
7
|
const function_zip_path_1 = require("../shared/function-zip-path");
|
|
8
8
|
const get_account_id_1 = require("../shared/get-account-id");
|
|
9
9
|
const lambda_version_string_1 = require("../shared/lambda-version-string");
|
|
10
|
-
const validate_architecture_1 = require("../shared/validate-architecture");
|
|
11
10
|
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
12
11
|
const validate_custom_role_arn_1 = require("../shared/validate-custom-role-arn");
|
|
13
12
|
const validate_disk_size_in_mb_1 = require("../shared/validate-disk-size-in-mb");
|
|
@@ -17,54 +16,52 @@ const validate_timeout_1 = require("../shared/validate-timeout");
|
|
|
17
16
|
const create_function_1 = require("./create-function");
|
|
18
17
|
/**
|
|
19
18
|
* @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
|
|
20
|
-
* @
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
19
|
+
* @see [Documentation](https://www.remotion.dev/docs/lambda/deployfunction)
|
|
20
|
+
* @param params.createCloudWatchLogGroup Whether you'd like to create a CloudWatch Log Group to store the logs for this function.
|
|
21
|
+
* @param params.cloudWatchLogRetentionPeriodInDays (optional) The number of days to retain the CloudWatch logs for this function. Default is 14 days.
|
|
22
|
+
* @param params.region The region you want to deploy your function to.
|
|
23
|
+
* @param params.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
|
|
24
|
+
* @param params.memorySizeInMb How much memory should be allocated to the Lambda function.
|
|
25
|
+
* @param params.architecture The architecture Lambda should run on. One of x86_64 and x64
|
|
26
|
+
* @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
|
|
28
27
|
* @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
|
|
29
28
|
*/
|
|
30
|
-
const deployFunction = async (
|
|
29
|
+
const deployFunction = async (params) => {
|
|
31
30
|
var _a, _b;
|
|
32
|
-
const diskSizeInMb = (_a =
|
|
33
|
-
(0, validate_memory_size_1.validateMemorySize)(
|
|
34
|
-
(0, validate_timeout_1.validateTimeout)(
|
|
35
|
-
(0, validate_aws_region_1.validateAwsRegion)(
|
|
36
|
-
(0, validate_retention_period_1.validateCloudWatchRetentionPeriod)(
|
|
37
|
-
(0, validate_architecture_1.validateArchitecture)(options.architecture);
|
|
31
|
+
const diskSizeInMb = (_a = params.diskSizeInMb) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB;
|
|
32
|
+
(0, validate_memory_size_1.validateMemorySize)(params.memorySizeInMb);
|
|
33
|
+
(0, validate_timeout_1.validateTimeout)(params.timeoutInSeconds);
|
|
34
|
+
(0, validate_aws_region_1.validateAwsRegion)(params.region);
|
|
35
|
+
(0, validate_retention_period_1.validateCloudWatchRetentionPeriod)(params.cloudWatchLogRetentionPeriodInDays);
|
|
38
36
|
(0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(diskSizeInMb);
|
|
39
|
-
(0, validate_custom_role_arn_1.validateCustomRoleArn)(
|
|
37
|
+
(0, validate_custom_role_arn_1.validateCustomRoleArn)(params.customRoleArn);
|
|
40
38
|
const fnNameRender = [
|
|
41
39
|
`${constants_1.RENDER_FN_PREFIX}${lambda_version_string_1.LAMBDA_VERSION_STRING}`,
|
|
42
|
-
`mem${
|
|
40
|
+
`mem${params.memorySizeInMb}mb`,
|
|
43
41
|
`disk${diskSizeInMb}mb`,
|
|
44
|
-
`${
|
|
42
|
+
`${params.timeoutInSeconds}sec`,
|
|
45
43
|
].join('-');
|
|
46
|
-
const accountId = await (0, get_account_id_1.getAccountId)({ region:
|
|
44
|
+
const accountId = await (0, get_account_id_1.getAccountId)({ region: params.region });
|
|
47
45
|
const fns = await (0, get_functions_1.getFunctions)({
|
|
48
46
|
compatibleOnly: true,
|
|
49
|
-
region:
|
|
47
|
+
region: params.region,
|
|
50
48
|
});
|
|
51
49
|
const alreadyDeployed = fns.find((f) => f.version === version_1.VERSION &&
|
|
52
|
-
f.memorySizeInMb ===
|
|
53
|
-
f.timeoutInSeconds ===
|
|
50
|
+
f.memorySizeInMb === params.memorySizeInMb &&
|
|
51
|
+
f.timeoutInSeconds === params.timeoutInSeconds &&
|
|
54
52
|
f.diskSizeInMb === diskSizeInMb);
|
|
55
53
|
const created = await (0, create_function_1.createFunction)({
|
|
56
|
-
createCloudWatchLogGroup:
|
|
57
|
-
region:
|
|
58
|
-
zipFile: function_zip_path_1.
|
|
54
|
+
createCloudWatchLogGroup: params.createCloudWatchLogGroup,
|
|
55
|
+
region: params.region,
|
|
56
|
+
zipFile: function_zip_path_1.FUNCTION_ZIP_ARM64,
|
|
59
57
|
functionName: fnNameRender,
|
|
60
58
|
accountId,
|
|
61
|
-
memorySizeInMb:
|
|
62
|
-
timeoutInSeconds:
|
|
63
|
-
retentionInDays: (_b =
|
|
59
|
+
memorySizeInMb: params.memorySizeInMb,
|
|
60
|
+
timeoutInSeconds: params.timeoutInSeconds,
|
|
61
|
+
retentionInDays: (_b = params.cloudWatchLogRetentionPeriodInDays) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_CLOUDWATCH_RETENTION_PERIOD,
|
|
64
62
|
alreadyCreated: Boolean(alreadyDeployed),
|
|
65
|
-
architecture: options.architecture,
|
|
66
63
|
ephemerealStorageInMb: diskSizeInMb,
|
|
67
|
-
customRoleArn:
|
|
64
|
+
customRoleArn: params.customRoleArn,
|
|
68
65
|
});
|
|
69
66
|
if (!created.FunctionName) {
|
|
70
67
|
throw new Error('Lambda was created but has no name');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { WebpackOverrideFn } from 'remotion';
|
|
1
|
+
import type { WebpackOverrideFn } from '@remotion/bundler';
|
|
2
2
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
3
3
|
import type { UploadDirProgress } from './upload-dir';
|
|
4
|
-
export
|
|
4
|
+
export type DeploySiteInput = {
|
|
5
5
|
entryPoint: string;
|
|
6
6
|
bucketName: string;
|
|
7
7
|
region: AwsRegion;
|
|
@@ -10,22 +10,30 @@ export declare type DeploySiteInput = {
|
|
|
10
10
|
onBundleProgress?: (progress: number) => void;
|
|
11
11
|
onUploadProgress?: (upload: UploadDirProgress) => void;
|
|
12
12
|
webpackOverride?: WebpackOverrideFn;
|
|
13
|
+
ignoreRegisterRootWarning?: boolean;
|
|
13
14
|
enableCaching?: boolean;
|
|
14
15
|
publicDir?: string | null;
|
|
15
16
|
rootDir?: string;
|
|
17
|
+
bypassBucketNameValidation?: boolean;
|
|
16
18
|
};
|
|
19
|
+
privacy?: 'public' | 'no-acl';
|
|
17
20
|
};
|
|
18
|
-
export
|
|
21
|
+
export type DeploySiteOutput = Promise<{
|
|
19
22
|
serveUrl: string;
|
|
20
23
|
siteName: string;
|
|
24
|
+
stats: {
|
|
25
|
+
uploadedFiles: number;
|
|
26
|
+
deletedFiles: number;
|
|
27
|
+
untouchedFiles: number;
|
|
28
|
+
};
|
|
21
29
|
}>;
|
|
22
30
|
/**
|
|
23
31
|
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
24
|
-
* @
|
|
32
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/deploysite)
|
|
25
33
|
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
26
34
|
* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
|
|
27
35
|
* @param {string} params.bucketName The name of the bucket to deploy your project into.
|
|
28
36
|
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
29
37
|
* @param {object} params.options Further options, see documentation page for this function.
|
|
30
38
|
*/
|
|
31
|
-
export declare const deploySite: ({ bucketName, entryPoint, siteName, options, region, }: DeploySiteInput) => DeploySiteOutput;
|
|
39
|
+
export declare const deploySite: ({ bucketName, entryPoint, siteName, options, region, privacy: passedPrivacy, }: DeploySiteInput) => DeploySiteOutput;
|
package/dist/api/deploy-site.js
CHANGED
|
@@ -1,72 +1,108 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.deploySite = void 0;
|
|
4
|
-
const
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const io_1 = require("../functions/helpers/io");
|
|
5
9
|
const bundle_site_1 = require("../shared/bundle-site");
|
|
6
10
|
const constants_1 = require("../shared/constants");
|
|
7
11
|
const get_account_id_1 = require("../shared/get-account-id");
|
|
12
|
+
const get_s3_operations_1 = require("../shared/get-s3-operations");
|
|
8
13
|
const make_s3_url_1 = require("../shared/make-s3-url");
|
|
9
14
|
const random_hash_1 = require("../shared/random-hash");
|
|
10
15
|
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
11
16
|
const validate_bucketname_1 = require("../shared/validate-bucketname");
|
|
17
|
+
const validate_privacy_1 = require("../shared/validate-privacy");
|
|
12
18
|
const validate_site_name_1 = require("../shared/validate-site-name");
|
|
13
19
|
const bucket_exists_1 = require("./bucket-exists");
|
|
14
|
-
const enable_s3_website_1 = require("./enable-s3-website");
|
|
15
20
|
const upload_dir_1 = require("./upload-dir");
|
|
16
21
|
/**
|
|
17
22
|
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
18
|
-
* @
|
|
23
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/deploysite)
|
|
19
24
|
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
20
25
|
* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
|
|
21
26
|
* @param {string} params.bucketName The name of the bucket to deploy your project into.
|
|
22
27
|
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
23
28
|
* @param {object} params.options Further options, see documentation page for this function.
|
|
24
29
|
*/
|
|
25
|
-
const deploySite = async ({ bucketName, entryPoint, siteName, options, region, }) => {
|
|
30
|
+
const deploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy: passedPrivacy, }) => {
|
|
26
31
|
var _a, _b, _c, _d;
|
|
27
32
|
(0, validate_aws_region_1.validateAwsRegion)(region);
|
|
28
|
-
(0, validate_bucketname_1.validateBucketName)(bucketName, {
|
|
33
|
+
(0, validate_bucketname_1.validateBucketName)(bucketName, {
|
|
34
|
+
mustStartWithRemotion: !(options === null || options === void 0 ? void 0 : options.bypassBucketNameValidation),
|
|
35
|
+
});
|
|
29
36
|
const siteId = siteName !== null && siteName !== void 0 ? siteName : (0, random_hash_1.randomHash)();
|
|
30
37
|
(0, validate_site_name_1.validateSiteName)(siteId);
|
|
38
|
+
const privacy = passedPrivacy !== null && passedPrivacy !== void 0 ? passedPrivacy : 'public';
|
|
39
|
+
(0, validate_privacy_1.validatePrivacy)(privacy, false);
|
|
40
|
+
const accountId = await (0, get_account_id_1.getAccountId)({ region });
|
|
31
41
|
const bucketExists = await (0, bucket_exists_1.bucketExistsInRegion)({
|
|
32
42
|
bucketName,
|
|
33
43
|
region,
|
|
34
|
-
expectedBucketOwner:
|
|
44
|
+
expectedBucketOwner: accountId,
|
|
35
45
|
});
|
|
36
46
|
if (!bucketExists) {
|
|
37
47
|
throw new Error(`No bucket with the name ${bucketName} exists`);
|
|
38
48
|
}
|
|
39
49
|
const subFolder = (0, constants_1.getSitesKey)(siteId);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
const [files, bundled] = await Promise.all([
|
|
51
|
+
(0, io_1.lambdaLs)({
|
|
52
|
+
bucketName,
|
|
53
|
+
expectedBucketOwner: accountId,
|
|
54
|
+
region,
|
|
55
|
+
// The `/` is important to not accidentially delete sites with the same name but containing a suffix.
|
|
56
|
+
prefix: `${subFolder}/`,
|
|
57
|
+
}),
|
|
58
|
+
(0, bundle_site_1.bundleSite)({
|
|
59
|
+
publicPath: `/${subFolder}/`,
|
|
60
|
+
webpackOverride: (_a = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _a !== void 0 ? _a : ((f) => f),
|
|
61
|
+
enableCaching: (_b = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _b !== void 0 ? _b : true,
|
|
62
|
+
publicDir: options === null || options === void 0 ? void 0 : options.publicDir,
|
|
63
|
+
rootDir: options === null || options === void 0 ? void 0 : options.rootDir,
|
|
64
|
+
ignoreRegisterRootWarning: options === null || options === void 0 ? void 0 : options.ignoreRegisterRootWarning,
|
|
65
|
+
onProgress: (_c = options === null || options === void 0 ? void 0 : options.onBundleProgress) !== null && _c !== void 0 ? _c : (() => undefined),
|
|
66
|
+
entryPoint,
|
|
67
|
+
}),
|
|
68
|
+
]);
|
|
69
|
+
const { toDelete, toUpload, existingCount } = await (0, get_s3_operations_1.getS3DiffOperations)({
|
|
70
|
+
objects: files,
|
|
71
|
+
bundle: bundled,
|
|
72
|
+
prefix: subFolder,
|
|
52
73
|
});
|
|
53
74
|
await Promise.all([
|
|
54
75
|
(0, upload_dir_1.uploadDir)({
|
|
55
76
|
bucket: bucketName,
|
|
56
77
|
region,
|
|
57
|
-
|
|
78
|
+
localDir: bundled,
|
|
58
79
|
onProgress: (_d = options === null || options === void 0 ? void 0 : options.onUploadProgress) !== null && _d !== void 0 ? _d : (() => undefined),
|
|
59
|
-
|
|
60
|
-
privacy: 'public',
|
|
61
|
-
|
|
62
|
-
(0, enable_s3_website_1.enableS3Website)({
|
|
63
|
-
region,
|
|
64
|
-
bucketName,
|
|
80
|
+
keyPrefix: subFolder,
|
|
81
|
+
privacy: privacy !== null && privacy !== void 0 ? privacy : 'public',
|
|
82
|
+
toUpload,
|
|
65
83
|
}),
|
|
84
|
+
Promise.all(toDelete.map((d) => {
|
|
85
|
+
return (0, io_1.lambdaDeleteFile)({
|
|
86
|
+
bucketName,
|
|
87
|
+
customCredentials: null,
|
|
88
|
+
key: d.Key,
|
|
89
|
+
region,
|
|
90
|
+
});
|
|
91
|
+
})),
|
|
66
92
|
]);
|
|
93
|
+
if (!process.env.VITEST) {
|
|
94
|
+
node_fs_1.default.rmSync(bundled, {
|
|
95
|
+
recursive: true,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
67
98
|
return {
|
|
68
99
|
serveUrl: (0, make_s3_url_1.makeS3ServeUrl)({ bucketName, subFolder, region }),
|
|
69
100
|
siteName: siteId,
|
|
101
|
+
stats: {
|
|
102
|
+
uploadedFiles: toUpload.length,
|
|
103
|
+
deletedFiles: toDelete.length,
|
|
104
|
+
untouchedFiles: existingCount,
|
|
105
|
+
},
|
|
70
106
|
};
|
|
71
107
|
};
|
|
72
108
|
exports.deploySite = deploySite;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LambdaReadFileProgress } from '../functions/helpers/read-with-progress';
|
|
2
2
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
3
3
|
import type { CustomCredentials } from '../shared/aws-clients';
|
|
4
|
-
export
|
|
4
|
+
export type DownloadMediaInput = {
|
|
5
5
|
region: AwsRegion;
|
|
6
6
|
bucketName: string;
|
|
7
7
|
renderId: string;
|
|
@@ -9,13 +9,13 @@ export declare type DownloadMediaInput = {
|
|
|
9
9
|
onProgress?: LambdaReadFileProgress;
|
|
10
10
|
customCredentials?: CustomCredentials;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type DownloadMediaOutput = {
|
|
13
13
|
outputPath: string;
|
|
14
14
|
sizeInBytes: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* @description
|
|
18
|
-
* @
|
|
17
|
+
* @description Downloads a rendered video, audio or still to the disk of the machine this API is called from.
|
|
18
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/downloadmedia)
|
|
19
19
|
* @param params.region The AWS region in which the media resides.
|
|
20
20
|
* @param params.bucketName The `bucketName` that was specified during the render.
|
|
21
21
|
* @param params.renderId The `renderId` that was obtained after triggering the render.
|
|
@@ -25,7 +25,3 @@ export declare type DownloadMediaOutput = {
|
|
|
25
25
|
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
26
26
|
*/
|
|
27
27
|
export declare const downloadMedia: (input: DownloadMediaInput) => Promise<DownloadMediaOutput>;
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated Renamed to downloadMedia()
|
|
30
|
-
*/
|
|
31
|
-
export declare const downloadVideo: (input: DownloadMediaInput) => Promise<DownloadMediaOutput>;
|
|
@@ -3,16 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.downloadMedia = void 0;
|
|
7
7
|
const renderer_1 = require("@remotion/renderer");
|
|
8
|
-
const
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const expected_out_name_1 = require("../functions/helpers/expected-out-name");
|
|
10
10
|
const get_render_metadata_1 = require("../functions/helpers/get-render-metadata");
|
|
11
11
|
const read_with_progress_1 = require("../functions/helpers/read-with-progress");
|
|
12
12
|
const get_account_id_1 = require("../shared/get-account-id");
|
|
13
13
|
/**
|
|
14
|
-
* @description
|
|
15
|
-
* @
|
|
14
|
+
* @description Downloads a rendered video, audio or still to the disk of the machine this API is called from.
|
|
15
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/downloadmedia)
|
|
16
16
|
* @param params.region The AWS region in which the media resides.
|
|
17
17
|
* @param params.bucketName The `bucketName` that was specified during the render.
|
|
18
18
|
* @param params.renderId The `renderId` that was obtained after triggering the render.
|
|
@@ -32,7 +32,7 @@ const downloadMedia = async (input) => {
|
|
|
32
32
|
region: input.region,
|
|
33
33
|
renderId: input.renderId,
|
|
34
34
|
});
|
|
35
|
-
const outputPath =
|
|
35
|
+
const outputPath = node_path_1.default.resolve(process.cwd(), input.outPath);
|
|
36
36
|
renderer_1.RenderInternals.ensureOutputDirectory(outputPath);
|
|
37
37
|
const { key, renderBucketName, customCredentials } = (0, expected_out_name_1.getExpectedOutName)(renderMetadata, input.bucketName, (_a = input.customCredentials) !== null && _a !== void 0 ? _a : null);
|
|
38
38
|
const { sizeInBytes } = await (0, read_with_progress_1.lambdaDownloadFileWithProgress)({
|
|
@@ -50,7 +50,3 @@ const downloadMedia = async (input) => {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
exports.downloadMedia = downloadMedia;
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated Renamed to downloadMedia()
|
|
55
|
-
*/
|
|
56
|
-
exports.downloadVideo = exports.downloadMedia;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
2
|
-
|
|
3
|
-
export declare type EstimatePriceInput = {
|
|
2
|
+
export type EstimatePriceInput = {
|
|
4
3
|
region: AwsRegion;
|
|
5
4
|
durationInMiliseconds: number;
|
|
6
5
|
memorySizeInMb: number;
|
|
7
6
|
diskSizeInMb: number;
|
|
8
|
-
architecture: LambdaArchitecture;
|
|
9
7
|
lambdasInvoked: number;
|
|
10
8
|
};
|
|
11
9
|
/**
|
|
12
10
|
*
|
|
13
11
|
* @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.
|
|
14
|
-
* @
|
|
12
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/estimateprice)
|
|
15
13
|
* @returns {number} Price in USD
|
|
16
14
|
*/
|
|
17
|
-
export declare const estimatePrice: ({ region, durationInMiliseconds, memorySizeInMb, diskSizeInMb,
|
|
15
|
+
export declare const estimatePrice: ({ region, durationInMiliseconds, memorySizeInMb, diskSizeInMb, lambdasInvoked, }: EstimatePriceInput) => number;
|
|
@@ -3,20 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.estimatePrice = void 0;
|
|
4
4
|
const defaults_1 = require("../defaults");
|
|
5
5
|
const price_per_1_s_1 = require("../pricing/price-per-1-s");
|
|
6
|
-
const validate_architecture_1 = require("../shared/validate-architecture");
|
|
7
6
|
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
8
7
|
const validate_disk_size_in_mb_1 = require("../shared/validate-disk-size-in-mb");
|
|
9
8
|
const validate_memory_size_1 = require("../shared/validate-memory-size");
|
|
10
9
|
/**
|
|
11
10
|
*
|
|
12
11
|
* @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.
|
|
13
|
-
* @
|
|
12
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/estimateprice)
|
|
14
13
|
* @returns {number} Price in USD
|
|
15
14
|
*/
|
|
16
|
-
const estimatePrice = ({ region, durationInMiliseconds, memorySizeInMb, diskSizeInMb,
|
|
15
|
+
const estimatePrice = ({ region, durationInMiliseconds, memorySizeInMb, diskSizeInMb, lambdasInvoked, }) => {
|
|
17
16
|
(0, validate_memory_size_1.validateMemorySize)(memorySizeInMb);
|
|
18
17
|
(0, validate_aws_region_1.validateAwsRegion)(region);
|
|
19
|
-
(0, validate_architecture_1.validateArchitecture)(architecture);
|
|
20
18
|
(0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(diskSizeInMb);
|
|
21
19
|
if (typeof durationInMiliseconds !== 'number') {
|
|
22
20
|
throw new TypeError(`Parameter 'durationInMiliseconds' must be a number but got ${typeof durationInMiliseconds}`);
|
|
@@ -30,15 +28,11 @@ const estimatePrice = ({ region, durationInMiliseconds, memorySizeInMb, diskSize
|
|
|
30
28
|
if (durationInMiliseconds < 0) {
|
|
31
29
|
throw new TypeError(`Parameter 'durationInMiliseconds' must be over 0 but it is ${durationInMiliseconds}.`);
|
|
32
30
|
}
|
|
33
|
-
const durationPrice =
|
|
34
|
-
? price_per_1_s_1.pricing[region]['Lambda Duration'].price
|
|
35
|
-
: price_per_1_s_1.pricing[region]['Lambda Duration-ARM'].price;
|
|
31
|
+
const durationPrice = price_per_1_s_1.pricing[region]['Lambda Duration-ARM'].price;
|
|
36
32
|
// In GB-second
|
|
37
33
|
const timeCostDollars = Number(durationPrice) *
|
|
38
34
|
((memorySizeInMb * durationInMiliseconds) / 1000 / 1024);
|
|
39
|
-
const diskSizePrice =
|
|
40
|
-
? price_per_1_s_1.pricing[region]['Lambda Storage-Duration'].price
|
|
41
|
-
: price_per_1_s_1.pricing[region]['Lambda Storage-Duration-ARM'].price;
|
|
35
|
+
const diskSizePrice = price_per_1_s_1.pricing[region]['Lambda Storage-Duration-ARM'].price;
|
|
42
36
|
const chargedDiskSize = Math.max(0, diskSizeInMb - defaults_1.MIN_EPHEMERAL_STORAGE_IN_MB);
|
|
43
37
|
// In GB-second
|
|
44
38
|
const diskSizeDollars = chargedDiskSize *
|
|
@@ -3,27 +3,29 @@ import * as IamSdk from '@aws-sdk/client-iam';
|
|
|
3
3
|
import * as LambdaSDK from '@aws-sdk/client-lambda';
|
|
4
4
|
import * as S3SDK from '@aws-sdk/client-s3';
|
|
5
5
|
import * as ServiceQuotasSDK from '@aws-sdk/client-service-quotas';
|
|
6
|
+
import * as StsSdk from '@aws-sdk/client-sts';
|
|
6
7
|
import type { AwsRegion } from '../client';
|
|
7
8
|
import type { CustomCredentials, ServiceMapping } from '../shared/aws-clients';
|
|
8
|
-
export
|
|
9
|
+
export type GetAwsClientInput<T extends keyof ServiceMapping> = {
|
|
9
10
|
region: AwsRegion;
|
|
10
11
|
service: T;
|
|
11
12
|
customCredentials?: CustomCredentials | null;
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
+
type SdkMapping = {
|
|
14
15
|
s3: typeof S3SDK;
|
|
15
16
|
cloudwatch: typeof CloudWatchSDK;
|
|
16
17
|
iam: typeof IamSdk;
|
|
17
18
|
lambda: typeof LambdaSDK;
|
|
18
19
|
servicequotas: typeof ServiceQuotasSDK;
|
|
20
|
+
sts: typeof StsSdk;
|
|
19
21
|
};
|
|
20
|
-
export
|
|
22
|
+
export type GetAwsClientOutput<T extends keyof ServiceMapping> = {
|
|
21
23
|
client: ServiceMapping[T];
|
|
22
24
|
sdk: SdkMapping[T];
|
|
23
25
|
};
|
|
24
26
|
/**
|
|
25
27
|
* @description Gets the full AWS SDK and an instantiated client for an AWS service
|
|
26
|
-
* @
|
|
28
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/getawsclient)
|
|
27
29
|
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
28
30
|
* @param {string} params.service One of `iam`, `s3`, `cloudwatch`, `iam` or `servicequotas`
|
|
29
31
|
* @param {CustomCredentials} params.customCredentials Pass endpoint and credentials if you want to connect to a different cloud for S3
|
|
@@ -29,10 +29,11 @@ const IamSdk = __importStar(require("@aws-sdk/client-iam"));
|
|
|
29
29
|
const LambdaSDK = __importStar(require("@aws-sdk/client-lambda"));
|
|
30
30
|
const S3SDK = __importStar(require("@aws-sdk/client-s3"));
|
|
31
31
|
const ServiceQuotasSDK = __importStar(require("@aws-sdk/client-service-quotas"));
|
|
32
|
+
const StsSdk = __importStar(require("@aws-sdk/client-sts"));
|
|
32
33
|
const aws_clients_1 = require("../shared/aws-clients");
|
|
33
34
|
/**
|
|
34
35
|
* @description Gets the full AWS SDK and an instantiated client for an AWS service
|
|
35
|
-
* @
|
|
36
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/getawsclient)
|
|
36
37
|
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
37
38
|
* @param {string} params.service One of `iam`, `s3`, `cloudwatch`, `iam` or `servicequotas`
|
|
38
39
|
* @param {CustomCredentials} params.customCredentials Pass endpoint and credentials if you want to connect to a different cloud for S3
|
|
@@ -51,6 +52,7 @@ const getAwsClient = ({ region, service, customCredentials, }) => {
|
|
|
51
52
|
iam: IamSdk,
|
|
52
53
|
s3: S3SDK,
|
|
53
54
|
servicequotas: ServiceQuotasSDK,
|
|
55
|
+
sts: StsSdk,
|
|
54
56
|
}[service],
|
|
55
57
|
};
|
|
56
58
|
};
|
package/dist/api/get-buckets.js
CHANGED
|
@@ -4,26 +4,43 @@ exports.getRemotionS3Buckets = void 0;
|
|
|
4
4
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
5
|
const aws_clients_1 = require("../shared/aws-clients");
|
|
6
6
|
const constants_1 = require("../shared/constants");
|
|
7
|
+
const validate_bucketname_1 = require("../shared/validate-bucketname");
|
|
7
8
|
const getRemotionS3Buckets = async (region) => {
|
|
8
9
|
const { Buckets } = await (0, aws_clients_1.getS3Client)(region, null).send(new client_s3_1.ListBucketsCommand({}));
|
|
9
10
|
if (!Buckets) {
|
|
10
11
|
return { remotionBuckets: [] };
|
|
11
12
|
}
|
|
12
13
|
const remotionBuckets = Buckets.filter((b) => { var _a; return (_a = b.Name) === null || _a === void 0 ? void 0 : _a.startsWith(constants_1.REMOTION_BUCKET_PREFIX); });
|
|
13
|
-
const locations = await Promise.all(remotionBuckets.map((bucket) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const locations = await Promise.all(remotionBuckets.map(async (bucket) => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const { region: parsedRegion } = (0, validate_bucketname_1.parseBucketName)(bucket.Name);
|
|
17
|
+
if (parsedRegion) {
|
|
18
|
+
return parsedRegion;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const result = await (0, aws_clients_1.getS3Client)(region, null).send(new client_s3_1.GetBucketLocationCommand({
|
|
22
|
+
Bucket: bucket.Name,
|
|
23
|
+
}));
|
|
24
|
+
// AWS docs: Buckets in Region us-east-1 have a LocationConstraint of null!!
|
|
25
|
+
return (_a = result.LocationConstraint) !== null && _a !== void 0 ? _a : 'us-east-1';
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
// Sometimes the API returns a bucket even if it was deleted before
|
|
29
|
+
if ((_b = err.stack) === null || _b === void 0 ? void 0 : _b.includes('NoSuchBucket')) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
throw err;
|
|
33
|
+
}
|
|
17
34
|
}));
|
|
18
|
-
const bucketsWithLocation = remotionBuckets
|
|
19
|
-
|
|
35
|
+
const bucketsWithLocation = remotionBuckets
|
|
36
|
+
.map((bucket, i) => {
|
|
20
37
|
return {
|
|
21
38
|
creationDate: bucket.CreationDate.getTime(),
|
|
22
39
|
name: bucket.Name,
|
|
23
|
-
|
|
24
|
-
region: ((_a = locations[i].LocationConstraint) !== null && _a !== void 0 ? _a : 'us-east-1'),
|
|
40
|
+
region: locations[i],
|
|
25
41
|
};
|
|
26
|
-
})
|
|
42
|
+
})
|
|
43
|
+
.filter((b) => b.region);
|
|
27
44
|
return {
|
|
28
45
|
remotionBuckets: bucketsWithLocation.filter((bucket) => {
|
|
29
46
|
return bucket.region === region;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ChromiumOptions, LogLevel } from '@remotion/renderer';
|
|
2
|
+
import type { AnyCompMetadata } from 'remotion';
|
|
3
|
+
import type { AwsRegion } from '../client';
|
|
4
|
+
export type GetCompositionsOnLambdaInput = {
|
|
5
|
+
chromiumOptions?: ChromiumOptions;
|
|
6
|
+
region: AwsRegion;
|
|
7
|
+
inputProps: Record<string, unknown>;
|
|
8
|
+
functionName: string;
|
|
9
|
+
serveUrl: string;
|
|
10
|
+
envVariables?: Record<string, string>;
|
|
11
|
+
logLevel?: LogLevel;
|
|
12
|
+
timeoutInMilliseconds?: number;
|
|
13
|
+
forceBucketName?: string;
|
|
14
|
+
dumpBrowserLogs?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type GetCompositionsOnLambdaOutput = AnyCompMetadata[];
|
|
17
|
+
/**
|
|
18
|
+
* @description Returns the compositions from a serveUrl
|
|
19
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/getcompositionsonlambda)
|
|
20
|
+
* @param params.functionName The name of the Lambda function that should be used
|
|
21
|
+
* @param params.serveUrl The URL of the deployed project
|
|
22
|
+
* @param params.inputProps The input props that should be passed while the compositions are evaluated.
|
|
23
|
+
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
24
|
+
* @param params.region The AWS region in which the video should be rendered.
|
|
25
|
+
* @param params.logLevel The log level of the Lambda function
|
|
26
|
+
* @param params.timeoutInMilliseconds The timeout of the Lambda function
|
|
27
|
+
* @param params.chromiumOptions The options to pass to Chromium
|
|
28
|
+
* @param params.dumpBrowserLogs Whether to print browser logs to CloudWatch
|
|
29
|
+
* @returns The compositions
|
|
30
|
+
*/
|
|
31
|
+
export declare const getCompositionsOnLambda: ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, }: GetCompositionsOnLambdaInput) => Promise<GetCompositionsOnLambdaOutput>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCompositionsOnLambda = void 0;
|
|
4
|
+
const version_1 = require("remotion/version");
|
|
5
|
+
const defaults_1 = require("../defaults");
|
|
6
|
+
const call_lambda_1 = require("../shared/call-lambda");
|
|
7
|
+
const serialize_input_props_1 = require("../shared/serialize-input-props");
|
|
8
|
+
/**
|
|
9
|
+
* @description Returns the compositions from a serveUrl
|
|
10
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/getcompositionsonlambda)
|
|
11
|
+
* @param params.functionName The name of the Lambda function that should be used
|
|
12
|
+
* @param params.serveUrl The URL of the deployed project
|
|
13
|
+
* @param params.inputProps The input props that should be passed while the compositions are evaluated.
|
|
14
|
+
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
15
|
+
* @param params.region The AWS region in which the video should be rendered.
|
|
16
|
+
* @param params.logLevel The log level of the Lambda function
|
|
17
|
+
* @param params.timeoutInMilliseconds The timeout of the Lambda function
|
|
18
|
+
* @param params.chromiumOptions The options to pass to Chromium
|
|
19
|
+
* @param params.dumpBrowserLogs Whether to print browser logs to CloudWatch
|
|
20
|
+
* @returns The compositions
|
|
21
|
+
*/
|
|
22
|
+
const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, }) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const serializedInputProps = await (0, serialize_input_props_1.serializeInputProps)({
|
|
25
|
+
inputProps,
|
|
26
|
+
region,
|
|
27
|
+
type: 'still',
|
|
28
|
+
userSpecifiedBucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
29
|
+
});
|
|
30
|
+
try {
|
|
31
|
+
const res = await (0, call_lambda_1.callLambda)({
|
|
32
|
+
functionName,
|
|
33
|
+
type: defaults_1.LambdaRoutines.compositions,
|
|
34
|
+
payload: {
|
|
35
|
+
chromiumOptions: chromiumOptions !== null && chromiumOptions !== void 0 ? chromiumOptions : {},
|
|
36
|
+
serveUrl,
|
|
37
|
+
envVariables,
|
|
38
|
+
inputProps: serializedInputProps,
|
|
39
|
+
logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
|
|
40
|
+
timeoutInMilliseconds: timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : 30000,
|
|
41
|
+
version: version_1.VERSION,
|
|
42
|
+
bucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
43
|
+
dumpBrowserLogs: dumpBrowserLogs !== null && dumpBrowserLogs !== void 0 ? dumpBrowserLogs : false,
|
|
44
|
+
},
|
|
45
|
+
region,
|
|
46
|
+
});
|
|
47
|
+
return res.compositions;
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('UnrecognizedClientException')) {
|
|
51
|
+
throw new Error('UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception');
|
|
52
|
+
}
|
|
53
|
+
throw err;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.getCompositionsOnLambda = getCompositionsOnLambda;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
2
|
-
export
|
|
2
|
+
export type FunctionInfo = {
|
|
3
3
|
functionName: string;
|
|
4
4
|
timeoutInSeconds: number;
|
|
5
5
|
memorySizeInMb: number;
|
|
6
6
|
version: string | null;
|
|
7
7
|
diskSizeInMb: number;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type GetFunctionInfoInput = {
|
|
10
10
|
region: AwsRegion;
|
|
11
11
|
functionName: string;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* @description Given a region and function name, returns information about the function such as version, memory size and timeout.
|
|
15
|
-
* @
|
|
15
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/getfunctioninfo)
|
|
16
16
|
* @param {AwsRegion} options.region The region in which the function resides in.
|
|
17
17
|
* @param {string} options.functionName The name of the function
|
|
18
18
|
* @return {Promise<FunctionInfo>} Promise resolving to information about the function.
|