@remotion/lambda 3.0.0-wrapped.214 → 3.0.0-wrappedup.212
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/admin/replicate-binaries.d.ts +2 -0
- package/dist/admin/replicate-binaries.d.ts.map +1 -0
- package/dist/admin/replicate-binaries.js +50 -0
- package/dist/admin/replicate-binaries.js.map +1 -0
- package/dist/api/bundle-lambda.d.ts +2 -0
- package/dist/api/bundle-lambda.d.ts.map +1 -0
- package/dist/api/bundle-lambda.js +34 -0
- package/dist/api/bundle-lambda.js.map +1 -0
- package/dist/api/bundle-remotion.d.ts +6 -0
- package/dist/api/bundle-remotion.d.ts.map +1 -0
- package/dist/api/bundle-remotion.js +12 -0
- package/dist/api/bundle-remotion.js.map +1 -0
- package/dist/api/deploy-lambda.d.ts +7 -0
- package/dist/api/deploy-lambda.d.ts.map +1 -0
- package/dist/api/deploy-lambda.js +48 -0
- package/dist/api/deploy-lambda.js.map +1 -0
- package/dist/api/deploy-project.d.ts +28 -0
- package/dist/api/deploy-project.d.ts.map +1 -0
- package/dist/api/deploy-project.js +58 -0
- package/dist/api/deploy-project.js.map +1 -0
- package/dist/api/ensure-lambda-binaries.d.ts +11 -0
- package/dist/api/ensure-lambda-binaries.d.ts.map +1 -0
- package/dist/api/ensure-lambda-binaries.js +60 -0
- package/dist/api/ensure-lambda-binaries.js.map +1 -0
- package/dist/api/get-deployed-lambdas.d.ts +10 -0
- package/dist/api/get-deployed-lambdas.d.ts.map +1 -0
- package/dist/api/get-deployed-lambdas.js +31 -0
- package/dist/api/get-deployed-lambdas.js.map +1 -0
- package/dist/api/get-function-version.d.ts +7 -0
- package/dist/api/get-function-version.d.ts.map +1 -0
- package/dist/api/get-function-version.js +27 -0
- package/dist/api/get-function-version.js.map +1 -0
- package/dist/api/iam-validation/required-permissions.d.ts +6 -0
- package/dist/api/iam-validation/required-permissions.d.ts.map +1 -0
- package/dist/api/iam-validation/required-permissions.js +68 -0
- package/dist/api/iam-validation/required-permissions.js.map +1 -0
- package/dist/api/render-still-on-lambda.d.ts +1 -1
- package/dist/api/render-video-on-lambda.d.ts +1 -1
- package/dist/benchmark.d.ts +2 -0
- package/dist/benchmark.d.ts.map +1 -0
- package/dist/benchmark.js +30 -0
- package/dist/benchmark.js.map +1 -0
- package/dist/build-render/index.js +126181 -0
- package/dist/chunked-upload.d.ts +2 -0
- package/dist/chunked-upload.d.ts.map +1 -0
- package/dist/chunked-upload.js +34 -0
- package/dist/chunked-upload.js.map +1 -0
- package/dist/cleanup/cleanup-lambdas.d.ts +7 -0
- package/dist/cleanup/cleanup-lambdas.d.ts.map +1 -0
- package/dist/cleanup/cleanup-lambdas.js +22 -0
- package/dist/cleanup/cleanup-lambdas.js.map +1 -0
- package/dist/cleanup/s3-buckets.d.ts +16 -0
- package/dist/cleanup/s3-buckets.d.ts.map +1 -0
- package/dist/cleanup/s3-buckets.js +59 -0
- package/dist/cleanup/s3-buckets.js.map +1 -0
- package/dist/cli/cleanup.d.ts +4 -0
- package/dist/cli/cleanup.d.ts.map +1 -0
- package/dist/cli/cleanup.js +77 -0
- package/dist/cli/cleanup.js.map +1 -0
- package/dist/cli/commands/render.d.ts +3 -0
- package/dist/cli/commands/render.d.ts.map +1 -0
- package/dist/cli/commands/render.js +75 -0
- package/dist/cli/commands/render.js.map +1 -0
- package/dist/cli/commands/sites/upload.d.ts +3 -0
- package/dist/cli/commands/sites/upload.d.ts.map +1 -0
- package/dist/cli/commands/sites/upload.js +111 -0
- package/dist/cli/commands/sites/upload.js.map +1 -0
- package/dist/cli/deploy.d.ts +3 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +13 -0
- package/dist/cli/deploy.js.map +1 -0
- package/dist/cli/policies.d.ts +3 -0
- package/dist/cli/policies.d.ts.map +1 -0
- package/dist/cli/policies.js +59 -0
- package/dist/cli/policies.js.map +1 -0
- package/dist/cli/render.d.ts +3 -0
- package/dist/cli/render.d.ts.map +1 -0
- package/dist/cli/render.js +96 -0
- package/dist/cli/render.js.map +1 -0
- package/dist/cli/upload.d.ts +3 -0
- package/dist/cli/upload.d.ts.map +1 -0
- package/dist/cli/upload.js +112 -0
- package/dist/cli/upload.js.map +1 -0
- package/dist/functions/chunk-optimization/write-profile.d.ts +8 -0
- package/dist/functions/chunk-optimization/write-profile.d.ts.map +1 -0
- package/dist/functions/chunk-optimization/write-profile.js +18 -0
- package/dist/functions/chunk-optimization/write-profile.js.map +1 -0
- package/dist/functions/get-progress.d.ts +27 -0
- package/dist/functions/get-progress.d.ts.map +1 -0
- package/dist/functions/get-progress.js +161 -0
- package/dist/functions/get-progress.js.map +1 -0
- package/dist/functions/helpers/is-fatal-error.d.ts +3 -0
- package/dist/functions/helpers/is-fatal-error.d.ts.map +1 -0
- package/dist/functions/helpers/is-fatal-error.js +8 -0
- package/dist/functions/helpers/is-fatal-error.js.map +1 -0
- package/dist/functions/helpers/upload-browser-logs.d.ts +11 -0
- package/dist/functions/helpers/upload-browser-logs.d.ts.map +1 -0
- package/dist/functions/helpers/upload-browser-logs.js +18 -0
- package/dist/functions/helpers/upload-browser-logs.js.map +1 -0
- package/dist/rendering/chunked-concatenation.d.ts +3 -0
- package/dist/rendering/chunked-concatenation.d.ts.map +1 -0
- package/dist/rendering/chunked-concatenation.js +38 -0
- package/dist/rendering/chunked-concatenation.js.map +1 -0
- package/dist/rendering/create-named-pipe.d.ts +8 -0
- package/dist/rendering/create-named-pipe.d.ts.map +1 -0
- package/dist/rendering/create-named-pipe.js +41 -0
- package/dist/rendering/create-named-pipe.js.map +1 -0
- package/dist/rendering/mount-tmp-fs.d.ts +2 -0
- package/dist/rendering/mount-tmp-fs.d.ts.map +1 -0
- package/dist/rendering/mount-tmp-fs.js +19 -0
- package/dist/rendering/mount-tmp-fs.js.map +1 -0
- package/dist/run.d.ts +2 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +104 -0
- package/dist/run.js.map +1 -0
- package/dist/scripts2.d.ts +1 -0
- package/dist/scripts2.d.ts.map +1 -0
- package/dist/scripts2.js +2 -0
- package/dist/scripts2.js.map +1 -0
- package/dist/shared/download-with-progress.d.ts +1 -0
- package/dist/shared/download-with-progress.d.ts.map +1 -0
- package/dist/shared/download-with-progress.js +2 -0
- package/dist/shared/download-with-progress.js.map +1 -0
- package/dist/shared/get-file-extension-from-codec.d.ts +3 -0
- package/dist/shared/get-file-extension-from-codec.d.ts.map +1 -0
- package/dist/shared/get-file-extension-from-codec.js +33 -0
- package/dist/shared/get-file-extension-from-codec.js.map +1 -0
- package/dist/shared/is-in-lambda.d.ts +2 -0
- package/dist/shared/is-in-lambda.d.ts.map +1 -0
- package/dist/shared/is-in-lambda.js +5 -0
- package/dist/shared/is-in-lambda.js.map +1 -0
- package/dist/shared/parse-chunk-timing-key.d.ts +7 -0
- package/dist/shared/parse-chunk-timing-key.d.ts.map +1 -0
- package/dist/shared/parse-chunk-timing-key.js +17 -0
- package/dist/shared/parse-chunk-timing-key.js.map +1 -0
- package/dist/shared/tmpdir.d.ts +3 -0
- package/dist/shared/tmpdir.d.ts.map +1 -0
- package/dist/shared/tmpdir.js +23 -0
- package/dist/shared/tmpdir.js.map +1 -0
- package/package.json +6 -6
- package/remotionlambda.zip +0 -0
- package/dist/api/convert-to-serve-url.d.ts +0 -2
- package/dist/api/convert-to-serve-url.d.ts.map +0 -1
- package/dist/api/convert-to-serve-url.js +0 -13
- package/dist/api/convert-to-serve-url.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replicate-binaries.d.ts","sourceRoot":"","sources":["../../src/admin/replicate-binaries.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
7
|
+
const cli_1 = require("@remotion/cli");
|
|
8
|
+
const log_1 = require("@remotion/cli/dist/log");
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const aws_regions_1 = require("../pricing/aws-regions");
|
|
12
|
+
const aws_clients_1 = require("../shared/aws-clients");
|
|
13
|
+
const bucketExistsInRegion = async ({ bucketName, region, }) => {
|
|
14
|
+
var _a;
|
|
15
|
+
try {
|
|
16
|
+
const bucket = await aws_clients_1.getS3Client(region).send(new client_s3_1.GetBucketLocationCommand({
|
|
17
|
+
Bucket: bucketName,
|
|
18
|
+
}));
|
|
19
|
+
return ((_a = bucket.LocationConstraint) !== null && _a !== void 0 ? _a : 'us-east-1') === region;
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
if (err.Code === 'NoSuchBucket') {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
throw err;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
cli_1.CliInternals.xns(async () => {
|
|
29
|
+
for (const region of aws_regions_1.AWS_REGIONS) {
|
|
30
|
+
log_1.Log.info('Region:', region);
|
|
31
|
+
const client = aws_clients_1.getS3Client(region);
|
|
32
|
+
const bucketExists = await bucketExistsInRegion({ bucketName, region });
|
|
33
|
+
if (!bucketExists) {
|
|
34
|
+
await client.send(new client_s3_1.CreateBucketCommand({
|
|
35
|
+
ACL: 'public-read',
|
|
36
|
+
Bucket: bucketName,
|
|
37
|
+
}));
|
|
38
|
+
log_1.Log.info(`Bucket ${bucketName} created.`);
|
|
39
|
+
}
|
|
40
|
+
const Body = fs_1.createReadStream(path_1.default.join(__dirname, 'remotion.zip'));
|
|
41
|
+
log_1.Log.info(`Uploading ${region}...`);
|
|
42
|
+
await client.send(new client_s3_1.PutObjectCommand({
|
|
43
|
+
Key: 'remotion.zip',
|
|
44
|
+
Bucket: bucketName,
|
|
45
|
+
Body,
|
|
46
|
+
ACL: 'public-read',
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=replicate-binaries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replicate-binaries.js","sourceRoot":"","sources":["../../src/admin/replicate-binaries.ts"],"names":[],"mappings":";;;;;AAAA,kDAI4B;AAC5B,uCAA2C;AAC3C,gDAA2C;AAC3C,2BAAoC;AACpC,gDAAwB;AACxB,wDAA8D;AAC9D,uDAAkD;AAElD,MAAM,oBAAoB,GAAG,KAAK,EAAE,EACnC,UAAU,EACV,MAAM,GAIN,EAAE,EAAE;;IACJ,IAAI;QACH,MAAM,MAAM,GAAG,MAAM,yBAAW,CAAC,MAAM,CAAC,CAAC,IAAI,CAC5C,IAAI,oCAAwB,CAAC;YAC5B,MAAM,EAAE,UAAU;SAClB,CAAC,CACF,CAAC;QAEF,OAAO,CAAC,MAAA,MAAM,CAAC,kBAAkB,mCAAI,WAAW,CAAC,KAAK,MAAM,CAAC;KAC7D;IAAC,OAAO,GAAG,EAAE;QACb,IAAK,GAAsB,CAAC,IAAI,KAAK,cAAc,EAAE;YACpD,OAAO,KAAK,CAAC;SACb;QAED,MAAM,GAAG,CAAC;KACV;AACF,CAAC,CAAC;AAEF,kBAAY,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;IAC3B,KAAK,MAAM,MAAM,IAAI,yBAAW,EAAE;QACjC,SAAG,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC5B,MAAM,MAAM,GAAG,yBAAW,CAAC,MAAM,CAAC,CAAC;QAEnC,MAAM,YAAY,GAAG,MAAM,oBAAoB,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC,CAAC;QACtE,IAAI,CAAC,YAAY,EAAE;YAClB,MAAM,MAAM,CAAC,IAAI,CAChB,IAAI,+BAAmB,CAAC;gBACvB,GAAG,EAAE,aAAa;gBAClB,MAAM,EAAE,UAAU;aAClB,CAAC,CACF,CAAC;YACF,SAAG,CAAC,IAAI,CAAC,UAAU,UAAU,WAAW,CAAC,CAAC;SAC1C;QAED,MAAM,IAAI,GAAG,qBAAgB,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;QAEpE,SAAG,CAAC,IAAI,CAAC,aAAa,MAAM,KAAK,CAAC,CAAC;QACnC,MAAM,MAAM,CAAC,IAAI,CAChB,IAAI,4BAAgB,CAAC;YACpB,GAAG,EAAE,cAAc;YACnB,MAAM,EAAE,UAAU;YAClB,IAAI;YACJ,GAAG,EAAE,aAAa;SAClB,CAAC,CACF,CAAC;KACF;AACF,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-lambda.d.ts","sourceRoot":"","sources":["../../src/api/bundle-lambda.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,uBAwBxB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.bundleLambda = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const tmpdir_1 = require("../shared/tmpdir");
|
|
10
|
+
const esbuild = require("esbuild");
|
|
11
|
+
const zl = require("zip-lib");
|
|
12
|
+
const bundleLambda = async () => {
|
|
13
|
+
var _a;
|
|
14
|
+
const outdir = path_1.default.join(__dirname, '..', `build-render`);
|
|
15
|
+
fs_1.default.mkdirSync(outdir, {
|
|
16
|
+
recursive: true,
|
|
17
|
+
});
|
|
18
|
+
const outfile = path_1.default.join(outdir, 'index.js');
|
|
19
|
+
((_a = fs_1.default.rmSync) !== null && _a !== void 0 ? _a : fs_1.default.rmdirSync)(outdir, { recursive: true });
|
|
20
|
+
fs_1.default.mkdirSync(outdir, { recursive: true });
|
|
21
|
+
const template = require.resolve(path_1.default.join(__dirname, '..', 'functions', 'index'));
|
|
22
|
+
await esbuild.build({
|
|
23
|
+
platform: 'node',
|
|
24
|
+
target: 'node14',
|
|
25
|
+
bundle: true,
|
|
26
|
+
outfile,
|
|
27
|
+
entryPoints: [template],
|
|
28
|
+
});
|
|
29
|
+
const out = path_1.default.join(tmpdir_1.tmpDir('remotion-fn'), `function-render.zip`);
|
|
30
|
+
await zl.archiveFolder(outdir, out);
|
|
31
|
+
return out;
|
|
32
|
+
};
|
|
33
|
+
exports.bundleLambda = bundleLambda;
|
|
34
|
+
//# sourceMappingURL=bundle-lambda.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-lambda.js","sourceRoot":"","sources":["../../src/api/bundle-lambda.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,6CAAwC;AACxC,mCAAoC;AACpC,8BAA+B;AAExB,MAAM,YAAY,GAAG,KAAK,IAAI,EAAE;;IACtC,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IAC1D,YAAE,CAAC,SAAS,CAAC,MAAM,EAAE;QACpB,SAAS,EAAE,IAAI;KACf,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAE9C,CAAC,MAAA,YAAE,CAAC,MAAM,mCAAI,YAAE,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;IACvD,YAAE,CAAC,SAAS,CAAC,MAAM,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAC/B,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAChD,CAAC;IAEF,MAAM,OAAO,CAAC,KAAK,CAAC;QACnB,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,IAAI;QACZ,OAAO;QACP,WAAW,EAAE,CAAC,QAAQ,CAAC;KACvB,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,cAAI,CAAC,IAAI,CAAC,eAAM,CAAC,aAAa,CAAC,EAAE,qBAAqB,CAAC,CAAC;IACpE,MAAM,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AAxBW,QAAA,YAAY,gBAwBvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-remotion.d.ts","sourceRoot":"","sources":["../../src/api/bundle-remotion.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;eAKf,MAAM;2BACM,MAAM,KAAK,IAAI;gBAC1B,MAAM;qBAKlB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bundleRemotion = void 0;
|
|
4
|
+
const bundler_1 = require("@remotion/bundler");
|
|
5
|
+
// TODO: Necessary? No
|
|
6
|
+
const bundleRemotion = ({ entryFile, onProgress, publicPath, }) => {
|
|
7
|
+
return bundler_1.bundle(entryFile, onProgress, {
|
|
8
|
+
publicPath,
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.bundleRemotion = bundleRemotion;
|
|
12
|
+
//# sourceMappingURL=bundle-remotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-remotion.js","sourceRoot":"","sources":["../../src/api/bundle-remotion.ts"],"names":[],"mappings":";;;AAAA,+CAAyC;AAEzC,sBAAsB;AACf,MAAM,cAAc,GAAG,CAAC,EAC9B,SAAS,EACT,UAAU,EACV,UAAU,GAKV,EAAE,EAAE;IACJ,OAAO,gBAAM,CAAC,SAAS,EAAE,UAAU,EAAE;QACpC,UAAU;KACV,CAAC,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,cAAc,kBAYzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-lambda.d.ts","sourceRoot":"","sources":["../../src/api/deploy-lambda.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,YAAY,YAAmB;IAAC,MAAM,EAAE,SAAS,CAAA;CAAC;;EA0C9D,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deployLambda = void 0;
|
|
4
|
+
const client_iam_1 = require("@aws-sdk/client-iam");
|
|
5
|
+
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const aws_clients_1 = require("../shared/aws-clients");
|
|
8
|
+
const constants_1 = require("../shared/constants");
|
|
9
|
+
const random_hash_1 = require("../shared/random-hash");
|
|
10
|
+
const bundle_lambda_1 = require("./bundle-lambda");
|
|
11
|
+
const ensure_lambda_binaries_1 = require("./ensure-lambda-binaries");
|
|
12
|
+
const deployLambda = async (options) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const { layerArn } = await ensure_lambda_binaries_1.ensureLambdaBinaries(options.region);
|
|
15
|
+
console.log('Done creating layers');
|
|
16
|
+
const fnNameRender = constants_1.RENDER_FN_PREFIX + random_hash_1.randomHash();
|
|
17
|
+
const renderOut = await bundle_lambda_1.bundleLambda('render');
|
|
18
|
+
console.log('done Bundling');
|
|
19
|
+
const user = await aws_clients_1.getIamClient(options.region).send(new client_iam_1.GetUserCommand({}));
|
|
20
|
+
const accountId = (_b = (_a = user.User) === null || _a === void 0 ? void 0 : _a.Arn) === null || _b === void 0 ? void 0 : _b.match(/aws:iam::([0-9]+)/);
|
|
21
|
+
if (!accountId) {
|
|
22
|
+
throw new Error('Cannot get account ID');
|
|
23
|
+
}
|
|
24
|
+
const created = await aws_clients_1.getLambdaClient(options.region).send(new client_lambda_1.CreateFunctionCommand({
|
|
25
|
+
Code: {
|
|
26
|
+
ZipFile: fs_1.readFileSync(renderOut),
|
|
27
|
+
},
|
|
28
|
+
FunctionName: fnNameRender,
|
|
29
|
+
Handler: 'index.handler',
|
|
30
|
+
// TODO: Give helpful suggestion if user did not create role
|
|
31
|
+
Role: `arn:aws:iam::${accountId[1]}:role/remotion-lambda-role`,
|
|
32
|
+
Runtime: 'nodejs14.x',
|
|
33
|
+
Description: 'Renders a Remotion video.',
|
|
34
|
+
MemorySize: constants_1.MEMORY_SIZE,
|
|
35
|
+
// TODO: Set timeout
|
|
36
|
+
Timeout: 120,
|
|
37
|
+
Layers: [layerArn],
|
|
38
|
+
}));
|
|
39
|
+
console.log('lambdas created');
|
|
40
|
+
if (!created.FunctionName) {
|
|
41
|
+
throw new Error('Lambda was created but has no name');
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
functionName: created.FunctionName,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
exports.deployLambda = deployLambda;
|
|
48
|
+
//# sourceMappingURL=deploy-lambda.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-lambda.js","sourceRoot":"","sources":["../../src/api/deploy-lambda.ts"],"names":[],"mappings":";;;AAAA,oDAAmD;AACnD,0DAA6D;AAC7D,2BAAgC;AAEhC,uDAAoE;AACpE,mDAAkE;AAClE,uDAAiD;AACjD,mDAA6C;AAC7C,qEAA8D;AAEvD,MAAM,YAAY,GAAG,KAAK,EAAE,OAA4B,EAAE,EAAE;;IAClE,MAAM,EAAC,QAAQ,EAAC,GAAG,MAAM,6CAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,4BAAgB,GAAG,wBAAU,EAAE,CAAC;IACrD,MAAM,SAAS,GAAG,MAAM,4BAAY,CAAC,QAAQ,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAE7B,MAAM,IAAI,GAAG,MAAM,0BAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,2BAAc,CAAC,EAAE,CAAC,CAAC,CAAC;IAE7E,MAAM,SAAS,GAAG,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,GAAG,0CAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAE7D,IAAI,CAAC,SAAS,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KACzC;IAED,MAAM,OAAO,GAAG,MAAM,6BAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CACzD,IAAI,qCAAqB,CAAC;QACzB,IAAI,EAAE;YACL,OAAO,EAAE,iBAAY,CAAC,SAAS,CAAC;SAChC;QACD,YAAY,EAAE,YAAY;QAC1B,OAAO,EAAE,eAAe;QACxB,4DAA4D;QAC5D,IAAI,EAAE,gBAAgB,SAAS,CAAC,CAAC,CAAC,4BAA4B;QAC9D,OAAO,EAAE,YAAY;QACrB,WAAW,EAAE,2BAA2B;QACxC,UAAU,EAAE,uBAAW;QACvB,oBAAoB;QACpB,OAAO,EAAE,GAAG;QACZ,MAAM,EAAE,CAAC,QAAQ,CAAC;KAClB,CAAC,CACF,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAE/B,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACtD;IAED,OAAO;QACN,YAAY,EAAE,OAAO,CAAC,YAAY;KAClC,CAAC;AACH,CAAC,CAAC;AA1CW,QAAA,YAAY,gBA0CvB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { WebpackOverrideFn } from 'remotion';
|
|
2
|
+
import { AwsRegion } from '../pricing/aws-regions';
|
|
3
|
+
import { UploadDirProgress } from './upload-dir';
|
|
4
|
+
declare type DeployProjectInput = {
|
|
5
|
+
entryPoint: string;
|
|
6
|
+
bucketName: string;
|
|
7
|
+
region: AwsRegion;
|
|
8
|
+
options?: {
|
|
9
|
+
onBundleProgress?: (progress: number) => void;
|
|
10
|
+
onWebsiteActivated?: () => void;
|
|
11
|
+
onUploadProgress?: (upload: UploadDirProgress) => void;
|
|
12
|
+
webpackOverride?: WebpackOverrideFn;
|
|
13
|
+
enableCaching?: boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
18
|
+
* @link https://remotion.dev/docs/lambda/deployproject
|
|
19
|
+
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
20
|
+
* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
|
|
21
|
+
* @param {string} params.bucketName The name of the bucket to deploy your project into.
|
|
22
|
+
* @param {object} params.options Further options, see documentation page for this function.
|
|
23
|
+
*/
|
|
24
|
+
export declare const deployProject: ({ bucketName, entryPoint, options, region, }: DeployProjectInput) => Promise<{
|
|
25
|
+
url: string;
|
|
26
|
+
}>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=deploy-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-project.d.ts","sourceRoot":"","sources":["../../src/api/deploy-project.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,iBAAiB,EAAC,MAAM,UAAU,CAAC;AACtD,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAKjD,OAAO,EAAY,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAE1D,aAAK,kBAAkB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE;QACT,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;QAC9C,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;QAChC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;QACvD,eAAe,CAAC,EAAE,iBAAiB,CAAC;QACpC,aAAa,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,iDAKvB,kBAAkB;;EAgDpB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deployProject = void 0;
|
|
4
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
+
const bundler_1 = require("@remotion/bundler");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const aws_clients_1 = require("../shared/aws-clients");
|
|
8
|
+
const constants_1 = require("../shared/constants");
|
|
9
|
+
const make_s3_url_1 = require("../shared/make-s3-url");
|
|
10
|
+
const random_hash_1 = require("../shared/random-hash");
|
|
11
|
+
const upload_dir_1 = require("./upload-dir");
|
|
12
|
+
/**
|
|
13
|
+
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
14
|
+
* @link https://remotion.dev/docs/lambda/deployproject
|
|
15
|
+
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
16
|
+
* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
|
|
17
|
+
* @param {string} params.bucketName The name of the bucket to deploy your project into.
|
|
18
|
+
* @param {object} params.options Further options, see documentation page for this function.
|
|
19
|
+
*/
|
|
20
|
+
const deployProject = async ({ bucketName, entryPoint, options, region, }) => {
|
|
21
|
+
var _a, _b, _c, _d;
|
|
22
|
+
if (!bucketName.startsWith(constants_1.REMOTION_BUCKET_PREFIX)) {
|
|
23
|
+
throw new Error(`The bucketName parameter must start with ${constants_1.REMOTION_BUCKET_PREFIX}.`);
|
|
24
|
+
}
|
|
25
|
+
const subFolder = constants_1.getSitesKey(random_hash_1.randomHash());
|
|
26
|
+
const bundled = await bundler_1.bundle(entryPoint, (_a = options === null || options === void 0 ? void 0 : options.onBundleProgress) !== null && _a !== void 0 ? _a : (() => undefined), {
|
|
27
|
+
publicPath: `/${subFolder}/`,
|
|
28
|
+
webpackOverride: (_b = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _b !== void 0 ? _b : remotion_1.Internals.getWebpackOverrideFn(),
|
|
29
|
+
enableCaching: (_c = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _c !== void 0 ? _c : remotion_1.Internals.getWebpackCaching(),
|
|
30
|
+
});
|
|
31
|
+
await Promise.all([
|
|
32
|
+
upload_dir_1.uploadDir({
|
|
33
|
+
bucket: bucketName,
|
|
34
|
+
client: aws_clients_1.getS3Client(region),
|
|
35
|
+
dir: bundled,
|
|
36
|
+
onProgress: (_d = options === null || options === void 0 ? void 0 : options.onUploadProgress) !== null && _d !== void 0 ? _d : (() => undefined),
|
|
37
|
+
folder: subFolder,
|
|
38
|
+
}),
|
|
39
|
+
aws_clients_1.getS3Client(region)
|
|
40
|
+
.send(new client_s3_1.PutBucketWebsiteCommand({
|
|
41
|
+
Bucket: bucketName,
|
|
42
|
+
WebsiteConfiguration: {
|
|
43
|
+
IndexDocument: {
|
|
44
|
+
// TODO: but it doesn't exist
|
|
45
|
+
// TODO: shouldn't we do this before
|
|
46
|
+
Suffix: `index.html`,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
}))
|
|
50
|
+
// TODO if we decide to keep it, add callback to docs
|
|
51
|
+
.then(() => { var _a; return (_a = options === null || options === void 0 ? void 0 : options.onWebsiteActivated) === null || _a === void 0 ? void 0 : _a.call(options); }),
|
|
52
|
+
]);
|
|
53
|
+
return {
|
|
54
|
+
url: make_s3_url_1.makeS3Url({ bucketName, subFolder, region }),
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
exports.deployProject = deployProject;
|
|
58
|
+
//# sourceMappingURL=deploy-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-project.js","sourceRoot":"","sources":["../../src/api/deploy-project.ts"],"names":[],"mappings":";;;AAAA,kDAA2D;AAC3D,+CAAyC;AACzC,uCAAsD;AAEtD,uDAAkD;AAClD,mDAAwE;AACxE,uDAAgD;AAChD,uDAAiD;AACjD,6CAA0D;AAe1D;;;;;;;GAOG;AACI,MAAM,aAAa,GAAG,KAAK,EAAE,EACnC,UAAU,EACV,UAAU,EACV,OAAO,EACP,MAAM,GACc,EAAE,EAAE;;IACxB,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,kCAAsB,CAAC,EAAE;QACnD,MAAM,IAAI,KAAK,CACd,4CAA4C,kCAAsB,GAAG,CACrE,CAAC;KACF;IAED,MAAM,SAAS,GAAG,uBAAW,CAAC,wBAAU,EAAE,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,MAAM,gBAAM,CAC3B,UAAU,EACV,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,mCAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,EAC9C;QACC,UAAU,EAAE,IAAI,SAAS,GAAG;QAC5B,eAAe,EACd,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,mCAAI,oBAAS,CAAC,oBAAoB,EAAE;QAC7D,aAAa,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,mCAAI,oBAAS,CAAC,iBAAiB,EAAE;KACtE,CACD,CAAC;IAEF,MAAM,OAAO,CAAC,GAAG,CAAC;QACjB,sBAAS,CAAC;YACT,MAAM,EAAE,UAAU;YAClB,MAAM,EAAE,yBAAW,CAAC,MAAM,CAAC;YAC3B,GAAG,EAAE,OAAO;YACZ,UAAU,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,mCAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;YAC1D,MAAM,EAAE,SAAS;SACjB,CAAC;QACF,yBAAW,CAAC,MAAM,CAAC;aACjB,IAAI,CACJ,IAAI,mCAAuB,CAAC;YAC3B,MAAM,EAAE,UAAU;YAElB,oBAAoB,EAAE;gBACrB,aAAa,EAAE;oBACd,6BAA6B;oBAC7B,oCAAoC;oBACpC,MAAM,EAAE,YAAY;iBACpB;aACD;SACD,CAAC,CACF;YACD,qDAAqD;aACpD,IAAI,CAAC,GAAG,EAAE,WAAC,OAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,kBAAkB,+CAA3B,OAAO,CAAwB,CAAA,EAAA,CAAC;KAC7C,CAAC,CAAC;IAEH,OAAO;QACN,GAAG,EAAE,uBAAS,CAAC,EAAC,UAAU,EAAE,SAAS,EAAE,MAAM,EAAC,CAAC;KAC/C,CAAC;AACH,CAAC,CAAC;AArDW,QAAA,aAAa,iBAqDxB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AwsRegion } from '../pricing/aws-regions';
|
|
2
|
+
/**
|
|
3
|
+
* @description Ensures that a Lambda layer with the necessary binaries exists.
|
|
4
|
+
* @link https://remotion.dev/docs/lambda/ensurelambdabinaries
|
|
5
|
+
* @param {AwsRegion} region The region in which you want ensure the binaries are deployed.
|
|
6
|
+
* @returns `Promise<{layerArn: string}>`
|
|
7
|
+
*/
|
|
8
|
+
export declare const ensureLambdaBinaries: (region: AwsRegion) => Promise<{
|
|
9
|
+
layerArn: string;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=ensure-lambda-binaries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensure-lambda-binaries.d.ts","sourceRoot":"","sources":["../../src/api/ensure-lambda-binaries.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAwEjD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,WAAkB,SAAS;;EAK3D,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ensureLambdaBinaries = void 0;
|
|
4
|
+
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
+
const aws_clients_1 = require("../shared/aws-clients");
|
|
6
|
+
const constants_1 = require("../shared/constants");
|
|
7
|
+
const runtimes = ['nodejs14.x', 'nodejs12.x', 'nodejs10.x'];
|
|
8
|
+
const LAYER_NAME = 'remotion-binaries';
|
|
9
|
+
const createLayer = ({ region, name, key, sourceS3Bucket, }) => {
|
|
10
|
+
return aws_clients_1.getLambdaClient(region).send(new client_lambda_1.PublishLayerVersionCommand({
|
|
11
|
+
Content: {
|
|
12
|
+
S3Bucket: sourceS3Bucket,
|
|
13
|
+
S3Key: key,
|
|
14
|
+
},
|
|
15
|
+
LayerName: name,
|
|
16
|
+
LicenseInfo: 'https://ffmpeg.org/legal.html / https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE',
|
|
17
|
+
CompatibleRuntimes: runtimes,
|
|
18
|
+
Description: constants_1.CURRENT_VERSION,
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
const getLayers = async (lambdaClient) => {
|
|
22
|
+
const data = await lambdaClient.send(new client_lambda_1.ListLayersCommand({
|
|
23
|
+
CompatibleRuntime: runtimes[0],
|
|
24
|
+
}));
|
|
25
|
+
return (data.Layers || []);
|
|
26
|
+
};
|
|
27
|
+
const hasLayer = (name, layers) => {
|
|
28
|
+
return layers.find((l) => {
|
|
29
|
+
var _a;
|
|
30
|
+
return l.LayerName === name &&
|
|
31
|
+
((_a = l.LatestMatchingVersion) === null || _a === void 0 ? void 0 : _a.Description) === constants_1.CURRENT_VERSION;
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const ensureLayer = async ({ layers, region, }) => {
|
|
35
|
+
var _a;
|
|
36
|
+
const existingLayer = hasLayer(LAYER_NAME, layers);
|
|
37
|
+
if (existingLayer) {
|
|
38
|
+
return (_a = existingLayer.LatestMatchingVersion) === null || _a === void 0 ? void 0 : _a.LayerVersionArn;
|
|
39
|
+
}
|
|
40
|
+
const layer = await createLayer({
|
|
41
|
+
name: LAYER_NAME,
|
|
42
|
+
key: 'remotion.zip',
|
|
43
|
+
sourceS3Bucket: constants_1.getBinariesBucketName(region),
|
|
44
|
+
region,
|
|
45
|
+
});
|
|
46
|
+
return layer.LayerVersionArn;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* @description Ensures that a Lambda layer with the necessary binaries exists.
|
|
50
|
+
* @link https://remotion.dev/docs/lambda/ensurelambdabinaries
|
|
51
|
+
* @param {AwsRegion} region The region in which you want ensure the binaries are deployed.
|
|
52
|
+
* @returns `Promise<{layerArn: string}>`
|
|
53
|
+
*/
|
|
54
|
+
const ensureLambdaBinaries = async (region) => {
|
|
55
|
+
const layers = await getLayers(aws_clients_1.getLambdaClient(region));
|
|
56
|
+
const layerArn = await ensureLayer({ layers, region });
|
|
57
|
+
return { layerArn };
|
|
58
|
+
};
|
|
59
|
+
exports.ensureLambdaBinaries = ensureLambdaBinaries;
|
|
60
|
+
//# sourceMappingURL=ensure-lambda-binaries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensure-lambda-binaries.js","sourceRoot":"","sources":["../../src/api/ensure-lambda-binaries.ts"],"names":[],"mappings":";;;AAAA,0DAKgC;AAEhC,uDAAsD;AACtD,mDAA2E;AAE3E,MAAM,QAAQ,GAAa,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAEtE,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAEvC,MAAM,WAAW,GAAG,CAAC,EACpB,MAAM,EACN,IAAI,EACJ,GAAG,EACH,cAAc,GAMd,EAAE,EAAE;IACJ,OAAO,6BAAe,CAAC,MAAM,CAAC,CAAC,IAAI,CAClC,IAAI,0CAA0B,CAAC;QAC9B,OAAO,EAAE;YACR,QAAQ,EAAE,cAAc;YACxB,KAAK,EAAE,GAAG;SACV;QACD,SAAS,EAAE,IAAI;QACf,WAAW,EACV,0GAA0G;QAC3G,kBAAkB,EAAE,QAAQ;QAC5B,WAAW,EAAE,2BAAe;KAC5B,CAAC,CACF,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,KAAK,EAAE,YAA0B,EAAE,EAAE;IACtD,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,CACnC,IAAI,iCAAiB,CAAC;QACrB,iBAAiB,EAAE,QAAQ,CAAC,CAAC,CAAC;KAC9B,CAAC,CACF,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAqB,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,MAAwB,EAAE,EAAE;IAC3D,OAAO,MAAM,CAAC,IAAI,CACjB,CAAC,CAAC,EAAE,EAAE;;QACL,OAAA,CAAC,CAAC,SAAS,KAAK,IAAI;YACpB,CAAA,MAAA,CAAC,CAAC,qBAAqB,0CAAE,WAAW,MAAK,2BAAe,CAAA;KAAA,CACzD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,KAAK,EAAE,EAC1B,MAAM,EACN,MAAM,GAIN,EAAmB,EAAE;;IACrB,MAAM,aAAa,GAAG,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACnD,IAAI,aAAa,EAAE;QAClB,OAAO,MAAA,aAAa,CAAC,qBAAqB,0CAAE,eAAyB,CAAC;KACtE;IAED,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC;QAC/B,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,cAAc;QACnB,cAAc,EAAE,iCAAqB,CAAC,MAAM,CAAC;QAC7C,MAAM;KACN,CAAC,CAAC;IACH,OAAO,KAAK,CAAC,eAAyB,CAAC;AACxC,CAAC,CAAC;AAEF;;;;;GAKG;AACI,MAAM,oBAAoB,GAAG,KAAK,EAAE,MAAiB,EAAE,EAAE;IAC/D,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,6BAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,EAAC,MAAM,EAAE,MAAM,EAAC,CAAC,CAAC;IAErD,OAAO,EAAC,QAAQ,EAAC,CAAC;AACnB,CAAC,CAAC;AALW,QAAA,oBAAoB,wBAK/B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AwsRegion } from '../pricing/aws-regions';
|
|
2
|
+
export declare const getDeployedLambdas: (options: {
|
|
3
|
+
region: AwsRegion;
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
name: string;
|
|
6
|
+
version: import("../shared/constants").LambdaVersions;
|
|
7
|
+
memory: number;
|
|
8
|
+
timeout: number;
|
|
9
|
+
}[]>;
|
|
10
|
+
//# sourceMappingURL=get-deployed-lambdas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-deployed-lambdas.d.ts","sourceRoot":"","sources":["../../src/api/get-deployed-lambdas.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAMjD,eAAO,MAAM,kBAAkB,YAAmB;IAAC,MAAM,EAAE,SAAS,CAAA;CAAC;;;;;IA0BpE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDeployedLambdas = void 0;
|
|
4
|
+
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
+
const aws_clients_1 = require("../shared/aws-clients");
|
|
6
|
+
const constants_1 = require("../shared/constants");
|
|
7
|
+
const get_function_version_1 = require("./get-function-version");
|
|
8
|
+
// TODO: Rename to getDeployedFunctions
|
|
9
|
+
const getDeployedLambdas = async (options) => {
|
|
10
|
+
const lambdas = await aws_clients_1.getLambdaClient(options.region).send(new client_lambda_1.ListFunctionsCommand({}));
|
|
11
|
+
const remotionLambdas = (lambdas.Functions || []).filter((f) => {
|
|
12
|
+
var _a;
|
|
13
|
+
return (_a = f.FunctionName) === null || _a === void 0 ? void 0 : _a.startsWith(constants_1.RENDER_FN_PREFIX);
|
|
14
|
+
});
|
|
15
|
+
const configs = await Promise.all(remotionLambdas.map((fn) => {
|
|
16
|
+
return get_function_version_1.getFunctionVersion({
|
|
17
|
+
functionName: fn.FunctionName,
|
|
18
|
+
region: options.region,
|
|
19
|
+
});
|
|
20
|
+
}));
|
|
21
|
+
return remotionLambdas.map((lambda, i) => {
|
|
22
|
+
return {
|
|
23
|
+
name: lambda.FunctionName,
|
|
24
|
+
version: configs[i],
|
|
25
|
+
memory: lambda.MemorySize,
|
|
26
|
+
timeout: lambda.Timeout,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
exports.getDeployedLambdas = getDeployedLambdas;
|
|
31
|
+
//# sourceMappingURL=get-deployed-lambdas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-deployed-lambdas.js","sourceRoot":"","sources":["../../src/api/get-deployed-lambdas.ts"],"names":[],"mappings":";;;AAAA,0DAA4D;AAE5D,uDAAsD;AACtD,mDAAqD;AACrD,iEAA0D;AAE1D,uCAAuC;AAChC,MAAM,kBAAkB,GAAG,KAAK,EAAE,OAA4B,EAAE,EAAE;IACxE,MAAM,OAAO,GAAG,MAAM,6BAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CACzD,IAAI,oCAAoB,CAAC,EAAE,CAAC,CAC5B,CAAC;IAEF,MAAM,eAAe,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;;QAC9D,OAAO,MAAA,CAAC,CAAC,YAAY,0CAAE,UAAU,CAAC,4BAAgB,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QAC1B,OAAO,yCAAkB,CAAC;YACzB,YAAY,EAAE,EAAE,CAAC,YAAsB;YACvC,MAAM,EAAE,OAAO,CAAC,MAAM;SACtB,CAAC,CAAC;IACJ,CAAC,CAAC,CACF,CAAC;IAEF,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,OAAO;YACN,IAAI,EAAE,MAAM,CAAC,YAAsB;YACnC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;YACnB,MAAM,EAAE,MAAM,CAAC,UAAoB;YACnC,OAAO,EAAE,MAAM,CAAC,OAAiB;SACjC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,kBAAkB,sBA0B7B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AwsRegion } from '../pricing/aws-regions';
|
|
2
|
+
import { LambdaVersions } from '../shared/constants';
|
|
3
|
+
export declare const getFunctionVersion: ({ functionName, region, }: {
|
|
4
|
+
functionName: string;
|
|
5
|
+
region: AwsRegion;
|
|
6
|
+
}) => Promise<LambdaVersions>;
|
|
7
|
+
//# sourceMappingURL=get-function-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-function-version.d.ts","sourceRoot":"","sources":["../../src/api/get-function-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAGN,cAAc,EACd,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,kBAAkB;kBAIhB,MAAM;YACZ,SAAS;MACd,QAAQ,cAAc,CAmBzB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFunctionVersion = void 0;
|
|
4
|
+
const call_lambda_1 = require("../shared/call-lambda");
|
|
5
|
+
const constants_1 = require("../shared/constants");
|
|
6
|
+
const getFunctionVersion = async ({ functionName, region, }) => {
|
|
7
|
+
try {
|
|
8
|
+
const result = await call_lambda_1.callLambda({
|
|
9
|
+
functionName,
|
|
10
|
+
payload: {
|
|
11
|
+
type: constants_1.LambdaRoutines.info,
|
|
12
|
+
},
|
|
13
|
+
region,
|
|
14
|
+
type: constants_1.LambdaRoutines.info,
|
|
15
|
+
});
|
|
16
|
+
return result.version;
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
// Prerelease versions had no info command
|
|
20
|
+
if (err.message.includes(constants_1.COMMAND_NOT_FOUND)) {
|
|
21
|
+
return 'n/a';
|
|
22
|
+
}
|
|
23
|
+
throw err;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.getFunctionVersion = getFunctionVersion;
|
|
27
|
+
//# sourceMappingURL=get-function-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-function-version.js","sourceRoot":"","sources":["../../src/api/get-function-version.ts"],"names":[],"mappings":";;;AACA,uDAAiD;AACjD,mDAI6B;AAEtB,MAAM,kBAAkB,GAAG,KAAK,EAAE,EACxC,YAAY,EACZ,MAAM,GAIN,EAA2B,EAAE;IAC7B,IAAI;QACH,MAAM,MAAM,GAAG,MAAM,wBAAU,CAAC;YAC/B,YAAY;YACZ,OAAO,EAAE;gBACR,IAAI,EAAE,0BAAc,CAAC,IAAI;aACzB;YACD,MAAM;YACN,IAAI,EAAE,0BAAc,CAAC,IAAI;SACzB,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,OAAO,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACb,0CAA0C;QAC1C,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,6BAAiB,CAAC,EAAE;YAC5C,OAAO,KAAK,CAAC;SACb;QAED,MAAM,GAAG,CAAC;KACV;AACF,CAAC,CAAC;AAzBW,QAAA,kBAAkB,sBAyB7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required-permissions.d.ts","sourceRoot":"","sources":["../../../src/api/iam-validation/required-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,MAAM,cAAc,CAAC;AAInD,eAAO,MAAM,mBAAmB,EAAE;IACjC,OAAO,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACtC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB,EA4DA,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.requiredPermissions = void 0;
|
|
4
|
+
const aws_policies_1 = require("aws-policies");
|
|
5
|
+
const constants_1 = require("../../shared/constants");
|
|
6
|
+
// TODO: Update docs before release
|
|
7
|
+
exports.requiredPermissions = [
|
|
8
|
+
{
|
|
9
|
+
actions: [aws_policies_1.iam.GetUser],
|
|
10
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
11
|
+
resource: ['arn:aws:iam::*:user/${aws:username}'],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
actions: [aws_policies_1.iam.SimulatePrincipalPolicy],
|
|
15
|
+
resource: ['*'],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
// TODO: arn:aws:iam::678892195805:role/lambda-admin, can it be locked down more?
|
|
19
|
+
actions: [aws_policies_1.iam.PassRole],
|
|
20
|
+
resource: ['*'],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
actions: [
|
|
24
|
+
aws_policies_1.s3.GetObject,
|
|
25
|
+
aws_policies_1.s3.DeleteObject,
|
|
26
|
+
aws_policies_1.s3.DeleteBucket,
|
|
27
|
+
aws_policies_1.s3.PutBucketWebsite,
|
|
28
|
+
aws_policies_1.s3.DeleteBucketWebsite,
|
|
29
|
+
aws_policies_1.s3.PutObjectAcl,
|
|
30
|
+
aws_policies_1.s3.PutObject,
|
|
31
|
+
aws_policies_1.s3.GetBucketLocation,
|
|
32
|
+
],
|
|
33
|
+
resource: [`arn:aws:s3:::${constants_1.REMOTION_BUCKET_PREFIX}*`],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
actions: [aws_policies_1.s3.CreateBucket, aws_policies_1.s3.ListBucket, aws_policies_1.s3.PutBucketAcl],
|
|
37
|
+
resource: [`arn:aws:s3:::*`],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
actions: [aws_policies_1.s3.ListAllMyBuckets],
|
|
41
|
+
resource: ['*'],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
actions: [
|
|
45
|
+
aws_policies_1.lambda.GetFunction,
|
|
46
|
+
aws_policies_1.lambda.InvokeAsync,
|
|
47
|
+
aws_policies_1.lambda.InvokeFunction,
|
|
48
|
+
aws_policies_1.lambda.CreateFunction,
|
|
49
|
+
aws_policies_1.lambda.DeleteFunction,
|
|
50
|
+
aws_policies_1.lambda.PutFunctionEventInvokeConfig,
|
|
51
|
+
],
|
|
52
|
+
resource: [`arn:aws:lambda:*:*:function:${constants_1.RENDER_FN_PREFIX}*`],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
actions: [aws_policies_1.lambda.GetLayerVersion],
|
|
56
|
+
// TODO: Tighten up
|
|
57
|
+
resource: [`*`],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
actions: [aws_policies_1.lambda.ListFunctions],
|
|
61
|
+
resource: ['*'],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
actions: [aws_policies_1.logs.CreateLogGroup, aws_policies_1.logs.PutRetentionPolicy],
|
|
65
|
+
resource: ['*'],
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
//# sourceMappingURL=required-permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required-permissions.js","sourceRoot":"","sources":["../../../src/api/iam-validation/required-permissions.ts"],"names":[],"mappings":";;;AAAA,+CAAmD;AACnD,sDAAgF;AAEhF,mCAAmC;AACtB,QAAA,mBAAmB,GAG1B;IACL;QACC,OAAO,EAAE,CAAC,kBAAG,CAAC,OAAO,CAAC;QACtB,uDAAuD;QACvD,QAAQ,EAAE,CAAC,qCAAqC,CAAC;KACjD;IACD;QACC,OAAO,EAAE,CAAC,kBAAG,CAAC,uBAAuB,CAAC;QACtC,QAAQ,EAAE,CAAC,GAAG,CAAC;KACf;IACD;QACC,iFAAiF;QACjF,OAAO,EAAE,CAAC,kBAAG,CAAC,QAAQ,CAAC;QACvB,QAAQ,EAAE,CAAC,GAAG,CAAC;KACf;IACD;QACC,OAAO,EAAE;YACR,iBAAE,CAAC,SAAS;YACZ,iBAAE,CAAC,YAAY;YACf,iBAAE,CAAC,YAAY;YACf,iBAAE,CAAC,gBAAgB;YACnB,iBAAE,CAAC,mBAAmB;YACtB,iBAAE,CAAC,YAAY;YACf,iBAAE,CAAC,SAAS;YACZ,iBAAE,CAAC,iBAAiB;SACpB;QACD,QAAQ,EAAE,CAAC,gBAAgB,kCAAsB,GAAG,CAAC;KACrD;IACD;QACC,OAAO,EAAE,CAAC,iBAAE,CAAC,YAAY,EAAE,iBAAE,CAAC,UAAU,EAAE,iBAAE,CAAC,YAAY,CAAC;QAC1D,QAAQ,EAAE,CAAC,gBAAgB,CAAC;KAC5B;IACD;QACC,OAAO,EAAE,CAAC,iBAAE,CAAC,gBAAgB,CAAC;QAC9B,QAAQ,EAAE,CAAC,GAAG,CAAC;KACf;IACD;QACC,OAAO,EAAE;YACR,qBAAM,CAAC,WAAW;YAClB,qBAAM,CAAC,WAAW;YAClB,qBAAM,CAAC,cAAc;YACrB,qBAAM,CAAC,cAAc;YACrB,qBAAM,CAAC,cAAc;YACrB,qBAAM,CAAC,4BAA4B;SACnC;QACD,QAAQ,EAAE,CAAC,+BAA+B,4BAAgB,GAAG,CAAC;KAC9D;IACD;QACC,OAAO,EAAE,CAAC,qBAAM,CAAC,eAAe,CAAC;QACjC,mBAAmB;QACnB,QAAQ,EAAE,CAAC,GAAG,CAAC;KACf;IACD;QACC,OAAO,EAAE,CAAC,qBAAM,CAAC,aAAa,CAAC;QAC/B,QAAQ,EAAE,CAAC,GAAG,CAAC;KACf;IACD;QACC,OAAO,EAAE,CAAC,mBAAI,CAAC,cAAc,EAAE,mBAAI,CAAC,kBAAkB,CAAC;QACvD,QAAQ,EAAE,CAAC,GAAG,CAAC;KACf;CACD,CAAC"}
|
|
@@ -28,7 +28,7 @@ export declare const renderStillOnLambda: ({ functionName, serveUrl, inputProps,
|
|
|
28
28
|
envVariables?: Record<string, string> | undefined;
|
|
29
29
|
quality?: number | undefined;
|
|
30
30
|
frame?: number | undefined;
|
|
31
|
-
logLevel?: "
|
|
31
|
+
logLevel?: "error" | "verbose" | "info" | "warn" | undefined;
|
|
32
32
|
}) => Promise<{
|
|
33
33
|
estimatedPrice: import("../shared/constants").CostsInfo;
|
|
34
34
|
url: string;
|
|
@@ -37,7 +37,7 @@ export declare const renderVideoOnLambda: ({ functionName, serveUrl, inputProps,
|
|
|
37
37
|
maxRetries: number;
|
|
38
38
|
framesPerLambda?: number | undefined;
|
|
39
39
|
enableChunkOptimization?: boolean | undefined;
|
|
40
|
-
logLevel?: "
|
|
40
|
+
logLevel?: "error" | "verbose" | "info" | "warn" | undefined;
|
|
41
41
|
frameRange?: FrameRange | undefined;
|
|
42
42
|
}) => Promise<{
|
|
43
43
|
renderId: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../src/benchmark.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS,qBAuBpB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.benchmark = void 0;
|
|
4
|
+
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
+
const cli_1 = require("@remotion/cli");
|
|
6
|
+
const aws_clients_1 = require("./shared/aws-clients");
|
|
7
|
+
const toTest = [12, 15, 20, 100];
|
|
8
|
+
const runs = [1, 2, 3, 4, 5];
|
|
9
|
+
exports.benchmark = cli_1.CliInternals.xns(async () => {
|
|
10
|
+
for (const chunkSize of toTest) {
|
|
11
|
+
for (const run of runs) {
|
|
12
|
+
const id = `invoking with ${chunkSize},run ${run}/${runs.length}`;
|
|
13
|
+
console.time(id);
|
|
14
|
+
const res = await aws_clients_1.getLambdaClient('eu-central-1').send(new client_lambda_1.InvokeCommand({
|
|
15
|
+
FunctionName: 'remotion-render-test-5455111895707452',
|
|
16
|
+
// @ts-expect-error
|
|
17
|
+
Payload: JSON.stringify({
|
|
18
|
+
serveUrl: 'http://remotion-bucket-0.0469902062423555.s3.eu-central-1.amazonaws.com',
|
|
19
|
+
type: 'launch',
|
|
20
|
+
composition: 'my-video',
|
|
21
|
+
chunkSize,
|
|
22
|
+
}),
|
|
23
|
+
}));
|
|
24
|
+
console.timeEnd(id);
|
|
25
|
+
const string = Buffer.from(res.Payload).toString();
|
|
26
|
+
console.log(string);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=benchmark.js.map
|