@remotion/lambda-client 4.0.369 → 4.0.371
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/cjs/index.js +1 -1
- package/dist/esm/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/app-router-webhook.d.ts +0 -10
- package/dist/app-router-webhook.js +0 -51
- package/dist/apply-lifecycle.d.ts +0 -8
- package/dist/apply-lifecycle.js +0 -18
- package/dist/aws-clients.d.ts +0 -12
- package/dist/aws-clients.js +0 -56
- package/dist/aws-provider.d.ts +0 -27
- package/dist/aws-provider.js +0 -94
- package/dist/bucket-exists.d.ts +0 -3
- package/dist/bucket-exists.js +0 -27
- package/dist/call-lambda-async.d.ts +0 -2
- package/dist/call-lambda-async.js +0 -20
- package/dist/call-lambda-streaming.d.ts +0 -6
- package/dist/call-lambda-streaming.js +0 -126
- package/dist/call-lambda-sync.d.ts +0 -2
- package/dist/call-lambda-sync.js +0 -30
- package/dist/check-credentials.d.ts +0 -1
- package/dist/check-credentials.js +0 -39
- package/dist/clean-items.d.ts +0 -17
- package/dist/clean-items.js +0 -26
- package/dist/constants.d.ts +0 -25
- package/dist/constants.js +0 -26
- package/dist/content-disposition-header.d.ts +0 -2
- package/dist/content-disposition-header.js +0 -50
- package/dist/convert-to-serve-url.d.ts +0 -6
- package/dist/convert-to-serve-url.js +0 -14
- package/dist/create-bucket.d.ts +0 -3
- package/dist/create-bucket.js +0 -65
- package/dist/delete-file.d.ts +0 -3
- package/dist/delete-file.js +0 -17
- package/dist/delete-function.d.ts +0 -7
- package/dist/delete-function.js +0 -15
- package/dist/delete-render.d.ts +0 -22
- package/dist/delete-render.js +0 -90
- package/dist/encode-aws-url-params.d.ts +0 -1
- package/dist/encode-aws-url-params.js +0 -7
- package/dist/estimate-price.d.ts +0 -17
- package/dist/estimate-price.js +0 -45
- package/dist/express-webhook.d.ts +0 -3
- package/dist/express-webhook.js +0 -54
- package/dist/get-account-id.d.ts +0 -3
- package/dist/get-account-id.js +0 -15
- package/dist/get-aws-client.d.ts +0 -32
- package/dist/get-aws-client.js +0 -67
- package/dist/get-aws-urls.d.ts +0 -25
- package/dist/get-aws-urls.js +0 -31
- package/dist/get-buckets.d.ts +0 -9
- package/dist/get-buckets.js +0 -64
- package/dist/get-compositions-on-lambda.d.ts +0 -20
- package/dist/get-compositions-on-lambda.js +0 -62
- package/dist/get-credentials.d.ts +0 -9
- package/dist/get-credentials.js +0 -55
- package/dist/get-env-variable.d.ts +0 -1
- package/dist/get-env-variable.js +0 -15
- package/dist/get-function-name.d.ts +0 -8
- package/dist/get-function-name.js +0 -17
- package/dist/get-function-version.d.ts +0 -9
- package/dist/get-function-version.js +0 -35
- package/dist/get-functions.d.ts +0 -10
- package/dist/get-functions.js +0 -80
- package/dist/get-output-url-from-metadata.d.ts +0 -3
- package/dist/get-output-url-from-metadata.js +0 -18
- package/dist/get-render-progress.d.ts +0 -17
- package/dist/get-render-progress.js +0 -47
- package/dist/get-s3-client.d.ts +0 -11
- package/dist/get-s3-client.js +0 -15
- package/dist/get-service-client.d.ts +0 -25
- package/dist/get-service-client.js +0 -131
- package/dist/get-sites.d.ts +0 -31
- package/dist/get-sites.js +0 -83
- package/dist/head-file.d.ts +0 -3
- package/dist/head-file.js +0 -18
- package/dist/index.d.ts +0 -129
- package/dist/index.js +0 -108
- package/dist/is-cli.d.ts +0 -2
- package/dist/is-cli.js +0 -10
- package/dist/is-flaky-error.d.ts +0 -1
- package/dist/is-flaky-error.js +0 -78
- package/dist/is-in-lambda.d.ts +0 -1
- package/dist/is-in-lambda.js +0 -9
- package/dist/is-likely-to-have-aws-profile.d.ts +0 -1
- package/dist/is-likely-to-have-aws-profile.js +0 -50
- package/dist/lambda-version-string.d.ts +0 -1
- package/dist/lambda-version-string.js +0 -7
- package/dist/lifecycle-rules.d.ts +0 -12
- package/dist/lifecycle-rules.js +0 -73
- package/dist/lifecycle.d.ts +0 -7
- package/dist/lifecycle.js +0 -24
- package/dist/list-objects.d.ts +0 -3
- package/dist/list-objects.js +0 -70
- package/dist/make-lambda-payload.d.ts +0 -59
- package/dist/make-lambda-payload.js +0 -150
- package/dist/make-s3-url.d.ts +0 -6
- package/dist/make-s3-url.js +0 -7
- package/dist/p-limit.d.ts +0 -1
- package/dist/p-limit.js +0 -57
- package/dist/pages-router-webhook.d.ts +0 -5
- package/dist/pages-router-webhook.js +0 -56
- package/dist/parse-function-name.d.ts +0 -8
- package/dist/parse-function-name.js +0 -17
- package/dist/presign-url.d.ts +0 -17
- package/dist/presign-url.js +0 -66
- package/dist/price-per-1s.d.ts +0 -37
- package/dist/price-per-1s.js +0 -822
- package/dist/random-hash.d.ts +0 -1
- package/dist/random-hash.js +0 -13
- package/dist/read-file.d.ts +0 -11
- package/dist/read-file.js +0 -19
- package/dist/regions.d.ts +0 -3
- package/dist/regions.js +0 -48
- package/dist/render-media-on-lambda.d.ts +0 -66
- package/dist/render-media-on-lambda.js +0 -133
- package/dist/render-still-on-lambda.d.ts +0 -61
- package/dist/render-still-on-lambda.js +0 -121
- package/dist/runtime-preference.d.ts +0 -2
- package/dist/runtime-preference.js +0 -8
- package/dist/speculate-function-name.d.ts +0 -7
- package/dist/speculate-function-name.js +0 -39
- package/dist/types.d.ts +0 -4
- package/dist/types.js +0 -2
- package/dist/validate-aws-region.d.ts +0 -2
- package/dist/validate-aws-region.js +0 -9
- package/dist/validate-bucketname.d.ts +0 -4
- package/dist/validate-bucketname.js +0 -15
- package/dist/validate-disk-size-in-mb.d.ts +0 -1
- package/dist/validate-disk-size-in-mb.js +0 -23
- package/dist/validate-lambda-codec.d.ts +0 -2
- package/dist/validate-lambda-codec.js +0 -21
- package/dist/validate-memory-size.d.ts +0 -1
- package/dist/validate-memory-size.js +0 -22
- package/dist/validate-presign-expiration.d.ts +0 -1
- package/dist/validate-presign-expiration.js +0 -29
- package/dist/validate-serveurl.d.ts +0 -1
- package/dist/validate-serveurl.js +0 -9
- package/dist/validate-webhook-signature.d.ts +0 -5
- package/dist/validate-webhook-signature.js +0 -28
- package/dist/write-file.d.ts +0 -5
- package/dist/write-file.js +0 -83
package/dist/random-hash.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const randomHashImplementation: () => string;
|
package/dist/random-hash.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.randomHashImplementation = void 0;
|
|
4
|
-
const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
5
|
-
const randomHashImplementation = () => {
|
|
6
|
-
return new Array(10)
|
|
7
|
-
.fill(1)
|
|
8
|
-
.map(() => {
|
|
9
|
-
return alphabet[Math.floor(Math.random() * alphabet.length)];
|
|
10
|
-
})
|
|
11
|
-
.join('');
|
|
12
|
-
};
|
|
13
|
-
exports.randomHashImplementation = randomHashImplementation;
|
package/dist/read-file.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Readable } from 'stream';
|
|
2
|
-
import type { AwsRegion } from './regions';
|
|
3
|
-
import type { RequestHandler } from './types';
|
|
4
|
-
export declare const lambdaReadFileImplementation: ({ bucketName, key, region, expectedBucketOwner, forcePathStyle, requestHandler, }: {
|
|
5
|
-
bucketName: string;
|
|
6
|
-
key: string;
|
|
7
|
-
region: AwsRegion;
|
|
8
|
-
expectedBucketOwner: string | null;
|
|
9
|
-
forcePathStyle: boolean;
|
|
10
|
-
requestHandler: RequestHandler | null;
|
|
11
|
-
}) => Promise<Readable>;
|
package/dist/read-file.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lambdaReadFileImplementation = void 0;
|
|
4
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
-
const get_s3_client_1 = require("./get-s3-client");
|
|
6
|
-
const lambdaReadFileImplementation = async ({ bucketName, key, region, expectedBucketOwner, forcePathStyle, requestHandler, }) => {
|
|
7
|
-
const { Body } = await (0, get_s3_client_1.getS3Client)({
|
|
8
|
-
region,
|
|
9
|
-
customCredentials: null,
|
|
10
|
-
forcePathStyle,
|
|
11
|
-
requestHandler,
|
|
12
|
-
}).send(new client_s3_1.GetObjectCommand({
|
|
13
|
-
Bucket: bucketName,
|
|
14
|
-
Key: key,
|
|
15
|
-
ExpectedBucketOwner: expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined,
|
|
16
|
-
}));
|
|
17
|
-
return Body;
|
|
18
|
-
};
|
|
19
|
-
exports.lambdaReadFileImplementation = lambdaReadFileImplementation;
|
package/dist/regions.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_AWS_REGIONS: readonly ["eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ca-central-1", "sa-east-1"];
|
|
2
|
-
export declare const AWS_REGIONS: readonly ["eu-central-1", "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "eu-south-1", "eu-north-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-south-1", "ap-east-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-southeast-4", "ap-southeast-5", "ca-central-1", "me-south-1", "sa-east-1"];
|
|
3
|
-
export type AwsRegion = (typeof AWS_REGIONS)[number];
|
package/dist/regions.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AWS_REGIONS = exports.DEFAULT_AWS_REGIONS = void 0;
|
|
4
|
-
exports.DEFAULT_AWS_REGIONS = [
|
|
5
|
-
'eu-central-1',
|
|
6
|
-
'eu-west-1',
|
|
7
|
-
'eu-west-2',
|
|
8
|
-
'eu-west-3',
|
|
9
|
-
'eu-north-1',
|
|
10
|
-
'us-east-1', // N. Virginia
|
|
11
|
-
'us-east-2', // Ohio;
|
|
12
|
-
'us-west-1',
|
|
13
|
-
'us-west-2', // Oregon
|
|
14
|
-
'ap-south-1',
|
|
15
|
-
'ap-southeast-1',
|
|
16
|
-
'ap-southeast-2',
|
|
17
|
-
'ap-northeast-1',
|
|
18
|
-
'ap-northeast-2',
|
|
19
|
-
'ap-northeast-3',
|
|
20
|
-
'ca-central-1',
|
|
21
|
-
'sa-east-1',
|
|
22
|
-
];
|
|
23
|
-
exports.AWS_REGIONS = [
|
|
24
|
-
'eu-central-1',
|
|
25
|
-
'eu-central-2',
|
|
26
|
-
'eu-west-1',
|
|
27
|
-
'eu-west-2',
|
|
28
|
-
'eu-west-3',
|
|
29
|
-
'eu-south-1',
|
|
30
|
-
'eu-north-1',
|
|
31
|
-
'us-east-1', // N. Virginia
|
|
32
|
-
'us-east-2', // Ohio;
|
|
33
|
-
'us-west-1',
|
|
34
|
-
'us-west-2', // Oregon
|
|
35
|
-
'af-south-1',
|
|
36
|
-
'ap-south-1',
|
|
37
|
-
'ap-east-1',
|
|
38
|
-
'ap-southeast-1',
|
|
39
|
-
'ap-southeast-2',
|
|
40
|
-
'ap-northeast-1',
|
|
41
|
-
'ap-northeast-2',
|
|
42
|
-
'ap-northeast-3',
|
|
43
|
-
'ap-southeast-4',
|
|
44
|
-
'ap-southeast-5',
|
|
45
|
-
'ca-central-1',
|
|
46
|
-
'me-south-1',
|
|
47
|
-
'sa-east-1',
|
|
48
|
-
];
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { StorageClass } from '@aws-sdk/client-s3';
|
|
2
|
-
import type { AudioCodec, BrowserSafeApis, ChromiumOptions, DownloadBehavior, FrameRange, OutNameInput, PixelFormat, Privacy, ProResProfile, ServerlessCodec, ToOptions, VideoImageFormat, WebhookOption } from '@remotion/serverless-client';
|
|
3
|
-
import { type AwsProvider } from './aws-provider';
|
|
4
|
-
import type { InnerRenderMediaOnLambdaInput } from './make-lambda-payload';
|
|
5
|
-
import type { AwsRegion } from './regions';
|
|
6
|
-
import type { RequestHandler } from './types';
|
|
7
|
-
export type RenderMediaOnLambdaInput = {
|
|
8
|
-
region: AwsRegion;
|
|
9
|
-
functionName: string;
|
|
10
|
-
serveUrl: string;
|
|
11
|
-
composition: string;
|
|
12
|
-
inputProps?: Record<string, unknown>;
|
|
13
|
-
codec: ServerlessCodec;
|
|
14
|
-
imageFormat?: VideoImageFormat;
|
|
15
|
-
crf?: number | undefined;
|
|
16
|
-
envVariables?: Record<string, string>;
|
|
17
|
-
pixelFormat?: PixelFormat;
|
|
18
|
-
proResProfile?: ProResProfile;
|
|
19
|
-
privacy?: Privacy;
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated Renamed to `jpegQuality`
|
|
22
|
-
*/
|
|
23
|
-
quality?: never;
|
|
24
|
-
jpegQuality?: number;
|
|
25
|
-
maxRetries?: number;
|
|
26
|
-
framesPerLambda?: number;
|
|
27
|
-
concurrency?: number;
|
|
28
|
-
frameRange?: FrameRange;
|
|
29
|
-
outName?: OutNameInput<AwsProvider>;
|
|
30
|
-
chromiumOptions?: Omit<ChromiumOptions, 'enableMultiProcessOnLinux'>;
|
|
31
|
-
scale?: number;
|
|
32
|
-
everyNthFrame?: number;
|
|
33
|
-
concurrencyPerLambda?: number;
|
|
34
|
-
downloadBehavior?: DownloadBehavior | null;
|
|
35
|
-
overwrite?: boolean;
|
|
36
|
-
webhook?: WebhookOption | null;
|
|
37
|
-
forceWidth?: number | null;
|
|
38
|
-
forceHeight?: number | null;
|
|
39
|
-
rendererFunctionName?: string | null;
|
|
40
|
-
forceBucketName?: string;
|
|
41
|
-
audioCodec?: AudioCodec | null;
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated in favor of `logLevel`: true
|
|
44
|
-
*/
|
|
45
|
-
dumpBrowserLogs?: boolean;
|
|
46
|
-
forcePathStyle?: boolean;
|
|
47
|
-
metadata?: Record<string, string> | null;
|
|
48
|
-
storageClass?: StorageClass | null;
|
|
49
|
-
requestHandler?: RequestHandler;
|
|
50
|
-
} & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>>;
|
|
51
|
-
export type RenderMediaOnLambdaOutput = {
|
|
52
|
-
renderId: string;
|
|
53
|
-
bucketName: string;
|
|
54
|
-
cloudWatchLogs: string;
|
|
55
|
-
cloudWatchMainLogs: string;
|
|
56
|
-
lambdaInsightsLogs: string;
|
|
57
|
-
folderInS3Console: string;
|
|
58
|
-
progressJsonInConsole: string;
|
|
59
|
-
};
|
|
60
|
-
export declare const internalRenderMediaOnLambdaRaw: (input: InnerRenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
61
|
-
export declare const renderMediaOnLambdaOptionalToRequired: (options: RenderMediaOnLambdaInput) => InnerRenderMediaOnLambdaInput;
|
|
62
|
-
export declare const renderMediaOnLambda: (options: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
63
|
-
/**
|
|
64
|
-
* @deprecated Renamed to renderMediaOnLambda()
|
|
65
|
-
*/
|
|
66
|
-
export declare const renderVideoOnLambda: (options: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderVideoOnLambda = exports.renderMediaOnLambda = exports.renderMediaOnLambdaOptionalToRequired = exports.internalRenderMediaOnLambdaRaw = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const aws_provider_1 = require("./aws-provider");
|
|
6
|
-
const get_aws_urls_1 = require("./get-aws-urls");
|
|
7
|
-
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
8
|
-
const internalRenderMediaOnLambdaRaw = async (input) => {
|
|
9
|
-
var _a;
|
|
10
|
-
const { functionName, region, rendererFunctionName } = input;
|
|
11
|
-
try {
|
|
12
|
-
const res = await aws_provider_1.awsImplementation.callFunctionSync({
|
|
13
|
-
functionName,
|
|
14
|
-
type: serverless_client_1.ServerlessRoutines.start,
|
|
15
|
-
payload: await (0, make_lambda_payload_1.makeLambdaRenderMediaPayload)(input),
|
|
16
|
-
region,
|
|
17
|
-
timeoutInTest: 120000,
|
|
18
|
-
requestHandler: input.requestHandler,
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
renderId: res.renderId,
|
|
22
|
-
bucketName: res.bucketName,
|
|
23
|
-
cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchRendererUrl)({
|
|
24
|
-
functionName,
|
|
25
|
-
region,
|
|
26
|
-
renderId: res.renderId,
|
|
27
|
-
rendererFunctionName: rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : null,
|
|
28
|
-
chunk: null,
|
|
29
|
-
}),
|
|
30
|
-
cloudWatchMainLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
31
|
-
renderId: res.renderId,
|
|
32
|
-
functionName,
|
|
33
|
-
method: serverless_client_1.ServerlessRoutines.launch,
|
|
34
|
-
region,
|
|
35
|
-
rendererFunctionName: rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : null,
|
|
36
|
-
}),
|
|
37
|
-
folderInS3Console: (0, get_aws_urls_1.getS3RenderUrl)({
|
|
38
|
-
bucketName: res.bucketName,
|
|
39
|
-
renderId: res.renderId,
|
|
40
|
-
region,
|
|
41
|
-
}),
|
|
42
|
-
lambdaInsightsLogs: (0, get_aws_urls_1.getLambdaInsightsUrl)({
|
|
43
|
-
functionName,
|
|
44
|
-
region,
|
|
45
|
-
}),
|
|
46
|
-
progressJsonInConsole: (0, get_aws_urls_1.getProgressJsonUrl)({
|
|
47
|
-
bucketName: res.bucketName,
|
|
48
|
-
renderId: res.renderId,
|
|
49
|
-
region,
|
|
50
|
-
}),
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
catch (err) {
|
|
54
|
-
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('UnrecognizedClientException')) {
|
|
55
|
-
throw new Error('UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception');
|
|
56
|
-
}
|
|
57
|
-
throw err;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
exports.internalRenderMediaOnLambdaRaw = internalRenderMediaOnLambdaRaw;
|
|
61
|
-
const renderMediaOnLambdaOptionalToRequired = (options) => {
|
|
62
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19;
|
|
63
|
-
return {
|
|
64
|
-
offthreadVideoThreads: (_a = options.offthreadVideoThreads) !== null && _a !== void 0 ? _a : null,
|
|
65
|
-
audioBitrate: (_b = options.audioBitrate) !== null && _b !== void 0 ? _b : null,
|
|
66
|
-
audioCodec: (_c = options.audioCodec) !== null && _c !== void 0 ? _c : null,
|
|
67
|
-
chromiumOptions: (_d = options.chromiumOptions) !== null && _d !== void 0 ? _d : {},
|
|
68
|
-
codec: options.codec,
|
|
69
|
-
colorSpace: (_e = options.colorSpace) !== null && _e !== void 0 ? _e : null,
|
|
70
|
-
composition: options.composition,
|
|
71
|
-
concurrencyPerLambda: (_f = options.concurrencyPerLambda) !== null && _f !== void 0 ? _f : 1,
|
|
72
|
-
concurrency: (_g = options.concurrency) !== null && _g !== void 0 ? _g : null,
|
|
73
|
-
crf: options.crf,
|
|
74
|
-
downloadBehavior: (_h = options.downloadBehavior) !== null && _h !== void 0 ? _h : { type: 'play-in-browser' },
|
|
75
|
-
envVariables: (_j = options.envVariables) !== null && _j !== void 0 ? _j : {},
|
|
76
|
-
everyNthFrame: (_k = options.everyNthFrame) !== null && _k !== void 0 ? _k : 1,
|
|
77
|
-
forceBucketName: (_l = options.forceBucketName) !== null && _l !== void 0 ? _l : null,
|
|
78
|
-
forceHeight: (_m = options.forceHeight) !== null && _m !== void 0 ? _m : null,
|
|
79
|
-
forceWidth: (_o = options.forceWidth) !== null && _o !== void 0 ? _o : null,
|
|
80
|
-
frameRange: (_p = options.frameRange) !== null && _p !== void 0 ? _p : null,
|
|
81
|
-
framesPerLambda: (_q = options.framesPerLambda) !== null && _q !== void 0 ? _q : null,
|
|
82
|
-
functionName: options.functionName,
|
|
83
|
-
imageFormat: (_r = options.imageFormat) !== null && _r !== void 0 ? _r : 'jpeg',
|
|
84
|
-
inputProps: (_s = options.inputProps) !== null && _s !== void 0 ? _s : {},
|
|
85
|
-
jpegQuality: (_t = options.jpegQuality) !== null && _t !== void 0 ? _t : 80,
|
|
86
|
-
logLevel: (_u = options.logLevel) !== null && _u !== void 0 ? _u : 'info',
|
|
87
|
-
maxRetries: (_v = options.maxRetries) !== null && _v !== void 0 ? _v : 1,
|
|
88
|
-
muted: (_w = options.muted) !== null && _w !== void 0 ? _w : false,
|
|
89
|
-
numberOfGifLoops: (_x = options.numberOfGifLoops) !== null && _x !== void 0 ? _x : null,
|
|
90
|
-
offthreadVideoCacheSizeInBytes: (_y = options.offthreadVideoCacheSizeInBytes) !== null && _y !== void 0 ? _y : null,
|
|
91
|
-
outName: (_z = options.outName) !== null && _z !== void 0 ? _z : null,
|
|
92
|
-
overwrite: (_0 = options.overwrite) !== null && _0 !== void 0 ? _0 : false,
|
|
93
|
-
pixelFormat: (_1 = options.pixelFormat) !== null && _1 !== void 0 ? _1 : undefined,
|
|
94
|
-
privacy: (_2 = options.privacy) !== null && _2 !== void 0 ? _2 : 'public',
|
|
95
|
-
proResProfile: (_3 = options.proResProfile) !== null && _3 !== void 0 ? _3 : undefined,
|
|
96
|
-
region: options.region,
|
|
97
|
-
rendererFunctionName: (_4 = options.rendererFunctionName) !== null && _4 !== void 0 ? _4 : null,
|
|
98
|
-
scale: (_5 = options.scale) !== null && _5 !== void 0 ? _5 : 1,
|
|
99
|
-
serveUrl: options.serveUrl,
|
|
100
|
-
timeoutInMilliseconds: (_6 = options.timeoutInMilliseconds) !== null && _6 !== void 0 ? _6 : 30000,
|
|
101
|
-
videoBitrate: (_7 = options.videoBitrate) !== null && _7 !== void 0 ? _7 : null,
|
|
102
|
-
encodingMaxRate: (_8 = options.encodingMaxRate) !== null && _8 !== void 0 ? _8 : null,
|
|
103
|
-
encodingBufferSize: (_9 = options.encodingBufferSize) !== null && _9 !== void 0 ? _9 : null,
|
|
104
|
-
webhook: (_10 = options.webhook) !== null && _10 !== void 0 ? _10 : null,
|
|
105
|
-
x264Preset: (_11 = options.x264Preset) !== null && _11 !== void 0 ? _11 : null,
|
|
106
|
-
deleteAfter: (_12 = options.deleteAfter) !== null && _12 !== void 0 ? _12 : null,
|
|
107
|
-
preferLossless: (_13 = options.preferLossless) !== null && _13 !== void 0 ? _13 : false,
|
|
108
|
-
forcePathStyle: (_14 = options.forcePathStyle) !== null && _14 !== void 0 ? _14 : false,
|
|
109
|
-
indent: false,
|
|
110
|
-
metadata: (_15 = options.metadata) !== null && _15 !== void 0 ? _15 : null,
|
|
111
|
-
apiKey: (_16 = options.apiKey) !== null && _16 !== void 0 ? _16 : null,
|
|
112
|
-
storageClass: (_17 = options.storageClass) !== null && _17 !== void 0 ? _17 : null,
|
|
113
|
-
requestHandler: (_18 = options.requestHandler) !== null && _18 !== void 0 ? _18 : null,
|
|
114
|
-
mediaCacheSizeInBytes: (_19 = options.mediaCacheSizeInBytes) !== null && _19 !== void 0 ? _19 : null,
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
exports.renderMediaOnLambdaOptionalToRequired = renderMediaOnLambdaOptionalToRequired;
|
|
118
|
-
const wrapped = (0, serverless_client_1.wrapWithErrorHandling)(exports.internalRenderMediaOnLambdaRaw);
|
|
119
|
-
/*
|
|
120
|
-
* @description Kicks off a render process on Remotion Lambda. The progress can be tracked using getRenderProgress().
|
|
121
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/rendermediaonlambda)
|
|
122
|
-
*/
|
|
123
|
-
const renderMediaOnLambda = (options) => {
|
|
124
|
-
if (options.quality) {
|
|
125
|
-
throw new Error('quality has been renamed to jpegQuality. Please rename the option.');
|
|
126
|
-
}
|
|
127
|
-
return wrapped((0, exports.renderMediaOnLambdaOptionalToRequired)(options));
|
|
128
|
-
};
|
|
129
|
-
exports.renderMediaOnLambda = renderMediaOnLambda;
|
|
130
|
-
/**
|
|
131
|
-
* @deprecated Renamed to renderMediaOnLambda()
|
|
132
|
-
*/
|
|
133
|
-
exports.renderVideoOnLambda = exports.renderMediaOnLambda;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { BrowserSafeApis, ChromiumOptions, DownloadBehavior, StillImageFormat, ToOptions } from '@remotion/serverless-client';
|
|
2
|
-
import type { StorageClass } from '@aws-sdk/client-s3';
|
|
3
|
-
import type { CostsInfo, OutNameInput, Privacy, ReceivedArtifact } from '@remotion/serverless-client';
|
|
4
|
-
import { type AwsProvider } from './aws-provider';
|
|
5
|
-
import type { AwsRegion } from './regions';
|
|
6
|
-
import type { RequestHandler } from './types';
|
|
7
|
-
type MandatoryParameters = {
|
|
8
|
-
region: AwsRegion;
|
|
9
|
-
functionName: string;
|
|
10
|
-
serveUrl: string;
|
|
11
|
-
composition: string;
|
|
12
|
-
inputProps: Record<string, unknown>;
|
|
13
|
-
imageFormat: StillImageFormat;
|
|
14
|
-
privacy: Privacy;
|
|
15
|
-
};
|
|
16
|
-
type OptionalParameters = {
|
|
17
|
-
maxRetries: number;
|
|
18
|
-
envVariables: Record<string, string>;
|
|
19
|
-
frame: number;
|
|
20
|
-
outName: OutNameInput<AwsProvider> | null;
|
|
21
|
-
chromiumOptions: ChromiumOptions;
|
|
22
|
-
downloadBehavior: DownloadBehavior;
|
|
23
|
-
forceWidth: number | null;
|
|
24
|
-
forceHeight: number | null;
|
|
25
|
-
forceBucketName: string | null;
|
|
26
|
-
onInit: (data: {
|
|
27
|
-
renderId: string;
|
|
28
|
-
cloudWatchLogs: string;
|
|
29
|
-
lambdaInsightsUrl: string;
|
|
30
|
-
}) => void;
|
|
31
|
-
indent: boolean;
|
|
32
|
-
forcePathStyle: boolean;
|
|
33
|
-
storageClass: StorageClass | null;
|
|
34
|
-
requestHandler: RequestHandler | null | undefined;
|
|
35
|
-
} & ToOptions<typeof BrowserSafeApis.optionsMap.renderStillOnLambda>;
|
|
36
|
-
export type RenderStillOnLambdaNonNullInput = MandatoryParameters & OptionalParameters;
|
|
37
|
-
export type RenderStillOnLambdaInput = MandatoryParameters & Partial<OptionalParameters> & {
|
|
38
|
-
requestHandler?: RequestHandler;
|
|
39
|
-
};
|
|
40
|
-
export type RenderStillOnLambdaOutput = {
|
|
41
|
-
estimatedPrice: CostsInfo;
|
|
42
|
-
url: string;
|
|
43
|
-
outKey: string;
|
|
44
|
-
sizeInBytes: number;
|
|
45
|
-
bucketName: string;
|
|
46
|
-
renderId: string;
|
|
47
|
-
cloudWatchLogs: string;
|
|
48
|
-
artifacts: ReceivedArtifact<AwsProvider>[];
|
|
49
|
-
};
|
|
50
|
-
export declare const internalRenderStillOnLambda: (input: RenderStillOnLambdaNonNullInput) => Promise<RenderStillOnLambdaOutput>;
|
|
51
|
-
export declare const renderStillOnLambda: (input: RenderStillOnLambdaInput & {
|
|
52
|
-
/**
|
|
53
|
-
* @deprecated Renamed to `jpegQuality`
|
|
54
|
-
*/
|
|
55
|
-
quality?: never;
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated Renamed to `logLevel`
|
|
58
|
-
*/
|
|
59
|
-
dumpBrowserLogs?: boolean;
|
|
60
|
-
}) => Promise<RenderStillOnLambdaOutput>;
|
|
61
|
-
export {};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderStillOnLambda = exports.internalRenderStillOnLambda = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const serverless_client_2 = require("@remotion/serverless-client");
|
|
6
|
-
const aws_provider_1 = require("./aws-provider");
|
|
7
|
-
const constants_1 = require("./constants");
|
|
8
|
-
const get_aws_urls_1 = require("./get-aws-urls");
|
|
9
|
-
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
10
|
-
const innerRenderStillOnLambda = async (input) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const { functionName, region, onInit } = input;
|
|
13
|
-
try {
|
|
14
|
-
const payload = await (0, make_lambda_payload_1.makeLambdaRenderStillPayload)(input);
|
|
15
|
-
const res = await new Promise((resolve, reject) => {
|
|
16
|
-
aws_provider_1.awsImplementation
|
|
17
|
-
.callFunctionStreaming({
|
|
18
|
-
functionName,
|
|
19
|
-
type: serverless_client_1.ServerlessRoutines.still,
|
|
20
|
-
payload,
|
|
21
|
-
region,
|
|
22
|
-
receivedStreamingPayload: ({ message }) => {
|
|
23
|
-
if (message.type === 'render-id-determined') {
|
|
24
|
-
onInit === null || onInit === void 0 ? void 0 : onInit({
|
|
25
|
-
renderId: message.payload.renderId,
|
|
26
|
-
cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
27
|
-
functionName,
|
|
28
|
-
method: serverless_client_1.ServerlessRoutines.still,
|
|
29
|
-
region,
|
|
30
|
-
rendererFunctionName: null,
|
|
31
|
-
renderId: message.payload.renderId,
|
|
32
|
-
}),
|
|
33
|
-
lambdaInsightsUrl: (0, get_aws_urls_1.getLambdaInsightsUrl)({
|
|
34
|
-
functionName,
|
|
35
|
-
region,
|
|
36
|
-
}),
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
if (message.type === 'error-occurred') {
|
|
40
|
-
reject(new Error(message.payload.error));
|
|
41
|
-
}
|
|
42
|
-
if (message.type === 'still-rendered') {
|
|
43
|
-
resolve(message.payload);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
timeoutInTest: 120000,
|
|
47
|
-
retriesRemaining: input.maxRetries,
|
|
48
|
-
requestHandler: input.requestHandler,
|
|
49
|
-
})
|
|
50
|
-
.then(() => {
|
|
51
|
-
reject(new Error('Expected response to be streamed'));
|
|
52
|
-
})
|
|
53
|
-
.catch((err) => {
|
|
54
|
-
reject(err);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
return {
|
|
58
|
-
estimatedPrice: res.estimatedPrice,
|
|
59
|
-
url: res.output,
|
|
60
|
-
outKey: res.outKey,
|
|
61
|
-
sizeInBytes: res.size,
|
|
62
|
-
bucketName: res.bucketName,
|
|
63
|
-
renderId: res.renderId,
|
|
64
|
-
cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
65
|
-
functionName,
|
|
66
|
-
method: serverless_client_1.ServerlessRoutines.still,
|
|
67
|
-
region,
|
|
68
|
-
renderId: res.renderId,
|
|
69
|
-
rendererFunctionName: null,
|
|
70
|
-
}),
|
|
71
|
-
artifacts: res.receivedArtifacts,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
catch (err) {
|
|
75
|
-
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('UnrecognizedClientException')) {
|
|
76
|
-
throw new Error('UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception');
|
|
77
|
-
}
|
|
78
|
-
throw err;
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
exports.internalRenderStillOnLambda = (0, serverless_client_2.wrapWithErrorHandling)(innerRenderStillOnLambda);
|
|
82
|
-
/*
|
|
83
|
-
* @description Renders a still image inside a lambda function and writes it to the specified output location.
|
|
84
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/renderstillonlambda)
|
|
85
|
-
*/
|
|
86
|
-
const renderStillOnLambda = (input) => {
|
|
87
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
88
|
-
return (0, exports.internalRenderStillOnLambda)({
|
|
89
|
-
chromiumOptions: (_a = input.chromiumOptions) !== null && _a !== void 0 ? _a : {},
|
|
90
|
-
composition: input.composition,
|
|
91
|
-
deleteAfter: (_b = input.deleteAfter) !== null && _b !== void 0 ? _b : null,
|
|
92
|
-
downloadBehavior: (_c = input.downloadBehavior) !== null && _c !== void 0 ? _c : { type: 'play-in-browser' },
|
|
93
|
-
envVariables: (_d = input.envVariables) !== null && _d !== void 0 ? _d : {},
|
|
94
|
-
forceBucketName: (_e = input.forceBucketName) !== null && _e !== void 0 ? _e : null,
|
|
95
|
-
forceHeight: (_f = input.forceHeight) !== null && _f !== void 0 ? _f : null,
|
|
96
|
-
forceWidth: (_g = input.forceWidth) !== null && _g !== void 0 ? _g : null,
|
|
97
|
-
frame: (_h = input.frame) !== null && _h !== void 0 ? _h : 0,
|
|
98
|
-
functionName: input.functionName,
|
|
99
|
-
imageFormat: input.imageFormat,
|
|
100
|
-
indent: false,
|
|
101
|
-
inputProps: input.inputProps,
|
|
102
|
-
maxRetries: (_j = input.maxRetries) !== null && _j !== void 0 ? _j : constants_1.DEFAULT_MAX_RETRIES,
|
|
103
|
-
onInit: (_k = input.onInit) !== null && _k !== void 0 ? _k : (() => undefined),
|
|
104
|
-
outName: (_l = input.outName) !== null && _l !== void 0 ? _l : null,
|
|
105
|
-
privacy: input.privacy,
|
|
106
|
-
region: input.region,
|
|
107
|
-
serveUrl: input.serveUrl,
|
|
108
|
-
jpegQuality: (_o = (_m = input.jpegQuality) !== null && _m !== void 0 ? _m : input.quality) !== null && _o !== void 0 ? _o : 80,
|
|
109
|
-
logLevel: input.dumpBrowserLogs ? 'verbose' : ((_p = input.logLevel) !== null && _p !== void 0 ? _p : 'info'),
|
|
110
|
-
offthreadVideoCacheSizeInBytes: (_q = input.offthreadVideoCacheSizeInBytes) !== null && _q !== void 0 ? _q : null,
|
|
111
|
-
scale: (_r = input.scale) !== null && _r !== void 0 ? _r : 1,
|
|
112
|
-
timeoutInMilliseconds: (_s = input.timeoutInMilliseconds) !== null && _s !== void 0 ? _s : 30000,
|
|
113
|
-
forcePathStyle: (_t = input.forcePathStyle) !== null && _t !== void 0 ? _t : false,
|
|
114
|
-
apiKey: (_u = input.apiKey) !== null && _u !== void 0 ? _u : null,
|
|
115
|
-
offthreadVideoThreads: (_v = input.offthreadVideoThreads) !== null && _v !== void 0 ? _v : null,
|
|
116
|
-
storageClass: (_w = input.storageClass) !== null && _w !== void 0 ? _w : null,
|
|
117
|
-
requestHandler: (_x = input.requestHandler) !== null && _x !== void 0 ? _x : null,
|
|
118
|
-
mediaCacheSizeInBytes: (_y = input.mediaCacheSizeInBytes) !== null && _y !== void 0 ? _y : null,
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
exports.renderStillOnLambda = renderStillOnLambda;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type SpeculateFunctionNameInput = {
|
|
2
|
-
memorySizeInMb: string | number;
|
|
3
|
-
diskSizeInMb: string | number;
|
|
4
|
-
timeoutInSeconds: string | number;
|
|
5
|
-
};
|
|
6
|
-
export declare const innerSpeculateFunctionName: ({ diskSizeInMb, memorySizeInMb, timeoutInSeconds, }: SpeculateFunctionNameInput) => string;
|
|
7
|
-
export declare const speculateFunctionName: ({ memorySizeInMb, diskSizeInMb, timeoutInSeconds, }: SpeculateFunctionNameInput) => string;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.speculateFunctionName = exports.innerSpeculateFunctionName = void 0;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
const lambda_version_string_1 = require("./lambda-version-string");
|
|
6
|
-
const innerSpeculateFunctionName = ({ diskSizeInMb, memorySizeInMb, timeoutInSeconds, }) => {
|
|
7
|
-
// No validation here, used in find-function-name.ts
|
|
8
|
-
return [
|
|
9
|
-
`${constants_1.RENDER_FN_PREFIX}${lambda_version_string_1.LAMBDA_VERSION_STRING}`,
|
|
10
|
-
`mem${memorySizeInMb}mb`,
|
|
11
|
-
`disk${diskSizeInMb}mb`,
|
|
12
|
-
`${timeoutInSeconds}sec`,
|
|
13
|
-
].join('-');
|
|
14
|
-
};
|
|
15
|
-
exports.innerSpeculateFunctionName = innerSpeculateFunctionName;
|
|
16
|
-
/*
|
|
17
|
-
* @description Speculate the name of the Lambda function that will be created by `deployFunction()` or its CLI equivalent, based on the function configuration.
|
|
18
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/speculatefunctionname)
|
|
19
|
-
*/
|
|
20
|
-
const speculateFunctionName = ({ memorySizeInMb, diskSizeInMb, timeoutInSeconds, }) => {
|
|
21
|
-
const memorySize = Number(memorySizeInMb);
|
|
22
|
-
const diskSize = Number(diskSizeInMb);
|
|
23
|
-
const timeout = Number(timeoutInSeconds);
|
|
24
|
-
if (!Number.isInteger(memorySize) || memorySize <= 0) {
|
|
25
|
-
throw new Error(`Memory size must be a positive integer. Received: ${memorySizeInMb}`);
|
|
26
|
-
}
|
|
27
|
-
if (!Number.isInteger(diskSize) || diskSize <= 0) {
|
|
28
|
-
throw new Error(`Disk size must be a positive integer. Received: ${diskSizeInMb}`);
|
|
29
|
-
}
|
|
30
|
-
if (!Number.isInteger(timeout) || timeout <= 0) {
|
|
31
|
-
throw new Error(`Timeout must be a positive integer. Received: ${timeoutInSeconds}`);
|
|
32
|
-
}
|
|
33
|
-
return (0, exports.innerSpeculateFunctionName)({
|
|
34
|
-
diskSizeInMb,
|
|
35
|
-
memorySizeInMb,
|
|
36
|
-
timeoutInSeconds,
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
exports.speculateFunctionName = speculateFunctionName;
|
package/dist/types.d.ts
DELETED
package/dist/types.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateAwsRegion = validateAwsRegion;
|
|
4
|
-
const regions_1 = require("./regions");
|
|
5
|
-
function validateAwsRegion(region) {
|
|
6
|
-
if (!regions_1.AWS_REGIONS.includes(region)) {
|
|
7
|
-
throw new TypeError(`${region} is not a supported AWS region. Must be one of: ${regions_1.AWS_REGIONS.join(', ')}`);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseBucketName = void 0;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
const regions_1 = require("./regions");
|
|
6
|
-
const parseBucketName = (name) => {
|
|
7
|
-
const parsed = name.match(new RegExp(`^${constants_1.REMOTION_BUCKET_PREFIX}(.*)-([a-z0-9A-Z]+)$`));
|
|
8
|
-
const region = parsed === null || parsed === void 0 ? void 0 : parsed[1];
|
|
9
|
-
if (!region) {
|
|
10
|
-
return { region: null };
|
|
11
|
-
}
|
|
12
|
-
const realRegionFound = regions_1.AWS_REGIONS.find((r) => r.replace(/-/g, '') === region);
|
|
13
|
-
return { region: realRegionFound !== null && realRegionFound !== void 0 ? realRegionFound : null };
|
|
14
|
-
};
|
|
15
|
-
exports.parseBucketName = parseBucketName;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const validateDiskSizeInMb: (diskSizeInMb: unknown) => void;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateDiskSizeInMb = void 0;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
const validateDiskSizeInMb = (diskSizeInMb) => {
|
|
6
|
-
if (typeof diskSizeInMb !== 'number') {
|
|
7
|
-
throw new TypeError(`parameter 'diskSizeInMb' must be a number, got a ${typeof diskSizeInMb}`);
|
|
8
|
-
}
|
|
9
|
-
if (Number.isNaN(diskSizeInMb)) {
|
|
10
|
-
throw new TypeError(`parameter 'diskSizeInMb' must not be NaN, but is`);
|
|
11
|
-
}
|
|
12
|
-
if (!Number.isFinite(diskSizeInMb)) {
|
|
13
|
-
throw new TypeError(`parameter 'diskSizeInMb' must be finite, but is ${diskSizeInMb}`);
|
|
14
|
-
}
|
|
15
|
-
if (diskSizeInMb < constants_1.MIN_EPHEMERAL_STORAGE_IN_MB ||
|
|
16
|
-
diskSizeInMb > constants_1.MAX_EPHEMERAL_STORAGE_IN_MB) {
|
|
17
|
-
throw new TypeError(`parameter 'diskSizeInMb' must be between ${constants_1.MIN_EPHEMERAL_STORAGE_IN_MB} and ${constants_1.MAX_EPHEMERAL_STORAGE_IN_MB}, but got ${diskSizeInMb}`);
|
|
18
|
-
}
|
|
19
|
-
if (diskSizeInMb % 1 !== 0) {
|
|
20
|
-
throw new TypeError(`parameter 'diskSizeInMb' must be an integer but got ${diskSizeInMb}`);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
exports.validateDiskSizeInMb = validateDiskSizeInMb;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateLambdaCodec = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const validateLambdaCodec = (codec) => {
|
|
6
|
-
if (typeof codec !== 'string') {
|
|
7
|
-
throw new TypeError('"codec" must be a string ');
|
|
8
|
-
}
|
|
9
|
-
if (!serverless_client_1.serverlessCodecs.includes(codec)) {
|
|
10
|
-
throw new TypeError("'" +
|
|
11
|
-
codec +
|
|
12
|
-
"' is not a valid codec for Lambda. The following values are supported: " +
|
|
13
|
-
serverless_client_1.serverlessCodecs.join(', '));
|
|
14
|
-
}
|
|
15
|
-
if (codec === 'h264-mkv') {
|
|
16
|
-
console.warn('The "h264-mkv" codec for renderMediaOnLambda() is deprecated - it\'s now just "h264".');
|
|
17
|
-
return 'h264';
|
|
18
|
-
}
|
|
19
|
-
return codec;
|
|
20
|
-
};
|
|
21
|
-
exports.validateLambdaCodec = validateLambdaCodec;
|