@remotion/lambda 4.0.242 → 4.0.244
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/upload-dir.js +44 -27
- package/package.json +12 -12
- package/remotionlambda-arm64.zip +0 -0
package/dist/api/upload-dir.js
CHANGED
|
@@ -45,7 +45,7 @@ async function getFiles(directory, originalDirectory, toUpload) {
|
|
|
45
45
|
}));
|
|
46
46
|
return _files.flat(1);
|
|
47
47
|
}
|
|
48
|
-
const limit = (0, p_limit_1.pLimit)(
|
|
48
|
+
const limit = (0, p_limit_1.pLimit)(30);
|
|
49
49
|
const uploadDir = async ({ bucket, region, localDir, onProgress, keyPrefix, privacy, toUpload, forcePathStyle, }) => {
|
|
50
50
|
const files = await getFiles(localDir, localDir, toUpload);
|
|
51
51
|
const progresses = {};
|
|
@@ -53,34 +53,51 @@ const uploadDir = async ({ bucket, region, localDir, onProgress, keyPrefix, priv
|
|
|
53
53
|
progresses[file.name] = 0;
|
|
54
54
|
}
|
|
55
55
|
const client = (0, get_s3_client_1.getS3Client)({ region, customCredentials: null, forcePathStyle });
|
|
56
|
+
const uploadWithoutRetry = async (filePath) => {
|
|
57
|
+
const Key = (0, make_s3_key_1.makeS3Key)(keyPrefix, localDir, filePath.name);
|
|
58
|
+
const Body = (0, node_fs_1.createReadStream)(filePath.name);
|
|
59
|
+
const ContentType = mime_types_1.default.lookup(Key) || 'application/octet-stream';
|
|
60
|
+
const ACL = privacy === 'no-acl'
|
|
61
|
+
? undefined
|
|
62
|
+
: privacy === 'private'
|
|
63
|
+
? 'private'
|
|
64
|
+
: 'public-read';
|
|
65
|
+
const paralellUploads3 = new lib_storage_1.Upload({
|
|
66
|
+
client,
|
|
67
|
+
queueSize: 4,
|
|
68
|
+
partSize: 5 * 1024 * 1024,
|
|
69
|
+
params: {
|
|
70
|
+
Key,
|
|
71
|
+
Bucket: bucket,
|
|
72
|
+
Body,
|
|
73
|
+
ACL,
|
|
74
|
+
ContentType,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
paralellUploads3.on('httpUploadProgress', (progress) => {
|
|
78
|
+
var _a;
|
|
79
|
+
progresses[filePath.name] = (_a = progress.loaded) !== null && _a !== void 0 ? _a : 0;
|
|
80
|
+
});
|
|
81
|
+
const prom = await paralellUploads3.done();
|
|
82
|
+
return prom;
|
|
83
|
+
};
|
|
84
|
+
const uploadWithRetry = async (filePath) => {
|
|
85
|
+
let error = null;
|
|
86
|
+
for (let i = 0; i < 3; i++) {
|
|
87
|
+
try {
|
|
88
|
+
return await uploadWithoutRetry(filePath);
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
error = err;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (error) {
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
56
98
|
const uploadAll = (async () => {
|
|
57
99
|
const uploads = files.map((filePath) => limit(async () => {
|
|
58
|
-
|
|
59
|
-
const Body = (0, node_fs_1.createReadStream)(filePath.name);
|
|
60
|
-
const ContentType = mime_types_1.default.lookup(Key) || 'application/octet-stream';
|
|
61
|
-
const ACL = privacy === 'no-acl'
|
|
62
|
-
? undefined
|
|
63
|
-
: privacy === 'private'
|
|
64
|
-
? 'private'
|
|
65
|
-
: 'public-read';
|
|
66
|
-
const paralellUploads3 = new lib_storage_1.Upload({
|
|
67
|
-
client,
|
|
68
|
-
queueSize: 4,
|
|
69
|
-
partSize: 5 * 1024 * 1024,
|
|
70
|
-
params: {
|
|
71
|
-
Key,
|
|
72
|
-
Bucket: bucket,
|
|
73
|
-
Body,
|
|
74
|
-
ACL,
|
|
75
|
-
ContentType,
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
paralellUploads3.on('httpUploadProgress', (progress) => {
|
|
79
|
-
var _a;
|
|
80
|
-
progresses[filePath.name] = (_a = progress.loaded) !== null && _a !== void 0 ? _a : 0;
|
|
81
|
-
});
|
|
82
|
-
const prom = await paralellUploads3.done();
|
|
83
|
-
return prom;
|
|
100
|
+
await uploadWithRetry(filePath);
|
|
84
101
|
}));
|
|
85
102
|
await Promise.all(uploads);
|
|
86
103
|
})();
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/lambda",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.244",
|
|
7
7
|
"description": "Render Remotion videos on AWS Lambda",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"@aws-sdk/s3-request-presigner": "3.645.0",
|
|
23
23
|
"mime-types": "2.1.34",
|
|
24
24
|
"zod": "3.22.3",
|
|
25
|
-
"@remotion/
|
|
26
|
-
"@remotion/cli": "4.0.
|
|
27
|
-
"@remotion/
|
|
28
|
-
"
|
|
29
|
-
"@remotion/
|
|
30
|
-
"@remotion/
|
|
31
|
-
"remotion": "4.0.
|
|
25
|
+
"@remotion/renderer": "4.0.244",
|
|
26
|
+
"@remotion/cli": "4.0.244",
|
|
27
|
+
"@remotion/streaming": "4.0.244",
|
|
28
|
+
"remotion": "4.0.244",
|
|
29
|
+
"@remotion/serverless": "4.0.244",
|
|
30
|
+
"@remotion/studio-server": "4.0.244",
|
|
31
|
+
"@remotion/bundler": "4.0.244"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/mime-types": "2.1.1",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"vitest": "0.31.1",
|
|
39
39
|
"zip-lib": "^0.7.2",
|
|
40
40
|
"eslint": "9.14.0",
|
|
41
|
-
"@remotion/bundler": "4.0.
|
|
42
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
43
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
41
|
+
"@remotion/bundler": "4.0.244",
|
|
42
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.244",
|
|
43
|
+
"@remotion/eslint-config-internal": "4.0.244"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@remotion/bundler": "4.0.
|
|
46
|
+
"@remotion/bundler": "4.0.244"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|