@remotion/lambda 4.0.186 → 4.0.188
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/__mocks__/clean-items.d.ts +2 -0
- package/dist/api/__mocks__/clean-items.js +24 -0
- package/dist/api/__mocks__/create-function.d.ts +2 -0
- package/dist/api/__mocks__/create-function.js +21 -0
- package/dist/api/__mocks__/delete-function.d.ts +2 -0
- package/dist/api/__mocks__/delete-function.js +9 -0
- package/dist/api/__mocks__/get-functions.d.ts +2 -0
- package/dist/api/__mocks__/get-functions.js +9 -0
- package/dist/api/__mocks__/upload-dir.d.ts +3 -0
- package/dist/api/__mocks__/upload-dir.js +47 -0
- package/dist/api/bucket-exists.d.ts +3 -6
- package/dist/api/bucket-exists.js +5 -5
- package/dist/api/clean-items.d.ts +4 -3
- package/dist/api/clean-items.js +7 -7
- package/dist/api/create-bucket.d.ts +3 -5
- package/dist/api/create-bucket.js +6 -6
- package/dist/api/create-function.d.ts +1 -1
- package/dist/api/delete-function.d.ts +1 -1
- package/dist/api/delete-render.d.ts +10 -3
- package/dist/api/delete-render.js +27 -19
- package/dist/api/delete-site.d.ts +7 -2
- package/dist/api/delete-site.js +23 -15
- package/dist/api/deploy-function.d.ts +1 -1
- package/dist/api/deploy-function.js +2 -2
- package/dist/api/deploy-site.d.ts +9 -5
- package/dist/api/deploy-site.js +11 -12
- package/dist/api/download-media.d.ts +8 -3
- package/dist/api/download-media.js +24 -15
- package/dist/api/estimate-price.d.ts +1 -1
- package/dist/api/get-aws-client.d.ts +4 -2
- package/dist/api/get-aws-client.js +2 -2
- package/dist/api/get-buckets.d.ts +4 -4
- package/dist/api/get-buckets.js +12 -14
- package/dist/api/get-compositions-on-lambda.js +7 -6
- package/dist/api/get-function-info.d.ts +1 -1
- package/dist/api/get-functions.d.ts +1 -1
- package/dist/api/get-or-create-bucket.d.ts +3 -19
- package/dist/api/get-or-create-bucket.js +5 -39
- package/dist/api/get-regions.d.ts +1 -1
- package/dist/api/get-regions.js +1 -2
- package/dist/api/get-render-progress.d.ts +4 -3
- package/dist/api/get-render-progress.js +2 -2
- package/dist/api/get-sites.d.ts +6 -1
- package/dist/api/get-sites.js +21 -14
- package/dist/api/iam-validation/role-permissions.js +2 -1
- package/dist/api/iam-validation/simulate-rule.d.ts +1 -1
- package/dist/api/iam-validation/simulate.d.ts +1 -1
- package/dist/api/iam-validation/user-permissions.js +2 -1
- package/dist/api/make-lambda-payload.d.ts +8 -9
- package/dist/api/make-lambda-payload.js +15 -13
- package/dist/api/mock-functions.d.ts +1 -1
- package/dist/api/presign-url.d.ts +1 -1
- package/dist/api/presign-url.js +4 -4
- package/dist/api/render-media-on-lambda.d.ts +5 -6
- package/dist/api/render-media-on-lambda.js +5 -5
- package/dist/api/render-still-on-lambda.d.ts +8 -6
- package/dist/api/render-still-on-lambda.js +6 -5
- package/dist/api/upload-dir.d.ts +2 -2
- package/dist/api/upload-dir.js +2 -2
- package/dist/cli/args.d.ts +2 -3
- package/dist/cli/commands/render/progress.d.ts +2 -2
- package/dist/cli/commands/render/progress.js +6 -5
- package/dist/cli/commands/render/render.d.ts +3 -1
- package/dist/cli/commands/render/render.js +3 -2
- package/dist/cli/commands/sites/create.d.ts +3 -1
- package/dist/cli/commands/sites/create.js +6 -5
- package/dist/cli/commands/sites/index.d.ts +3 -1
- package/dist/cli/commands/sites/index.js +4 -4
- package/dist/cli/commands/sites/rm.d.ts +3 -1
- package/dist/cli/commands/sites/rm.js +4 -3
- package/dist/cli/commands/sites/rmall.d.ts +3 -1
- package/dist/cli/commands/sites/rmall.js +4 -3
- package/dist/cli/commands/still.d.ts +3 -1
- package/dist/cli/commands/still.js +3 -2
- package/dist/cli/get-aws-region.d.ts +1 -1
- package/dist/cli/helpers/__mocks__/quit.d.ts +1 -0
- package/dist/cli/helpers/__mocks__/quit.js +7 -0
- package/dist/cli/index.d.ts +3 -1
- package/dist/cli/index.js +8 -7
- package/dist/client.d.ts +4 -5
- package/dist/functions/aws-implementation.d.ts +11 -0
- package/dist/functions/aws-implementation.js +49 -0
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +4 -1
- package/dist/functions/compositions.d.ts +3 -2
- package/dist/functions/compositions.js +18 -15
- package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +3 -0
- package/dist/functions/helpers/__mocks__/get-browser-instance.js +12 -0
- package/dist/functions/helpers/__mocks__/leak-detection.d.ts +4 -0
- package/dist/functions/helpers/__mocks__/leak-detection.js +9 -0
- package/dist/functions/helpers/__mocks__/timer.d.ts +2 -0
- package/dist/functions/helpers/__mocks__/timer.js +10 -0
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +5 -3
- package/dist/functions/helpers/calculate-price-from-bucket.js +2 -3
- package/dist/functions/helpers/cleanup-props.d.ts +4 -2
- package/dist/functions/helpers/cleanup-props.js +5 -4
- package/dist/functions/helpers/concat-videos.d.ts +2 -2
- package/dist/functions/helpers/create-post-render-data.d.ts +8 -8
- package/dist/functions/helpers/create-post-render-data.js +1 -1
- package/dist/functions/helpers/expected-out-name.d.ts +4 -4
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +8 -7
- package/dist/functions/helpers/find-output-file-in-bucket.js +5 -6
- package/dist/functions/helpers/get-browser-instance.d.ts +3 -2
- package/dist/functions/helpers/get-browser-instance.js +3 -4
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/get-current-region.js +3 -3
- package/dist/functions/helpers/get-custom-out-name.d.ts +5 -5
- package/dist/functions/helpers/get-folder-files.d.ts +2 -0
- package/dist/functions/helpers/get-folder-files.js +38 -0
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +4 -3
- package/dist/functions/helpers/get-output-url-from-metadata.js +4 -5
- package/dist/functions/helpers/get-overall-progress-s3.d.ts +5 -4
- package/dist/functions/helpers/get-overall-progress-s3.js +5 -7
- package/dist/functions/helpers/get-progress.d.ts +8 -7
- package/dist/functions/helpers/get-progress.js +7 -5
- package/dist/functions/helpers/inspect-errors.d.ts +1 -1
- package/dist/functions/helpers/inspect-errors.js +4 -4
- package/dist/functions/helpers/io.d.ts +3 -36
- package/dist/functions/helpers/io.js +3 -104
- package/dist/functions/helpers/lifecycle.d.ts +3 -9
- package/dist/functions/helpers/lifecycle.js +6 -16
- package/dist/functions/helpers/make-aws-artifact.d.ts +3 -0
- package/dist/functions/helpers/make-aws-artifact.js +12 -0
- package/dist/functions/helpers/make-timeout-error.d.ts +5 -4
- package/dist/functions/helpers/make-timeout-error.js +2 -1
- package/dist/functions/helpers/make-timeout-message.d.ts +5 -3
- package/dist/functions/helpers/make-timeout-message.js +8 -9
- package/dist/functions/helpers/merge-chunks.d.ts +10 -10
- package/dist/functions/helpers/merge-chunks.js +7 -8
- package/dist/functions/helpers/overall-render-progress.d.ts +18 -23
- package/dist/functions/helpers/overall-render-progress.js +5 -5
- package/dist/functions/helpers/print-cloudwatch-helper.d.ts +2 -2
- package/dist/functions/helpers/print-logging-helper.d.ts +4 -0
- package/dist/functions/helpers/print-logging-helper.js +12 -0
- package/dist/functions/helpers/read-with-progress.d.ts +4 -3
- package/dist/functions/helpers/read-with-progress.js +2 -2
- package/dist/functions/helpers/render-has-audio-video.d.ts +3 -2
- package/dist/functions/helpers/stream-renderer.d.ts +7 -4
- package/dist/functions/helpers/stream-renderer.js +11 -10
- package/dist/functions/helpers/streamify-response.d.ts +0 -20
- package/dist/functions/helpers/streamify-response.js +1 -62
- package/dist/functions/helpers/validate-composition.d.ts +5 -3
- package/dist/functions/helpers/validate-composition.js +2 -3
- package/dist/functions/index.d.ts +5 -3
- package/dist/functions/index.js +98 -72
- package/dist/functions/info.d.ts +1 -1
- package/dist/functions/info.js +2 -2
- package/dist/functions/launch.d.ts +3 -2
- package/dist/functions/launch.js +54 -41
- package/dist/functions/progress.d.ts +6 -3
- package/dist/functions/progress.js +5 -4
- package/dist/functions/provider-implementation.d.ts +0 -0
- package/dist/functions/provider-implementation.js +1 -0
- package/dist/functions/renderer.d.ts +9 -3
- package/dist/functions/renderer.js +30 -22
- package/dist/functions/start.d.ts +3 -2
- package/dist/functions/start.js +13 -16
- package/dist/functions/still.d.ts +8 -18
- package/dist/functions/still.js +47 -46
- package/dist/index.d.ts +4 -6
- package/dist/internals.d.ts +15 -13
- package/dist/io/delete-file.d.ts +3 -0
- package/dist/io/delete-file.js +12 -0
- package/dist/io/head-file.d.ts +3 -0
- package/dist/io/head-file.js +13 -0
- package/dist/io/list-objects.d.ts +3 -0
- package/dist/io/list-objects.js +58 -0
- package/dist/io/read-file.d.ts +9 -0
- package/dist/io/read-file.js +14 -0
- package/dist/io/write-file.d.ts +5 -0
- package/dist/io/write-file.js +51 -0
- package/dist/pricing/aws-regions.d.ts +0 -3
- package/dist/pricing/aws-regions.js +0 -44
- package/dist/pricing/price-per-1-s.d.ts +1 -1
- package/dist/regions.d.ts +3 -2
- package/dist/regions.js +43 -3
- package/dist/shared/__mocks__/aws-clients.d.ts +2 -0
- package/dist/shared/__mocks__/aws-clients.js +62 -0
- package/dist/shared/__mocks__/bundle-site.d.ts +2 -0
- package/dist/shared/__mocks__/bundle-site.js +32 -0
- package/dist/shared/__mocks__/check-credentials.d.ts +1 -0
- package/dist/shared/__mocks__/check-credentials.js +5 -0
- package/dist/shared/__mocks__/get-account-id.d.ts +2 -0
- package/dist/shared/__mocks__/get-account-id.js +11 -0
- package/dist/shared/__mocks__/read-dir.d.ts +2 -0
- package/dist/shared/__mocks__/read-dir.js +13 -0
- package/dist/shared/aws-clients.d.ts +6 -29
- package/dist/shared/aws-clients.js +7 -177
- package/dist/shared/call-lambda.d.ts +8 -9
- package/dist/shared/call-lambda.js +16 -3
- package/dist/shared/check-credentials.js +2 -2
- package/dist/shared/cleanup-serialized-input-props.d.ts +8 -6
- package/dist/shared/cleanup-serialized-input-props.js +7 -8
- package/dist/shared/compress-props.d.ts +8 -6
- package/dist/shared/compress-props.js +11 -14
- package/dist/shared/constants.d.ts +10 -288
- package/dist/shared/constants.js +1 -46
- package/dist/shared/content-disposition-header.d.ts +1 -6
- package/dist/shared/content-disposition-header.js +2 -2
- package/dist/shared/convert-to-serve-url.d.ts +2 -2
- package/dist/shared/convert-to-serve-url.js +3 -3
- package/dist/shared/get-account-id.d.ts +1 -1
- package/dist/shared/get-aws-urls.d.ts +2 -2
- package/dist/shared/get-credentials.d.ts +9 -0
- package/dist/shared/get-credentials.js +53 -0
- package/dist/shared/get-function-version.d.ts +1 -1
- package/dist/shared/get-function-version.js +2 -1
- package/dist/shared/get-s3-client.d.ts +5 -0
- package/dist/shared/get-s3-client.js +13 -0
- package/dist/shared/get-service-client.d.ts +22 -0
- package/dist/shared/get-service-client.js +117 -0
- package/dist/shared/hosted-layers.d.ts +1 -1
- package/dist/shared/invoke-webhook.d.ts +1 -1
- package/dist/shared/lambda-insights-extensions.d.ts +1 -1
- package/dist/shared/lifecycle-rules.d.ts +4 -3
- package/dist/shared/lifecycle-rules.js +3 -3
- package/dist/shared/make-s3-url.d.ts +1 -1
- package/dist/shared/random-hash.d.ts +1 -3
- package/dist/shared/random-hash.js +3 -4
- package/dist/shared/return-values.d.ts +10 -11
- package/dist/shared/validate-aws-region.d.ts +1 -1
- package/dist/shared/validate-aws-region.js +3 -3
- package/dist/shared/validate-bucketname.d.ts +0 -4
- package/dist/shared/validate-bucketname.js +3 -23
- package/dist/shared/validate-lambda-codec.d.ts +2 -4
- package/dist/shared/validate-lambda-codec.js +3 -13
- package/dist/shared/validate-outname.js +2 -2
- package/dist/shared/validate-privacy.d.ts +1 -1
- package/dist/shared/validate-webhook.d.ts +1 -1
- package/package.json +11 -9
- package/remotionlambda-arm64.zip +0 -0
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type { OnMessage } from '
|
|
2
|
-
import type {
|
|
3
|
-
import type { LambdaPayloads, LambdaRoutines } from './constants';
|
|
1
|
+
import type { CloudProvider, OnMessage } from '@remotion/serverless';
|
|
2
|
+
import type { ServerlessPayloads, ServerlessRoutines } from '@remotion/serverless/client';
|
|
4
3
|
import type { LambdaReturnValues } from './return-values';
|
|
5
|
-
type Options<T extends
|
|
4
|
+
type Options<T extends ServerlessRoutines, Provider extends CloudProvider> = {
|
|
6
5
|
functionName: string;
|
|
7
6
|
type: T;
|
|
8
|
-
payload: Omit<
|
|
9
|
-
region:
|
|
7
|
+
payload: Omit<ServerlessPayloads<Provider>[T], 'type'>;
|
|
8
|
+
region: Provider['region'];
|
|
10
9
|
timeoutInTest: number;
|
|
11
10
|
};
|
|
12
|
-
export declare const callLambda: <T extends
|
|
13
|
-
export declare const callLambdaWithStreaming: <T extends
|
|
14
|
-
receivedStreamingPayload: OnMessage
|
|
11
|
+
export declare const callLambda: <Provider extends CloudProvider<string, Record<string, unknown>>, T extends ServerlessRoutines>(options: Options<T, Provider>) => Promise<LambdaReturnValues<Provider>[T]>;
|
|
12
|
+
export declare const callLambdaWithStreaming: <Provider extends CloudProvider<string, Record<string, unknown>>, T extends ServerlessRoutines>(options: Options<T, Provider> & {
|
|
13
|
+
receivedStreamingPayload: OnMessage<Provider>;
|
|
15
14
|
retriesRemaining: number;
|
|
16
15
|
}) => Promise<void>;
|
|
17
16
|
export {};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.callLambdaWithStreaming = exports.callLambda = void 0;
|
|
4
4
|
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
+
const client_1 = require("@remotion/serverless/client");
|
|
5
6
|
const streaming_1 = require("@remotion/streaming");
|
|
6
|
-
const streaming_2 = require("../functions/streaming/streaming");
|
|
7
7
|
const aws_clients_1 = require("./aws-clients");
|
|
8
8
|
const INVALID_JSON_MESSAGE = 'Cannot parse Lambda response as JSON';
|
|
9
9
|
const parseJsonOrThrowSource = (data, type) => {
|
|
@@ -95,8 +95,8 @@ const callLambdaWithStreamingWithoutRetry = async ({ functionName, type, payload
|
|
|
95
95
|
type,
|
|
96
96
|
});
|
|
97
97
|
const { onData, clear } = (0, streaming_1.makeStreamer)((status, messageTypeId, data) => {
|
|
98
|
-
const messageType = (0,
|
|
99
|
-
const innerPayload =
|
|
98
|
+
const messageType = (0, client_1.messageTypeIdToMessageType)(messageTypeId);
|
|
99
|
+
const innerPayload = client_1.formatMap[messageType] === 'json'
|
|
100
100
|
? parseJsonOrThrowSource(data, messageType)
|
|
101
101
|
: data;
|
|
102
102
|
const message = {
|
|
@@ -108,6 +108,14 @@ const callLambdaWithStreamingWithoutRetry = async ({ functionName, type, payload
|
|
|
108
108
|
};
|
|
109
109
|
receivedStreamingPayload(message);
|
|
110
110
|
});
|
|
111
|
+
const dumpBuffers = () => {
|
|
112
|
+
clear();
|
|
113
|
+
};
|
|
114
|
+
// @ts-expect-error - We are adding a listener to a global variable
|
|
115
|
+
if (globalThis._dumpUnreleasedBuffers) {
|
|
116
|
+
// @ts-expect-error - We are adding a listener to a global variable
|
|
117
|
+
globalThis._dumpUnreleasedBuffers.addListener('dump-unreleased-buffers', dumpBuffers);
|
|
118
|
+
}
|
|
111
119
|
const events = res.EventStream;
|
|
112
120
|
for await (const event of events) {
|
|
113
121
|
// There are two types of events you can get on a stream.
|
|
@@ -127,5 +135,10 @@ const callLambdaWithStreamingWithoutRetry = async ({ functionName, type, payload
|
|
|
127
135
|
}
|
|
128
136
|
// Don't put a `break` statement here, as it will cause the socket to not properly exit.
|
|
129
137
|
}
|
|
138
|
+
// @ts-expect-error - We are adding a listener to a global variable
|
|
139
|
+
if (globalThis._dumpUnreleasedBuffers) {
|
|
140
|
+
// @ts-expect-error - We are adding a listener to a global variable
|
|
141
|
+
globalThis._dumpUnreleasedBuffers.removeListener('dump-unreleased-buffers', dumpBuffers);
|
|
142
|
+
}
|
|
130
143
|
clear();
|
|
131
144
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkCredentials = void 0;
|
|
4
|
+
const client_1 = require("@remotion/serverless/client");
|
|
4
5
|
const is_cli_1 = require("../cli/is-cli");
|
|
5
6
|
const docs_url_1 = require("./docs-url");
|
|
6
7
|
const is_likely_to_have_aws_profile_1 = require("./is-likely-to-have-aws-profile");
|
|
7
|
-
const truthy_1 = require("./truthy");
|
|
8
8
|
const messageForVariable = (variable) => {
|
|
9
9
|
return [
|
|
10
10
|
`You have tried to call a Remotion Lambda function, but have not set the environment variable ${variable}.`,
|
|
@@ -14,7 +14,7 @@ const messageForVariable = (variable) => {
|
|
|
14
14
|
`- Please refer to the Remotion Lambda docs (${docs_url_1.DOCS_URL}/docs/lambda/setup) to see how to generate the credentials for your AWS account and then set the environment variables.`,
|
|
15
15
|
`- For more reasons see the troubleshooting page: ${docs_url_1.DOCS_URL}/docs/lambda/troubleshooting/permissions`,
|
|
16
16
|
]
|
|
17
|
-
.filter(
|
|
17
|
+
.filter(client_1.truthy)
|
|
18
18
|
.join('\n');
|
|
19
19
|
};
|
|
20
20
|
const checkCredentials = () => {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
3
|
-
export declare const cleanupSerializedInputProps: ({ serialized, region, }: {
|
|
1
|
+
import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
+
import { type SerializedInputProps } from '@remotion/serverless/client';
|
|
3
|
+
export declare const cleanupSerializedInputProps: <Provider extends CloudProvider<string, Record<string, unknown>>>({ serialized, region, providerSpecifics, }: {
|
|
4
4
|
serialized: SerializedInputProps;
|
|
5
|
-
region:
|
|
5
|
+
region: Provider["region"];
|
|
6
|
+
providerSpecifics: ProviderSpecifics<Provider>;
|
|
6
7
|
}) => Promise<number>;
|
|
7
|
-
export declare const cleanupSerializedResolvedProps: ({ serialized, region, }: {
|
|
8
|
+
export declare const cleanupSerializedResolvedProps: <Provider extends CloudProvider<string, Record<string, unknown>>>({ serialized, region, providerSpecifics, }: {
|
|
8
9
|
serialized: SerializedInputProps;
|
|
9
|
-
region:
|
|
10
|
+
region: Provider["region"];
|
|
11
|
+
providerSpecifics: ProviderSpecifics<Provider>;
|
|
10
12
|
}) => Promise<number>;
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cleanupSerializedResolvedProps = exports.cleanupSerializedInputProps = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const cleanupSerializedInputProps = async ({ serialized, region, }) => {
|
|
4
|
+
const client_1 = require("@remotion/serverless/client");
|
|
5
|
+
const cleanupSerializedInputProps = async ({ serialized, region, providerSpecifics, }) => {
|
|
7
6
|
if (serialized.type === 'payload') {
|
|
8
7
|
return 0;
|
|
9
8
|
}
|
|
10
9
|
const time = Date.now();
|
|
11
|
-
await
|
|
10
|
+
await providerSpecifics.deleteFile({
|
|
12
11
|
bucketName: serialized.bucketName,
|
|
13
|
-
key: (0,
|
|
12
|
+
key: (0, client_1.inputPropsKey)(serialized.hash),
|
|
14
13
|
region,
|
|
15
14
|
customCredentials: null,
|
|
16
15
|
});
|
|
17
16
|
return Date.now() - time;
|
|
18
17
|
};
|
|
19
18
|
exports.cleanupSerializedInputProps = cleanupSerializedInputProps;
|
|
20
|
-
const cleanupSerializedResolvedProps = async ({ serialized, region, }) => {
|
|
19
|
+
const cleanupSerializedResolvedProps = async ({ serialized, region, providerSpecifics, }) => {
|
|
21
20
|
if (serialized.type === 'payload') {
|
|
22
21
|
return 0;
|
|
23
22
|
}
|
|
24
23
|
const time = Date.now();
|
|
25
|
-
await
|
|
24
|
+
await providerSpecifics.deleteFile({
|
|
26
25
|
bucketName: serialized.bucketName,
|
|
27
|
-
key: (0,
|
|
26
|
+
key: (0, client_1.resolvedPropsKey)(serialized.hash),
|
|
28
27
|
region,
|
|
29
28
|
customCredentials: null,
|
|
30
29
|
});
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
1
|
+
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
+
import { type SerializedInputProps } from '@remotion/serverless/client';
|
|
3
3
|
type PropsType = 'input-props' | 'resolved-props';
|
|
4
4
|
export declare const serializeOrThrow: (inputProps: Record<string, unknown>, propsType: PropsType) => string;
|
|
5
5
|
export declare const getNeedsToUpload: (type: 'still' | 'video-or-audio', sizes: number[]) => boolean;
|
|
6
|
-
export declare const compressInputProps: ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, }: {
|
|
6
|
+
export declare const compressInputProps: <Region extends string>({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, providerSpecifics, }: {
|
|
7
7
|
stringifiedInputProps: string;
|
|
8
|
-
region:
|
|
8
|
+
region: Region;
|
|
9
9
|
userSpecifiedBucketName: string | null;
|
|
10
10
|
propsType: PropsType;
|
|
11
11
|
needsToUpload: boolean;
|
|
12
|
+
providerSpecifics: ProviderSpecifics<Region>;
|
|
12
13
|
}) => Promise<SerializedInputProps>;
|
|
13
|
-
export declare const decompressInputProps: ({ serialized, region, bucketName, expectedBucketOwner, propsType, }: {
|
|
14
|
+
export declare const decompressInputProps: <Region extends string>({ serialized, region, bucketName, expectedBucketOwner, propsType, providerSpecifics, }: {
|
|
14
15
|
serialized: SerializedInputProps;
|
|
15
|
-
region:
|
|
16
|
+
region: Region;
|
|
16
17
|
bucketName: string;
|
|
17
18
|
expectedBucketOwner: string;
|
|
18
19
|
propsType: PropsType;
|
|
20
|
+
providerSpecifics: ProviderSpecifics<Region>;
|
|
19
21
|
}) => Promise<string>;
|
|
20
22
|
export {};
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.decompressInputProps = exports.compressInputProps = exports.getNeedsToUpload = exports.serializeOrThrow = void 0;
|
|
4
|
+
const client_1 = require("@remotion/serverless/client");
|
|
4
5
|
const no_react_1 = require("remotion/no-react");
|
|
5
|
-
const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
|
|
6
|
-
const io_1 = require("../functions/helpers/io");
|
|
7
|
-
const constants_1 = require("./constants");
|
|
8
|
-
const random_hash_1 = require("./random-hash");
|
|
9
|
-
const stream_to_string_1 = require("./stream-to-string");
|
|
10
6
|
const validate_webhook_1 = require("./validate-webhook");
|
|
11
7
|
const makeKey = (type, hash) => {
|
|
12
8
|
if (type === 'input-props') {
|
|
13
|
-
return (0,
|
|
9
|
+
return (0, client_1.inputPropsKey)(hash);
|
|
14
10
|
}
|
|
15
|
-
return (0,
|
|
11
|
+
return (0, client_1.resolvedPropsKey)(hash);
|
|
16
12
|
};
|
|
17
13
|
const serializeOrThrow = (inputProps, propsType) => {
|
|
18
14
|
try {
|
|
@@ -39,15 +35,16 @@ const getNeedsToUpload = (type, sizes) => {
|
|
|
39
35
|
return false;
|
|
40
36
|
};
|
|
41
37
|
exports.getNeedsToUpload = getNeedsToUpload;
|
|
42
|
-
const compressInputProps = async ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, }) => {
|
|
43
|
-
const hash =
|
|
38
|
+
const compressInputProps = async ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, providerSpecifics, }) => {
|
|
39
|
+
const hash = providerSpecifics.randomHash();
|
|
44
40
|
if (needsToUpload) {
|
|
45
|
-
const bucketName = userSpecifiedBucketName !== null && userSpecifiedBucketName !== void 0 ? userSpecifiedBucketName : (await (0,
|
|
41
|
+
const bucketName = userSpecifiedBucketName !== null && userSpecifiedBucketName !== void 0 ? userSpecifiedBucketName : (await (0, client_1.internalGetOrCreateBucket)({
|
|
46
42
|
region,
|
|
47
43
|
enableFolderExpiry: null,
|
|
48
44
|
customCredentials: null,
|
|
45
|
+
providerSpecifics,
|
|
49
46
|
})).bucketName;
|
|
50
|
-
await
|
|
47
|
+
await providerSpecifics.writeFile({
|
|
51
48
|
body: stringifiedInputProps,
|
|
52
49
|
bucketName,
|
|
53
50
|
region,
|
|
@@ -69,18 +66,18 @@ const compressInputProps = async ({ stringifiedInputProps, region, userSpecified
|
|
|
69
66
|
};
|
|
70
67
|
};
|
|
71
68
|
exports.compressInputProps = compressInputProps;
|
|
72
|
-
const decompressInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, propsType, }) => {
|
|
69
|
+
const decompressInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, propsType, providerSpecifics, }) => {
|
|
73
70
|
if (serialized.type === 'payload') {
|
|
74
71
|
return serialized.payload;
|
|
75
72
|
}
|
|
76
73
|
try {
|
|
77
|
-
const response = await
|
|
74
|
+
const response = await providerSpecifics.readFile({
|
|
78
75
|
bucketName,
|
|
79
76
|
expectedBucketOwner,
|
|
80
77
|
key: makeKey(propsType, serialized.hash),
|
|
81
78
|
region,
|
|
82
79
|
});
|
|
83
|
-
const body = await (0,
|
|
80
|
+
const body = await (0, client_1.streamToString)(response);
|
|
84
81
|
const payload = body;
|
|
85
82
|
return payload;
|
|
86
83
|
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
1
|
+
import type { CloudProvider, EnhancedErrorInfo, ReceivedArtifact } from '@remotion/serverless';
|
|
2
|
+
import { type DeleteAfter, type Privacy, type RenderMetadata } from '@remotion/serverless/client';
|
|
3
|
+
import type { AwsProvider } from '../functions/aws-implementation';
|
|
3
4
|
import type { ChunkRetry } from '../functions/helpers/get-retry-stats';
|
|
4
|
-
import type {
|
|
5
|
-
import type { ReceivedArtifact } from '../functions/helpers/overall-render-progress';
|
|
6
|
-
import type { EnhancedErrorInfo } from '../functions/helpers/write-lambda-error';
|
|
7
|
-
import type { AwsRegion } from '../pricing/aws-regions';
|
|
8
|
-
import type { CustomCredentials, CustomCredentialsWithoutSensitiveData } from './aws-clients';
|
|
9
|
-
import type { DownloadBehavior } from './content-disposition-header';
|
|
5
|
+
import type { AwsRegion } from '../regions';
|
|
10
6
|
import type { ExpensiveChunk } from './get-most-expensive-chunks';
|
|
11
|
-
import type { LambdaCodec } from './validate-lambda-codec';
|
|
12
7
|
export declare const MIN_MEMORY = 512;
|
|
13
8
|
export declare const MAX_MEMORY = 10240;
|
|
14
9
|
export declare const DEFAULT_MEMORY_SIZE = 2048;
|
|
@@ -27,294 +22,21 @@ export declare const MIN_EPHEMERAL_STORAGE_IN_MB = 512;
|
|
|
27
22
|
export declare const MAX_EPHEMERAL_STORAGE_IN_MB = 10240;
|
|
28
23
|
export declare const DEFAULT_OUTPUT_PRIVACY: Privacy;
|
|
29
24
|
export declare const DEFAULT_CLOUDWATCH_RETENTION_PERIOD = 14;
|
|
30
|
-
export declare const REMOTION_BUCKET_PREFIX = "remotionlambda-";
|
|
31
25
|
export declare const RENDER_FN_PREFIX = "remotion-render-";
|
|
32
26
|
export declare const LOG_GROUP_PREFIX = "/aws/lambda/";
|
|
33
27
|
export declare const LAMBDA_INSIGHTS_PREFIX = "/aws/lambda-insights";
|
|
34
|
-
export declare const rendersPrefix: (renderId: string) => string;
|
|
35
|
-
export declare const overallProgressKey: (renderId: string) => string;
|
|
36
|
-
export type OutNameInput = string | {
|
|
37
|
-
bucketName: string;
|
|
38
|
-
key: string;
|
|
39
|
-
s3OutputProvider?: CustomCredentials;
|
|
40
|
-
};
|
|
41
|
-
export type OutNameInputWithoutCredentials = string | {
|
|
42
|
-
bucketName: string;
|
|
43
|
-
key: string;
|
|
44
|
-
s3OutputProvider?: CustomCredentialsWithoutSensitiveData;
|
|
45
|
-
};
|
|
46
|
-
export type OutNameOutput = {
|
|
47
|
-
renderBucketName: string;
|
|
48
|
-
key: string;
|
|
49
|
-
customCredentials: CustomCredentials | null;
|
|
50
|
-
};
|
|
51
28
|
export declare const getSitesKey: (siteId: string) => string;
|
|
52
|
-
export declare const outName: (renderId: string, extension: string) => string;
|
|
53
|
-
export declare const outStillName: (renderId: string, imageFormat: StillImageFormat) => string;
|
|
54
|
-
export declare const artifactName: (renderId: string, name: string) => string;
|
|
55
|
-
export declare const customOutName: (renderId: string, bucketName: string, name: OutNameInput) => OutNameOutput;
|
|
56
|
-
export declare const inputPropsKey: (hash: string) => string;
|
|
57
|
-
export declare const resolvedPropsKey: (hash: string) => string;
|
|
58
29
|
export declare const RENDERER_PATH_TOKEN = "remotion-bucket";
|
|
59
30
|
export declare const CONCAT_FOLDER_TOKEN = "remotion-concat";
|
|
60
31
|
export declare const REMOTION_CONCATED_TOKEN = "remotion-concated-token";
|
|
61
32
|
export declare const REMOTION_FILELIST_TOKEN = "remotion-filelist";
|
|
62
|
-
export declare enum LambdaRoutines {
|
|
63
|
-
info = "info",
|
|
64
|
-
start = "start",
|
|
65
|
-
launch = "launch",
|
|
66
|
-
status = "status",
|
|
67
|
-
renderer = "renderer",
|
|
68
|
-
still = "still",
|
|
69
|
-
compositions = "compositions"
|
|
70
|
-
}
|
|
71
|
-
type Prettify<T> = {
|
|
72
|
-
[K in keyof T]: T[K];
|
|
73
|
-
} & {};
|
|
74
|
-
export type WebhookOption = Prettify<null | ({
|
|
75
|
-
url: string;
|
|
76
|
-
secret: string | null;
|
|
77
|
-
} & Partial<ToOptions<{
|
|
78
|
-
customData: typeof BrowserSafeApis.options.webhookCustomDataOption;
|
|
79
|
-
}>>)>;
|
|
80
|
-
export type SerializedInputProps = {
|
|
81
|
-
type: 'bucket-url';
|
|
82
|
-
hash: string;
|
|
83
|
-
bucketName: string;
|
|
84
|
-
} | {
|
|
85
|
-
type: 'payload';
|
|
86
|
-
payload: string;
|
|
87
|
-
};
|
|
88
|
-
export type LambdaStartPayload = {
|
|
89
|
-
rendererFunctionName: string | null;
|
|
90
|
-
type: LambdaRoutines.start;
|
|
91
|
-
serveUrl: string;
|
|
92
|
-
composition: string;
|
|
93
|
-
framesPerLambda: number | null;
|
|
94
|
-
inputProps: SerializedInputProps;
|
|
95
|
-
codec: LambdaCodec;
|
|
96
|
-
audioCodec: AudioCodec | null;
|
|
97
|
-
imageFormat: VideoImageFormat;
|
|
98
|
-
crf: number | undefined;
|
|
99
|
-
envVariables: Record<string, string> | undefined;
|
|
100
|
-
pixelFormat: PixelFormat | undefined;
|
|
101
|
-
proResProfile: ProResProfile | undefined;
|
|
102
|
-
x264Preset: X264Preset | null;
|
|
103
|
-
jpegQuality: number | undefined;
|
|
104
|
-
maxRetries: number;
|
|
105
|
-
privacy: Privacy;
|
|
106
|
-
logLevel: LogLevel;
|
|
107
|
-
frameRange: FrameRange | null;
|
|
108
|
-
outName: OutNameInput | null;
|
|
109
|
-
timeoutInMilliseconds: number;
|
|
110
|
-
chromiumOptions: ChromiumOptions;
|
|
111
|
-
scale: number;
|
|
112
|
-
everyNthFrame: number;
|
|
113
|
-
numberOfGifLoops: number | null;
|
|
114
|
-
concurrencyPerLambda: number;
|
|
115
|
-
downloadBehavior: DownloadBehavior;
|
|
116
|
-
muted: boolean;
|
|
117
|
-
version: string;
|
|
118
|
-
overwrite: boolean;
|
|
119
|
-
audioBitrate: string | null;
|
|
120
|
-
videoBitrate: string | null;
|
|
121
|
-
encodingMaxRate: string | null;
|
|
122
|
-
encodingBufferSize: string | null;
|
|
123
|
-
webhook: WebhookOption;
|
|
124
|
-
forceHeight: number | null;
|
|
125
|
-
forceWidth: number | null;
|
|
126
|
-
bucketName: string | null;
|
|
127
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
128
|
-
deleteAfter: DeleteAfter | null;
|
|
129
|
-
colorSpace: ColorSpace | null;
|
|
130
|
-
preferLossless: boolean;
|
|
131
|
-
};
|
|
132
|
-
export type LambdaStatusPayload = {
|
|
133
|
-
type: LambdaRoutines.status;
|
|
134
|
-
bucketName: string;
|
|
135
|
-
renderId: string;
|
|
136
|
-
version: string;
|
|
137
|
-
logLevel: LogLevel;
|
|
138
|
-
s3OutputProvider?: CustomCredentials;
|
|
139
|
-
};
|
|
140
|
-
export type LambdaPayloads = {
|
|
141
|
-
info: {
|
|
142
|
-
type: LambdaRoutines.info;
|
|
143
|
-
logLevel: LogLevel;
|
|
144
|
-
};
|
|
145
|
-
start: LambdaStartPayload;
|
|
146
|
-
launch: {
|
|
147
|
-
rendererFunctionName: string | null;
|
|
148
|
-
type: LambdaRoutines.launch;
|
|
149
|
-
serveUrl: string;
|
|
150
|
-
composition: string;
|
|
151
|
-
framesPerLambda: number | null;
|
|
152
|
-
bucketName: string;
|
|
153
|
-
inputProps: SerializedInputProps;
|
|
154
|
-
renderId: string;
|
|
155
|
-
imageFormat: VideoImageFormat;
|
|
156
|
-
codec: LambdaCodec;
|
|
157
|
-
audioCodec: AudioCodec | null;
|
|
158
|
-
crf: number | undefined;
|
|
159
|
-
envVariables: Record<string, string> | undefined;
|
|
160
|
-
pixelFormat: PixelFormat | undefined;
|
|
161
|
-
proResProfile: ProResProfile | undefined;
|
|
162
|
-
x264Preset: X264Preset | null;
|
|
163
|
-
jpegQuality: number | undefined;
|
|
164
|
-
maxRetries: number;
|
|
165
|
-
privacy: Privacy;
|
|
166
|
-
logLevel: LogLevel;
|
|
167
|
-
frameRange: FrameRange | null;
|
|
168
|
-
outName: OutNameInput | null;
|
|
169
|
-
timeoutInMilliseconds: number;
|
|
170
|
-
chromiumOptions: ChromiumOptions;
|
|
171
|
-
scale: number;
|
|
172
|
-
everyNthFrame: number;
|
|
173
|
-
numberOfGifLoops: number | null;
|
|
174
|
-
concurrencyPerLambda: number;
|
|
175
|
-
downloadBehavior: DownloadBehavior;
|
|
176
|
-
muted: boolean;
|
|
177
|
-
overwrite: boolean;
|
|
178
|
-
audioBitrate: string | null;
|
|
179
|
-
videoBitrate: string | null;
|
|
180
|
-
encodingMaxRate: string | null;
|
|
181
|
-
encodingBufferSize: string | null;
|
|
182
|
-
webhook: WebhookOption;
|
|
183
|
-
forceHeight: number | null;
|
|
184
|
-
forceWidth: number | null;
|
|
185
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
186
|
-
deleteAfter: DeleteAfter | null;
|
|
187
|
-
colorSpace: ColorSpace | null;
|
|
188
|
-
preferLossless: boolean;
|
|
189
|
-
};
|
|
190
|
-
status: LambdaStatusPayload;
|
|
191
|
-
renderer: {
|
|
192
|
-
concurrencyPerLambda: number;
|
|
193
|
-
type: LambdaRoutines.renderer;
|
|
194
|
-
serveUrl: string;
|
|
195
|
-
frameRange: [number, number];
|
|
196
|
-
chunk: number;
|
|
197
|
-
bucketName: string;
|
|
198
|
-
composition: string;
|
|
199
|
-
fps: number;
|
|
200
|
-
height: number;
|
|
201
|
-
width: number;
|
|
202
|
-
durationInFrames: number;
|
|
203
|
-
retriesLeft: number;
|
|
204
|
-
inputProps: SerializedInputProps;
|
|
205
|
-
renderId: string;
|
|
206
|
-
imageFormat: VideoImageFormat;
|
|
207
|
-
codec: LambdaCodec;
|
|
208
|
-
crf: number | undefined;
|
|
209
|
-
proResProfile: ProResProfile | undefined;
|
|
210
|
-
x264Preset: X264Preset | null;
|
|
211
|
-
pixelFormat: PixelFormat | undefined;
|
|
212
|
-
jpegQuality: number | undefined;
|
|
213
|
-
envVariables: Record<string, string> | undefined;
|
|
214
|
-
privacy: Privacy;
|
|
215
|
-
attempt: number;
|
|
216
|
-
logLevel: LogLevel;
|
|
217
|
-
timeoutInMilliseconds: number;
|
|
218
|
-
chromiumOptions: ChromiumOptions;
|
|
219
|
-
resolvedProps: SerializedInputProps;
|
|
220
|
-
scale: number;
|
|
221
|
-
everyNthFrame: number;
|
|
222
|
-
muted: boolean;
|
|
223
|
-
audioBitrate: string | null;
|
|
224
|
-
videoBitrate: string | null;
|
|
225
|
-
encodingBufferSize: string | null;
|
|
226
|
-
encodingMaxRate: string | null;
|
|
227
|
-
launchFunctionConfig: {
|
|
228
|
-
version: string;
|
|
229
|
-
};
|
|
230
|
-
preferLossless: boolean;
|
|
231
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
232
|
-
deleteAfter: DeleteAfter | null;
|
|
233
|
-
colorSpace: ColorSpace | null;
|
|
234
|
-
compositionStart: number;
|
|
235
|
-
framesPerLambda: number;
|
|
236
|
-
progressEveryNthFrame: number;
|
|
237
|
-
};
|
|
238
|
-
still: {
|
|
239
|
-
type: LambdaRoutines.still;
|
|
240
|
-
serveUrl: string;
|
|
241
|
-
composition: string;
|
|
242
|
-
inputProps: SerializedInputProps;
|
|
243
|
-
imageFormat: StillImageFormat;
|
|
244
|
-
envVariables: Record<string, string>;
|
|
245
|
-
attempt: number;
|
|
246
|
-
jpegQuality: number | undefined;
|
|
247
|
-
maxRetries: number;
|
|
248
|
-
frame: number;
|
|
249
|
-
privacy: Privacy;
|
|
250
|
-
logLevel: LogLevel;
|
|
251
|
-
outName: OutNameInput | null;
|
|
252
|
-
timeoutInMilliseconds: number;
|
|
253
|
-
chromiumOptions: ChromiumOptions;
|
|
254
|
-
scale: number;
|
|
255
|
-
downloadBehavior: DownloadBehavior;
|
|
256
|
-
version: string;
|
|
257
|
-
forceHeight: number | null;
|
|
258
|
-
forceWidth: number | null;
|
|
259
|
-
bucketName: string | null;
|
|
260
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
261
|
-
deleteAfter: DeleteAfter | null;
|
|
262
|
-
streamed: boolean;
|
|
263
|
-
};
|
|
264
|
-
compositions: {
|
|
265
|
-
type: LambdaRoutines.compositions;
|
|
266
|
-
version: string;
|
|
267
|
-
chromiumOptions: ChromiumOptions;
|
|
268
|
-
logLevel: LogLevel;
|
|
269
|
-
inputProps: SerializedInputProps;
|
|
270
|
-
envVariables: Record<string, string> | undefined;
|
|
271
|
-
timeoutInMilliseconds: number;
|
|
272
|
-
serveUrl: string;
|
|
273
|
-
bucketName: string | null;
|
|
274
|
-
offthreadVideoCacheSizeInBytes: number | null;
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
export type LambdaPayload = LambdaPayloads[LambdaRoutines];
|
|
278
|
-
type Discriminated = {
|
|
279
|
-
type: 'still';
|
|
280
|
-
imageFormat: StillImageFormat;
|
|
281
|
-
codec: null;
|
|
282
|
-
} | {
|
|
283
|
-
type: 'video';
|
|
284
|
-
imageFormat: VideoImageFormat;
|
|
285
|
-
muted: boolean;
|
|
286
|
-
frameRange: [number, number];
|
|
287
|
-
everyNthFrame: number;
|
|
288
|
-
codec: LambdaCodec;
|
|
289
|
-
};
|
|
290
|
-
export type RenderMetadata = Discriminated & {
|
|
291
|
-
siteId: string;
|
|
292
|
-
startedDate: number;
|
|
293
|
-
totalChunks: number;
|
|
294
|
-
estimatedTotalLambdaInvokations: number;
|
|
295
|
-
estimatedRenderLambdaInvokations: number;
|
|
296
|
-
compositionId: string;
|
|
297
|
-
audioCodec: AudioCodec | null;
|
|
298
|
-
inputProps: SerializedInputProps;
|
|
299
|
-
framesPerLambda: number;
|
|
300
|
-
memorySizeInMb: number;
|
|
301
|
-
lambdaVersion: string;
|
|
302
|
-
region: AwsRegion;
|
|
303
|
-
renderId: string;
|
|
304
|
-
outName: OutNameInputWithoutCredentials | undefined;
|
|
305
|
-
privacy: Privacy;
|
|
306
|
-
deleteAfter: DeleteAfter | null;
|
|
307
|
-
numberOfGifLoops: number | null;
|
|
308
|
-
audioBitrate: string | null;
|
|
309
|
-
downloadBehavior: DownloadBehavior;
|
|
310
|
-
};
|
|
311
33
|
export type AfterRenderCost = {
|
|
312
34
|
estimatedCost: number;
|
|
313
35
|
estimatedDisplayCost: string;
|
|
314
36
|
currency: string;
|
|
315
37
|
disclaimer: string;
|
|
316
38
|
};
|
|
317
|
-
export type PostRenderData = {
|
|
39
|
+
export type PostRenderData<Provider extends CloudProvider> = {
|
|
318
40
|
cost: AfterRenderCost;
|
|
319
41
|
outputFile: string;
|
|
320
42
|
outputSize: number;
|
|
@@ -333,7 +55,7 @@ export type PostRenderData = {
|
|
|
333
55
|
estimatedBillingDurationInMilliseconds: number;
|
|
334
56
|
deleteAfter: DeleteAfter | null;
|
|
335
57
|
timeToCombine: number | null;
|
|
336
|
-
artifactProgress: ReceivedArtifact[];
|
|
58
|
+
artifactProgress: ReceivedArtifact<Provider>[];
|
|
337
59
|
};
|
|
338
60
|
export type CostsInfo = {
|
|
339
61
|
accruedSoFar: number;
|
|
@@ -351,13 +73,13 @@ type EncodingProgress = {
|
|
|
351
73
|
combinedFrames: number;
|
|
352
74
|
timeToCombine: number | null;
|
|
353
75
|
};
|
|
354
|
-
export type
|
|
76
|
+
export type GenericRenderProgress<Provider extends CloudProvider> = {
|
|
355
77
|
chunks: number;
|
|
356
78
|
done: boolean;
|
|
357
79
|
encodingStatus: EncodingProgress | null;
|
|
358
80
|
costs: CostsInfo;
|
|
359
81
|
renderId: string;
|
|
360
|
-
renderMetadata: RenderMetadata | null;
|
|
82
|
+
renderMetadata: RenderMetadata<Provider> | null;
|
|
361
83
|
bucket: string;
|
|
362
84
|
outputFile: string | null;
|
|
363
85
|
outKey: string | null;
|
|
@@ -385,8 +107,8 @@ export type RenderProgress = {
|
|
|
385
107
|
functionLaunched: number;
|
|
386
108
|
serveUrlOpened: number | null;
|
|
387
109
|
compositionValidated: number | null;
|
|
388
|
-
artifacts: ReceivedArtifact[];
|
|
110
|
+
artifacts: ReceivedArtifact<Provider>[];
|
|
389
111
|
};
|
|
390
|
-
export type
|
|
112
|
+
export type RenderProgress = GenericRenderProgress<AwsProvider>;
|
|
391
113
|
export declare const LAMBDA_CONCURRENCY_LIMIT_QUOTA = "L-B99A9384";
|
|
392
114
|
export {};
|
package/dist/shared/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.
|
|
3
|
+
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.getSitesKey = exports.LAMBDA_INSIGHTS_PREFIX = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.MAX_EPHEMERAL_STORAGE_IN_MB = exports.MIN_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = exports.MAX_FUNCTIONS_PER_RENDER = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_REGION = exports.COMMAND_NOT_FOUND = exports.BINARY_NAME = exports.DEFAULT_FRAMES_PER_LAMBDA = exports.MINIMUM_FRAMES_PER_LAMBDA = exports.MAX_TIMEOUT = exports.MIN_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DEFAULT_MEMORY_SIZE = exports.MAX_MEMORY = exports.MIN_MEMORY = void 0;
|
|
4
4
|
exports.MIN_MEMORY = 512;
|
|
5
5
|
exports.MAX_MEMORY = 10240;
|
|
6
6
|
exports.DEFAULT_MEMORY_SIZE = 2048;
|
|
@@ -19,58 +19,13 @@ exports.MIN_EPHEMERAL_STORAGE_IN_MB = 512;
|
|
|
19
19
|
exports.MAX_EPHEMERAL_STORAGE_IN_MB = 10240;
|
|
20
20
|
exports.DEFAULT_OUTPUT_PRIVACY = 'public';
|
|
21
21
|
exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = 14;
|
|
22
|
-
exports.REMOTION_BUCKET_PREFIX = 'remotionlambda-';
|
|
23
22
|
exports.RENDER_FN_PREFIX = 'remotion-render-';
|
|
24
23
|
exports.LOG_GROUP_PREFIX = '/aws/lambda/';
|
|
25
24
|
exports.LAMBDA_INSIGHTS_PREFIX = '/aws/lambda-insights';
|
|
26
|
-
const rendersPrefix = (renderId) => `renders/${renderId}`;
|
|
27
|
-
exports.rendersPrefix = rendersPrefix;
|
|
28
|
-
const overallProgressKey = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/progress.json`;
|
|
29
|
-
exports.overallProgressKey = overallProgressKey;
|
|
30
25
|
const getSitesKey = (siteId) => `sites/${siteId}`;
|
|
31
26
|
exports.getSitesKey = getSitesKey;
|
|
32
|
-
const outName = (renderId, extension) => `${(0, exports.rendersPrefix)(renderId)}/out.${extension}`;
|
|
33
|
-
exports.outName = outName;
|
|
34
|
-
const outStillName = (renderId, imageFormat) => `${(0, exports.rendersPrefix)(renderId)}/out.${imageFormat}`;
|
|
35
|
-
exports.outStillName = outStillName;
|
|
36
|
-
const artifactName = (renderId, name) => `${(0, exports.rendersPrefix)(renderId)}/artifacts/${name}`;
|
|
37
|
-
exports.artifactName = artifactName;
|
|
38
|
-
const customOutName = (renderId, bucketName, name) => {
|
|
39
|
-
var _a;
|
|
40
|
-
if (typeof name === 'string') {
|
|
41
|
-
return {
|
|
42
|
-
renderBucketName: bucketName,
|
|
43
|
-
key: `${(0, exports.rendersPrefix)(renderId)}/${name}`,
|
|
44
|
-
customCredentials: null,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
key: name.key,
|
|
49
|
-
renderBucketName: name.bucketName,
|
|
50
|
-
customCredentials: (_a = name.s3OutputProvider) !== null && _a !== void 0 ? _a : null,
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
exports.customOutName = customOutName;
|
|
54
|
-
const inputPropsKey = (hash) => {
|
|
55
|
-
return `input-props/${hash}.json`;
|
|
56
|
-
};
|
|
57
|
-
exports.inputPropsKey = inputPropsKey;
|
|
58
|
-
const resolvedPropsKey = (hash) => {
|
|
59
|
-
return `resolved-props/${hash}.json`;
|
|
60
|
-
};
|
|
61
|
-
exports.resolvedPropsKey = resolvedPropsKey;
|
|
62
27
|
exports.RENDERER_PATH_TOKEN = 'remotion-bucket';
|
|
63
28
|
exports.CONCAT_FOLDER_TOKEN = 'remotion-concat';
|
|
64
29
|
exports.REMOTION_CONCATED_TOKEN = 'remotion-concated-token';
|
|
65
30
|
exports.REMOTION_FILELIST_TOKEN = 'remotion-filelist';
|
|
66
|
-
var LambdaRoutines;
|
|
67
|
-
(function (LambdaRoutines) {
|
|
68
|
-
LambdaRoutines["info"] = "info";
|
|
69
|
-
LambdaRoutines["start"] = "start";
|
|
70
|
-
LambdaRoutines["launch"] = "launch";
|
|
71
|
-
LambdaRoutines["status"] = "status";
|
|
72
|
-
LambdaRoutines["renderer"] = "renderer";
|
|
73
|
-
LambdaRoutines["still"] = "still";
|
|
74
|
-
LambdaRoutines["compositions"] = "compositions";
|
|
75
|
-
})(LambdaRoutines || (exports.LambdaRoutines = LambdaRoutines = {}));
|
|
76
31
|
exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = 'L-B99A9384';
|