@remotion/serverless 4.0.245 → 4.0.246
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.
- package/.turbo/turbo-make.log +1 -1
- package/dist/best-frames-per-function-param.js +5 -5
- package/dist/client.d.ts +9 -0
- package/dist/client.js +30 -12
- package/dist/compress-props.d.ts +6 -2
- package/dist/compress-props.js +5 -3
- package/dist/concat-videos.d.ts +3 -4
- package/dist/concat-videos.js +2 -2
- package/dist/constants.d.ts +39 -3
- package/dist/constants.js +8 -1
- package/dist/create-post-render-data.d.ts +1 -1
- package/dist/create-post-render-data.js +2 -2
- package/dist/estimate-price-from-bucket.d.ts +2 -2
- package/dist/estimate-price-from-bucket.js +4 -4
- package/dist/expected-out-name.d.ts +1 -1
- package/dist/get-browser-instance.d.ts +5 -12
- package/dist/get-browser-instance.js +8 -7
- package/dist/get-custom-out-name.d.ts +1 -1
- package/dist/get-or-create-bucket.d.ts +1 -1
- package/dist/handlers/check-version-mismatch.d.ts +8 -0
- package/dist/handlers/check-version-mismatch.js +23 -0
- package/dist/handlers/compositions.d.ts +7 -2
- package/dist/handlers/compositions.js +25 -25
- package/dist/handlers/launch.d.ts +3 -2
- package/dist/handlers/launch.js +30 -31
- package/dist/handlers/progress.d.ts +6 -2
- package/dist/handlers/progress.js +23 -20
- package/dist/handlers/renderer.d.ts +3 -2
- package/dist/handlers/renderer.js +13 -11
- package/dist/handlers/start.d.ts +7 -2
- package/dist/handlers/start.js +10 -11
- package/dist/handlers/still.d.ts +2 -1
- package/dist/handlers/still.js +68 -67
- package/dist/index.d.ts +21 -5
- package/dist/index.js +54 -7
- package/dist/info.d.ts +1 -1
- package/dist/inner-routine.d.ts +22 -0
- package/dist/inner-routine.js +267 -0
- package/dist/inspect-error.d.ts +2 -2
- package/dist/invoke-webhook.d.ts +14 -11
- package/dist/invoke-webhook.js +1 -1
- package/dist/is-warm.d.ts +2 -0
- package/dist/is-warm.js +10 -0
- package/dist/make-bucket-name.d.ts +1 -1
- package/dist/make-timeout-error.d.ts +1 -1
- package/dist/make-timeout-message.js +3 -2
- package/dist/merge-chunks.d.ts +2 -1
- package/dist/merge-chunks.js +3 -3
- package/dist/most-expensive-chunks.d.ts +2 -2
- package/dist/most-expensive-chunks.js +1 -1
- package/dist/overall-render-progress.d.ts +3 -3
- package/dist/plan-frame-ranges.d.ts +2 -2
- package/dist/plan-frame-ranges.js +4 -4
- package/dist/print-logging-grep-helper.d.ts +4 -0
- package/dist/print-logging-grep-helper.js +12 -0
- package/dist/progress.js +2 -2
- package/dist/provider-implementation.d.ts +152 -3
- package/dist/render-metadata.d.ts +1 -1
- package/dist/render-progress.d.ts +1 -1
- package/dist/streaming/streaming.d.ts +6 -6
- package/dist/streaming/streaming.js +3 -3
- package/dist/types.d.ts +3 -2
- package/dist/validate-composition.d.ts +1 -1
- package/dist/validate-composition.js +11 -1
- package/dist/validate-frames-per-function.d.ts +2 -2
- package/dist/validate-frames-per-function.js +13 -13
- package/dist/{write-lambda-error.d.ts → write-error-to-storage.d.ts} +4 -4
- package/package.json +6 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-formatting.log +0 -7
- package/.turbo/turbo-lint.log +0 -11
- package/dist/compositions.d.ts +0 -11
- package/dist/compositions.js +0 -82
- package/dist/still.d.ts +0 -28
- package/dist/still.js +0 -2
- package/dist/validate-frames-per-lambda.d.ts +0 -4
- package/dist/validate-frames-per-lambda.js +0 -29
- /package/dist/{write-lambda-error.js → write-error-to-storage.js} +0 -0
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { bundle } from '@remotion/bundler';
|
|
2
|
+
import type { ChromiumOptions, EmittedArtifact, LogLevel } from '@remotion/renderer';
|
|
2
3
|
import type { Readable } from 'stream';
|
|
3
|
-
import type { CustomCredentials, DownloadBehavior, Privacy } from './constants';
|
|
4
|
+
import type { CustomCredentials, DeleteAfter, DownloadBehavior, Privacy, ServerlessRoutines } from './constants';
|
|
5
|
+
import type { LaunchedBrowser } from './get-browser-instance';
|
|
4
6
|
import type { GetFolderFiles } from './get-files-in-folder';
|
|
5
|
-
import type {
|
|
7
|
+
import type { RenderMetadata } from './render-metadata';
|
|
8
|
+
import type { ServerlessReturnValues } from './return-values';
|
|
9
|
+
import type { OnMessage } from './streaming/streaming';
|
|
10
|
+
import type { CallFunctionOptions, CloudProvider, ReceivedArtifact } from './types';
|
|
6
11
|
export type BucketWithLocation<Provider extends CloudProvider> = {
|
|
7
12
|
name: string;
|
|
8
13
|
creationDate: number;
|
|
@@ -96,6 +101,134 @@ export type MakeArtifactWithDetails<Provider extends CloudProvider> = (params: {
|
|
|
96
101
|
storageKey: string;
|
|
97
102
|
artifact: EmittedArtifact;
|
|
98
103
|
}) => ReceivedArtifact<Provider>;
|
|
104
|
+
export type DebuggingTimer = (label: string, logLevel: LogLevel) => {
|
|
105
|
+
end: () => void;
|
|
106
|
+
};
|
|
107
|
+
export type CallFunctionAsync<Provider extends CloudProvider> = <T extends ServerlessRoutines>({ functionName, payload, region, timeoutInTest, }: CallFunctionOptions<T, Provider>) => Promise<void>;
|
|
108
|
+
export type CallFunctionStreaming<Provider extends CloudProvider> = <T extends ServerlessRoutines>(options: CallFunctionOptions<T, Provider> & {
|
|
109
|
+
receivedStreamingPayload: OnMessage<Provider>;
|
|
110
|
+
retriesRemaining: number;
|
|
111
|
+
}) => Promise<void>;
|
|
112
|
+
export type CallFunctionSync<Provider extends CloudProvider> = <T extends ServerlessRoutines>({ functionName, payload, region, timeoutInTest, }: CallFunctionOptions<T, Provider>) => Promise<ServerlessReturnValues<Provider>[T]>;
|
|
113
|
+
export type EstimatePriceInput<Provider extends CloudProvider> = {
|
|
114
|
+
region: Provider['region'];
|
|
115
|
+
memorySizeInMb: number;
|
|
116
|
+
diskSizeInMb: number;
|
|
117
|
+
lambdasInvoked: number;
|
|
118
|
+
durationInMilliseconds: number;
|
|
119
|
+
};
|
|
120
|
+
export type EstimatePrice<Provider extends CloudProvider> = ({ region, memorySizeInMb, diskSizeInMb, lambdasInvoked, ...other }: EstimatePriceInput<Provider>) => number;
|
|
121
|
+
export type GetLoggingUrlForRendererFunction<Provider extends CloudProvider> = (options: {
|
|
122
|
+
region: Provider['region'];
|
|
123
|
+
functionName: string;
|
|
124
|
+
rendererFunctionName: string | null;
|
|
125
|
+
renderId: string;
|
|
126
|
+
chunk: null | number;
|
|
127
|
+
}) => string;
|
|
128
|
+
export type GetLoggingUrlForMethod<Provider extends CloudProvider> = (options: {
|
|
129
|
+
region: Provider['region'];
|
|
130
|
+
functionName: string;
|
|
131
|
+
method: ServerlessRoutines;
|
|
132
|
+
rendererFunctionName: string | null;
|
|
133
|
+
renderId: string;
|
|
134
|
+
}) => string;
|
|
135
|
+
export type GetOutputUrl<Provider extends CloudProvider> = (options: {
|
|
136
|
+
renderMetadata: RenderMetadata<Provider>;
|
|
137
|
+
bucketName: string;
|
|
138
|
+
customCredentials: CustomCredentials<Provider> | null;
|
|
139
|
+
currentRegion: Provider['region'];
|
|
140
|
+
}) => {
|
|
141
|
+
url: string;
|
|
142
|
+
key: string;
|
|
143
|
+
};
|
|
144
|
+
export type GetBrowserInstance = <Provider extends CloudProvider>({ logLevel, indent, chromiumOptions, providerSpecifics, insideFunctionSpecifics, }: {
|
|
145
|
+
logLevel: LogLevel;
|
|
146
|
+
indent: boolean;
|
|
147
|
+
chromiumOptions: ChromiumOptions;
|
|
148
|
+
providerSpecifics: ProviderSpecifics<Provider>;
|
|
149
|
+
insideFunctionSpecifics: InsideFunctionSpecifics;
|
|
150
|
+
}) => Promise<LaunchedBrowser>;
|
|
151
|
+
export type ForgetBrowserEventLoop = (logLevel: LogLevel) => void;
|
|
152
|
+
export type GenerateRenderId = (options: {
|
|
153
|
+
deleteAfter: DeleteAfter | null;
|
|
154
|
+
randomHashFn: () => string;
|
|
155
|
+
}) => string;
|
|
156
|
+
export type GetAccountId<Provider extends CloudProvider> = (options: {
|
|
157
|
+
region: Provider['region'];
|
|
158
|
+
}) => Promise<string>;
|
|
159
|
+
export type DeleteFunctionInput<Provider extends CloudProvider> = {
|
|
160
|
+
region: Provider['region'];
|
|
161
|
+
functionName: string;
|
|
162
|
+
};
|
|
163
|
+
export type DeleteFunction<Provider extends CloudProvider> = (options: DeleteFunctionInput<Provider>) => Promise<void>;
|
|
164
|
+
export type GetFunctionsInput<Provider extends CloudProvider> = {
|
|
165
|
+
region: Provider['region'];
|
|
166
|
+
compatibleOnly: boolean;
|
|
167
|
+
logLevel?: LogLevel;
|
|
168
|
+
};
|
|
169
|
+
export type FunctionInfo = {
|
|
170
|
+
functionName: string;
|
|
171
|
+
timeoutInSeconds: number;
|
|
172
|
+
memorySizeInMb: number;
|
|
173
|
+
version: string | null;
|
|
174
|
+
diskSizeInMb: number;
|
|
175
|
+
};
|
|
176
|
+
export type GetFunctions<Provider extends CloudProvider> = (params: GetFunctionsInput<Provider>) => Promise<FunctionInfo[]>;
|
|
177
|
+
export type ReadDir = ({ dir, etags, originalDir, onProgress, }: {
|
|
178
|
+
dir: string;
|
|
179
|
+
etags: {
|
|
180
|
+
[key: string]: () => Promise<string>;
|
|
181
|
+
};
|
|
182
|
+
originalDir: string;
|
|
183
|
+
onProgress: (bytes: number) => void;
|
|
184
|
+
}) => {
|
|
185
|
+
[key: string]: () => Promise<string>;
|
|
186
|
+
};
|
|
187
|
+
export type UploadDirProgress = {
|
|
188
|
+
totalFiles: number;
|
|
189
|
+
filesUploaded: number;
|
|
190
|
+
totalSize: number;
|
|
191
|
+
sizeUploaded: number;
|
|
192
|
+
};
|
|
193
|
+
export type UploadDir<Provider extends CloudProvider> = (options: {
|
|
194
|
+
bucket: string;
|
|
195
|
+
region: Provider['region'];
|
|
196
|
+
localDir: string;
|
|
197
|
+
keyPrefix: string;
|
|
198
|
+
onProgress: (progress: UploadDirProgress) => void;
|
|
199
|
+
privacy: Privacy;
|
|
200
|
+
toUpload: string[];
|
|
201
|
+
forcePathStyle: boolean;
|
|
202
|
+
}) => Promise<void>;
|
|
203
|
+
type CreateFunctionOptions<Provider extends CloudProvider> = {
|
|
204
|
+
region: Provider['region'];
|
|
205
|
+
logLevel: LogLevel;
|
|
206
|
+
ephemerealStorageInMb: number;
|
|
207
|
+
timeoutInSeconds: number;
|
|
208
|
+
memorySizeInMb: number;
|
|
209
|
+
functionName: string;
|
|
210
|
+
zipFile: string;
|
|
211
|
+
} & Provider['creationFunctionOptions'];
|
|
212
|
+
export type CreateFunction<Provider extends CloudProvider> = (options: CreateFunctionOptions<Provider>) => Promise<{
|
|
213
|
+
FunctionName: string;
|
|
214
|
+
}>;
|
|
215
|
+
export type InsideFunctionSpecifics = {
|
|
216
|
+
getBrowserInstance: GetBrowserInstance;
|
|
217
|
+
forgetBrowserEventLoop: ForgetBrowserEventLoop;
|
|
218
|
+
timer: DebuggingTimer;
|
|
219
|
+
generateRandomId: GenerateRenderId;
|
|
220
|
+
deleteTmpDir: () => Promise<void>;
|
|
221
|
+
getCurrentFunctionName: () => string;
|
|
222
|
+
getCurrentMemorySizeInMb: () => number;
|
|
223
|
+
};
|
|
224
|
+
export type FullClientSpecifics<Provider extends CloudProvider> = {
|
|
225
|
+
id: '__remotion_full_client_specifics';
|
|
226
|
+
bundleSite: typeof bundle;
|
|
227
|
+
readDirectory: ReadDir;
|
|
228
|
+
uploadDir: UploadDir<Provider>;
|
|
229
|
+
createFunction: CreateFunction<Provider>;
|
|
230
|
+
checkCredentials: () => void;
|
|
231
|
+
};
|
|
99
232
|
export type ProviderSpecifics<Provider extends CloudProvider> = {
|
|
100
233
|
getChromiumPath: () => string | null;
|
|
101
234
|
getCurrentRegionInFunction: () => Provider['region'];
|
|
@@ -113,5 +246,21 @@ export type ProviderSpecifics<Provider extends CloudProvider> = {
|
|
|
113
246
|
printLoggingHelper: boolean;
|
|
114
247
|
getFolderFiles: GetFolderFiles;
|
|
115
248
|
makeArtifactWithDetails: MakeArtifactWithDetails<Provider>;
|
|
249
|
+
validateDeleteAfter: (lifeCycleValue: unknown) => void;
|
|
250
|
+
callFunctionAsync: CallFunctionAsync<Provider>;
|
|
251
|
+
callFunctionStreaming: CallFunctionStreaming<Provider>;
|
|
252
|
+
callFunctionSync: CallFunctionSync<Provider>;
|
|
253
|
+
estimatePrice: EstimatePrice<Provider>;
|
|
254
|
+
getLoggingUrlForRendererFunction: GetLoggingUrlForRendererFunction<Provider>;
|
|
255
|
+
getLoggingUrlForMethod: GetLoggingUrlForMethod<Provider>;
|
|
256
|
+
getEphemeralStorageForPriceCalculation: () => number;
|
|
257
|
+
getOutputUrl: GetOutputUrl<Provider>;
|
|
258
|
+
isFlakyError: (err: Error) => boolean;
|
|
259
|
+
serverStorageProductName: () => string;
|
|
260
|
+
getMaxStillInlinePayloadSize: () => number;
|
|
261
|
+
getMaxNonInlinePayloadSizePerFunction: () => number;
|
|
262
|
+
getAccountId: GetAccountId<Provider>;
|
|
263
|
+
deleteFunction: DeleteFunction<Provider>;
|
|
264
|
+
getFunctions: GetFunctions<Provider>;
|
|
116
265
|
};
|
|
117
266
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AudioCodec, DeleteAfter, StillImageFormat, VideoImageFormat } from '@remotion/renderer';
|
|
2
2
|
import type { DownloadBehavior, OutNameInputWithoutCredentials, Privacy, SerializedInputProps, ServerlessCodec } from './constants';
|
|
3
|
-
import type { CloudProvider } from './
|
|
3
|
+
import type { CloudProvider } from './types';
|
|
4
4
|
type Discriminated = {
|
|
5
5
|
type: 'still';
|
|
6
6
|
imageFormat: StillImageFormat;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExpensiveChunk } from './most-expensive-chunks';
|
|
2
2
|
import type { RenderMetadata } from './render-metadata';
|
|
3
3
|
import type { ChunkRetry, CloudProvider, CostsInfo, ReceivedArtifact } from './types';
|
|
4
|
-
import type { EnhancedErrorInfo } from './write-
|
|
4
|
+
import type { EnhancedErrorInfo } from './write-error-to-storage';
|
|
5
5
|
export type CleanupInfo = {
|
|
6
6
|
doneIn: number | null;
|
|
7
7
|
minFilesToDelete: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SerializedArtifact } from '../serialize-artifact';
|
|
2
|
-
import type { CloudProvider,
|
|
3
|
-
import type {
|
|
2
|
+
import type { CloudProvider, RenderStillFunctionResponsePayload } from '../types';
|
|
3
|
+
import type { FunctionErrorInfo } from '../write-error-to-storage';
|
|
4
4
|
declare const framesRendered: "frames-rendered";
|
|
5
5
|
declare const errorOccurred: "error-occurred";
|
|
6
6
|
declare const renderIdDetermined: "render-id-determined";
|
|
@@ -8,7 +8,7 @@ declare const videoChunkRendered: "video-chunk-rendered";
|
|
|
8
8
|
declare const audioChunkRendered: "audio-chunk-rendered";
|
|
9
9
|
declare const chunkComplete: "chunk-complete";
|
|
10
10
|
declare const stillRendered: "still-rendered";
|
|
11
|
-
declare const
|
|
11
|
+
declare const functionInvoked: "lambda-invoked";
|
|
12
12
|
declare const artifactEmitted: "artifact-emitted";
|
|
13
13
|
declare const messageTypes: {
|
|
14
14
|
readonly '1': {
|
|
@@ -61,7 +61,7 @@ export type StreamingPayload<Provider extends CloudProvider> = {
|
|
|
61
61
|
payload: {
|
|
62
62
|
error: string;
|
|
63
63
|
shouldRetry: boolean;
|
|
64
|
-
errorInfo:
|
|
64
|
+
errorInfo: FunctionErrorInfo;
|
|
65
65
|
};
|
|
66
66
|
} | {
|
|
67
67
|
type: typeof renderIdDetermined;
|
|
@@ -70,7 +70,7 @@ export type StreamingPayload<Provider extends CloudProvider> = {
|
|
|
70
70
|
};
|
|
71
71
|
} | {
|
|
72
72
|
type: typeof stillRendered;
|
|
73
|
-
payload:
|
|
73
|
+
payload: RenderStillFunctionResponsePayload<Provider>;
|
|
74
74
|
} | {
|
|
75
75
|
type: typeof chunkComplete;
|
|
76
76
|
payload: {
|
|
@@ -78,7 +78,7 @@ export type StreamingPayload<Provider extends CloudProvider> = {
|
|
|
78
78
|
rendered: number;
|
|
79
79
|
};
|
|
80
80
|
} | {
|
|
81
|
-
type: typeof
|
|
81
|
+
type: typeof functionInvoked;
|
|
82
82
|
payload: {
|
|
83
83
|
attempt: number;
|
|
84
84
|
};
|
|
@@ -9,7 +9,7 @@ const videoChunkRendered = 'video-chunk-rendered';
|
|
|
9
9
|
const audioChunkRendered = 'audio-chunk-rendered';
|
|
10
10
|
const chunkComplete = 'chunk-complete';
|
|
11
11
|
const stillRendered = 'still-rendered';
|
|
12
|
-
const
|
|
12
|
+
const functionInvoked = 'lambda-invoked';
|
|
13
13
|
const artifactEmitted = 'artifact-emitted';
|
|
14
14
|
const messageTypes = {
|
|
15
15
|
'1': { type: framesRendered },
|
|
@@ -19,7 +19,7 @@ const messageTypes = {
|
|
|
19
19
|
'5': { type: audioChunkRendered },
|
|
20
20
|
'6': { type: stillRendered },
|
|
21
21
|
'7': { type: chunkComplete },
|
|
22
|
-
'8': { type:
|
|
22
|
+
'8': { type: functionInvoked },
|
|
23
23
|
'9': { type: artifactEmitted },
|
|
24
24
|
};
|
|
25
25
|
exports.formatMap = {
|
|
@@ -30,7 +30,7 @@ exports.formatMap = {
|
|
|
30
30
|
[audioChunkRendered]: 'binary',
|
|
31
31
|
[stillRendered]: 'json',
|
|
32
32
|
[chunkComplete]: 'json',
|
|
33
|
-
[
|
|
33
|
+
[functionInvoked]: 'json',
|
|
34
34
|
[artifactEmitted]: 'json',
|
|
35
35
|
};
|
|
36
36
|
const messageTypeIdToMessageType = (messageTypeId) => {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ServerlessPayloads, ServerlessRoutines } from './constants';
|
|
2
|
-
export interface CloudProvider<Region extends string = string, ReceivedArtifactType extends Record<string, unknown> = Record<string, unknown>> {
|
|
2
|
+
export interface CloudProvider<Region extends string = string, ReceivedArtifactType extends Record<string, unknown> = Record<string, unknown>, CreateFunctionSpecifics extends Record<string, unknown> = Record<string, unknown>> {
|
|
3
3
|
type: string;
|
|
4
4
|
region: Region;
|
|
5
5
|
receivedArtifactType: ReceivedArtifactType;
|
|
6
|
+
creationFunctionOptions: CreateFunctionSpecifics;
|
|
6
7
|
}
|
|
7
8
|
export type ReceivedArtifact<Provider extends CloudProvider> = {
|
|
8
9
|
filename: string;
|
|
@@ -16,7 +17,7 @@ export type CostsInfo = {
|
|
|
16
17
|
currency: string;
|
|
17
18
|
disclaimer: string;
|
|
18
19
|
};
|
|
19
|
-
export type
|
|
20
|
+
export type RenderStillFunctionResponsePayload<Provider extends CloudProvider> = {
|
|
20
21
|
type: 'success';
|
|
21
22
|
output: string;
|
|
22
23
|
outKey: string;
|
|
@@ -2,7 +2,7 @@ import type { ChromiumOptions, LogLevel, OnBrowserDownload, openBrowser, Remotio
|
|
|
2
2
|
import type { VideoConfig } from 'remotion/no-react';
|
|
3
3
|
import type { Await } from './await';
|
|
4
4
|
import type { ProviderSpecifics } from './provider-implementation';
|
|
5
|
-
import type { CloudProvider } from './
|
|
5
|
+
import type { CloudProvider } from './types';
|
|
6
6
|
type ValidateCompositionOptions<Provider extends CloudProvider> = {
|
|
7
7
|
serveUrl: string;
|
|
8
8
|
composition: string;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateComposition = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
const validate_1 = require("./validate");
|
|
5
6
|
const validateComposition = async ({ serveUrl, composition, browserInstance, serializedInputPropsWithCustomSchema, envVariables, timeoutInMilliseconds, chromiumOptions, port, forceHeight, forceWidth, logLevel, server, offthreadVideoCacheSizeInBytes, onBrowserDownload, onServeUrlVisited, providerSpecifics, }) => {
|
|
6
7
|
const { metadata: comp } = await renderer_1.RenderInternals.internalSelectComposition({
|
|
7
8
|
id: composition,
|
|
@@ -22,10 +23,19 @@ const validateComposition = async ({ serveUrl, composition, browserInstance, ser
|
|
|
22
23
|
onBrowserDownload,
|
|
23
24
|
onServeUrlVisited,
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
+
const videoConfig = {
|
|
26
27
|
...comp,
|
|
27
28
|
height: forceHeight !== null && forceHeight !== void 0 ? forceHeight : comp.height,
|
|
28
29
|
width: forceWidth !== null && forceWidth !== void 0 ? forceWidth : comp.width,
|
|
29
30
|
};
|
|
31
|
+
const reason = `of the "<Composition />" component with the id "${composition}"`;
|
|
32
|
+
(0, validate_1.validateDurationInFrames)(comp.durationInFrames, {
|
|
33
|
+
component: reason,
|
|
34
|
+
allowFloats: false,
|
|
35
|
+
});
|
|
36
|
+
(0, validate_1.validateFps)(comp.fps, reason, false);
|
|
37
|
+
(0, validate_1.validateDimension)(comp.height, 'height', reason);
|
|
38
|
+
(0, validate_1.validateDimension)(comp.width, 'width', reason);
|
|
39
|
+
return videoConfig;
|
|
30
40
|
};
|
|
31
41
|
exports.validateComposition = validateComposition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const validateFramesPerFunction: ({
|
|
2
|
-
|
|
1
|
+
export declare const validateFramesPerFunction: ({ framesPerFunction, durationInFrames, }: {
|
|
2
|
+
framesPerFunction: unknown;
|
|
3
3
|
durationInFrames: number;
|
|
4
4
|
}) => void;
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateFramesPerFunction = void 0;
|
|
4
4
|
const constants_1 = require("./constants");
|
|
5
|
-
const validateFramesPerFunction = ({
|
|
6
|
-
if (
|
|
5
|
+
const validateFramesPerFunction = ({ framesPerFunction, durationInFrames, }) => {
|
|
6
|
+
if (framesPerFunction === null) {
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
|
-
if (
|
|
9
|
+
if (framesPerFunction === undefined) {
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
|
-
if (typeof
|
|
13
|
-
throw new TypeError(`'framesPerLambda' needs to be a number, passed ${JSON.stringify(
|
|
12
|
+
if (typeof framesPerFunction !== 'number') {
|
|
13
|
+
throw new TypeError(`'framesPerLambda' needs to be a number, passed ${JSON.stringify(framesPerFunction)}`);
|
|
14
14
|
}
|
|
15
|
-
if (!Number.isFinite(
|
|
16
|
-
throw new TypeError(`'framesPerLambda' needs to be finite, passed ${
|
|
15
|
+
if (!Number.isFinite(framesPerFunction)) {
|
|
16
|
+
throw new TypeError(`'framesPerLambda' needs to be finite, passed ${framesPerFunction}`);
|
|
17
17
|
}
|
|
18
|
-
if (Number.isNaN(
|
|
19
|
-
throw new TypeError(`'framesPerLambda' needs to be NaN, passed ${
|
|
18
|
+
if (Number.isNaN(framesPerFunction)) {
|
|
19
|
+
throw new TypeError(`'framesPerLambda' needs to be NaN, passed ${framesPerFunction}`);
|
|
20
20
|
}
|
|
21
|
-
if (
|
|
22
|
-
throw new TypeError(`'framesPerLambda' needs to be an integer, passed ${
|
|
21
|
+
if (framesPerFunction % 1 !== 0) {
|
|
22
|
+
throw new TypeError(`'framesPerLambda' needs to be an integer, passed ${framesPerFunction}`);
|
|
23
23
|
}
|
|
24
24
|
const effectiveMinimum = Math.min(constants_1.MINIMUM_FRAMES_PER_LAMBDA, durationInFrames);
|
|
25
|
-
if (
|
|
26
|
-
throw new TypeError(`The framesPerLambda needs to be at least ${effectiveMinimum}, but is ${
|
|
25
|
+
if (framesPerFunction < effectiveMinimum) {
|
|
26
|
+
throw new TypeError(`The framesPerLambda needs to be at least ${effectiveMinimum}, but is ${framesPerFunction}`);
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
exports.validateFramesPerFunction = validateFramesPerFunction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FileNameAndSize } from './get-files-in-folder';
|
|
2
2
|
import type { ProviderSpecifics } from './provider-implementation';
|
|
3
|
-
import type { CloudProvider } from './
|
|
4
|
-
export type
|
|
3
|
+
import type { CloudProvider } from './types';
|
|
4
|
+
export type FunctionErrorInfo = {
|
|
5
5
|
type: 'renderer' | 'browser' | 'stitcher' | 'webhook' | 'artifact';
|
|
6
6
|
message: string;
|
|
7
7
|
name: string;
|
|
@@ -17,8 +17,8 @@ export type LambdaErrorInfo = {
|
|
|
17
17
|
total: number;
|
|
18
18
|
} | null;
|
|
19
19
|
};
|
|
20
|
-
export declare const getTmpDirStateIfENoSp: <Provider extends CloudProvider>(err: string, providerSpecifics: ProviderSpecifics<Provider>) =>
|
|
21
|
-
export type EnhancedErrorInfo =
|
|
20
|
+
export declare const getTmpDirStateIfENoSp: <Provider extends CloudProvider>(err: string, providerSpecifics: ProviderSpecifics<Provider>) => FunctionErrorInfo["tmpDir"];
|
|
21
|
+
export type EnhancedErrorInfo = FunctionErrorInfo & {
|
|
22
22
|
/**
|
|
23
23
|
* @deprecated Will always be an empty string.
|
|
24
24
|
*/
|
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.
|
|
6
|
+
"version": "4.0.246",
|
|
7
7
|
"description": "A runtime for distributed rendering",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"remotion": "4.0.
|
|
21
|
-
"@remotion/renderer": "4.0.
|
|
22
|
-
"@remotion/
|
|
20
|
+
"remotion": "4.0.246",
|
|
21
|
+
"@remotion/renderer": "4.0.246",
|
|
22
|
+
"@remotion/bundler": "4.0.246",
|
|
23
|
+
"@remotion/streaming": "4.0.246"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"eslint": "9.14.0",
|
|
26
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
27
|
+
"@remotion/eslint-config-internal": "4.0.246"
|
|
27
28
|
},
|
|
28
29
|
"exports": {
|
|
29
30
|
".": "./dist/index.js",
|