@remotion/lambda 3.3.8 → 3.3.9
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/api/deploy-site.js +0 -5
- package/dist/api/get-or-create-bucket.js +0 -5
- package/dist/api/iam-validation/simulate.js +7 -0
- package/dist/api/iam-validation/user-permissions.js +0 -2
- package/dist/cli/commands/sites/create.js +0 -2
- package/dist/cli/helpers/progress-bar.d.ts +1 -2
- package/dist/cli/helpers/progress-bar.js +2 -2
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +4 -1
- package/dist/functions/helpers/get-progress.js +3 -1
- package/dist/shared/aws-clients.js +46 -12
- package/dist/shared/check-credentials.js +3 -0
- package/dist/shared/constants.d.ts +1 -0
- package/dist/shared/get-cloudwatch-stream-url.d.ts +8 -0
- package/dist/shared/get-cloudwatch-stream-url.js +7 -0
- package/dist/shared/invoke-webhook.d.ts +0 -2
- package/package.json +7 -6
- package/remotionlambda.zip +0 -0
- package/dist/functions/helpers/get-chunk-progress.d.ts +0 -0
- package/dist/functions/helpers/get-chunk-progress.js +0 -1
- package/dist/shared/get-chunk-progress.d.ts +0 -0
- package/dist/shared/get-chunk-progress.js +0 -1
package/dist/api/deploy-site.js
CHANGED
|
@@ -12,7 +12,6 @@ const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
|
12
12
|
const validate_bucketname_1 = require("../shared/validate-bucketname");
|
|
13
13
|
const validate_site_name_1 = require("../shared/validate-site-name");
|
|
14
14
|
const bucket_exists_1 = require("./bucket-exists");
|
|
15
|
-
const enable_s3_website_1 = require("./enable-s3-website");
|
|
16
15
|
const upload_dir_1 = require("./upload-dir");
|
|
17
16
|
/**
|
|
18
17
|
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
@@ -77,10 +76,6 @@ const deploySite = async ({ bucketName, entryPoint, siteName, options, region, }
|
|
|
77
76
|
region,
|
|
78
77
|
});
|
|
79
78
|
})),
|
|
80
|
-
(0, enable_s3_website_1.enableS3Website)({
|
|
81
|
-
region,
|
|
82
|
-
bucketName,
|
|
83
|
-
}),
|
|
84
79
|
]);
|
|
85
80
|
return {
|
|
86
81
|
serveUrl: (0, make_s3_url_1.makeS3ServeUrl)({ bucketName, subFolder, region }),
|
|
@@ -4,7 +4,6 @@ exports.getOrCreateBucket = void 0;
|
|
|
4
4
|
const constants_1 = require("../shared/constants");
|
|
5
5
|
const random_hash_1 = require("../shared/random-hash");
|
|
6
6
|
const create_bucket_1 = require("./create-bucket");
|
|
7
|
-
const enable_s3_website_1 = require("./enable-s3-website");
|
|
8
7
|
const get_buckets_1 = require("./get-buckets");
|
|
9
8
|
/**
|
|
10
9
|
* @description Creates a bucket for Remotion Lambda in your S3 account. If one already exists, it will get returned instead.
|
|
@@ -28,10 +27,6 @@ const getOrCreateBucket = async (options) => {
|
|
|
28
27
|
region: options.region,
|
|
29
28
|
});
|
|
30
29
|
(_b = options.onBucketEnsured) === null || _b === void 0 ? void 0 : _b.call(options);
|
|
31
|
-
await (0, enable_s3_website_1.enableS3Website)({
|
|
32
|
-
region: options.region,
|
|
33
|
-
bucketName,
|
|
34
|
-
});
|
|
35
30
|
return { bucketName };
|
|
36
31
|
};
|
|
37
32
|
exports.getOrCreateBucket = getOrCreateBucket;
|
|
@@ -39,6 +39,13 @@ const simulatePermissions = async (options) => {
|
|
|
39
39
|
if (callerIdentityArnType === 'iam' && callerIdentityArnComponents[3] === 'user') {
|
|
40
40
|
callerArn = callerIdentity.Arn;
|
|
41
41
|
}
|
|
42
|
+
else if (callerIdentityArnType === 'sts' && callerIdentityArnComponents[3] === 'assumed-role') {
|
|
43
|
+
const assumedRoleComponents = callerIdentityArnComponents[4].match(/\/([^/]+)\/(.*)/);
|
|
44
|
+
if (!assumedRoleComponents) {
|
|
45
|
+
throw new Error('Unsupported AWS Caller Identity as Assumed-Role ARN detected');
|
|
46
|
+
}
|
|
47
|
+
callerArn = `arn:aws:iam::${callerIdentityArnComponents[2]}:role/${assumedRoleComponents[1]}`;
|
|
48
|
+
}
|
|
42
49
|
else {
|
|
43
50
|
throw new Error('Unsupported AWS Caller Identity ARN detected');
|
|
44
51
|
}
|
|
@@ -37,8 +37,6 @@ exports.requiredPermissions = [
|
|
|
37
37
|
aws_policies_1.s3.GetBucketLocation,
|
|
38
38
|
aws_policies_1.s3.PutBucketAcl,
|
|
39
39
|
aws_policies_1.s3.DeleteBucket,
|
|
40
|
-
aws_policies_1.s3.PutBucketWebsite,
|
|
41
|
-
aws_policies_1.s3.DeleteBucketWebsite,
|
|
42
40
|
],
|
|
43
41
|
resource: [`arn:aws:s3:::${constants_1.REMOTION_BUCKET_PREFIX}*`],
|
|
44
42
|
},
|
|
@@ -52,7 +52,6 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
|
|
|
52
52
|
bucketProgress: {
|
|
53
53
|
bucketCreated: false,
|
|
54
54
|
doneIn: null,
|
|
55
|
-
websiteEnabled: false,
|
|
56
55
|
},
|
|
57
56
|
deployProgress: {
|
|
58
57
|
doneIn: null,
|
|
@@ -76,7 +75,6 @@ const sitesCreateSubcommand = async (args, remotionRoot) => {
|
|
|
76
75
|
updateProgress();
|
|
77
76
|
},
|
|
78
77
|
});
|
|
79
|
-
multiProgress.bucketProgress.websiteEnabled = true;
|
|
80
78
|
multiProgress.bucketProgress.doneIn = Date.now() - bucketStart;
|
|
81
79
|
updateProgress();
|
|
82
80
|
const bundleStart = Date.now();
|
|
@@ -5,10 +5,9 @@ export declare type BundleProgress = {
|
|
|
5
5
|
export declare const makeBundleProgress: ({ progress, doneIn }: BundleProgress) => string;
|
|
6
6
|
export declare type BucketCreationProgress = {
|
|
7
7
|
bucketCreated: boolean;
|
|
8
|
-
websiteEnabled: boolean;
|
|
9
8
|
doneIn: number | null;
|
|
10
9
|
};
|
|
11
|
-
export declare const makeBucketProgress: ({ bucketCreated,
|
|
10
|
+
export declare const makeBucketProgress: ({ bucketCreated, doneIn, }: BucketCreationProgress) => string;
|
|
12
11
|
declare type UploadStats = {
|
|
13
12
|
addedFiles: number;
|
|
14
13
|
removedFiles: number;
|
|
@@ -15,8 +15,8 @@ const makeBundleProgress = ({ progress, doneIn }) => {
|
|
|
15
15
|
].join(' ');
|
|
16
16
|
};
|
|
17
17
|
exports.makeBundleProgress = makeBundleProgress;
|
|
18
|
-
const makeBucketProgress = ({ bucketCreated,
|
|
19
|
-
const states = [bucketCreated
|
|
18
|
+
const makeBucketProgress = ({ bucketCreated, doneIn, }) => {
|
|
19
|
+
const states = [bucketCreated];
|
|
20
20
|
const statesFinished = states.filter(Boolean).map((p) => p).length;
|
|
21
21
|
const progress = statesFinished / states.length;
|
|
22
22
|
return [
|
|
@@ -72,6 +72,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
|
|
|
72
72
|
outBucket: outData.renderBucketName,
|
|
73
73
|
mostExpensiveFrameRanges: (_a = postRenderData.mostExpensiveFrameRanges) !== null && _a !== void 0 ? _a : null,
|
|
74
74
|
timeToEncode: postRenderData.timeToEncode,
|
|
75
|
+
outputSizeInBytes: postRenderData.outputSize,
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
78
|
const contents = await (0, io_1.lambdaLs)({
|
|
@@ -80,7 +81,6 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
|
|
|
80
81
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
81
82
|
expectedBucketOwner,
|
|
82
83
|
});
|
|
83
|
-
(0, check_if_render_exists_1.checkIfRenderExists)(contents, renderId, bucketName, (0, get_current_region_1.getCurrentRegionInFunction)());
|
|
84
84
|
const renderMetadataExists = Boolean(contents.find((c) => c.Key === (0, constants_1.renderMetadataKey)(renderId)));
|
|
85
85
|
const encodingStatus = (0, get_encoding_metadata_1.getEncodingMetadata)({
|
|
86
86
|
exists: contents.find((c) => c.Key === (0, constants_1.encodingProgressKey)(renderId)),
|
|
@@ -105,6 +105,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
|
|
|
105
105
|
if ((renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.type) === 'still') {
|
|
106
106
|
throw new Error("You don't need to call getRenderProgress() on a still render. Once you have obtained the `renderId`, the render is already done! 😉");
|
|
107
107
|
}
|
|
108
|
+
(0, check_if_render_exists_1.checkIfRenderExists)(contents, renderId, bucketName, (0, get_current_region_1.getCurrentRegionInFunction)());
|
|
108
109
|
const outputFile = renderMetadata
|
|
109
110
|
? await (0, find_output_file_in_bucket_1.findOutputFileInBucket)({
|
|
110
111
|
bucketName,
|
|
@@ -239,6 +240,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
|
|
|
239
240
|
: null,
|
|
240
241
|
mostExpensiveFrameRanges: null,
|
|
241
242
|
timeToEncode: null,
|
|
243
|
+
outputSizeInBytes: null,
|
|
242
244
|
};
|
|
243
245
|
};
|
|
244
246
|
exports.getProgress = getProgress;
|
|
@@ -7,6 +7,8 @@ const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
|
7
7
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
8
8
|
const client_service_quotas_1 = require("@aws-sdk/client-service-quotas");
|
|
9
9
|
const client_sts_1 = require("@aws-sdk/client-sts");
|
|
10
|
+
const credential_providers_1 = require("@aws-sdk/credential-providers");
|
|
11
|
+
const crypto_1 = require("crypto");
|
|
10
12
|
const check_credentials_1 = require("./check-credentials");
|
|
11
13
|
const is_in_lambda_1 = require("./is-in-lambda");
|
|
12
14
|
const _clients = {};
|
|
@@ -14,6 +16,11 @@ const getCredentials = () => {
|
|
|
14
16
|
if ((0, is_in_lambda_1.isInsideLambda)()) {
|
|
15
17
|
return undefined;
|
|
16
18
|
}
|
|
19
|
+
if (process.env.REMOTION_AWS_PROFILE) {
|
|
20
|
+
return (0, credential_providers_1.fromIni)({
|
|
21
|
+
profile: process.env.REMOTION_AWS_PROFILE,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
17
24
|
if (process.env.REMOTION_AWS_ACCESS_KEY_ID &&
|
|
18
25
|
process.env.REMOTION_AWS_SECRET_ACCESS_KEY) {
|
|
19
26
|
return {
|
|
@@ -21,6 +28,11 @@ const getCredentials = () => {
|
|
|
21
28
|
secretAccessKey: process.env.REMOTION_AWS_SECRET_ACCESS_KEY,
|
|
22
29
|
};
|
|
23
30
|
}
|
|
31
|
+
if (process.env.AWS_PROFILE) {
|
|
32
|
+
return (0, credential_providers_1.fromIni)({
|
|
33
|
+
profile: process.env.AWS_PROFILE,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
24
36
|
if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY) {
|
|
25
37
|
return {
|
|
26
38
|
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
@@ -29,17 +41,40 @@ const getCredentials = () => {
|
|
|
29
41
|
}
|
|
30
42
|
return undefined;
|
|
31
43
|
};
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
const getCredentialsHash = ({ customCredentials, region, service, }) => {
|
|
45
|
+
const hashComponents = {};
|
|
46
|
+
if (process.env.REMOTION_AWS_PROFILE) {
|
|
47
|
+
hashComponents.credentials = {
|
|
48
|
+
awsProfile: process.env.REMOTION_AWS_PROFILE,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
else if (process.env.REMOTION_AWS_ACCESS_KEY_ID &&
|
|
52
|
+
process.env.REMOTION_AWS_SECRET_ACCESS_KEY) {
|
|
53
|
+
hashComponents.credentials = {
|
|
54
|
+
accessKeyId: process.env.REMOTION_AWS_ACCESS_KEY_ID,
|
|
55
|
+
secretAccessKey: process.env.REMOTION_AWS_SECRET_ACCESS_KEY,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
else if (process.env.AWS_PROFILE) {
|
|
59
|
+
hashComponents.credentials = {
|
|
60
|
+
awsProfile: process.env.AWS_PROFILE,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
else if (process.env.AWS_ACCESS_KEY_ID &&
|
|
64
|
+
process.env.AWS_SECRET_ACCESS_KEY) {
|
|
65
|
+
hashComponents.credentials = {
|
|
66
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
67
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
hashComponents.customCredentials = customCredentials;
|
|
71
|
+
hashComponents.region = region;
|
|
72
|
+
hashComponents.service = service;
|
|
73
|
+
return (0, crypto_1.createHash)('sha256')
|
|
74
|
+
.update(JSON.stringify(hashComponents))
|
|
75
|
+
.digest('base64');
|
|
76
|
+
};
|
|
41
77
|
const getServiceClient = ({ region, service, customCredentials, }) => {
|
|
42
|
-
var _a;
|
|
43
78
|
const Client = (() => {
|
|
44
79
|
if (service === 'cloudwatch') {
|
|
45
80
|
return client_cloudwatch_logs_1.CloudWatchLogsClient;
|
|
@@ -61,8 +96,7 @@ const getServiceClient = ({ region, service, customCredentials, }) => {
|
|
|
61
96
|
}
|
|
62
97
|
throw new TypeError('unknown client ' + service);
|
|
63
98
|
})();
|
|
64
|
-
const key =
|
|
65
|
-
credentials: (_a = getCredentials()) !== null && _a !== void 0 ? _a : null,
|
|
99
|
+
const key = getCredentialsHash({
|
|
66
100
|
region,
|
|
67
101
|
customCredentials,
|
|
68
102
|
service,
|
|
@@ -17,6 +17,9 @@ const messageForVariable = (variable) => {
|
|
|
17
17
|
.join('\n');
|
|
18
18
|
};
|
|
19
19
|
const checkCredentials = () => {
|
|
20
|
+
if (process.env.REMOTION_AWS_PROFILE || process.env.AWS_PROFILE) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
20
23
|
if (!process.env.AWS_ACCESS_KEY_ID &&
|
|
21
24
|
!process.env.REMOTION_AWS_ACCESS_KEY_ID) {
|
|
22
25
|
throw new Error(messageForVariable('AWS_ACCESS_KEY_ID or REMOTION_AWS_ACCESS_KEY_ID'));
|
|
@@ -334,6 +334,7 @@ export declare type RenderProgress = {
|
|
|
334
334
|
retriesInfo: ChunkRetry[];
|
|
335
335
|
mostExpensiveFrameRanges: ExpensiveChunk[] | null;
|
|
336
336
|
framesRendered: number;
|
|
337
|
+
outputSizeInBytes: number | null;
|
|
337
338
|
};
|
|
338
339
|
export declare type Privacy = 'public' | 'private' | 'no-acl';
|
|
339
340
|
export declare const LAMBDA_CONCURRENCY_LIMIT_QUOTA = "L-B99A9384";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AwsRegion } from '../client';
|
|
2
|
+
import type { LambdaRoutines } from './constants';
|
|
3
|
+
export declare const getCloudwatchStreamUrl: ({ region, functionName, method, renderId, }: {
|
|
4
|
+
region: AwsRegion;
|
|
5
|
+
functionName: string;
|
|
6
|
+
method: LambdaRoutines;
|
|
7
|
+
renderId: string;
|
|
8
|
+
}) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCloudwatchStreamUrl = void 0;
|
|
4
|
+
const getCloudwatchStreamUrl = ({ region, functionName, method, renderId, }) => {
|
|
5
|
+
return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logsV2:log-groups/log-group/$252Faws$252Flambda$252F${functionName}/log-events$3FfilterPattern$3D$2522method$253D${method}$252CrenderId$253D${renderId}$2522`;
|
|
6
|
+
};
|
|
7
|
+
exports.getCloudwatchStreamUrl = getCloudwatchStreamUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.9",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -30,14 +30,15 @@
|
|
|
30
30
|
"@aws-sdk/client-s3": "3.215.0",
|
|
31
31
|
"@aws-sdk/client-service-quotas": "3.215.0",
|
|
32
32
|
"@aws-sdk/client-sts": "3.215.0",
|
|
33
|
+
"@aws-sdk/credential-providers": "3.215.0",
|
|
33
34
|
"@aws-sdk/lib-storage": "3.215.0",
|
|
34
35
|
"@aws-sdk/s3-request-presigner": "3.215.0",
|
|
35
|
-
"@remotion/bundler": "3.3.
|
|
36
|
-
"@remotion/cli": "3.3.
|
|
37
|
-
"@remotion/renderer": "3.3.
|
|
36
|
+
"@remotion/bundler": "3.3.9",
|
|
37
|
+
"@remotion/cli": "3.3.9",
|
|
38
|
+
"@remotion/renderer": "3.3.9",
|
|
38
39
|
"aws-policies": "^1.0.1",
|
|
39
40
|
"mime-types": "2.1.34",
|
|
40
|
-
"remotion": "3.3.
|
|
41
|
+
"remotion": "3.3.9"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
43
44
|
"react": ">=16.8.0",
|
|
@@ -60,5 +61,5 @@
|
|
|
60
61
|
"publishConfig": {
|
|
61
62
|
"access": "public"
|
|
62
63
|
},
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "86269c98522cb7ea280f8283fa6c57885b971b3b"
|
|
64
65
|
}
|
package/remotionlambda.zip
CHANGED
|
Binary file
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|