@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/constants.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { GenericRenderProgress, Privacy } from '@remotion/serverless-client';
|
|
2
|
-
import type { AwsProvider } from './aws-provider';
|
|
3
|
-
import type { AwsRegion } from './regions';
|
|
4
|
-
export declare const MIN_MEMORY = 512;
|
|
5
|
-
export declare const MAX_MEMORY = 10240;
|
|
6
|
-
export declare const DEFAULT_MEMORY_SIZE = 2048;
|
|
7
|
-
export declare const DEFAULT_TIMEOUT = 120;
|
|
8
|
-
export declare const MIN_TIMEOUT = 15;
|
|
9
|
-
export declare const MAX_TIMEOUT = 900;
|
|
10
|
-
export declare const DEFAULT_FRAMES_PER_LAMBDA = 20;
|
|
11
|
-
export declare const BINARY_NAME = "remotion lambda";
|
|
12
|
-
export declare const DEFAULT_REGION: AwsRegion;
|
|
13
|
-
export declare const DEFAULT_MAX_RETRIES = 1;
|
|
14
|
-
export declare const MAX_EPHEMERAL_STORAGE_IN_MB = 10240;
|
|
15
|
-
export declare const DEFAULT_EPHEMERAL_STORAGE_IN_MB = 2048;
|
|
16
|
-
export declare const MIN_EPHEMERAL_STORAGE_IN_MB = 512;
|
|
17
|
-
export declare const DEFAULT_OUTPUT_PRIVACY: Privacy;
|
|
18
|
-
export declare const DEFAULT_CLOUDWATCH_RETENTION_PERIOD = 14;
|
|
19
|
-
export declare const RENDER_FN_PREFIX = "remotion-render-";
|
|
20
|
-
export declare const LOG_GROUP_PREFIX = "/aws/lambda/";
|
|
21
|
-
export declare const LAMBDA_INSIGHTS_PREFIX = "/aws/lambda-insights";
|
|
22
|
-
export declare const getSitesKey: (siteId: string) => string;
|
|
23
|
-
export type RenderProgress = GenericRenderProgress<AwsProvider>;
|
|
24
|
-
export declare const LAMBDA_CONCURRENCY_LIMIT_QUOTA = "L-B99A9384";
|
|
25
|
-
export declare const REMOTION_BUCKET_PREFIX = "remotionlambda-";
|
package/dist/constants.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOTION_BUCKET_PREFIX = exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.getSitesKey = exports.LAMBDA_INSIGHTS_PREFIX = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.MIN_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = exports.MAX_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_REGION = exports.BINARY_NAME = exports.DEFAULT_FRAMES_PER_LAMBDA = exports.MAX_TIMEOUT = exports.MIN_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DEFAULT_MEMORY_SIZE = exports.MAX_MEMORY = exports.MIN_MEMORY = void 0;
|
|
4
|
-
exports.MIN_MEMORY = 512;
|
|
5
|
-
exports.MAX_MEMORY = 10240;
|
|
6
|
-
exports.DEFAULT_MEMORY_SIZE = 2048;
|
|
7
|
-
exports.DEFAULT_TIMEOUT = 120;
|
|
8
|
-
exports.MIN_TIMEOUT = 15;
|
|
9
|
-
exports.MAX_TIMEOUT = 900;
|
|
10
|
-
exports.DEFAULT_FRAMES_PER_LAMBDA = 20;
|
|
11
|
-
exports.BINARY_NAME = 'remotion lambda';
|
|
12
|
-
exports.DEFAULT_REGION = 'us-east-1';
|
|
13
|
-
exports.DEFAULT_MAX_RETRIES = 1;
|
|
14
|
-
exports.MAX_EPHEMERAL_STORAGE_IN_MB = 10240;
|
|
15
|
-
// TODO: In V5, Enable set this to 10240
|
|
16
|
-
exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = 2048;
|
|
17
|
-
exports.MIN_EPHEMERAL_STORAGE_IN_MB = 512;
|
|
18
|
-
exports.DEFAULT_OUTPUT_PRIVACY = 'public';
|
|
19
|
-
exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = 14;
|
|
20
|
-
exports.RENDER_FN_PREFIX = 'remotion-render-';
|
|
21
|
-
exports.LOG_GROUP_PREFIX = '/aws/lambda/';
|
|
22
|
-
exports.LAMBDA_INSIGHTS_PREFIX = '/aws/lambda-insights';
|
|
23
|
-
const getSitesKey = (siteId) => `sites/${siteId}`;
|
|
24
|
-
exports.getSitesKey = getSitesKey;
|
|
25
|
-
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = 'L-B99A9384';
|
|
26
|
-
exports.REMOTION_BUCKET_PREFIX = 'remotionlambda-';
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getContentDispositionHeader = void 0;
|
|
4
|
-
// By setting the Content-Disposition header in an S3 object,
|
|
5
|
-
// you can control if the user downloads the item if you
|
|
6
|
-
// visit the link
|
|
7
|
-
const problematicCharacters = {
|
|
8
|
-
'%3A': ':',
|
|
9
|
-
'%2F': '/',
|
|
10
|
-
'%3F': '?',
|
|
11
|
-
'%23': '#',
|
|
12
|
-
'%5B': '[',
|
|
13
|
-
'%5D': ']',
|
|
14
|
-
'%40': '@',
|
|
15
|
-
'%21': '!',
|
|
16
|
-
'%24': '$',
|
|
17
|
-
'%26': '&',
|
|
18
|
-
'%27': "'",
|
|
19
|
-
'%28': '(',
|
|
20
|
-
'%29': ')',
|
|
21
|
-
'%2A': '*',
|
|
22
|
-
'%2B': '+',
|
|
23
|
-
'%2C': ',',
|
|
24
|
-
'%3B': ';',
|
|
25
|
-
};
|
|
26
|
-
const includesHexOfUnsafeChar = (path) => {
|
|
27
|
-
for (const key of Object.keys(problematicCharacters)) {
|
|
28
|
-
if (path.includes(key)) {
|
|
29
|
-
return { containsHex: true };
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return { containsHex: false };
|
|
33
|
-
};
|
|
34
|
-
const getContentDispositionHeader = (behavior) => {
|
|
35
|
-
if (behavior === null) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
if (behavior.type === 'play-in-browser') {
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
if (behavior.fileName === null) {
|
|
42
|
-
return `attachment`;
|
|
43
|
-
}
|
|
44
|
-
const { containsHex } = includesHexOfUnsafeChar(behavior.fileName);
|
|
45
|
-
if (containsHex) {
|
|
46
|
-
return `attachment; filename="${behavior.fileName}"`;
|
|
47
|
-
}
|
|
48
|
-
return `attachment; filename="${encodeURIComponent(behavior.fileName)}"`;
|
|
49
|
-
};
|
|
50
|
-
exports.getContentDispositionHeader = getContentDispositionHeader;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertToServeUrlImplementation = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const convertToServeUrlImplementation = ({ urlOrId, region, bucketName, }) => {
|
|
6
|
-
if (urlOrId.startsWith('src/')) {
|
|
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 ${serverless_client_1.DOCS_URL}/docs/lambda/setup`);
|
|
8
|
-
}
|
|
9
|
-
if (urlOrId.startsWith('http://') || urlOrId.startsWith('https://')) {
|
|
10
|
-
return urlOrId;
|
|
11
|
-
}
|
|
12
|
-
return `https://${bucketName}.s3.${region}.amazonaws.com/sites/${urlOrId}/index.html`;
|
|
13
|
-
};
|
|
14
|
-
exports.convertToServeUrlImplementation = convertToServeUrlImplementation;
|
package/dist/create-bucket.d.ts
DELETED
package/dist/create-bucket.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createBucket = void 0;
|
|
4
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
-
const get_s3_client_1 = require("./get-s3-client");
|
|
6
|
-
const createBucket = async ({ region, bucketName, forcePathStyle, requestHandler }) => {
|
|
7
|
-
await (0, get_s3_client_1.getS3Client)({
|
|
8
|
-
region,
|
|
9
|
-
customCredentials: null,
|
|
10
|
-
forcePathStyle,
|
|
11
|
-
requestHandler,
|
|
12
|
-
}).send(new client_s3_1.CreateBucketCommand({
|
|
13
|
-
Bucket: bucketName,
|
|
14
|
-
}));
|
|
15
|
-
try {
|
|
16
|
-
await (0, get_s3_client_1.getS3Client)({
|
|
17
|
-
region,
|
|
18
|
-
customCredentials: null,
|
|
19
|
-
forcePathStyle,
|
|
20
|
-
requestHandler,
|
|
21
|
-
}).send(new client_s3_1.DeleteBucketOwnershipControlsCommand({
|
|
22
|
-
Bucket: bucketName,
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
if (err.message.includes('Access Denied')) {
|
|
27
|
-
throw new Error('Since April 2023, more AWS permissions are required to create an S3 bucket. You need to update your user policy to continue. See https://remotion.dev/docs/lambda/s3-public-access for instructions on how to resolve this issue.');
|
|
28
|
-
}
|
|
29
|
-
throw err;
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
await (0, get_s3_client_1.getS3Client)({
|
|
33
|
-
region,
|
|
34
|
-
customCredentials: null,
|
|
35
|
-
forcePathStyle,
|
|
36
|
-
requestHandler,
|
|
37
|
-
}).send(new client_s3_1.DeletePublicAccessBlockCommand({
|
|
38
|
-
Bucket: bucketName,
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
if (err.message.includes('Access Denied')) {
|
|
43
|
-
throw new Error('PARTIAL SUCCESS: The s3:PutBucketOwnershipControls was found, but the s3:PutBucketPublicAccessBlock permission is not given. Since April 2023, more AWS permissions are required to create an S3 bucket. You need to update your user policy to continue. You need to update your user policy to continue. See https://remotion.dev/docs/lambda/s3-public-access for instructions on how to resolve this issue.');
|
|
44
|
-
}
|
|
45
|
-
throw err;
|
|
46
|
-
}
|
|
47
|
-
try {
|
|
48
|
-
await (0, get_s3_client_1.getS3Client)({
|
|
49
|
-
region,
|
|
50
|
-
customCredentials: null,
|
|
51
|
-
forcePathStyle,
|
|
52
|
-
requestHandler,
|
|
53
|
-
}).send(new client_s3_1.PutBucketAclCommand({
|
|
54
|
-
Bucket: bucketName,
|
|
55
|
-
ACL: 'public-read',
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
catch (err) {
|
|
59
|
-
if (err.message.includes('The bucket does not allow ACLs')) {
|
|
60
|
-
throw new Error(`Could not add an ACL to the bucket. This might have happened because the bucket was already successfully created before but then failed to configure correctly. We recommend to delete the bucket (${bucketName}) if it is empty and start over to fix the problem.`);
|
|
61
|
-
}
|
|
62
|
-
throw err;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
exports.createBucket = createBucket;
|
package/dist/delete-file.d.ts
DELETED
package/dist/delete-file.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lambdaDeleteFileImplementation = void 0;
|
|
4
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
-
const get_s3_client_1 = require("./get-s3-client");
|
|
6
|
-
const lambdaDeleteFileImplementation = async ({ bucketName, key, region, customCredentials, forcePathStyle, requestHandler, }) => {
|
|
7
|
-
await (0, get_s3_client_1.getS3Client)({
|
|
8
|
-
region,
|
|
9
|
-
customCredentials,
|
|
10
|
-
forcePathStyle,
|
|
11
|
-
requestHandler,
|
|
12
|
-
}).send(new client_s3_1.DeleteObjectCommand({
|
|
13
|
-
Bucket: bucketName,
|
|
14
|
-
Key: key,
|
|
15
|
-
}));
|
|
16
|
-
};
|
|
17
|
-
exports.lambdaDeleteFileImplementation = lambdaDeleteFileImplementation;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DeleteFunction, DeleteFunctionInput as GenericDeleteFunctionInput } from '@remotion/serverless-client';
|
|
2
|
-
import type { AwsProvider } from './aws-provider';
|
|
3
|
-
import type { RequestHandler } from './types';
|
|
4
|
-
export type DeleteFunctionInput = GenericDeleteFunctionInput<AwsProvider> & {
|
|
5
|
-
requestHandler?: RequestHandler;
|
|
6
|
-
};
|
|
7
|
-
export declare const deleteFunction: DeleteFunction<AwsProvider>;
|
package/dist/delete-function.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteFunction = void 0;
|
|
4
|
-
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
-
const aws_clients_1 = require("./aws-clients");
|
|
6
|
-
/*
|
|
7
|
-
* @description Deletes a deployed Lambda function based on its name.
|
|
8
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/deletefunction)
|
|
9
|
-
*/
|
|
10
|
-
const deleteFunction = async ({ region, functionName, requestHandler, }) => {
|
|
11
|
-
await (0, aws_clients_1.getLambdaClient)(region, undefined, requestHandler !== null && requestHandler !== void 0 ? requestHandler : null).send(new client_lambda_1.DeleteFunctionCommand({
|
|
12
|
-
FunctionName: functionName,
|
|
13
|
-
}));
|
|
14
|
-
};
|
|
15
|
-
exports.deleteFunction = deleteFunction;
|
package/dist/delete-render.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ProviderSpecifics } from '@remotion/serverless-client';
|
|
2
|
-
import { type CustomCredentials } from '@remotion/serverless-client';
|
|
3
|
-
import type { AwsProvider } from './aws-provider';
|
|
4
|
-
import type { AwsRegion } from './regions';
|
|
5
|
-
import type { RequestHandler } from './types';
|
|
6
|
-
export type DeleteRenderInput = {
|
|
7
|
-
region: AwsRegion;
|
|
8
|
-
bucketName: string;
|
|
9
|
-
renderId: string;
|
|
10
|
-
customCredentials?: CustomCredentials<AwsProvider>;
|
|
11
|
-
forcePathStyle?: boolean;
|
|
12
|
-
requestHandler?: RequestHandler;
|
|
13
|
-
};
|
|
14
|
-
export declare const internalDeleteRender: (input: DeleteRenderInput & {
|
|
15
|
-
providerSpecifics: ProviderSpecifics<AwsProvider>;
|
|
16
|
-
forcePathStyle: boolean;
|
|
17
|
-
}) => Promise<{
|
|
18
|
-
freedBytes: number;
|
|
19
|
-
}>;
|
|
20
|
-
export declare const deleteRender: (input: DeleteRenderInput) => Promise<{
|
|
21
|
-
freedBytes: number;
|
|
22
|
-
}>;
|
package/dist/delete-render.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteRender = exports.internalDeleteRender = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const aws_provider_1 = require("./aws-provider");
|
|
6
|
-
const clean_items_1 = require("./clean-items");
|
|
7
|
-
const constants_1 = require("./constants");
|
|
8
|
-
const internalDeleteRender = async (input) => {
|
|
9
|
-
var _a;
|
|
10
|
-
const expectedBucketOwner = await input.providerSpecifics.getAccountId({
|
|
11
|
-
region: input.region,
|
|
12
|
-
});
|
|
13
|
-
const progress = await (0, serverless_client_1.getOverallProgressFromStorage)({
|
|
14
|
-
bucketName: input.bucketName,
|
|
15
|
-
expectedBucketOwner,
|
|
16
|
-
region: input.region,
|
|
17
|
-
renderId: input.renderId,
|
|
18
|
-
providerSpecifics: input.providerSpecifics,
|
|
19
|
-
forcePathStyle: input.forcePathStyle,
|
|
20
|
-
requestHandler: input.requestHandler,
|
|
21
|
-
});
|
|
22
|
-
// Render did not start yet
|
|
23
|
-
if (progress.renderMetadata === null) {
|
|
24
|
-
return { freedBytes: 0 };
|
|
25
|
-
}
|
|
26
|
-
const { key, renderBucketName, customCredentials } = (0, serverless_client_1.getExpectedOutName)({
|
|
27
|
-
renderMetadata: progress.renderMetadata,
|
|
28
|
-
bucketName: input.bucketName,
|
|
29
|
-
customCredentials: (_a = input.customCredentials) !== null && _a !== void 0 ? _a : null,
|
|
30
|
-
bucketNamePrefix: constants_1.REMOTION_BUCKET_PREFIX,
|
|
31
|
-
});
|
|
32
|
-
await input.providerSpecifics.deleteFile({
|
|
33
|
-
bucketName: renderBucketName,
|
|
34
|
-
customCredentials,
|
|
35
|
-
key,
|
|
36
|
-
region: input.region,
|
|
37
|
-
forcePathStyle: input.forcePathStyle,
|
|
38
|
-
requestHandler: input.requestHandler,
|
|
39
|
-
});
|
|
40
|
-
let files = await input.providerSpecifics.listObjects({
|
|
41
|
-
bucketName: input.bucketName,
|
|
42
|
-
prefix: (0, serverless_client_1.rendersPrefix)(input.renderId),
|
|
43
|
-
region: input.region,
|
|
44
|
-
expectedBucketOwner,
|
|
45
|
-
forcePathStyle: input.forcePathStyle,
|
|
46
|
-
requestHandler: input.requestHandler,
|
|
47
|
-
});
|
|
48
|
-
let totalSize = 0;
|
|
49
|
-
while (files.length > 0) {
|
|
50
|
-
totalSize += files.reduce((a, b) => {
|
|
51
|
-
var _a;
|
|
52
|
-
return a + ((_a = b.Size) !== null && _a !== void 0 ? _a : 0);
|
|
53
|
-
}, 0);
|
|
54
|
-
await (0, clean_items_1.cleanItems)({
|
|
55
|
-
list: files.map((f) => f.Key),
|
|
56
|
-
bucket: input.bucketName,
|
|
57
|
-
onAfterItemDeleted: () => undefined,
|
|
58
|
-
onBeforeItemDeleted: () => undefined,
|
|
59
|
-
region: input.region,
|
|
60
|
-
providerSpecifics: input.providerSpecifics,
|
|
61
|
-
forcePathStyle: input.forcePathStyle,
|
|
62
|
-
requestHandler: input.requestHandler,
|
|
63
|
-
});
|
|
64
|
-
files = await input.providerSpecifics.listObjects({
|
|
65
|
-
bucketName: input.bucketName,
|
|
66
|
-
prefix: (0, serverless_client_1.rendersPrefix)(input.renderId),
|
|
67
|
-
region: input.region,
|
|
68
|
-
expectedBucketOwner,
|
|
69
|
-
forcePathStyle: input.forcePathStyle,
|
|
70
|
-
requestHandler: input.requestHandler,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
freedBytes: totalSize,
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
exports.internalDeleteRender = internalDeleteRender;
|
|
78
|
-
/*
|
|
79
|
-
* @description Deletes a rendered video, audio or still and its associated metadata.
|
|
80
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/deleterender)
|
|
81
|
-
*/
|
|
82
|
-
const deleteRender = (input) => {
|
|
83
|
-
var _a;
|
|
84
|
-
return (0, exports.internalDeleteRender)({
|
|
85
|
-
...input,
|
|
86
|
-
providerSpecifics: aws_provider_1.awsImplementation,
|
|
87
|
-
forcePathStyle: (_a = input.forcePathStyle) !== null && _a !== void 0 ? _a : false,
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
exports.deleteRender = deleteRender;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const encodeAwsUrlParams: (input: string) => string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.encodeAwsUrlParams = void 0;
|
|
4
|
-
const encodeAwsUrlParams = (input) => {
|
|
5
|
-
return encodeURIComponent(input).replace(/%/g, '$25');
|
|
6
|
-
};
|
|
7
|
-
exports.encodeAwsUrlParams = encodeAwsUrlParams;
|
package/dist/estimate-price.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { AwsRegion } from './regions';
|
|
2
|
-
type Miliseconds = {
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Typo in property name. Use `durationInMilliseconds` instead.
|
|
5
|
-
*/
|
|
6
|
-
durationInMiliseconds: number;
|
|
7
|
-
} | {
|
|
8
|
-
durationInMilliseconds: number;
|
|
9
|
-
};
|
|
10
|
-
export type EstimatePriceInput = {
|
|
11
|
-
region: AwsRegion;
|
|
12
|
-
memorySizeInMb: number;
|
|
13
|
-
diskSizeInMb: number;
|
|
14
|
-
lambdasInvoked: number;
|
|
15
|
-
} & Miliseconds;
|
|
16
|
-
export declare const estimatePrice: ({ region, memorySizeInMb, diskSizeInMb, lambdasInvoked, ...other }: EstimatePriceInput) => number;
|
|
17
|
-
export {};
|
package/dist/estimate-price.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.estimatePrice = void 0;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
const price_per_1s_1 = require("./price-per-1s");
|
|
6
|
-
const validate_aws_region_1 = require("./validate-aws-region");
|
|
7
|
-
const validate_disk_size_in_mb_1 = require("./validate-disk-size-in-mb");
|
|
8
|
-
const validate_memory_size_1 = require("./validate-memory-size");
|
|
9
|
-
/*
|
|
10
|
-
* @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.
|
|
11
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/estimateprice)
|
|
12
|
-
*/
|
|
13
|
-
const estimatePrice = ({ region, memorySizeInMb, diskSizeInMb, lambdasInvoked, ...other }) => {
|
|
14
|
-
(0, validate_memory_size_1.validateMemorySize)(memorySizeInMb);
|
|
15
|
-
(0, validate_aws_region_1.validateAwsRegion)(region);
|
|
16
|
-
(0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(diskSizeInMb);
|
|
17
|
-
const durationInMilliseconds = 'durationInMiliseconds' in other
|
|
18
|
-
? other.durationInMiliseconds
|
|
19
|
-
: other.durationInMilliseconds;
|
|
20
|
-
if (typeof durationInMilliseconds !== 'number') {
|
|
21
|
-
throw new TypeError(`Parameter 'durationInMilliseconds' must be a number but got ${typeof durationInMilliseconds}`);
|
|
22
|
-
}
|
|
23
|
-
if (Number.isNaN(durationInMilliseconds)) {
|
|
24
|
-
throw new TypeError(`Parameter 'durationInMilliseconds' must not be NaN but it is.`);
|
|
25
|
-
}
|
|
26
|
-
if (!Number.isFinite(durationInMilliseconds)) {
|
|
27
|
-
throw new TypeError(`Parameter 'durationInMilliseconds' must be finite but it is ${durationInMilliseconds}`);
|
|
28
|
-
}
|
|
29
|
-
if (durationInMilliseconds < 0) {
|
|
30
|
-
throw new TypeError(`Parameter 'durationInMilliseconds' must be over 0 but it is ${durationInMilliseconds}.`);
|
|
31
|
-
}
|
|
32
|
-
const durationPrice = price_per_1s_1.pricing[region]['Lambda Duration-ARM'].price;
|
|
33
|
-
// In GB-second
|
|
34
|
-
const timeCostDollars = Number(durationPrice) *
|
|
35
|
-
((memorySizeInMb * durationInMilliseconds) / 1000 / 1024);
|
|
36
|
-
const diskSizePrice = price_per_1s_1.pricing[region]['Lambda Storage-Duration-ARM'].price;
|
|
37
|
-
const chargedDiskSize = Math.max(0, diskSizeInMb - constants_1.MIN_EPHEMERAL_STORAGE_IN_MB);
|
|
38
|
-
// In GB-second
|
|
39
|
-
const diskSizeDollars = chargedDiskSize *
|
|
40
|
-
Number(diskSizePrice) *
|
|
41
|
-
(durationInMilliseconds / 1000 / 1024);
|
|
42
|
-
const invocationCost = Number(price_per_1s_1.pricing[region]['Lambda Requests'].price) * lambdasInvoked;
|
|
43
|
-
return Number((timeCostDollars + diskSizeDollars + invocationCost).toFixed(5));
|
|
44
|
-
};
|
|
45
|
-
exports.estimatePrice = estimatePrice;
|
package/dist/express-webhook.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.expressWebhook = void 0;
|
|
4
|
-
const pages_router_webhook_1 = require("./pages-router-webhook");
|
|
5
|
-
const validate_webhook_signature_1 = require("./validate-webhook-signature");
|
|
6
|
-
const expressWebhook = (options) => {
|
|
7
|
-
const { testing, extraHeaders, secret, onSuccess, onTimeout, onError } = options;
|
|
8
|
-
return async (req, res) => {
|
|
9
|
-
// add headers to enable testing
|
|
10
|
-
if (testing) {
|
|
11
|
-
const testingheaders = {
|
|
12
|
-
'Access-Control-Allow-Origin': 'https://www.remotion.dev',
|
|
13
|
-
'Access-Control-Allow-Headers': 'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version, X-Remotion-Status, X-Remotion-Signature, X-Remotion-Mode',
|
|
14
|
-
'Access-Control-Allow-Methods': 'OPTIONS,POST',
|
|
15
|
-
};
|
|
16
|
-
(0, pages_router_webhook_1.addHeaders)(res, testingheaders);
|
|
17
|
-
}
|
|
18
|
-
// add extra headers
|
|
19
|
-
(0, pages_router_webhook_1.addHeaders)(res, extraHeaders || {});
|
|
20
|
-
// dont go forward if just testing
|
|
21
|
-
if (req.method === 'OPTIONS') {
|
|
22
|
-
res.status(200).end();
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
// validate the webhook signature
|
|
27
|
-
(0, validate_webhook_signature_1.validateWebhookSignature)({
|
|
28
|
-
signatureHeader: req.header('X-Remotion-Signature'),
|
|
29
|
-
body: req.body,
|
|
30
|
-
secret,
|
|
31
|
-
});
|
|
32
|
-
// custom logic
|
|
33
|
-
const payload = req.body;
|
|
34
|
-
if (payload.type === 'success' && onSuccess) {
|
|
35
|
-
await onSuccess(payload);
|
|
36
|
-
}
|
|
37
|
-
else if (payload.type === 'error' && onError) {
|
|
38
|
-
await onError(payload);
|
|
39
|
-
}
|
|
40
|
-
else if (payload.type === 'timeout' && onTimeout) {
|
|
41
|
-
await onTimeout(payload);
|
|
42
|
-
}
|
|
43
|
-
// send response
|
|
44
|
-
res.status(200).json({ success: true });
|
|
45
|
-
}
|
|
46
|
-
catch (err) {
|
|
47
|
-
res.status(500).json({
|
|
48
|
-
success: false,
|
|
49
|
-
error: err instanceof Error ? err.message : String(err),
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
exports.expressWebhook = expressWebhook;
|
package/dist/get-account-id.d.ts
DELETED
package/dist/get-account-id.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAccountIdImplementation = void 0;
|
|
4
|
-
const client_sts_1 = require("@aws-sdk/client-sts");
|
|
5
|
-
const aws_clients_1 = require("./aws-clients");
|
|
6
|
-
const validate_aws_region_1 = require("./validate-aws-region");
|
|
7
|
-
const getAccountIdImplementation = async (options) => {
|
|
8
|
-
(0, validate_aws_region_1.validateAwsRegion)(options.region);
|
|
9
|
-
const callerIdentity = await (0, aws_clients_1.getStsClient)(options.region, null).send(new client_sts_1.GetCallerIdentityCommand({}));
|
|
10
|
-
if (!callerIdentity.Account) {
|
|
11
|
-
throw new Error('Cannot get account ID');
|
|
12
|
-
}
|
|
13
|
-
return callerIdentity.Account;
|
|
14
|
-
};
|
|
15
|
-
exports.getAccountIdImplementation = getAccountIdImplementation;
|
package/dist/get-aws-client.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as CloudWatchSDK from '@aws-sdk/client-cloudwatch-logs';
|
|
2
|
-
import * as IamSdk from '@aws-sdk/client-iam';
|
|
3
|
-
import * as LambdaSDK from '@aws-sdk/client-lambda';
|
|
4
|
-
import * as S3SDK from '@aws-sdk/client-s3';
|
|
5
|
-
import * as ServiceQuotasSDK from '@aws-sdk/client-service-quotas';
|
|
6
|
-
import * as StsSdk from '@aws-sdk/client-sts';
|
|
7
|
-
import type { CustomCredentials } from '@remotion/serverless-client';
|
|
8
|
-
import type { AwsProvider } from './aws-provider';
|
|
9
|
-
import { type ServiceMapping } from './get-service-client';
|
|
10
|
-
import type { AwsRegion } from './regions';
|
|
11
|
-
import type { RequestHandler } from './types';
|
|
12
|
-
export type GetAwsClientInput<T extends keyof ServiceMapping> = {
|
|
13
|
-
region: AwsRegion;
|
|
14
|
-
service: T;
|
|
15
|
-
customCredentials?: CustomCredentials<AwsProvider> | null;
|
|
16
|
-
forcePathStyle?: boolean;
|
|
17
|
-
requestHandler?: RequestHandler;
|
|
18
|
-
};
|
|
19
|
-
type SdkMapping = {
|
|
20
|
-
s3: typeof S3SDK;
|
|
21
|
-
cloudwatch: typeof CloudWatchSDK;
|
|
22
|
-
iam: typeof IamSdk;
|
|
23
|
-
lambda: typeof LambdaSDK;
|
|
24
|
-
servicequotas: typeof ServiceQuotasSDK;
|
|
25
|
-
sts: typeof StsSdk;
|
|
26
|
-
};
|
|
27
|
-
export type GetAwsClientOutput<T extends keyof ServiceMapping> = {
|
|
28
|
-
client: ServiceMapping[T];
|
|
29
|
-
sdk: SdkMapping[T];
|
|
30
|
-
};
|
|
31
|
-
export declare const getAwsClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, forcePathStyle, requestHandler, }: GetAwsClientInput<T>) => GetAwsClientOutput<T>;
|
|
32
|
-
export {};
|
package/dist/get-aws-client.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.getAwsClient = void 0;
|
|
37
|
-
const CloudWatchSDK = __importStar(require("@aws-sdk/client-cloudwatch-logs"));
|
|
38
|
-
const IamSdk = __importStar(require("@aws-sdk/client-iam"));
|
|
39
|
-
const LambdaSDK = __importStar(require("@aws-sdk/client-lambda"));
|
|
40
|
-
const S3SDK = __importStar(require("@aws-sdk/client-s3"));
|
|
41
|
-
const ServiceQuotasSDK = __importStar(require("@aws-sdk/client-service-quotas"));
|
|
42
|
-
const StsSdk = __importStar(require("@aws-sdk/client-sts"));
|
|
43
|
-
const get_service_client_1 = require("./get-service-client");
|
|
44
|
-
/*
|
|
45
|
-
* @description Exposes full access to the AWS SDK used by Remotion, allowing interaction with AWS infrastructure beyond provided functionalities.
|
|
46
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/getawsclient)
|
|
47
|
-
*/
|
|
48
|
-
const getAwsClient = ({ region, service, customCredentials, forcePathStyle, requestHandler, }) => {
|
|
49
|
-
return {
|
|
50
|
-
client: (0, get_service_client_1.getServiceClient)({
|
|
51
|
-
region,
|
|
52
|
-
service,
|
|
53
|
-
customCredentials: customCredentials !== null && customCredentials !== void 0 ? customCredentials : null,
|
|
54
|
-
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
55
|
-
requestHandler,
|
|
56
|
-
}),
|
|
57
|
-
sdk: {
|
|
58
|
-
lambda: LambdaSDK,
|
|
59
|
-
cloudwatch: CloudWatchSDK,
|
|
60
|
-
iam: IamSdk,
|
|
61
|
-
s3: S3SDK,
|
|
62
|
-
servicequotas: ServiceQuotasSDK,
|
|
63
|
-
sts: StsSdk,
|
|
64
|
-
}[service],
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
exports.getAwsClient = getAwsClient;
|
package/dist/get-aws-urls.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { GetLoggingUrlForRendererFunction, ServerlessRoutines } from '@remotion/serverless-client';
|
|
2
|
-
import type { AwsProvider } from './aws-provider';
|
|
3
|
-
import type { AwsRegion } from './regions';
|
|
4
|
-
export declare const getCloudwatchMethodUrl: ({ region, functionName, renderId, rendererFunctionName, method, }: {
|
|
5
|
-
region: AwsRegion;
|
|
6
|
-
functionName: string;
|
|
7
|
-
method: ServerlessRoutines;
|
|
8
|
-
rendererFunctionName: string | null;
|
|
9
|
-
renderId: string;
|
|
10
|
-
}) => string;
|
|
11
|
-
export declare const getLambdaInsightsUrl: ({ region, functionName, }: {
|
|
12
|
-
region: AwsRegion;
|
|
13
|
-
functionName: string;
|
|
14
|
-
}) => string;
|
|
15
|
-
export declare const getCloudwatchRendererUrl: GetLoggingUrlForRendererFunction<AwsProvider>;
|
|
16
|
-
export declare const getS3RenderUrl: ({ renderId, region, bucketName, }: {
|
|
17
|
-
renderId: string;
|
|
18
|
-
region: AwsRegion;
|
|
19
|
-
bucketName: string;
|
|
20
|
-
}) => string;
|
|
21
|
-
export declare const getProgressJsonUrl: ({ region, bucketName, renderId, }: {
|
|
22
|
-
region: AwsRegion;
|
|
23
|
-
bucketName: string;
|
|
24
|
-
renderId: string;
|
|
25
|
-
}) => string;
|