@remotion/lambda 4.0.496 → 4.0.498
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-from-bundle.d.ts +28 -0
- package/dist/api/deploy-site-from-bundle.js +48 -0
- package/dist/api/deploy-site.d.ts +5 -11
- package/dist/api/deploy-site.js +43 -117
- package/dist/api/upload-dir.js +2 -1
- package/dist/cli/commands/sites/create.js +2 -0
- package/dist/esm/index.mjs +295 -126
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/shared/deploy-site-with-bundle.d.ts +31 -0
- package/dist/shared/deploy-site-with-bundle.js +116 -0
- package/dist/shared/get-etag.js +4 -4
- package/dist/shared/multipart-upload-part-size.d.ts +1 -0
- package/dist/shared/multipart-upload-part-size.js +4 -0
- package/dist/shared/validate-bundle-dir.d.ts +1 -0
- package/dist/shared/validate-bundle-dir.js +63 -0
- package/dist/shared/validate-site-name.js +9 -3
- package/package.json +13 -13
- package/remotionlambda-arm64.zip +0 -0
package/dist/esm/index.mjs
CHANGED
|
@@ -8604,7 +8604,7 @@ var require_package = __commonJS((exports, module) => {
|
|
|
8604
8604
|
url: "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
|
|
8605
8605
|
},
|
|
8606
8606
|
name: "@remotion/lambda",
|
|
8607
|
-
version: "4.0.
|
|
8607
|
+
version: "4.0.498",
|
|
8608
8608
|
description: "Render Remotion videos on AWS Lambda",
|
|
8609
8609
|
main: "dist/index.js",
|
|
8610
8610
|
scripts: {
|
|
@@ -9688,6 +9688,9 @@ var makeS3Key = (folder, dir, filePath) => {
|
|
|
9688
9688
|
return `${folder}/${path.relative(dir, filePath).split(path.sep).join("/")}`;
|
|
9689
9689
|
};
|
|
9690
9690
|
|
|
9691
|
+
// src/shared/multipart-upload-part-size.ts
|
|
9692
|
+
var multipartUploadPartSize = 40 * 1024 * 1024;
|
|
9693
|
+
|
|
9691
9694
|
// src/api/upload-dir.ts
|
|
9692
9695
|
async function getFiles(directory, originalDirectory, toUpload) {
|
|
9693
9696
|
const dirents = await fs.readdir(directory, { withFileTypes: true });
|
|
@@ -9745,7 +9748,7 @@ var uploadDir = async ({
|
|
|
9745
9748
|
const parallelUploadsS3 = new Upload({
|
|
9746
9749
|
client,
|
|
9747
9750
|
queueSize: 2,
|
|
9748
|
-
partSize:
|
|
9751
|
+
partSize: multipartUploadPartSize,
|
|
9749
9752
|
params: {
|
|
9750
9753
|
Key,
|
|
9751
9754
|
Bucket: bucket,
|
|
@@ -9798,20 +9801,19 @@ import * as path3 from "node:path";
|
|
|
9798
9801
|
// src/shared/get-etag.ts
|
|
9799
9802
|
import crypto from "node:crypto";
|
|
9800
9803
|
import fs2 from "node:fs";
|
|
9801
|
-
var chunk = 1024 * 1024 * 5;
|
|
9802
9804
|
var md5 = (data) => crypto.createHash("md5").update(data).digest("hex");
|
|
9803
9805
|
var getEtagOfFile = (filePath, onProgress) => {
|
|
9804
9806
|
const calc = async () => {
|
|
9805
9807
|
const size = await fs2.promises.stat(filePath).then((s) => s.size);
|
|
9806
|
-
if (size <=
|
|
9808
|
+
if (size <= multipartUploadPartSize) {
|
|
9807
9809
|
const buffer = await fs2.promises.readFile(filePath);
|
|
9808
9810
|
return `"${md5(buffer)}"`;
|
|
9809
9811
|
}
|
|
9810
9812
|
const stream = fs2.createReadStream(filePath, {
|
|
9811
|
-
highWaterMark:
|
|
9813
|
+
highWaterMark: multipartUploadPartSize
|
|
9812
9814
|
});
|
|
9813
9815
|
const md5Chunks = [];
|
|
9814
|
-
const chunksNumber = Math.ceil(size /
|
|
9816
|
+
const chunksNumber = Math.ceil(size / multipartUploadPartSize);
|
|
9815
9817
|
return new Promise((resolve, reject) => {
|
|
9816
9818
|
stream.on("data", (c) => {
|
|
9817
9819
|
md5Chunks.push(md5(c));
|
|
@@ -10030,12 +10032,16 @@ var deployFunction = ({
|
|
|
10030
10032
|
|
|
10031
10033
|
// src/api/deploy-site.ts
|
|
10032
10034
|
import fs4 from "node:fs";
|
|
10035
|
+
import { LambdaClientInternals as LambdaClientInternals7 } from "@remotion/lambda-client";
|
|
10036
|
+
import { getSitesKey as getSitesKey3 } from "@remotion/lambda-client/constants";
|
|
10037
|
+
import { wrapWithErrorHandling as wrapWithErrorHandling2 } from "@remotion/renderer/error-handling";
|
|
10038
|
+
|
|
10039
|
+
// src/shared/deploy-site-with-bundle.ts
|
|
10033
10040
|
import { LambdaClientInternals as LambdaClientInternals6 } from "@remotion/lambda-client";
|
|
10034
10041
|
import {
|
|
10035
10042
|
getSitesKey as getSitesKey2,
|
|
10036
10043
|
REMOTION_BUCKET_PREFIX as REMOTION_BUCKET_PREFIX3
|
|
10037
10044
|
} from "@remotion/lambda-client/constants";
|
|
10038
|
-
import { wrapWithErrorHandling as wrapWithErrorHandling2 } from "@remotion/renderer/error-handling";
|
|
10039
10045
|
import { validateBucketName, validatePrivacy } from "@remotion/serverless";
|
|
10040
10046
|
|
|
10041
10047
|
// src/shared/get-s3-operations.ts
|
|
@@ -10095,39 +10101,43 @@ var getS3DiffOperations = async ({
|
|
|
10095
10101
|
};
|
|
10096
10102
|
|
|
10097
10103
|
// src/shared/validate-site-name.ts
|
|
10104
|
+
var VALID_SITE_NAME_RE = /^[-0-9a-zA-Z!_.*'()]+$/;
|
|
10098
10105
|
var validateSiteName = (siteName) => {
|
|
10099
10106
|
if (typeof siteName === "undefined") {
|
|
10100
10107
|
return;
|
|
10101
10108
|
}
|
|
10102
10109
|
if (typeof siteName !== "string") {
|
|
10103
|
-
throw new TypeError(`The '
|
|
10110
|
+
throw new TypeError(`The 'siteName' argument must be a string if provided, but is ${JSON.stringify(siteName)}`);
|
|
10104
10111
|
}
|
|
10105
|
-
if (
|
|
10106
|
-
throw new Error("The `siteName` must
|
|
10112
|
+
if (siteName === "." || siteName === "..") {
|
|
10113
|
+
throw new Error("The `siteName` must not be `.` or `..`. You passed: " + siteName + ".");
|
|
10114
|
+
}
|
|
10115
|
+
if (!VALID_SITE_NAME_RE.test(siteName)) {
|
|
10116
|
+
throw new Error("The `siteName` must match the RegExp `/" + VALID_SITE_NAME_RE.source + "/`. You passed: " + siteName + ". Check for invalid characters.");
|
|
10107
10117
|
}
|
|
10108
10118
|
};
|
|
10109
10119
|
|
|
10110
|
-
// src/
|
|
10111
|
-
var
|
|
10120
|
+
// src/shared/deploy-site-with-bundle.ts
|
|
10121
|
+
var deleteConcurrency = 10;
|
|
10122
|
+
var deploySiteWithBundle = async ({
|
|
10112
10123
|
bucketName,
|
|
10113
|
-
|
|
10124
|
+
region,
|
|
10114
10125
|
siteName,
|
|
10115
10126
|
options,
|
|
10116
|
-
region,
|
|
10117
10127
|
privacy,
|
|
10118
|
-
gitSource,
|
|
10119
10128
|
throwIfSiteExists,
|
|
10120
10129
|
providerSpecifics,
|
|
10121
10130
|
forcePathStyle,
|
|
10122
10131
|
fullClientSpecifics,
|
|
10123
|
-
requestHandler
|
|
10132
|
+
requestHandler,
|
|
10133
|
+
getBundle
|
|
10124
10134
|
}) => {
|
|
10125
10135
|
LambdaClientInternals6.validateAwsRegion(region);
|
|
10126
10136
|
validateBucketName({
|
|
10127
10137
|
bucketName,
|
|
10128
10138
|
bucketNamePrefix: REMOTION_BUCKET_PREFIX3,
|
|
10129
10139
|
options: {
|
|
10130
|
-
mustStartWithRemotion: !options
|
|
10140
|
+
mustStartWithRemotion: !options.bypassBucketNameValidation
|
|
10131
10141
|
}
|
|
10132
10142
|
});
|
|
10133
10143
|
validateSiteName(siteName);
|
|
@@ -10144,7 +10154,7 @@ var mandatoryDeploySite = async ({
|
|
|
10144
10154
|
throw new Error(`No bucket with the name ${bucketName} exists`);
|
|
10145
10155
|
}
|
|
10146
10156
|
const subFolder = getSitesKey2(siteName);
|
|
10147
|
-
const [files,
|
|
10157
|
+
const [files, bundleDir] = await Promise.all([
|
|
10148
10158
|
providerSpecifics.listObjects({
|
|
10149
10159
|
bucketName,
|
|
10150
10160
|
expectedBucketOwner: accountId,
|
|
@@ -10153,38 +10163,7 @@ var mandatoryDeploySite = async ({
|
|
|
10153
10163
|
forcePathStyle,
|
|
10154
10164
|
requestHandler
|
|
10155
10165
|
}),
|
|
10156
|
-
|
|
10157
|
-
publicPath: `/${subFolder}/`,
|
|
10158
|
-
webpackOverride: options?.webpackOverride ?? ((f) => f),
|
|
10159
|
-
enableCaching: options?.enableCaching ?? true,
|
|
10160
|
-
publicDir: options?.publicDir ?? null,
|
|
10161
|
-
rootDir: options?.rootDir ?? null,
|
|
10162
|
-
ignoreRegisterRootWarning: options?.ignoreRegisterRootWarning ?? false,
|
|
10163
|
-
onProgress: options?.onBundleProgress ?? (() => {
|
|
10164
|
-
return;
|
|
10165
|
-
}),
|
|
10166
|
-
entryPoint,
|
|
10167
|
-
gitSource,
|
|
10168
|
-
bufferStateDelayInMilliseconds: null,
|
|
10169
|
-
maxTimelineTracks: null,
|
|
10170
|
-
onDirectoryCreated: () => {
|
|
10171
|
-
return;
|
|
10172
|
-
},
|
|
10173
|
-
onPublicDirCopyProgress: () => {
|
|
10174
|
-
return;
|
|
10175
|
-
},
|
|
10176
|
-
onSymlinkDetected: () => {
|
|
10177
|
-
return;
|
|
10178
|
-
},
|
|
10179
|
-
outDir: null,
|
|
10180
|
-
askAIEnabled: options?.askAIEnabled ?? true,
|
|
10181
|
-
interactivityEnabled: options?.interactivityEnabled ?? true,
|
|
10182
|
-
audioLatencyHint: null,
|
|
10183
|
-
keyboardShortcutsEnabled: options?.keyboardShortcutsEnabled ?? true,
|
|
10184
|
-
renderDefaults: null,
|
|
10185
|
-
rspack: options?.rspack ?? false,
|
|
10186
|
-
symlinkPublicDir: false
|
|
10187
|
-
})
|
|
10166
|
+
getBundle()
|
|
10188
10167
|
]);
|
|
10189
10168
|
if (throwIfSiteExists && files.length > 0) {
|
|
10190
10169
|
throw new Error("`throwIfSiteExists` was passed as true, but there are already files in this folder: " + files.slice(0, 5).map((f) => f.Key).join(", "));
|
|
@@ -10193,7 +10172,7 @@ var mandatoryDeploySite = async ({
|
|
|
10193
10172
|
let totalBytes = 0;
|
|
10194
10173
|
const { toDelete, toUpload, existingCount } = await getS3DiffOperations({
|
|
10195
10174
|
objects: files,
|
|
10196
|
-
bundle:
|
|
10175
|
+
bundle: bundleDir,
|
|
10197
10176
|
prefix: subFolder,
|
|
10198
10177
|
onProgress: (bytes) => {
|
|
10199
10178
|
totalBytes = bytes;
|
|
@@ -10202,21 +10181,32 @@ var mandatoryDeploySite = async ({
|
|
|
10202
10181
|
fullClientSpecifics
|
|
10203
10182
|
});
|
|
10204
10183
|
options.onDiffingProgress?.(totalBytes, true);
|
|
10205
|
-
|
|
10206
|
-
|
|
10184
|
+
const indexHtml = "index.html";
|
|
10185
|
+
const assetsToUpload = toUpload.filter((file) => file !== indexHtml);
|
|
10186
|
+
const indexHtmlToUpload = toUpload.filter((file) => file === indexHtml);
|
|
10187
|
+
const upload = (filesToUpload) => {
|
|
10188
|
+
if (filesToUpload.length === 0) {
|
|
10189
|
+
return Promise.resolve();
|
|
10190
|
+
}
|
|
10191
|
+
return fullClientSpecifics.uploadDir({
|
|
10207
10192
|
bucket: bucketName,
|
|
10208
10193
|
region,
|
|
10209
|
-
localDir:
|
|
10210
|
-
onProgress: options
|
|
10194
|
+
localDir: bundleDir,
|
|
10195
|
+
onProgress: options.onUploadProgress ?? (() => {
|
|
10211
10196
|
return;
|
|
10212
10197
|
}),
|
|
10213
10198
|
keyPrefix: subFolder,
|
|
10214
|
-
privacy
|
|
10215
|
-
toUpload,
|
|
10199
|
+
privacy,
|
|
10200
|
+
toUpload: filesToUpload,
|
|
10216
10201
|
forcePathStyle,
|
|
10217
10202
|
requestHandler
|
|
10218
|
-
})
|
|
10219
|
-
|
|
10203
|
+
});
|
|
10204
|
+
};
|
|
10205
|
+
await upload(assetsToUpload);
|
|
10206
|
+
await upload(indexHtmlToUpload);
|
|
10207
|
+
const limit2 = LambdaClientInternals6.pLimit(deleteConcurrency);
|
|
10208
|
+
await Promise.all(toDelete.map((d) => {
|
|
10209
|
+
return limit2(() => {
|
|
10220
10210
|
return providerSpecifics.deleteFile({
|
|
10221
10211
|
bucketName,
|
|
10222
10212
|
customCredentials: null,
|
|
@@ -10225,13 +10215,8 @@ var mandatoryDeploySite = async ({
|
|
|
10225
10215
|
forcePathStyle,
|
|
10226
10216
|
requestHandler
|
|
10227
10217
|
});
|
|
10228
|
-
}))
|
|
10229
|
-
]);
|
|
10230
|
-
if (fs4.existsSync(bundled)) {
|
|
10231
|
-
fs4.rmSync(bundled, {
|
|
10232
|
-
recursive: true
|
|
10233
10218
|
});
|
|
10234
|
-
}
|
|
10219
|
+
}));
|
|
10235
10220
|
return {
|
|
10236
10221
|
serveUrl: LambdaClientInternals6.makeS3ServeUrl({
|
|
10237
10222
|
bucketName,
|
|
@@ -10246,6 +10231,79 @@ var mandatoryDeploySite = async ({
|
|
|
10246
10231
|
}
|
|
10247
10232
|
};
|
|
10248
10233
|
};
|
|
10234
|
+
|
|
10235
|
+
// src/api/deploy-site.ts
|
|
10236
|
+
var mandatoryDeploySite = async ({
|
|
10237
|
+
bucketName,
|
|
10238
|
+
entryPoint,
|
|
10239
|
+
siteName,
|
|
10240
|
+
options,
|
|
10241
|
+
region,
|
|
10242
|
+
privacy,
|
|
10243
|
+
gitSource,
|
|
10244
|
+
throwIfSiteExists,
|
|
10245
|
+
providerSpecifics,
|
|
10246
|
+
forcePathStyle,
|
|
10247
|
+
fullClientSpecifics,
|
|
10248
|
+
requestHandler
|
|
10249
|
+
}) => {
|
|
10250
|
+
let generatedBundleDir = null;
|
|
10251
|
+
const result = await deploySiteWithBundle({
|
|
10252
|
+
bucketName,
|
|
10253
|
+
region,
|
|
10254
|
+
siteName,
|
|
10255
|
+
options,
|
|
10256
|
+
privacy,
|
|
10257
|
+
throwIfSiteExists,
|
|
10258
|
+
providerSpecifics,
|
|
10259
|
+
forcePathStyle,
|
|
10260
|
+
fullClientSpecifics,
|
|
10261
|
+
requestHandler,
|
|
10262
|
+
getBundle: async () => {
|
|
10263
|
+
generatedBundleDir = await fullClientSpecifics.bundleSite({
|
|
10264
|
+
publicPath: `/${getSitesKey3(siteName)}/`,
|
|
10265
|
+
bundlerOverride: options.bundlerOverride ?? ((f) => f),
|
|
10266
|
+
rspackOverride: options.rspackOverride ?? ((f) => f),
|
|
10267
|
+
webpackOverride: options.webpackOverride ?? ((f) => f),
|
|
10268
|
+
enableCaching: options.enableCaching ?? true,
|
|
10269
|
+
publicDir: options.publicDir ?? null,
|
|
10270
|
+
rootDir: options.rootDir ?? null,
|
|
10271
|
+
ignoreRegisterRootWarning: options.ignoreRegisterRootWarning ?? false,
|
|
10272
|
+
onProgress: options.onBundleProgress ?? (() => {
|
|
10273
|
+
return;
|
|
10274
|
+
}),
|
|
10275
|
+
entryPoint,
|
|
10276
|
+
gitSource,
|
|
10277
|
+
bufferStateDelayInMilliseconds: null,
|
|
10278
|
+
maxTimelineTracks: null,
|
|
10279
|
+
onDirectoryCreated: () => {
|
|
10280
|
+
return;
|
|
10281
|
+
},
|
|
10282
|
+
onPublicDirCopyProgress: () => {
|
|
10283
|
+
return;
|
|
10284
|
+
},
|
|
10285
|
+
onSymlinkDetected: () => {
|
|
10286
|
+
return;
|
|
10287
|
+
},
|
|
10288
|
+
outDir: null,
|
|
10289
|
+
askAIEnabled: options.askAIEnabled ?? true,
|
|
10290
|
+
interactivityEnabled: options.interactivityEnabled ?? true,
|
|
10291
|
+
audioLatencyHint: null,
|
|
10292
|
+
keyboardShortcutsEnabled: options.keyboardShortcutsEnabled ?? true,
|
|
10293
|
+
renderDefaults: null,
|
|
10294
|
+
rspack: options.rspack ?? false,
|
|
10295
|
+
symlinkPublicDir: false
|
|
10296
|
+
});
|
|
10297
|
+
return generatedBundleDir;
|
|
10298
|
+
}
|
|
10299
|
+
});
|
|
10300
|
+
if (generatedBundleDir && fs4.existsSync(generatedBundleDir)) {
|
|
10301
|
+
fs4.rmSync(generatedBundleDir, {
|
|
10302
|
+
recursive: true
|
|
10303
|
+
});
|
|
10304
|
+
}
|
|
10305
|
+
return result;
|
|
10306
|
+
};
|
|
10249
10307
|
var internalDeploySite = wrapWithErrorHandling2(mandatoryDeploySite);
|
|
10250
10308
|
var deploySite = (args) => {
|
|
10251
10309
|
return internalDeploySite({
|
|
@@ -10255,20 +10313,128 @@ var deploySite = (args) => {
|
|
|
10255
10313
|
gitSource: args.gitSource ?? null,
|
|
10256
10314
|
options: args.options ?? {},
|
|
10257
10315
|
privacy: args.privacy ?? "public",
|
|
10258
|
-
siteName: args.siteName ??
|
|
10316
|
+
siteName: args.siteName ?? LambdaClientInternals7.awsImplementation.randomHash(),
|
|
10259
10317
|
indent: false,
|
|
10260
10318
|
logLevel: "info",
|
|
10261
10319
|
throwIfSiteExists: args.throwIfSiteExists ?? false,
|
|
10262
|
-
providerSpecifics:
|
|
10320
|
+
providerSpecifics: LambdaClientInternals7.awsImplementation,
|
|
10263
10321
|
forcePathStyle: args.forcePathStyle ?? false,
|
|
10264
10322
|
fullClientSpecifics: awsFullClientSpecifics,
|
|
10265
10323
|
requestHandler: args.requestHandler ?? null
|
|
10266
10324
|
});
|
|
10267
10325
|
};
|
|
10268
10326
|
|
|
10269
|
-
// src/api/
|
|
10270
|
-
import path5 from "node:path";
|
|
10327
|
+
// src/api/deploy-site-from-bundle.ts
|
|
10271
10328
|
import { LambdaClientInternals as LambdaClientInternals8 } from "@remotion/lambda-client";
|
|
10329
|
+
import { wrapWithErrorHandling as wrapWithErrorHandling3 } from "@remotion/renderer/error-handling";
|
|
10330
|
+
|
|
10331
|
+
// src/shared/validate-bundle-dir.ts
|
|
10332
|
+
import fs5 from "node:fs";
|
|
10333
|
+
import path5 from "node:path";
|
|
10334
|
+
var getPublicPath = (indexHtml) => {
|
|
10335
|
+
const match = indexHtml.match(/window\.remotion_publicPath\s*=\s*("(?:[^"\\]|\\.)*")\s*;/);
|
|
10336
|
+
if (!match) {
|
|
10337
|
+
return null;
|
|
10338
|
+
}
|
|
10339
|
+
try {
|
|
10340
|
+
return JSON.parse(match[1]);
|
|
10341
|
+
} catch (error) {
|
|
10342
|
+
throw new Error("Could not parse `window.remotion_publicPath` in the bundle index.html.", { cause: error });
|
|
10343
|
+
}
|
|
10344
|
+
};
|
|
10345
|
+
var validateNoDirectorySymlinks = (directory, bundleDir) => {
|
|
10346
|
+
for (const entry of fs5.readdirSync(directory, { withFileTypes: true })) {
|
|
10347
|
+
const entryPath = path5.join(directory, entry.name);
|
|
10348
|
+
if (entry.isSymbolicLink()) {
|
|
10349
|
+
if (fs5.statSync(entryPath).isDirectory()) {
|
|
10350
|
+
throw new Error(`The bundle directory ${bundleDir} contains a symbolic link to a directory at ${path5.relative(bundleDir, entryPath)}. Directory symbolic links are not supported by \`deploySiteFromBundle()\`.`);
|
|
10351
|
+
}
|
|
10352
|
+
continue;
|
|
10353
|
+
}
|
|
10354
|
+
if (entry.isDirectory()) {
|
|
10355
|
+
validateNoDirectorySymlinks(entryPath, bundleDir);
|
|
10356
|
+
}
|
|
10357
|
+
}
|
|
10358
|
+
};
|
|
10359
|
+
var validateBundleDir = (bundleDir) => {
|
|
10360
|
+
if (typeof bundleDir !== "string") {
|
|
10361
|
+
throw new TypeError(`The \`bundleDir\` must be a string, but received ${JSON.stringify(bundleDir)}.`);
|
|
10362
|
+
}
|
|
10363
|
+
const resolvedBundleDir = path5.resolve(bundleDir);
|
|
10364
|
+
if (!fs5.existsSync(resolvedBundleDir)) {
|
|
10365
|
+
throw new Error(`The bundle directory ${resolvedBundleDir} does not exist. Run \`npx remotion bundle\` or pass a valid \`bundleDir\`.`);
|
|
10366
|
+
}
|
|
10367
|
+
if (!fs5.statSync(resolvedBundleDir).isDirectory()) {
|
|
10368
|
+
throw new Error(`The bundle path ${resolvedBundleDir} is not a directory. Pass the directory returned by \`bundle()\` or created by \`npx remotion bundle\`.`);
|
|
10369
|
+
}
|
|
10370
|
+
const indexHtmlPath = path5.join(resolvedBundleDir, "index.html");
|
|
10371
|
+
if (!fs5.existsSync(indexHtmlPath) || !fs5.statSync(indexHtmlPath).isFile()) {
|
|
10372
|
+
throw new Error(`The bundle directory ${resolvedBundleDir} does not contain an index.html file at its root.`);
|
|
10373
|
+
}
|
|
10374
|
+
const bundleScriptPath = path5.join(resolvedBundleDir, "bundle.js");
|
|
10375
|
+
if (!fs5.existsSync(bundleScriptPath) || !fs5.statSync(bundleScriptPath).isFile()) {
|
|
10376
|
+
throw new Error(`The bundle directory ${resolvedBundleDir} does not contain a bundle.js file at its root.`);
|
|
10377
|
+
}
|
|
10378
|
+
const indexHtml = fs5.readFileSync(indexHtmlPath, "utf8");
|
|
10379
|
+
const publicPath = getPublicPath(indexHtml);
|
|
10380
|
+
if (publicPath !== "./") {
|
|
10381
|
+
throw new Error(`The bundle at ${resolvedBundleDir} is not relocatable. Rebuild it using Remotion v4.0.497 or newer.`);
|
|
10382
|
+
}
|
|
10383
|
+
validateNoDirectorySymlinks(resolvedBundleDir, resolvedBundleDir);
|
|
10384
|
+
return resolvedBundleDir;
|
|
10385
|
+
};
|
|
10386
|
+
|
|
10387
|
+
// src/api/deploy-site-from-bundle.ts
|
|
10388
|
+
var mandatoryDeploySiteFromBundle = ({
|
|
10389
|
+
bucketName,
|
|
10390
|
+
bundleDir,
|
|
10391
|
+
region,
|
|
10392
|
+
siteName,
|
|
10393
|
+
options,
|
|
10394
|
+
privacy,
|
|
10395
|
+
throwIfSiteExists,
|
|
10396
|
+
providerSpecifics,
|
|
10397
|
+
forcePathStyle,
|
|
10398
|
+
fullClientSpecifics,
|
|
10399
|
+
requestHandler
|
|
10400
|
+
}) => {
|
|
10401
|
+
const resolvedBundleDir = validateBundleDir(bundleDir);
|
|
10402
|
+
return deploySiteWithBundle({
|
|
10403
|
+
bucketName,
|
|
10404
|
+
region,
|
|
10405
|
+
siteName,
|
|
10406
|
+
options,
|
|
10407
|
+
privacy,
|
|
10408
|
+
throwIfSiteExists,
|
|
10409
|
+
providerSpecifics,
|
|
10410
|
+
forcePathStyle,
|
|
10411
|
+
fullClientSpecifics,
|
|
10412
|
+
requestHandler,
|
|
10413
|
+
getBundle: () => Promise.resolve(resolvedBundleDir)
|
|
10414
|
+
});
|
|
10415
|
+
};
|
|
10416
|
+
var internalDeploySiteFromBundle = wrapWithErrorHandling3(mandatoryDeploySiteFromBundle);
|
|
10417
|
+
var deploySiteFromBundle = (args) => {
|
|
10418
|
+
return internalDeploySiteFromBundle({
|
|
10419
|
+
bucketName: args.bucketName,
|
|
10420
|
+
bundleDir: args.bundleDir,
|
|
10421
|
+
region: args.region,
|
|
10422
|
+
options: args.options ?? {},
|
|
10423
|
+
privacy: args.privacy ?? "public",
|
|
10424
|
+
siteName: args.siteName ?? LambdaClientInternals8.awsImplementation.randomHash(),
|
|
10425
|
+
indent: false,
|
|
10426
|
+
logLevel: args.logLevel ?? "info",
|
|
10427
|
+
throwIfSiteExists: args.throwIfSiteExists ?? false,
|
|
10428
|
+
providerSpecifics: LambdaClientInternals8.awsImplementation,
|
|
10429
|
+
forcePathStyle: args.forcePathStyle ?? false,
|
|
10430
|
+
fullClientSpecifics: awsFullClientSpecifics,
|
|
10431
|
+
requestHandler: args.requestHandler ?? null
|
|
10432
|
+
});
|
|
10433
|
+
};
|
|
10434
|
+
|
|
10435
|
+
// src/api/download-media.ts
|
|
10436
|
+
import path6 from "node:path";
|
|
10437
|
+
import { LambdaClientInternals as LambdaClientInternals10 } from "@remotion/lambda-client";
|
|
10272
10438
|
import { REMOTION_BUCKET_PREFIX as REMOTION_BUCKET_PREFIX4 } from "@remotion/lambda-client/constants";
|
|
10273
10439
|
import { RenderInternals as RenderInternals3 } from "@remotion/renderer";
|
|
10274
10440
|
import {
|
|
@@ -10279,7 +10445,7 @@ import {
|
|
|
10279
10445
|
// src/functions/helpers/read-with-progress.ts
|
|
10280
10446
|
import { GetObjectCommand } from "@aws-sdk/client-s3";
|
|
10281
10447
|
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
|
|
10282
|
-
import { LambdaClientInternals as
|
|
10448
|
+
import { LambdaClientInternals as LambdaClientInternals9 } from "@remotion/lambda-client";
|
|
10283
10449
|
import { RenderInternals as RenderInternals2 } from "@remotion/renderer";
|
|
10284
10450
|
var lambdaDownloadFileWithProgress = async ({
|
|
10285
10451
|
bucketName,
|
|
@@ -10294,7 +10460,7 @@ var lambdaDownloadFileWithProgress = async ({
|
|
|
10294
10460
|
requestHandler,
|
|
10295
10461
|
abortSignal
|
|
10296
10462
|
}) => {
|
|
10297
|
-
const client =
|
|
10463
|
+
const client = LambdaClientInternals9.getS3Client({
|
|
10298
10464
|
region,
|
|
10299
10465
|
customCredentials,
|
|
10300
10466
|
forcePathStyle,
|
|
@@ -10340,7 +10506,7 @@ var internalDownloadMedia = async (input) => {
|
|
|
10340
10506
|
if (!overallProgress.renderMetadata) {
|
|
10341
10507
|
throw new Error("Render did not finish yet");
|
|
10342
10508
|
}
|
|
10343
|
-
const outputPath =
|
|
10509
|
+
const outputPath = path6.resolve(process.cwd(), input.outPath);
|
|
10344
10510
|
RenderInternals3.ensureOutputDirectory(outputPath);
|
|
10345
10511
|
const { key, renderBucketName, customCredentials } = getExpectedOutName({
|
|
10346
10512
|
renderMetadata: overallProgress.renderMetadata,
|
|
@@ -10371,7 +10537,7 @@ var internalDownloadMedia = async (input) => {
|
|
|
10371
10537
|
var downloadMedia = (input) => {
|
|
10372
10538
|
return internalDownloadMedia({
|
|
10373
10539
|
...input,
|
|
10374
|
-
providerSpecifics:
|
|
10540
|
+
providerSpecifics: LambdaClientInternals10.awsImplementation,
|
|
10375
10541
|
forcePathStyle: false,
|
|
10376
10542
|
onProgress: input.onProgress ?? (() => {
|
|
10377
10543
|
return;
|
|
@@ -10387,7 +10553,7 @@ var downloadMedia = (input) => {
|
|
|
10387
10553
|
import { GetFunctionCommand as GetFunctionCommand2 } from "@aws-sdk/client-lambda";
|
|
10388
10554
|
import {
|
|
10389
10555
|
getFunctionVersion,
|
|
10390
|
-
LambdaClientInternals as
|
|
10556
|
+
LambdaClientInternals as LambdaClientInternals11
|
|
10391
10557
|
} from "@remotion/lambda-client";
|
|
10392
10558
|
import { DEFAULT_EPHEMERAL_STORAGE_IN_MB as DEFAULT_EPHEMERAL_STORAGE_IN_MB2 } from "@remotion/lambda-client/constants";
|
|
10393
10559
|
var getFunctionInfo = async ({
|
|
@@ -10396,9 +10562,9 @@ var getFunctionInfo = async ({
|
|
|
10396
10562
|
logLevel,
|
|
10397
10563
|
requestHandler
|
|
10398
10564
|
}) => {
|
|
10399
|
-
|
|
10565
|
+
LambdaClientInternals11.validateAwsRegion(region);
|
|
10400
10566
|
const [functionInfo, version] = await Promise.all([
|
|
10401
|
-
|
|
10567
|
+
LambdaClientInternals11.getLambdaClient(region, undefined, requestHandler).send(new GetFunctionCommand2({
|
|
10402
10568
|
FunctionName: functionName
|
|
10403
10569
|
})),
|
|
10404
10570
|
getFunctionVersion({
|
|
@@ -10418,14 +10584,14 @@ var getFunctionInfo = async ({
|
|
|
10418
10584
|
};
|
|
10419
10585
|
|
|
10420
10586
|
// src/api/get-or-create-bucket.ts
|
|
10421
|
-
import { LambdaClientInternals as
|
|
10587
|
+
import { LambdaClientInternals as LambdaClientInternals12 } from "@remotion/lambda-client";
|
|
10422
10588
|
import { internalGetOrCreateBucket } from "@remotion/serverless";
|
|
10423
10589
|
var getOrCreateBucket = (options) => {
|
|
10424
10590
|
return internalGetOrCreateBucket({
|
|
10425
10591
|
region: options.region,
|
|
10426
10592
|
enableFolderExpiry: options.enableFolderExpiry ?? null,
|
|
10427
10593
|
customCredentials: options.customCredentials ?? null,
|
|
10428
|
-
providerSpecifics:
|
|
10594
|
+
providerSpecifics: LambdaClientInternals12.awsImplementation,
|
|
10429
10595
|
forcePathStyle: false,
|
|
10430
10596
|
skipPutAcl: false,
|
|
10431
10597
|
requestHandler: options.requestHandler ?? null,
|
|
@@ -10445,14 +10611,14 @@ var getRegions = (options) => {
|
|
|
10445
10611
|
|
|
10446
10612
|
// src/api/iam-validation/simulate.ts
|
|
10447
10613
|
import { GetCallerIdentityCommand } from "@aws-sdk/client-sts";
|
|
10448
|
-
import { LambdaClientInternals as
|
|
10614
|
+
import { LambdaClientInternals as LambdaClientInternals14 } from "@remotion/lambda-client";
|
|
10449
10615
|
|
|
10450
10616
|
// src/api/iam-validation/simulate-rule.ts
|
|
10451
10617
|
import { SimulatePrincipalPolicyCommand } from "@aws-sdk/client-iam";
|
|
10452
|
-
import { LambdaClientInternals as
|
|
10618
|
+
import { LambdaClientInternals as LambdaClientInternals13 } from "@remotion/lambda-client";
|
|
10453
10619
|
var simulateRule = async (options) => {
|
|
10454
10620
|
try {
|
|
10455
|
-
const res = await
|
|
10621
|
+
const res = await LambdaClientInternals13.getIamClient(options.region, options.requestHandler).send(new SimulatePrincipalPolicyCommand({
|
|
10456
10622
|
ActionNames: options.actionNames,
|
|
10457
10623
|
PolicySourceArn: options.arn,
|
|
10458
10624
|
ResourceArns: options.resource
|
|
@@ -10487,7 +10653,7 @@ var logPermissionOutput = (output) => {
|
|
|
10487
10653
|
return [getEmojiForStatus(output.decision), output.name].join(" ");
|
|
10488
10654
|
};
|
|
10489
10655
|
var simulatePermissions = async (options) => {
|
|
10490
|
-
const callerIdentity = await
|
|
10656
|
+
const callerIdentity = await LambdaClientInternals14.getStsClient(options.region, options.requestHandler).send(new GetCallerIdentityCommand({}));
|
|
10491
10657
|
if (!callerIdentity?.Arn) {
|
|
10492
10658
|
throw new Error("No valid AWS Caller Identity detected");
|
|
10493
10659
|
}
|
|
@@ -10528,7 +10694,7 @@ var simulatePermissions = async (options) => {
|
|
|
10528
10694
|
|
|
10529
10695
|
// src/cli/index.ts
|
|
10530
10696
|
import { CliInternals as CliInternals23 } from "@remotion/cli";
|
|
10531
|
-
import { LambdaClientInternals as
|
|
10697
|
+
import { LambdaClientInternals as LambdaClientInternals24 } from "@remotion/lambda-client";
|
|
10532
10698
|
import { BINARY_NAME as BINARY_NAME14 } from "@remotion/lambda-client/constants";
|
|
10533
10699
|
import { RenderInternals as RenderInternals7 } from "@remotion/renderer";
|
|
10534
10700
|
import {
|
|
@@ -10559,29 +10725,29 @@ var forceFlagProvided = parsedLambdaCli.f || parsedLambdaCli.force || parsedLamb
|
|
|
10559
10725
|
import { CliInternals as CliInternals8 } from "@remotion/cli";
|
|
10560
10726
|
import {
|
|
10561
10727
|
getCompositionsOnLambda,
|
|
10562
|
-
LambdaClientInternals as
|
|
10728
|
+
LambdaClientInternals as LambdaClientInternals18
|
|
10563
10729
|
} from "@remotion/lambda-client";
|
|
10564
10730
|
import { BINARY_NAME as BINARY_NAME4 } from "@remotion/lambda-client/constants";
|
|
10565
10731
|
import { BrowserSafeApis } from "@remotion/renderer/client";
|
|
10566
10732
|
|
|
10567
10733
|
// src/cli/get-aws-region.ts
|
|
10568
|
-
import { LambdaClientInternals as
|
|
10734
|
+
import { LambdaClientInternals as LambdaClientInternals15 } from "@remotion/lambda-client";
|
|
10569
10735
|
import { DEFAULT_REGION } from "@remotion/lambda-client/constants";
|
|
10570
10736
|
var getAwsRegion = () => {
|
|
10571
10737
|
if (parsedLambdaCli.region) {
|
|
10572
|
-
|
|
10738
|
+
LambdaClientInternals15.validateAwsRegion(parsedLambdaCli.region);
|
|
10573
10739
|
return parsedLambdaCli.region;
|
|
10574
10740
|
}
|
|
10575
|
-
const envVariable =
|
|
10741
|
+
const envVariable = LambdaClientInternals15.getEnvVariable("REMOTION_AWS_REGION") ?? LambdaClientInternals15.getEnvVariable("AWS_REGION");
|
|
10576
10742
|
if (envVariable) {
|
|
10577
|
-
|
|
10743
|
+
LambdaClientInternals15.validateAwsRegion(envVariable);
|
|
10578
10744
|
return envVariable;
|
|
10579
10745
|
}
|
|
10580
10746
|
return DEFAULT_REGION;
|
|
10581
10747
|
};
|
|
10582
10748
|
|
|
10583
10749
|
// src/cli/helpers/find-function-name.ts
|
|
10584
|
-
import { LambdaClientInternals as
|
|
10750
|
+
import { LambdaClientInternals as LambdaClientInternals17 } from "@remotion/lambda-client";
|
|
10585
10751
|
import { BINARY_NAME as BINARY_NAME3 } from "@remotion/lambda-client/constants";
|
|
10586
10752
|
import { VERSION as VERSION4 } from "remotion/version";
|
|
10587
10753
|
|
|
@@ -10596,7 +10762,7 @@ var quit = (exitCode) => {
|
|
|
10596
10762
|
|
|
10597
10763
|
// src/cli/commands/functions/deploy.ts
|
|
10598
10764
|
import { CliInternals as CliInternals3 } from "@remotion/cli";
|
|
10599
|
-
import { LambdaClientInternals as
|
|
10765
|
+
import { LambdaClientInternals as LambdaClientInternals16 } from "@remotion/lambda-client";
|
|
10600
10766
|
import {
|
|
10601
10767
|
DEFAULT_CLOUDWATCH_RETENTION_PERIOD,
|
|
10602
10768
|
DEFAULT_EPHEMERAL_STORAGE_IN_MB as DEFAULT_EPHEMERAL_STORAGE_IN_MB3,
|
|
@@ -10663,9 +10829,9 @@ var functionsDeploySubcommand = async ({
|
|
|
10663
10829
|
const vpcSubnetIds = parsedLambdaCli["vpc-subnet-ids"] ?? undefined;
|
|
10664
10830
|
const vpcSecurityGroupIds = parsedLambdaCli["vpc-security-group-ids"] ?? undefined;
|
|
10665
10831
|
const runtimePreference = parsedLambdaCli["runtime-preference"] ?? "default";
|
|
10666
|
-
|
|
10832
|
+
LambdaClientInternals16.validateMemorySize(memorySizeInMb);
|
|
10667
10833
|
validateTimeout(timeoutInSeconds);
|
|
10668
|
-
|
|
10834
|
+
LambdaClientInternals16.validateDiskSizeInMb(diskSizeInMb);
|
|
10669
10835
|
validateCustomRoleArn(customRoleArn);
|
|
10670
10836
|
validateVpcSubnetIds(vpcSubnetIds);
|
|
10671
10837
|
validateVpcSecurityGroupIds(vpcSecurityGroupIds);
|
|
@@ -11021,7 +11187,7 @@ var findFunctionName = async ({
|
|
|
11021
11187
|
if (cliFlag) {
|
|
11022
11188
|
const compatibleFunctionExists = lambdasWithMatchingVersion.find((l) => l.functionName === cliFlag);
|
|
11023
11189
|
if (!compatibleFunctionExists) {
|
|
11024
|
-
Log.warn({ indent: false, logLevel }, `The name passed to --function-name "${cliFlag}" does not match the naming convention this version of the CLI expects: ${
|
|
11190
|
+
Log.warn({ indent: false, logLevel }, `The name passed to --function-name "${cliFlag}" does not match the naming convention this version of the CLI expects: ${LambdaClientInternals17.innerSpeculateFunctionName({ diskSizeInMb: "[disk]", memorySizeInMb: "[memory]", timeoutInSeconds: "[timeout]" })}.`);
|
|
11025
11191
|
Log.warn({ indent: false, logLevel }, "Remotion relies on the naming to determine function information. This is an unsupported workflow.");
|
|
11026
11192
|
if (lambdasWithMatchingVersion.length > 0) {
|
|
11027
11193
|
Log.info(logOptions, "The following functions were found:");
|
|
@@ -11123,7 +11289,7 @@ var compositionsCommand = async ({
|
|
|
11123
11289
|
darkMode
|
|
11124
11290
|
};
|
|
11125
11291
|
const region = getAwsRegion();
|
|
11126
|
-
|
|
11292
|
+
LambdaClientInternals18.validateServeUrl(serveUrl);
|
|
11127
11293
|
const functionName = await findFunctionName({ logLevel, providerSpecifics });
|
|
11128
11294
|
const comps = await getCompositionsOnLambda({
|
|
11129
11295
|
functionName,
|
|
@@ -11219,7 +11385,7 @@ import {
|
|
|
11219
11385
|
RequestServiceQuotaIncreaseCommand
|
|
11220
11386
|
} from "@aws-sdk/client-service-quotas";
|
|
11221
11387
|
import {
|
|
11222
|
-
LambdaClientInternals as
|
|
11388
|
+
LambdaClientInternals as LambdaClientInternals19
|
|
11223
11389
|
} from "@remotion/lambda-client";
|
|
11224
11390
|
import {
|
|
11225
11391
|
BINARY_NAME as BINARY_NAME6,
|
|
@@ -11235,15 +11401,15 @@ var makeQuotaUrl = ({
|
|
|
11235
11401
|
async function quotasIncreaseCommand(logLevel, requestHandler) {
|
|
11236
11402
|
const region = getAwsRegion();
|
|
11237
11403
|
const [concurrencyLimit, defaultConcurrencyLimit, changes] = await Promise.all([
|
|
11238
|
-
|
|
11404
|
+
LambdaClientInternals19.getServiceQuotasClient(region, requestHandler).send(new GetServiceQuotaCommand({
|
|
11239
11405
|
QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA,
|
|
11240
11406
|
ServiceCode: "lambda"
|
|
11241
11407
|
})),
|
|
11242
|
-
|
|
11408
|
+
LambdaClientInternals19.getServiceQuotasClient(region, requestHandler).send(new GetAWSDefaultServiceQuotaCommand({
|
|
11243
11409
|
QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA,
|
|
11244
11410
|
ServiceCode: "lambda"
|
|
11245
11411
|
})),
|
|
11246
|
-
|
|
11412
|
+
LambdaClientInternals19.getServiceQuotasClient(region, requestHandler).send(new ListRequestedServiceQuotaChangeHistoryByQuotaCommand({
|
|
11247
11413
|
QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA,
|
|
11248
11414
|
ServiceCode: "lambda"
|
|
11249
11415
|
}))
|
|
@@ -11277,7 +11443,7 @@ async function quotasIncreaseCommand(logLevel, requestHandler) {
|
|
|
11277
11443
|
quit(1);
|
|
11278
11444
|
}
|
|
11279
11445
|
try {
|
|
11280
|
-
await
|
|
11446
|
+
await LambdaClientInternals19.getServiceQuotasClient(region, requestHandler).send(new RequestServiceQuotaIncreaseCommand({
|
|
11281
11447
|
QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA,
|
|
11282
11448
|
DesiredValue: newLimit,
|
|
11283
11449
|
ServiceCode: "lambda"
|
|
@@ -11303,7 +11469,7 @@ import {
|
|
|
11303
11469
|
ListRequestedServiceQuotaChangeHistoryByQuotaCommand as ListRequestedServiceQuotaChangeHistoryByQuotaCommand2
|
|
11304
11470
|
} from "@aws-sdk/client-service-quotas";
|
|
11305
11471
|
import { CliInternals as CliInternals10 } from "@remotion/cli";
|
|
11306
|
-
import { LambdaClientInternals as
|
|
11472
|
+
import { LambdaClientInternals as LambdaClientInternals20 } from "@remotion/lambda-client";
|
|
11307
11473
|
import {
|
|
11308
11474
|
BINARY_NAME as BINARY_NAME7,
|
|
11309
11475
|
LAMBDA_CONCURRENCY_LIMIT_QUOTA as LAMBDA_CONCURRENCY_LIMIT_QUOTA2
|
|
@@ -11313,15 +11479,15 @@ var quotasListCommand = async (logLevel) => {
|
|
|
11313
11479
|
Log.info({ indent: false, logLevel }, CliInternals10.chalk.gray(`Region = ${region}`));
|
|
11314
11480
|
Log.info({ indent: false, logLevel });
|
|
11315
11481
|
const [concurrencyLimit, defaultConcurrencyLimit, changes] = await Promise.all([
|
|
11316
|
-
|
|
11482
|
+
LambdaClientInternals20.getServiceQuotasClient(region, null).send(new GetServiceQuotaCommand2({
|
|
11317
11483
|
QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA2,
|
|
11318
11484
|
ServiceCode: "lambda"
|
|
11319
11485
|
})),
|
|
11320
|
-
|
|
11486
|
+
LambdaClientInternals20.getServiceQuotasClient(region, null).send(new GetAWSDefaultServiceQuotaCommand2({
|
|
11321
11487
|
QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA2,
|
|
11322
11488
|
ServiceCode: "lambda"
|
|
11323
11489
|
})),
|
|
11324
|
-
|
|
11490
|
+
LambdaClientInternals20.getServiceQuotasClient(region, null).send(new ListRequestedServiceQuotaChangeHistoryByQuotaCommand2({
|
|
11325
11491
|
QuotaCode: LAMBDA_CONCURRENCY_LIMIT_QUOTA2,
|
|
11326
11492
|
ServiceCode: "lambda"
|
|
11327
11493
|
}))
|
|
@@ -11377,12 +11543,12 @@ var regionsCommand = (logLevel) => {
|
|
|
11377
11543
|
};
|
|
11378
11544
|
|
|
11379
11545
|
// src/cli/commands/render/render.ts
|
|
11380
|
-
import
|
|
11546
|
+
import path8 from "path";
|
|
11381
11547
|
import { CliInternals as CliInternals14 } from "@remotion/cli";
|
|
11382
11548
|
import { ConfigInternals } from "@remotion/cli/config";
|
|
11383
11549
|
import {
|
|
11384
11550
|
getRenderProgress,
|
|
11385
|
-
LambdaClientInternals as
|
|
11551
|
+
LambdaClientInternals as LambdaClientInternals22
|
|
11386
11552
|
} from "@remotion/lambda-client";
|
|
11387
11553
|
import {
|
|
11388
11554
|
BINARY_NAME as BINARY_NAME9,
|
|
@@ -11421,7 +11587,7 @@ function validateMaxRetries(maxRetries) {
|
|
|
11421
11587
|
}
|
|
11422
11588
|
|
|
11423
11589
|
// src/cli/helpers/get-s3-output-provider-from-cli.ts
|
|
11424
|
-
import { LambdaClientInternals as
|
|
11590
|
+
import { LambdaClientInternals as LambdaClientInternals21 } from "@remotion/lambda-client";
|
|
11425
11591
|
var S3_OUTPUT_PROVIDER_ACCESS_KEY_ID_ENV_NAME = "REMOTION_S3_OUTPUT_PROVIDER_ACCESS_KEY_ID";
|
|
11426
11592
|
var S3_OUTPUT_PROVIDER_SECRET_ACCESS_KEY_ENV_NAME = "REMOTION_S3_OUTPUT_PROVIDER_SECRET_ACCESS_KEY";
|
|
11427
11593
|
var getS3OutputProviderFromCli = ({
|
|
@@ -11438,8 +11604,8 @@ var getS3OutputProviderFromCli = ({
|
|
|
11438
11604
|
}
|
|
11439
11605
|
return {
|
|
11440
11606
|
endpoint,
|
|
11441
|
-
accessKeyId:
|
|
11442
|
-
secretAccessKey:
|
|
11607
|
+
accessKeyId: LambdaClientInternals21.getEnvVariable(S3_OUTPUT_PROVIDER_ACCESS_KEY_ID_ENV_NAME) ?? null,
|
|
11608
|
+
secretAccessKey: LambdaClientInternals21.getEnvVariable(S3_OUTPUT_PROVIDER_SECRET_ACCESS_KEY_ENV_NAME) ?? null,
|
|
11443
11609
|
region,
|
|
11444
11610
|
forcePathStyle
|
|
11445
11611
|
};
|
|
@@ -11466,9 +11632,9 @@ var makeOutNameWithCustomCredentials = ({
|
|
|
11466
11632
|
};
|
|
11467
11633
|
|
|
11468
11634
|
// src/cli/helpers/get-webhook-custom-data.ts
|
|
11469
|
-
import
|
|
11635
|
+
import fs6 from "node:fs";
|
|
11470
11636
|
import os from "node:os";
|
|
11471
|
-
import
|
|
11637
|
+
import path7 from "node:path";
|
|
11472
11638
|
import { BrowserSafeApis as BrowserSafeApis2 } from "@remotion/renderer/client";
|
|
11473
11639
|
var getWebhookCustomData = (logLevel) => {
|
|
11474
11640
|
const flagName = BrowserSafeApis2.options.webhookCustomDataOption.cliFlag;
|
|
@@ -11476,10 +11642,10 @@ var getWebhookCustomData = (logLevel) => {
|
|
|
11476
11642
|
if (!webhookFlag) {
|
|
11477
11643
|
return null;
|
|
11478
11644
|
}
|
|
11479
|
-
const jsonFile =
|
|
11645
|
+
const jsonFile = path7.resolve(process.cwd(), webhookFlag);
|
|
11480
11646
|
try {
|
|
11481
|
-
if (
|
|
11482
|
-
const rawJsonData =
|
|
11647
|
+
if (fs6.existsSync(jsonFile)) {
|
|
11648
|
+
const rawJsonData = fs6.readFileSync(jsonFile, "utf-8");
|
|
11483
11649
|
return JSON.parse(rawJsonData);
|
|
11484
11650
|
}
|
|
11485
11651
|
return JSON.parse(webhookFlag);
|
|
@@ -11832,7 +11998,7 @@ var renderCommand = async ({
|
|
|
11832
11998
|
let composition = args[1];
|
|
11833
11999
|
if (!composition) {
|
|
11834
12000
|
Log.info({ indent: false, logLevel }, "No compositions passed. Fetching compositions...");
|
|
11835
|
-
|
|
12001
|
+
LambdaClientInternals22.validateServeUrl(serveUrl);
|
|
11836
12002
|
if (!serveUrl.startsWith("https://") && !serveUrl.startsWith("http://")) {
|
|
11837
12003
|
throw Error(`Passing the shorthand serve URL without composition name is currently not supported.
|
|
11838
12004
|
Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.`);
|
|
@@ -11928,7 +12094,7 @@ var renderCommand = async ({
|
|
|
11928
12094
|
const concurrency = parsedLambdaCli["concurrency"] ?? undefined;
|
|
11929
12095
|
const concurrencyPerLambda = parsedLambdaCli["concurrency-per-lambda"] ?? 1;
|
|
11930
12096
|
const webhookCustomData = getWebhookCustomData(logLevel);
|
|
11931
|
-
const res = await
|
|
12097
|
+
const res = await LambdaClientInternals22.internalRenderMediaOnLambdaRaw({
|
|
11932
12098
|
functionName,
|
|
11933
12099
|
serveUrl,
|
|
11934
12100
|
inputProps,
|
|
@@ -12036,7 +12202,7 @@ var renderCommand = async ({
|
|
|
12036
12202
|
fallback: `Render folder: ${res.folderInS3Console}`
|
|
12037
12203
|
}));
|
|
12038
12204
|
}
|
|
12039
|
-
const adheresToFunctionNameConvention =
|
|
12205
|
+
const adheresToFunctionNameConvention = LambdaClientInternals22.parseFunctionName(functionName);
|
|
12040
12206
|
const status = await getRenderProgress({
|
|
12041
12207
|
functionName,
|
|
12042
12208
|
bucketName: res.bucketName,
|
|
@@ -12107,7 +12273,7 @@ var renderCommand = async ({
|
|
|
12107
12273
|
url: newStatus.outputFile
|
|
12108
12274
|
})), CliInternals14.chalk.gray(CliInternals14.formatBytes(newStatus.outputSizeInBytes)));
|
|
12109
12275
|
if (downloadOrNothing) {
|
|
12110
|
-
const relativeOutputPath =
|
|
12276
|
+
const relativeOutputPath = path8.relative(process.cwd(), downloadOrNothing.outputPath);
|
|
12111
12277
|
Log.info({ indent: false, logLevel }, CliInternals14.chalk.blue("↓".padEnd(CliInternals14.LABEL_WIDTH)), CliInternals14.chalk.blue(CliInternals14.makeHyperlink({
|
|
12112
12278
|
url: `file://${downloadOrNothing.outputPath}`,
|
|
12113
12279
|
text: relativeOutputPath,
|
|
@@ -12376,6 +12542,8 @@ var sitesCreateSubcommand = async (args, remotionRoot, logLevel, implementation)
|
|
|
12376
12542
|
enableCaching: BrowserSafeApis4.options.bundleCacheOption.getValue({
|
|
12377
12543
|
commandLine: CliInternals16.parsedCli
|
|
12378
12544
|
}).value,
|
|
12545
|
+
bundlerOverride: ConfigInternals2.getBundlerOverrideFn(),
|
|
12546
|
+
rspackOverride: ConfigInternals2.getRspackOverrideFn(),
|
|
12379
12547
|
webpackOverride: ConfigInternals2.getWebpackOverrideFn() ?? ((f) => f),
|
|
12380
12548
|
bypassBucketNameValidation: Boolean(parsedLambdaCli["force-bucket-name"]),
|
|
12381
12549
|
askAIEnabled,
|
|
@@ -12608,10 +12776,10 @@ var sitesCommand = (args, remotionRoot, logLevel, providerSpecifics) => {
|
|
|
12608
12776
|
};
|
|
12609
12777
|
|
|
12610
12778
|
// src/cli/commands/still.ts
|
|
12611
|
-
import
|
|
12779
|
+
import path9 from "path";
|
|
12612
12780
|
import { CliInternals as CliInternals21 } from "@remotion/cli";
|
|
12613
12781
|
import { ConfigInternals as ConfigInternals3 } from "@remotion/cli/config";
|
|
12614
|
-
import { LambdaClientInternals as
|
|
12782
|
+
import { LambdaClientInternals as LambdaClientInternals23 } from "@remotion/lambda-client";
|
|
12615
12783
|
import {
|
|
12616
12784
|
BINARY_NAME as BINARY_NAME12,
|
|
12617
12785
|
DEFAULT_MAX_RETRIES as DEFAULT_MAX_RETRIES2,
|
|
@@ -12725,7 +12893,7 @@ var stillCommand = async ({
|
|
|
12725
12893
|
}).value;
|
|
12726
12894
|
if (!composition) {
|
|
12727
12895
|
Log.info({ indent: false, logLevel }, "No compositions passed. Fetching compositions...");
|
|
12728
|
-
|
|
12896
|
+
LambdaClientInternals23.validateServeUrl(serveUrl);
|
|
12729
12897
|
if (!serveUrl.startsWith("https://") && !serveUrl.startsWith("http://")) {
|
|
12730
12898
|
throw Error(`Passing the shorthand serve URL without composition name is currently not supported.
|
|
12731
12899
|
Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.`);
|
|
@@ -12817,7 +12985,7 @@ var stillCommand = async ({
|
|
|
12817
12985
|
const jpegQuality = jpegQualityOption2.getValue({
|
|
12818
12986
|
commandLine: parsedCli
|
|
12819
12987
|
}).value;
|
|
12820
|
-
const res = await
|
|
12988
|
+
const res = await LambdaClientInternals23.internalRenderStillOnLambda({
|
|
12821
12989
|
functionName,
|
|
12822
12990
|
serveUrl,
|
|
12823
12991
|
inputProps,
|
|
@@ -12863,7 +13031,7 @@ var stillCommand = async ({
|
|
|
12863
13031
|
mediaCacheSizeInBytes,
|
|
12864
13032
|
isProduction: parsedLambdaCli[BrowserSafeApis5.options.isProductionOption.cliFlag] ?? true
|
|
12865
13033
|
});
|
|
12866
|
-
Log.info({ indent: false, logLevel }, CliInternals21.chalk.gray(`Render ID: ${CliInternals21.makeHyperlink({ text: res.renderId, fallback: res.renderId, url:
|
|
13034
|
+
Log.info({ indent: false, logLevel }, CliInternals21.chalk.gray(`Render ID: ${CliInternals21.makeHyperlink({ text: res.renderId, fallback: res.renderId, url: LambdaClientInternals23.getS3RenderUrl({ bucketName: res.bucketName, renderId: res.renderId, region: getAwsRegion() }) })}`));
|
|
12867
13035
|
Log.info({ indent: false, logLevel }, CliInternals21.chalk.gray(`Bucket: ${CliInternals21.makeHyperlink({ text: res.bucketName, fallback: res.bucketName, url: `https://${getAwsRegion()}.console.aws.amazon.com/s3/buckets/${res.bucketName}/?region=${getAwsRegion()}` })}`));
|
|
12868
13036
|
const artifactProgress = makeArtifactProgress(res.artifacts);
|
|
12869
13037
|
if (artifactProgress) {
|
|
@@ -12893,7 +13061,7 @@ var stillCommand = async ({
|
|
|
12893
13061
|
},
|
|
12894
13062
|
requestHandler: null
|
|
12895
13063
|
});
|
|
12896
|
-
const relativePath =
|
|
13064
|
+
const relativePath = path9.relative(process.cwd(), outputPath);
|
|
12897
13065
|
Log.info({ indent: false, logLevel }, chalk.blue("↓".padEnd(CliInternals21.LABEL_WIDTH)), chalk.blue(CliInternals21.makeHyperlink({
|
|
12898
13066
|
url: "file://" + outputPath,
|
|
12899
13067
|
text: relativePath,
|
|
@@ -13037,7 +13205,7 @@ var matchCommand = ({
|
|
|
13037
13205
|
};
|
|
13038
13206
|
var executeCommand = async (args, remotionRoot, logLevel, _providerSpecifics, fullClientSpecifics) => {
|
|
13039
13207
|
try {
|
|
13040
|
-
const providerSpecifics = _providerSpecifics ??
|
|
13208
|
+
const providerSpecifics = _providerSpecifics ?? LambdaClientInternals24.awsImplementation;
|
|
13041
13209
|
await matchCommand({
|
|
13042
13210
|
args,
|
|
13043
13211
|
remotionRoot,
|
|
@@ -13081,8 +13249,8 @@ AWS returned an "ConcurrentInvocationLimitExceeded" error message which could me
|
|
|
13081
13249
|
`.trim());
|
|
13082
13250
|
}
|
|
13083
13251
|
if (error.stack?.includes("The security token included in the request is invalid")) {
|
|
13084
|
-
const keyButDoesntStartWithAki =
|
|
13085
|
-
const pureKeyButDoesntStartWithAki =
|
|
13252
|
+
const keyButDoesntStartWithAki = LambdaClientInternals24.getEnvVariable("REMOTION_AWS_ACCESS_KEY_ID") && !LambdaClientInternals24.getEnvVariable("REMOTION_AWS_ACCESS_KEY_ID").startsWith("AKI");
|
|
13253
|
+
const pureKeyButDoesntStartWithAki = LambdaClientInternals24.getEnvVariable("AWS_ACCESS_KEY_ID") && !LambdaClientInternals24.getEnvVariable("AWS_ACCESS_KEY_ID").startsWith("AKI");
|
|
13086
13254
|
if (keyButDoesntStartWithAki || pureKeyButDoesntStartWithAki) {
|
|
13087
13255
|
Log.error({ indent: false, logLevel }, `
|
|
13088
13256
|
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:
|
|
@@ -13154,6 +13322,7 @@ export {
|
|
|
13154
13322
|
getAwsClient,
|
|
13155
13323
|
estimatePrice,
|
|
13156
13324
|
downloadMedia,
|
|
13325
|
+
deploySiteFromBundle,
|
|
13157
13326
|
deploySite,
|
|
13158
13327
|
deployFunction,
|
|
13159
13328
|
deleteSite,
|