@remotion/lambda 4.0.187 → 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 +16 -14
- 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
|
@@ -5,45 +5,47 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.rendererHandler = void 0;
|
|
7
7
|
const renderer_1 = require("@remotion/renderer");
|
|
8
|
+
const serverless_1 = require("@remotion/serverless");
|
|
9
|
+
const client_1 = require("@remotion/serverless/client");
|
|
8
10
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
11
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
12
|
const version_1 = require("remotion/version");
|
|
11
|
-
const compress_props_1 = require("../shared/compress-props");
|
|
12
13
|
const constants_1 = require("../shared/constants");
|
|
13
14
|
const is_flaky_error_1 = require("../shared/is-flaky-error");
|
|
14
|
-
const truthy_1 = require("../shared/truthy");
|
|
15
15
|
const why_is_node_running_1 = require("../shared/why-is-node-running");
|
|
16
16
|
const can_concat_seamlessly_1 = require("./helpers/can-concat-seamlessly");
|
|
17
|
-
const get_browser_instance_1 = require("./helpers/get-browser-instance");
|
|
18
|
-
const get_chromium_executable_path_1 = require("./helpers/get-chromium-executable-path");
|
|
19
|
-
const get_current_region_1 = require("./helpers/get-current-region");
|
|
20
17
|
const leak_detection_1 = require("./helpers/leak-detection");
|
|
21
18
|
const on_downloads_logger_1 = require("./helpers/on-downloads-logger");
|
|
22
|
-
const serialize_artifact_1 = require("./helpers/serialize-artifact");
|
|
23
19
|
const timer_1 = require("./helpers/timer");
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
if (params.type !== constants_1.LambdaRoutines.renderer) {
|
|
20
|
+
const renderHandler = async ({ params, options, logs, onStream, providerSpecifics, }) => {
|
|
21
|
+
if (params.type !== client_1.ServerlessRoutines.renderer) {
|
|
27
22
|
throw new Error('Params must be renderer');
|
|
28
23
|
}
|
|
29
24
|
if (params.launchFunctionConfig.version !== version_1.VERSION) {
|
|
30
25
|
throw new Error(`The version of the function that was specified as "rendererFunctionName" is ${version_1.VERSION} but the version of the function that invoked the render is ${params.launchFunctionConfig.version}. Please make sure that the version of the function that is specified as "rendererFunctionName" is the same as the version of the function that is invoked.`);
|
|
31
26
|
}
|
|
32
|
-
const inputPropsPromise = (0,
|
|
27
|
+
const inputPropsPromise = (0, client_1.decompressInputProps)({
|
|
33
28
|
bucketName: params.bucketName,
|
|
34
29
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
35
|
-
region:
|
|
30
|
+
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
36
31
|
serialized: params.inputProps,
|
|
37
32
|
propsType: 'input-props',
|
|
33
|
+
providerSpecifics,
|
|
38
34
|
});
|
|
39
|
-
const resolvedPropsPromise = (0,
|
|
35
|
+
const resolvedPropsPromise = (0, client_1.decompressInputProps)({
|
|
40
36
|
bucketName: params.bucketName,
|
|
41
37
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
42
|
-
region:
|
|
38
|
+
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
43
39
|
serialized: params.resolvedProps,
|
|
44
40
|
propsType: 'resolved-props',
|
|
41
|
+
providerSpecifics,
|
|
42
|
+
});
|
|
43
|
+
const browserInstance = await (0, serverless_1.getBrowserInstance)({
|
|
44
|
+
logLevel: params.logLevel,
|
|
45
|
+
indent: false,
|
|
46
|
+
chromiumOptions: params.chromiumOptions,
|
|
47
|
+
providerSpecifics,
|
|
45
48
|
});
|
|
46
|
-
const browserInstance = await (0, get_browser_instance_1.getBrowserInstance)(params.logLevel, false, params.chromiumOptions);
|
|
47
49
|
const outputPath = renderer_1.RenderInternals.tmpDir('remotion-render-');
|
|
48
50
|
if (typeof params.chunk !== 'number') {
|
|
49
51
|
throw new Error('must pass chunk');
|
|
@@ -104,7 +106,7 @@ const renderHandler = async ({ params, options, logs, onStream, }) => {
|
|
|
104
106
|
onStream({
|
|
105
107
|
type: 'artifact-emitted',
|
|
106
108
|
payload: {
|
|
107
|
-
artifact: (0,
|
|
109
|
+
artifact: (0, serverless_1.serializeArtifact)(artifact),
|
|
108
110
|
},
|
|
109
111
|
})
|
|
110
112
|
.then(() => {
|
|
@@ -189,7 +191,7 @@ const renderHandler = async ({ params, options, logs, onStream, }) => {
|
|
|
189
191
|
encodingMaxRate: params.encodingMaxRate,
|
|
190
192
|
audioCodec,
|
|
191
193
|
preferLossless: params.preferLossless,
|
|
192
|
-
browserExecutable:
|
|
194
|
+
browserExecutable: providerSpecifics.getChromiumPath(),
|
|
193
195
|
cancelSignal: undefined,
|
|
194
196
|
disallowParallelEncoding: false,
|
|
195
197
|
ffmpegOverride: ({ args }) => args,
|
|
@@ -252,19 +254,25 @@ const renderHandler = async ({ params, options, logs, onStream, }) => {
|
|
|
252
254
|
? node_fs_1.default.promises.rm(audioOutputLocation, { recursive: true })
|
|
253
255
|
: null,
|
|
254
256
|
node_fs_1.default.promises.rm(outputPath, { recursive: true }),
|
|
255
|
-
].filter(
|
|
257
|
+
].filter(client_1.truthy));
|
|
256
258
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel: params.logLevel }, 'Done!');
|
|
257
259
|
return {};
|
|
258
260
|
};
|
|
259
261
|
const ENABLE_SLOW_LEAK_DETECTION = false;
|
|
260
|
-
const rendererHandler = async (
|
|
261
|
-
if (params.type !==
|
|
262
|
+
const rendererHandler = async ({ onStream, options, params, providerSpecifics, requestContext, }) => {
|
|
263
|
+
if (params.type !== client_1.ServerlessRoutines.renderer) {
|
|
262
264
|
throw new Error('Params must be renderer');
|
|
263
265
|
}
|
|
264
266
|
const logs = [];
|
|
265
267
|
const leakDetection = (0, why_is_node_running_1.enableNodeIntrospection)(ENABLE_SLOW_LEAK_DETECTION);
|
|
266
268
|
try {
|
|
267
|
-
await renderHandler({
|
|
269
|
+
await renderHandler({
|
|
270
|
+
params,
|
|
271
|
+
options,
|
|
272
|
+
logs,
|
|
273
|
+
onStream,
|
|
274
|
+
providerSpecifics,
|
|
275
|
+
});
|
|
268
276
|
return {
|
|
269
277
|
type: 'success',
|
|
270
278
|
};
|
|
@@ -294,7 +302,7 @@ const rendererHandler = async (params, options, onStream, requestContext) => {
|
|
|
294
302
|
frame: null,
|
|
295
303
|
type: 'renderer',
|
|
296
304
|
isFatal: !shouldRetry,
|
|
297
|
-
tmpDir: (0,
|
|
305
|
+
tmpDir: (0, serverless_1.getTmpDirStateIfENoSp)(err.stack, providerSpecifics),
|
|
298
306
|
attempt: params.attempt,
|
|
299
307
|
totalAttempts: params.retriesLeft + params.attempt,
|
|
300
308
|
willRetry: shouldRetry,
|
|
@@ -304,7 +312,7 @@ const rendererHandler = async (params, options, onStream, requestContext) => {
|
|
|
304
312
|
throw err;
|
|
305
313
|
}
|
|
306
314
|
finally {
|
|
307
|
-
(0,
|
|
315
|
+
(0, serverless_1.forgetBrowserEventLoop)(params.logLevel);
|
|
308
316
|
if (ENABLE_SLOW_LEAK_DETECTION) {
|
|
309
317
|
(0, leak_detection_1.startLeakDetection)(leakDetection, requestContext.awsRequestId);
|
|
310
318
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
+
import type { ServerlessPayload } from '@remotion/serverless/client';
|
|
2
3
|
type Options = {
|
|
3
4
|
expectedBucketOwner: string;
|
|
4
5
|
timeoutInMilliseconds: number;
|
|
5
6
|
};
|
|
6
|
-
export declare const startHandler: (params:
|
|
7
|
+
export declare const startHandler: <Provider extends CloudProvider<string, Record<string, unknown>>>(params: ServerlessPayload<Provider>, options: Options, providerSpecifics: ProviderSpecifics<Provider>) => Promise<{
|
|
7
8
|
type: "success";
|
|
8
9
|
bucketName: string;
|
|
9
10
|
renderId: string;
|
package/dist/functions/start.js
CHANGED
|
@@ -2,18 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.startHandler = void 0;
|
|
4
4
|
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
+
const client_1 = require("@remotion/serverless/client");
|
|
5
6
|
const version_1 = require("remotion/version");
|
|
6
|
-
const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
|
|
7
7
|
const aws_clients_1 = require("../shared/aws-clients");
|
|
8
|
-
const constants_1 = require("../shared/constants");
|
|
9
|
-
const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
|
|
10
|
-
const get_current_region_1 = require("./helpers/get-current-region");
|
|
11
|
-
const io_1 = require("./helpers/io");
|
|
12
8
|
const lifecycle_1 = require("./helpers/lifecycle");
|
|
13
9
|
const overall_render_progress_1 = require("./helpers/overall-render-progress");
|
|
14
|
-
const startHandler = async (params, options) => {
|
|
10
|
+
const startHandler = async (params, options, providerSpecifics) => {
|
|
15
11
|
var _a;
|
|
16
|
-
if (params.type !==
|
|
12
|
+
if (params.type !== client_1.ServerlessRoutines.start) {
|
|
17
13
|
throw new TypeError('Expected type start');
|
|
18
14
|
}
|
|
19
15
|
if (params.version !== version_1.VERSION) {
|
|
@@ -22,31 +18,32 @@ const startHandler = async (params, options) => {
|
|
|
22
18
|
}
|
|
23
19
|
throw new Error(`Version mismatch: When calling renderMediaOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${version_1.VERSION}, but the @remotion/lambda package you used to invoke the function has version ${params.version}. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
24
20
|
}
|
|
25
|
-
const region =
|
|
26
|
-
const bucketName = (_a = params.bucketName) !== null && _a !== void 0 ? _a : (await (0,
|
|
27
|
-
region:
|
|
21
|
+
const region = providerSpecifics.getCurrentRegionInFunction();
|
|
22
|
+
const bucketName = (_a = params.bucketName) !== null && _a !== void 0 ? _a : (await (0, client_1.internalGetOrCreateBucket)({
|
|
23
|
+
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
28
24
|
enableFolderExpiry: null,
|
|
29
25
|
customCredentials: null,
|
|
26
|
+
providerSpecifics,
|
|
30
27
|
})).bucketName;
|
|
31
|
-
const realServeUrl =
|
|
28
|
+
const realServeUrl = providerSpecifics.convertToServeUrl({
|
|
32
29
|
urlOrId: params.serveUrl,
|
|
33
30
|
region,
|
|
34
31
|
bucketName,
|
|
35
32
|
});
|
|
36
33
|
(0, lifecycle_1.validateDeleteAfter)(params.deleteAfter);
|
|
37
|
-
const renderId = (0, lifecycle_1.generateRandomHashWithLifeCycleRule)(params.deleteAfter);
|
|
38
|
-
const initialFile =
|
|
34
|
+
const renderId = (0, lifecycle_1.generateRandomHashWithLifeCycleRule)(params.deleteAfter, providerSpecifics);
|
|
35
|
+
const initialFile = providerSpecifics.writeFile({
|
|
39
36
|
bucketName,
|
|
40
37
|
downloadBehavior: null,
|
|
41
38
|
region,
|
|
42
39
|
body: JSON.stringify((0, overall_render_progress_1.makeInitialOverallRenderProgress)(options.timeoutInMilliseconds + Date.now())),
|
|
43
40
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
44
|
-
key: (0,
|
|
41
|
+
key: (0, client_1.overallProgressKey)(renderId),
|
|
45
42
|
privacy: 'private',
|
|
46
43
|
customCredentials: null,
|
|
47
44
|
});
|
|
48
45
|
const payload = {
|
|
49
|
-
type:
|
|
46
|
+
type: client_1.ServerlessRoutines.launch,
|
|
50
47
|
framesPerLambda: params.framesPerLambda,
|
|
51
48
|
composition: params.composition,
|
|
52
49
|
serveUrl: realServeUrl,
|
|
@@ -90,7 +87,7 @@ const startHandler = async (params, options) => {
|
|
|
90
87
|
preferLossless: params.preferLossless,
|
|
91
88
|
};
|
|
92
89
|
// Don't replace with callLambda(), we want to return before the render is snone
|
|
93
|
-
const result = await (0, aws_clients_1.getLambdaClient)(
|
|
90
|
+
const result = await (0, aws_clients_1.getLambdaClient)(providerSpecifics.getCurrentRegionInFunction()).send(new client_lambda_1.InvokeCommand({
|
|
94
91
|
FunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
|
95
92
|
Payload: JSON.stringify(payload),
|
|
96
93
|
InvocationType: 'Event',
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
3
|
-
import type {
|
|
4
|
-
type Options = {
|
|
5
|
-
params:
|
|
1
|
+
import type { CloudProvider, OnStream } from '@remotion/serverless';
|
|
2
|
+
import { type ProviderSpecifics } from '@remotion/serverless';
|
|
3
|
+
import type { ServerlessPayload } from '@remotion/serverless/client';
|
|
4
|
+
type Options<Provider extends CloudProvider> = {
|
|
5
|
+
params: ServerlessPayload<Provider>;
|
|
6
6
|
renderId: string;
|
|
7
7
|
expectedBucketOwner: string;
|
|
8
|
-
onStream: OnStream
|
|
8
|
+
onStream: OnStream<Provider>;
|
|
9
9
|
timeoutInMilliseconds: number;
|
|
10
|
+
providerSpecifics: ProviderSpecifics<Provider>;
|
|
10
11
|
};
|
|
11
|
-
export
|
|
12
|
-
type: 'success';
|
|
13
|
-
output: string;
|
|
14
|
-
outKey: string;
|
|
15
|
-
size: number;
|
|
16
|
-
bucketName: string;
|
|
17
|
-
sizeInBytes: number;
|
|
18
|
-
estimatedPrice: CostsInfo;
|
|
19
|
-
renderId: string;
|
|
20
|
-
receivedArtifacts: ReceivedArtifact[];
|
|
21
|
-
};
|
|
22
|
-
export declare const stillHandler: (options: Options) => Promise<{
|
|
12
|
+
export declare const stillHandler: <Provider extends CloudProvider<string, Record<string, unknown>>>(options: Options<Provider>) => Promise<{
|
|
23
13
|
type: 'success';
|
|
24
14
|
} | {
|
|
25
15
|
type: 'error';
|
package/dist/functions/still.js
CHANGED
|
@@ -5,34 +5,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.stillHandler = void 0;
|
|
7
7
|
const renderer_1 = require("@remotion/renderer");
|
|
8
|
+
const serverless_1 = require("@remotion/serverless");
|
|
9
|
+
const client_1 = require("@remotion/serverless/client");
|
|
8
10
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
11
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
12
|
const no_react_1 = require("remotion/no-react");
|
|
11
13
|
const version_1 = require("remotion/version");
|
|
12
14
|
const estimate_price_1 = require("../api/estimate-price");
|
|
13
|
-
const
|
|
15
|
+
const defaults_1 = require("../defaults");
|
|
14
16
|
const cleanup_serialized_input_props_1 = require("../shared/cleanup-serialized-input-props");
|
|
15
|
-
const compress_props_1 = require("../shared/compress-props");
|
|
16
|
-
const constants_1 = require("../shared/constants");
|
|
17
|
-
const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
|
|
18
17
|
const is_flaky_error_1 = require("../shared/is-flaky-error");
|
|
19
18
|
const validate_download_behavior_1 = require("../shared/validate-download-behavior");
|
|
20
|
-
const validate_outname_1 = require("../shared/validate-outname");
|
|
21
19
|
const validate_privacy_1 = require("../shared/validate-privacy");
|
|
22
|
-
const expected_out_name_1 = require("./helpers/expected-out-name");
|
|
23
20
|
const format_costs_info_1 = require("./helpers/format-costs-info");
|
|
24
|
-
const get_browser_instance_1 = require("./helpers/get-browser-instance");
|
|
25
|
-
const get_chromium_executable_path_1 = require("./helpers/get-chromium-executable-path");
|
|
26
|
-
const get_current_region_1 = require("./helpers/get-current-region");
|
|
27
21
|
const get_output_url_from_metadata_1 = require("./helpers/get-output-url-from-metadata");
|
|
28
|
-
const io_1 = require("./helpers/io");
|
|
29
22
|
const on_downloads_logger_1 = require("./helpers/on-downloads-logger");
|
|
30
23
|
const overall_render_progress_1 = require("./helpers/overall-render-progress");
|
|
31
|
-
const
|
|
32
|
-
const write_lambda_error_1 = require("./helpers/write-lambda-error");
|
|
33
|
-
const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, renderId, onStream, timeoutInMilliseconds, }) => {
|
|
24
|
+
const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, renderId, onStream, timeoutInMilliseconds, providerSpecifics, }) => {
|
|
34
25
|
var _a, _b, _c, _d, _e;
|
|
35
|
-
if (lambdaParams.type !==
|
|
26
|
+
if (lambdaParams.type !== client_1.ServerlessRoutines.still) {
|
|
36
27
|
throw new TypeError('Expected still type');
|
|
37
28
|
}
|
|
38
29
|
if (lambdaParams.version !== version_1.VERSION) {
|
|
@@ -43,31 +34,38 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
43
34
|
}
|
|
44
35
|
(0, validate_download_behavior_1.validateDownloadBehavior)(lambdaParams.downloadBehavior);
|
|
45
36
|
(0, validate_privacy_1.validatePrivacy)(lambdaParams.privacy, true);
|
|
46
|
-
(0,
|
|
37
|
+
(0, serverless_1.validateOutname)({
|
|
47
38
|
outName: lambdaParams.outName,
|
|
48
39
|
codec: null,
|
|
49
40
|
audioCodecSetting: null,
|
|
50
41
|
separateAudioTo: null,
|
|
51
42
|
});
|
|
52
43
|
const start = Date.now();
|
|
53
|
-
const browserInstancePromise = (0,
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
const browserInstancePromise = (0, serverless_1.getBrowserInstance)({
|
|
45
|
+
logLevel: lambdaParams.logLevel,
|
|
46
|
+
indent: false,
|
|
47
|
+
chromiumOptions: lambdaParams.chromiumOptions,
|
|
48
|
+
providerSpecifics,
|
|
49
|
+
});
|
|
50
|
+
const bucketNamePromise = (_a = lambdaParams.bucketName) !== null && _a !== void 0 ? _a : (0, client_1.internalGetOrCreateBucket)({
|
|
51
|
+
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
56
52
|
enableFolderExpiry: null,
|
|
57
53
|
customCredentials: null,
|
|
54
|
+
providerSpecifics,
|
|
58
55
|
}).then((b) => b.bucketName);
|
|
59
56
|
const outputDir = renderer_1.RenderInternals.tmpDir('remotion-render-');
|
|
60
57
|
const outputPath = node_path_1.default.join(outputDir, 'output');
|
|
61
|
-
const region =
|
|
58
|
+
const region = providerSpecifics.getCurrentRegionInFunction();
|
|
62
59
|
const bucketName = await bucketNamePromise;
|
|
63
|
-
const serializedInputPropsWithCustomSchema = await (0,
|
|
60
|
+
const serializedInputPropsWithCustomSchema = await (0, client_1.decompressInputProps)({
|
|
64
61
|
bucketName,
|
|
65
62
|
expectedBucketOwner,
|
|
66
63
|
region,
|
|
67
64
|
serialized: lambdaParams.inputProps,
|
|
68
65
|
propsType: 'input-props',
|
|
66
|
+
providerSpecifics,
|
|
69
67
|
});
|
|
70
|
-
const serveUrl =
|
|
68
|
+
const serveUrl = providerSpecifics.convertToServeUrl({
|
|
71
69
|
urlOrId: lambdaParams.serveUrl,
|
|
72
70
|
region,
|
|
73
71
|
bucketName,
|
|
@@ -84,7 +82,7 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
84
82
|
forceIPv4: false,
|
|
85
83
|
});
|
|
86
84
|
const browserInstance = await browserInstancePromise;
|
|
87
|
-
const composition = await (0,
|
|
85
|
+
const composition = await (0, serverless_1.validateComposition)({
|
|
88
86
|
serveUrl,
|
|
89
87
|
browserInstance: browserInstance.instance,
|
|
90
88
|
composition: lambdaParams.composition,
|
|
@@ -102,6 +100,7 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
102
100
|
throw new Error('Should not download a browser in Lambda');
|
|
103
101
|
},
|
|
104
102
|
onServeUrlVisited: () => undefined,
|
|
103
|
+
providerSpecifics,
|
|
105
104
|
});
|
|
106
105
|
const renderMetadata = {
|
|
107
106
|
startedDate: Date.now(),
|
|
@@ -117,7 +116,7 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
117
116
|
lambdaVersion: version_1.VERSION,
|
|
118
117
|
framesPerLambda: 1,
|
|
119
118
|
memorySizeInMb: Number(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE),
|
|
120
|
-
region:
|
|
119
|
+
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
121
120
|
renderId,
|
|
122
121
|
outName: (_c = lambdaParams.outName) !== null && _c !== void 0 ? _c : undefined,
|
|
123
122
|
privacy: lambdaParams.privacy,
|
|
@@ -129,11 +128,11 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
129
128
|
};
|
|
130
129
|
const still = (0, overall_render_progress_1.makeInitialOverallRenderProgress)(timeoutInMilliseconds);
|
|
131
130
|
still.renderMetadata = renderMetadata;
|
|
132
|
-
await
|
|
131
|
+
await providerSpecifics.writeFile({
|
|
133
132
|
bucketName,
|
|
134
|
-
key: (0,
|
|
133
|
+
key: (0, client_1.overallProgressKey)(renderId),
|
|
135
134
|
body: JSON.stringify(still),
|
|
136
|
-
region:
|
|
135
|
+
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
137
136
|
privacy: 'private',
|
|
138
137
|
expectedBucketOwner,
|
|
139
138
|
downloadBehavior: null,
|
|
@@ -143,23 +142,24 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
143
142
|
throw new Error('Should not download a browser in Lambda');
|
|
144
143
|
};
|
|
145
144
|
const receivedArtifact = [];
|
|
146
|
-
const { key, renderBucketName, customCredentials } = (0,
|
|
145
|
+
const { key, renderBucketName, customCredentials } = (0, client_1.getExpectedOutName)(renderMetadata, bucketName, (0, serverless_1.getCredentialsFromOutName)(lambdaParams.outName));
|
|
147
146
|
const onArtifact = (artifact) => {
|
|
148
147
|
if (receivedArtifact.find((a) => a.filename === artifact.filename)) {
|
|
149
148
|
return { alreadyExisted: true };
|
|
150
149
|
}
|
|
151
|
-
const
|
|
152
|
-
receivedArtifact.push({
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
});
|
|
150
|
+
const storageKey = (0, client_1.artifactName)(renderMetadata.renderId, artifact.filename);
|
|
151
|
+
receivedArtifact.push(providerSpecifics.makeArtifactWithDetails({
|
|
152
|
+
storageKey,
|
|
153
|
+
artifact,
|
|
154
|
+
region,
|
|
155
|
+
renderBucketName,
|
|
156
|
+
}));
|
|
158
157
|
const startTime = Date.now();
|
|
159
158
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel: lambdaParams.logLevel }, 'Writing artifact ' + artifact.filename + ' to S3');
|
|
160
|
-
|
|
159
|
+
providerSpecifics
|
|
160
|
+
.writeFile({
|
|
161
161
|
bucketName: renderBucketName,
|
|
162
|
-
key:
|
|
162
|
+
key: storageKey,
|
|
163
163
|
body: artifact.content,
|
|
164
164
|
region,
|
|
165
165
|
privacy: lambdaParams.privacy,
|
|
@@ -192,7 +192,7 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
192
192
|
chromiumOptions: lambdaParams.chromiumOptions,
|
|
193
193
|
scale: lambdaParams.scale,
|
|
194
194
|
timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,
|
|
195
|
-
browserExecutable:
|
|
195
|
+
browserExecutable: providerSpecifics.getChromiumPath(),
|
|
196
196
|
cancelSignal: null,
|
|
197
197
|
indent: false,
|
|
198
198
|
onBrowserLog: null,
|
|
@@ -211,34 +211,35 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
211
211
|
onArtifact,
|
|
212
212
|
});
|
|
213
213
|
const { size } = await node_fs_1.default.promises.stat(outputPath);
|
|
214
|
-
await
|
|
214
|
+
await providerSpecifics.writeFile({
|
|
215
215
|
bucketName: renderBucketName,
|
|
216
216
|
key,
|
|
217
217
|
privacy: lambdaParams.privacy,
|
|
218
218
|
body: node_fs_1.default.createReadStream(outputPath),
|
|
219
219
|
expectedBucketOwner,
|
|
220
|
-
region:
|
|
220
|
+
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
221
221
|
downloadBehavior: lambdaParams.downloadBehavior,
|
|
222
222
|
customCredentials,
|
|
223
223
|
});
|
|
224
224
|
await Promise.all([
|
|
225
225
|
node_fs_1.default.promises.rm(outputPath, { recursive: true }),
|
|
226
226
|
(0, cleanup_serialized_input_props_1.cleanupSerializedInputProps)({
|
|
227
|
-
region:
|
|
227
|
+
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
228
228
|
serialized: lambdaParams.inputProps,
|
|
229
|
+
providerSpecifics,
|
|
229
230
|
}),
|
|
230
231
|
server.closeServer(true),
|
|
231
232
|
]);
|
|
232
233
|
const estimatedPrice = (0, estimate_price_1.estimatePrice)({
|
|
233
234
|
durationInMilliseconds: Date.now() - start + 100,
|
|
234
235
|
memorySizeInMb: Number(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE),
|
|
235
|
-
region:
|
|
236
|
+
region: providerSpecifics.getCurrentRegionInFunction(),
|
|
236
237
|
lambdasInvoked: 1,
|
|
237
238
|
// We cannot determine the ephemeral storage size, so we
|
|
238
239
|
// overestimate the price, but will only have a miniscule effect (~0.2%)
|
|
239
|
-
diskSizeInMb:
|
|
240
|
+
diskSizeInMb: defaults_1.MAX_EPHEMERAL_STORAGE_IN_MB,
|
|
240
241
|
});
|
|
241
|
-
const { key: outKey, url } = (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, bucketName, customCredentials);
|
|
242
|
+
const { key: outKey, url } = (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, bucketName, customCredentials, providerSpecifics.getCurrentRegionInFunction());
|
|
242
243
|
const payload = {
|
|
243
244
|
type: 'success',
|
|
244
245
|
output: url,
|
|
@@ -257,7 +258,7 @@ const innerStillHandler = async ({ params: lambdaParams, expectedBucketOwner, re
|
|
|
257
258
|
};
|
|
258
259
|
const stillHandler = async (options) => {
|
|
259
260
|
const { params } = options;
|
|
260
|
-
if (params.type !==
|
|
261
|
+
if (params.type !== client_1.ServerlessRoutines.still) {
|
|
261
262
|
throw new Error('Params must be renderer');
|
|
262
263
|
}
|
|
263
264
|
try {
|
|
@@ -287,7 +288,7 @@ const stillHandler = async (options) => {
|
|
|
287
288
|
frame: params.frame,
|
|
288
289
|
type: 'renderer',
|
|
289
290
|
isFatal: false,
|
|
290
|
-
tmpDir: (0,
|
|
291
|
+
tmpDir: (0, serverless_1.getTmpDirStateIfENoSp)(err.stack, options.providerSpecifics),
|
|
291
292
|
attempt: params.attempt,
|
|
292
293
|
totalAttempts: 1 + params.maxRetries,
|
|
293
294
|
willRetry: true,
|
|
@@ -302,7 +303,7 @@ const stillHandler = async (options) => {
|
|
|
302
303
|
};
|
|
303
304
|
}
|
|
304
305
|
finally {
|
|
305
|
-
(0,
|
|
306
|
+
(0, serverless_1.forgetBrowserEventLoop)(options.params.type === client_1.ServerlessRoutines.still
|
|
306
307
|
? options.params.logLevel
|
|
307
308
|
: 'error');
|
|
308
309
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { EnhancedErrorInfo, LambdaErrorInfo } from '@remotion/serverless';
|
|
2
|
+
import type { CustomCredentials, GetOrCreateBucketInput, GetOrCreateBucketOutput } from '@remotion/serverless/client';
|
|
1
3
|
import type { DeleteFunctionInput } from './api/delete-function';
|
|
2
4
|
import { deleteFunction } from './api/delete-function';
|
|
3
5
|
import type { DeleteRenderInput } from './api/delete-render';
|
|
@@ -20,7 +22,6 @@ import type { FunctionInfo, GetFunctionInfoInput } from './api/get-function-info
|
|
|
20
22
|
import { getFunctionInfo } from './api/get-function-info';
|
|
21
23
|
import type { GetFunctionsInput } from './api/get-functions';
|
|
22
24
|
import { getFunctions } from './api/get-functions';
|
|
23
|
-
import type { GetOrCreateBucketInput, GetOrCreateBucketOutput } from './api/get-or-create-bucket';
|
|
24
25
|
import { getOrCreateBucket } from './api/get-or-create-bucket';
|
|
25
26
|
import { getRegions } from './api/get-regions';
|
|
26
27
|
import type { GetRenderProgressInput } from './api/get-render-progress';
|
|
@@ -33,11 +34,8 @@ import type { RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput } from './api/
|
|
|
33
34
|
import { renderVideoOnLambda } from './api/render-media-on-lambda';
|
|
34
35
|
import type { RenderStillOnLambdaInput, RenderStillOnLambdaOutput } from './api/render-still-on-lambda';
|
|
35
36
|
import { validateWebhookSignature } from './api/validate-webhook-signature';
|
|
36
|
-
import type { LambdaLSInput, LambdaLsReturnType } from './functions/helpers/io';
|
|
37
|
-
import type { EnhancedErrorInfo, LambdaErrorInfo } from './functions/helpers/write-lambda-error';
|
|
38
37
|
import { LambdaInternals } from './internals';
|
|
39
|
-
import type { AwsRegion } from './
|
|
40
|
-
import type { CustomCredentials } from './shared/aws-clients';
|
|
38
|
+
import type { AwsRegion } from './regions';
|
|
41
39
|
import type { RenderProgress } from './shared/constants';
|
|
42
40
|
import type { WebhookPayload } from './shared/invoke-webhook';
|
|
43
41
|
/**
|
|
@@ -57,4 +55,4 @@ declare const presignUrl: <CheckIfObjectExists extends boolean = false>({ region
|
|
|
57
55
|
*/
|
|
58
56
|
declare const getSites: ({ region, forceBucketName, }: GetSitesInput) => Promise<GetSitesOutput>;
|
|
59
57
|
export { LambdaInternals, deleteFunction, deleteRender, deleteSite, deployFunction, deploySite, downloadMedia, estimatePrice, getAwsClient, getCompositionsOnLambda, getFunctionInfo, getFunctions, getOrCreateBucket, getRegions, getRenderProgress, getRolePolicy, getSites, getUserPolicy, presignUrl, renderMediaOnLambda, renderStillOnLambda, renderVideoOnLambda, simulatePermissions, validateWebhookSignature, };
|
|
60
|
-
export type { AwsRegion, CustomCredentials, DeleteFunctionInput, DeleteRenderInput, DeleteSiteInput, DeleteSiteOutput, DeployFunctionInput, DeployFunctionOutput, DeploySiteInput, DeploySiteOutput, DownloadMediaInput, DownloadMediaOutput, EnhancedErrorInfo, EstimatePriceInput, FunctionInfo, GetAwsClientInput, GetAwsClientOutput, GetCompositionsOnLambdaInput, GetCompositionsOnLambdaOutput, GetFunctionInfoInput, GetFunctionsInput, GetOrCreateBucketInput, GetOrCreateBucketOutput, GetRenderProgressInput, GetSitesInput, GetSitesOutput, LambdaErrorInfo,
|
|
58
|
+
export type { AwsRegion, CustomCredentials, DeleteFunctionInput, DeleteRenderInput, DeleteSiteInput, DeleteSiteOutput, DeployFunctionInput, DeployFunctionOutput, DeploySiteInput, DeploySiteOutput, DownloadMediaInput, DownloadMediaOutput, EnhancedErrorInfo, EstimatePriceInput, FunctionInfo, GetAwsClientInput, GetAwsClientOutput, GetCompositionsOnLambdaInput, GetCompositionsOnLambdaOutput, GetFunctionInfoInput, GetFunctionsInput, GetOrCreateBucketInput, GetOrCreateBucketOutput, GetRenderProgressInput, GetSitesInput, GetSitesOutput, LambdaErrorInfo, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, RenderProgress, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, SimulatePermissionsInput, SimulatePermissionsOutput, WebhookPayload, };
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export declare const LambdaInternals: {
|
|
2
|
-
executeCommand: (args: string[], remotionRoot: string, logLevel: "
|
|
3
|
-
makeLambdaRenderMediaPayload: ({ 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, }: import("./api/make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("./
|
|
4
|
-
getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, }: import("./client").GetRenderProgressInput) => import("./
|
|
2
|
+
executeCommand: (args: string[], remotionRoot: string, logLevel: "verbose" | "info" | "warn" | "error", implementation: import("@remotion/serverless").ProviderSpecifics<import("./functions/aws-implementation").AwsProvider> | null) => Promise<void>;
|
|
3
|
+
makeLambdaRenderMediaPayload: ({ 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, }: import("./api/make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("@remotion/serverless/client").ServerlessStartPayload<import("./functions/aws-implementation").AwsProvider>>;
|
|
4
|
+
getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, }: import("./client").GetRenderProgressInput) => import("@remotion/serverless/client").ServerlessStatusPayload<import("./functions/aws-implementation").AwsProvider>;
|
|
5
5
|
makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, }: import("./api/render-still-on-lambda").RenderStillOnLambdaNonNullInput) => Promise<{
|
|
6
|
-
type: import("
|
|
6
|
+
type: import("@remotion/serverless/client").ServerlessRoutines.still;
|
|
7
7
|
serveUrl: string;
|
|
8
8
|
composition: string;
|
|
9
|
-
inputProps: import("
|
|
9
|
+
inputProps: import("@remotion/serverless/client").SerializedInputProps;
|
|
10
10
|
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
11
11
|
envVariables: Record<string, string>;
|
|
12
12
|
attempt: number;
|
|
13
13
|
jpegQuality: number | undefined;
|
|
14
14
|
maxRetries: number;
|
|
15
15
|
frame: number;
|
|
16
|
-
privacy: import("
|
|
17
|
-
logLevel: "
|
|
18
|
-
outName: import("./
|
|
16
|
+
privacy: import("@remotion/serverless/client").Privacy;
|
|
17
|
+
logLevel: "verbose" | "info" | "warn" | "error";
|
|
18
|
+
outName: import("@remotion/serverless/client").OutNameInput<import("./functions/aws-implementation").AwsProvider> | null;
|
|
19
19
|
timeoutInMilliseconds: number;
|
|
20
20
|
chromiumOptions: import("@remotion/renderer").ChromiumOptions;
|
|
21
21
|
scale: number;
|
|
22
|
-
downloadBehavior: import("
|
|
22
|
+
downloadBehavior: import("@remotion/serverless/client").DownloadBehavior;
|
|
23
23
|
version: string;
|
|
24
24
|
forceHeight: number | null;
|
|
25
25
|
forceWidth: number | null;
|
|
@@ -31,7 +31,7 @@ export declare const LambdaInternals: {
|
|
|
31
31
|
internalDeploySite: (args_0: {
|
|
32
32
|
entryPoint: string;
|
|
33
33
|
bucketName: string;
|
|
34
|
-
region: "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "
|
|
34
|
+
region: "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-south-1" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "af-south-1" | "ap-south-1" | "ap-east-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "me-south-1" | "sa-east-1";
|
|
35
35
|
} & {
|
|
36
36
|
siteName: string;
|
|
37
37
|
options: {
|
|
@@ -57,11 +57,11 @@ export declare const LambdaInternals: {
|
|
|
57
57
|
getValue: ({ commandLine }: {
|
|
58
58
|
commandLine: Record<string, unknown>;
|
|
59
59
|
}) => {
|
|
60
|
-
value: "
|
|
60
|
+
value: "verbose" | "info" | "warn" | "error";
|
|
61
61
|
source: string;
|
|
62
62
|
};
|
|
63
|
-
setConfig: (newLogLevel: "
|
|
64
|
-
type: "
|
|
63
|
+
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
64
|
+
type: "verbose" | "info" | "warn" | "error";
|
|
65
65
|
};
|
|
66
66
|
readonly throwIfSiteExists: {
|
|
67
67
|
cliFlag: string;
|
|
@@ -78,7 +78,9 @@ export declare const LambdaInternals: {
|
|
|
78
78
|
ssrName: string;
|
|
79
79
|
type: boolean;
|
|
80
80
|
};
|
|
81
|
-
}>
|
|
81
|
+
}> & {
|
|
82
|
+
providerSpecifics: import("@remotion/serverless").ProviderSpecifics<import("./functions/aws-implementation").AwsProvider>;
|
|
83
|
+
}) => Promise<{
|
|
82
84
|
serveUrl: string;
|
|
83
85
|
siteName: string;
|
|
84
86
|
stats: {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lambdaDeleteFileImplementation = void 0;
|
|
4
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
+
const get_s3_client_1 = require("../shared/get-s3-client");
|
|
6
|
+
const lambdaDeleteFileImplementation = async ({ bucketName, key, region, customCredentials, }) => {
|
|
7
|
+
await (0, get_s3_client_1.getS3Client)(region, customCredentials).send(new client_s3_1.DeleteObjectCommand({
|
|
8
|
+
Bucket: bucketName,
|
|
9
|
+
Key: key,
|
|
10
|
+
}));
|
|
11
|
+
};
|
|
12
|
+
exports.lambdaDeleteFileImplementation = lambdaDeleteFileImplementation;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lambdaHeadFileImplementation = void 0;
|
|
4
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
+
const get_s3_client_1 = require("../shared/get-s3-client");
|
|
6
|
+
const lambdaHeadFileImplementation = async ({ bucketName, key, region, customCredentials, }) => {
|
|
7
|
+
const head = await (0, get_s3_client_1.getS3Client)(region, customCredentials).send(new client_s3_1.HeadObjectCommand({
|
|
8
|
+
Bucket: bucketName,
|
|
9
|
+
Key: key,
|
|
10
|
+
}));
|
|
11
|
+
return head;
|
|
12
|
+
};
|
|
13
|
+
exports.lambdaHeadFileImplementation = lambdaHeadFileImplementation;
|