@remotion/lambda 4.0.0-copy.4 → 4.0.0-esm.17
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/LICENSE.md +1 -1
- package/dist/admin/bundle-lambda.js +20 -4
- package/dist/admin/generate-etag-list.d.ts +1 -0
- package/dist/admin/generate-etag-list.js +14 -0
- package/dist/admin/make-layer-public.js +23 -1
- package/dist/api/deploy-function.js +3 -1
- package/dist/api/deploy-site.d.ts +5 -0
- package/dist/api/deploy-site.js +39 -21
- package/dist/api/get-aws-client.d.ts +2 -0
- package/dist/api/get-aws-client.js +2 -0
- package/dist/api/get-buckets.js +26 -9
- package/dist/api/get-compositions-on-lambda.d.ts +2 -1
- package/dist/api/get-compositions-on-lambda.js +1 -3
- package/dist/api/get-or-create-bucket.js +2 -7
- package/dist/api/get-regions.d.ts +5 -1
- package/dist/api/get-regions.js +5 -2
- package/dist/api/iam-validation/simulate-rule.js +0 -22
- package/dist/api/iam-validation/simulate.js +24 -5
- package/dist/api/iam-validation/user-permissions.js +0 -8
- package/dist/api/render-media-on-lambda.d.ts +2 -1
- package/dist/api/render-media-on-lambda.js +6 -10
- package/dist/api/render-still-on-lambda.d.ts +2 -1
- package/dist/api/render-still-on-lambda.js +1 -3
- package/dist/api/upload-dir.d.ts +4 -3
- package/dist/api/upload-dir.js +33 -19
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/commands/compositions/index.js +1 -3
- package/dist/cli/commands/regions.js +5 -1
- package/dist/cli/commands/render/progress.d.ts +6 -3
- package/dist/cli/commands/render/progress.js +49 -39
- package/dist/cli/commands/render/render.js +17 -4
- package/dist/cli/commands/sites/create.js +12 -4
- package/dist/cli/commands/still.js +5 -9
- package/dist/cli/helpers/progress-bar.d.ts +9 -3
- package/dist/cli/helpers/progress-bar.js +19 -3
- package/dist/cli/index.js +6 -1
- package/dist/functions/compositions.js +10 -3
- package/dist/functions/helpers/concat-videos.d.ts +10 -6
- package/dist/functions/helpers/concat-videos.js +8 -25
- package/dist/functions/helpers/create-post-render-data.js +0 -12
- package/dist/functions/helpers/expected-out-name.js +1 -1
- package/dist/functions/helpers/get-chromium-executable-path.js +2 -1
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/get-encoding-metadata.d.ts +4 -8
- package/dist/functions/helpers/get-encoding-metadata.js +4 -18
- package/dist/functions/helpers/get-final-encoding-status.d.ts +2 -4
- package/dist/functions/helpers/get-final-encoding-status.js +1 -4
- package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +1 -5
- package/dist/functions/helpers/get-lambdas-invoked-stats.js +1 -9
- package/dist/functions/helpers/get-overall-progress.d.ts +2 -1
- package/dist/functions/helpers/get-overall-progress.js +7 -5
- package/dist/functions/helpers/get-progress.js +40 -26
- 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/launch.js +50 -38
- package/dist/functions/renderer.js +19 -24
- package/dist/functions/start.js +9 -2
- package/dist/functions/still.js +16 -5
- package/dist/index.d.ts +9 -2
- package/dist/index.js +10 -2
- package/dist/pricing/aws-regions.d.ts +2 -1
- package/dist/pricing/aws-regions.js +31 -1
- package/dist/pricing/price-per-1-s.js +413 -39
- package/dist/shared/aws-clients.d.ts +3 -0
- package/dist/shared/aws-clients.js +75 -13
- package/dist/shared/check-credentials.js +3 -0
- package/dist/shared/chunk-progress.d.ts +9 -0
- package/dist/shared/chunk-progress.js +2034 -0
- package/dist/shared/constants.d.ts +13 -12
- package/dist/shared/convert-to-serve-url.d.ts +5 -1
- package/dist/shared/convert-to-serve-url.js +1 -5
- package/dist/shared/deserialize-input-props.d.ts +1 -1
- package/dist/shared/deserialize-input-props.js +1 -1
- package/dist/shared/function-zip-path.d.ts +2 -1
- package/dist/shared/function-zip-path.js +3 -2
- package/dist/shared/get-account-id.js +4 -6
- package/dist/shared/get-etag.d.ts +1 -0
- package/dist/shared/get-etag.js +24 -0
- package/dist/shared/get-s3-operations.d.ts +10 -0
- package/dist/shared/get-s3-operations.js +36 -0
- package/dist/shared/hosted-layers.js +368 -60
- package/dist/shared/invoke-webhook.d.ts +2 -0
- package/dist/shared/parse-chunk-key.d.ts +4 -0
- package/dist/shared/parse-chunk-key.js +14 -0
- package/dist/shared/read-dir.d.ts +9 -0
- package/dist/shared/read-dir.js +57 -0
- package/dist/shared/validate-bucketname.d.ts +5 -0
- package/dist/shared/validate-bucketname.js +19 -1
- package/dist/shared/validate-lambda-codec.d.ts +1 -1
- package/dist/shared/validate-lambda-codec.js +0 -1
- package/package.json +18 -14
- package/remotionlambda-arm64.zip +0 -0
- package/remotionlambda-x64.zip +0 -0
- package/remotionlambda.zip +0 -0
- package/.prettierrc.js +0 -14
- package/dist/api/enable-s3-website.d.ts +0 -5
- package/dist/api/enable-s3-website.js +0 -16
- package/dist/shared/get-cloudwatch-stream-url.d.ts +0 -8
- package/dist/shared/get-cloudwatch-stream-url.js +0 -7
- package/tsconfig.json +0 -16
|
@@ -201,7 +201,7 @@ export declare type LambdaPayloads = {
|
|
|
201
201
|
inputProps: SerializedInputProps;
|
|
202
202
|
renderId: string;
|
|
203
203
|
imageFormat: ImageFormat;
|
|
204
|
-
codec:
|
|
204
|
+
codec: LambdaCodec;
|
|
205
205
|
crf: number | undefined;
|
|
206
206
|
proResProfile: ProResProfile | undefined;
|
|
207
207
|
pixelFormat: PixelFormat | undefined;
|
|
@@ -254,9 +254,6 @@ export declare type LambdaPayloads = {
|
|
|
254
254
|
export declare type LambdaPayload = LambdaPayloads[LambdaRoutines];
|
|
255
255
|
export declare type EncodingProgress = {
|
|
256
256
|
framesEncoded: number;
|
|
257
|
-
totalFrames: number | null;
|
|
258
|
-
doneIn: number | null;
|
|
259
|
-
timeToInvoke: number | null;
|
|
260
257
|
};
|
|
261
258
|
export declare type RenderMetadata = {
|
|
262
259
|
siteId: string;
|
|
@@ -277,14 +274,17 @@ export declare type RenderMetadata = {
|
|
|
277
274
|
renderId: string;
|
|
278
275
|
outName: OutNameInputWithoutCredentials | undefined;
|
|
279
276
|
privacy: Privacy;
|
|
277
|
+
frameRange: [number, number];
|
|
278
|
+
everyNthFrame: number;
|
|
279
|
+
};
|
|
280
|
+
export declare type AfterRenderCost = {
|
|
281
|
+
estimatedCost: number;
|
|
282
|
+
estimatedDisplayCost: string;
|
|
283
|
+
currency: string;
|
|
284
|
+
disclaimer: string;
|
|
280
285
|
};
|
|
281
286
|
export declare type PostRenderData = {
|
|
282
|
-
cost:
|
|
283
|
-
estimatedCost: number;
|
|
284
|
-
estimatedDisplayCost: string;
|
|
285
|
-
currency: string;
|
|
286
|
-
disclaimer: string;
|
|
287
|
-
};
|
|
287
|
+
cost: AfterRenderCost;
|
|
288
288
|
outputFile: string;
|
|
289
289
|
outputSize: number;
|
|
290
290
|
renderSize: number;
|
|
@@ -297,7 +297,6 @@ export declare type PostRenderData = {
|
|
|
297
297
|
timeToEncode: number;
|
|
298
298
|
timeToCleanUp: number;
|
|
299
299
|
timeToRenderChunks: number;
|
|
300
|
-
timeToInvokeLambdas: number;
|
|
301
300
|
retriesInfo: ChunkRetry[];
|
|
302
301
|
mostExpensiveFrameRanges: ExpensiveChunk[] | undefined;
|
|
303
302
|
};
|
|
@@ -331,10 +330,12 @@ export declare type RenderProgress = {
|
|
|
331
330
|
lambdasInvoked: number;
|
|
332
331
|
cleanup: CleanupInfo | null;
|
|
333
332
|
timeToFinishChunks: number | null;
|
|
334
|
-
|
|
333
|
+
timeToEncode: number | null;
|
|
335
334
|
overallProgress: number;
|
|
336
335
|
retriesInfo: ChunkRetry[];
|
|
337
336
|
mostExpensiveFrameRanges: ExpensiveChunk[] | null;
|
|
337
|
+
framesRendered: number;
|
|
338
|
+
outputSizeInBytes: number | null;
|
|
338
339
|
};
|
|
339
340
|
export declare type Privacy = 'public' | 'private' | 'no-acl';
|
|
340
341
|
export declare const LAMBDA_CONCURRENCY_LIMIT_QUOTA = "L-B99A9384";
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import type { AwsRegion } from '../pricing/aws-regions';
|
|
2
|
-
export declare const convertToServeUrl: (urlOrId
|
|
2
|
+
export declare const convertToServeUrl: ({ urlOrId, region, bucketName, }: {
|
|
3
|
+
urlOrId: string;
|
|
4
|
+
region: AwsRegion;
|
|
5
|
+
bucketName: string;
|
|
6
|
+
}) => string;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertToServeUrl = void 0;
|
|
4
|
-
const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
|
|
5
4
|
const docs_url_1 = require("./docs-url");
|
|
6
|
-
const convertToServeUrl =
|
|
5
|
+
const convertToServeUrl = ({ urlOrId, region, bucketName, }) => {
|
|
7
6
|
if (urlOrId.startsWith('src/')) {
|
|
8
7
|
throw new Error(`Remotion Lambda can only render based on a URL in the cloud. It seems like you passed a local file: ${urlOrId}. Read the setup guide for Remotion Lambda ${docs_url_1.DOCS_URL}/docs/lambda/setup`);
|
|
9
8
|
}
|
|
10
9
|
if (urlOrId.startsWith('http://') || urlOrId.startsWith('https://')) {
|
|
11
10
|
return urlOrId;
|
|
12
11
|
}
|
|
13
|
-
const { bucketName } = await (0, get_or_create_bucket_1.getOrCreateBucket)({
|
|
14
|
-
region,
|
|
15
|
-
});
|
|
16
12
|
return `https://${bucketName}.s3.${region}.amazonaws.com/sites/${urlOrId}/index.html`;
|
|
17
13
|
};
|
|
18
14
|
exports.convertToServeUrl = convertToServeUrl;
|
|
@@ -20,7 +20,7 @@ const deserializeInputProps = async ({ serialized, region, bucketName, expectedB
|
|
|
20
20
|
return payload;
|
|
21
21
|
}
|
|
22
22
|
catch (err) {
|
|
23
|
-
throw new Error(
|
|
23
|
+
throw new Error(`Failed to parse input props that were serialized: ${err.stack}`);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
exports.deserializeInputProps = deserializeInputProps;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const FUNCTION_ZIP_ARM64: string;
|
|
2
|
+
export declare const FUNCTION_ZIP_X86_64: string;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.FUNCTION_ZIP_X86_64 = exports.FUNCTION_ZIP_ARM64 = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
exports.
|
|
8
|
+
exports.FUNCTION_ZIP_ARM64 = path_1.default.join(path_1.default.resolve(__dirname, '..', '..'), `remotionlambda-arm64.zip`);
|
|
9
|
+
exports.FUNCTION_ZIP_X86_64 = path_1.default.join(path_1.default.resolve(__dirname, '..', '..'), `remotionlambda-x64.zip`);
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAccountId = void 0;
|
|
4
|
-
const
|
|
4
|
+
const client_sts_1 = require("@aws-sdk/client-sts");
|
|
5
5
|
const aws_clients_1 = require("./aws-clients");
|
|
6
6
|
const validate_aws_region_1 = require("./validate-aws-region");
|
|
7
7
|
const getAccountId = async (options) => {
|
|
8
|
-
var _a, _b;
|
|
9
8
|
(0, validate_aws_region_1.validateAwsRegion)(options.region);
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
if (!accountId) {
|
|
9
|
+
const callerIdentity = await (0, aws_clients_1.getStsClient)(options.region).send(new client_sts_1.GetCallerIdentityCommand({}));
|
|
10
|
+
if (!callerIdentity.Account) {
|
|
13
11
|
throw new Error('Cannot get account ID');
|
|
14
12
|
}
|
|
15
|
-
return
|
|
13
|
+
return callerIdentity.Account;
|
|
16
14
|
};
|
|
17
15
|
exports.getAccountId = getAccountId;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getEtagOfFile: (filePath: string) => Promise<string>;
|
|
@@ -0,0 +1,24 @@
|
|
|
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.getEtagOfFile = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
+
const chunk = 1024 * 1024 * 5; // 5MB
|
|
10
|
+
const md5 = (data) => crypto_1.default.createHash('md5').update(data).digest('hex');
|
|
11
|
+
const getEtagOfFile = async (filePath) => {
|
|
12
|
+
const stream = await fs_1.default.promises.readFile(filePath);
|
|
13
|
+
if (stream.length <= chunk) {
|
|
14
|
+
return `"${md5(stream)}"`;
|
|
15
|
+
}
|
|
16
|
+
const md5Chunks = [];
|
|
17
|
+
const chunksNumber = Math.ceil(stream.length / chunk);
|
|
18
|
+
for (let i = 0; i < chunksNumber; i++) {
|
|
19
|
+
const chunkStream = stream.slice(i * chunk, (i + 1) * chunk);
|
|
20
|
+
md5Chunks.push(md5(chunkStream));
|
|
21
|
+
}
|
|
22
|
+
return `"${md5(Buffer.from(md5Chunks.join(''), 'hex'))}-${chunksNumber}"`;
|
|
23
|
+
};
|
|
24
|
+
exports.getEtagOfFile = getEtagOfFile;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { _Object } from '@aws-sdk/client-s3';
|
|
2
|
+
export declare const getS3DiffOperations: ({ objects, bundle, prefix, }: {
|
|
3
|
+
objects: _Object[];
|
|
4
|
+
bundle: string;
|
|
5
|
+
prefix: string;
|
|
6
|
+
}) => Promise<{
|
|
7
|
+
toDelete: _Object[];
|
|
8
|
+
toUpload: string[];
|
|
9
|
+
existingCount: number;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getS3DiffOperations = void 0;
|
|
4
|
+
const read_dir_1 = require("./read-dir");
|
|
5
|
+
const getS3DiffOperations = async ({ objects, bundle, prefix, }) => {
|
|
6
|
+
const dir = await (0, read_dir_1.readDirectory)({
|
|
7
|
+
dir: bundle,
|
|
8
|
+
etags: {},
|
|
9
|
+
originalDir: bundle,
|
|
10
|
+
});
|
|
11
|
+
const filesOnS3ButNotLocal = objects.filter((fileOnS3) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const key = (_a = fileOnS3.Key) === null || _a === void 0 ? void 0 : _a.substring(prefix.length + 1);
|
|
14
|
+
return !dir[key];
|
|
15
|
+
});
|
|
16
|
+
const localFilesNotOnS3 = Object.keys(dir).filter((d) => {
|
|
17
|
+
return !objects.find((o) => {
|
|
18
|
+
var _a;
|
|
19
|
+
const key = (_a = o.Key) === null || _a === void 0 ? void 0 : _a.substring(prefix.length + 1);
|
|
20
|
+
return key === d && o.ETag === dir[d];
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
const existing = Object.keys(dir).filter((d) => {
|
|
24
|
+
return objects.find((o) => {
|
|
25
|
+
var _a;
|
|
26
|
+
const key = (_a = o.Key) === null || _a === void 0 ? void 0 : _a.substring(prefix.length + 1);
|
|
27
|
+
return key === d && o.ETag === dir[d];
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
toDelete: filesOnS3ButNotLocal,
|
|
32
|
+
toUpload: localFilesNotOnS3,
|
|
33
|
+
existingCount: existing.length,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
exports.getS3DiffOperations = getS3DiffOperations;
|