@remotion/lambda 4.0.245 → 4.0.247
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/api/app-router-webhook.d.ts +10 -0
- package/dist/api/app-router-webhook.js +43 -0
- package/dist/api/delete-function.d.ts +4 -6
- package/dist/api/delete-render.js +2 -4
- package/dist/api/delete-site.js +1 -2
- package/dist/api/deploy-function.d.ts +5 -1
- package/dist/api/deploy-function.js +16 -14
- package/dist/api/deploy-site.d.ts +2 -2
- package/dist/api/deploy-site.js +11 -14
- package/dist/api/download-media.js +2 -4
- package/dist/api/get-aws-client.d.ts +1 -1
- package/dist/api/get-compositions-on-lambda.d.ts +1 -1
- package/dist/api/get-compositions-on-lambda.js +10 -6
- package/dist/api/get-function-info.d.ts +1 -7
- package/dist/api/get-functions.d.ts +1 -1
- package/dist/api/get-render-progress.js +2 -4
- package/dist/api/get-sites.js +1 -2
- 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/render-media-on-lambda.d.ts +1 -1
- package/dist/api/render-media-on-lambda.js +2 -2
- package/dist/api/render-still-on-lambda.d.ts +2 -3
- package/dist/api/render-still-on-lambda.js +3 -2
- package/dist/api/upload-dir.d.ts +1 -7
- package/dist/api/upload-dir.js +2 -6
- 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 +3 -1
- 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 +10 -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 +6 -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/index.d.ts +1 -8
- package/dist/functions/index.js +12 -235
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/internals.d.ts +6 -5
- 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-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/read-dir.d.ts +2 -10
- package/dist/shared/read-dir.js +5 -4
- 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/call-lambda.js +0 -149
- 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
|
@@ -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,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
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,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,
|
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.
|
|
@@ -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 = {
|
|
@@ -23,7 +24,10 @@ export type DeployFunctionOutput = {
|
|
|
23
24
|
functionName: string;
|
|
24
25
|
alreadyExisted: boolean;
|
|
25
26
|
};
|
|
26
|
-
export declare const internalDeployFunction: (params: MandatoryParameters & OptionalParameters
|
|
27
|
+
export declare const internalDeployFunction: <Provider extends CloudProvider>(params: MandatoryParameters & OptionalParameters & {
|
|
28
|
+
providerSpecifics: ProviderSpecifics<Provider>;
|
|
29
|
+
fullClientSpecifics: FullClientSpecifics<Provider>;
|
|
30
|
+
}) => Promise<DeployFunctionOutput>;
|
|
27
31
|
export declare const deployFunction: ({ createCloudWatchLogGroup, memorySizeInMb, region, timeoutInSeconds, cloudWatchLogRetentionPeriodInDays, customRoleArn, enableLambdaInsights, indent, logLevel, enableV5Runtime, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, diskSizeInMb, }: DeployFunctionInput & {
|
|
28
32
|
enableV5Runtime?: boolean;
|
|
29
33
|
}) => Promise<DeployFunctionOutput>;
|
|
@@ -3,19 +3,18 @@ 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
5
|
const version_1 = require("remotion/version");
|
|
6
|
-
const
|
|
6
|
+
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
7
|
+
const full_client_implementation_1 = require("../functions/full-client-implementation");
|
|
7
8
|
const constants_1 = require("../shared/constants");
|
|
8
9
|
const function_zip_path_1 = require("../shared/function-zip-path");
|
|
9
|
-
const get_account_id_1 = require("../shared/get-account-id");
|
|
10
10
|
const get_layers_1 = require("../shared/get-layers");
|
|
11
|
-
const lambda_version_string_1 = require("../shared/lambda-version-string");
|
|
12
11
|
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
13
12
|
const validate_custom_role_arn_1 = require("../shared/validate-custom-role-arn");
|
|
14
13
|
const validate_disk_size_in_mb_1 = require("../shared/validate-disk-size-in-mb");
|
|
15
14
|
const validate_memory_size_1 = require("../shared/validate-memory-size");
|
|
16
15
|
const validate_retention_period_1 = require("../shared/validate-retention-period");
|
|
17
16
|
const validate_timeout_1 = require("../shared/validate-timeout");
|
|
18
|
-
const
|
|
17
|
+
const speculate_function_name_1 = require("./speculate-function-name");
|
|
19
18
|
const internalDeployFunction = async (params) => {
|
|
20
19
|
var _a, _b;
|
|
21
20
|
(0, validate_memory_size_1.validateMemorySize)(params.memorySizeInMb);
|
|
@@ -25,14 +24,15 @@ const internalDeployFunction = async (params) => {
|
|
|
25
24
|
(0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(params.diskSizeInMb);
|
|
26
25
|
(0, validate_custom_role_arn_1.validateCustomRoleArn)(params.customRoleArn);
|
|
27
26
|
(0, get_layers_1.validateRuntimePreference)(params.runtimePreference);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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({
|
|
36
36
|
compatibleOnly: true,
|
|
37
37
|
region: params.region,
|
|
38
38
|
});
|
|
@@ -40,11 +40,11 @@ const internalDeployFunction = async (params) => {
|
|
|
40
40
|
f.memorySizeInMb === params.memorySizeInMb &&
|
|
41
41
|
f.timeoutInSeconds === params.timeoutInSeconds &&
|
|
42
42
|
f.diskSizeInMb === params.diskSizeInMb);
|
|
43
|
-
const created = await
|
|
43
|
+
const created = await params.fullClientSpecifics.createFunction({
|
|
44
44
|
createCloudWatchLogGroup: params.createCloudWatchLogGroup,
|
|
45
45
|
region: params.region,
|
|
46
46
|
zipFile: function_zip_path_1.FUNCTION_ZIP_ARM64,
|
|
47
|
-
functionName
|
|
47
|
+
functionName,
|
|
48
48
|
accountId,
|
|
49
49
|
memorySizeInMb: params.memorySizeInMb,
|
|
50
50
|
timeoutInSeconds: params.timeoutInSeconds,
|
|
@@ -90,6 +90,8 @@ const deployFunction = ({ createCloudWatchLogGroup, memorySizeInMb, region, time
|
|
|
90
90
|
vpcSubnetIds,
|
|
91
91
|
vpcSecurityGroupIds,
|
|
92
92
|
runtimePreference: runtimePreference !== null && runtimePreference !== void 0 ? runtimePreference : 'default',
|
|
93
|
+
providerSpecifics: aws_implementation_1.awsImplementation,
|
|
94
|
+
fullClientSpecifics: full_client_implementation_1.awsFullClientSpecifics,
|
|
93
95
|
});
|
|
94
96
|
};
|
|
95
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;
|
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,
|
|
@@ -139,6 +135,7 @@ const deploySite = (args) => {
|
|
|
139
135
|
throwIfSiteExists: (_e = args.throwIfSiteExists) !== null && _e !== void 0 ? _e : false,
|
|
140
136
|
providerSpecifics: aws_implementation_1.awsImplementation,
|
|
141
137
|
forcePathStyle: (_f = args.forcePathStyle) !== null && _f !== void 0 ? _f : false,
|
|
138
|
+
fullClientSpecifics: full_client_implementation_1.awsFullClientSpecifics,
|
|
142
139
|
});
|
|
143
140
|
};
|
|
144
141
|
exports.deploySite = deploySite;
|
|
@@ -8,15 +8,13 @@ const renderer_1 = require("@remotion/renderer");
|
|
|
8
8
|
const client_1 = require("@remotion/serverless/client");
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
11
|
-
const get_overall_progress_s3_1 = require("../functions/helpers/get-overall-progress-s3");
|
|
12
11
|
const read_with_progress_1 = require("../functions/helpers/read-with-progress");
|
|
13
|
-
const get_account_id_1 = require("../shared/get-account-id");
|
|
14
12
|
const internalDownloadMedia = async (input) => {
|
|
15
13
|
var _a, _b, _c, _d;
|
|
16
|
-
const expectedBucketOwner = await
|
|
14
|
+
const expectedBucketOwner = await input.providerSpecifics.getAccountId({
|
|
17
15
|
region: input.region,
|
|
18
16
|
});
|
|
19
|
-
const overallProgress = await (0,
|
|
17
|
+
const overallProgress = await (0, client_1.getOverallProgressFromStorage)({
|
|
20
18
|
bucketName: input.bucketName,
|
|
21
19
|
expectedBucketOwner,
|
|
22
20
|
region: input.region,
|
|
@@ -5,8 +5,8 @@ import * as S3SDK from '@aws-sdk/client-s3';
|
|
|
5
5
|
import * as ServiceQuotasSDK from '@aws-sdk/client-service-quotas';
|
|
6
6
|
import * as StsSdk from '@aws-sdk/client-sts';
|
|
7
7
|
import type { CustomCredentials } from '@remotion/serverless/client';
|
|
8
|
-
import type { AwsRegion } from '../client';
|
|
9
8
|
import type { AwsProvider } from '../functions/aws-implementation';
|
|
9
|
+
import type { AwsRegion } from '../regions';
|
|
10
10
|
import { type ServiceMapping } from '../shared/get-service-client';
|
|
11
11
|
export type GetAwsClientInput<T extends keyof ServiceMapping> = {
|
|
12
12
|
region: AwsRegion;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChromiumOptions, ToOptions } from '@remotion/renderer';
|
|
2
2
|
import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
3
3
|
import type { VideoConfig } from 'remotion/no-react';
|
|
4
|
-
import type { AwsRegion } from '../
|
|
4
|
+
import type { AwsRegion } from '../regions';
|
|
5
5
|
export type GetCompositionsOnLambdaInput = {
|
|
6
6
|
chromiumOptions?: ChromiumOptions;
|
|
7
7
|
region: AwsRegion;
|
|
@@ -4,7 +4,6 @@ exports.getCompositionsOnLambda = void 0;
|
|
|
4
4
|
const client_1 = require("@remotion/serverless/client");
|
|
5
5
|
const version_1 = require("remotion/version");
|
|
6
6
|
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
7
|
-
const call_lambda_1 = require("../shared/call-lambda");
|
|
8
7
|
/*
|
|
9
8
|
* @description Gets the compositions inside a Lambda function.
|
|
10
9
|
* @see [Documentation](https://remotion.dev/docs/lambda/getcompositionsonlambda)
|
|
@@ -17,19 +16,24 @@ const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inpu
|
|
|
17
16
|
region,
|
|
18
17
|
userSpecifiedBucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
19
18
|
propsType: 'input-props',
|
|
20
|
-
needsToUpload: (0, client_1.getNeedsToUpload)(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
needsToUpload: (0, client_1.getNeedsToUpload)({
|
|
20
|
+
type: 'video-or-audio',
|
|
21
|
+
sizes: [
|
|
22
|
+
stringifiedInputProps.length,
|
|
23
|
+
JSON.stringify(envVariables).length,
|
|
24
|
+
],
|
|
25
|
+
providerSpecifics: aws_implementation_1.awsImplementation,
|
|
26
|
+
}),
|
|
24
27
|
providerSpecifics: aws_implementation_1.awsImplementation,
|
|
25
28
|
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
26
29
|
skipPutAcl: false,
|
|
27
30
|
});
|
|
28
31
|
try {
|
|
29
|
-
const res = await
|
|
32
|
+
const res = await aws_implementation_1.awsImplementation.callFunctionSync({
|
|
30
33
|
functionName,
|
|
31
34
|
type: client_1.ServerlessRoutines.compositions,
|
|
32
35
|
payload: {
|
|
36
|
+
type: client_1.ServerlessRoutines.compositions,
|
|
33
37
|
chromiumOptions: chromiumOptions !== null && chromiumOptions !== void 0 ? chromiumOptions : {},
|
|
34
38
|
serveUrl,
|
|
35
39
|
envVariables,
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
+
import type { FunctionInfo } from '@remotion/serverless';
|
|
2
3
|
import type { AwsRegion } from '../regions';
|
|
3
|
-
export type FunctionInfo = {
|
|
4
|
-
functionName: string;
|
|
5
|
-
timeoutInSeconds: number;
|
|
6
|
-
memorySizeInMb: number;
|
|
7
|
-
version: string | null;
|
|
8
|
-
diskSizeInMb: number;
|
|
9
|
-
};
|
|
10
4
|
export type GetFunctionInfoInput = {
|
|
11
5
|
region: AwsRegion;
|
|
12
6
|
functionName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
+
import type { FunctionInfo } from '@remotion/serverless';
|
|
2
3
|
import type { AwsRegion } from '../regions';
|
|
3
|
-
import type { FunctionInfo } from './get-function-info';
|
|
4
4
|
export type GetFunctionsInput = {
|
|
5
5
|
region: AwsRegion;
|
|
6
6
|
compatibleOnly: boolean;
|
|
@@ -3,9 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getRenderProgress = void 0;
|
|
4
4
|
const client_1 = require("@remotion/serverless/client");
|
|
5
5
|
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
6
|
-
const get_progress_1 = require("../functions/helpers/get-progress");
|
|
7
6
|
const parse_function_name_1 = require("../functions/helpers/parse-function-name");
|
|
8
|
-
const call_lambda_1 = require("../shared/call-lambda");
|
|
9
7
|
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
10
8
|
/*
|
|
11
9
|
* @description Gets the current status of a render originally triggered via renderMediaOnLambda().
|
|
@@ -22,7 +20,7 @@ const getRenderProgress = async (input) => {
|
|
|
22
20
|
'You must call getRenderProgress with `skipLambdaInvocation` set to false.',
|
|
23
21
|
].join('\n'));
|
|
24
22
|
}
|
|
25
|
-
return (0,
|
|
23
|
+
return (0, client_1.getProgress)({
|
|
26
24
|
bucketName: input.bucketName,
|
|
27
25
|
renderId: input.renderId,
|
|
28
26
|
region: input.region,
|
|
@@ -35,7 +33,7 @@ const getRenderProgress = async (input) => {
|
|
|
35
33
|
functionName: input.functionName,
|
|
36
34
|
});
|
|
37
35
|
}
|
|
38
|
-
const result = await
|
|
36
|
+
const result = await aws_implementation_1.awsImplementation.callFunctionSync({
|
|
39
37
|
functionName: input.functionName,
|
|
40
38
|
type: client_1.ServerlessRoutines.status,
|
|
41
39
|
payload: (0, make_lambda_payload_1.getRenderProgressPayload)(input),
|
package/dist/api/get-sites.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getSites = exports.internalGetSites = void 0;
|
|
4
4
|
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
5
5
|
const constants_1 = require("../shared/constants");
|
|
6
|
-
const get_account_id_1 = require("../shared/get-account-id");
|
|
7
6
|
const make_s3_url_1 = require("../shared/make-s3-url");
|
|
8
7
|
const internalGetSites = async ({ region, forceBucketName, providerSpecifics, forcePathStyle, }) => {
|
|
9
8
|
var _a;
|
|
@@ -18,7 +17,7 @@ const internalGetSites = async ({ region, forceBucketName, providerSpecifics, fo
|
|
|
18
17
|
forceBucketName: null,
|
|
19
18
|
forcePathStyle,
|
|
20
19
|
});
|
|
21
|
-
const accountId = await
|
|
20
|
+
const accountId = await providerSpecifics.getAccountId({ region });
|
|
22
21
|
const sites = {};
|
|
23
22
|
for (const bucket of remotionBuckets) {
|
|
24
23
|
const ls = await providerSpecifics.listObjects({
|
|
@@ -2,8 +2,9 @@ import type { AudioCodec, ChromiumOptions, ColorSpace, FrameRange, LogLevel, Pix
|
|
|
2
2
|
import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
3
3
|
import type { DownloadBehavior, OutNameInput, Privacy, ServerlessCodec, ServerlessPayloads, ServerlessStartPayload, ServerlessStatusPayload, WebhookOption } from '@remotion/serverless/client';
|
|
4
4
|
import { ServerlessRoutines } from '@remotion/serverless/client';
|
|
5
|
-
import type {
|
|
5
|
+
import type { DeleteAfter } from '../client';
|
|
6
6
|
import type { AwsProvider } from '../functions/aws-implementation';
|
|
7
|
+
import type { AwsRegion } from '../regions';
|
|
7
8
|
import type { GetRenderProgressInput } from './get-render-progress';
|
|
8
9
|
import type { RenderStillOnLambdaNonNullInput } from './render-still-on-lambda';
|
|
9
10
|
export type InnerRenderMediaOnLambdaInput = {
|
|
@@ -6,27 +6,29 @@ const version_1 = require("remotion/version");
|
|
|
6
6
|
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
7
7
|
const client_2 = require("@remotion/serverless/client");
|
|
8
8
|
const no_react_1 = require("remotion/no-react");
|
|
9
|
-
const validate_download_behavior_1 = require("../shared/validate-download-behavior");
|
|
10
|
-
const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
|
|
11
9
|
const validate_lambda_codec_1 = require("../shared/validate-lambda-codec");
|
|
12
10
|
const validate_serveurl_1 = require("../shared/validate-serveurl");
|
|
13
11
|
const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, forcePathStyle, metadata, }) => {
|
|
14
12
|
const actualCodec = (0, validate_lambda_codec_1.validateLambdaCodec)(codec);
|
|
15
13
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
16
|
-
(0,
|
|
17
|
-
|
|
14
|
+
(0, client_1.validateFramesPerFunction)({
|
|
15
|
+
framesPerFunction: framesPerLambda !== null && framesPerLambda !== void 0 ? framesPerLambda : null,
|
|
18
16
|
durationInFrames: 1,
|
|
19
17
|
});
|
|
20
|
-
(0,
|
|
18
|
+
(0, client_1.validateDownloadBehavior)(downloadBehavior);
|
|
21
19
|
(0, client_2.validateWebhook)(webhook);
|
|
22
20
|
const stringifiedInputProps = (0, client_1.serializeOrThrow)(inputProps !== null && inputProps !== void 0 ? inputProps : {}, 'input-props');
|
|
23
21
|
const serialized = await (0, client_1.compressInputProps)({
|
|
24
22
|
stringifiedInputProps,
|
|
25
23
|
region,
|
|
26
|
-
needsToUpload: (0, client_1.getNeedsToUpload)(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
needsToUpload: (0, client_1.getNeedsToUpload)({
|
|
25
|
+
type: 'video-or-audio',
|
|
26
|
+
sizes: [
|
|
27
|
+
stringifiedInputProps.length,
|
|
28
|
+
JSON.stringify(envVariables).length,
|
|
29
|
+
],
|
|
30
|
+
providerSpecifics: aws_implementation_1.awsImplementation,
|
|
31
|
+
}),
|
|
30
32
|
userSpecifiedBucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
31
33
|
propsType: 'input-props',
|
|
32
34
|
providerSpecifics: aws_implementation_1.awsImplementation,
|
|
@@ -101,10 +103,14 @@ const makeLambdaRenderStillPayload = async ({ serveUrl, inputProps, imageFormat,
|
|
|
101
103
|
const serializedInputProps = await (0, client_1.compressInputProps)({
|
|
102
104
|
stringifiedInputProps,
|
|
103
105
|
region,
|
|
104
|
-
needsToUpload: (0, client_1.getNeedsToUpload)(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
needsToUpload: (0, client_1.getNeedsToUpload)({
|
|
107
|
+
type: 'still',
|
|
108
|
+
sizes: [
|
|
109
|
+
stringifiedInputProps.length,
|
|
110
|
+
JSON.stringify(envVariables).length,
|
|
111
|
+
],
|
|
112
|
+
providerSpecifics: aws_implementation_1.awsImplementation,
|
|
113
|
+
}),
|
|
108
114
|
userSpecifiedBucketName: forceBucketName !== null && forceBucketName !== void 0 ? forceBucketName : null,
|
|
109
115
|
propsType: 'input-props',
|
|
110
116
|
providerSpecifics: aws_implementation_1.awsImplementation,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pagesRouterWebhook = void 0;
|
|
4
|
+
const validate_webhook_signature_1 = require("./validate-webhook-signature");
|
|
5
|
+
const addHeaders = (res, headers) => {
|
|
6
|
+
Object.entries(headers).forEach(([key, value]) => {
|
|
7
|
+
res.setHeader(key, value);
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
const pagesRouterWebhook = (options) => {
|
|
11
|
+
const { testing, extraHeaders, secret, onSuccess, onTimeout, onError } = options;
|
|
12
|
+
return function (req, res) {
|
|
13
|
+
addHeaders(res, extraHeaders || {});
|
|
14
|
+
if (testing) {
|
|
15
|
+
const testingheaders = {
|
|
16
|
+
'Access-Control-Allow-Origin': 'https://www.remotion.dev',
|
|
17
|
+
'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',
|
|
18
|
+
'Access-Control-Allow-Methods': 'OPTIONS,POST',
|
|
19
|
+
};
|
|
20
|
+
addHeaders(res, testingheaders);
|
|
21
|
+
}
|
|
22
|
+
if (req.method === 'OPTIONS') {
|
|
23
|
+
res.status(200).end();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
(0, validate_webhook_signature_1.validateWebhookSignature)({
|
|
27
|
+
secret,
|
|
28
|
+
body: req.body,
|
|
29
|
+
signatureHeader: req.headers['x-remotion-signature'],
|
|
30
|
+
});
|
|
31
|
+
// If code reaches this path, the webhook is authentic.
|
|
32
|
+
const payload = req.body;
|
|
33
|
+
if (payload.type === 'success' && onSuccess) {
|
|
34
|
+
onSuccess(payload);
|
|
35
|
+
}
|
|
36
|
+
else if (payload.type === 'timeout' && onTimeout) {
|
|
37
|
+
onTimeout(payload);
|
|
38
|
+
}
|
|
39
|
+
else if (payload.type === 'error' && onError) {
|
|
40
|
+
onError(payload);
|
|
41
|
+
}
|
|
42
|
+
res.status(200).json({
|
|
43
|
+
success: true,
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
exports.pagesRouterWebhook = pagesRouterWebhook;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AudioCodec, ChromiumOptions, FrameRange, PixelFormat, ProResProfile, ToOptions, VideoImageFormat } from '@remotion/renderer';
|
|
2
2
|
import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
3
3
|
import type { DownloadBehavior, OutNameInput, Privacy, ServerlessCodec, WebhookOption } from '@remotion/serverless/client';
|
|
4
|
-
import type
|
|
4
|
+
import { type AwsProvider } from '../functions/aws-implementation';
|
|
5
5
|
import type { AwsRegion } from '../regions';
|
|
6
6
|
import type { InnerRenderMediaOnLambdaInput } from './make-lambda-payload';
|
|
7
7
|
export type RenderMediaOnLambdaInput = {
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.renderVideoOnLambda = exports.renderMediaOnLambda = exports.renderMediaOnLambdaOptionalToRequired = exports.internalRenderMediaOnLambdaRaw = void 0;
|
|
4
4
|
const error_handling_1 = require("@remotion/renderer/error-handling");
|
|
5
5
|
const client_1 = require("@remotion/serverless/client");
|
|
6
|
-
const
|
|
6
|
+
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
7
7
|
const get_aws_urls_1 = require("../shared/get-aws-urls");
|
|
8
8
|
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
9
9
|
const internalRenderMediaOnLambdaRaw = async (input) => {
|
|
10
10
|
var _a;
|
|
11
11
|
const { functionName, region, rendererFunctionName } = input;
|
|
12
12
|
try {
|
|
13
|
-
const res = await
|
|
13
|
+
const res = await aws_implementation_1.awsImplementation.callFunctionSync({
|
|
14
14
|
functionName,
|
|
15
15
|
type: client_1.ServerlessRoutines.start,
|
|
16
16
|
payload: await (0, make_lambda_payload_1.makeLambdaRenderMediaPayload)(input),
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { ChromiumOptions, StillImageFormat, ToOptions } from '@remotion/renderer';
|
|
2
2
|
import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
3
3
|
import type { DownloadBehavior } from '@remotion/serverless/client';
|
|
4
|
-
import type { ReceivedArtifact } from '@remotion/serverless';
|
|
4
|
+
import type { CostsInfo, ReceivedArtifact } from '@remotion/serverless';
|
|
5
5
|
import type { OutNameInput, Privacy } from '@remotion/serverless/client';
|
|
6
|
-
import type
|
|
6
|
+
import { type AwsProvider } from '../functions/aws-implementation';
|
|
7
7
|
import type { AwsRegion } from '../regions';
|
|
8
|
-
import type { CostsInfo } from '../shared/constants';
|
|
9
8
|
type MandatoryParameters = {
|
|
10
9
|
region: AwsRegion;
|
|
11
10
|
functionName: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderStillOnLambda = void 0;
|
|
4
4
|
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const call_lambda_1 = require("../shared/call-lambda");
|
|
6
5
|
const error_handling_1 = require("@remotion/renderer/error-handling");
|
|
6
|
+
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
7
7
|
const constants_1 = require("../shared/constants");
|
|
8
8
|
const get_aws_urls_1 = require("../shared/get-aws-urls");
|
|
9
9
|
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
@@ -13,7 +13,8 @@ const internalRenderStillOnLambda = async (input) => {
|
|
|
13
13
|
try {
|
|
14
14
|
const payload = await (0, make_lambda_payload_1.makeLambdaRenderStillPayload)(input);
|
|
15
15
|
const res = await new Promise((resolve, reject) => {
|
|
16
|
-
|
|
16
|
+
aws_implementation_1.awsImplementation
|
|
17
|
+
.callFunctionStreaming({
|
|
17
18
|
functionName,
|
|
18
19
|
type: client_1.ServerlessRoutines.still,
|
|
19
20
|
payload,
|