@remotion/lambda 4.0.244 → 4.0.246
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 +1 -1
- package/dist/admin/make-layer-public.js +10 -11
- package/dist/api/app-router-webhook.d.ts +10 -0
- package/dist/api/app-router-webhook.js +43 -0
- package/dist/api/create-function.d.ts +1 -2
- package/dist/api/create-function.js +10 -10
- package/dist/api/delete-function.d.ts +4 -13
- package/dist/api/delete-function.js +2 -5
- package/dist/api/delete-render.d.ts +0 -8
- package/dist/api/delete-render.js +4 -10
- package/dist/api/delete-site.d.ts +0 -10
- package/dist/api/delete-site.js +4 -11
- package/dist/api/deploy-function.d.ts +8 -15
- package/dist/api/deploy-function.js +21 -27
- package/dist/api/deploy-site.d.ts +2 -11
- package/dist/api/deploy-site.js +14 -22
- package/dist/api/download-media.d.ts +0 -11
- package/dist/api/download-media.js +3 -12
- package/dist/api/estimate-price.d.ts +0 -6
- package/dist/api/estimate-price.js +1 -3
- package/dist/api/get-aws-client.d.ts +1 -9
- package/dist/api/get-aws-client.js +2 -6
- package/dist/api/get-compositions-on-lambda.d.ts +1 -14
- package/dist/api/get-compositions-on-lambda.js +12 -17
- package/dist/api/get-function-info.d.ts +1 -14
- package/dist/api/get-function-info.js +2 -5
- package/dist/api/get-functions.d.ts +1 -8
- package/dist/api/get-functions.js +2 -5
- package/dist/api/get-or-create-bucket.d.ts +0 -6
- package/dist/api/get-or-create-bucket.js +3 -5
- package/dist/api/get-regions.d.ts +0 -5
- package/dist/api/get-regions.js +3 -4
- package/dist/api/get-render-progress.d.ts +0 -10
- package/dist/api/get-render-progress.js +3 -11
- package/dist/api/get-sites.d.ts +0 -6
- package/dist/api/get-sites.js +4 -7
- package/dist/api/iam-validation/simulate.d.ts +0 -7
- package/dist/api/iam-validation/simulate.js +2 -5
- package/dist/api/iam-validation/suggested-policy.d.ts +0 -10
- package/dist/api/iam-validation/suggested-policy.js +2 -4
- package/dist/api/make-lambda-payload.d.ts +2 -1
- package/dist/api/make-lambda-payload.js +19 -13
- package/dist/api/pages-router-webhook.d.ts +3 -0
- package/dist/api/pages-router-webhook.js +47 -0
- package/dist/api/presign-url.d.ts +0 -10
- package/dist/api/presign-url.js +2 -8
- package/dist/api/render-media-on-lambda.d.ts +1 -20
- package/dist/api/render-media-on-lambda.js +4 -19
- package/dist/api/render-still-on-lambda.d.ts +2 -19
- package/dist/api/render-still-on-lambda.js +6 -17
- package/dist/api/speculate-function-name.d.ts +0 -8
- package/dist/api/speculate-function-name.js +3 -7
- package/dist/api/upload-dir.d.ts +1 -7
- package/dist/api/upload-dir.js +1 -5
- package/dist/api/validate-webhook-signature.d.ts +0 -8
- package/dist/api/validate-webhook-signature.js +3 -7
- package/dist/cli/args.d.ts +2 -1
- package/dist/cli/commands/compositions/index.d.ts +7 -1
- package/dist/cli/commands/compositions/index.js +2 -2
- package/dist/cli/commands/functions/deploy.d.ts +7 -1
- package/dist/cli/commands/functions/deploy.js +7 -2
- package/dist/cli/commands/functions/index.d.ts +8 -1
- package/dist/cli/commands/functions/index.js +8 -4
- package/dist/cli/commands/functions/ls.d.ts +6 -1
- package/dist/cli/commands/functions/ls.js +2 -3
- package/dist/cli/commands/functions/rmall.d.ts +6 -1
- package/dist/cli/commands/functions/rmall.js +2 -3
- package/dist/cli/commands/render/render.d.ts +6 -1
- package/dist/cli/commands/render/render.js +9 -7
- package/dist/cli/commands/sites/create.js +2 -0
- package/dist/cli/commands/sites/index.d.ts +1 -1
- package/dist/cli/commands/sites/index.js +4 -4
- package/dist/cli/commands/still.d.ts +2 -2
- package/dist/cli/commands/still.js +5 -5
- package/dist/cli/get-aws-region.js +0 -4
- package/dist/cli/helpers/find-function-name.d.ts +6 -1
- package/dist/cli/helpers/find-function-name.js +4 -5
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +36 -16
- package/dist/client.d.ts +17 -22
- package/dist/client.js +17 -13
- package/dist/functions/aws-implementation.d.ts +13 -1
- package/dist/functions/aws-implementation.js +46 -0
- package/dist/functions/aws-server-implementation.d.ts +2 -0
- package/dist/functions/aws-server-implementation.js +25 -0
- package/dist/functions/full-client-implementation.d.ts +3 -0
- package/dist/functions/full-client-implementation.js +16 -0
- package/dist/functions/helpers/clean-tmpdir.js +1 -3
- package/dist/functions/helpers/get-current-region.js +0 -4
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +3 -7
- package/dist/functions/helpers/get-output-url-from-metadata.js +1 -1
- package/dist/functions/helpers/lifecycle.d.ts +4 -2
- package/dist/functions/helpers/lifecycle.js +3 -18
- package/dist/functions/helpers/timer.d.ts +2 -4
- package/dist/functions/http-client.d.ts +7 -0
- package/dist/functions/http-client.js +22 -0
- package/dist/functions/index.d.ts +1 -8
- package/dist/functions/index.js +12 -235
- package/dist/index.d.ts +6 -6
- package/dist/index.js +27 -6
- package/dist/internals.d.ts +6 -5
- package/dist/pricing/price-per-1-s.js +102 -0
- package/dist/regions.d.ts +1 -1
- package/dist/regions.js +3 -0
- package/dist/shared/call-lambda-async.d.ts +3 -0
- package/dist/shared/call-lambda-async.js +20 -0
- package/dist/shared/call-lambda-streaming.d.ts +7 -0
- package/dist/shared/{call-lambda.js → call-lambda-streaming.js} +36 -61
- package/dist/shared/call-lambda-sync.d.ts +3 -0
- package/dist/shared/call-lambda-sync.js +30 -0
- package/dist/shared/check-credentials.js +2 -3
- package/dist/shared/constants.d.ts +2 -91
- package/dist/shared/constants.js +1 -8
- package/dist/shared/convert-to-serve-url.js +2 -2
- package/dist/shared/get-account-id.d.ts +3 -4
- package/dist/shared/get-account-id.js +3 -3
- package/dist/shared/get-aws-urls.d.ts +4 -8
- package/dist/shared/get-aws-urls.js +1 -1
- package/dist/shared/get-function-version.js +4 -4
- package/dist/shared/get-layers.d.ts +1 -2
- package/dist/shared/get-layers.js +2 -4
- package/dist/shared/get-s3-operations.d.ts +4 -1
- package/dist/shared/get-s3-operations.js +2 -3
- package/dist/shared/get-service-client.js +2 -2
- package/dist/shared/hosted-layers.d.ts +0 -1
- package/dist/shared/hosted-layers.js +139 -537
- package/dist/shared/lambda-insights-extensions.d.ts +1 -1
- package/dist/shared/lambda-insights-extensions.js +3 -0
- package/dist/shared/read-dir.d.ts +2 -10
- package/dist/shared/read-dir.js +5 -4
- package/dist/shared/validate-aws-region.js +1 -1
- package/dist/shared/validate-bucketname.d.ts +1 -1
- package/package.json +15 -15
- package/remotionlambda-arm64.zip +0 -0
- package/dist/api/__mocks__/clean-items.d.ts +0 -2
- package/dist/api/__mocks__/clean-items.js +0 -24
- package/dist/api/__mocks__/create-function.d.ts +0 -2
- package/dist/api/__mocks__/create-function.js +0 -21
- package/dist/api/__mocks__/delete-function.d.ts +0 -2
- package/dist/api/__mocks__/delete-function.js +0 -9
- package/dist/api/__mocks__/get-functions.d.ts +0 -2
- package/dist/api/__mocks__/get-functions.js +0 -9
- package/dist/api/__mocks__/upload-dir.d.ts +0 -3
- package/dist/api/__mocks__/upload-dir.js +0 -47
- package/dist/api/mock-functions.d.ts +0 -18
- package/dist/api/mock-functions.js +0 -36
- package/dist/cli/helpers/__mocks__/quit.d.ts +0 -1
- package/dist/cli/helpers/__mocks__/quit.js +0 -7
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +0 -7
- package/dist/functions/chunk-optimization/plan-frame-ranges.js +0 -17
- package/dist/functions/chunk-optimization/types.d.ts +0 -8
- package/dist/functions/chunk-optimization/types.js +0 -2
- package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +0 -3
- package/dist/functions/helpers/__mocks__/get-browser-instance.js +0 -12
- package/dist/functions/helpers/__mocks__/leak-detection.d.ts +0 -4
- package/dist/functions/helpers/__mocks__/leak-detection.js +0 -9
- package/dist/functions/helpers/__mocks__/timer.d.ts +0 -2
- package/dist/functions/helpers/__mocks__/timer.js +0 -10
- package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -1
- package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -17
- package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -5
- package/dist/functions/helpers/calculate-chunk-times.js +0 -29
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -15
- package/dist/functions/helpers/calculate-price-from-bucket.js +0 -30
- package/dist/functions/helpers/can-concat-seamlessly.d.ts +0 -3
- package/dist/functions/helpers/can-concat-seamlessly.js +0 -17
- package/dist/functions/helpers/cleanup-props.d.ts +0 -8
- package/dist/functions/helpers/cleanup-props.js +0 -23
- package/dist/functions/helpers/concat-videos.d.ts +0 -23
- package/dist/functions/helpers/concat-videos.js +0 -54
- package/dist/functions/helpers/create-post-render-data.d.ts +0 -17
- package/dist/functions/helpers/create-post-render-data.js +0 -67
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +0 -14
- package/dist/functions/helpers/find-output-file-in-bucket.js +0 -38
- package/dist/functions/helpers/format-costs-info.d.ts +0 -2
- package/dist/functions/helpers/format-costs-info.js +0 -23
- package/dist/functions/helpers/get-overall-progress-s3.d.ts +0 -10
- package/dist/functions/helpers/get-overall-progress-s3.js +0 -24
- package/dist/functions/helpers/get-overall-progress.d.ts +0 -9
- package/dist/functions/helpers/get-overall-progress.js +0 -23
- package/dist/functions/helpers/get-progress.d.ts +0 -15
- package/dist/functions/helpers/get-progress.js +0 -254
- package/dist/functions/helpers/get-retry-stats.d.ts +0 -5
- package/dist/functions/helpers/get-retry-stats.js +0 -2
- package/dist/functions/helpers/inspect-errors.d.ts +0 -4
- package/dist/functions/helpers/inspect-errors.js +0 -39
- package/dist/functions/helpers/is-warm.d.ts +0 -2
- package/dist/functions/helpers/is-warm.js +0 -10
- package/dist/functions/helpers/leak-detection.d.ts +0 -4
- package/dist/functions/helpers/leak-detection.js +0 -40
- package/dist/functions/helpers/make-timeout-error.d.ts +0 -10
- package/dist/functions/helpers/make-timeout-error.js +0 -31
- package/dist/functions/helpers/make-timeout-message.d.ts +0 -10
- package/dist/functions/helpers/make-timeout-message.js +0 -75
- package/dist/functions/helpers/merge-chunks.d.ts +0 -36
- package/dist/functions/helpers/merge-chunks.js +0 -84
- package/dist/functions/helpers/min-max.d.ts +0 -2
- package/dist/functions/helpers/min-max.js +0 -33
- package/dist/functions/helpers/on-downloads-logger.d.ts +0 -2
- package/dist/functions/helpers/on-downloads-logger.js +0 -29
- package/dist/functions/helpers/overall-render-progress.d.ts +0 -59
- package/dist/functions/helpers/overall-render-progress.js +0 -180
- package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -1
- package/dist/functions/helpers/print-concurrency-curve.js +0 -8
- package/dist/functions/helpers/print-logging-helper.d.ts +0 -4
- package/dist/functions/helpers/print-logging-helper.js +0 -12
- package/dist/functions/helpers/render-has-audio-video.d.ts +0 -6
- package/dist/functions/helpers/render-has-audio-video.js +0 -21
- package/dist/functions/helpers/request-context.d.ts +0 -5
- package/dist/functions/helpers/request-context.js +0 -2
- package/dist/functions/helpers/stream-renderer.d.ts +0 -17
- package/dist/functions/helpers/stream-renderer.js +0 -148
- package/dist/functions/launch.d.ts +0 -10
- package/dist/functions/launch.js +0 -596
- package/dist/functions/progress.d.ts +0 -11
- package/dist/functions/progress.js +0 -51
- package/dist/functions/renderer.d.ts +0 -17
- package/dist/functions/renderer.js +0 -341
- package/dist/functions/start.d.ts +0 -13
- package/dist/functions/start.js +0 -113
- package/dist/functions/still.d.ts +0 -19
- package/dist/functions/still.js +0 -330
- package/dist/shared/__mocks__/aws-clients.d.ts +0 -2
- package/dist/shared/__mocks__/aws-clients.js +0 -62
- package/dist/shared/__mocks__/bundle-site.d.ts +0 -2
- package/dist/shared/__mocks__/bundle-site.js +0 -32
- package/dist/shared/__mocks__/check-credentials.d.ts +0 -1
- package/dist/shared/__mocks__/check-credentials.js +0 -5
- package/dist/shared/__mocks__/get-account-id.d.ts +0 -2
- package/dist/shared/__mocks__/get-account-id.js +0 -11
- package/dist/shared/__mocks__/read-dir.d.ts +0 -2
- package/dist/shared/__mocks__/read-dir.js +0 -13
- package/dist/shared/call-lambda.d.ts +0 -16
- package/dist/shared/cleanup-serialized-input-props.d.ts +0 -14
- package/dist/shared/cleanup-serialized-input-props.js +0 -34
- package/dist/shared/docs-url.d.ts +0 -1
- package/dist/shared/docs-url.js +0 -4
- package/dist/shared/get-most-expensive-chunks.d.ts +0 -8
- package/dist/shared/get-most-expensive-chunks.js +0 -28
- package/dist/shared/invoke-webhook.d.ts +0 -48
- package/dist/shared/invoke-webhook.js +0 -140
- package/dist/shared/parse-lambda-timings-key.d.ts +0 -5
- package/dist/shared/parse-lambda-timings-key.js +0 -2
- package/dist/shared/return-values.d.ts +0 -16
- package/dist/shared/return-values.js +0 -2
- package/dist/shared/stackback.d.ts +0 -6
- package/dist/shared/stackback.js +0 -59
- package/dist/shared/validate-download-behavior.d.ts +0 -1
- package/dist/shared/validate-download-behavior.js +0 -21
- package/dist/shared/validate-frames-per-lambda.d.ts +0 -4
- package/dist/shared/validate-frames-per-lambda.js +0 -29
- package/dist/shared/validate-privacy.d.ts +0 -2
- package/dist/shared/validate-privacy.js +0 -14
- package/dist/shared/validate.d.ts +0 -4
- package/dist/shared/validate.js +0 -8
- package/dist/shared/why-is-node-running.d.ts +0 -15
- package/dist/shared/why-is-node-running.js +0 -88
- package/vitest.config.mts +0 -11
|
@@ -8,13 +8,13 @@ const cli_1 = require("@remotion/cli");
|
|
|
8
8
|
const config_1 = require("@remotion/cli/config");
|
|
9
9
|
const renderer_1 = require("@remotion/renderer");
|
|
10
10
|
const client_1 = require("@remotion/renderer/client");
|
|
11
|
+
const client_2 = require("@remotion/serverless/client");
|
|
11
12
|
const path_1 = __importDefault(require("path"));
|
|
12
13
|
const no_react_1 = require("remotion/no-react");
|
|
13
14
|
const download_media_1 = require("../../api/download-media");
|
|
14
15
|
const render_still_on_lambda_1 = require("../../api/render-still-on-lambda");
|
|
15
16
|
const constants_1 = require("../../shared/constants");
|
|
16
17
|
const get_aws_urls_1 = require("../../shared/get-aws-urls");
|
|
17
|
-
const validate_privacy_1 = require("../../shared/validate-privacy");
|
|
18
18
|
const validate_retries_1 = require("../../shared/validate-retries");
|
|
19
19
|
const validate_serveurl_1 = require("../../shared/validate-serveurl");
|
|
20
20
|
const args_1 = require("../args");
|
|
@@ -26,7 +26,7 @@ const progress_1 = require("./render/progress");
|
|
|
26
26
|
const { offthreadVideoCacheSizeInBytesOption, scaleOption, deleteAfterOption, jpegQualityOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, delayRenderTimeoutInMillisecondsOption, binariesDirectoryOption, } = client_1.BrowserSafeApis.options;
|
|
27
27
|
const { parsedCli, determineFinalStillImageFormat, chalk, getCliOptions, formatBytes, getCompositionWithDimensionOverride, } = cli_1.CliInternals;
|
|
28
28
|
exports.STILL_COMMAND = 'still';
|
|
29
|
-
const stillCommand = async ({ args, remotionRoot, logLevel,
|
|
29
|
+
const stillCommand = async ({ args, remotionRoot, logLevel, providerSpecifics, }) => {
|
|
30
30
|
var _a, _b, _c, _d, _e;
|
|
31
31
|
const serveUrl = args[0];
|
|
32
32
|
if (!serveUrl) {
|
|
@@ -117,11 +117,11 @@ const stillCommand = async ({ args, remotionRoot, logLevel, implementation, }) =
|
|
|
117
117
|
}
|
|
118
118
|
const downloadName = (_a = args[2]) !== null && _a !== void 0 ? _a : null;
|
|
119
119
|
const outName = args_1.parsedLambdaCli['out-name'];
|
|
120
|
-
const functionName = await (0, find_function_name_1.findFunctionName)(logLevel);
|
|
120
|
+
const functionName = await (0, find_function_name_1.findFunctionName)({ logLevel, providerSpecifics });
|
|
121
121
|
const maxRetries = (_b = args_1.parsedLambdaCli['max-retries']) !== null && _b !== void 0 ? _b : constants_1.DEFAULT_MAX_RETRIES;
|
|
122
122
|
(0, validate_retries_1.validateMaxRetries)(maxRetries);
|
|
123
123
|
const privacy = (_c = args_1.parsedLambdaCli.privacy) !== null && _c !== void 0 ? _c : constants_1.DEFAULT_OUTPUT_PRIVACY;
|
|
124
|
-
(0,
|
|
124
|
+
(0, client_2.validatePrivacy)(privacy, true);
|
|
125
125
|
const { format: imageFormat, source: imageFormatReason } = determineFinalStillImageFormat({
|
|
126
126
|
downloadName,
|
|
127
127
|
outName: outName !== null && outName !== void 0 ? outName : null,
|
|
@@ -193,7 +193,7 @@ const stillCommand = async ({ args, remotionRoot, logLevel, implementation, }) =
|
|
|
193
193
|
region,
|
|
194
194
|
renderId: res.renderId,
|
|
195
195
|
logLevel,
|
|
196
|
-
providerSpecifics:
|
|
196
|
+
providerSpecifics: providerSpecifics,
|
|
197
197
|
forcePathStyle: args_1.parsedLambdaCli['force-path-style'],
|
|
198
198
|
});
|
|
199
199
|
const relativePath = path_1.default.relative(process.cwd(), outputPath);
|
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAwsRegion = void 0;
|
|
4
4
|
const constants_1 = require("../shared/constants");
|
|
5
|
-
const is_in_lambda_1 = require("../shared/is-in-lambda");
|
|
6
5
|
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
7
6
|
const args_1 = require("./args");
|
|
8
7
|
const getAwsRegion = () => {
|
|
9
8
|
var _a;
|
|
10
|
-
if ((0, is_in_lambda_1.isInsideLambda)()) {
|
|
11
|
-
throw new Error('Should not call getAwsRegion() if in lambda');
|
|
12
|
-
}
|
|
13
9
|
if (args_1.parsedLambdaCli.region) {
|
|
14
10
|
(0, validate_aws_region_1.validateAwsRegion)(args_1.parsedLambdaCli.region);
|
|
15
11
|
return args_1.parsedLambdaCli.region;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
-
|
|
2
|
+
import { ProviderSpecifics } from '@remotion/serverless';
|
|
3
|
+
import { AwsProvider } from '../../functions/aws-implementation';
|
|
4
|
+
export declare const findFunctionName: ({ logLevel, providerSpecifics, }: {
|
|
5
|
+
logLevel: LogLevel;
|
|
6
|
+
providerSpecifics: ProviderSpecifics<AwsProvider>;
|
|
7
|
+
}) => Promise<string>;
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findFunctionName = void 0;
|
|
4
4
|
const version_1 = require("remotion/version");
|
|
5
|
-
const
|
|
6
|
-
const client_1 = require("../../client");
|
|
5
|
+
const speculate_function_name_1 = require("../../api/speculate-function-name");
|
|
7
6
|
const constants_1 = require("../../shared/constants");
|
|
8
7
|
const args_1 = require("../args");
|
|
9
8
|
const functions_1 = require("../commands/functions");
|
|
@@ -13,8 +12,8 @@ const rm_1 = require("../commands/functions/rm");
|
|
|
13
12
|
const get_aws_region_1 = require("../get-aws-region");
|
|
14
13
|
const log_1 = require("../log");
|
|
15
14
|
const quit_1 = require("./quit");
|
|
16
|
-
const findFunctionName = async (logLevel) => {
|
|
17
|
-
const remotionLambdas = await
|
|
15
|
+
const findFunctionName = async ({ logLevel, providerSpecifics, }) => {
|
|
16
|
+
const remotionLambdas = await providerSpecifics.getFunctions({
|
|
18
17
|
region: (0, get_aws_region_1.getAwsRegion)(),
|
|
19
18
|
compatibleOnly: false,
|
|
20
19
|
});
|
|
@@ -27,7 +26,7 @@ const findFunctionName = async (logLevel) => {
|
|
|
27
26
|
if (cliFlag) {
|
|
28
27
|
const compatibleFunctionExists = lambdasWithMatchingVersion.find((l) => l.functionName === cliFlag);
|
|
29
28
|
if (!compatibleFunctionExists) {
|
|
30
|
-
log_1.Log.warn({ indent: false, logLevel }, `Function "${cliFlag}" does not match naming convention ${(0,
|
|
29
|
+
log_1.Log.warn({ indent: false, logLevel }, `Function "${cliFlag}" does not match naming convention ${(0, speculate_function_name_1.speculateFunctionName)({ diskSizeInMb: '[disk]', memorySizeInMb: '[memory]', timeoutInSeconds: '[timeout]' })}.`);
|
|
31
30
|
log_1.Log.warn({ indent: false, logLevel }, 'Remotion relies on the naming to determine function information. This is an unsupported workflow.');
|
|
32
31
|
if (lambdasWithMatchingVersion.length > 0) {
|
|
33
32
|
log_1.Log.info(logOptions, 'The following functions were found:');
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
-
import type
|
|
2
|
+
import { FullClientSpecifics, type ProviderSpecifics } from '@remotion/serverless';
|
|
3
3
|
import type { AwsProvider } from '../functions/aws-implementation';
|
|
4
|
-
export declare const executeCommand: (args: string[], remotionRoot: string, logLevel: LogLevel,
|
|
4
|
+
export declare const executeCommand: (args: string[], remotionRoot: string, logLevel: LogLevel, providerSpecifics: ProviderSpecifics<AwsProvider> | null, fullClientSpecifics: FullClientSpecifics<AwsProvider> | null) => Promise<void>;
|
|
5
5
|
export declare const cli: (logLevel: LogLevel) => Promise<void>;
|
package/dist/cli/index.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.cli = exports.executeCommand = void 0;
|
|
4
4
|
const cli_1 = require("@remotion/cli");
|
|
5
5
|
const renderer_1 = require("@remotion/renderer");
|
|
6
|
+
const client_1 = require("@remotion/serverless/client");
|
|
6
7
|
const suggested_policy_1 = require("../api/iam-validation/suggested-policy");
|
|
7
8
|
const defaults_1 = require("../defaults");
|
|
8
9
|
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
9
|
-
const
|
|
10
|
-
const docs_url_1 = require("../shared/docs-url");
|
|
10
|
+
const full_client_implementation_1 = require("../functions/full-client-implementation");
|
|
11
11
|
const args_1 = require("./args");
|
|
12
12
|
const compositions_1 = require("./commands/compositions");
|
|
13
13
|
const functions_1 = require("./commands/functions");
|
|
@@ -37,30 +37,44 @@ const requiresCredentials = (args) => {
|
|
|
37
37
|
}
|
|
38
38
|
return true;
|
|
39
39
|
};
|
|
40
|
-
const matchCommand = (args, remotionRoot, logLevel,
|
|
40
|
+
const matchCommand = ({ args, remotionRoot, logLevel, providerSpecifics, fullClientSpecifics, }) => {
|
|
41
41
|
if (args_1.parsedLambdaCli.help || args.length === 0) {
|
|
42
42
|
(0, help_1.printHelp)(logLevel);
|
|
43
43
|
(0, quit_1.quit)(0);
|
|
44
44
|
}
|
|
45
45
|
if (requiresCredentials(args)) {
|
|
46
|
-
|
|
46
|
+
fullClientSpecifics.checkCredentials();
|
|
47
47
|
}
|
|
48
48
|
if (args[0] === render_1.RENDER_COMMAND) {
|
|
49
|
-
return (0, render_1.renderCommand)(
|
|
49
|
+
return (0, render_1.renderCommand)({
|
|
50
|
+
args: args.slice(1),
|
|
51
|
+
remotionRoot,
|
|
52
|
+
logLevel,
|
|
53
|
+
providerSpecifics,
|
|
54
|
+
});
|
|
50
55
|
}
|
|
51
56
|
if (args[0] === still_1.STILL_COMMAND) {
|
|
52
57
|
return (0, still_1.stillCommand)({
|
|
53
58
|
args: args.slice(1),
|
|
54
59
|
remotionRoot,
|
|
55
60
|
logLevel,
|
|
56
|
-
|
|
61
|
+
providerSpecifics: providerSpecifics,
|
|
57
62
|
});
|
|
58
63
|
}
|
|
59
64
|
if (args[0] === compositions_1.COMPOSITIONS_COMMAND) {
|
|
60
|
-
return (0, compositions_1.compositionsCommand)(
|
|
65
|
+
return (0, compositions_1.compositionsCommand)({
|
|
66
|
+
args: args.slice(1),
|
|
67
|
+
logLevel,
|
|
68
|
+
providerSpecifics,
|
|
69
|
+
});
|
|
61
70
|
}
|
|
62
71
|
if (args[0] === functions_1.FUNCTIONS_COMMAND) {
|
|
63
|
-
return (0, functions_1.functionsCommand)(
|
|
72
|
+
return (0, functions_1.functionsCommand)({
|
|
73
|
+
args: args.slice(1),
|
|
74
|
+
logLevel,
|
|
75
|
+
fullClientSpecifics,
|
|
76
|
+
providerSpecifics,
|
|
77
|
+
});
|
|
64
78
|
}
|
|
65
79
|
if (args[0] === quotas_1.QUOTAS_COMMAND) {
|
|
66
80
|
return (0, quotas_1.quotasCommand)(args.slice(1), logLevel);
|
|
@@ -72,7 +86,7 @@ const matchCommand = (args, remotionRoot, logLevel, implementation) => {
|
|
|
72
86
|
return (0, regions_1.regionsCommand)(logLevel);
|
|
73
87
|
}
|
|
74
88
|
if (args[0] === sites_1.SITES_COMMAND) {
|
|
75
|
-
return (0, sites_1.sitesCommand)(args.slice(1), remotionRoot, logLevel,
|
|
89
|
+
return (0, sites_1.sitesCommand)(args.slice(1), remotionRoot, logLevel, providerSpecifics);
|
|
76
90
|
}
|
|
77
91
|
if (args[0] === 'upload') {
|
|
78
92
|
log_1.Log.info({ indent: false, logLevel }, 'The command has been renamed.');
|
|
@@ -102,11 +116,17 @@ const matchCommand = (args, remotionRoot, logLevel, implementation) => {
|
|
|
102
116
|
(0, help_1.printHelp)(logLevel);
|
|
103
117
|
(0, quit_1.quit)(1);
|
|
104
118
|
};
|
|
105
|
-
const executeCommand = async (args, remotionRoot, logLevel,
|
|
119
|
+
const executeCommand = async (args, remotionRoot, logLevel, providerSpecifics, fullClientSpecifics) => {
|
|
106
120
|
var _a, _b, _c, _d, _e;
|
|
107
121
|
try {
|
|
108
122
|
(0, is_cli_1.setIsCli)(true);
|
|
109
|
-
await matchCommand(
|
|
123
|
+
await matchCommand({
|
|
124
|
+
args,
|
|
125
|
+
remotionRoot,
|
|
126
|
+
logLevel,
|
|
127
|
+
providerSpecifics: providerSpecifics !== null && providerSpecifics !== void 0 ? providerSpecifics : aws_implementation_1.awsImplementation,
|
|
128
|
+
fullClientSpecifics: fullClientSpecifics !== null && fullClientSpecifics !== void 0 ? fullClientSpecifics : full_client_implementation_1.awsFullClientSpecifics,
|
|
129
|
+
});
|
|
110
130
|
}
|
|
111
131
|
catch (err) {
|
|
112
132
|
const error = err;
|
|
@@ -117,7 +137,7 @@ const executeCommand = async (args, remotionRoot, logLevel, implementation) => {
|
|
|
117
137
|
- Remove the "--custom-role-arn" parameter and set up Remotion Lambda according to the setup guide
|
|
118
138
|
- Make sure the role has the same policy assigned as the one returned by "npx ${defaults_1.BINARY_NAME} ${policies_1.POLICIES_COMMAND} ${role_1.ROLE_SUBCOMMAND}"
|
|
119
139
|
|
|
120
|
-
Revisit ${
|
|
140
|
+
Revisit ${client_1.DOCS_URL}/docs/lambda/setup and make sure you set up the role and role policy correctly. Also see the troubleshooting page: ${client_1.DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is:
|
|
121
141
|
`.trim());
|
|
122
142
|
}
|
|
123
143
|
log_1.Log.error({ indent: false, logLevel }, `
|
|
@@ -125,17 +145,17 @@ The role "${suggested_policy_1.ROLE_NAME}" does not exist in your AWS account or
|
|
|
125
145
|
- The name of the role is not "${suggested_policy_1.ROLE_NAME}"
|
|
126
146
|
- The policy is not exactly as specified in the setup guide
|
|
127
147
|
|
|
128
|
-
Revisit ${
|
|
148
|
+
Revisit ${client_1.DOCS_URL}/docs/lambda/setup and make sure you set up the role and role policy correctly. Also see the troubleshooting page: ${client_1.DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is:
|
|
129
149
|
`.trim());
|
|
130
150
|
}
|
|
131
151
|
if ((_a = error.stack) === null || _a === void 0 ? void 0 : _a.includes('AccessDenied')) {
|
|
132
152
|
log_1.Log.error({ indent: false, logLevel }, `
|
|
133
|
-
AWS returned an "AccessDenied" error message meaning a permission is missing. Read the permissions troubleshooting page: ${
|
|
153
|
+
AWS returned an "AccessDenied" error message meaning a permission is missing. Read the permissions troubleshooting page: ${client_1.DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is:
|
|
134
154
|
`.trim());
|
|
135
155
|
}
|
|
136
156
|
if ((_b = error.stack) === null || _b === void 0 ? void 0 : _b.includes('TooManyRequestsException')) {
|
|
137
157
|
log_1.Log.error({ indent: false, logLevel }, `
|
|
138
|
-
AWS returned an "TooManyRequestsException" error message which could mean you reached the concurrency limit of AWS Lambda. You can increase the limit - read this troubleshooting page: ${
|
|
158
|
+
AWS returned an "TooManyRequestsException" error message which could mean you reached the concurrency limit of AWS Lambda. You can increase the limit - read this troubleshooting page: ${client_1.DOCS_URL}/docs/lambda/troubleshooting/rate-limit. The original error message is:
|
|
139
159
|
`.trim());
|
|
140
160
|
}
|
|
141
161
|
if ((_c = error.stack) === null || _c === void 0 ? void 0 : _c.includes('The security token included in the request is invalid')) {
|
|
@@ -176,6 +196,6 @@ exports.executeCommand = executeCommand;
|
|
|
176
196
|
const cli = async (logLevel) => {
|
|
177
197
|
const remotionRoot = renderer_1.RenderInternals.findRemotionRoot();
|
|
178
198
|
await cli_1.CliInternals.initializeCli(remotionRoot);
|
|
179
|
-
await (0, exports.executeCommand)(args_1.parsedLambdaCli._, remotionRoot, logLevel, aws_implementation_1.awsImplementation);
|
|
199
|
+
await (0, exports.executeCommand)(args_1.parsedLambdaCli._, remotionRoot, logLevel, aws_implementation_1.awsImplementation, full_client_implementation_1.awsFullClientSpecifics);
|
|
180
200
|
};
|
|
181
201
|
exports.cli = cli;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import type { RenderProgress } from './shared/constants';
|
|
18
|
-
import type { WebhookPayload } from './shared/invoke-webhook';
|
|
19
|
-
export { CustomCredentials, DeleteAfter } from '@remotion/serverless/client';
|
|
20
|
-
export { getAwsClient, GetAwsClientInput, GetAwsClientOutput, } from './api/get-aws-client';
|
|
1
|
+
export type { WebhookErrorPayload, WebhookPayload, WebhookSuccessPayload, WebhookTimeoutPayload, } from '@remotion/serverless';
|
|
2
|
+
export type { CustomCredentials, DeleteAfter } from '@remotion/serverless/client';
|
|
3
|
+
export { NextWebhookArgs, appRouterWebhook } from './api/app-router-webhook';
|
|
4
|
+
export { deleteRender, type DeleteRenderInput } from './api/delete-render';
|
|
5
|
+
export { getAwsClient, type GetAwsClientInput, type GetAwsClientOutput, } from './api/get-aws-client';
|
|
6
|
+
export { getCompositionsOnLambda, type GetCompositionsOnLambdaInput, type GetCompositionsOnLambdaOutput, } from './api/get-compositions-on-lambda';
|
|
7
|
+
export { getFunctions, type GetFunctionsInput } from './api/get-functions';
|
|
8
|
+
export { getRenderProgress } from './api/get-render-progress';
|
|
9
|
+
export type { GetRenderProgressInput } from './api/get-render-progress';
|
|
10
|
+
export { getSites, type GetSitesInput, type GetSitesOutput, } from './api/get-sites';
|
|
11
|
+
export { pagesRouterWebhook } from './api/pages-router-webhook';
|
|
12
|
+
export { presignUrl, type PresignUrlInput } from './api/presign-url';
|
|
13
|
+
export { renderMediaOnLambda, renderVideoOnLambda, type RenderMediaOnLambdaInput, type RenderMediaOnLambdaOutput, } from './api/render-media-on-lambda';
|
|
14
|
+
export { renderStillOnLambda, type RenderStillOnLambdaInput, type RenderStillOnLambdaOutput, } from './api/render-still-on-lambda';
|
|
15
|
+
export { speculateFunctionName, type SpeculateFunctionNameInput, } from './api/speculate-function-name';
|
|
16
|
+
export { validateWebhookSignature } from './api/validate-webhook-signature';
|
|
21
17
|
export type { AwsRegion } from './regions';
|
|
22
|
-
export {
|
|
23
|
-
export type { DeleteRenderInput, GetRenderProgressInput, PresignUrlInput, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, RenderProgress, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, SpeculateFunctionNameInput, WebhookPayload, };
|
|
18
|
+
export type { RenderProgress } from './shared/constants';
|
package/dist/client.js
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateWebhookSignature = exports.speculateFunctionName = exports.
|
|
4
|
-
|
|
3
|
+
exports.validateWebhookSignature = exports.speculateFunctionName = exports.renderStillOnLambda = exports.renderVideoOnLambda = exports.renderMediaOnLambda = exports.presignUrl = exports.pagesRouterWebhook = exports.getSites = exports.getRenderProgress = exports.getFunctions = exports.getCompositionsOnLambda = exports.getAwsClient = exports.deleteRender = exports.appRouterWebhook = void 0;
|
|
4
|
+
var app_router_webhook_1 = require("./api/app-router-webhook");
|
|
5
|
+
Object.defineProperty(exports, "appRouterWebhook", { enumerable: true, get: function () { return app_router_webhook_1.appRouterWebhook; } });
|
|
6
|
+
var delete_render_1 = require("./api/delete-render");
|
|
5
7
|
Object.defineProperty(exports, "deleteRender", { enumerable: true, get: function () { return delete_render_1.deleteRender; } });
|
|
6
|
-
|
|
8
|
+
var get_aws_client_1 = require("./api/get-aws-client");
|
|
9
|
+
Object.defineProperty(exports, "getAwsClient", { enumerable: true, get: function () { return get_aws_client_1.getAwsClient; } });
|
|
10
|
+
var get_compositions_on_lambda_1 = require("./api/get-compositions-on-lambda");
|
|
7
11
|
Object.defineProperty(exports, "getCompositionsOnLambda", { enumerable: true, get: function () { return get_compositions_on_lambda_1.getCompositionsOnLambda; } });
|
|
8
|
-
|
|
12
|
+
var get_functions_1 = require("./api/get-functions");
|
|
9
13
|
Object.defineProperty(exports, "getFunctions", { enumerable: true, get: function () { return get_functions_1.getFunctions; } });
|
|
10
|
-
|
|
14
|
+
var get_render_progress_1 = require("./api/get-render-progress");
|
|
11
15
|
Object.defineProperty(exports, "getRenderProgress", { enumerable: true, get: function () { return get_render_progress_1.getRenderProgress; } });
|
|
12
|
-
|
|
16
|
+
var get_sites_1 = require("./api/get-sites");
|
|
13
17
|
Object.defineProperty(exports, "getSites", { enumerable: true, get: function () { return get_sites_1.getSites; } });
|
|
14
|
-
|
|
18
|
+
var pages_router_webhook_1 = require("./api/pages-router-webhook");
|
|
19
|
+
Object.defineProperty(exports, "pagesRouterWebhook", { enumerable: true, get: function () { return pages_router_webhook_1.pagesRouterWebhook; } });
|
|
20
|
+
var presign_url_1 = require("./api/presign-url");
|
|
15
21
|
Object.defineProperty(exports, "presignUrl", { enumerable: true, get: function () { return presign_url_1.presignUrl; } });
|
|
16
|
-
|
|
22
|
+
var render_media_on_lambda_1 = require("./api/render-media-on-lambda");
|
|
17
23
|
Object.defineProperty(exports, "renderMediaOnLambda", { enumerable: true, get: function () { return render_media_on_lambda_1.renderMediaOnLambda; } });
|
|
18
24
|
Object.defineProperty(exports, "renderVideoOnLambda", { enumerable: true, get: function () { return render_media_on_lambda_1.renderVideoOnLambda; } });
|
|
19
|
-
|
|
25
|
+
var render_still_on_lambda_1 = require("./api/render-still-on-lambda");
|
|
20
26
|
Object.defineProperty(exports, "renderStillOnLambda", { enumerable: true, get: function () { return render_still_on_lambda_1.renderStillOnLambda; } });
|
|
21
|
-
|
|
27
|
+
var speculate_function_name_1 = require("./api/speculate-function-name");
|
|
22
28
|
Object.defineProperty(exports, "speculateFunctionName", { enumerable: true, get: function () { return speculate_function_name_1.speculateFunctionName; } });
|
|
23
|
-
|
|
29
|
+
var validate_webhook_signature_1 = require("./api/validate-webhook-signature");
|
|
24
30
|
Object.defineProperty(exports, "validateWebhookSignature", { enumerable: true, get: function () { return validate_webhook_signature_1.validateWebhookSignature; } });
|
|
25
|
-
var get_aws_client_1 = require("./api/get-aws-client");
|
|
26
|
-
Object.defineProperty(exports, "getAwsClient", { enumerable: true, get: function () { return get_aws_client_1.getAwsClient; } });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
2
2
|
import type { AwsRegion } from '../regions';
|
|
3
|
+
import type { RuntimePreference } from '../shared/get-layers';
|
|
3
4
|
export type AwsProvider = {
|
|
4
5
|
type: 'aws';
|
|
5
6
|
region: AwsRegion;
|
|
@@ -7,5 +8,16 @@ export type AwsProvider = {
|
|
|
7
8
|
s3Key: string;
|
|
8
9
|
s3Url: string;
|
|
9
10
|
};
|
|
11
|
+
creationFunctionOptions: {
|
|
12
|
+
createCloudWatchLogGroup: boolean;
|
|
13
|
+
accountId: string;
|
|
14
|
+
alreadyCreated: boolean;
|
|
15
|
+
retentionInDays: number;
|
|
16
|
+
customRoleArn: string;
|
|
17
|
+
enableLambdaInsights: boolean;
|
|
18
|
+
vpcSubnetIds: string;
|
|
19
|
+
vpcSecurityGroupIds: string;
|
|
20
|
+
runtimePreference: RuntimePreference;
|
|
21
|
+
};
|
|
10
22
|
};
|
|
11
23
|
export declare const awsImplementation: ProviderSpecifics<AwsProvider>;
|
|
@@ -2,20 +2,32 @@
|
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.awsImplementation = void 0;
|
|
5
|
+
const client_1 = require("@remotion/serverless/client");
|
|
5
6
|
const node_events_1 = require("node:events");
|
|
6
7
|
const bucket_exists_1 = require("../api/bucket-exists");
|
|
7
8
|
const create_bucket_1 = require("../api/create-bucket");
|
|
9
|
+
const delete_function_1 = require("../api/delete-function");
|
|
10
|
+
const estimate_price_1 = require("../api/estimate-price");
|
|
8
11
|
const get_buckets_1 = require("../api/get-buckets");
|
|
12
|
+
const get_functions_1 = require("../api/get-functions");
|
|
13
|
+
const defaults_1 = require("../defaults");
|
|
9
14
|
const delete_file_1 = require("../io/delete-file");
|
|
10
15
|
const head_file_1 = require("../io/head-file");
|
|
11
16
|
const list_objects_1 = require("../io/list-objects");
|
|
12
17
|
const read_file_1 = require("../io/read-file");
|
|
13
18
|
const write_file_1 = require("../io/write-file");
|
|
19
|
+
const call_lambda_async_1 = require("../shared/call-lambda-async");
|
|
20
|
+
const call_lambda_streaming_1 = require("../shared/call-lambda-streaming");
|
|
21
|
+
const call_lambda_sync_1 = require("../shared/call-lambda-sync");
|
|
14
22
|
const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
|
|
23
|
+
const get_account_id_1 = require("../shared/get-account-id");
|
|
24
|
+
const get_aws_urls_1 = require("../shared/get-aws-urls");
|
|
25
|
+
const is_flaky_error_1 = require("../shared/is-flaky-error");
|
|
15
26
|
const lifecycle_rules_1 = require("../shared/lifecycle-rules");
|
|
16
27
|
const random_hash_1 = require("../shared/random-hash");
|
|
17
28
|
const get_current_region_1 = require("./helpers/get-current-region");
|
|
18
29
|
const get_folder_files_1 = require("./helpers/get-folder-files");
|
|
30
|
+
const get_output_url_from_metadata_1 = require("./helpers/get-output-url-from-metadata");
|
|
19
31
|
const make_aws_artifact_1 = require("./helpers/make-aws-artifact");
|
|
20
32
|
if (/^AWS_Lambda_nodejs(?:18|20)[.]x$/.test((_a = process.env.AWS_EXECUTION_ENV) !== null && _a !== void 0 ? _a : '') === true) {
|
|
21
33
|
process.env.FONTCONFIG_PATH = '/opt';
|
|
@@ -27,6 +39,20 @@ if (/^AWS_Lambda_nodejs(?:18|20)[.]x$/.test((_a = process.env.AWS_EXECUTION_ENV)
|
|
|
27
39
|
// @ts-expect-error
|
|
28
40
|
globalThis._dumpUnreleasedBuffers.setMaxListeners(201);
|
|
29
41
|
}
|
|
42
|
+
const validateDeleteAfter = (lifeCycleValue) => {
|
|
43
|
+
if (lifeCycleValue === null) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (lifeCycleValue === undefined) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (typeof lifeCycleValue !== 'string') {
|
|
50
|
+
throw new TypeError(`Expected life cycle value to be a string, got ${JSON.stringify(lifeCycleValue)}`);
|
|
51
|
+
}
|
|
52
|
+
if (!(lifeCycleValue in client_1.expiryDays)) {
|
|
53
|
+
throw new TypeError(`Expected deleteAfter value to be one of ${Object.keys(client_1.expiryDays).join(', ')}, got ${lifeCycleValue}`);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
30
56
|
exports.awsImplementation = {
|
|
31
57
|
getChromiumPath() {
|
|
32
58
|
return '/opt/bin/chromium';
|
|
@@ -46,4 +72,24 @@ exports.awsImplementation = {
|
|
|
46
72
|
printLoggingHelper: true,
|
|
47
73
|
getFolderFiles: get_folder_files_1.getFolderFiles,
|
|
48
74
|
makeArtifactWithDetails: make_aws_artifact_1.makeAwsArtifact,
|
|
75
|
+
validateDeleteAfter,
|
|
76
|
+
callFunctionAsync: call_lambda_async_1.callFunctionAsyncImplementation,
|
|
77
|
+
callFunctionStreaming: call_lambda_streaming_1.callFunctionWithStreamingImplementation,
|
|
78
|
+
callFunctionSync: call_lambda_sync_1.callFunctionSyncImplementation,
|
|
79
|
+
getEphemeralStorageForPriceCalculation() {
|
|
80
|
+
// We cannot determine the ephemeral storage size, so we
|
|
81
|
+
// overestimate the price, but will only have a miniscule effect (~0.2%)
|
|
82
|
+
return defaults_1.MAX_EPHEMERAL_STORAGE_IN_MB;
|
|
83
|
+
},
|
|
84
|
+
estimatePrice: estimate_price_1.estimatePrice,
|
|
85
|
+
getLoggingUrlForMethod: get_aws_urls_1.getCloudwatchMethodUrl,
|
|
86
|
+
getLoggingUrlForRendererFunction: get_aws_urls_1.getCloudwatchRendererUrl,
|
|
87
|
+
isFlakyError: is_flaky_error_1.isFlakyError,
|
|
88
|
+
getOutputUrl: get_output_url_from_metadata_1.getOutputUrlFromMetadata,
|
|
89
|
+
serverStorageProductName: () => 'S3',
|
|
90
|
+
getMaxStillInlinePayloadSize: () => 5000000,
|
|
91
|
+
getMaxNonInlinePayloadSizePerFunction: () => 200000,
|
|
92
|
+
getAccountId: get_account_id_1.getAccountIdImplementation,
|
|
93
|
+
deleteFunction: delete_function_1.deleteFunction,
|
|
94
|
+
getFunctions: get_functions_1.getFunctions,
|
|
49
95
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serverAwsImplementation = void 0;
|
|
4
|
+
const serverless_1 = require("@remotion/serverless");
|
|
5
|
+
const clean_tmpdir_1 = require("./helpers/clean-tmpdir");
|
|
6
|
+
const lifecycle_1 = require("./helpers/lifecycle");
|
|
7
|
+
const timer_1 = require("./helpers/timer");
|
|
8
|
+
exports.serverAwsImplementation = {
|
|
9
|
+
forgetBrowserEventLoop: serverless_1.forgetBrowserEventLoopImplementation,
|
|
10
|
+
getBrowserInstance: serverless_1.getBrowserInstanceImplementation,
|
|
11
|
+
timer: timer_1.timer,
|
|
12
|
+
generateRandomId: ({ deleteAfter, randomHashFn }) => {
|
|
13
|
+
return (0, lifecycle_1.generateRandomHashWithLifeCycleRule)({ deleteAfter, randomHashFn });
|
|
14
|
+
},
|
|
15
|
+
deleteTmpDir: () => Promise.resolve((0, clean_tmpdir_1.deleteTmpDir)()),
|
|
16
|
+
getCurrentFunctionName: () => {
|
|
17
|
+
if (!process.env.AWS_LAMBDA_FUNCTION_NAME) {
|
|
18
|
+
throw new Error('Expected AWS_LAMBDA_FUNCTION_NAME to be set');
|
|
19
|
+
}
|
|
20
|
+
return process.env.AWS_LAMBDA_FUNCTION_NAME;
|
|
21
|
+
},
|
|
22
|
+
getCurrentMemorySizeInMb: () => {
|
|
23
|
+
return Number(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.awsFullClientSpecifics = void 0;
|
|
4
|
+
const bundler_1 = require("@remotion/bundler");
|
|
5
|
+
const create_function_1 = require("../api/create-function");
|
|
6
|
+
const upload_dir_1 = require("../api/upload-dir");
|
|
7
|
+
const check_credentials_1 = require("../shared/check-credentials");
|
|
8
|
+
const read_dir_1 = require("../shared/read-dir");
|
|
9
|
+
exports.awsFullClientSpecifics = {
|
|
10
|
+
bundleSite: bundler_1.bundle,
|
|
11
|
+
id: '__remotion_full_client_specifics',
|
|
12
|
+
readDirectory: read_dir_1.readDirectory,
|
|
13
|
+
uploadDir: upload_dir_1.uploadDir,
|
|
14
|
+
createFunction: create_function_1.createFunction,
|
|
15
|
+
checkCredentials: check_credentials_1.checkCredentials,
|
|
16
|
+
};
|
|
@@ -29,8 +29,6 @@ const deleteAllFilesInAFolderRecursively = (path) => {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
const deleteTmpDir = () => {
|
|
32
|
-
|
|
33
|
-
deleteAllFilesInAFolderRecursively('/tmp');
|
|
34
|
-
}
|
|
32
|
+
deleteAllFilesInAFolderRecursively('/tmp');
|
|
35
33
|
};
|
|
36
34
|
exports.deleteTmpDir = deleteTmpDir;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCurrentRegionInFunctionImplementation = void 0;
|
|
4
|
-
const is_in_lambda_1 = require("../../shared/is-in-lambda");
|
|
5
4
|
const getCurrentRegionInFunctionImplementation = () => {
|
|
6
|
-
if (!(0, is_in_lambda_1.isInsideLambda)()) {
|
|
7
|
-
throw new Error('Should not call getCurrentRegionInFunctionImplementation() if not inside a lambda function');
|
|
8
|
-
}
|
|
9
5
|
if (!process.env.AWS_REGION) {
|
|
10
6
|
throw new Error('Expected process.env.AWS_REGION to be defined');
|
|
11
7
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export declare const getOutputUrlFromMetadata: <Provider extends CloudProvider>(renderMetadata: RenderMetadata<Provider>, bucketName: string, customCredentials: CustomCredentials<Provider> | null, currentRegion: Provider["region"]) => {
|
|
5
|
-
url: string;
|
|
6
|
-
key: string;
|
|
7
|
-
};
|
|
1
|
+
import type { GetOutputUrl } from '@remotion/serverless';
|
|
2
|
+
import type { AwsProvider } from '../aws-implementation';
|
|
3
|
+
export declare const getOutputUrlFromMetadata: GetOutputUrl<AwsProvider>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getOutputUrlFromMetadata = void 0;
|
|
4
4
|
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const getOutputUrlFromMetadata = (renderMetadata, bucketName, customCredentials, currentRegion) => {
|
|
5
|
+
const getOutputUrlFromMetadata = ({ renderMetadata, bucketName, customCredentials, currentRegion, }) => {
|
|
6
6
|
const { key, renderBucketName } = (0, client_1.getExpectedOutName)(renderMetadata, bucketName, customCredentials);
|
|
7
7
|
return {
|
|
8
8
|
url: `https://s3.${currentRegion}.amazonaws.com/${renderBucketName}/${key}`,
|
|
@@ -2,5 +2,7 @@ import type { LifecycleRule } from '@aws-sdk/client-s3';
|
|
|
2
2
|
import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
|
|
3
3
|
import type { DeleteAfter } from '@remotion/serverless/client';
|
|
4
4
|
export declare const getLifeCycleRules: () => LifecycleRule[];
|
|
5
|
-
export declare const generateRandomHashWithLifeCycleRule: <Provider extends CloudProvider>(deleteAfter
|
|
6
|
-
|
|
5
|
+
export declare const generateRandomHashWithLifeCycleRule: <Provider extends CloudProvider>({ deleteAfter, randomHashFn, }: {
|
|
6
|
+
deleteAfter: DeleteAfter | null;
|
|
7
|
+
randomHashFn: ProviderSpecifics<Provider>["randomHash"];
|
|
8
|
+
}) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.generateRandomHashWithLifeCycleRule = exports.getLifeCycleRules = void 0;
|
|
4
4
|
const client_1 = require("@remotion/serverless/client");
|
|
5
5
|
const getEnabledLifeCycleRule = ({ key, value, }) => {
|
|
6
6
|
return {
|
|
@@ -18,22 +18,7 @@ const getLifeCycleRules = () => {
|
|
|
18
18
|
return Object.entries(client_1.expiryDays).map(([key, value]) => getEnabledLifeCycleRule({ key, value }));
|
|
19
19
|
};
|
|
20
20
|
exports.getLifeCycleRules = getLifeCycleRules;
|
|
21
|
-
const generateRandomHashWithLifeCycleRule = (deleteAfter,
|
|
22
|
-
return [deleteAfter,
|
|
21
|
+
const generateRandomHashWithLifeCycleRule = ({ deleteAfter, randomHashFn, }) => {
|
|
22
|
+
return [deleteAfter, randomHashFn()].filter(client_1.truthy).join('-');
|
|
23
23
|
};
|
|
24
24
|
exports.generateRandomHashWithLifeCycleRule = generateRandomHashWithLifeCycleRule;
|
|
25
|
-
const validateDeleteAfter = (lifeCycleValue) => {
|
|
26
|
-
if (lifeCycleValue === null) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (lifeCycleValue === undefined) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (typeof lifeCycleValue !== 'string') {
|
|
33
|
-
throw new TypeError(`Expected life cycle value to be a string, got ${JSON.stringify(lifeCycleValue)}`);
|
|
34
|
-
}
|
|
35
|
-
if (!(lifeCycleValue in client_1.expiryDays)) {
|
|
36
|
-
throw new TypeError(`Expected deleteAfter value to be one of ${Object.keys(client_1.expiryDays).join(', ')}, got ${lifeCycleValue}`);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
exports.validateDeleteAfter = validateDeleteAfter;
|