@remotion/lambda 4.0.189 → 4.0.192
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.d.ts +3 -3
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
- package/dist/functions/helpers/check-if-render-exists.d.ts +3 -0
- package/dist/functions/helpers/check-if-render-exists.js +15 -0
- package/dist/functions/helpers/delete-chunks.d.ts +9 -0
- package/dist/functions/helpers/delete-chunks.js +25 -0
- package/dist/functions/helpers/expected-out-name.d.ts +1 -1
- package/dist/functions/helpers/get-browser-instance.d.ts +2 -3
- package/dist/functions/helpers/get-browser-instance.js +4 -3
- package/dist/functions/helpers/get-cleanup-progress.d.ts +10 -0
- package/dist/functions/helpers/get-cleanup-progress.js +35 -0
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/get-custom-out-name.d.ts +1 -1
- package/dist/functions/helpers/get-encoding-metadata.d.ts +7 -0
- package/dist/functions/helpers/get-encoding-metadata.js +15 -0
- package/dist/functions/helpers/get-encoding-progress-step-size.d.ts +1 -0
- package/dist/functions/helpers/get-encoding-progress-step-size.js +7 -0
- package/dist/functions/helpers/get-files-to-delete.d.ts +10 -0
- package/dist/functions/helpers/get-files-to-delete.js +52 -0
- package/dist/functions/helpers/get-final-encoding-status.d.ts +6 -0
- package/dist/functions/helpers/get-final-encoding-status.js +18 -0
- package/dist/functions/helpers/get-folder-size.d.ts +1 -0
- package/dist/functions/helpers/get-folder-size.js +8 -0
- package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +8 -0
- package/dist/functions/helpers/get-lambdas-invoked-stats.js +14 -0
- package/dist/functions/helpers/get-post-render-data.d.ts +8 -0
- package/dist/functions/helpers/get-post-render-data.js +22 -0
- package/dist/functions/helpers/get-render-metadata.d.ts +8 -0
- package/dist/functions/helpers/get-render-metadata.js +17 -0
- package/dist/functions/helpers/get-rendered-frames-progress.d.ts +8 -0
- package/dist/functions/helpers/get-rendered-frames-progress.js +37 -0
- package/dist/functions/helpers/get-time-to-finish.d.ts +5 -0
- package/dist/functions/helpers/get-time-to-finish.js +13 -0
- package/dist/functions/helpers/io.d.ts +33 -3
- package/dist/functions/helpers/io.js +104 -3
- package/dist/functions/helpers/print-cloudwatch-helper.d.ts +1 -1
- package/dist/functions/helpers/print-cloudwatch-helper.js +3 -3
- package/dist/functions/helpers/streaming-payloads.d.ts +19 -0
- package/dist/functions/helpers/streaming-payloads.js +25 -0
- package/dist/functions/helpers/write-lambda-error.d.ts +3 -2
- package/dist/functions/helpers/write-lambda-error.js +2 -3
- package/dist/functions/helpers/write-post-render-data.d.ts +9 -0
- package/dist/functions/helpers/write-post-render-data.js +18 -0
- package/dist/functions/merge.d.ts +9 -0
- package/dist/functions/merge.js +61 -0
- package/dist/internals.d.ts +6 -6
- package/dist/shared/chunk-progress.d.ts +9 -0
- package/dist/shared/chunk-progress.js +2034 -0
- package/dist/shared/compress-props.d.ts +6 -8
- package/dist/shared/compress-props.js +14 -11
- package/dist/shared/parse-chunk-key.d.ts +5 -0
- package/dist/shared/parse-chunk-key.js +15 -0
- package/dist/shared/parse-lambda-initialized-key.d.ts +5 -0
- package/dist/shared/parse-lambda-initialized-key.js +15 -0
- package/dist/shared/serialize-props.d.ts +14 -0
- package/dist/shared/serialize-props.js +36 -0
- package/package.json +11 -11
- package/remotionlambda-arm64.zip +0 -0
- package/dist/functions/provider-implementation.d.ts +0 -0
- package/dist/functions/provider-implementation.js +0 -1
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { SerializedInputProps } from '@remotion/serverless/client';
|
|
2
|
+
import type { AwsRegion } from '../client';
|
|
3
3
|
type PropsType = 'input-props' | 'resolved-props';
|
|
4
4
|
export declare const serializeOrThrow: (inputProps: Record<string, unknown>, propsType: PropsType) => string;
|
|
5
5
|
export declare const getNeedsToUpload: (type: 'still' | 'video-or-audio', sizes: number[]) => boolean;
|
|
6
|
-
export declare const compressInputProps:
|
|
6
|
+
export declare const compressInputProps: ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, }: {
|
|
7
7
|
stringifiedInputProps: string;
|
|
8
|
-
region:
|
|
8
|
+
region: AwsRegion;
|
|
9
9
|
userSpecifiedBucketName: string | null;
|
|
10
10
|
propsType: PropsType;
|
|
11
11
|
needsToUpload: boolean;
|
|
12
|
-
providerSpecifics: ProviderSpecifics<Region>;
|
|
13
12
|
}) => Promise<SerializedInputProps>;
|
|
14
|
-
export declare const decompressInputProps:
|
|
13
|
+
export declare const decompressInputProps: ({ serialized, region, bucketName, expectedBucketOwner, propsType, }: {
|
|
15
14
|
serialized: SerializedInputProps;
|
|
16
|
-
region:
|
|
15
|
+
region: AwsRegion;
|
|
17
16
|
bucketName: string;
|
|
18
17
|
expectedBucketOwner: string;
|
|
19
18
|
propsType: PropsType;
|
|
20
|
-
providerSpecifics: ProviderSpecifics<Region>;
|
|
21
19
|
}) => Promise<string>;
|
|
22
20
|
export {};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.decompressInputProps = exports.compressInputProps = exports.getNeedsToUpload = exports.serializeOrThrow = void 0;
|
|
4
|
-
const client_1 = require("@remotion/serverless/client");
|
|
5
4
|
const no_react_1 = require("remotion/no-react");
|
|
5
|
+
const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
|
|
6
|
+
const io_1 = require("../functions/helpers/io");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const random_hash_1 = require("./random-hash");
|
|
9
|
+
const stream_to_string_1 = require("./stream-to-string");
|
|
6
10
|
const validate_webhook_1 = require("./validate-webhook");
|
|
7
11
|
const makeKey = (type, hash) => {
|
|
8
12
|
if (type === 'input-props') {
|
|
9
|
-
return (0,
|
|
13
|
+
return (0, constants_1.inputPropsKey)(hash);
|
|
10
14
|
}
|
|
11
|
-
return (0,
|
|
15
|
+
return (0, constants_1.resolvedPropsKey)(hash);
|
|
12
16
|
};
|
|
13
17
|
const serializeOrThrow = (inputProps, propsType) => {
|
|
14
18
|
try {
|
|
@@ -35,16 +39,15 @@ const getNeedsToUpload = (type, sizes) => {
|
|
|
35
39
|
return false;
|
|
36
40
|
};
|
|
37
41
|
exports.getNeedsToUpload = getNeedsToUpload;
|
|
38
|
-
const compressInputProps = async ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload,
|
|
39
|
-
const hash =
|
|
42
|
+
const compressInputProps = async ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, }) => {
|
|
43
|
+
const hash = (0, random_hash_1.randomHash)();
|
|
40
44
|
if (needsToUpload) {
|
|
41
|
-
const bucketName = userSpecifiedBucketName !== null && userSpecifiedBucketName !== void 0 ? userSpecifiedBucketName : (await (0,
|
|
45
|
+
const bucketName = userSpecifiedBucketName !== null && userSpecifiedBucketName !== void 0 ? userSpecifiedBucketName : (await (0, get_or_create_bucket_1.internalGetOrCreateBucket)({
|
|
42
46
|
region,
|
|
43
47
|
enableFolderExpiry: null,
|
|
44
48
|
customCredentials: null,
|
|
45
|
-
providerSpecifics,
|
|
46
49
|
})).bucketName;
|
|
47
|
-
await
|
|
50
|
+
await (0, io_1.lambdaWriteFile)({
|
|
48
51
|
body: stringifiedInputProps,
|
|
49
52
|
bucketName,
|
|
50
53
|
region,
|
|
@@ -66,18 +69,18 @@ const compressInputProps = async ({ stringifiedInputProps, region, userSpecified
|
|
|
66
69
|
};
|
|
67
70
|
};
|
|
68
71
|
exports.compressInputProps = compressInputProps;
|
|
69
|
-
const decompressInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, propsType,
|
|
72
|
+
const decompressInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, propsType, }) => {
|
|
70
73
|
if (serialized.type === 'payload') {
|
|
71
74
|
return serialized.payload;
|
|
72
75
|
}
|
|
73
76
|
try {
|
|
74
|
-
const response = await
|
|
77
|
+
const response = await (0, io_1.lambdaReadFile)({
|
|
75
78
|
bucketName,
|
|
76
79
|
expectedBucketOwner,
|
|
77
80
|
key: makeKey(propsType, serialized.hash),
|
|
78
81
|
region,
|
|
79
82
|
});
|
|
80
|
-
const body = await (0,
|
|
83
|
+
const body = await (0, stream_to_string_1.streamToString)(response);
|
|
81
84
|
const payload = body;
|
|
82
85
|
return payload;
|
|
83
86
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseLambdaChunkKey = void 0;
|
|
4
|
+
const parseLambdaChunkKey = (key) => {
|
|
5
|
+
const match = key.match(/^renders\/(.*)\/chunks\/chunk:([0-9]+):(video|audio)$/);
|
|
6
|
+
if (!match) {
|
|
7
|
+
throw new Error(`Cannot parse filename ${key} into timing information. Malformed data.`);
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
renderId: match[1],
|
|
11
|
+
chunk: Number(match[2]),
|
|
12
|
+
type: match[3],
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.parseLambdaChunkKey = parseLambdaChunkKey;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseLambdaInitializedKey = void 0;
|
|
4
|
+
const parseLambdaInitializedKey = (key) => {
|
|
5
|
+
const match = key.match(/^renders\/(.*)\/lambda-initialized-chunk:([0-9]+)-attempt:([0-9]+).txt$/);
|
|
6
|
+
if (!match) {
|
|
7
|
+
throw new Error(`Cannot parse filename ${key} into timing information. Malformed data.`);
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
renderId: match[1],
|
|
11
|
+
chunk: Number(match[2]),
|
|
12
|
+
attempt: Number(match[3]),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.parseLambdaInitializedKey = parseLambdaInitializedKey;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type SerializedJSONWithCustomFields = {
|
|
2
|
+
serializedString: string;
|
|
3
|
+
customDateUsed: boolean;
|
|
4
|
+
customFileUsed: boolean;
|
|
5
|
+
mapUsed: boolean;
|
|
6
|
+
setUsed: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const FILE_TOKEN = "remotion-file:";
|
|
9
|
+
export declare const serializeJSONWithDate: ({ data, indent, staticBase, }: {
|
|
10
|
+
data: Record<string, unknown>;
|
|
11
|
+
indent: number | undefined;
|
|
12
|
+
staticBase: string | null;
|
|
13
|
+
}) => SerializedJSONWithCustomFields;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Must keep this file in sync with the one in packages/core/src/input-props-serialization.ts!
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.serializeJSONWithDate = exports.FILE_TOKEN = void 0;
|
|
5
|
+
const DATE_TOKEN = 'remotion-date:';
|
|
6
|
+
exports.FILE_TOKEN = 'remotion-file:';
|
|
7
|
+
const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
|
|
8
|
+
let customDateUsed = false;
|
|
9
|
+
let customFileUsed = false;
|
|
10
|
+
let mapUsed = false;
|
|
11
|
+
let setUsed = false;
|
|
12
|
+
const serializedString = JSON.stringify(data, function (key, value) {
|
|
13
|
+
const item = this[key];
|
|
14
|
+
if (item instanceof Date) {
|
|
15
|
+
customDateUsed = true;
|
|
16
|
+
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
17
|
+
}
|
|
18
|
+
if (item instanceof Map) {
|
|
19
|
+
mapUsed = true;
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
if (item instanceof Set) {
|
|
23
|
+
setUsed = true;
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
if (typeof item === 'string' &&
|
|
27
|
+
staticBase !== null &&
|
|
28
|
+
item.startsWith(staticBase)) {
|
|
29
|
+
customFileUsed = true;
|
|
30
|
+
return `${exports.FILE_TOKEN}${item.replace(staticBase + '/', '')}`;
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
}, indent);
|
|
34
|
+
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
35
|
+
};
|
|
36
|
+
exports.serializeJSONWithDate = serializeJSONWithDate;
|
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.192",
|
|
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.583.0",
|
|
23
23
|
"mime-types": "2.1.34",
|
|
24
24
|
"zod": "3.22.3",
|
|
25
|
-
"@remotion/bundler": "4.0.
|
|
26
|
-
"@remotion/
|
|
27
|
-
"@remotion/
|
|
28
|
-
"@remotion/studio-server": "4.0.
|
|
29
|
-
"@remotion/streaming": "4.0.
|
|
30
|
-
"
|
|
31
|
-
"remotion": "4.0.
|
|
25
|
+
"@remotion/bundler": "4.0.192",
|
|
26
|
+
"@remotion/renderer": "4.0.192",
|
|
27
|
+
"@remotion/cli": "4.0.192",
|
|
28
|
+
"@remotion/studio-server": "4.0.192",
|
|
29
|
+
"@remotion/streaming": "4.0.192",
|
|
30
|
+
"remotion": "4.0.192",
|
|
31
|
+
"@remotion/serverless": "4.0.192"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/mime-types": "2.1.1",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"pureimage": "0.4.13",
|
|
38
38
|
"vitest": "0.31.1",
|
|
39
39
|
"zip-lib": "^0.7.2",
|
|
40
|
-
"@remotion/bundler": "4.0.
|
|
41
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
40
|
+
"@remotion/bundler": "4.0.192",
|
|
41
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.192"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@remotion/bundler": "4.0.
|
|
44
|
+
"@remotion/bundler": "4.0.192"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|