@remotion/serverless-client 4.0.443 → 4.0.445

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.
@@ -1000,7 +1000,7 @@ var validateFramesPerFunction = ({
1000
1000
  import * as tty from "tty";
1001
1001
 
1002
1002
  // ../core/dist/esm/version.mjs
1003
- var VERSION = "4.0.443";
1003
+ var VERSION = "4.0.445";
1004
1004
 
1005
1005
  // ../renderer/dist/esm/error-handling.mjs
1006
1006
  var isColorSupported = () => {
@@ -1765,12 +1765,14 @@ var estimatePriceFromMetadata = ({
1765
1765
  functionsInvoked,
1766
1766
  timings,
1767
1767
  region,
1768
- providerSpecifics
1768
+ providerSpecifics,
1769
+ fatalErrorTimestamp
1769
1770
  }) => {
1770
1771
  if (!renderMetadata) {
1771
1772
  return null;
1772
1773
  }
1773
- const elapsedTime = Math.max(0, Date.now() - (renderMetadata?.startedDate ?? 0));
1774
+ const now = fatalErrorTimestamp ?? Date.now();
1775
+ const elapsedTime = Math.max(0, now - (renderMetadata?.startedDate ?? 0));
1774
1776
  const unfinished = Math.max(0, (renderMetadata?.totalChunks ?? 0) - timings.length);
1775
1777
  const timeElapsedOfUnfinished = new Array(unfinished).fill(true).map(() => elapsedTime).reduce((a, b) => a + b, 0);
1776
1778
  const estimatedBillingDurationInMilliseconds = calculateChunkTimes({
@@ -2880,7 +2882,8 @@ var getProgress = async ({
2880
2882
  diskSizeInMb: providerSpecifics.getEphemeralStorageForPriceCalculation(),
2881
2883
  timings: overallProgress.timings ?? [],
2882
2884
  region,
2883
- providerSpecifics
2885
+ providerSpecifics,
2886
+ fatalErrorTimestamp: overallProgress.fatalErrorTimestamp ?? null
2884
2887
  });
2885
2888
  const chunkMultiplier = [hasAudio, hasVideo].filter(truthy3).length;
2886
2889
  if (renderMetadata.type === "still") {
@@ -1,7 +1,7 @@
1
1
  import type { ProviderSpecifics } from './provider-implementation';
2
2
  import type { RenderMetadata } from './render-metadata';
3
3
  import type { CloudProvider, ParsedTiming } from './types';
4
- export declare const estimatePriceFromMetadata: <Provider extends CloudProvider<string, Record<string, unknown>, Record<string, unknown>, string, object>>({ renderMetadata, memorySizeInMb, diskSizeInMb, functionsInvoked, timings, region, providerSpecifics, }: {
4
+ export declare const estimatePriceFromMetadata: <Provider extends CloudProvider<string, Record<string, unknown>, Record<string, unknown>, string, object>>({ renderMetadata, memorySizeInMb, diskSizeInMb, functionsInvoked, timings, region, providerSpecifics, fatalErrorTimestamp, }: {
5
5
  renderMetadata: RenderMetadata<Provider> | null;
6
6
  memorySizeInMb: number;
7
7
  diskSizeInMb: number;
@@ -9,6 +9,7 @@ export declare const estimatePriceFromMetadata: <Provider extends CloudProvider<
9
9
  timings: ParsedTiming[];
10
10
  region: Provider["region"];
11
11
  providerSpecifics: ProviderSpecifics<Provider>;
12
+ fatalErrorTimestamp: number | null;
12
13
  }) => {
13
14
  accruedSoFar: number;
14
15
  estimatedBillingDurationInMilliseconds: number;
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.estimatePriceFromMetadata = void 0;
4
4
  const calculate_chunk_times_1 = require("./calculate-chunk-times");
5
- const estimatePriceFromMetadata = ({ renderMetadata, memorySizeInMb, diskSizeInMb, functionsInvoked, timings, region, providerSpecifics, }) => {
5
+ const estimatePriceFromMetadata = ({ renderMetadata, memorySizeInMb, diskSizeInMb, functionsInvoked, timings, region, providerSpecifics, fatalErrorTimestamp, }) => {
6
6
  var _a, _b;
7
7
  if (!renderMetadata) {
8
8
  return null;
9
9
  }
10
- const elapsedTime = Math.max(0, Date.now() - ((_a = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.startedDate) !== null && _a !== void 0 ? _a : 0));
10
+ const now = fatalErrorTimestamp !== null && fatalErrorTimestamp !== void 0 ? fatalErrorTimestamp : Date.now();
11
+ const elapsedTime = Math.max(0, now - ((_a = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.startedDate) !== null && _a !== void 0 ? _a : 0));
11
12
  const unfinished = Math.max(0, ((_b = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _b !== void 0 ? _b : 0) - timings.length);
12
13
  const timeElapsedOfUnfinished = new Array(unfinished)
13
14
  .fill(true)
@@ -16,6 +16,7 @@ export type OverallRenderProgress<Provider extends CloudProvider> = {
16
16
  timings: ParsedTiming[];
17
17
  renderMetadata: RenderMetadata<Provider> | null;
18
18
  errors: FunctionErrorInfo[];
19
+ fatalErrorTimestamp: number | null;
19
20
  timeoutTimestamp: number;
20
21
  functionLaunched: number;
21
22
  serveUrlOpened: number | null;
package/dist/progress.js CHANGED
@@ -14,7 +14,7 @@ const render_has_audio_video_1 = require("./render-has-audio-video");
14
14
  const truthy_1 = require("./truthy");
15
15
  const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region, memorySizeInMb, timeoutInMilliseconds, customCredentials, providerSpecifics, forcePathStyle, functionName, requestHandler, }) => {
16
16
  var _a;
17
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
17
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
18
18
  const overallProgress = await (0, get_overall_progress_from_storage_1.getOverallProgressFromStorage)({
19
19
  renderId,
20
20
  bucketName,
@@ -159,13 +159,14 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
159
159
  timings: (_l = overallProgress.timings) !== null && _l !== void 0 ? _l : [],
160
160
  region,
161
161
  providerSpecifics,
162
+ fatalErrorTimestamp: (_m = overallProgress.fatalErrorTimestamp) !== null && _m !== void 0 ? _m : null,
162
163
  });
163
164
  const chunkMultiplier = [hasAudio, hasVideo].filter(truthy_1.truthy).length;
164
165
  if (renderMetadata.type === 'still') {
165
166
  throw new Error("You don't need to call getRenderProgress() on a still render. Once you have obtained the `renderId`, the render is already done! 😉");
166
167
  }
167
- const allChunks = ((_m = overallProgress.chunks) !== null && _m !== void 0 ? _m : []).length / chunkMultiplier ===
168
- ((_o = renderMetadata.totalChunks) !== null && _o !== void 0 ? _o : Infinity);
168
+ const allChunks = ((_o = overallProgress.chunks) !== null && _o !== void 0 ? _o : []).length / chunkMultiplier ===
169
+ ((_p = renderMetadata.totalChunks) !== null && _p !== void 0 ? _p : Infinity);
169
170
  const frameCount = pure_1.NoReactAPIs.getFramesToRender(renderMetadata.frameRange, renderMetadata.everyNthFrame).length;
170
171
  const missingChunks = new Array(renderMetadata.totalChunks)
171
172
  .fill(true)
@@ -197,7 +198,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
197
198
  ...errorExplanations,
198
199
  ].filter(truthy_1.truthy);
199
200
  return {
200
- framesRendered: (_p = overallProgress.framesRendered) !== null && _p !== void 0 ? _p : 0,
201
+ framesRendered: (_q = overallProgress.framesRendered) !== null && _q !== void 0 ? _q : 0,
201
202
  chunks: chunkCount,
202
203
  done: false,
203
204
  encodingStatus: {
@@ -218,7 +219,7 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
218
219
  fatalErrorEncountered: allErrors.some((f) => f.isFatal && !f.willRetry),
219
220
  currentTime: Date.now(),
220
221
  renderSize: 0,
221
- lambdasInvoked: (_q = overallProgress.lambdasInvoked) !== null && _q !== void 0 ? _q : 0,
222
+ lambdasInvoked: (_r = overallProgress.lambdasInvoked) !== null && _r !== void 0 ? _r : 0,
222
223
  cleanup,
223
224
  timeToFinishChunks: allChunks && overallProgress
224
225
  ? (0, calculate_chunk_times_1.calculateChunkTimes)({
@@ -228,17 +229,17 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
228
229
  : null,
229
230
  overallProgress: (0, get_overall_progress_1.getOverallProgress)({
230
231
  encoding: frameCount
231
- ? ((_r = overallProgress.framesEncoded) !== null && _r !== void 0 ? _r : 0) / frameCount
232
+ ? ((_s = overallProgress.framesEncoded) !== null && _s !== void 0 ? _s : 0) / frameCount
232
233
  : 0,
233
- invoking: ((_s = overallProgress.lambdasInvoked) !== null && _s !== void 0 ? _s : 0) /
234
+ invoking: ((_t = overallProgress.lambdasInvoked) !== null && _t !== void 0 ? _t : 0) /
234
235
  renderMetadata.estimatedRenderLambdaInvokations,
235
- frames: ((_t = overallProgress.framesRendered) !== null && _t !== void 0 ? _t : 0) / (frameCount !== null && frameCount !== void 0 ? frameCount : 1),
236
+ frames: ((_u = overallProgress.framesRendered) !== null && _u !== void 0 ? _u : 0) / (frameCount !== null && frameCount !== void 0 ? frameCount : 1),
236
237
  gotComposition: overallProgress.compositionValidated,
237
238
  visitedServeUrl: overallProgress.serveUrlOpened,
238
239
  invokedLambda: overallProgress.lambdasInvoked,
239
240
  combining: overallProgress.combinedFrames / (frameCount !== null && frameCount !== void 0 ? frameCount : 1),
240
241
  }),
241
- retriesInfo: (_u = overallProgress.retries) !== null && _u !== void 0 ? _u : [],
242
+ retriesInfo: (_v = overallProgress.retries) !== null && _v !== void 0 ? _v : [],
242
243
  outKey: null,
243
244
  outBucket: null,
244
245
  mostExpensiveFrameRanges: null,
@@ -247,8 +248,8 @@ const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region,
247
248
  estimatedBillingDurationInMilliseconds: priceFromBucket
248
249
  ? priceFromBucket.estimatedBillingDurationInMilliseconds
249
250
  : null,
250
- combinedFrames: (_v = overallProgress.combinedFrames) !== null && _v !== void 0 ? _v : 0,
251
- timeToCombine: (_w = overallProgress.timeToCombine) !== null && _w !== void 0 ? _w : null,
251
+ combinedFrames: (_w = overallProgress.combinedFrames) !== null && _w !== void 0 ? _w : 0,
252
+ timeToCombine: (_x = overallProgress.timeToCombine) !== null && _x !== void 0 ? _x : null,
252
253
  timeoutTimestamp: overallProgress.timeoutTimestamp,
253
254
  type: 'success',
254
255
  compositionValidated: overallProgress.compositionValidated,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/serverless-client"
4
4
  },
5
5
  "name": "@remotion/serverless-client",
6
- "version": "4.0.443",
6
+ "version": "4.0.445",
7
7
  "main": "dist",
8
8
  "sideEffects": false,
9
9
  "scripts": {
@@ -24,10 +24,10 @@
24
24
  },
25
25
  "dependencies": {},
26
26
  "devDependencies": {
27
- "remotion": "4.0.443",
28
- "@remotion/streaming": "4.0.443",
29
- "@remotion/renderer": "4.0.443",
30
- "@remotion/eslint-config-internal": "4.0.443",
27
+ "remotion": "4.0.445",
28
+ "@remotion/streaming": "4.0.445",
29
+ "@remotion/renderer": "4.0.445",
30
+ "@remotion/eslint-config-internal": "4.0.445",
31
31
  "eslint": "9.19.0",
32
32
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
33
33
  },