@remotion/serverless 4.0.244 → 4.0.245

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.
Files changed (92) hide show
  1. package/.turbo/turbo-formatting.log +7 -0
  2. package/.turbo/turbo-lint.log +11 -0
  3. package/.turbo/turbo-make.log +1 -1
  4. package/LICENSE.md +1 -1
  5. package/dist/best-frames-per-function-param.d.ts +1 -0
  6. package/dist/best-frames-per-function-param.js +17 -0
  7. package/dist/calculate-chunk-times.d.ts +5 -0
  8. package/dist/calculate-chunk-times.js +29 -0
  9. package/dist/can-concat-seamlessly.d.ts +3 -0
  10. package/dist/can-concat-seamlessly.js +17 -0
  11. package/dist/cleanup-props.d.ts +9 -0
  12. package/dist/cleanup-props.js +23 -0
  13. package/dist/cleanup-serialized-input-props.d.ts +15 -0
  14. package/dist/cleanup-serialized-input-props.js +34 -0
  15. package/dist/concat-videos.d.ts +26 -0
  16. package/dist/concat-videos.js +53 -0
  17. package/dist/create-post-render-data.d.ts +20 -0
  18. package/dist/create-post-render-data.js +68 -0
  19. package/dist/docs-url.d.ts +1 -0
  20. package/dist/docs-url.js +4 -0
  21. package/dist/estimate-price-from-bucket.d.ts +15 -0
  22. package/dist/estimate-price-from-bucket.js +31 -0
  23. package/dist/find-output-file-in-bucket.d.ts +16 -0
  24. package/dist/find-output-file-in-bucket.js +41 -0
  25. package/dist/format-costs-info.d.ts +2 -0
  26. package/dist/format-costs-info.js +23 -0
  27. package/dist/get-overall-progress-from-storage.d.ts +11 -0
  28. package/dist/get-overall-progress-from-storage.js +25 -0
  29. package/dist/get-overall-progress.d.ts +9 -0
  30. package/dist/get-overall-progress.js +23 -0
  31. package/dist/handlers/compositions.d.ts +11 -0
  32. package/dist/handlers/compositions.js +81 -0
  33. package/dist/handlers/launch.d.ts +17 -0
  34. package/dist/handlers/launch.js +601 -0
  35. package/dist/handlers/progress.d.ts +12 -0
  36. package/dist/handlers/progress.js +51 -0
  37. package/dist/handlers/renderer.d.ts +23 -0
  38. package/dist/handlers/renderer.js +342 -0
  39. package/dist/handlers/start.d.ts +14 -0
  40. package/dist/handlers/start.js +105 -0
  41. package/dist/handlers/still.d.ts +20 -0
  42. package/dist/handlers/still.js +334 -0
  43. package/dist/inspect-error.d.ts +4 -0
  44. package/dist/inspect-error.js +39 -0
  45. package/dist/invoke-webhook.d.ts +39 -0
  46. package/dist/invoke-webhook.js +116 -0
  47. package/dist/leak-detection.d.ts +4 -0
  48. package/dist/leak-detection.js +40 -0
  49. package/dist/make-timeout-error.d.ts +13 -0
  50. package/dist/make-timeout-error.js +32 -0
  51. package/dist/make-timeout-message.d.ts +12 -0
  52. package/dist/make-timeout-message.js +75 -0
  53. package/dist/merge-chunks.d.ts +37 -0
  54. package/dist/merge-chunks.js +92 -0
  55. package/dist/min-max.d.ts +2 -0
  56. package/dist/min-max.js +33 -0
  57. package/dist/most-expensive-chunks.d.ts +13 -0
  58. package/dist/most-expensive-chunks.js +28 -0
  59. package/dist/on-downloads-helpers.d.ts +2 -0
  60. package/dist/on-downloads-helpers.js +29 -0
  61. package/dist/overall-render-progress.d.ts +59 -0
  62. package/dist/overall-render-progress.js +180 -0
  63. package/dist/plan-frame-ranges.d.ts +7 -0
  64. package/dist/plan-frame-ranges.js +17 -0
  65. package/dist/progress.d.ts +16 -0
  66. package/dist/progress.js +254 -0
  67. package/dist/render-has-audio-video.d.ts +6 -0
  68. package/dist/render-has-audio-video.js +21 -0
  69. package/dist/render-progress.d.ts +51 -0
  70. package/dist/render-progress.js +2 -0
  71. package/dist/return-values.d.ts +38 -0
  72. package/dist/return-values.js +2 -0
  73. package/dist/stackback.d.ts +6 -0
  74. package/dist/stackback.js +59 -0
  75. package/dist/stream-renderer.d.ts +17 -0
  76. package/dist/stream-renderer.js +148 -0
  77. package/dist/types.d.ts +54 -0
  78. package/dist/types.js +2 -0
  79. package/dist/validate-download-behavior.d.ts +1 -0
  80. package/dist/validate-download-behavior.js +21 -0
  81. package/dist/validate-frames-per-function.d.ts +4 -0
  82. package/dist/validate-frames-per-function.js +29 -0
  83. package/dist/validate-frames-per-lambda.d.ts +4 -0
  84. package/dist/validate-frames-per-lambda.js +29 -0
  85. package/dist/validate-privacy.d.ts +2 -0
  86. package/dist/validate-privacy.js +14 -0
  87. package/dist/validate.d.ts +4 -0
  88. package/dist/validate.js +8 -0
  89. package/dist/why-is-node-running.d.ts +15 -0
  90. package/dist/why-is-node-running.js +89 -0
  91. package/package.json +5 -5
  92. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDownloadBehavior = void 0;
4
+ const validateDownloadBehavior = (downloadBehavior) => {
5
+ if (downloadBehavior === null || downloadBehavior === undefined) {
6
+ return null;
7
+ }
8
+ if (typeof downloadBehavior !== 'object') {
9
+ throw new Error('downloadBehavior must be null or an object');
10
+ }
11
+ const behavior = downloadBehavior;
12
+ if (behavior.type !== 'download' && behavior.type !== 'play-in-browser') {
13
+ throw new Error('Download behavior must be either "download" or "play-in-browser"');
14
+ }
15
+ if (behavior.type === 'download') {
16
+ if (typeof behavior.fileName !== 'string' && behavior.fileName !== null) {
17
+ throw new Error('If "downloadBehavior.type" is "download", then fileName must be "null" or a string');
18
+ }
19
+ }
20
+ };
21
+ exports.validateDownloadBehavior = validateDownloadBehavior;
@@ -0,0 +1,4 @@
1
+ export declare const validateFramesPerFunction: ({ framesPerLambda, durationInFrames, }: {
2
+ framesPerLambda: unknown;
3
+ durationInFrames: number;
4
+ }) => void;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateFramesPerFunction = void 0;
4
+ const constants_1 = require("./constants");
5
+ const validateFramesPerFunction = ({ framesPerLambda, durationInFrames, }) => {
6
+ if (framesPerLambda === null) {
7
+ return;
8
+ }
9
+ if (framesPerLambda === undefined) {
10
+ return;
11
+ }
12
+ if (typeof framesPerLambda !== 'number') {
13
+ throw new TypeError(`'framesPerLambda' needs to be a number, passed ${JSON.stringify(framesPerLambda)}`);
14
+ }
15
+ if (!Number.isFinite(framesPerLambda)) {
16
+ throw new TypeError(`'framesPerLambda' needs to be finite, passed ${framesPerLambda}`);
17
+ }
18
+ if (Number.isNaN(framesPerLambda)) {
19
+ throw new TypeError(`'framesPerLambda' needs to be NaN, passed ${framesPerLambda}`);
20
+ }
21
+ if (framesPerLambda % 1 !== 0) {
22
+ throw new TypeError(`'framesPerLambda' needs to be an integer, passed ${framesPerLambda}`);
23
+ }
24
+ const effectiveMinimum = Math.min(constants_1.MINIMUM_FRAMES_PER_LAMBDA, durationInFrames);
25
+ if (framesPerLambda < effectiveMinimum) {
26
+ throw new TypeError(`The framesPerLambda needs to be at least ${effectiveMinimum}, but is ${framesPerLambda}`);
27
+ }
28
+ };
29
+ exports.validateFramesPerFunction = validateFramesPerFunction;
@@ -0,0 +1,4 @@
1
+ export declare const validateFramesPerFunction: ({ framesPerLambda, durationInFrames, }: {
2
+ framesPerLambda: unknown;
3
+ durationInFrames: number;
4
+ }) => void;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateFramesPerFunction = void 0;
4
+ const constants_1 = require("./constants");
5
+ const validateFramesPerFunction = ({ framesPerLambda, durationInFrames, }) => {
6
+ if (framesPerLambda === null) {
7
+ return;
8
+ }
9
+ if (framesPerLambda === undefined) {
10
+ return;
11
+ }
12
+ if (typeof framesPerLambda !== 'number') {
13
+ throw new TypeError(`'framesPerLambda' needs to be a number, passed ${JSON.stringify(framesPerLambda)}`);
14
+ }
15
+ if (!Number.isFinite(framesPerLambda)) {
16
+ throw new TypeError(`'framesPerLambda' needs to be finite, passed ${framesPerLambda}`);
17
+ }
18
+ if (Number.isNaN(framesPerLambda)) {
19
+ throw new TypeError(`'framesPerLambda' needs to be NaN, passed ${framesPerLambda}`);
20
+ }
21
+ if (framesPerLambda % 1 !== 0) {
22
+ throw new TypeError(`'framesPerLambda' needs to be an integer, passed ${framesPerLambda}`);
23
+ }
24
+ const effectiveMinimum = Math.min(constants_1.MINIMUM_FRAMES_PER_LAMBDA, durationInFrames);
25
+ if (framesPerLambda < effectiveMinimum) {
26
+ throw new TypeError(`The framesPerLambda needs to be at least ${effectiveMinimum}, but is ${framesPerLambda}`);
27
+ }
28
+ };
29
+ exports.validateFramesPerFunction = validateFramesPerFunction;
@@ -0,0 +1,2 @@
1
+ import type { Privacy } from './constants';
2
+ export declare function validatePrivacy(privacy: unknown, allowPrivate: boolean): asserts privacy is Privacy;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validatePrivacy = validatePrivacy;
4
+ function validatePrivacy(privacy, allowPrivate) {
5
+ if (typeof privacy !== 'string') {
6
+ throw new TypeError('Privacy must be a string');
7
+ }
8
+ if (!allowPrivate && privacy === 'private') {
9
+ throw new TypeError('Privacy must be either "public" or "no-acl"');
10
+ }
11
+ if (privacy !== 'private' && privacy !== 'public' && privacy !== 'no-acl') {
12
+ throw new TypeError('Privacy must be either "private", "public" or "no-acl"');
13
+ }
14
+ }
@@ -0,0 +1,4 @@
1
+ import { NoReactInternals } from 'remotion/no-react';
2
+ export declare const validateFps: typeof NoReactInternals.validateFps;
3
+ export declare const validateDimension: typeof NoReactInternals.validateDimension;
4
+ export declare const validateDurationInFrames: typeof NoReactInternals.validateDurationInFrames;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDurationInFrames = exports.validateDimension = exports.validateFps = void 0;
4
+ /* eslint-disable prefer-destructuring */
5
+ const no_react_1 = require("remotion/no-react");
6
+ exports.validateFps = no_react_1.NoReactInternals.validateFps;
7
+ exports.validateDimension = no_react_1.NoReactInternals.validateDimension;
8
+ exports.validateDurationInFrames = no_react_1.NoReactInternals.validateDurationInFrames;
@@ -0,0 +1,15 @@
1
+ import asyncHooks from 'async_hooks';
2
+ type Resource = {
3
+ type: string;
4
+ stacks: NodeJS.CallSite[];
5
+ resource: {
6
+ hasRef?: () => boolean;
7
+ };
8
+ };
9
+ export type NodeIntrospection = {
10
+ hook: asyncHooks.AsyncHook | null;
11
+ active: Map<number, Resource>;
12
+ };
13
+ export declare const enableNodeIntrospection: (enabled: boolean) => NodeIntrospection;
14
+ export declare function whyIsNodeRunning({ active, hook }: NodeIntrospection): void;
15
+ export {};
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.enableNodeIntrospection = void 0;
7
+ exports.whyIsNodeRunning = whyIsNodeRunning;
8
+ /* eslint-disable no-console */
9
+ const async_hooks_1 = __importDefault(require("async_hooks"));
10
+ const fs_1 = __importDefault(require("fs"));
11
+ const path_1 = require("path");
12
+ const stackback_1 = require("./stackback");
13
+ const enableNodeIntrospection = (enabled) => {
14
+ const active = new Map();
15
+ if (!enabled) {
16
+ return {
17
+ active,
18
+ hook: null,
19
+ };
20
+ }
21
+ const hook = async_hooks_1.default.createHook({
22
+ init(asyncId, type, _triggerAsyncId, resource) {
23
+ if (type === 'TIMERWRAP' || type === 'PROMISE')
24
+ return;
25
+ if (type === 'PerformanceObserver' || type === 'RANDOMBYTESREQUEST')
26
+ return;
27
+ const err = new Error('whatevs');
28
+ const stacks = (0, stackback_1.stackback)(err);
29
+ active.set(asyncId, { type, stacks, resource });
30
+ },
31
+ destroy(asyncId) {
32
+ active.delete(asyncId);
33
+ },
34
+ });
35
+ hook.enable();
36
+ return { hook, active };
37
+ };
38
+ exports.enableNodeIntrospection = enableNodeIntrospection;
39
+ function whyIsNodeRunning({ active, hook }) {
40
+ if (!hook) {
41
+ return;
42
+ }
43
+ hook.disable();
44
+ const activeResources = [...active.values()].filter((r) => {
45
+ if (typeof r.resource.hasRef === 'function' && !r.resource.hasRef())
46
+ return false;
47
+ return true;
48
+ });
49
+ console.error('There are %d handle(s) keeping the process running', activeResources.length);
50
+ function printStacks(o) {
51
+ const stacks = o.stacks.slice(1).filter((s) => {
52
+ const filename = s.getFileName();
53
+ return (filename &&
54
+ filename.indexOf(path_1.sep) > -1 &&
55
+ filename.indexOf('internal' + path_1.sep) !== 0);
56
+ });
57
+ console.error('');
58
+ console.error('# %s', o.type);
59
+ if (stacks[0]) {
60
+ let padding = '';
61
+ stacks.forEach((s) => {
62
+ const pad = (s.getFileName() + ':' + s.getLineNumber()).replace(/./g, ' ');
63
+ if (pad.length > padding.length)
64
+ padding = pad;
65
+ });
66
+ stacks.forEach((s) => {
67
+ const prefix = s.getFileName() + ':' + s.getLineNumber();
68
+ try {
69
+ const src = fs_1.default
70
+ .readFileSync(s.getFileName(), 'utf-8')
71
+ .split(/\n|\r\n/);
72
+ console.error(prefix +
73
+ padding.slice(prefix.length) +
74
+ ' - ' +
75
+ src[s.getLineNumber() - 1].trim());
76
+ }
77
+ catch (_a) {
78
+ console.error(prefix + padding.slice(prefix.length));
79
+ }
80
+ });
81
+ }
82
+ else {
83
+ console.error('(unknown stack trace)');
84
+ }
85
+ }
86
+ for (const o of activeResources) {
87
+ printStacks(o);
88
+ }
89
+ }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/serverless"
4
4
  },
5
5
  "name": "@remotion/serverless",
6
- "version": "4.0.244",
6
+ "version": "4.0.245",
7
7
  "description": "A runtime for distributed rendering",
8
8
  "main": "dist",
9
9
  "sideEffects": false,
@@ -17,13 +17,13 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "remotion": "4.0.244",
21
- "@remotion/renderer": "4.0.244",
22
- "@remotion/streaming": "4.0.244"
20
+ "remotion": "4.0.245",
21
+ "@remotion/renderer": "4.0.245",
22
+ "@remotion/streaming": "4.0.245"
23
23
  },
24
24
  "devDependencies": {
25
25
  "eslint": "9.14.0",
26
- "@remotion/eslint-config-internal": "4.0.244"
26
+ "@remotion/eslint-config-internal": "4.0.245"
27
27
  },
28
28
  "exports": {
29
29
  ".": "./dist/index.js",