@remotion/lambda 4.0.243 → 4.0.245
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/make-layer-public.js +10 -11
- package/dist/api/create-function.d.ts +1 -2
- package/dist/api/create-function.js +10 -10
- package/dist/api/delete-function.d.ts +0 -7
- package/dist/api/delete-function.js +2 -5
- package/dist/api/delete-render.d.ts +0 -8
- package/dist/api/delete-render.js +2 -6
- package/dist/api/delete-site.d.ts +0 -10
- package/dist/api/delete-site.js +3 -9
- package/dist/api/deploy-function.d.ts +3 -14
- package/dist/api/deploy-function.js +5 -13
- package/dist/api/deploy-site.d.ts +0 -9
- package/dist/api/deploy-site.js +3 -8
- package/dist/api/download-media.d.ts +0 -11
- package/dist/api/download-media.js +1 -8
- package/dist/api/estimate-price.d.ts +0 -6
- package/dist/api/estimate-price.js +1 -3
- package/dist/api/get-aws-client.d.ts +0 -8
- package/dist/api/get-aws-client.js +2 -6
- package/dist/api/get-compositions-on-lambda.d.ts +0 -13
- package/dist/api/get-compositions-on-lambda.js +2 -11
- package/dist/api/get-function-info.d.ts +0 -7
- package/dist/api/get-function-info.js +2 -5
- package/dist/api/get-functions.d.ts +0 -7
- package/dist/api/get-functions.js +2 -5
- package/dist/api/get-or-create-bucket.d.ts +0 -6
- package/dist/api/get-or-create-bucket.js +3 -5
- package/dist/api/get-regions.d.ts +0 -5
- package/dist/api/get-regions.js +3 -4
- package/dist/api/get-render-progress.d.ts +0 -10
- package/dist/api/get-render-progress.js +1 -7
- package/dist/api/get-sites.d.ts +0 -6
- package/dist/api/get-sites.js +3 -5
- package/dist/api/iam-validation/simulate.d.ts +0 -7
- package/dist/api/iam-validation/simulate.js +2 -5
- package/dist/api/iam-validation/suggested-policy.d.ts +0 -10
- package/dist/api/iam-validation/suggested-policy.js +2 -4
- package/dist/api/presign-url.d.ts +0 -10
- package/dist/api/presign-url.js +2 -8
- package/dist/api/render-media-on-lambda.d.ts +0 -19
- package/dist/api/render-media-on-lambda.js +2 -17
- package/dist/api/render-still-on-lambda.d.ts +0 -16
- package/dist/api/render-still-on-lambda.js +3 -15
- package/dist/api/speculate-function-name.d.ts +0 -8
- package/dist/api/speculate-function-name.js +3 -7
- package/dist/api/upload-dir.js +44 -27
- package/dist/api/validate-webhook-signature.d.ts +0 -8
- package/dist/api/validate-webhook-signature.js +3 -7
- package/dist/cli/commands/functions/deploy.js +4 -1
- package/dist/cli/log.d.ts +3 -3
- package/dist/functions/http-client.d.ts +7 -0
- package/dist/functions/http-client.js +22 -0
- package/dist/index.js +26 -5
- package/dist/pricing/price-per-1-s.js +102 -0
- package/dist/regions.d.ts +1 -1
- package/dist/regions.js +3 -0
- package/dist/shared/call-lambda-async.d.ts +3 -0
- package/dist/shared/call-lambda-async.js +20 -0
- package/dist/shared/call-lambda-streaming.d.ts +7 -0
- package/dist/shared/call-lambda-streaming.js +124 -0
- package/dist/shared/call-lambda-sync.d.ts +3 -0
- package/dist/shared/call-lambda-sync.js +30 -0
- package/dist/shared/get-layers.d.ts +1 -2
- package/dist/shared/get-layers.js +2 -4
- package/dist/shared/hosted-layers.d.ts +0 -1
- package/dist/shared/hosted-layers.js +139 -537
- package/dist/shared/lambda-insights-extensions.d.ts +1 -1
- package/dist/shared/lambda-insights-extensions.js +3 -0
- package/dist/shared/validate-aws-region.js +1 -1
- package/package.json +12 -12
- package/remotionlambda-arm64.zip +0 -0
|
@@ -7,15 +7,9 @@ const get_progress_1 = require("../functions/helpers/get-progress");
|
|
|
7
7
|
const parse_function_name_1 = require("../functions/helpers/parse-function-name");
|
|
8
8
|
const call_lambda_1 = require("../shared/call-lambda");
|
|
9
9
|
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
10
|
-
|
|
10
|
+
/*
|
|
11
11
|
* @description Gets the current status of a render originally triggered via renderMediaOnLambda().
|
|
12
12
|
* @see [Documentation](https://remotion.dev/docs/lambda/getrenderprogress)
|
|
13
|
-
* @param {string} params.functionName The name of the function used to trigger the render.
|
|
14
|
-
* @param {string} params.bucketName The name of the bucket that was used in the render.
|
|
15
|
-
* @param {string} params.renderId The ID of the render that was returned by `renderMediaOnLambda()`.
|
|
16
|
-
* @param {AwsRegion} params.region The region in which the render was triggered.
|
|
17
|
-
* @param {CustomCredentials} params.s3OutputProvider? Endpoint and credentials if the output file is stored outside of AWS.
|
|
18
|
-
* @returns {Promise<RenderProgress>} See documentation for this function to see all properties on the return object.
|
|
19
13
|
*/
|
|
20
14
|
const getRenderProgress = async (input) => {
|
|
21
15
|
var _a, _b;
|
package/dist/api/get-sites.d.ts
CHANGED
|
@@ -25,11 +25,5 @@ export type GetSitesOutput = {
|
|
|
25
25
|
export declare const internalGetSites: ({ region, forceBucketName, providerSpecifics, forcePathStyle, }: GetSitesInternalInput & {
|
|
26
26
|
providerSpecifics: ProviderSpecifics<AwsProvider>;
|
|
27
27
|
}) => Promise<GetSitesOutput>;
|
|
28
|
-
/**
|
|
29
|
-
* @description Gets all the deployed sites for a certain AWS region.
|
|
30
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/getsites)
|
|
31
|
-
* @param {AwsRegion} params.region The AWS region that you want to query for.
|
|
32
|
-
* @returns {Promise<GetSitesOutput>} A Promise containing an object with `sites` and `bucket` keys. Consult documentation for details.
|
|
33
|
-
*/
|
|
34
28
|
export declare const getSites: ({ region, forceBucketName, forcePathStyle, }: GetSitesInput) => Promise<GetSitesOutput>;
|
|
35
29
|
export {};
|
package/dist/api/get-sites.js
CHANGED
|
@@ -65,11 +65,9 @@ const internalGetSites = async ({ region, forceBucketName, providerSpecifics, fo
|
|
|
65
65
|
return { sites: sitesArray, buckets: remotionBuckets };
|
|
66
66
|
};
|
|
67
67
|
exports.internalGetSites = internalGetSites;
|
|
68
|
-
|
|
69
|
-
* @description Gets
|
|
70
|
-
* @see [Documentation](https://remotion.dev/docs/
|
|
71
|
-
* @param {AwsRegion} params.region The AWS region that you want to query for.
|
|
72
|
-
* @returns {Promise<GetSitesOutput>} A Promise containing an object with `sites` and `bucket` keys. Consult documentation for details.
|
|
68
|
+
/*
|
|
69
|
+
* @description Gets an array of Remotion projects in Cloud Storage, in your GCP project.
|
|
70
|
+
* @see [Documentation](https://remotion.dev/docs/cloudrun/getsites)
|
|
73
71
|
*/
|
|
74
72
|
const getSites = ({ region, forceBucketName, forcePathStyle, }) => {
|
|
75
73
|
return (0, exports.internalGetSites)({
|
|
@@ -8,11 +8,4 @@ export type SimulatePermissionsInput = {
|
|
|
8
8
|
export type SimulatePermissionsOutput = {
|
|
9
9
|
results: SimulationResult[];
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
12
|
-
* @description Simulates calls using the AWS Simulator to validate the correct permissions.
|
|
13
|
-
* @see [Documentation](http://remotion.dev/docs/lambda/simulatepermissions)
|
|
14
|
-
* @param {AwsRegion} options.region The region which you would like to validate
|
|
15
|
-
* @param {(result: SimulationResult) => void} options.onSimulation The region which you would like to validate
|
|
16
|
-
* @returns {Promise<SimulatePermissionsOutput>} See documentation for detailed response structure.
|
|
17
|
-
*/
|
|
18
11
|
export declare const simulatePermissions: (options: SimulatePermissionsInput) => Promise<SimulatePermissionsOutput>;
|
|
@@ -17,12 +17,9 @@ const logPermissionOutput = (output) => {
|
|
|
17
17
|
return [getEmojiForStatus(output.decision), output.name].join(' ');
|
|
18
18
|
};
|
|
19
19
|
exports.logPermissionOutput = logPermissionOutput;
|
|
20
|
-
|
|
20
|
+
/*
|
|
21
21
|
* @description Simulates calls using the AWS Simulator to validate the correct permissions.
|
|
22
|
-
* @see [Documentation](
|
|
23
|
-
* @param {AwsRegion} options.region The region which you would like to validate
|
|
24
|
-
* @param {(result: SimulationResult) => void} options.onSimulation The region which you would like to validate
|
|
25
|
-
* @returns {Promise<SimulatePermissionsOutput>} See documentation for detailed response structure.
|
|
22
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/simulatepermissions)
|
|
26
23
|
*/
|
|
27
24
|
const simulatePermissions = async (options) => {
|
|
28
25
|
var _a;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Returns an inline JSON policy to be assigned to the AWS user whose credentials are being used for executing CLI commands or calling Node.JS functions.
|
|
3
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/getuserpolicy)
|
|
4
|
-
* @returns {string} A JSON string representation of the user policy.
|
|
5
|
-
*/
|
|
6
1
|
export declare const getUserPolicy: () => string;
|
|
7
2
|
export declare const ROLE_NAME = "remotion-lambda-role";
|
|
8
|
-
/**
|
|
9
|
-
* @description Returns an inline JSON policy to be assigned to the 'remotion-lambda-role' role that needs to be created in your AWS account.
|
|
10
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/getrolepolicy)
|
|
11
|
-
* @returns {object} The policy object which includes the version and statements specific to AWS permissions for the lambda function
|
|
12
|
-
*/
|
|
13
3
|
export declare const getRolePolicy: () => string;
|
|
@@ -29,18 +29,16 @@ const suggestedRolePolicy = {
|
|
|
29
29
|
}),
|
|
30
30
|
],
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
/*
|
|
33
33
|
* @description Returns an inline JSON policy to be assigned to the AWS user whose credentials are being used for executing CLI commands or calling Node.JS functions.
|
|
34
34
|
* @see [Documentation](https://remotion.dev/docs/lambda/getuserpolicy)
|
|
35
|
-
* @returns {string} A JSON string representation of the user policy.
|
|
36
35
|
*/
|
|
37
36
|
const getUserPolicy = () => JSON.stringify(suggestedPolicy, null, 2);
|
|
38
37
|
exports.getUserPolicy = getUserPolicy;
|
|
39
38
|
exports.ROLE_NAME = 'remotion-lambda-role';
|
|
40
|
-
|
|
39
|
+
/*
|
|
41
40
|
* @description Returns an inline JSON policy to be assigned to the 'remotion-lambda-role' role that needs to be created in your AWS account.
|
|
42
41
|
* @see [Documentation](https://remotion.dev/docs/lambda/getrolepolicy)
|
|
43
|
-
* @returns {object} The policy object which includes the version and statements specific to AWS permissions for the lambda function
|
|
44
42
|
*/
|
|
45
43
|
const getRolePolicy = () => JSON.stringify(suggestedRolePolicy, null, 2);
|
|
46
44
|
exports.getRolePolicy = getRolePolicy;
|
|
@@ -10,15 +10,5 @@ type OptionalParameters<CheckIfObjectExists extends boolean> = {
|
|
|
10
10
|
forcePathStyle: boolean;
|
|
11
11
|
};
|
|
12
12
|
export type PresignUrlInput<CheckIfObjectExists extends boolean = boolean> = MandatoryParameters & Partial<OptionalParameters<CheckIfObjectExists>>;
|
|
13
|
-
/**
|
|
14
|
-
* @description Returns a public url of an object stored in Remotion's S3 bucket.
|
|
15
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/presignurl)
|
|
16
|
-
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
17
|
-
* @param {string} params.bucketName The name of the bucket to fetch the object from.
|
|
18
|
-
* @param {string} params.objectKey Key of the S3 object to get.
|
|
19
|
-
* @param {string} params.expiresIn The number of seconds before the presigned URL expires. Default 120.
|
|
20
|
-
* @param {boolean} params.checkIfObjectExists Whether the function should check if the object exists in the bucket before generating the presigned url.
|
|
21
|
-
* @returns {Promise<string | null>} The public url of an object or `null` if `checkIfObjectExists=true` & object does not exist.
|
|
22
|
-
*/
|
|
23
13
|
export declare const presignUrl: <CheckIfObjectExists extends boolean = false>({ region, bucketName, objectKey, checkIfObjectExists, expiresInSeconds, forcePathStyle, }: PresignUrlInput<CheckIfObjectExists>) => Promise<CheckIfObjectExists extends true ? string | null : string>;
|
|
24
14
|
export {};
|
package/dist/api/presign-url.js
CHANGED
|
@@ -42,15 +42,9 @@ const internalPresignUrl = async ({ region, bucketName, objectKey, checkIfObject
|
|
|
42
42
|
});
|
|
43
43
|
return publicUrl;
|
|
44
44
|
};
|
|
45
|
-
|
|
46
|
-
* @description
|
|
45
|
+
/*
|
|
46
|
+
* @description Takes a private S3 object and turns it into a public URL by signing it with your AWS credentials.
|
|
47
47
|
* @see [Documentation](https://remotion.dev/docs/lambda/presignurl)
|
|
48
|
-
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
49
|
-
* @param {string} params.bucketName The name of the bucket to fetch the object from.
|
|
50
|
-
* @param {string} params.objectKey Key of the S3 object to get.
|
|
51
|
-
* @param {string} params.expiresIn The number of seconds before the presigned URL expires. Default 120.
|
|
52
|
-
* @param {boolean} params.checkIfObjectExists Whether the function should check if the object exists in the bucket before generating the presigned url.
|
|
53
|
-
* @returns {Promise<string | null>} The public url of an object or `null` if `checkIfObjectExists=true` & object does not exist.
|
|
54
48
|
*/
|
|
55
49
|
const presignUrl = ({ region, bucketName, objectKey, checkIfObjectExists, expiresInSeconds, forcePathStyle, }) => {
|
|
56
50
|
return internalPresignUrl({
|
|
@@ -56,25 +56,6 @@ export type RenderMediaOnLambdaOutput = {
|
|
|
56
56
|
};
|
|
57
57
|
export declare const internalRenderMediaOnLambdaRaw: (input: InnerRenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
58
58
|
export declare const renderMediaOnLambdaOptionalToRequired: (options: RenderMediaOnLambdaInput) => InnerRenderMediaOnLambdaInput;
|
|
59
|
-
/**
|
|
60
|
-
* @description Triggers a render on a lambda given a composition and a lambda function.
|
|
61
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/rendermediaonlambda)
|
|
62
|
-
* @param params.functionName The name of the Lambda function that should be used
|
|
63
|
-
* @param params.serveUrl The URL of the deployed project
|
|
64
|
-
* @param params.composition The ID of the composition which should be rendered.
|
|
65
|
-
* @param params.inputProps The input props that should be passed to the composition.
|
|
66
|
-
* @param params.codec The media codec which should be used for encoding.
|
|
67
|
-
* @param params.imageFormat In which image format the frames should be rendered. Default "jpeg"
|
|
68
|
-
* @param params.crf The constant rate factor to be used during encoding.
|
|
69
|
-
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
70
|
-
* @param params.proResProfile The ProRes profile if rendering a ProRes video
|
|
71
|
-
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
72
|
-
* @param params.region The AWS region in which the media should be rendered.
|
|
73
|
-
* @param params.maxRetries How often rendering a chunk may fail before the media render gets aborted. Default "1"
|
|
74
|
-
* @param params.logLevel Level of logging that Lambda function should perform. Default "info".
|
|
75
|
-
* @param params.webhook Configuration for webhook called upon completion or timeout of the render.
|
|
76
|
-
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
77
|
-
*/
|
|
78
59
|
export declare const renderMediaOnLambda: (options: RenderMediaOnLambdaInput) => Promise<RenderMediaOnLambdaOutput>;
|
|
79
60
|
/**
|
|
80
61
|
* @deprecated Renamed to renderMediaOnLambda()
|
|
@@ -110,24 +110,9 @@ const renderMediaOnLambdaOptionalToRequired = (options) => {
|
|
|
110
110
|
};
|
|
111
111
|
exports.renderMediaOnLambdaOptionalToRequired = renderMediaOnLambdaOptionalToRequired;
|
|
112
112
|
const wrapped = (0, error_handling_1.wrapWithErrorHandling)(exports.internalRenderMediaOnLambdaRaw);
|
|
113
|
-
|
|
114
|
-
* @description
|
|
113
|
+
/*
|
|
114
|
+
* @description Kicks off a render process on Remotion Lambda. The progress can be tracked using getRenderProgress().
|
|
115
115
|
* @see [Documentation](https://remotion.dev/docs/lambda/rendermediaonlambda)
|
|
116
|
-
* @param params.functionName The name of the Lambda function that should be used
|
|
117
|
-
* @param params.serveUrl The URL of the deployed project
|
|
118
|
-
* @param params.composition The ID of the composition which should be rendered.
|
|
119
|
-
* @param params.inputProps The input props that should be passed to the composition.
|
|
120
|
-
* @param params.codec The media codec which should be used for encoding.
|
|
121
|
-
* @param params.imageFormat In which image format the frames should be rendered. Default "jpeg"
|
|
122
|
-
* @param params.crf The constant rate factor to be used during encoding.
|
|
123
|
-
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
124
|
-
* @param params.proResProfile The ProRes profile if rendering a ProRes video
|
|
125
|
-
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
126
|
-
* @param params.region The AWS region in which the media should be rendered.
|
|
127
|
-
* @param params.maxRetries How often rendering a chunk may fail before the media render gets aborted. Default "1"
|
|
128
|
-
* @param params.logLevel Level of logging that Lambda function should perform. Default "info".
|
|
129
|
-
* @param params.webhook Configuration for webhook called upon completion or timeout of the render.
|
|
130
|
-
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
131
116
|
*/
|
|
132
117
|
const renderMediaOnLambda = (options) => {
|
|
133
118
|
if (options.quality) {
|
|
@@ -53,21 +53,5 @@ export type RenderStillOnLambdaOutput = {
|
|
|
53
53
|
cloudWatchLogs: string;
|
|
54
54
|
artifacts: ReceivedArtifact<AwsProvider>[];
|
|
55
55
|
};
|
|
56
|
-
/**
|
|
57
|
-
* @description Renders a still frame on Lambda
|
|
58
|
-
* @link https://remotion.dev/docs/lambda/renderstillonlambda
|
|
59
|
-
* @param params.functionName The name of the Lambda function that should be used
|
|
60
|
-
* @param params.serveUrl The URL of the deployed project
|
|
61
|
-
* @param params.composition The ID of the composition which should be rendered.
|
|
62
|
-
* @param params.inputProps The input props that should be passed to the composition.
|
|
63
|
-
* @param params.imageFormat In which image format the frames should be rendered.
|
|
64
|
-
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
65
|
-
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
66
|
-
* @param params.region The AWS region in which the video should be rendered.
|
|
67
|
-
* @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
|
|
68
|
-
* @param params.frame Which frame should be used for the still image. Default 0.
|
|
69
|
-
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
|
|
70
|
-
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
71
|
-
*/
|
|
72
56
|
export declare const renderStillOnLambda: (input: RenderStillOnLambdaInput) => Promise<RenderStillOnLambdaOutput>;
|
|
73
57
|
export {};
|
|
@@ -77,21 +77,9 @@ const internalRenderStillOnLambda = async (input) => {
|
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
const errorHandled = (0, error_handling_1.wrapWithErrorHandling)(internalRenderStillOnLambda);
|
|
80
|
-
|
|
81
|
-
* @description Renders a still
|
|
82
|
-
* @
|
|
83
|
-
* @param params.functionName The name of the Lambda function that should be used
|
|
84
|
-
* @param params.serveUrl The URL of the deployed project
|
|
85
|
-
* @param params.composition The ID of the composition which should be rendered.
|
|
86
|
-
* @param params.inputProps The input props that should be passed to the composition.
|
|
87
|
-
* @param params.imageFormat In which image format the frames should be rendered.
|
|
88
|
-
* @param params.envVariables Object containing environment variables to be inserted into the video environment
|
|
89
|
-
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
90
|
-
* @param params.region The AWS region in which the video should be rendered.
|
|
91
|
-
* @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
|
|
92
|
-
* @param params.frame Which frame should be used for the still image. Default 0.
|
|
93
|
-
* @param params.privacy Whether the item in the S3 bucket should be public. Possible values: `"private"` and `"public"`
|
|
94
|
-
* @returns {Promise<RenderStillOnLambdaOutput>} See documentation for exact response structure.
|
|
80
|
+
/*
|
|
81
|
+
* @description Renders a still image inside a lambda function and writes it to the specified output location.
|
|
82
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/renderstillonlambda)
|
|
95
83
|
*/
|
|
96
84
|
const renderStillOnLambda = (input) => {
|
|
97
85
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
@@ -3,12 +3,4 @@ export type SpeculateFunctionNameInput = {
|
|
|
3
3
|
diskSizeInMb: string | number;
|
|
4
4
|
timeoutInSeconds: string | number;
|
|
5
5
|
};
|
|
6
|
-
/**
|
|
7
|
-
* @description Speculate the name of a lambda function that will be created when you call `deployFunction`, based on the function configuration.
|
|
8
|
-
* @see [Documentation](https://www.remotion.dev/docs/lambda/speculatefunctionname)
|
|
9
|
-
* @param params.memorySizeInMb How much memory is allocated to the Lambda function.
|
|
10
|
-
* @param params.diskSizeInMb The amount of storage the function is allocated.
|
|
11
|
-
* @param params.timeoutInSeconds Time in seconds until the function times out.
|
|
12
|
-
* @returns {string} The speculated lambda function name
|
|
13
|
-
*/
|
|
14
6
|
export declare const speculateFunctionName: ({ memorySizeInMb, diskSizeInMb, timeoutInSeconds, }: SpeculateFunctionNameInput) => string;
|
|
@@ -3,13 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.speculateFunctionName = void 0;
|
|
4
4
|
const defaults_1 = require("../defaults");
|
|
5
5
|
const lambda_version_string_1 = require("../shared/lambda-version-string");
|
|
6
|
-
|
|
7
|
-
* @description Speculate the name of
|
|
8
|
-
* @see [Documentation](https://
|
|
9
|
-
* @param params.memorySizeInMb How much memory is allocated to the Lambda function.
|
|
10
|
-
* @param params.diskSizeInMb The amount of storage the function is allocated.
|
|
11
|
-
* @param params.timeoutInSeconds Time in seconds until the function times out.
|
|
12
|
-
* @returns {string} The speculated lambda function name
|
|
6
|
+
/*
|
|
7
|
+
* @description Speculate the name of the Lambda function that will be created by `deployFunction()` or its CLI equivalent, based on the function configuration.
|
|
8
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/speculatefunctionname)
|
|
13
9
|
*/
|
|
14
10
|
const speculateFunctionName = ({ memorySizeInMb, diskSizeInMb, timeoutInSeconds, }) => {
|
|
15
11
|
// find-function-name.ts uses this for templating
|
package/dist/api/upload-dir.js
CHANGED
|
@@ -45,7 +45,7 @@ async function getFiles(directory, originalDirectory, toUpload) {
|
|
|
45
45
|
}));
|
|
46
46
|
return _files.flat(1);
|
|
47
47
|
}
|
|
48
|
-
const limit = (0, p_limit_1.pLimit)(
|
|
48
|
+
const limit = (0, p_limit_1.pLimit)(30);
|
|
49
49
|
const uploadDir = async ({ bucket, region, localDir, onProgress, keyPrefix, privacy, toUpload, forcePathStyle, }) => {
|
|
50
50
|
const files = await getFiles(localDir, localDir, toUpload);
|
|
51
51
|
const progresses = {};
|
|
@@ -53,34 +53,51 @@ const uploadDir = async ({ bucket, region, localDir, onProgress, keyPrefix, priv
|
|
|
53
53
|
progresses[file.name] = 0;
|
|
54
54
|
}
|
|
55
55
|
const client = (0, get_s3_client_1.getS3Client)({ region, customCredentials: null, forcePathStyle });
|
|
56
|
+
const uploadWithoutRetry = async (filePath) => {
|
|
57
|
+
const Key = (0, make_s3_key_1.makeS3Key)(keyPrefix, localDir, filePath.name);
|
|
58
|
+
const Body = (0, node_fs_1.createReadStream)(filePath.name);
|
|
59
|
+
const ContentType = mime_types_1.default.lookup(Key) || 'application/octet-stream';
|
|
60
|
+
const ACL = privacy === 'no-acl'
|
|
61
|
+
? undefined
|
|
62
|
+
: privacy === 'private'
|
|
63
|
+
? 'private'
|
|
64
|
+
: 'public-read';
|
|
65
|
+
const paralellUploads3 = new lib_storage_1.Upload({
|
|
66
|
+
client,
|
|
67
|
+
queueSize: 4,
|
|
68
|
+
partSize: 5 * 1024 * 1024,
|
|
69
|
+
params: {
|
|
70
|
+
Key,
|
|
71
|
+
Bucket: bucket,
|
|
72
|
+
Body,
|
|
73
|
+
ACL,
|
|
74
|
+
ContentType,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
paralellUploads3.on('httpUploadProgress', (progress) => {
|
|
78
|
+
var _a;
|
|
79
|
+
progresses[filePath.name] = (_a = progress.loaded) !== null && _a !== void 0 ? _a : 0;
|
|
80
|
+
});
|
|
81
|
+
const prom = await paralellUploads3.done();
|
|
82
|
+
return prom;
|
|
83
|
+
};
|
|
84
|
+
const uploadWithRetry = async (filePath) => {
|
|
85
|
+
let error = null;
|
|
86
|
+
for (let i = 0; i < 3; i++) {
|
|
87
|
+
try {
|
|
88
|
+
return await uploadWithoutRetry(filePath);
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
error = err;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (error) {
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
56
98
|
const uploadAll = (async () => {
|
|
57
99
|
const uploads = files.map((filePath) => limit(async () => {
|
|
58
|
-
|
|
59
|
-
const Body = (0, node_fs_1.createReadStream)(filePath.name);
|
|
60
|
-
const ContentType = mime_types_1.default.lookup(Key) || 'application/octet-stream';
|
|
61
|
-
const ACL = privacy === 'no-acl'
|
|
62
|
-
? undefined
|
|
63
|
-
: privacy === 'private'
|
|
64
|
-
? 'private'
|
|
65
|
-
: 'public-read';
|
|
66
|
-
const paralellUploads3 = new lib_storage_1.Upload({
|
|
67
|
-
client,
|
|
68
|
-
queueSize: 4,
|
|
69
|
-
partSize: 5 * 1024 * 1024,
|
|
70
|
-
params: {
|
|
71
|
-
Key,
|
|
72
|
-
Bucket: bucket,
|
|
73
|
-
Body,
|
|
74
|
-
ACL,
|
|
75
|
-
ContentType,
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
paralellUploads3.on('httpUploadProgress', (progress) => {
|
|
79
|
-
var _a;
|
|
80
|
-
progresses[filePath.name] = (_a = progress.loaded) !== null && _a !== void 0 ? _a : 0;
|
|
81
|
-
});
|
|
82
|
-
const prom = await paralellUploads3.done();
|
|
83
|
-
return prom;
|
|
100
|
+
await uploadWithRetry(filePath);
|
|
84
101
|
}));
|
|
85
102
|
await Promise.all(uploads);
|
|
86
103
|
})();
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Throws if the signature of the finish webhook is missing or inauthentic
|
|
3
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/validate-webhook-signature)
|
|
4
|
-
* @param params.secret The secret used for signing the webhook
|
|
5
|
-
* @param params.body The body that was received by the endpoint
|
|
6
|
-
* @param params.signatureHeader The `X-Remotion-Signature` header
|
|
7
|
-
* @returns {void}
|
|
8
|
-
*/
|
|
9
1
|
export declare const validateWebhookSignature: ({ secret, body, signatureHeader, }: {
|
|
10
2
|
secret: string;
|
|
11
3
|
body: unknown;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateWebhookSignature = void 0;
|
|
4
|
-
|
|
5
|
-
* @description
|
|
6
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/
|
|
7
|
-
* @param params.secret The secret used for signing the webhook
|
|
8
|
-
* @param params.body The body that was received by the endpoint
|
|
9
|
-
* @param params.signatureHeader The `X-Remotion-Signature` header
|
|
10
|
-
* @returns {void}
|
|
4
|
+
/*
|
|
5
|
+
* @description Validates that the signature received by a webhook endpoint is authentic. If validation fails, an error is thrown.
|
|
6
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/validatewebhooksignature)
|
|
11
7
|
*/
|
|
12
8
|
const validateWebhookSignature = ({ secret, body, signatureHeader, }) => {
|
|
13
9
|
if (!secret) {
|
|
@@ -13,6 +13,7 @@ const validate_vpc_security_group_ids_1 = require("../../../shared/validate-vpc-
|
|
|
13
13
|
const validate_vpc_subnet_ids_1 = require("../../../shared/validate-vpc-subnet-ids");
|
|
14
14
|
const args_1 = require("../../args");
|
|
15
15
|
const get_aws_region_1 = require("../../get-aws-region");
|
|
16
|
+
const log_1 = require("../../log");
|
|
16
17
|
exports.FUNCTIONS_DEPLOY_SUBCOMMAND = 'deploy';
|
|
17
18
|
const functionsDeploySubcommand = async (logLevel) => {
|
|
18
19
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
@@ -25,6 +26,9 @@ const functionsDeploySubcommand = async (logLevel) => {
|
|
|
25
26
|
const enableLambdaInsights = (_e = args_1.parsedLambdaCli['enable-lambda-insights']) !== null && _e !== void 0 ? _e : false;
|
|
26
27
|
const cloudWatchLogRetentionPeriodInDays = (_f = args_1.parsedLambdaCli['retention-period']) !== null && _f !== void 0 ? _f : constants_1.DEFAULT_CLOUDWATCH_RETENTION_PERIOD;
|
|
27
28
|
const enableV5Runtime = (_g = args_1.parsedLambdaCli['enable-v5-runtime']) !== null && _g !== void 0 ? _g : undefined;
|
|
29
|
+
if (enableV5Runtime) {
|
|
30
|
+
log_1.Log.warn({ logLevel, indent: false }, `The --enable-v5-runtime flag is now enabled by default and has no function anymore.`);
|
|
31
|
+
}
|
|
28
32
|
const vpcSubnetIds = (_h = args_1.parsedLambdaCli['vpc-subnet-ids']) !== null && _h !== void 0 ? _h : undefined;
|
|
29
33
|
const vpcSecurityGroupIds = (_j = args_1.parsedLambdaCli['vpc-security-group-ids']) !== null && _j !== void 0 ? _j : undefined;
|
|
30
34
|
const runtimePreference = (_k = args_1.parsedLambdaCli['runtime-preference']) !== null && _k !== void 0 ? _k : 'default';
|
|
@@ -70,7 +74,6 @@ VPC Security Group IDs = ${vpcSecurityGroupIds}
|
|
|
70
74
|
diskSizeInMb,
|
|
71
75
|
customRoleArn,
|
|
72
76
|
enableLambdaInsights,
|
|
73
|
-
enableV5Runtime,
|
|
74
77
|
indent: false,
|
|
75
78
|
logLevel,
|
|
76
79
|
vpcSubnetIds,
|
package/dist/cli/log.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const Log: {
|
|
2
|
-
verbose: (options: import("@remotion/renderer
|
|
2
|
+
verbose: (options: import("@remotion/renderer").LogOptions & {
|
|
3
3
|
tag?: string;
|
|
4
4
|
}, ...args: Parameters<typeof console.log>) => boolean | void;
|
|
5
5
|
info: (options: import("@remotion/renderer").LogOptions, ...args: Parameters<typeof console.log>) => boolean | void;
|
|
6
|
-
warn: (options: import("@remotion/renderer
|
|
7
|
-
error: (options: import("@remotion/renderer
|
|
6
|
+
warn: (options: import("@remotion/renderer").LogOptions, ...args: Parameters<typeof console.log>) => boolean | void;
|
|
7
|
+
error: (options: import("@remotion/renderer").LogOptions & {
|
|
8
8
|
tag?: string;
|
|
9
9
|
}, ...args: Parameters<typeof console.log>) => boolean | void;
|
|
10
10
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
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.getWebhookClient = exports.mockableHttpClients = void 0;
|
|
7
|
+
const node_http_1 = __importDefault(require("node:http"));
|
|
8
|
+
const node_https_1 = __importDefault(require("node:https"));
|
|
9
|
+
exports.mockableHttpClients = {
|
|
10
|
+
http: node_http_1.default.request,
|
|
11
|
+
https: node_https_1.default.request,
|
|
12
|
+
};
|
|
13
|
+
const getWebhookClient = (url) => {
|
|
14
|
+
if (url.startsWith('https://')) {
|
|
15
|
+
return exports.mockableHttpClients.https;
|
|
16
|
+
}
|
|
17
|
+
if (url.startsWith('http://')) {
|
|
18
|
+
return exports.mockableHttpClients.http;
|
|
19
|
+
}
|
|
20
|
+
throw new Error('Can only request URLs starting with http:// or https://');
|
|
21
|
+
};
|
|
22
|
+
exports.getWebhookClient = getWebhookClient;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateWebhookSignature = exports.simulatePermissions = exports.renderVideoOnLambda = exports.renderStillOnLambda = exports.renderMediaOnLambda = exports.presignUrl = exports.getUserPolicy = exports.getSites = exports.getRolePolicy = exports.getRenderProgress = exports.getRegions = exports.getOrCreateBucket = exports.getFunctions = exports.getFunctionInfo = exports.getCompositionsOnLambda = exports.getAwsClient = exports.estimatePrice = exports.downloadMedia = exports.deploySite = exports.deployFunction = exports.deleteSite = exports.deleteRender = exports.deleteFunction = exports.LambdaInternals = void 0;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
4
5
|
const delete_function_1 = require("./api/delete-function");
|
|
5
6
|
Object.defineProperty(exports, "deleteFunction", { enumerable: true, get: function () { return delete_function_1.deleteFunction; } });
|
|
6
7
|
const delete_render_1 = require("./api/delete-render");
|
|
@@ -45,25 +46,45 @@ Object.defineProperty(exports, "LambdaInternals", { enumerable: true, get: funct
|
|
|
45
46
|
/**
|
|
46
47
|
* @deprecated Import this from `@remotion/lambda/client` instead
|
|
47
48
|
*/
|
|
48
|
-
const renderMediaOnLambda =
|
|
49
|
+
const renderMediaOnLambda = no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES
|
|
50
|
+
? () => {
|
|
51
|
+
throw new Error('renderMediaOnLambda() has moved to `@remotion/lambda/client`. Please import it from there.');
|
|
52
|
+
}
|
|
53
|
+
: render_media_on_lambda_1.renderMediaOnLambda;
|
|
49
54
|
exports.renderMediaOnLambda = renderMediaOnLambda;
|
|
50
55
|
/**
|
|
51
56
|
* @deprecated Import this from `@remotion/lambda/client` instead
|
|
52
57
|
*/
|
|
53
|
-
const getRenderProgress =
|
|
58
|
+
const getRenderProgress = no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES
|
|
59
|
+
? () => {
|
|
60
|
+
throw new Error('getRenderProgress() has moved to `@remotion/lambda/client`. Please import it from there.');
|
|
61
|
+
}
|
|
62
|
+
: get_render_progress_1.getRenderProgress;
|
|
54
63
|
exports.getRenderProgress = getRenderProgress;
|
|
55
64
|
/**
|
|
56
65
|
* @deprecated Import this from `@remotion/lambda/client` instead
|
|
57
66
|
*/
|
|
58
|
-
const renderStillOnLambda =
|
|
67
|
+
const renderStillOnLambda = no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES
|
|
68
|
+
? () => {
|
|
69
|
+
throw new Error('renderStillOnLambda() has moved to `@remotion/lambda/client`. Please import it from there.');
|
|
70
|
+
}
|
|
71
|
+
: render_still_on_lambda_1.renderStillOnLambda;
|
|
59
72
|
exports.renderStillOnLambda = renderStillOnLambda;
|
|
60
73
|
/**
|
|
61
74
|
* @deprecated Import this from `@remotion/lambda/client` instead
|
|
62
75
|
*/
|
|
63
|
-
const presignUrl =
|
|
76
|
+
const presignUrl = no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES
|
|
77
|
+
? () => {
|
|
78
|
+
throw new Error('presignUrl() has moved to `@remotion/lambda/client`. Please import it from there.');
|
|
79
|
+
}
|
|
80
|
+
: presign_url_1.presignUrl;
|
|
64
81
|
exports.presignUrl = presignUrl;
|
|
65
82
|
/**
|
|
66
83
|
* @deprecated Import this from `@remotion/lambda/client` instead
|
|
67
84
|
*/
|
|
68
|
-
const getSites =
|
|
85
|
+
const getSites = no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES
|
|
86
|
+
? () => {
|
|
87
|
+
throw new Error('getSites() has moved to `@remotion/lambda/client`. Please import it from there.');
|
|
88
|
+
}
|
|
89
|
+
: get_sites_1.getSites;
|
|
69
90
|
exports.getSites = getSites;
|