@remotion/lambda 4.0.256 → 4.0.258
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/dist/cli/get-aws-region.js +2 -1
- package/dist/cli/index.js +5 -4
- package/dist/shared/check-credentials.js +7 -6
- package/dist/shared/get-credentials.js +25 -23
- package/dist/shared/get-env-variable.d.ts +1 -0
- package/dist/shared/get-env-variable.js +15 -0
- package/dist/shared/get-service-client.js +16 -15
- package/dist/shared/is-likely-to-have-aws-profile.js +7 -1
- package/package.json +21 -21
- 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 -595
- 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 -112
- package/dist/functions/still.d.ts +0 -19
- package/dist/functions/still.js +0 -329
- 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/call-lambda.js +0 -149
- 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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAwsRegion = void 0;
|
|
4
4
|
const constants_1 = require("../shared/constants");
|
|
5
|
+
const get_env_variable_1 = require("../shared/get-env-variable");
|
|
5
6
|
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
6
7
|
const args_1 = require("./args");
|
|
7
8
|
const getAwsRegion = () => {
|
|
@@ -10,7 +11,7 @@ const getAwsRegion = () => {
|
|
|
10
11
|
(0, validate_aws_region_1.validateAwsRegion)(args_1.parsedLambdaCli.region);
|
|
11
12
|
return args_1.parsedLambdaCli.region;
|
|
12
13
|
}
|
|
13
|
-
const envVariable = (_a =
|
|
14
|
+
const envVariable = (_a = (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_REGION')) !== null && _a !== void 0 ? _a : (0, get_env_variable_1.getEnvVariable)('AWS_REGION');
|
|
14
15
|
if (envVariable) {
|
|
15
16
|
(0, validate_aws_region_1.validateAwsRegion)(envVariable);
|
|
16
17
|
return envVariable;
|
package/dist/cli/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const suggested_policy_1 = require("../api/iam-validation/suggested-policy");
|
|
|
8
8
|
const defaults_1 = require("../defaults");
|
|
9
9
|
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
10
10
|
const full_client_implementation_1 = require("../functions/full-client-implementation");
|
|
11
|
+
const get_env_variable_1 = require("../shared/get-env-variable");
|
|
11
12
|
const args_1 = require("./args");
|
|
12
13
|
const compositions_1 = require("./commands/compositions");
|
|
13
14
|
const functions_1 = require("./commands/functions");
|
|
@@ -159,10 +160,10 @@ AWS returned an "TooManyRequestsException" error message which could mean you re
|
|
|
159
160
|
`.trim());
|
|
160
161
|
}
|
|
161
162
|
if ((_c = error.stack) === null || _c === void 0 ? void 0 : _c.includes('The security token included in the request is invalid')) {
|
|
162
|
-
const keyButDoesntStartWithAki =
|
|
163
|
-
!
|
|
164
|
-
const pureKeyButDoesntStartWithAki =
|
|
165
|
-
!
|
|
163
|
+
const keyButDoesntStartWithAki = (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID') &&
|
|
164
|
+
!(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID').startsWith('AKI');
|
|
165
|
+
const pureKeyButDoesntStartWithAki = (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
|
|
166
|
+
!(0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID').startsWith('AKI');
|
|
166
167
|
if (keyButDoesntStartWithAki || pureKeyButDoesntStartWithAki) {
|
|
167
168
|
log_1.Log.error({ indent: false, logLevel }, `
|
|
168
169
|
AWS returned an error message "The security token included in the request is invalid". A possible reason is that your AWS Access key ID is set but doesn't start with "AKI", which it usually should. The original message is:
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.checkCredentials = void 0;
|
|
4
4
|
const client_1 = require("@remotion/serverless/client");
|
|
5
5
|
const is_cli_1 = require("../cli/is-cli");
|
|
6
|
+
const get_env_variable_1 = require("./get-env-variable");
|
|
6
7
|
const is_likely_to_have_aws_profile_1 = require("./is-likely-to-have-aws-profile");
|
|
7
8
|
const messageForVariable = (variable) => {
|
|
8
9
|
return [
|
|
@@ -17,21 +18,21 @@ const messageForVariable = (variable) => {
|
|
|
17
18
|
.join('\n');
|
|
18
19
|
};
|
|
19
20
|
const checkCredentials = () => {
|
|
20
|
-
if (
|
|
21
|
+
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')) {
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
|
-
if (
|
|
24
|
+
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE') || (0, get_env_variable_1.getEnvVariable)('AWS_PROFILE')) {
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
27
|
if ((0, is_likely_to_have_aws_profile_1.isLikelyToHaveAwsProfile)()) {
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
|
-
if (!
|
|
30
|
-
!
|
|
30
|
+
if (!(0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
|
|
31
|
+
!(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID')) {
|
|
31
32
|
throw new Error(messageForVariable('AWS_ACCESS_KEY_ID or REMOTION_AWS_ACCESS_KEY_ID'));
|
|
32
33
|
}
|
|
33
|
-
if (!
|
|
34
|
-
!
|
|
34
|
+
if (!(0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY') &&
|
|
35
|
+
!(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY')) {
|
|
35
36
|
throw new Error(messageForVariable('AWS_SECRET_ACCESS_KEY or REMOTION_AWS_SECRET_ACCESS_KEY'));
|
|
36
37
|
}
|
|
37
38
|
};
|
|
@@ -2,50 +2,52 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCredentials = void 0;
|
|
4
4
|
const credential_providers_1 = require("@aws-sdk/credential-providers");
|
|
5
|
+
const get_env_variable_1 = require("./get-env-variable");
|
|
5
6
|
const is_in_lambda_1 = require("./is-in-lambda");
|
|
6
7
|
const getCredentials = () => {
|
|
7
8
|
if ((0, is_in_lambda_1.isInsideLambda)()) {
|
|
8
9
|
return undefined;
|
|
9
10
|
}
|
|
10
|
-
if (
|
|
11
|
+
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE')) {
|
|
11
12
|
return (0, credential_providers_1.fromIni)({
|
|
12
|
-
profile:
|
|
13
|
+
profile: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE'),
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID') &&
|
|
17
|
+
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY') &&
|
|
18
|
+
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SESSION_TOKEN')) {
|
|
18
19
|
return {
|
|
19
|
-
accessKeyId:
|
|
20
|
-
secretAccessKey:
|
|
21
|
-
sessionToken:
|
|
20
|
+
accessKeyId: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID'),
|
|
21
|
+
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY'),
|
|
22
|
+
sessionToken: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SESSION_TOKEN'),
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
|
-
if (
|
|
25
|
-
|
|
25
|
+
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID') &&
|
|
26
|
+
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY')) {
|
|
26
27
|
return {
|
|
27
|
-
accessKeyId:
|
|
28
|
-
secretAccessKey:
|
|
28
|
+
accessKeyId: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID'),
|
|
29
|
+
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY'),
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
|
-
if (
|
|
32
|
+
if ((0, get_env_variable_1.getEnvVariable)('AWS_PROFILE')) {
|
|
32
33
|
return (0, credential_providers_1.fromIni)({
|
|
33
|
-
profile:
|
|
34
|
+
profile: (0, get_env_variable_1.getEnvVariable)('AWS_PROFILE'),
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
if ((0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
|
|
38
|
+
(0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY') &&
|
|
39
|
+
(0, get_env_variable_1.getEnvVariable)('AWS_SESSION_TOKEN')) {
|
|
39
40
|
return {
|
|
40
|
-
accessKeyId:
|
|
41
|
-
secretAccessKey:
|
|
42
|
-
sessionToken:
|
|
41
|
+
accessKeyId: (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID'),
|
|
42
|
+
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY'),
|
|
43
|
+
sessionToken: (0, get_env_variable_1.getEnvVariable)('AWS_SESSION_TOKEN'),
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
|
-
if (
|
|
46
|
+
if ((0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
|
|
47
|
+
(0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY')) {
|
|
46
48
|
return {
|
|
47
|
-
accessKeyId:
|
|
48
|
-
secretAccessKey:
|
|
49
|
+
accessKeyId: (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID'),
|
|
50
|
+
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY'),
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
return undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getEnvVariable: (name: string) => string | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnvVariable = void 0;
|
|
4
|
+
const getEnvVariable = (name) => {
|
|
5
|
+
if (typeof process !== 'undefined' &&
|
|
6
|
+
typeof process.env !== 'undefined' &&
|
|
7
|
+
process.env[name]) {
|
|
8
|
+
return process.env[name];
|
|
9
|
+
}
|
|
10
|
+
if (typeof Deno !== 'undefined' && Deno.env.has(name)) {
|
|
11
|
+
return Deno.env.get(name);
|
|
12
|
+
}
|
|
13
|
+
return undefined;
|
|
14
|
+
};
|
|
15
|
+
exports.getEnvVariable = getEnvVariable;
|
|
@@ -11,35 +11,36 @@ const client_1 = require("@remotion/serverless/client");
|
|
|
11
11
|
const no_react_1 = require("remotion/no-react");
|
|
12
12
|
const check_credentials_1 = require("./check-credentials");
|
|
13
13
|
const get_credentials_1 = require("./get-credentials");
|
|
14
|
+
const get_env_variable_1 = require("./get-env-variable");
|
|
14
15
|
const getCredentialsHash = ({ customCredentials, region, service, forcePathStyle, }) => {
|
|
15
16
|
const hashComponents = {};
|
|
16
|
-
if (
|
|
17
|
+
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')) {
|
|
17
18
|
hashComponents.credentials = {
|
|
18
19
|
credentialsSkipped: true,
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
|
-
else if (
|
|
22
|
+
else if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE')) {
|
|
22
23
|
hashComponents.credentials = {
|
|
23
|
-
awsProfile:
|
|
24
|
+
awsProfile: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE'),
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
else if (
|
|
27
|
-
|
|
27
|
+
else if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID') &&
|
|
28
|
+
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY')) {
|
|
28
29
|
hashComponents.credentials = {
|
|
29
|
-
accessKeyId:
|
|
30
|
-
secretAccessKey:
|
|
30
|
+
accessKeyId: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID'),
|
|
31
|
+
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY'),
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
|
-
else if (
|
|
34
|
+
else if ((0, get_env_variable_1.getEnvVariable)('AWS_PROFILE')) {
|
|
34
35
|
hashComponents.credentials = {
|
|
35
|
-
awsProfile:
|
|
36
|
+
awsProfile: (0, get_env_variable_1.getEnvVariable)('AWS_PROFILE'),
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
else if (
|
|
39
|
-
|
|
39
|
+
else if ((0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
|
|
40
|
+
(0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY')) {
|
|
40
41
|
hashComponents.credentials = {
|
|
41
|
-
accessKeyId:
|
|
42
|
-
secretAccessKey:
|
|
42
|
+
accessKeyId: (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID'),
|
|
43
|
+
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY'),
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
hashComponents.customCredentials = customCredentials;
|
|
@@ -99,7 +100,7 @@ const getServiceClient = ({ region, service, customCredentials, forcePathStyle,
|
|
|
99
100
|
endpoint: customCredentials.endpoint,
|
|
100
101
|
requestHandler: lambdaOptions,
|
|
101
102
|
})
|
|
102
|
-
:
|
|
103
|
+
: (0, get_env_variable_1.getEnvVariable)('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')
|
|
103
104
|
? new Client({
|
|
104
105
|
region,
|
|
105
106
|
requestHandler: lambdaOptions,
|
|
@@ -109,7 +110,7 @@ const getServiceClient = ({ region, service, customCredentials, forcePathStyle,
|
|
|
109
110
|
credentials: (0, get_credentials_1.getCredentials)(),
|
|
110
111
|
requestHandler: lambdaOptions,
|
|
111
112
|
});
|
|
112
|
-
if (
|
|
113
|
+
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_DISABLE_AWS_CLIENT_CACHE')) {
|
|
113
114
|
return client;
|
|
114
115
|
}
|
|
115
116
|
_clients[key] = client;
|
|
@@ -4,6 +4,7 @@ exports.isLikelyToHaveAwsProfile = void 0;
|
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const os_1 = require("os");
|
|
6
6
|
const path_1 = require("path");
|
|
7
|
+
const get_env_variable_1 = require("./get-env-variable");
|
|
7
8
|
const homeDirCache = {};
|
|
8
9
|
const getHomeDirCacheKey = () => {
|
|
9
10
|
// geteuid is only available on POSIX platforms (i.e. not Windows or Android).
|
|
@@ -28,10 +29,15 @@ const getHomeDir = () => {
|
|
|
28
29
|
const ENV_CREDENTIALS_PATH = 'AWS_SHARED_CREDENTIALS_FILE';
|
|
29
30
|
// Logic is inline to https://github.com/smithy-lang/smithy-typescript/blob/main/packages/shared-ini-file-loader/src/getCredentialsFilepath.ts#L7
|
|
30
31
|
const pathOfCredentialsFile = () => {
|
|
31
|
-
return (
|
|
32
|
+
return ((0, get_env_variable_1.getEnvVariable)(ENV_CREDENTIALS_PATH) ||
|
|
32
33
|
(0, path_1.join)(getHomeDir(), '.aws', 'credentials'));
|
|
33
34
|
};
|
|
34
35
|
const isLikelyToHaveAwsProfile = () => {
|
|
36
|
+
// Supabase uses Deno and does not support readFile
|
|
37
|
+
// https://github.com/remotion-dev/remotion/issues/4844
|
|
38
|
+
if (typeof Deno !== 'undefined') {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
35
41
|
const credentialsFile = pathOfCredentialsFile();
|
|
36
42
|
try {
|
|
37
43
|
const content = (0, fs_1.readFileSync)(credentialsFile, 'utf-8');
|
package/package.json
CHANGED
|
@@ -3,32 +3,32 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/lambda",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.258",
|
|
7
7
|
"description": "Render Remotion videos on AWS Lambda",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@aws-sdk/client-cloudwatch-logs": "3.
|
|
14
|
-
"@aws-sdk/client-iam": "3.
|
|
15
|
-
"@aws-sdk/client-lambda": "3.
|
|
16
|
-
"@aws-sdk/client-s3": "3.
|
|
17
|
-
"@aws-sdk/client-service-quotas": "3.
|
|
18
|
-
"@aws-sdk/client-sts": "3.
|
|
19
|
-
"@aws-sdk/credential-providers": "3.
|
|
20
|
-
"@aws-sdk/lib-storage": "3.
|
|
21
|
-
"@aws-sdk/s3-request-presigner": "3.
|
|
13
|
+
"@aws-sdk/client-cloudwatch-logs": "3.738.0",
|
|
14
|
+
"@aws-sdk/client-iam": "3.738.0",
|
|
15
|
+
"@aws-sdk/client-lambda": "3.738.0",
|
|
16
|
+
"@aws-sdk/client-s3": "3.738.0",
|
|
17
|
+
"@aws-sdk/client-service-quotas": "3.738.0",
|
|
18
|
+
"@aws-sdk/client-sts": "3.738.0",
|
|
19
|
+
"@aws-sdk/credential-providers": "3.738.0",
|
|
20
|
+
"@aws-sdk/lib-storage": "3.738.0",
|
|
21
|
+
"@aws-sdk/s3-request-presigner": "3.738.0",
|
|
22
22
|
"@smithy/abort-controller": "3.1.1",
|
|
23
23
|
"mime-types": "2.1.34",
|
|
24
24
|
"zod": "3.22.3",
|
|
25
|
-
"@remotion/
|
|
26
|
-
"@remotion/
|
|
27
|
-
"@remotion/
|
|
28
|
-
"remotion": "4.0.
|
|
29
|
-
"@remotion/
|
|
30
|
-
"@remotion/
|
|
31
|
-
"
|
|
25
|
+
"@remotion/cli": "4.0.258",
|
|
26
|
+
"@remotion/bundler": "4.0.258",
|
|
27
|
+
"@remotion/renderer": "4.0.258",
|
|
28
|
+
"@remotion/serverless": "4.0.258",
|
|
29
|
+
"@remotion/streaming": "4.0.258",
|
|
30
|
+
"@remotion/studio-server": "4.0.258",
|
|
31
|
+
"remotion": "4.0.258"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/express": "^5.0.0",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"next": "15.1.2",
|
|
41
41
|
"pureimage": "0.4.13",
|
|
42
42
|
"zip-lib": "^0.7.2",
|
|
43
|
-
"@remotion/
|
|
44
|
-
"@remotion/
|
|
45
|
-
"@remotion/
|
|
43
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.258",
|
|
44
|
+
"@remotion/eslint-config-internal": "4.0.258",
|
|
45
|
+
"@remotion/bundler": "4.0.258"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@remotion/bundler": "4.0.
|
|
48
|
+
"@remotion/bundler": "4.0.258"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cleanItems = void 0;
|
|
4
|
-
const mock_store_1 = require("../../test/mocks/mock-store");
|
|
5
|
-
const cleanItems = (input) => {
|
|
6
|
-
var _a, _b;
|
|
7
|
-
for (const item of input.list) {
|
|
8
|
-
(_a = input.onBeforeItemDeleted) === null || _a === void 0 ? void 0 : _a.call(input, {
|
|
9
|
-
bucketName: input.bucket,
|
|
10
|
-
itemName: item,
|
|
11
|
-
});
|
|
12
|
-
(0, mock_store_1.mockDeleteS3File)({
|
|
13
|
-
key: item,
|
|
14
|
-
bucketName: input.bucket,
|
|
15
|
-
region: input.region,
|
|
16
|
-
});
|
|
17
|
-
(_b = input.onAfterItemDeleted) === null || _b === void 0 ? void 0 : _b.call(input, {
|
|
18
|
-
bucketName: input.bucket,
|
|
19
|
-
itemName: item,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return Promise.resolve([]);
|
|
23
|
-
};
|
|
24
|
-
exports.cleanItems = cleanItems;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createFunction = void 0;
|
|
4
|
-
const version_1 = require("remotion/version");
|
|
5
|
-
const defaults_1 = require("../../defaults");
|
|
6
|
-
const mock_functions_1 = require("../mock-functions");
|
|
7
|
-
const createFunction = (input) => {
|
|
8
|
-
if (!input.alreadyCreated) {
|
|
9
|
-
(0, mock_functions_1.addFunction)({
|
|
10
|
-
functionName: input.functionName,
|
|
11
|
-
memorySizeInMb: defaults_1.DEFAULT_MEMORY_SIZE,
|
|
12
|
-
timeoutInSeconds: input.timeoutInSeconds,
|
|
13
|
-
version: version_1.VERSION,
|
|
14
|
-
diskSizeInMb: defaults_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB,
|
|
15
|
-
}, input.region);
|
|
16
|
-
}
|
|
17
|
-
return Promise.resolve({
|
|
18
|
-
FunctionName: input.functionName,
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
exports.createFunction = createFunction;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteFunction = void 0;
|
|
4
|
-
const mock_functions_1 = require("../mock-functions");
|
|
5
|
-
const deleteFunction = ({ region, functionName }) => {
|
|
6
|
-
(0, mock_functions_1.deleteMockFunction)(functionName, region);
|
|
7
|
-
return Promise.resolve();
|
|
8
|
-
};
|
|
9
|
-
exports.deleteFunction = deleteFunction;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFunctions = void 0;
|
|
4
|
-
const version_1 = require("remotion/version");
|
|
5
|
-
const mock_functions_1 = require("../mock-functions");
|
|
6
|
-
const getFunctions = ({ region, compatibleOnly }) => {
|
|
7
|
-
return Promise.resolve((0, mock_functions_1.getAllMockFunctions)(region, compatibleOnly ? version_1.VERSION : null));
|
|
8
|
-
};
|
|
9
|
-
exports.getFunctions = getFunctions;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uploadDir = exports.getDirFiles = void 0;
|
|
4
|
-
const mock_store_1 = require("../../test/mocks/mock-store");
|
|
5
|
-
const getDirFiles = (dir) => {
|
|
6
|
-
if (dir === '/path/to/bundle-1') {
|
|
7
|
-
return [
|
|
8
|
-
{
|
|
9
|
-
name: 'bundle.js',
|
|
10
|
-
content: 'console.log("Hello World")',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'styles.css',
|
|
14
|
-
content: 'body {background: red}',
|
|
15
|
-
},
|
|
16
|
-
];
|
|
17
|
-
}
|
|
18
|
-
if (dir === '/path/to/bundle-2') {
|
|
19
|
-
return [
|
|
20
|
-
{
|
|
21
|
-
name: 'bundle.js',
|
|
22
|
-
content: 'console.log("Hello World")',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'styles2.css',
|
|
26
|
-
content: 'body {background: red}',
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
}
|
|
30
|
-
throw new Error('could not get dir for ' + dir);
|
|
31
|
-
};
|
|
32
|
-
exports.getDirFiles = getDirFiles;
|
|
33
|
-
const uploadDir = (input) => {
|
|
34
|
-
const files = (0, exports.getDirFiles)(input.localDir);
|
|
35
|
-
for (const file of files) {
|
|
36
|
-
(0, mock_store_1.writeMockS3File)({
|
|
37
|
-
privacy: input.privacy,
|
|
38
|
-
bucketName: input.bucket,
|
|
39
|
-
body: file.content,
|
|
40
|
-
// Should not use path.join here because on Windows it's not / separator
|
|
41
|
-
key: [input.keyPrefix, file.name].join('/'),
|
|
42
|
-
region: input.region,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return Promise.resolve();
|
|
46
|
-
};
|
|
47
|
-
exports.uploadDir = uploadDir;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { AwsRegion } from '../regions';
|
|
2
|
-
import type { FunctionInfo } from './get-function-info';
|
|
3
|
-
export declare let mockFunctionsStore: (FunctionInfo & {
|
|
4
|
-
region: AwsRegion;
|
|
5
|
-
version: string;
|
|
6
|
-
})[];
|
|
7
|
-
export declare const addFunction: (fn: FunctionInfo, region: AwsRegion) => void;
|
|
8
|
-
export declare const deleteMockFunction: (name: string, region: string) => void;
|
|
9
|
-
export declare const findFunction: (name: string, region: string) => (FunctionInfo & {
|
|
10
|
-
region: AwsRegion;
|
|
11
|
-
version: string;
|
|
12
|
-
}) | undefined;
|
|
13
|
-
export declare const getAllMockFunctions: (region: string, version: string | null) => (FunctionInfo & {
|
|
14
|
-
region: AwsRegion;
|
|
15
|
-
version: string;
|
|
16
|
-
})[];
|
|
17
|
-
export declare const cleanFnStore: () => void;
|
|
18
|
-
export declare const markFunctionAsIncompatible: (functionName: string) => void;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.markFunctionAsIncompatible = exports.cleanFnStore = exports.getAllMockFunctions = exports.findFunction = exports.deleteMockFunction = exports.addFunction = exports.mockFunctionsStore = void 0;
|
|
4
|
-
exports.mockFunctionsStore = [];
|
|
5
|
-
const addFunction = (fn, region) => {
|
|
6
|
-
exports.mockFunctionsStore.push({
|
|
7
|
-
...fn,
|
|
8
|
-
region,
|
|
9
|
-
version: fn.version,
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
exports.addFunction = addFunction;
|
|
13
|
-
const deleteMockFunction = (name, region) => {
|
|
14
|
-
exports.mockFunctionsStore = exports.mockFunctionsStore.filter((fn) => fn.functionName !== name && fn.region !== region);
|
|
15
|
-
};
|
|
16
|
-
exports.deleteMockFunction = deleteMockFunction;
|
|
17
|
-
const findFunction = (name, region) => {
|
|
18
|
-
return exports.mockFunctionsStore.find((n) => n.functionName === name && region === n.region);
|
|
19
|
-
};
|
|
20
|
-
exports.findFunction = findFunction;
|
|
21
|
-
const getAllMockFunctions = (region, version) => {
|
|
22
|
-
return exports.mockFunctionsStore.filter((f) => f.region === region && (version ? f.version === version : true));
|
|
23
|
-
};
|
|
24
|
-
exports.getAllMockFunctions = getAllMockFunctions;
|
|
25
|
-
const cleanFnStore = () => {
|
|
26
|
-
exports.mockFunctionsStore = [];
|
|
27
|
-
};
|
|
28
|
-
exports.cleanFnStore = cleanFnStore;
|
|
29
|
-
const markFunctionAsIncompatible = (functionName) => {
|
|
30
|
-
for (const fn of exports.mockFunctionsStore) {
|
|
31
|
-
if (fn.functionName === functionName) {
|
|
32
|
-
fn.version = '2021-06-23';
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
exports.markFunctionAsIncompatible = markFunctionAsIncompatible;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const quit: (exitCode: number) => never;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.planFrameRanges = void 0;
|
|
4
|
-
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const planFrameRanges = ({ framesPerLambda, frameRange, everyNthFrame, }) => {
|
|
6
|
-
const framesToRender = renderer_1.RenderInternals.getFramesToRender(frameRange, everyNthFrame);
|
|
7
|
-
const chunkCount = Math.ceil(framesToRender.length / framesPerLambda);
|
|
8
|
-
const firstFrame = frameRange[0];
|
|
9
|
-
return {
|
|
10
|
-
chunks: new Array(chunkCount).fill(1).map((_, i) => {
|
|
11
|
-
const start = i * framesPerLambda * everyNthFrame + firstFrame;
|
|
12
|
-
const end = Math.min(framesToRender[framesToRender.length - 1], (i + 1) * framesPerLambda * everyNthFrame - 1 + firstFrame);
|
|
13
|
-
return [start, end];
|
|
14
|
-
}),
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
exports.planFrameRanges = planFrameRanges;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { forgetBrowserEventLoop as originalForget, getBrowserInstance as originalGetBrowserInstance } from '@remotion/serverless';
|
|
2
|
-
export declare const getBrowserInstance: typeof originalGetBrowserInstance;
|
|
3
|
-
export declare const forgetBrowserEventLoop: typeof originalForget;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.forgetBrowserEventLoop = exports.getBrowserInstance = void 0;
|
|
4
|
-
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
let _browserInstance;
|
|
6
|
-
const getBrowserInstance = async () => {
|
|
7
|
-
_browserInstance = await (0, renderer_1.openBrowser)('chrome');
|
|
8
|
-
return { instance: _browserInstance, configurationString: 'chrome' };
|
|
9
|
-
};
|
|
10
|
-
exports.getBrowserInstance = getBrowserInstance;
|
|
11
|
-
const forgetBrowserEventLoop = () => { };
|
|
12
|
-
exports.forgetBrowserEventLoop = forgetBrowserEventLoop;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { setCurrentRequestId as originalSetCurrentRequestId, startLeakDetection as originalStartLeakDetection, stopLeakDetection as originalStopLeakDetection } from '../leak-detection';
|
|
2
|
-
export declare const stopLeakDetection: typeof originalStopLeakDetection;
|
|
3
|
-
export declare const setCurrentRequestId: typeof originalSetCurrentRequestId;
|
|
4
|
-
export declare const startLeakDetection: typeof originalStartLeakDetection;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startLeakDetection = exports.setCurrentRequestId = exports.stopLeakDetection = void 0;
|
|
4
|
-
const stopLeakDetection = () => { };
|
|
5
|
-
exports.stopLeakDetection = stopLeakDetection;
|
|
6
|
-
const setCurrentRequestId = () => { };
|
|
7
|
-
exports.setCurrentRequestId = setCurrentRequestId;
|
|
8
|
-
const startLeakDetection = () => { };
|
|
9
|
-
exports.startLeakDetection = startLeakDetection;
|