@remotion/lambda-client 4.0.512 → 4.0.514

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,2 +1,2 @@
1
1
  import type { CallFunctionOptions, CloudProvider, ServerlessRoutines } from '@remotion/serverless-client';
2
- export declare const callFunctionAsyncImplementation: <T extends ServerlessRoutines, Provider extends CloudProvider<string, Record<string, unknown>, Record<string, unknown>, string, object>>({ functionName, payload, region, timeoutInTest, }: CallFunctionOptions<T, Provider>) => Promise<void>;
2
+ export declare const callFunctionAsyncImplementation: <T extends ServerlessRoutines, Provider extends CloudProvider<string, Record<string, unknown>, Record<string, unknown>, string, object>>({ functionName, payload, region, timeoutInTest, requestHandler, }: CallFunctionOptions<T, Provider>) => Promise<void>;
package/dist/cjs/index.js CHANGED
@@ -70818,7 +70818,9 @@ var interpolateString = ({
70818
70818
  }) => {
70819
70819
  const initiallyParsedOutputRange = outputRange.map(parseStringInterpolationValue);
70820
70820
  const hasAxisRotation = initiallyParsedOutputRange.some((parsed) => parsed.axisRotation);
70821
- const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed) => {
70821
+ const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
70822
+ const segmentIndex = inputRange.length === 1 ? 0 : findRange(posterizedInput, inputRange);
70823
+ const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed, index) => {
70822
70824
  if (parsed.kind !== "rotate") {
70823
70825
  return parsed;
70824
70826
  }
@@ -70828,9 +70830,11 @@ var interpolateString = ({
70828
70830
  if (parsed.dimensions !== 1) {
70829
70831
  throw new TypeError("Cannot interpolate a multi-angle rotate value with an axis rotation");
70830
70832
  }
70833
+ const adjacentAxisRotation = parsed.values[0] === 0 ? index === segmentIndex ? initiallyParsedOutputRange[index + 1] : index === segmentIndex + 1 ? initiallyParsedOutputRange[index - 1] : undefined : undefined;
70834
+ const axis = adjacentAxisRotation?.axisRotation ? adjacentAxisRotation.values : [0, 0, 1];
70831
70835
  return {
70832
70836
  kind: "rotate",
70833
- values: [0, 0, 1, parsed.values[0]],
70837
+ values: [axis[0], axis[1], axis[2], parsed.values[0]],
70834
70838
  units: [null, null, null, parsed.units[0]],
70835
70839
  dimensions: 4,
70836
70840
  axisRotation: true
@@ -71118,16 +71122,6 @@ var random = (seed, dummy) => {
71118
71122
  }
71119
71123
  throw new Error("random() argument must be a number or a string");
71120
71124
  };
71121
- function truthy(value) {
71122
- return Boolean(value);
71123
- }
71124
- if (typeof window !== "undefined") {
71125
- window.remotion_renderReady = false;
71126
- if (!window.remotion_delayRenderTimeouts) {
71127
- window.remotion_delayRenderTimeouts = {};
71128
- }
71129
- window.remotion_delayRenderHandles = [];
71130
- }
71131
71125
  var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
71132
71126
  var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
71133
71127
  var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
@@ -72006,6 +72000,9 @@ var serializeScaleValue = ([x, y, z]) => {
72006
72000
  }
72007
72001
  return `${normalizedX} ${normalizedY} ${normalizedZ}`;
72008
72002
  };
72003
+ function truthy(value) {
72004
+ return Boolean(value);
72005
+ }
72009
72006
  var ENABLE_V5_BREAKING_CHANGES = false;
72010
72007
  var validCodecs = [
72011
72008
  "h264",
@@ -72198,7 +72195,7 @@ var validateDownloadBehavior = (downloadBehavior) => {
72198
72195
  }
72199
72196
  }
72200
72197
  };
72201
- var VERSION = "4.0.512";
72198
+ var VERSION = "4.0.514";
72202
72199
  var isColorSupported = () => {
72203
72200
  const env = process.env || {};
72204
72201
  const isForceDisabled = "NO_COLOR" in env;
@@ -74341,8 +74338,7 @@ var getCredentialsHash = ({
74341
74338
  customCredentials,
74342
74339
  region,
74343
74340
  service,
74344
- forcePathStyle,
74345
- requestHandler
74341
+ forcePathStyle
74346
74342
  }) => {
74347
74343
  const hashComponents = {};
74348
74344
  if (getEnvVariable("REMOTION_SKIP_AWS_CREDENTIALS_CHECK")) {
@@ -74372,10 +74368,19 @@ var getCredentialsHash = ({
74372
74368
  hashComponents.region = region;
74373
74369
  hashComponents.service = service;
74374
74370
  hashComponents.forcePathStyle = forcePathStyle;
74375
- hashComponents.requestHandler = requestHandler;
74376
74371
  return random(JSON.stringify(hashComponents)).toString().replace("0.", "");
74377
74372
  };
74378
74373
  var _clients = {};
74374
+ var _clientsWithCustomHandler = new WeakMap;
74375
+ var getCustomHandlerClientCache = (requestHandler) => {
74376
+ const existing = _clientsWithCustomHandler.get(requestHandler);
74377
+ if (existing) {
74378
+ return existing;
74379
+ }
74380
+ const created = {};
74381
+ _clientsWithCustomHandler.set(requestHandler, created);
74382
+ return created;
74383
+ };
74379
74384
  function getServiceClient({
74380
74385
  region,
74381
74386
  service,
@@ -74408,17 +74413,17 @@ function getServiceClient({
74408
74413
  region,
74409
74414
  customCredentials,
74410
74415
  service,
74411
- forcePathStyle,
74412
- requestHandler
74416
+ forcePathStyle
74413
74417
  });
74414
- if (!_clients[key]) {
74418
+ const cache2 = requestHandler ? getCustomHandlerClientCache(requestHandler) : _clients;
74419
+ if (!cache2[key]) {
74415
74420
  checkCredentials();
74416
74421
  const lambdaOptions = service === "lambda" ? {
74417
74422
  httpsAgent: {
74418
74423
  maxSockets: MAX_FUNCTIONS_PER_RENDER * 2
74419
74424
  }
74420
74425
  } : undefined;
74421
- const finalRequestHandler = requestHandler ? lambdaOptions ? { ...requestHandler, ...lambdaOptions } : requestHandler : lambdaOptions;
74426
+ const finalRequestHandler = requestHandler ?? lambdaOptions;
74422
74427
  const client = customCredentials ? new Client({
74423
74428
  region: customCredentials.region ?? "us-east-1",
74424
74429
  credentials: customCredentials.accessKeyId && customCredentials.secretAccessKey ? {
@@ -74442,9 +74447,9 @@ function getServiceClient({
74442
74447
  if (getEnvVariable("REMOTION_DISABLE_AWS_CLIENT_CACHE")) {
74443
74448
  return client;
74444
74449
  }
74445
- _clients[key] = client;
74450
+ cache2[key] = client;
74446
74451
  }
74447
- return _clients[key];
74452
+ return cache2[key];
74448
74453
  }
74449
74454
 
74450
74455
  // src/aws-clients.ts
@@ -74594,13 +74599,14 @@ var callFunctionAsyncImplementation = async ({
74594
74599
  functionName,
74595
74600
  payload,
74596
74601
  region,
74597
- timeoutInTest
74602
+ timeoutInTest,
74603
+ requestHandler
74598
74604
  }) => {
74599
74605
  const stringifiedPayload = JSON.stringify(payload);
74600
74606
  if (stringifiedPayload.length > 256 * 1024) {
74601
74607
  throw new Error(`Payload is too big: ${stringifiedPayload.length} bytes. Maximum size is 256 KB. This should not happen, please report this to the Remotion team. Payload: ${stringifiedPayload}`);
74602
74608
  }
74603
- const result = await getLambdaClient(region, timeoutInTest, null).send(new import_client_lambda2.InvokeCommand({
74609
+ const result = await getLambdaClient(region, timeoutInTest, requestHandler ?? null).send(new import_client_lambda2.InvokeCommand({
74604
74610
  FunctionName: functionName,
74605
74611
  Payload: stringifiedPayload,
74606
74612
  InvocationType: "Event"
@@ -74627,9 +74633,10 @@ var invokeStreamOrTimeout = async ({
74627
74633
  timeoutInTest,
74628
74634
  functionName,
74629
74635
  type,
74630
- payload
74636
+ payload,
74637
+ requestHandler
74631
74638
  }) => {
74632
- const resProm = getLambdaClient(region, timeoutInTest, null).send(new import_client_lambda3.InvokeWithResponseStreamCommand({
74639
+ const resProm = getLambdaClient(region, timeoutInTest, requestHandler ?? null).send(new import_client_lambda3.InvokeWithResponseStreamCommand({
74633
74640
  FunctionName: functionName,
74634
74641
  Payload: JSON.stringify({ type, ...payload })
74635
74642
  }));
@@ -74655,14 +74662,16 @@ var callLambdaWithStreamingWithoutRetry = async ({
74655
74662
  payload,
74656
74663
  region,
74657
74664
  timeoutInTest,
74658
- receivedStreamingPayload
74665
+ receivedStreamingPayload,
74666
+ requestHandler
74659
74667
  }) => {
74660
74668
  const res = await invokeStreamOrTimeout({
74661
74669
  functionName,
74662
74670
  payload,
74663
74671
  region,
74664
74672
  timeoutInTest,
74665
- type
74673
+ type,
74674
+ requestHandler
74666
74675
  });
74667
74676
  const { onData, clear } = makeStreamer((status, messageTypeId, data) => {
74668
74677
  const messageType = messageTypeIdToMessageType(messageTypeId);
@@ -74732,10 +74741,11 @@ var callLambdaSyncWithoutRetry = async ({
74732
74741
  functionName,
74733
74742
  payload,
74734
74743
  region,
74735
- timeoutInTest
74744
+ timeoutInTest,
74745
+ requestHandler
74736
74746
  }) => {
74737
74747
  const Payload = JSON.stringify(payload);
74738
- const res = await getLambdaClient(region, timeoutInTest, null).send(new import_client_lambda4.InvokeCommand({
74748
+ const res = await getLambdaClient(region, timeoutInTest, requestHandler ?? null).send(new import_client_lambda4.InvokeCommand({
74739
74749
  FunctionName: functionName,
74740
74750
  Payload,
74741
74751
  InvocationType: "RequestResponse"
@@ -70161,7 +70161,9 @@ var interpolateString = ({
70161
70161
  }) => {
70162
70162
  const initiallyParsedOutputRange = outputRange.map(parseStringInterpolationValue);
70163
70163
  const hasAxisRotation = initiallyParsedOutputRange.some((parsed) => parsed.axisRotation);
70164
- const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed) => {
70164
+ const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
70165
+ const segmentIndex = inputRange.length === 1 ? 0 : findRange(posterizedInput, inputRange);
70166
+ const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed, index) => {
70165
70167
  if (parsed.kind !== "rotate") {
70166
70168
  return parsed;
70167
70169
  }
@@ -70171,9 +70173,11 @@ var interpolateString = ({
70171
70173
  if (parsed.dimensions !== 1) {
70172
70174
  throw new TypeError("Cannot interpolate a multi-angle rotate value with an axis rotation");
70173
70175
  }
70176
+ const adjacentAxisRotation = parsed.values[0] === 0 ? index === segmentIndex ? initiallyParsedOutputRange[index + 1] : index === segmentIndex + 1 ? initiallyParsedOutputRange[index - 1] : undefined : undefined;
70177
+ const axis = adjacentAxisRotation?.axisRotation ? adjacentAxisRotation.values : [0, 0, 1];
70174
70178
  return {
70175
70179
  kind: "rotate",
70176
- values: [0, 0, 1, parsed.values[0]],
70180
+ values: [axis[0], axis[1], axis[2], parsed.values[0]],
70177
70181
  units: [null, null, null, parsed.units[0]],
70178
70182
  dimensions: 4,
70179
70183
  axisRotation: true
@@ -70461,16 +70465,6 @@ var random = (seed, dummy) => {
70461
70465
  }
70462
70466
  throw new Error("random() argument must be a number or a string");
70463
70467
  };
70464
- function truthy(value) {
70465
- return Boolean(value);
70466
- }
70467
- if (typeof window !== "undefined") {
70468
- window.remotion_renderReady = false;
70469
- if (!window.remotion_delayRenderTimeouts) {
70470
- window.remotion_delayRenderTimeouts = {};
70471
- }
70472
- window.remotion_delayRenderHandles = [];
70473
- }
70474
70468
  var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
70475
70469
  var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
70476
70470
  var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
@@ -71349,6 +71343,9 @@ var serializeScaleValue = ([x, y, z]) => {
71349
71343
  }
71350
71344
  return `${normalizedX} ${normalizedY} ${normalizedZ}`;
71351
71345
  };
71346
+ function truthy(value) {
71347
+ return Boolean(value);
71348
+ }
71352
71349
  var ENABLE_V5_BREAKING_CHANGES = false;
71353
71350
  var validCodecs = [
71354
71351
  "h264",
@@ -71541,7 +71538,7 @@ var validateDownloadBehavior = (downloadBehavior) => {
71541
71538
  }
71542
71539
  }
71543
71540
  };
71544
- var VERSION = "4.0.512";
71541
+ var VERSION = "4.0.514";
71545
71542
  var isColorSupported = () => {
71546
71543
  const env = process.env || {};
71547
71544
  const isForceDisabled = "NO_COLOR" in env;
@@ -73684,8 +73681,7 @@ var getCredentialsHash = ({
73684
73681
  customCredentials,
73685
73682
  region,
73686
73683
  service,
73687
- forcePathStyle,
73688
- requestHandler
73684
+ forcePathStyle
73689
73685
  }) => {
73690
73686
  const hashComponents = {};
73691
73687
  if (getEnvVariable("REMOTION_SKIP_AWS_CREDENTIALS_CHECK")) {
@@ -73715,10 +73711,19 @@ var getCredentialsHash = ({
73715
73711
  hashComponents.region = region;
73716
73712
  hashComponents.service = service;
73717
73713
  hashComponents.forcePathStyle = forcePathStyle;
73718
- hashComponents.requestHandler = requestHandler;
73719
73714
  return random(JSON.stringify(hashComponents)).toString().replace("0.", "");
73720
73715
  };
73721
73716
  var _clients = {};
73717
+ var _clientsWithCustomHandler = new WeakMap;
73718
+ var getCustomHandlerClientCache = (requestHandler) => {
73719
+ const existing = _clientsWithCustomHandler.get(requestHandler);
73720
+ if (existing) {
73721
+ return existing;
73722
+ }
73723
+ const created = {};
73724
+ _clientsWithCustomHandler.set(requestHandler, created);
73725
+ return created;
73726
+ };
73722
73727
  function getServiceClient({
73723
73728
  region,
73724
73729
  service,
@@ -73751,17 +73756,17 @@ function getServiceClient({
73751
73756
  region,
73752
73757
  customCredentials,
73753
73758
  service,
73754
- forcePathStyle,
73755
- requestHandler
73759
+ forcePathStyle
73756
73760
  });
73757
- if (!_clients[key]) {
73761
+ const cache2 = requestHandler ? getCustomHandlerClientCache(requestHandler) : _clients;
73762
+ if (!cache2[key]) {
73758
73763
  checkCredentials();
73759
73764
  const lambdaOptions = service === "lambda" ? {
73760
73765
  httpsAgent: {
73761
73766
  maxSockets: MAX_FUNCTIONS_PER_RENDER * 2
73762
73767
  }
73763
73768
  } : undefined;
73764
- const finalRequestHandler = requestHandler ? lambdaOptions ? { ...requestHandler, ...lambdaOptions } : requestHandler : lambdaOptions;
73769
+ const finalRequestHandler = requestHandler ?? lambdaOptions;
73765
73770
  const client = customCredentials ? new Client({
73766
73771
  region: customCredentials.region ?? "us-east-1",
73767
73772
  credentials: customCredentials.accessKeyId && customCredentials.secretAccessKey ? {
@@ -73785,9 +73790,9 @@ function getServiceClient({
73785
73790
  if (getEnvVariable("REMOTION_DISABLE_AWS_CLIENT_CACHE")) {
73786
73791
  return client;
73787
73792
  }
73788
- _clients[key] = client;
73793
+ cache2[key] = client;
73789
73794
  }
73790
- return _clients[key];
73795
+ return cache2[key];
73791
73796
  }
73792
73797
 
73793
73798
  // src/aws-clients.ts
@@ -73937,13 +73942,14 @@ var callFunctionAsyncImplementation = async ({
73937
73942
  functionName,
73938
73943
  payload,
73939
73944
  region,
73940
- timeoutInTest
73945
+ timeoutInTest,
73946
+ requestHandler
73941
73947
  }) => {
73942
73948
  const stringifiedPayload = JSON.stringify(payload);
73943
73949
  if (stringifiedPayload.length > 256 * 1024) {
73944
73950
  throw new Error(`Payload is too big: ${stringifiedPayload.length} bytes. Maximum size is 256 KB. This should not happen, please report this to the Remotion team. Payload: ${stringifiedPayload}`);
73945
73951
  }
73946
- const result = await getLambdaClient(region, timeoutInTest, null).send(new import_client_lambda2.InvokeCommand({
73952
+ const result = await getLambdaClient(region, timeoutInTest, requestHandler ?? null).send(new import_client_lambda2.InvokeCommand({
73947
73953
  FunctionName: functionName,
73948
73954
  Payload: stringifiedPayload,
73949
73955
  InvocationType: "Event"
@@ -73970,9 +73976,10 @@ var invokeStreamOrTimeout = async ({
73970
73976
  timeoutInTest,
73971
73977
  functionName,
73972
73978
  type,
73973
- payload
73979
+ payload,
73980
+ requestHandler
73974
73981
  }) => {
73975
- const resProm = getLambdaClient(region, timeoutInTest, null).send(new import_client_lambda3.InvokeWithResponseStreamCommand({
73982
+ const resProm = getLambdaClient(region, timeoutInTest, requestHandler ?? null).send(new import_client_lambda3.InvokeWithResponseStreamCommand({
73976
73983
  FunctionName: functionName,
73977
73984
  Payload: JSON.stringify({ type, ...payload })
73978
73985
  }));
@@ -73998,14 +74005,16 @@ var callLambdaWithStreamingWithoutRetry = async ({
73998
74005
  payload,
73999
74006
  region,
74000
74007
  timeoutInTest,
74001
- receivedStreamingPayload
74008
+ receivedStreamingPayload,
74009
+ requestHandler
74002
74010
  }) => {
74003
74011
  const res = await invokeStreamOrTimeout({
74004
74012
  functionName,
74005
74013
  payload,
74006
74014
  region,
74007
74015
  timeoutInTest,
74008
- type
74016
+ type,
74017
+ requestHandler
74009
74018
  });
74010
74019
  const { onData, clear } = makeStreamer((status, messageTypeId, data) => {
74011
74020
  const messageType = messageTypeIdToMessageType(messageTypeId);
@@ -74075,10 +74084,11 @@ var callLambdaSyncWithoutRetry = async ({
74075
74084
  functionName,
74076
74085
  payload,
74077
74086
  region,
74078
- timeoutInTest
74087
+ timeoutInTest,
74088
+ requestHandler
74079
74089
  }) => {
74080
74090
  const Payload = JSON.stringify(payload);
74081
- const res = await getLambdaClient(region, timeoutInTest, null).send(new import_client_lambda4.InvokeCommand({
74091
+ const res = await getLambdaClient(region, timeoutInTest, requestHandler ?? null).send(new import_client_lambda4.InvokeCommand({
74082
74092
  FunctionName: functionName,
74083
74093
  Payload,
74084
74094
  InvocationType: "RequestResponse"
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.512",
6
+ "version": "4.0.514",
7
7
  "main": "dist/cjs/index.js",
8
8
  "scripts": {
9
9
  "formatting": "oxfmt src --check",
@@ -26,10 +26,10 @@
26
26
  "@aws-sdk/lib-storage": "3.986.0",
27
27
  "mime-types": "2.1.34",
28
28
  "@aws-sdk/credential-provider-ini": "3.972.5",
29
- "@remotion/serverless-client": "4.0.512",
29
+ "@remotion/serverless-client": "4.0.514",
30
30
  "@types/express": "5.0.1",
31
31
  "express": "4.21.0",
32
- "@remotion/eslint-config-internal": "4.0.512",
32
+ "@remotion/eslint-config-internal": "4.0.514",
33
33
  "eslint": "9.19.0",
34
34
  "next": "16.2.11",
35
35
  "@types/mime-types": "2.1.1",