@remotion/lambda-client 4.0.303 → 4.0.305

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @remotion/lambda-client@4.0.303 make /Users/jonathanburger/remotion/packages/lambda-client
3
+ > @remotion/lambda-client@4.0.305 make /Users/jonathanburger/remotion/packages/lambda-client
4
4
  > tsc -d && bun --env-file=../.env.bundle bundle.ts
5
5
 
6
- [75.36ms] Generated.
6
+ [92.40ms] Generated.
@@ -17,7 +17,9 @@ export type AwsProvider = {
17
17
  vpcSecurityGroupIds: string;
18
18
  runtimePreference: RuntimePreference;
19
19
  };
20
+ storageClass: StorageClass;
20
21
  };
22
+ import type { StorageClass } from '@aws-sdk/client-s3';
21
23
  import type { ProviderSpecifics } from '@remotion/serverless-client';
22
24
  import type { RuntimePreference } from './runtime-preference';
23
25
  export declare const awsImplementation: ProviderSpecifics<AwsProvider>;
@@ -16874,7 +16874,7 @@ var validateFramesPerFunction = ({
16874
16874
  throw new TypeError(`The framesPerLambda needs to be at least ${effectiveMinimum}, but is ${framesPerFunction}`);
16875
16875
  }
16876
16876
  };
16877
- var VERSION = "4.0.303";
16877
+ var VERSION = "4.0.305";
16878
16878
  var isColorSupported = () => {
16879
16879
  const env = process.env || {};
16880
16880
  const isForceDisabled = "NO_COLOR" in env;
@@ -17386,7 +17386,8 @@ var compressInputProps = async ({
17386
17386
  expectedBucketOwner: null,
17387
17387
  key: makeKey(propsType, hash),
17388
17388
  privacy: "private",
17389
- forcePathStyle
17389
+ forcePathStyle,
17390
+ storageClass: null
17390
17391
  });
17391
17392
  return {
17392
17393
  type: "bucket-url",
@@ -20697,7 +20698,8 @@ var tryLambdaWriteFile = async ({
20697
20698
  expectedBucketOwner,
20698
20699
  downloadBehavior,
20699
20700
  customCredentials,
20700
- forcePathStyle
20701
+ forcePathStyle,
20702
+ storageClass
20701
20703
  }) => {
20702
20704
  const client = getS3Client({
20703
20705
  region,
@@ -20711,7 +20713,8 @@ var tryLambdaWriteFile = async ({
20711
20713
  ACL: privacy === "no-acl" ? undefined : privacy === "private" ? "private" : "public-read",
20712
20714
  ExpectedBucketOwner: customCredentials ? undefined : expectedBucketOwner ?? undefined,
20713
20715
  ContentType: mimeTypes.lookup(key) || "application/octet-stream",
20714
- ContentDisposition: getContentDispositionHeader(downloadBehavior)
20716
+ ContentDisposition: getContentDispositionHeader(downloadBehavior),
20717
+ StorageClass: storageClass ?? undefined
20715
20718
  };
20716
20719
  const size = body instanceof Buffer || body instanceof Uint8Array ? body.length : body instanceof Blob ? body.size : typeof body === "string" ? Buffer.from(body).length : null;
20717
20720
  if (size === null || size > MULTIPART_THRESHOLD) {
@@ -21115,7 +21118,8 @@ var makeLambdaRenderMediaPayload = async ({
21115
21118
  forcePathStyle,
21116
21119
  metadata,
21117
21120
  apiKey,
21118
- offthreadVideoThreads
21121
+ offthreadVideoThreads,
21122
+ storageClass
21119
21123
  }) => {
21120
21124
  const actualCodec = validateLambdaCodec(codec);
21121
21125
  validateServeUrl(serveUrl);
@@ -21189,7 +21193,8 @@ var makeLambdaRenderMediaPayload = async ({
21189
21193
  forcePathStyle: forcePathStyle ?? false,
21190
21194
  metadata: metadata ?? null,
21191
21195
  apiKey: apiKey ?? null,
21192
- offthreadVideoThreads: offthreadVideoThreads ?? null
21196
+ offthreadVideoThreads: offthreadVideoThreads ?? null,
21197
+ storageClass: storageClass ?? null
21193
21198
  };
21194
21199
  };
21195
21200
  var getRenderProgressPayload = ({
@@ -21214,7 +21219,6 @@ var makeLambdaRenderStillPayload = async ({
21214
21219
  inputProps,
21215
21220
  imageFormat,
21216
21221
  envVariables,
21217
- quality,
21218
21222
  jpegQuality,
21219
21223
  region,
21220
21224
  maxRetries,
@@ -21233,11 +21237,9 @@ var makeLambdaRenderStillPayload = async ({
21233
21237
  offthreadVideoCacheSizeInBytes,
21234
21238
  deleteAfter,
21235
21239
  forcePathStyle,
21236
- apiKey
21240
+ apiKey,
21241
+ storageClass
21237
21242
  }) => {
21238
- if (quality) {
21239
- throw new Error("The `quality` option is deprecated. Use `jpegQuality` instead.");
21240
- }
21241
21243
  const stringifiedInputProps = serializeOrThrow(inputProps, "input-props");
21242
21244
  const serializedInputProps = await compressInputProps({
21243
21245
  stringifiedInputProps,
@@ -21283,7 +21285,8 @@ var makeLambdaRenderStillPayload = async ({
21283
21285
  streamed: true,
21284
21286
  forcePathStyle,
21285
21287
  apiKey: apiKey ?? null,
21286
- offthreadVideoThreads: null
21288
+ offthreadVideoThreads: null,
21289
+ storageClass: storageClass ?? null
21287
21290
  };
21288
21291
  };
21289
21292
 
@@ -21385,7 +21388,8 @@ var renderMediaOnLambdaOptionalToRequired = (options) => {
21385
21388
  forcePathStyle: options.forcePathStyle ?? false,
21386
21389
  indent: false,
21387
21390
  metadata: options.metadata ?? null,
21388
- apiKey: options.apiKey ?? null
21391
+ apiKey: options.apiKey ?? null,
21392
+ storageClass: options.storageClass ?? null
21389
21393
  };
21390
21394
  };
21391
21395
  var wrapped = wrapWithErrorHandling(internalRenderMediaOnLambdaRaw);
@@ -21397,6 +21401,108 @@ var renderMediaOnLambda = (options) => {
21397
21401
  };
21398
21402
  var renderVideoOnLambda = renderMediaOnLambda;
21399
21403
 
21404
+ // src/render-still-on-lambda.ts
21405
+ var innerRenderStillOnLambda = async (input) => {
21406
+ const { functionName, region, onInit } = input;
21407
+ try {
21408
+ const payload = await makeLambdaRenderStillPayload(input);
21409
+ const res = await new Promise((resolve, reject) => {
21410
+ awsImplementation.callFunctionStreaming({
21411
+ functionName,
21412
+ type: ServerlessRoutines.still,
21413
+ payload,
21414
+ region,
21415
+ receivedStreamingPayload: ({ message }) => {
21416
+ if (message.type === "render-id-determined") {
21417
+ onInit?.({
21418
+ renderId: message.payload.renderId,
21419
+ cloudWatchLogs: getCloudwatchMethodUrl({
21420
+ functionName,
21421
+ method: ServerlessRoutines.still,
21422
+ region,
21423
+ rendererFunctionName: null,
21424
+ renderId: message.payload.renderId
21425
+ }),
21426
+ lambdaInsightsUrl: getLambdaInsightsUrl({
21427
+ functionName,
21428
+ region
21429
+ })
21430
+ });
21431
+ }
21432
+ if (message.type === "error-occurred") {
21433
+ reject(new Error(message.payload.error));
21434
+ }
21435
+ if (message.type === "still-rendered") {
21436
+ resolve(message.payload);
21437
+ }
21438
+ },
21439
+ timeoutInTest: 120000,
21440
+ retriesRemaining: input.maxRetries
21441
+ }).then(() => {
21442
+ reject(new Error("Expected response to be streamed"));
21443
+ }).catch((err) => {
21444
+ reject(err);
21445
+ });
21446
+ });
21447
+ return {
21448
+ estimatedPrice: res.estimatedPrice,
21449
+ url: res.output,
21450
+ outKey: res.outKey,
21451
+ sizeInBytes: res.size,
21452
+ bucketName: res.bucketName,
21453
+ renderId: res.renderId,
21454
+ cloudWatchLogs: getCloudwatchMethodUrl({
21455
+ functionName,
21456
+ method: ServerlessRoutines.still,
21457
+ region,
21458
+ renderId: res.renderId,
21459
+ rendererFunctionName: null
21460
+ }),
21461
+ artifacts: res.receivedArtifacts
21462
+ };
21463
+ } catch (err) {
21464
+ if (err.stack?.includes("UnrecognizedClientException")) {
21465
+ throw new Error("UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception");
21466
+ }
21467
+ throw err;
21468
+ }
21469
+ };
21470
+ var internalRenderStillOnLambda = wrapWithErrorHandling(innerRenderStillOnLambda);
21471
+ var renderStillOnLambda = (input) => {
21472
+ return internalRenderStillOnLambda({
21473
+ chromiumOptions: input.chromiumOptions ?? {},
21474
+ composition: input.composition,
21475
+ deleteAfter: input.deleteAfter ?? null,
21476
+ downloadBehavior: input.downloadBehavior ?? { type: "play-in-browser" },
21477
+ envVariables: input.envVariables ?? {},
21478
+ forceBucketName: input.forceBucketName ?? null,
21479
+ forceHeight: input.forceHeight ?? null,
21480
+ forceWidth: input.forceWidth ?? null,
21481
+ frame: input.frame ?? 0,
21482
+ functionName: input.functionName,
21483
+ imageFormat: input.imageFormat,
21484
+ indent: false,
21485
+ inputProps: input.inputProps,
21486
+ maxRetries: input.maxRetries ?? DEFAULT_MAX_RETRIES,
21487
+ onInit: input.onInit ?? (() => {
21488
+ return;
21489
+ }),
21490
+ outName: input.outName ?? null,
21491
+ privacy: input.privacy,
21492
+ region: input.region,
21493
+ serveUrl: input.serveUrl,
21494
+ jpegQuality: input.jpegQuality ?? input.quality ?? 80,
21495
+ logLevel: input.dumpBrowserLogs ? "verbose" : input.logLevel ?? "info",
21496
+ offthreadVideoCacheSizeInBytes: input.offthreadVideoCacheSizeInBytes ?? null,
21497
+ scale: input.scale ?? 1,
21498
+ timeoutInMilliseconds: input.timeoutInMilliseconds ?? 30000,
21499
+ forcePathStyle: input.forcePathStyle ?? false,
21500
+ apiKey: input.apiKey ?? null,
21501
+ offthreadVideoThreads: input.offthreadVideoThreads ?? null,
21502
+ storageClass: input.storageClass ?? null
21503
+ });
21504
+ };
21505
+
21400
21506
  // src/runtime-preference.ts
21401
21507
  var runtimePreferenceOptions = [
21402
21508
  "default",
@@ -21792,108 +21898,6 @@ var presignUrl = ({
21792
21898
  forcePathStyle: forcePathStyle ?? false
21793
21899
  });
21794
21900
  };
21795
- // src/render-still-on-lambda.ts
21796
- var internalRenderStillOnLambda = async (input) => {
21797
- const { functionName, region, onInit } = input;
21798
- try {
21799
- const payload = await makeLambdaRenderStillPayload(input);
21800
- const res = await new Promise((resolve, reject) => {
21801
- awsImplementation.callFunctionStreaming({
21802
- functionName,
21803
- type: ServerlessRoutines.still,
21804
- payload,
21805
- region,
21806
- receivedStreamingPayload: ({ message }) => {
21807
- if (message.type === "render-id-determined") {
21808
- onInit?.({
21809
- renderId: message.payload.renderId,
21810
- cloudWatchLogs: getCloudwatchMethodUrl({
21811
- functionName,
21812
- method: ServerlessRoutines.still,
21813
- region,
21814
- rendererFunctionName: null,
21815
- renderId: message.payload.renderId
21816
- }),
21817
- lambdaInsightsUrl: getLambdaInsightsUrl({
21818
- functionName,
21819
- region
21820
- })
21821
- });
21822
- }
21823
- if (message.type === "error-occurred") {
21824
- reject(new Error(message.payload.error));
21825
- }
21826
- if (message.type === "still-rendered") {
21827
- resolve(message.payload);
21828
- }
21829
- },
21830
- timeoutInTest: 120000,
21831
- retriesRemaining: input.maxRetries
21832
- }).then(() => {
21833
- reject(new Error("Expected response to be streamed"));
21834
- }).catch((err) => {
21835
- reject(err);
21836
- });
21837
- });
21838
- return {
21839
- estimatedPrice: res.estimatedPrice,
21840
- url: res.output,
21841
- outKey: res.outKey,
21842
- sizeInBytes: res.size,
21843
- bucketName: res.bucketName,
21844
- renderId: res.renderId,
21845
- cloudWatchLogs: getCloudwatchMethodUrl({
21846
- functionName,
21847
- method: ServerlessRoutines.still,
21848
- region,
21849
- renderId: res.renderId,
21850
- rendererFunctionName: null
21851
- }),
21852
- artifacts: res.receivedArtifacts
21853
- };
21854
- } catch (err) {
21855
- if (err.stack?.includes("UnrecognizedClientException")) {
21856
- throw new Error("UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception");
21857
- }
21858
- throw err;
21859
- }
21860
- };
21861
- var errorHandled = wrapWithErrorHandling(internalRenderStillOnLambda);
21862
- var renderStillOnLambda = (input) => {
21863
- return errorHandled({
21864
- chromiumOptions: input.chromiumOptions ?? {},
21865
- composition: input.composition,
21866
- deleteAfter: input.deleteAfter ?? null,
21867
- downloadBehavior: input.downloadBehavior ?? { type: "play-in-browser" },
21868
- envVariables: input.envVariables ?? {},
21869
- forceBucketName: input.forceBucketName ?? null,
21870
- forceHeight: input.forceHeight ?? null,
21871
- forceWidth: input.forceWidth ?? null,
21872
- frame: input.frame ?? 0,
21873
- functionName: input.functionName,
21874
- imageFormat: input.imageFormat,
21875
- indent: false,
21876
- inputProps: input.inputProps,
21877
- maxRetries: input.maxRetries ?? DEFAULT_MAX_RETRIES,
21878
- onInit: input.onInit ?? (() => {
21879
- return;
21880
- }),
21881
- outName: input.outName ?? null,
21882
- privacy: input.privacy,
21883
- quality: undefined,
21884
- region: input.region,
21885
- serveUrl: input.serveUrl,
21886
- jpegQuality: input.jpegQuality ?? 80,
21887
- logLevel: input.dumpBrowserLogs ? "verbose" : input.logLevel ?? "info",
21888
- offthreadVideoCacheSizeInBytes: input.offthreadVideoCacheSizeInBytes ?? null,
21889
- scale: input.scale ?? 1,
21890
- timeoutInMilliseconds: input.timeoutInMilliseconds ?? 30000,
21891
- dumpBrowserLogs: false,
21892
- forcePathStyle: input.forcePathStyle ?? false,
21893
- apiKey: input.apiKey ?? null,
21894
- offthreadVideoThreads: input.offthreadVideoThreads ?? null
21895
- });
21896
- };
21897
21901
 
21898
21902
  // src/index.ts
21899
21903
  var LambdaClientInternals = {
@@ -21932,6 +21936,7 @@ var LambdaClientInternals = {
21932
21936
  validateServeUrl,
21933
21937
  getEnvVariable,
21934
21938
  internalRenderMediaOnLambdaRaw,
21939
+ internalRenderStillOnLambda,
21935
21940
  cleanItems,
21936
21941
  makeLambdaRenderStillPayload,
21937
21942
  getRenderProgressPayload,
package/dist/index.d.ts CHANGED
@@ -69,7 +69,7 @@ export declare const LambdaClientInternals: {
69
69
  parseBucketName: (name: string) => {
70
70
  region: import("./regions").AwsRegion | null;
71
71
  };
72
- 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, forcePathStyle, metadata, apiKey, offthreadVideoThreads, }: import("./make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("@remotion/serverless-client").ServerlessStartPayload<import("./aws-provider").AwsProvider>>;
72
+ 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, forcePathStyle, metadata, apiKey, offthreadVideoThreads, storageClass, }: import("./make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("@remotion/serverless-client").ServerlessStartPayload<import("./aws-provider").AwsProvider>>;
73
73
  renderMediaOnLambdaOptionalToRequired: (options: import("./render-media-on-lambda").RenderMediaOnLambdaInput) => import("./make-lambda-payload").InnerRenderMediaOnLambdaInput;
74
74
  internalDeleteRender: (input: import("./delete-render").DeleteRenderInput & {
75
75
  providerSpecifics: import("@remotion/serverless-client").ProviderSpecifics<import("./aws-provider").AwsProvider>;
@@ -103,6 +103,7 @@ export declare const LambdaClientInternals: {
103
103
  validateServeUrl: (serveUrl: unknown) => void;
104
104
  getEnvVariable: (name: string) => string | undefined;
105
105
  internalRenderMediaOnLambdaRaw: (input: import("./make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("./render-media-on-lambda").RenderMediaOnLambdaOutput>;
106
+ internalRenderStillOnLambda: (input: import("./render-still-on-lambda").RenderStillOnLambdaNonNullInput) => Promise<import("./render-still-on-lambda").RenderStillOnLambdaOutput>;
106
107
  cleanItems: <Provider extends import("@remotion/serverless-client").CloudProvider>({ bucket, onAfterItemDeleted, onBeforeItemDeleted, region, list, providerSpecifics, forcePathStyle, }: {
107
108
  bucket: string;
108
109
  region: Provider["region"];
@@ -118,7 +119,7 @@ export declare const LambdaClientInternals: {
118
119
  providerSpecifics: import("@remotion/serverless-client").ProviderSpecifics<Provider>;
119
120
  forcePathStyle: boolean;
120
121
  }) => Promise<void[]>;
121
- makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, }: import("./render-still-on-lambda").RenderStillOnLambdaNonNullInput) => Promise<import("@remotion/serverless-client").ServerlessPayloads<import("./aws-provider").AwsProvider>[import("@remotion/serverless-client").ServerlessRoutines.still]>;
122
+ makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, storageClass, }: import("./render-still-on-lambda").RenderStillOnLambdaNonNullInput) => Promise<import("@remotion/serverless-client").ServerlessPayloads<import("./aws-provider").AwsProvider>[import("@remotion/serverless-client").ServerlessRoutines.still]>;
122
123
  getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, forcePathStyle, }: import("./get-render-progress").GetRenderProgressInput) => import("@remotion/serverless-client").ServerlessStatusPayload<import("./aws-provider").AwsProvider>;
123
124
  innerSpeculateFunctionName: ({ diskSizeInMb, memorySizeInMb, timeoutInSeconds, }: import("./speculate-function-name").SpeculateFunctionNameInput) => string;
124
125
  };
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ const p_limit_1 = require("./p-limit");
21
21
  const parse_function_name_1 = require("./parse-function-name");
22
22
  const random_hash_1 = require("./random-hash");
23
23
  const render_media_on_lambda_1 = require("./render-media-on-lambda");
24
+ const render_still_on_lambda_1 = require("./render-still-on-lambda");
24
25
  const runtime_preference_1 = require("./runtime-preference");
25
26
  const speculate_function_name_1 = require("./speculate-function-name");
26
27
  const validate_aws_region_1 = require("./validate-aws-region");
@@ -57,8 +58,8 @@ Object.defineProperty(exports, "presignUrl", { enumerable: true, get: function (
57
58
  var render_media_on_lambda_2 = require("./render-media-on-lambda");
58
59
  Object.defineProperty(exports, "renderMediaOnLambda", { enumerable: true, get: function () { return render_media_on_lambda_2.renderMediaOnLambda; } });
59
60
  Object.defineProperty(exports, "renderVideoOnLambda", { enumerable: true, get: function () { return render_media_on_lambda_2.renderVideoOnLambda; } });
60
- var render_still_on_lambda_1 = require("./render-still-on-lambda");
61
- Object.defineProperty(exports, "renderStillOnLambda", { enumerable: true, get: function () { return render_still_on_lambda_1.renderStillOnLambda; } });
61
+ var render_still_on_lambda_2 = require("./render-still-on-lambda");
62
+ Object.defineProperty(exports, "renderStillOnLambda", { enumerable: true, get: function () { return render_still_on_lambda_2.renderStillOnLambda; } });
62
63
  var speculate_function_name_2 = require("./speculate-function-name");
63
64
  Object.defineProperty(exports, "speculateFunctionName", { enumerable: true, get: function () { return speculate_function_name_2.speculateFunctionName; } });
64
65
  var validate_webhook_signature_1 = require("./validate-webhook-signature");
@@ -99,6 +100,7 @@ exports.LambdaClientInternals = {
99
100
  validateServeUrl: validate_serveurl_1.validateServeUrl,
100
101
  getEnvVariable: get_env_variable_1.getEnvVariable,
101
102
  internalRenderMediaOnLambdaRaw: render_media_on_lambda_1.internalRenderMediaOnLambdaRaw,
103
+ internalRenderStillOnLambda: render_still_on_lambda_1.internalRenderStillOnLambda,
102
104
  cleanItems: clean_items_1.cleanItems,
103
105
  makeLambdaRenderStillPayload: make_lambda_payload_1.makeLambdaRenderStillPayload,
104
106
  getRenderProgressPayload: make_lambda_payload_1.getRenderProgressPayload,
@@ -1,6 +1,7 @@
1
1
  import type { AudioCodec, BrowserSafeApis, ChromiumOptions, ColorSpace, DeleteAfter, DownloadBehavior, FrameRange, LogLevel, OutNameInput, PixelFormat, Privacy, ProResProfile, ServerlessCodec, ServerlessPayloads, ServerlessStartPayload, ServerlessStatusPayload, ToOptions, VideoImageFormat, WebhookOption, X264Preset } from '@remotion/serverless-client';
2
2
  import { ServerlessRoutines } from '@remotion/serverless-client';
3
3
  import type { AwsProvider } from './aws-provider';
4
+ import type { StorageClass } from '@aws-sdk/client-s3';
4
5
  import type { GetRenderProgressInput } from './get-render-progress';
5
6
  import type { AwsRegion } from './regions';
6
7
  import type { RenderStillOnLambdaNonNullInput } from './render-still-on-lambda';
@@ -48,7 +49,8 @@ export type InnerRenderMediaOnLambdaInput = {
48
49
  indent: boolean;
49
50
  forcePathStyle: boolean;
50
51
  metadata: Record<string, string> | null;
52
+ storageClass: StorageClass | null;
51
53
  } & ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>;
52
- export declare const 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, forcePathStyle, metadata, apiKey, offthreadVideoThreads, }: InnerRenderMediaOnLambdaInput) => Promise<ServerlessStartPayload<AwsProvider>>;
54
+ export declare const 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, forcePathStyle, metadata, apiKey, offthreadVideoThreads, storageClass, }: InnerRenderMediaOnLambdaInput) => Promise<ServerlessStartPayload<AwsProvider>>;
53
55
  export declare const getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, forcePathStyle, }: GetRenderProgressInput) => ServerlessStatusPayload<AwsProvider>;
54
- export declare const makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, }: RenderStillOnLambdaNonNullInput) => Promise<ServerlessPayloads<AwsProvider>[ServerlessRoutines.still]>;
56
+ export declare const makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, storageClass, }: RenderStillOnLambdaNonNullInput) => Promise<ServerlessPayloads<AwsProvider>[ServerlessRoutines.still]>;
@@ -6,7 +6,7 @@ const aws_provider_1 = require("./aws-provider");
6
6
  const serverless_client_2 = require("@remotion/serverless-client");
7
7
  const validate_lambda_codec_1 = require("./validate-lambda-codec");
8
8
  const validate_serveurl_1 = require("./validate-serveurl");
9
- const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, forcePathStyle, metadata, apiKey, offthreadVideoThreads, }) => {
9
+ const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, forcePathStyle, metadata, apiKey, offthreadVideoThreads, storageClass, }) => {
10
10
  const actualCodec = (0, validate_lambda_codec_1.validateLambdaCodec)(codec);
11
11
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
12
12
  (0, serverless_client_1.validateFramesPerFunction)({
@@ -80,6 +80,7 @@ const makeLambdaRenderMediaPayload = async ({ rendererFunctionName, frameRange,
80
80
  metadata: metadata !== null && metadata !== void 0 ? metadata : null,
81
81
  apiKey: apiKey !== null && apiKey !== void 0 ? apiKey : null,
82
82
  offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
83
+ storageClass: storageClass !== null && storageClass !== void 0 ? storageClass : null,
83
84
  };
84
85
  };
85
86
  exports.makeLambdaRenderMediaPayload = makeLambdaRenderMediaPayload;
@@ -95,10 +96,7 @@ const getRenderProgressPayload = ({ bucketName, renderId, s3OutputProvider, logL
95
96
  };
96
97
  };
97
98
  exports.getRenderProgressPayload = getRenderProgressPayload;
98
- const makeLambdaRenderStillPayload = async ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, }) => {
99
- if (quality) {
100
- throw new Error('The `quality` option is deprecated. Use `jpegQuality` instead.');
101
- }
99
+ const makeLambdaRenderStillPayload = async ({ serveUrl, inputProps, imageFormat, envVariables, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, storageClass, }) => {
102
100
  const stringifiedInputProps = (0, serverless_client_1.serializeOrThrow)(inputProps, 'input-props');
103
101
  const serializedInputProps = await (0, serverless_client_1.compressInputProps)({
104
102
  stringifiedInputProps,
@@ -145,6 +143,7 @@ const makeLambdaRenderStillPayload = async ({ serveUrl, inputProps, imageFormat,
145
143
  forcePathStyle,
146
144
  apiKey: apiKey !== null && apiKey !== void 0 ? apiKey : null,
147
145
  offthreadVideoThreads: null,
146
+ storageClass: storageClass !== null && storageClass !== void 0 ? storageClass : null,
148
147
  };
149
148
  };
150
149
  exports.makeLambdaRenderStillPayload = makeLambdaRenderStillPayload;
@@ -1,3 +1,4 @@
1
+ import type { StorageClass } from '@aws-sdk/client-s3';
1
2
  import type { AudioCodec, BrowserSafeApis, ChromiumOptions, DownloadBehavior, FrameRange, OutNameInput, PixelFormat, Privacy, ProResProfile, ServerlessCodec, ToOptions, VideoImageFormat, WebhookOption } from '@remotion/serverless-client';
2
3
  import { type AwsProvider } from './aws-provider';
3
4
  import type { InnerRenderMediaOnLambdaInput } from './make-lambda-payload';
@@ -42,6 +43,7 @@ export type RenderMediaOnLambdaInput = {
42
43
  dumpBrowserLogs?: boolean;
43
44
  forcePathStyle?: boolean;
44
45
  metadata?: Record<string, string> | null;
46
+ storageClass?: StorageClass | null;
45
47
  } & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>>;
46
48
  export type RenderMediaOnLambdaOutput = {
47
49
  renderId: string;
@@ -58,7 +58,7 @@ const internalRenderMediaOnLambdaRaw = async (input) => {
58
58
  };
59
59
  exports.internalRenderMediaOnLambdaRaw = internalRenderMediaOnLambdaRaw;
60
60
  const renderMediaOnLambdaOptionalToRequired = (options) => {
61
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
61
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
62
62
  return {
63
63
  offthreadVideoThreads: (_a = options.offthreadVideoThreads) !== null && _a !== void 0 ? _a : null,
64
64
  audioBitrate: (_b = options.audioBitrate) !== null && _b !== void 0 ? _b : null,
@@ -107,6 +107,7 @@ const renderMediaOnLambdaOptionalToRequired = (options) => {
107
107
  indent: false,
108
108
  metadata: (_14 = options.metadata) !== null && _14 !== void 0 ? _14 : null,
109
109
  apiKey: (_15 = options.apiKey) !== null && _15 !== void 0 ? _15 : null,
110
+ storageClass: (_16 = options.storageClass) !== null && _16 !== void 0 ? _16 : null,
110
111
  };
111
112
  };
112
113
  exports.renderMediaOnLambdaOptionalToRequired = renderMediaOnLambdaOptionalToRequired;
@@ -1,4 +1,5 @@
1
1
  import type { BrowserSafeApis, ChromiumOptions, DownloadBehavior, StillImageFormat, ToOptions } from '@remotion/serverless-client';
2
+ import type { StorageClass } from '@aws-sdk/client-s3';
2
3
  import type { CostsInfo, OutNameInput, Privacy, ReceivedArtifact } from '@remotion/serverless-client';
3
4
  import { type AwsProvider } from './aws-provider';
4
5
  import type { AwsRegion } from './regions';
@@ -14,10 +15,6 @@ type MandatoryParameters = {
14
15
  type OptionalParameters = {
15
16
  maxRetries: number;
16
17
  envVariables: Record<string, string>;
17
- /**
18
- * @deprecated Renamed to `jpegQuality`
19
- */
20
- quality?: never;
21
18
  frame: number;
22
19
  outName: OutNameInput<AwsProvider> | null;
23
20
  chromiumOptions: ChromiumOptions;
@@ -25,10 +22,6 @@ type OptionalParameters = {
25
22
  forceWidth: number | null;
26
23
  forceHeight: number | null;
27
24
  forceBucketName: string | null;
28
- /**
29
- * @deprecated Renamed to `logLevel`
30
- */
31
- dumpBrowserLogs: boolean;
32
25
  onInit: (data: {
33
26
  renderId: string;
34
27
  cloudWatchLogs: string;
@@ -36,6 +29,7 @@ type OptionalParameters = {
36
29
  }) => void;
37
30
  indent: boolean;
38
31
  forcePathStyle: boolean;
32
+ storageClass: StorageClass | null;
39
33
  } & ToOptions<typeof BrowserSafeApis.optionsMap.renderStillOnLambda>;
40
34
  export type RenderStillOnLambdaNonNullInput = MandatoryParameters & OptionalParameters;
41
35
  export type RenderStillOnLambdaInput = MandatoryParameters & Partial<OptionalParameters>;
@@ -49,5 +43,15 @@ export type RenderStillOnLambdaOutput = {
49
43
  cloudWatchLogs: string;
50
44
  artifacts: ReceivedArtifact<AwsProvider>[];
51
45
  };
52
- export declare const renderStillOnLambda: (input: RenderStillOnLambdaInput) => Promise<RenderStillOnLambdaOutput>;
46
+ export declare const internalRenderStillOnLambda: (input: RenderStillOnLambdaNonNullInput) => Promise<RenderStillOnLambdaOutput>;
47
+ export declare const renderStillOnLambda: (input: RenderStillOnLambdaInput & {
48
+ /**
49
+ * @deprecated Renamed to `jpegQuality`
50
+ */
51
+ quality?: never;
52
+ /**
53
+ * @deprecated Renamed to `logLevel`
54
+ */
55
+ dumpBrowserLogs?: boolean;
56
+ }) => Promise<RenderStillOnLambdaOutput>;
53
57
  export {};
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.renderStillOnLambda = void 0;
3
+ exports.renderStillOnLambda = exports.internalRenderStillOnLambda = void 0;
4
4
  const serverless_client_1 = require("@remotion/serverless-client");
5
5
  const serverless_client_2 = require("@remotion/serverless-client");
6
6
  const aws_provider_1 = require("./aws-provider");
7
7
  const constants_1 = require("./constants");
8
8
  const get_aws_urls_1 = require("./get-aws-urls");
9
9
  const make_lambda_payload_1 = require("./make-lambda-payload");
10
- const internalRenderStillOnLambda = async (input) => {
10
+ const innerRenderStillOnLambda = async (input) => {
11
11
  var _a;
12
12
  const { functionName, region, onInit } = input;
13
13
  try {
@@ -77,14 +77,14 @@ const internalRenderStillOnLambda = async (input) => {
77
77
  throw err;
78
78
  }
79
79
  };
80
- const errorHandled = (0, serverless_client_2.wrapWithErrorHandling)(internalRenderStillOnLambda);
80
+ exports.internalRenderStillOnLambda = (0, serverless_client_2.wrapWithErrorHandling)(innerRenderStillOnLambda);
81
81
  /*
82
82
  * @description Renders a still image inside a lambda function and writes it to the specified output location.
83
83
  * @see [Documentation](https://remotion.dev/docs/lambda/renderstillonlambda)
84
84
  */
85
85
  const renderStillOnLambda = (input) => {
86
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
87
- return errorHandled({
86
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
87
+ return (0, exports.internalRenderStillOnLambda)({
88
88
  chromiumOptions: (_a = input.chromiumOptions) !== null && _a !== void 0 ? _a : {},
89
89
  composition: input.composition,
90
90
  deleteAfter: (_b = input.deleteAfter) !== null && _b !== void 0 ? _b : null,
@@ -102,18 +102,17 @@ const renderStillOnLambda = (input) => {
102
102
  onInit: (_k = input.onInit) !== null && _k !== void 0 ? _k : (() => undefined),
103
103
  outName: (_l = input.outName) !== null && _l !== void 0 ? _l : null,
104
104
  privacy: input.privacy,
105
- quality: undefined,
106
105
  region: input.region,
107
106
  serveUrl: input.serveUrl,
108
- jpegQuality: (_m = input.jpegQuality) !== null && _m !== void 0 ? _m : 80,
109
- logLevel: input.dumpBrowserLogs ? 'verbose' : ((_o = input.logLevel) !== null && _o !== void 0 ? _o : 'info'),
110
- offthreadVideoCacheSizeInBytes: (_p = input.offthreadVideoCacheSizeInBytes) !== null && _p !== void 0 ? _p : null,
111
- scale: (_q = input.scale) !== null && _q !== void 0 ? _q : 1,
112
- timeoutInMilliseconds: (_r = input.timeoutInMilliseconds) !== null && _r !== void 0 ? _r : 30000,
113
- dumpBrowserLogs: false,
114
- forcePathStyle: (_s = input.forcePathStyle) !== null && _s !== void 0 ? _s : false,
115
- apiKey: (_t = input.apiKey) !== null && _t !== void 0 ? _t : null,
116
- offthreadVideoThreads: (_u = input.offthreadVideoThreads) !== null && _u !== void 0 ? _u : null,
107
+ jpegQuality: (_o = (_m = input.jpegQuality) !== null && _m !== void 0 ? _m : input.quality) !== null && _o !== void 0 ? _o : 80,
108
+ logLevel: input.dumpBrowserLogs ? 'verbose' : ((_p = input.logLevel) !== null && _p !== void 0 ? _p : 'info'),
109
+ offthreadVideoCacheSizeInBytes: (_q = input.offthreadVideoCacheSizeInBytes) !== null && _q !== void 0 ? _q : null,
110
+ scale: (_r = input.scale) !== null && _r !== void 0 ? _r : 1,
111
+ timeoutInMilliseconds: (_s = input.timeoutInMilliseconds) !== null && _s !== void 0 ? _s : 30000,
112
+ forcePathStyle: (_t = input.forcePathStyle) !== null && _t !== void 0 ? _t : false,
113
+ apiKey: (_u = input.apiKey) !== null && _u !== void 0 ? _u : null,
114
+ offthreadVideoThreads: (_v = input.offthreadVideoThreads) !== null && _v !== void 0 ? _v : null,
115
+ storageClass: (_w = input.storageClass) !== null && _w !== void 0 ? _w : null,
117
116
  });
118
117
  };
119
118
  exports.renderStillOnLambda = renderStillOnLambda;
@@ -11,7 +11,7 @@ const content_disposition_header_1 = require("./content-disposition-header");
11
11
  const get_s3_client_1 = require("./get-s3-client");
12
12
  // Files larger than 100MB will use multipart upload
13
13
  const MULTIPART_THRESHOLD = 100 * 1024 * 1024; // 5MB in bytes
14
- const tryLambdaWriteFile = async ({ bucketName, key, body, region, privacy, expectedBucketOwner, downloadBehavior, customCredentials, forcePathStyle, }) => {
14
+ const tryLambdaWriteFile = async ({ bucketName, key, body, region, privacy, expectedBucketOwner, downloadBehavior, customCredentials, forcePathStyle, storageClass, }) => {
15
15
  const client = (0, get_s3_client_1.getS3Client)({
16
16
  region,
17
17
  customCredentials: customCredentials,
@@ -31,6 +31,7 @@ const tryLambdaWriteFile = async ({ bucketName, key, body, region, privacy, expe
31
31
  : (expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined),
32
32
  ContentType: mime_types_1.default.lookup(key) || 'application/octet-stream',
33
33
  ContentDisposition: (0, content_disposition_header_1.getContentDispositionHeader)(downloadBehavior),
34
+ StorageClass: storageClass !== null && storageClass !== void 0 ? storageClass : undefined,
34
35
  };
35
36
  // Determine file size
36
37
  const size = body instanceof Buffer || body instanceof Uint8Array
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda-client"
4
4
  },
5
5
  "name": "@remotion/lambda-client",
6
- "version": "4.0.303",
6
+ "version": "4.0.305",
7
7
  "main": "dist/index.js",
8
8
  "sideEffects": false,
9
9
  "author": "Jonny Burger <jonny@remotion.dev>",
@@ -26,8 +26,8 @@
26
26
  "eslint": "9.19.0",
27
27
  "next": "15.2.4",
28
28
  "@types/mime-types": "2.1.1",
29
- "@remotion/serverless-client": "4.0.303",
30
- "@remotion/eslint-config-internal": "4.0.303"
29
+ "@remotion/serverless-client": "4.0.305",
30
+ "@remotion/eslint-config-internal": "4.0.305"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"