@remotion/lambda 4.0.256 → 4.0.257

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 (126) hide show
  1. package/package.json +12 -12
  2. package/remotionlambda-arm64.zip +0 -0
  3. package/dist/api/__mocks__/clean-items.d.ts +0 -2
  4. package/dist/api/__mocks__/clean-items.js +0 -24
  5. package/dist/api/__mocks__/create-function.d.ts +0 -2
  6. package/dist/api/__mocks__/create-function.js +0 -21
  7. package/dist/api/__mocks__/delete-function.d.ts +0 -2
  8. package/dist/api/__mocks__/delete-function.js +0 -9
  9. package/dist/api/__mocks__/get-functions.d.ts +0 -2
  10. package/dist/api/__mocks__/get-functions.js +0 -9
  11. package/dist/api/__mocks__/upload-dir.d.ts +0 -3
  12. package/dist/api/__mocks__/upload-dir.js +0 -47
  13. package/dist/api/mock-functions.d.ts +0 -18
  14. package/dist/api/mock-functions.js +0 -36
  15. package/dist/cli/helpers/__mocks__/quit.d.ts +0 -1
  16. package/dist/cli/helpers/__mocks__/quit.js +0 -7
  17. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +0 -7
  18. package/dist/functions/chunk-optimization/plan-frame-ranges.js +0 -17
  19. package/dist/functions/chunk-optimization/types.d.ts +0 -8
  20. package/dist/functions/chunk-optimization/types.js +0 -2
  21. package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +0 -3
  22. package/dist/functions/helpers/__mocks__/get-browser-instance.js +0 -12
  23. package/dist/functions/helpers/__mocks__/leak-detection.d.ts +0 -4
  24. package/dist/functions/helpers/__mocks__/leak-detection.js +0 -9
  25. package/dist/functions/helpers/__mocks__/timer.d.ts +0 -2
  26. package/dist/functions/helpers/__mocks__/timer.js +0 -10
  27. package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -1
  28. package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -17
  29. package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -5
  30. package/dist/functions/helpers/calculate-chunk-times.js +0 -29
  31. package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -15
  32. package/dist/functions/helpers/calculate-price-from-bucket.js +0 -30
  33. package/dist/functions/helpers/can-concat-seamlessly.d.ts +0 -3
  34. package/dist/functions/helpers/can-concat-seamlessly.js +0 -17
  35. package/dist/functions/helpers/cleanup-props.d.ts +0 -8
  36. package/dist/functions/helpers/cleanup-props.js +0 -23
  37. package/dist/functions/helpers/concat-videos.d.ts +0 -23
  38. package/dist/functions/helpers/concat-videos.js +0 -54
  39. package/dist/functions/helpers/create-post-render-data.d.ts +0 -17
  40. package/dist/functions/helpers/create-post-render-data.js +0 -67
  41. package/dist/functions/helpers/find-output-file-in-bucket.d.ts +0 -14
  42. package/dist/functions/helpers/find-output-file-in-bucket.js +0 -38
  43. package/dist/functions/helpers/format-costs-info.d.ts +0 -2
  44. package/dist/functions/helpers/format-costs-info.js +0 -23
  45. package/dist/functions/helpers/get-overall-progress-s3.d.ts +0 -10
  46. package/dist/functions/helpers/get-overall-progress-s3.js +0 -24
  47. package/dist/functions/helpers/get-overall-progress.d.ts +0 -9
  48. package/dist/functions/helpers/get-overall-progress.js +0 -23
  49. package/dist/functions/helpers/get-progress.d.ts +0 -15
  50. package/dist/functions/helpers/get-progress.js +0 -254
  51. package/dist/functions/helpers/get-retry-stats.d.ts +0 -5
  52. package/dist/functions/helpers/get-retry-stats.js +0 -2
  53. package/dist/functions/helpers/inspect-errors.d.ts +0 -4
  54. package/dist/functions/helpers/inspect-errors.js +0 -39
  55. package/dist/functions/helpers/is-warm.d.ts +0 -2
  56. package/dist/functions/helpers/is-warm.js +0 -10
  57. package/dist/functions/helpers/leak-detection.d.ts +0 -4
  58. package/dist/functions/helpers/leak-detection.js +0 -40
  59. package/dist/functions/helpers/make-timeout-error.d.ts +0 -10
  60. package/dist/functions/helpers/make-timeout-error.js +0 -31
  61. package/dist/functions/helpers/make-timeout-message.d.ts +0 -10
  62. package/dist/functions/helpers/make-timeout-message.js +0 -75
  63. package/dist/functions/helpers/merge-chunks.d.ts +0 -36
  64. package/dist/functions/helpers/merge-chunks.js +0 -84
  65. package/dist/functions/helpers/min-max.d.ts +0 -2
  66. package/dist/functions/helpers/min-max.js +0 -33
  67. package/dist/functions/helpers/on-downloads-logger.d.ts +0 -2
  68. package/dist/functions/helpers/on-downloads-logger.js +0 -29
  69. package/dist/functions/helpers/overall-render-progress.d.ts +0 -59
  70. package/dist/functions/helpers/overall-render-progress.js +0 -180
  71. package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -1
  72. package/dist/functions/helpers/print-concurrency-curve.js +0 -8
  73. package/dist/functions/helpers/print-logging-helper.d.ts +0 -4
  74. package/dist/functions/helpers/print-logging-helper.js +0 -12
  75. package/dist/functions/helpers/render-has-audio-video.d.ts +0 -6
  76. package/dist/functions/helpers/render-has-audio-video.js +0 -21
  77. package/dist/functions/helpers/request-context.d.ts +0 -5
  78. package/dist/functions/helpers/request-context.js +0 -2
  79. package/dist/functions/helpers/stream-renderer.d.ts +0 -17
  80. package/dist/functions/helpers/stream-renderer.js +0 -148
  81. package/dist/functions/launch.d.ts +0 -10
  82. package/dist/functions/launch.js +0 -595
  83. package/dist/functions/progress.d.ts +0 -11
  84. package/dist/functions/progress.js +0 -51
  85. package/dist/functions/renderer.d.ts +0 -17
  86. package/dist/functions/renderer.js +0 -341
  87. package/dist/functions/start.d.ts +0 -13
  88. package/dist/functions/start.js +0 -112
  89. package/dist/functions/still.d.ts +0 -19
  90. package/dist/functions/still.js +0 -329
  91. package/dist/shared/__mocks__/aws-clients.d.ts +0 -2
  92. package/dist/shared/__mocks__/aws-clients.js +0 -62
  93. package/dist/shared/__mocks__/bundle-site.d.ts +0 -2
  94. package/dist/shared/__mocks__/bundle-site.js +0 -32
  95. package/dist/shared/__mocks__/check-credentials.d.ts +0 -1
  96. package/dist/shared/__mocks__/check-credentials.js +0 -5
  97. package/dist/shared/__mocks__/get-account-id.d.ts +0 -2
  98. package/dist/shared/__mocks__/get-account-id.js +0 -11
  99. package/dist/shared/__mocks__/read-dir.d.ts +0 -2
  100. package/dist/shared/__mocks__/read-dir.js +0 -13
  101. package/dist/shared/call-lambda.d.ts +0 -16
  102. package/dist/shared/call-lambda.js +0 -149
  103. package/dist/shared/cleanup-serialized-input-props.d.ts +0 -14
  104. package/dist/shared/cleanup-serialized-input-props.js +0 -34
  105. package/dist/shared/docs-url.d.ts +0 -1
  106. package/dist/shared/docs-url.js +0 -4
  107. package/dist/shared/get-most-expensive-chunks.d.ts +0 -8
  108. package/dist/shared/get-most-expensive-chunks.js +0 -28
  109. package/dist/shared/invoke-webhook.d.ts +0 -48
  110. package/dist/shared/invoke-webhook.js +0 -140
  111. package/dist/shared/parse-lambda-timings-key.d.ts +0 -5
  112. package/dist/shared/parse-lambda-timings-key.js +0 -2
  113. package/dist/shared/return-values.d.ts +0 -16
  114. package/dist/shared/return-values.js +0 -2
  115. package/dist/shared/stackback.d.ts +0 -6
  116. package/dist/shared/stackback.js +0 -59
  117. package/dist/shared/validate-download-behavior.d.ts +0 -1
  118. package/dist/shared/validate-download-behavior.js +0 -21
  119. package/dist/shared/validate-frames-per-lambda.d.ts +0 -4
  120. package/dist/shared/validate-frames-per-lambda.js +0 -29
  121. package/dist/shared/validate-privacy.d.ts +0 -2
  122. package/dist/shared/validate-privacy.js +0 -14
  123. package/dist/shared/validate.d.ts +0 -4
  124. package/dist/shared/validate.js +0 -8
  125. package/dist/shared/why-is-node-running.d.ts +0 -15
  126. package/dist/shared/why-is-node-running.js +0 -88
@@ -1,148 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.streamRendererFunctionWithRetry = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- const serverless_1 = require("@remotion/serverless");
6
- const client_1 = require("@remotion/serverless/client");
7
- const fs_1 = require("fs");
8
- const path_1 = require("path");
9
- const call_lambda_1 = require("../../shared/call-lambda");
10
- const streamRenderer = ({ payload, functionName, outdir, overallProgress, files, logLevel, onArtifact, providerSpecifics, }) => {
11
- if (payload.type !== client_1.ServerlessRoutines.renderer) {
12
- throw new Error('Expected renderer type');
13
- }
14
- return new Promise((resolve) => {
15
- const receivedStreamingPayload = ({ message }) => {
16
- if (message.type === 'lambda-invoked') {
17
- overallProgress.setLambdaInvoked(payload.chunk);
18
- return;
19
- }
20
- if (message.type === 'frames-rendered') {
21
- overallProgress.setFrames({
22
- index: payload.chunk,
23
- encoded: message.payload.encoded,
24
- rendered: message.payload.rendered,
25
- });
26
- return;
27
- }
28
- if (message.type === 'video-chunk-rendered') {
29
- const filename = (0, path_1.join)(outdir, `chunk:${String(payload.chunk).padStart(8, '0')}:video`);
30
- (0, fs_1.writeFileSync)(filename, message.payload);
31
- files.push(filename);
32
- renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, `Received video chunk for chunk ${payload.chunk}`);
33
- return;
34
- }
35
- if (message.type === 'audio-chunk-rendered') {
36
- const filename = (0, path_1.join)(outdir, `chunk:${String(payload.chunk).padStart(8, '0')}:audio`);
37
- (0, fs_1.writeFileSync)(filename, message.payload);
38
- renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, `Received audio chunk for chunk ${payload.chunk}`);
39
- files.push(filename);
40
- return;
41
- }
42
- if (message.type === 'chunk-complete') {
43
- renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, `Finished chunk ${payload.chunk}`);
44
- overallProgress.addChunkCompleted(payload.chunk, message.payload.start, message.payload.rendered);
45
- return;
46
- }
47
- if (message.type === 'artifact-emitted') {
48
- const artifact = (0, serverless_1.deserializeArtifact)(message.payload.artifact);
49
- renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `Received artifact on frame ${message.payload.artifact.frame}:`, artifact.filename, artifact.content.length + 'bytes.');
50
- const { alreadyExisted } = onArtifact(artifact);
51
- if (alreadyExisted) {
52
- return resolve({
53
- type: 'error',
54
- error: `Chunk ${payload.chunk} emitted an asset filename ${message.payload.artifact.filename} at frame ${message.payload.artifact.frame} but there is already another artifact with the same name. https://remotion.dev/docs/artifacts`,
55
- shouldRetry: false,
56
- });
57
- }
58
- return;
59
- }
60
- if (message.type === 'error-occurred') {
61
- overallProgress.addErrorWithoutUpload(message.payload.errorInfo);
62
- overallProgress.setFrames({
63
- encoded: 0,
64
- index: payload.chunk,
65
- rendered: 0,
66
- });
67
- renderer_1.RenderInternals.Log.error({
68
- indent: false,
69
- logLevel,
70
- }, `Renderer function of chunk ${payload.chunk} failed with error: ${message.payload.error}`);
71
- renderer_1.RenderInternals.Log.error({
72
- indent: false,
73
- logLevel,
74
- }, `Will retry chunk = ${message.payload.shouldRetry}`);
75
- resolve({
76
- type: 'error',
77
- error: message.payload.error,
78
- shouldRetry: message.payload.shouldRetry,
79
- });
80
- return;
81
- }
82
- throw new Error(`Unknown message type ${message.type}`);
83
- };
84
- (0, call_lambda_1.callLambdaWithStreaming)({
85
- functionName,
86
- payload,
87
- retriesRemaining: 1,
88
- region: providerSpecifics.getCurrentRegionInFunction(),
89
- timeoutInTest: 12000,
90
- type: client_1.ServerlessRoutines.renderer,
91
- receivedStreamingPayload,
92
- })
93
- .then(() => {
94
- resolve({
95
- type: 'success',
96
- });
97
- })
98
- .catch((err) => {
99
- var _a, _b;
100
- const shouldRetry = (_b = (_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('Error: aborted')) !== null && _b !== void 0 ? _b : false;
101
- resolve({
102
- type: 'error',
103
- error: err.stack,
104
- shouldRetry,
105
- });
106
- });
107
- });
108
- };
109
- const streamRendererFunctionWithRetry = async ({ payload, files, functionName, outdir, overallProgress, logLevel, onArtifact, providerSpecifics, }) => {
110
- if (payload.type !== client_1.ServerlessRoutines.renderer) {
111
- throw new Error('Expected renderer type');
112
- }
113
- const result = await streamRenderer({
114
- files,
115
- functionName,
116
- outdir,
117
- overallProgress,
118
- payload,
119
- logLevel,
120
- onArtifact,
121
- providerSpecifics,
122
- });
123
- if (result.type === 'error') {
124
- if (!result.shouldRetry) {
125
- throw new Error(result.error);
126
- }
127
- overallProgress.addRetry({
128
- attempt: payload.attempt + 1,
129
- time: Date.now(),
130
- chunk: payload.chunk,
131
- });
132
- return (0, exports.streamRendererFunctionWithRetry)({
133
- files,
134
- functionName,
135
- outdir,
136
- overallProgress,
137
- payload: {
138
- ...payload,
139
- attempt: payload.attempt + 1,
140
- retriesLeft: payload.retriesLeft - 1,
141
- },
142
- logLevel,
143
- onArtifact,
144
- providerSpecifics,
145
- });
146
- }
147
- };
148
- exports.streamRendererFunctionWithRetry = streamRendererFunctionWithRetry;
@@ -1,10 +0,0 @@
1
- import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
2
- import type { ServerlessPayload } from '@remotion/serverless/client';
3
- type Options = {
4
- expectedBucketOwner: string;
5
- getRemainingTimeInMillis: () => number;
6
- };
7
- export declare const launchHandler: <Provider extends CloudProvider>(params: ServerlessPayload<Provider>, options: Options, providerSpecifics: ProviderSpecifics<Provider>) => Promise<{
8
- type: "success";
9
- }>;
10
- export {};