@remotion/lambda 4.0.244 → 4.0.246
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/app-router-webhook.d.ts +10 -0
- package/dist/api/app-router-webhook.js +43 -0
- package/dist/api/create-function.d.ts +1 -2
- package/dist/api/create-function.js +10 -10
- package/dist/api/delete-function.d.ts +4 -13
- package/dist/api/delete-function.js +2 -5
- package/dist/api/delete-render.d.ts +0 -8
- package/dist/api/delete-render.js +4 -10
- package/dist/api/delete-site.d.ts +0 -10
- package/dist/api/delete-site.js +4 -11
- package/dist/api/deploy-function.d.ts +8 -15
- package/dist/api/deploy-function.js +21 -27
- package/dist/api/deploy-site.d.ts +2 -11
- package/dist/api/deploy-site.js +14 -22
- package/dist/api/download-media.d.ts +0 -11
- package/dist/api/download-media.js +3 -12
- 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 +1 -9
- package/dist/api/get-aws-client.js +2 -6
- package/dist/api/get-compositions-on-lambda.d.ts +1 -14
- package/dist/api/get-compositions-on-lambda.js +12 -17
- package/dist/api/get-function-info.d.ts +1 -14
- package/dist/api/get-function-info.js +2 -5
- package/dist/api/get-functions.d.ts +1 -8
- 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 +3 -11
- package/dist/api/get-sites.d.ts +0 -6
- package/dist/api/get-sites.js +4 -7
- 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/make-lambda-payload.d.ts +2 -1
- package/dist/api/make-lambda-payload.js +19 -13
- package/dist/api/pages-router-webhook.d.ts +3 -0
- package/dist/api/pages-router-webhook.js +47 -0
- 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 +1 -20
- package/dist/api/render-media-on-lambda.js +4 -19
- package/dist/api/render-still-on-lambda.d.ts +2 -19
- package/dist/api/render-still-on-lambda.js +6 -17
- package/dist/api/speculate-function-name.d.ts +0 -8
- package/dist/api/speculate-function-name.js +3 -7
- package/dist/api/upload-dir.d.ts +1 -7
- package/dist/api/upload-dir.js +1 -5
- package/dist/api/validate-webhook-signature.d.ts +0 -8
- package/dist/api/validate-webhook-signature.js +3 -7
- package/dist/cli/args.d.ts +2 -1
- package/dist/cli/commands/compositions/index.d.ts +7 -1
- package/dist/cli/commands/compositions/index.js +2 -2
- package/dist/cli/commands/functions/deploy.d.ts +7 -1
- package/dist/cli/commands/functions/deploy.js +7 -2
- package/dist/cli/commands/functions/index.d.ts +8 -1
- package/dist/cli/commands/functions/index.js +8 -4
- package/dist/cli/commands/functions/ls.d.ts +6 -1
- package/dist/cli/commands/functions/ls.js +2 -3
- package/dist/cli/commands/functions/rmall.d.ts +6 -1
- package/dist/cli/commands/functions/rmall.js +2 -3
- package/dist/cli/commands/render/render.d.ts +6 -1
- package/dist/cli/commands/render/render.js +9 -7
- package/dist/cli/commands/sites/create.js +2 -0
- package/dist/cli/commands/sites/index.d.ts +1 -1
- package/dist/cli/commands/sites/index.js +4 -4
- package/dist/cli/commands/still.d.ts +2 -2
- package/dist/cli/commands/still.js +5 -5
- package/dist/cli/get-aws-region.js +0 -4
- package/dist/cli/helpers/find-function-name.d.ts +6 -1
- package/dist/cli/helpers/find-function-name.js +4 -5
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +36 -16
- package/dist/client.d.ts +17 -22
- package/dist/client.js +17 -13
- package/dist/functions/aws-implementation.d.ts +13 -1
- package/dist/functions/aws-implementation.js +46 -0
- package/dist/functions/aws-server-implementation.d.ts +2 -0
- package/dist/functions/aws-server-implementation.js +25 -0
- package/dist/functions/full-client-implementation.d.ts +3 -0
- package/dist/functions/full-client-implementation.js +16 -0
- package/dist/functions/helpers/clean-tmpdir.js +1 -3
- package/dist/functions/helpers/get-current-region.js +0 -4
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +3 -7
- package/dist/functions/helpers/get-output-url-from-metadata.js +1 -1
- package/dist/functions/helpers/lifecycle.d.ts +4 -2
- package/dist/functions/helpers/lifecycle.js +3 -18
- package/dist/functions/helpers/timer.d.ts +2 -4
- package/dist/functions/http-client.d.ts +7 -0
- package/dist/functions/http-client.js +22 -0
- package/dist/functions/index.d.ts +1 -8
- package/dist/functions/index.js +12 -235
- package/dist/index.d.ts +6 -6
- package/dist/index.js +27 -6
- package/dist/internals.d.ts +6 -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.js → call-lambda-streaming.js} +36 -61
- package/dist/shared/call-lambda-sync.d.ts +3 -0
- package/dist/shared/call-lambda-sync.js +30 -0
- package/dist/shared/check-credentials.js +2 -3
- package/dist/shared/constants.d.ts +2 -91
- package/dist/shared/constants.js +1 -8
- package/dist/shared/convert-to-serve-url.js +2 -2
- package/dist/shared/get-account-id.d.ts +3 -4
- package/dist/shared/get-account-id.js +3 -3
- package/dist/shared/get-aws-urls.d.ts +4 -8
- package/dist/shared/get-aws-urls.js +1 -1
- package/dist/shared/get-function-version.js +4 -4
- package/dist/shared/get-layers.d.ts +1 -2
- package/dist/shared/get-layers.js +2 -4
- package/dist/shared/get-s3-operations.d.ts +4 -1
- package/dist/shared/get-s3-operations.js +2 -3
- package/dist/shared/get-service-client.js +2 -2
- 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/read-dir.d.ts +2 -10
- package/dist/shared/read-dir.js +5 -4
- package/dist/shared/validate-aws-region.js +1 -1
- package/dist/shared/validate-bucketname.d.ts +1 -1
- package/package.json +15 -15
- package/remotionlambda-arm64.zip +0 -0
- package/dist/api/__mocks__/clean-items.d.ts +0 -2
- package/dist/api/__mocks__/clean-items.js +0 -24
- package/dist/api/__mocks__/create-function.d.ts +0 -2
- package/dist/api/__mocks__/create-function.js +0 -21
- package/dist/api/__mocks__/delete-function.d.ts +0 -2
- package/dist/api/__mocks__/delete-function.js +0 -9
- package/dist/api/__mocks__/get-functions.d.ts +0 -2
- package/dist/api/__mocks__/get-functions.js +0 -9
- package/dist/api/__mocks__/upload-dir.d.ts +0 -3
- package/dist/api/__mocks__/upload-dir.js +0 -47
- package/dist/api/mock-functions.d.ts +0 -18
- package/dist/api/mock-functions.js +0 -36
- package/dist/cli/helpers/__mocks__/quit.d.ts +0 -1
- package/dist/cli/helpers/__mocks__/quit.js +0 -7
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +0 -7
- package/dist/functions/chunk-optimization/plan-frame-ranges.js +0 -17
- package/dist/functions/chunk-optimization/types.d.ts +0 -8
- package/dist/functions/chunk-optimization/types.js +0 -2
- package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +0 -3
- package/dist/functions/helpers/__mocks__/get-browser-instance.js +0 -12
- package/dist/functions/helpers/__mocks__/leak-detection.d.ts +0 -4
- package/dist/functions/helpers/__mocks__/leak-detection.js +0 -9
- package/dist/functions/helpers/__mocks__/timer.d.ts +0 -2
- package/dist/functions/helpers/__mocks__/timer.js +0 -10
- package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -1
- package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -17
- package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -5
- package/dist/functions/helpers/calculate-chunk-times.js +0 -29
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -15
- package/dist/functions/helpers/calculate-price-from-bucket.js +0 -30
- package/dist/functions/helpers/can-concat-seamlessly.d.ts +0 -3
- package/dist/functions/helpers/can-concat-seamlessly.js +0 -17
- package/dist/functions/helpers/cleanup-props.d.ts +0 -8
- package/dist/functions/helpers/cleanup-props.js +0 -23
- package/dist/functions/helpers/concat-videos.d.ts +0 -23
- package/dist/functions/helpers/concat-videos.js +0 -54
- package/dist/functions/helpers/create-post-render-data.d.ts +0 -17
- package/dist/functions/helpers/create-post-render-data.js +0 -67
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +0 -14
- package/dist/functions/helpers/find-output-file-in-bucket.js +0 -38
- package/dist/functions/helpers/format-costs-info.d.ts +0 -2
- package/dist/functions/helpers/format-costs-info.js +0 -23
- package/dist/functions/helpers/get-overall-progress-s3.d.ts +0 -10
- package/dist/functions/helpers/get-overall-progress-s3.js +0 -24
- package/dist/functions/helpers/get-overall-progress.d.ts +0 -9
- package/dist/functions/helpers/get-overall-progress.js +0 -23
- package/dist/functions/helpers/get-progress.d.ts +0 -15
- package/dist/functions/helpers/get-progress.js +0 -254
- package/dist/functions/helpers/get-retry-stats.d.ts +0 -5
- package/dist/functions/helpers/get-retry-stats.js +0 -2
- package/dist/functions/helpers/inspect-errors.d.ts +0 -4
- package/dist/functions/helpers/inspect-errors.js +0 -39
- package/dist/functions/helpers/is-warm.d.ts +0 -2
- package/dist/functions/helpers/is-warm.js +0 -10
- package/dist/functions/helpers/leak-detection.d.ts +0 -4
- package/dist/functions/helpers/leak-detection.js +0 -40
- package/dist/functions/helpers/make-timeout-error.d.ts +0 -10
- package/dist/functions/helpers/make-timeout-error.js +0 -31
- package/dist/functions/helpers/make-timeout-message.d.ts +0 -10
- package/dist/functions/helpers/make-timeout-message.js +0 -75
- package/dist/functions/helpers/merge-chunks.d.ts +0 -36
- package/dist/functions/helpers/merge-chunks.js +0 -84
- package/dist/functions/helpers/min-max.d.ts +0 -2
- package/dist/functions/helpers/min-max.js +0 -33
- package/dist/functions/helpers/on-downloads-logger.d.ts +0 -2
- package/dist/functions/helpers/on-downloads-logger.js +0 -29
- package/dist/functions/helpers/overall-render-progress.d.ts +0 -59
- package/dist/functions/helpers/overall-render-progress.js +0 -180
- package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -1
- package/dist/functions/helpers/print-concurrency-curve.js +0 -8
- package/dist/functions/helpers/print-logging-helper.d.ts +0 -4
- package/dist/functions/helpers/print-logging-helper.js +0 -12
- package/dist/functions/helpers/render-has-audio-video.d.ts +0 -6
- package/dist/functions/helpers/render-has-audio-video.js +0 -21
- package/dist/functions/helpers/request-context.d.ts +0 -5
- package/dist/functions/helpers/request-context.js +0 -2
- package/dist/functions/helpers/stream-renderer.d.ts +0 -17
- package/dist/functions/helpers/stream-renderer.js +0 -148
- package/dist/functions/launch.d.ts +0 -10
- package/dist/functions/launch.js +0 -596
- package/dist/functions/progress.d.ts +0 -11
- package/dist/functions/progress.js +0 -51
- package/dist/functions/renderer.d.ts +0 -17
- package/dist/functions/renderer.js +0 -341
- package/dist/functions/start.d.ts +0 -13
- package/dist/functions/start.js +0 -113
- package/dist/functions/still.d.ts +0 -19
- package/dist/functions/still.js +0 -330
- package/dist/shared/__mocks__/aws-clients.d.ts +0 -2
- package/dist/shared/__mocks__/aws-clients.js +0 -62
- package/dist/shared/__mocks__/bundle-site.d.ts +0 -2
- package/dist/shared/__mocks__/bundle-site.js +0 -32
- package/dist/shared/__mocks__/check-credentials.d.ts +0 -1
- package/dist/shared/__mocks__/check-credentials.js +0 -5
- package/dist/shared/__mocks__/get-account-id.d.ts +0 -2
- package/dist/shared/__mocks__/get-account-id.js +0 -11
- package/dist/shared/__mocks__/read-dir.d.ts +0 -2
- package/dist/shared/__mocks__/read-dir.js +0 -13
- package/dist/shared/call-lambda.d.ts +0 -16
- package/dist/shared/cleanup-serialized-input-props.d.ts +0 -14
- package/dist/shared/cleanup-serialized-input-props.js +0 -34
- package/dist/shared/docs-url.d.ts +0 -1
- package/dist/shared/docs-url.js +0 -4
- package/dist/shared/get-most-expensive-chunks.d.ts +0 -8
- package/dist/shared/get-most-expensive-chunks.js +0 -28
- package/dist/shared/invoke-webhook.d.ts +0 -48
- package/dist/shared/invoke-webhook.js +0 -140
- package/dist/shared/parse-lambda-timings-key.d.ts +0 -5
- package/dist/shared/parse-lambda-timings-key.js +0 -2
- package/dist/shared/return-values.d.ts +0 -16
- package/dist/shared/return-values.js +0 -2
- package/dist/shared/stackback.d.ts +0 -6
- package/dist/shared/stackback.js +0 -59
- package/dist/shared/validate-download-behavior.d.ts +0 -1
- package/dist/shared/validate-download-behavior.js +0 -21
- package/dist/shared/validate-frames-per-lambda.d.ts +0 -4
- package/dist/shared/validate-frames-per-lambda.js +0 -29
- package/dist/shared/validate-privacy.d.ts +0 -2
- package/dist/shared/validate-privacy.js +0 -14
- package/dist/shared/validate.d.ts +0 -4
- package/dist/shared/validate.js +0 -8
- package/dist/shared/why-is-node-running.d.ts +0 -15
- package/dist/shared/why-is-node-running.js +0 -88
- package/vitest.config.mts +0 -11
package/LICENSE.md
CHANGED
|
@@ -27,10 +27,15 @@ const layerInfo = {
|
|
|
27
27
|
'me-south-1': [],
|
|
28
28
|
'sa-east-1': [],
|
|
29
29
|
'us-west-1': [],
|
|
30
|
+
'ap-southeast-4': [],
|
|
31
|
+
'ap-southeast-5': [],
|
|
32
|
+
'eu-central-2': [],
|
|
33
|
+
};
|
|
34
|
+
const getBucketName = (region) => {
|
|
35
|
+
return `remotionlambda-binaries-${region}`;
|
|
30
36
|
};
|
|
31
|
-
const V5_RUNTIME = true;
|
|
32
37
|
const makeLayerPublic = async () => {
|
|
33
|
-
const runtimes = [
|
|
38
|
+
const runtimes = ['nodejs20.x'];
|
|
34
39
|
const layers = [
|
|
35
40
|
'fonts',
|
|
36
41
|
'chromium',
|
|
@@ -43,18 +48,12 @@ const makeLayerPublic = async () => {
|
|
|
43
48
|
const layerName = `remotion-binaries-${layer}-arm64`;
|
|
44
49
|
const { Version, LayerArn } = await (0, aws_clients_1.getLambdaClient)(region).send(new client_lambda_1.PublishLayerVersionCommand({
|
|
45
50
|
Content: {
|
|
46
|
-
S3Bucket:
|
|
47
|
-
S3Key: layer
|
|
48
|
-
? 'remotion-layer-emoji-v1-arm64.zip'
|
|
49
|
-
: V5_RUNTIME
|
|
50
|
-
? `remotion-layer-${layer}-v11-arm64.zip`
|
|
51
|
-
: `remotion-layer-${layer}-v10-arm64.zip`,
|
|
51
|
+
S3Bucket: getBucketName(region),
|
|
52
|
+
S3Key: `remotion-layer-${layer}-v12-arm64.zip`,
|
|
52
53
|
},
|
|
53
54
|
LayerName: layerName,
|
|
54
55
|
LicenseInfo: layer === 'chromium'
|
|
55
|
-
?
|
|
56
|
-
? 'Chromium 123.0.6312.86, compiled from source. Read Chromium License: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE'
|
|
57
|
-
: 'Chromium 114, compiled from source. Read Chromium License: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE'
|
|
56
|
+
? 'Chromium 123.0.6312.86, compiled from source. Read Chromium License: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE'
|
|
58
57
|
: layer === 'emoji-apple'
|
|
59
58
|
? 'Apple Emojis (https://github.com/samuelngs/apple-emoji-linux). For educational purposes only - Apple is a trademark of Apple Inc., registered in the U.S. and other countries.'
|
|
60
59
|
: layer === 'emoji-google'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WebhookErrorPayload, WebhookSuccessPayload, WebhookTimeoutPayload } from '@remotion/serverless';
|
|
2
|
+
export type NextWebhookArgs = {
|
|
3
|
+
testing?: boolean;
|
|
4
|
+
extraHeaders?: Record<string, string>;
|
|
5
|
+
secret: string;
|
|
6
|
+
onSuccess?: (payload: WebhookSuccessPayload) => void;
|
|
7
|
+
onTimeout?: (payload: WebhookTimeoutPayload) => void;
|
|
8
|
+
onError?: (payload: WebhookErrorPayload) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const appRouterWebhook: (options: NextWebhookArgs) => ((req: Request) => Promise<Response>);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.appRouterWebhook = void 0;
|
|
4
|
+
const validate_webhook_signature_1 = require("./validate-webhook-signature");
|
|
5
|
+
const appRouterWebhook = (options) => {
|
|
6
|
+
const { testing, extraHeaders, secret, onSuccess, onTimeout, onError } = options;
|
|
7
|
+
return async function (req) {
|
|
8
|
+
let headers = extraHeaders || {};
|
|
9
|
+
if (testing) {
|
|
10
|
+
const testingheaders = {
|
|
11
|
+
'Access-Control-Allow-Origin': 'https://www.remotion.dev',
|
|
12
|
+
'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',
|
|
13
|
+
'Access-Control-Allow-Methods': 'OPTIONS,POST',
|
|
14
|
+
};
|
|
15
|
+
headers = { ...headers, ...testingheaders };
|
|
16
|
+
}
|
|
17
|
+
if (req.method === 'OPTIONS') {
|
|
18
|
+
// do we have any use of the OPTIONS method other than the tester on webhooks page ? if so we can add a condition here to only return this if testing mode enabled
|
|
19
|
+
return new Response(null, {
|
|
20
|
+
headers,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
// Parse the body properly
|
|
24
|
+
const body = await req.json();
|
|
25
|
+
(0, validate_webhook_signature_1.validateWebhookSignature)({
|
|
26
|
+
secret,
|
|
27
|
+
body,
|
|
28
|
+
signatureHeader: req.headers.get('X-Remotion-Signature'),
|
|
29
|
+
});
|
|
30
|
+
const payload = body;
|
|
31
|
+
if (payload.type === 'success' && onSuccess) {
|
|
32
|
+
onSuccess(payload);
|
|
33
|
+
}
|
|
34
|
+
else if (payload.type === 'timeout' && onTimeout) {
|
|
35
|
+
onTimeout(payload);
|
|
36
|
+
}
|
|
37
|
+
else if (payload.type === 'error' && onError) {
|
|
38
|
+
onError(payload);
|
|
39
|
+
}
|
|
40
|
+
return new Response(JSON.stringify({ success: true }), { headers });
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
exports.appRouterWebhook = appRouterWebhook;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
2
|
import type { AwsRegion } from '../regions';
|
|
3
3
|
import type { RuntimePreference } from '../shared/get-layers';
|
|
4
|
-
export declare const createFunction: ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights,
|
|
4
|
+
export declare const createFunction: ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights, logLevel, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, }: {
|
|
5
5
|
createCloudWatchLogGroup: boolean;
|
|
6
6
|
region: AwsRegion;
|
|
7
7
|
zipFile: string;
|
|
@@ -14,7 +14,6 @@ export declare const createFunction: ({ createCloudWatchLogGroup, region, zipFil
|
|
|
14
14
|
ephemerealStorageInMb: number;
|
|
15
15
|
customRoleArn: string;
|
|
16
16
|
enableLambdaInsights: boolean;
|
|
17
|
-
enableV5Runtime: boolean;
|
|
18
17
|
logLevel: LogLevel;
|
|
19
18
|
vpcSubnetIds: string;
|
|
20
19
|
vpcSecurityGroupIds: string;
|
|
@@ -11,7 +11,7 @@ const aws_clients_1 = require("../shared/aws-clients");
|
|
|
11
11
|
const get_layers_1 = require("../shared/get-layers");
|
|
12
12
|
const lambda_insights_extensions_1 = require("../shared/lambda-insights-extensions");
|
|
13
13
|
const suggested_policy_1 = require("./iam-validation/suggested-policy");
|
|
14
|
-
const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights,
|
|
14
|
+
const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights, logLevel, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, }) => {
|
|
15
15
|
var _a;
|
|
16
16
|
if (createCloudWatchLogGroup) {
|
|
17
17
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Creating CloudWatch group');
|
|
@@ -45,11 +45,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
45
45
|
const layers = (0, get_layers_1.getLayers)({
|
|
46
46
|
option: runtimePreference,
|
|
47
47
|
region,
|
|
48
|
-
enableV5Runtime,
|
|
49
48
|
});
|
|
50
|
-
if (enableV5Runtime) {
|
|
51
|
-
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'New V5 runtime enabled https://remotion.dev/docs/lambda/runtime#runtime-changes-in-remotion-50');
|
|
52
|
-
}
|
|
53
49
|
let vpcConfig;
|
|
54
50
|
if (vpcSubnetIds && vpcSecurityGroupIds) {
|
|
55
51
|
vpcConfig = {
|
|
@@ -58,6 +54,12 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
58
54
|
};
|
|
59
55
|
}
|
|
60
56
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Deploying new Lambda function');
|
|
57
|
+
const insightsLayer = enableLambdaInsights
|
|
58
|
+
? lambda_insights_extensions_1.lambdaInsightsExtensions[region]
|
|
59
|
+
: null;
|
|
60
|
+
if (enableLambdaInsights && !insightsLayer) {
|
|
61
|
+
throw new Error(`Lambda Insights is not supported by AWS in region ${region}. Please disable Lambda Insights. See http://remotion.dev/docs/lambda/insights#unsupported-regions`);
|
|
62
|
+
}
|
|
61
63
|
const { FunctionName, FunctionArn } = await (0, aws_clients_1.getLambdaClient)(region).send(new client_lambda_1.CreateFunctionCommand({
|
|
62
64
|
Code: {
|
|
63
65
|
ZipFile: (0, node_fs_1.readFileSync)(zipFile),
|
|
@@ -65,13 +67,13 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
65
67
|
FunctionName: functionName,
|
|
66
68
|
Handler: 'index.handler',
|
|
67
69
|
Role: customRoleArn !== null && customRoleArn !== void 0 ? customRoleArn : defaultRoleName,
|
|
68
|
-
Runtime:
|
|
70
|
+
Runtime: 'nodejs20.x',
|
|
69
71
|
Description: 'Renders a Remotion video.',
|
|
70
72
|
MemorySize: memorySizeInMb,
|
|
71
73
|
Timeout: timeoutInSeconds,
|
|
72
74
|
Layers: layers
|
|
73
75
|
.map(({ layerArn, version }) => `${layerArn}:${version}`)
|
|
74
|
-
.concat(
|
|
76
|
+
.concat(insightsLayer ? [insightsLayer] : []),
|
|
75
77
|
Architectures: ['arm64'],
|
|
76
78
|
EphemeralStorage: {
|
|
77
79
|
Size: ephemerealStorageInMb,
|
|
@@ -119,9 +121,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
119
121
|
}
|
|
120
122
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Function is now ready.');
|
|
121
123
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Locking the runtime version of the function...');
|
|
122
|
-
const RuntimeVersionArn =
|
|
123
|
-
? `arn:aws:lambda:${region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72`
|
|
124
|
-
: `arn:aws:lambda:${region}::runtime:b97ad873eb5228db2e7d5727cd116734cc24c92ff1381739c4400c095404a2d3`;
|
|
124
|
+
const RuntimeVersionArn = `arn:aws:lambda:${region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72`;
|
|
125
125
|
try {
|
|
126
126
|
await (0, aws_clients_1.getLambdaClient)(region).send(new client_lambda_1.PutRuntimeManagementConfigCommand({
|
|
127
127
|
FunctionName,
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* @description Deletes a function from AWS Lambda.
|
|
8
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/deletefunction)
|
|
9
|
-
* @param params.region The region the function was deployed to.
|
|
10
|
-
* @param params.functionName The name of the function.
|
|
11
|
-
* @returns {Promise<void>} Nothing. Throws if the function failed to delete.
|
|
12
|
-
*/
|
|
13
|
-
export declare const deleteFunction: ({ region, functionName, }: DeleteFunctionInput) => Promise<void>;
|
|
1
|
+
import type { DeleteFunction, DeleteFunctionInput as GenericDeleteFunctionInput } from '@remotion/serverless';
|
|
2
|
+
import type { AwsProvider } from '../functions/aws-implementation';
|
|
3
|
+
export type DeleteFunctionInput = GenericDeleteFunctionInput<AwsProvider>;
|
|
4
|
+
export declare const deleteFunction: DeleteFunction<AwsProvider>;
|
|
@@ -3,12 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deleteFunction = void 0;
|
|
4
4
|
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
5
|
const aws_clients_1 = require("../shared/aws-clients");
|
|
6
|
-
|
|
7
|
-
* @description Deletes a function
|
|
6
|
+
/*
|
|
7
|
+
* @description Deletes a deployed Lambda function based on its name.
|
|
8
8
|
* @see [Documentation](https://remotion.dev/docs/lambda/deletefunction)
|
|
9
|
-
* @param params.region The region the function was deployed to.
|
|
10
|
-
* @param params.functionName The name of the function.
|
|
11
|
-
* @returns {Promise<void>} Nothing. Throws if the function failed to delete.
|
|
12
9
|
*/
|
|
13
10
|
const deleteFunction = async ({ region, functionName, }) => {
|
|
14
11
|
await (0, aws_clients_1.getLambdaClient)(region).send(new client_lambda_1.DeleteFunctionCommand({
|
|
@@ -15,14 +15,6 @@ export declare const internalDeleteRender: (input: DeleteRenderInput & {
|
|
|
15
15
|
}) => Promise<{
|
|
16
16
|
freedBytes: number;
|
|
17
17
|
}>;
|
|
18
|
-
/**
|
|
19
|
-
* @description Deletes a render artifact and it's metadata given it's renderId.
|
|
20
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/deleterender)
|
|
21
|
-
* @param params.region The AWS region in which the media resides.
|
|
22
|
-
* @param params.bucketName The `bucketName` that was specified during the render
|
|
23
|
-
* @param params.renderId The `renderId` that was obtained after triggering the render.
|
|
24
|
-
* @param params.customCredentials If the file was saved to a foreign cloud, pass credentials for reading from it.
|
|
25
|
-
*/
|
|
26
18
|
export declare const deleteRender: (input: DeleteRenderInput) => Promise<{
|
|
27
19
|
freedBytes: number;
|
|
28
20
|
}>;
|
|
@@ -3,15 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deleteRender = exports.internalDeleteRender = void 0;
|
|
4
4
|
const client_1 = require("@remotion/serverless/client");
|
|
5
5
|
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
6
|
-
const get_overall_progress_s3_1 = require("../functions/helpers/get-overall-progress-s3");
|
|
7
|
-
const get_account_id_1 = require("../shared/get-account-id");
|
|
8
6
|
const clean_items_1 = require("./clean-items");
|
|
9
7
|
const internalDeleteRender = async (input) => {
|
|
10
8
|
var _a;
|
|
11
|
-
const expectedBucketOwner = await
|
|
9
|
+
const expectedBucketOwner = await input.providerSpecifics.getAccountId({
|
|
12
10
|
region: input.region,
|
|
13
11
|
});
|
|
14
|
-
const progress = await (0,
|
|
12
|
+
const progress = await (0, client_1.getOverallProgressFromStorage)({
|
|
15
13
|
bucketName: input.bucketName,
|
|
16
14
|
expectedBucketOwner,
|
|
17
15
|
region: input.region,
|
|
@@ -66,13 +64,9 @@ const internalDeleteRender = async (input) => {
|
|
|
66
64
|
};
|
|
67
65
|
};
|
|
68
66
|
exports.internalDeleteRender = internalDeleteRender;
|
|
69
|
-
|
|
70
|
-
* @description Deletes a
|
|
67
|
+
/*
|
|
68
|
+
* @description Deletes a rendered video, audio or still and its associated metadata.
|
|
71
69
|
* @see [Documentation](https://remotion.dev/docs/lambda/deleterender)
|
|
72
|
-
* @param params.region The AWS region in which the media resides.
|
|
73
|
-
* @param params.bucketName The `bucketName` that was specified during the render
|
|
74
|
-
* @param params.renderId The `renderId` that was obtained after triggering the render.
|
|
75
|
-
* @param params.customCredentials If the file was saved to a foreign cloud, pass credentials for reading from it.
|
|
76
70
|
*/
|
|
77
71
|
const deleteRender = (input) => {
|
|
78
72
|
return (0, exports.internalDeleteRender)({
|
|
@@ -21,15 +21,5 @@ export type DeleteSiteOutput = {
|
|
|
21
21
|
export declare const internalDeleteSite: ({ bucketName, siteName, region, onAfterItemDeleted, providerSpecifics, forcePathStyle, }: DeleteSiteInput & {
|
|
22
22
|
providerSpecifics: ProviderSpecifics<AwsProvider>;
|
|
23
23
|
}) => Promise<DeleteSiteOutput>;
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @description Deletes a deployed site from your S3 bucket. The opposite of deploySite().
|
|
27
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/deletesite)
|
|
28
|
-
* @param params.bucketName The S3 bucket name where the site resides in.
|
|
29
|
-
* @param params.siteName The ID of the site that you want to delete.
|
|
30
|
-
* @param {AwsRegion} params.region The region in where the S3 bucket resides in.
|
|
31
|
-
* @param params.onAfterItemDeleted Function that gets called after each file that gets deleted, useful for showing progress.
|
|
32
|
-
* @returns {Promise<DeleteSiteOutput>} Object containing info about how much space was freed.
|
|
33
|
-
*/
|
|
34
24
|
export declare const deleteSite: (props: DeleteSiteOptionalInput) => Promise<DeleteSiteOutput>;
|
|
35
25
|
export {};
|
package/dist/api/delete-site.js
CHANGED
|
@@ -3,10 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deleteSite = exports.internalDeleteSite = void 0;
|
|
4
4
|
const defaults_1 = require("../defaults");
|
|
5
5
|
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
6
|
-
const get_account_id_1 = require("../shared/get-account-id");
|
|
7
6
|
const clean_items_1 = require("./clean-items");
|
|
8
7
|
const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDeleted, providerSpecifics, forcePathStyle, }) => {
|
|
9
|
-
const accountId = await
|
|
8
|
+
const accountId = await providerSpecifics.getAccountId({ region });
|
|
10
9
|
let files = await providerSpecifics.listObjects({
|
|
11
10
|
bucketName,
|
|
12
11
|
// The `/` is important to not accidentially delete sites with the same name but containing a suffix.
|
|
@@ -44,15 +43,9 @@ const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDel
|
|
|
44
43
|
};
|
|
45
44
|
};
|
|
46
45
|
exports.internalDeleteSite = internalDeleteSite;
|
|
47
|
-
|
|
48
|
-
*
|
|
49
|
-
* @
|
|
50
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/deletesite)
|
|
51
|
-
* @param params.bucketName The S3 bucket name where the site resides in.
|
|
52
|
-
* @param params.siteName The ID of the site that you want to delete.
|
|
53
|
-
* @param {AwsRegion} params.region The region in where the S3 bucket resides in.
|
|
54
|
-
* @param params.onAfterItemDeleted Function that gets called after each file that gets deleted, useful for showing progress.
|
|
55
|
-
* @returns {Promise<DeleteSiteOutput>} Object containing info about how much space was freed.
|
|
46
|
+
/*
|
|
47
|
+
* @description Removes a Remotion project from your Cloud Storage bucket.
|
|
48
|
+
* @see [Documentation](https://remotion.dev/docs/cloudrun/deletesite)
|
|
56
49
|
*/
|
|
57
50
|
const deleteSite = (props) => {
|
|
58
51
|
var _a, _b;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
+
import type { CloudProvider, FullClientSpecifics, ProviderSpecifics } from '@remotion/serverless';
|
|
2
3
|
import type { AwsRegion } from '../regions';
|
|
3
4
|
import { type RuntimePreference } from '../shared/get-layers';
|
|
4
5
|
type MandatoryParameters = {
|
|
@@ -14,7 +15,6 @@ type OptionalParameters = {
|
|
|
14
15
|
enableLambdaInsights: boolean;
|
|
15
16
|
indent: boolean;
|
|
16
17
|
logLevel: LogLevel;
|
|
17
|
-
enableV5Runtime: boolean;
|
|
18
18
|
vpcSubnetIds: string | undefined;
|
|
19
19
|
vpcSecurityGroupIds: string | undefined;
|
|
20
20
|
runtimePreference: RuntimePreference;
|
|
@@ -24,18 +24,11 @@ export type DeployFunctionOutput = {
|
|
|
24
24
|
functionName: string;
|
|
25
25
|
alreadyExisted: boolean;
|
|
26
26
|
};
|
|
27
|
-
export declare const internalDeployFunction: (params: MandatoryParameters & OptionalParameters
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* @param params.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
|
|
35
|
-
* @param params.memorySizeInMb How much memory should be allocated to the Lambda function.
|
|
36
|
-
* @param params.architecture The architecture Lambda should run on. One of x86_64 and x64
|
|
37
|
-
* @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
|
|
38
|
-
* @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
|
|
39
|
-
*/
|
|
40
|
-
export declare const deployFunction: ({ createCloudWatchLogGroup, memorySizeInMb, region, timeoutInSeconds, cloudWatchLogRetentionPeriodInDays, customRoleArn, enableLambdaInsights, indent, logLevel, enableV5Runtime, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, diskSizeInMb, }: DeployFunctionInput) => Promise<DeployFunctionOutput>;
|
|
27
|
+
export declare const internalDeployFunction: <Provider extends CloudProvider>(params: MandatoryParameters & OptionalParameters & {
|
|
28
|
+
providerSpecifics: ProviderSpecifics<Provider>;
|
|
29
|
+
fullClientSpecifics: FullClientSpecifics<Provider>;
|
|
30
|
+
}) => Promise<DeployFunctionOutput>;
|
|
31
|
+
export declare const deployFunction: ({ createCloudWatchLogGroup, memorySizeInMb, region, timeoutInSeconds, cloudWatchLogRetentionPeriodInDays, customRoleArn, enableLambdaInsights, indent, logLevel, enableV5Runtime, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, diskSizeInMb, }: DeployFunctionInput & {
|
|
32
|
+
enableV5Runtime?: boolean;
|
|
33
|
+
}) => Promise<DeployFunctionOutput>;
|
|
41
34
|
export {};
|
|
@@ -2,21 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deployFunction = exports.internalDeployFunction = void 0;
|
|
4
4
|
const error_handling_1 = require("@remotion/renderer/error-handling");
|
|
5
|
-
const no_react_1 = require("remotion/no-react");
|
|
6
5
|
const version_1 = require("remotion/version");
|
|
7
|
-
const
|
|
6
|
+
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
7
|
+
const full_client_implementation_1 = require("../functions/full-client-implementation");
|
|
8
8
|
const constants_1 = require("../shared/constants");
|
|
9
9
|
const function_zip_path_1 = require("../shared/function-zip-path");
|
|
10
|
-
const get_account_id_1 = require("../shared/get-account-id");
|
|
11
10
|
const get_layers_1 = require("../shared/get-layers");
|
|
12
|
-
const lambda_version_string_1 = require("../shared/lambda-version-string");
|
|
13
11
|
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
14
12
|
const validate_custom_role_arn_1 = require("../shared/validate-custom-role-arn");
|
|
15
13
|
const validate_disk_size_in_mb_1 = require("../shared/validate-disk-size-in-mb");
|
|
16
14
|
const validate_memory_size_1 = require("../shared/validate-memory-size");
|
|
17
15
|
const validate_retention_period_1 = require("../shared/validate-retention-period");
|
|
18
16
|
const validate_timeout_1 = require("../shared/validate-timeout");
|
|
19
|
-
const
|
|
17
|
+
const speculate_function_name_1 = require("./speculate-function-name");
|
|
20
18
|
const internalDeployFunction = async (params) => {
|
|
21
19
|
var _a, _b;
|
|
22
20
|
(0, validate_memory_size_1.validateMemorySize)(params.memorySizeInMb);
|
|
@@ -26,14 +24,15 @@ const internalDeployFunction = async (params) => {
|
|
|
26
24
|
(0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(params.diskSizeInMb);
|
|
27
25
|
(0, validate_custom_role_arn_1.validateCustomRoleArn)(params.customRoleArn);
|
|
28
26
|
(0, get_layers_1.validateRuntimePreference)(params.runtimePreference);
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
const functionName = (0, speculate_function_name_1.speculateFunctionName)({
|
|
28
|
+
diskSizeInMb: params.diskSizeInMb,
|
|
29
|
+
memorySizeInMb: params.memorySizeInMb,
|
|
30
|
+
timeoutInSeconds: params.timeoutInSeconds,
|
|
31
|
+
});
|
|
32
|
+
const accountId = await params.providerSpecifics.getAccountId({
|
|
33
|
+
region: params.region,
|
|
34
|
+
});
|
|
35
|
+
const fns = await params.providerSpecifics.getFunctions({
|
|
37
36
|
compatibleOnly: true,
|
|
38
37
|
region: params.region,
|
|
39
38
|
});
|
|
@@ -41,11 +40,11 @@ const internalDeployFunction = async (params) => {
|
|
|
41
40
|
f.memorySizeInMb === params.memorySizeInMb &&
|
|
42
41
|
f.timeoutInSeconds === params.timeoutInSeconds &&
|
|
43
42
|
f.diskSizeInMb === params.diskSizeInMb);
|
|
44
|
-
const created = await
|
|
43
|
+
const created = await params.fullClientSpecifics.createFunction({
|
|
45
44
|
createCloudWatchLogGroup: params.createCloudWatchLogGroup,
|
|
46
45
|
region: params.region,
|
|
47
46
|
zipFile: function_zip_path_1.FUNCTION_ZIP_ARM64,
|
|
48
|
-
functionName
|
|
47
|
+
functionName,
|
|
49
48
|
accountId,
|
|
50
49
|
memorySizeInMb: params.memorySizeInMb,
|
|
51
50
|
timeoutInSeconds: params.timeoutInSeconds,
|
|
@@ -54,7 +53,6 @@ const internalDeployFunction = async (params) => {
|
|
|
54
53
|
ephemerealStorageInMb: params.diskSizeInMb,
|
|
55
54
|
customRoleArn: params.customRoleArn,
|
|
56
55
|
enableLambdaInsights: (_b = params.enableLambdaInsights) !== null && _b !== void 0 ? _b : false,
|
|
57
|
-
enableV5Runtime: params.enableV5Runtime,
|
|
58
56
|
logLevel: params.logLevel,
|
|
59
57
|
vpcSubnetIds: params.vpcSubnetIds,
|
|
60
58
|
vpcSecurityGroupIds: params.vpcSecurityGroupIds,
|
|
@@ -70,19 +68,14 @@ const internalDeployFunction = async (params) => {
|
|
|
70
68
|
};
|
|
71
69
|
exports.internalDeployFunction = internalDeployFunction;
|
|
72
70
|
const errorHandled = (0, error_handling_1.wrapWithErrorHandling)(exports.internalDeployFunction);
|
|
73
|
-
|
|
71
|
+
/*
|
|
74
72
|
* @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
|
|
75
|
-
* @see [Documentation](https://
|
|
76
|
-
* @param params.createCloudWatchLogGroup Whether you'd like to create a CloudWatch Log Group to store the logs for this function.
|
|
77
|
-
* @param params.cloudWatchLogRetentionPeriodInDays (optional) The number of days to retain the CloudWatch logs for this function. Default is 14 days.
|
|
78
|
-
* @param params.region The region you want to deploy your function to.
|
|
79
|
-
* @param params.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
|
|
80
|
-
* @param params.memorySizeInMb How much memory should be allocated to the Lambda function.
|
|
81
|
-
* @param params.architecture The architecture Lambda should run on. One of x86_64 and x64
|
|
82
|
-
* @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
|
|
83
|
-
* @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
|
|
73
|
+
* @see [Documentation](https://remotion.dev/docs/lambda/deployfunction)
|
|
84
74
|
*/
|
|
85
75
|
const deployFunction = ({ createCloudWatchLogGroup, memorySizeInMb, region, timeoutInSeconds, cloudWatchLogRetentionPeriodInDays, customRoleArn, enableLambdaInsights, indent, logLevel, enableV5Runtime, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, diskSizeInMb, }) => {
|
|
76
|
+
if (enableV5Runtime) {
|
|
77
|
+
console.warn('The `enableV5Runtime` option is now on by default. No need to specify it anymore.');
|
|
78
|
+
}
|
|
86
79
|
return errorHandled({
|
|
87
80
|
indent: indent !== null && indent !== void 0 ? indent : false,
|
|
88
81
|
logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
|
|
@@ -94,10 +87,11 @@ const deployFunction = ({ createCloudWatchLogGroup, memorySizeInMb, region, time
|
|
|
94
87
|
region,
|
|
95
88
|
timeoutInSeconds,
|
|
96
89
|
cloudWatchLogRetentionPeriodInDays,
|
|
97
|
-
enableV5Runtime: enableV5Runtime !== null && enableV5Runtime !== void 0 ? enableV5Runtime : no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES,
|
|
98
90
|
vpcSubnetIds,
|
|
99
91
|
vpcSecurityGroupIds,
|
|
100
92
|
runtimePreference: runtimePreference !== null && runtimePreference !== void 0 ? runtimePreference : 'default',
|
|
93
|
+
providerSpecifics: aws_implementation_1.awsImplementation,
|
|
94
|
+
fullClientSpecifics: full_client_implementation_1.awsFullClientSpecifics,
|
|
101
95
|
});
|
|
102
96
|
};
|
|
103
97
|
exports.deployFunction = deployFunction;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type GitSource, type WebpackOverrideFn } from '@remotion/bundler';
|
|
2
2
|
import type { ToOptions } from '@remotion/renderer';
|
|
3
3
|
import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
4
|
-
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
4
|
+
import type { FullClientSpecifics, ProviderSpecifics, UploadDirProgress } from '@remotion/serverless';
|
|
5
5
|
import type { AwsProvider } from '../functions/aws-implementation';
|
|
6
6
|
import type { AwsRegion } from '../regions';
|
|
7
|
-
import type { UploadDirProgress } from './upload-dir';
|
|
8
7
|
type MandatoryParameters = {
|
|
9
8
|
entryPoint: string;
|
|
10
9
|
bucketName: string;
|
|
@@ -88,6 +87,7 @@ export declare const internalDeploySite: (args_0: MandatoryParameters & {
|
|
|
88
87
|
};
|
|
89
88
|
}> & {
|
|
90
89
|
providerSpecifics: ProviderSpecifics<AwsProvider>;
|
|
90
|
+
fullClientSpecifics: FullClientSpecifics<AwsProvider>;
|
|
91
91
|
}) => Promise<{
|
|
92
92
|
serveUrl: string;
|
|
93
93
|
siteName: string;
|
|
@@ -97,15 +97,6 @@ export declare const internalDeploySite: (args_0: MandatoryParameters & {
|
|
|
97
97
|
untouchedFiles: number;
|
|
98
98
|
};
|
|
99
99
|
}>;
|
|
100
|
-
/**
|
|
101
|
-
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
|
|
102
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/deploysite)
|
|
103
|
-
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
104
|
-
* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
|
|
105
|
-
* @param {string} params.bucketName The name of the bucket to deploy your project into.
|
|
106
|
-
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
107
|
-
* @param {object} params.options Further options, see documentation page for this function.
|
|
108
|
-
*/
|
|
109
100
|
export declare const deploySite: (args: DeploySiteInput) => Promise<{
|
|
110
101
|
serveUrl: string;
|
|
111
102
|
siteName: string;
|
package/dist/api/deploy-site.js
CHANGED
|
@@ -8,24 +8,21 @@ const error_handling_1 = require("@remotion/renderer/error-handling");
|
|
|
8
8
|
const client_1 = require("@remotion/serverless/client");
|
|
9
9
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
10
10
|
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
11
|
-
const
|
|
11
|
+
const full_client_implementation_1 = require("../functions/full-client-implementation");
|
|
12
12
|
const constants_1 = require("../shared/constants");
|
|
13
|
-
const get_account_id_1 = require("../shared/get-account-id");
|
|
14
13
|
const get_s3_operations_1 = require("../shared/get-s3-operations");
|
|
15
14
|
const make_s3_url_1 = require("../shared/make-s3-url");
|
|
16
15
|
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
17
|
-
const validate_privacy_1 = require("../shared/validate-privacy");
|
|
18
16
|
const validate_site_name_1 = require("../shared/validate-site-name");
|
|
19
|
-
const
|
|
20
|
-
const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy, gitSource, throwIfSiteExists, providerSpecifics, forcePathStyle, }) => {
|
|
17
|
+
const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy, gitSource, throwIfSiteExists, providerSpecifics, forcePathStyle, fullClientSpecifics, }) => {
|
|
21
18
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
22
19
|
(0, validate_aws_region_1.validateAwsRegion)(region);
|
|
23
20
|
(0, client_1.validateBucketName)(bucketName, {
|
|
24
21
|
mustStartWithRemotion: !(options === null || options === void 0 ? void 0 : options.bypassBucketNameValidation),
|
|
25
22
|
});
|
|
26
23
|
(0, validate_site_name_1.validateSiteName)(siteName);
|
|
27
|
-
(0,
|
|
28
|
-
const accountId = await
|
|
24
|
+
(0, client_1.validatePrivacy)(privacy, false);
|
|
25
|
+
const accountId = await providerSpecifics.getAccountId({ region });
|
|
29
26
|
const bucketExists = await providerSpecifics.bucketExists({
|
|
30
27
|
bucketName,
|
|
31
28
|
region,
|
|
@@ -45,7 +42,7 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
|
|
|
45
42
|
prefix: `${subFolder}/`,
|
|
46
43
|
forcePathStyle,
|
|
47
44
|
}),
|
|
48
|
-
|
|
45
|
+
fullClientSpecifics.bundleSite({
|
|
49
46
|
publicPath: `/${subFolder}/`,
|
|
50
47
|
webpackOverride: (_a = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _a !== void 0 ? _a : ((f) => f),
|
|
51
48
|
enableCaching: (_b = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _b !== void 0 ? _b : true,
|
|
@@ -81,10 +78,11 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
|
|
|
81
78
|
totalBytes = bytes;
|
|
82
79
|
(_a = options.onDiffingProgress) === null || _a === void 0 ? void 0 : _a.call(options, bytes, false);
|
|
83
80
|
},
|
|
81
|
+
fullClientSpecifics,
|
|
84
82
|
});
|
|
85
83
|
(_h = options.onDiffingProgress) === null || _h === void 0 ? void 0 : _h.call(options, totalBytes, true);
|
|
86
84
|
await Promise.all([
|
|
87
|
-
|
|
85
|
+
fullClientSpecifics.uploadDir({
|
|
88
86
|
bucket: bucketName,
|
|
89
87
|
region,
|
|
90
88
|
localDir: bundled,
|
|
@@ -104,11 +102,9 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
|
|
|
104
102
|
});
|
|
105
103
|
})),
|
|
106
104
|
]);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
});
|
|
111
|
-
}
|
|
105
|
+
node_fs_1.default.rmSync(bundled, {
|
|
106
|
+
recursive: true,
|
|
107
|
+
});
|
|
112
108
|
return {
|
|
113
109
|
serveUrl: (0, make_s3_url_1.makeS3ServeUrl)({ bucketName, subFolder, region }),
|
|
114
110
|
siteName,
|
|
@@ -120,14 +116,9 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
|
|
|
120
116
|
};
|
|
121
117
|
};
|
|
122
118
|
exports.internalDeploySite = (0, error_handling_1.wrapWithErrorHandling)(mandatoryDeploySite);
|
|
123
|
-
|
|
124
|
-
* @description Deploys a Remotion project to
|
|
125
|
-
* @see [Documentation](https://remotion.dev/docs/
|
|
126
|
-
* @param {AwsRegion} params.region The region in which the S3 bucket resides in.
|
|
127
|
-
* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
|
|
128
|
-
* @param {string} params.bucketName The name of the bucket to deploy your project into.
|
|
129
|
-
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
130
|
-
* @param {object} params.options Further options, see documentation page for this function.
|
|
119
|
+
/*
|
|
120
|
+
* @description Deploys a Remotion project to a GCP storage bucket to prepare it for rendering on Cloud Run.
|
|
121
|
+
* @see [Documentation](https://remotion.dev/docs/cloudrun/deploysite)
|
|
131
122
|
*/
|
|
132
123
|
const deploySite = (args) => {
|
|
133
124
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -144,6 +135,7 @@ const deploySite = (args) => {
|
|
|
144
135
|
throwIfSiteExists: (_e = args.throwIfSiteExists) !== null && _e !== void 0 ? _e : false,
|
|
145
136
|
providerSpecifics: aws_implementation_1.awsImplementation,
|
|
146
137
|
forcePathStyle: (_f = args.forcePathStyle) !== null && _f !== void 0 ? _f : false,
|
|
138
|
+
fullClientSpecifics: full_client_implementation_1.awsFullClientSpecifics,
|
|
147
139
|
});
|
|
148
140
|
};
|
|
149
141
|
exports.deploySite = deploySite;
|
|
@@ -22,15 +22,4 @@ export declare const internalDownloadMedia: (input: DownloadMediaInput & {
|
|
|
22
22
|
providerSpecifics: ProviderSpecifics<AwsProvider>;
|
|
23
23
|
forcePathStyle: boolean;
|
|
24
24
|
}) => Promise<DownloadMediaOutput>;
|
|
25
|
-
/**
|
|
26
|
-
* @description Downloads a rendered video, audio or still to the disk of the machine this API is called from.
|
|
27
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/downloadmedia)
|
|
28
|
-
* @param params.region The AWS region in which the media resides.
|
|
29
|
-
* @param params.bucketName The `bucketName` that was specified during the render.
|
|
30
|
-
* @param params.renderId The `renderId` that was obtained after triggering the render.
|
|
31
|
-
* @param params.outPath Where to save the media.
|
|
32
|
-
* @param params.onProgress Progress callback function - see docs for details.
|
|
33
|
-
* @param params.customCredentials If the file was saved to a foreign cloud, pass credentials for reading from it.
|
|
34
|
-
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
|
|
35
|
-
*/
|
|
36
25
|
export declare const downloadMedia: (input: DownloadMediaInput) => Promise<DownloadMediaOutput>;
|