@remotion/lambda-client 4.0.304 → 4.0.305
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 +2 -2
- package/dist/aws-provider.d.ts +2 -0
- package/dist/esm/index.mjs +120 -115
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -2
- package/dist/make-lambda-payload.d.ts +4 -2
- package/dist/make-lambda-payload.js +4 -5
- package/dist/render-media-on-lambda.d.ts +2 -0
- package/dist/render-media-on-lambda.js +2 -1
- package/dist/render-still-on-lambda.d.ts +13 -9
- package/dist/render-still-on-lambda.js +14 -15
- package/dist/write-file.js +2 -1
- package/package.json +3 -3
- package/src/aws-provider.ts +2 -0
- package/src/index.ts +2 -0
- package/src/make-lambda-payload.ts +6 -7
- package/src/render-media-on-lambda.ts +3 -0
- package/src/render-still-on-lambda.ts +21 -15
- package/src/write-file.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
package/src/aws-provider.ts
CHANGED
|
@@ -18,8 +18,10 @@ export type AwsProvider = {
|
|
|
18
18
|
vpcSecurityGroupIds: string;
|
|
19
19
|
runtimePreference: RuntimePreference;
|
|
20
20
|
};
|
|
21
|
+
storageClass: StorageClass;
|
|
21
22
|
};
|
|
22
23
|
|
|
24
|
+
import type {StorageClass} from '@aws-sdk/client-s3';
|
|
23
25
|
import type {ProviderSpecifics} from '@remotion/serverless-client';
|
|
24
26
|
import {expiryDays} from '@remotion/serverless-client';
|
|
25
27
|
import {EventEmitter} from 'node:events';
|
package/src/index.ts
CHANGED
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
internalRenderMediaOnLambdaRaw,
|
|
49
49
|
renderMediaOnLambdaOptionalToRequired,
|
|
50
50
|
} from './render-media-on-lambda';
|
|
51
|
+
import {internalRenderStillOnLambda} from './render-still-on-lambda';
|
|
51
52
|
import {runtimePreferenceOptions} from './runtime-preference';
|
|
52
53
|
import {innerSpeculateFunctionName} from './speculate-function-name';
|
|
53
54
|
import {validateAwsRegion} from './validate-aws-region';
|
|
@@ -142,6 +143,7 @@ export const LambdaClientInternals = {
|
|
|
142
143
|
validateServeUrl,
|
|
143
144
|
getEnvVariable,
|
|
144
145
|
internalRenderMediaOnLambdaRaw,
|
|
146
|
+
internalRenderStillOnLambda,
|
|
145
147
|
cleanItems,
|
|
146
148
|
makeLambdaRenderStillPayload,
|
|
147
149
|
getRenderProgressPayload,
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
import type {AwsProvider} from './aws-provider';
|
|
34
34
|
import {awsImplementation} from './aws-provider';
|
|
35
35
|
|
|
36
|
+
import type {StorageClass} from '@aws-sdk/client-s3';
|
|
36
37
|
import {validateWebhook} from '@remotion/serverless-client';
|
|
37
38
|
import type {GetRenderProgressInput} from './get-render-progress';
|
|
38
39
|
import type {AwsRegion} from './regions';
|
|
@@ -84,6 +85,7 @@ export type InnerRenderMediaOnLambdaInput = {
|
|
|
84
85
|
indent: boolean;
|
|
85
86
|
forcePathStyle: boolean;
|
|
86
87
|
metadata: Record<string, string> | null;
|
|
88
|
+
storageClass: StorageClass | null;
|
|
87
89
|
} & ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>;
|
|
88
90
|
|
|
89
91
|
export const makeLambdaRenderMediaPayload = async ({
|
|
@@ -132,6 +134,7 @@ export const makeLambdaRenderMediaPayload = async ({
|
|
|
132
134
|
metadata,
|
|
133
135
|
apiKey,
|
|
134
136
|
offthreadVideoThreads,
|
|
137
|
+
storageClass,
|
|
135
138
|
}: InnerRenderMediaOnLambdaInput): Promise<
|
|
136
139
|
ServerlessStartPayload<AwsProvider>
|
|
137
140
|
> => {
|
|
@@ -213,6 +216,7 @@ export const makeLambdaRenderMediaPayload = async ({
|
|
|
213
216
|
metadata: metadata ?? null,
|
|
214
217
|
apiKey: apiKey ?? null,
|
|
215
218
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
219
|
+
storageClass: storageClass ?? null,
|
|
216
220
|
};
|
|
217
221
|
};
|
|
218
222
|
|
|
@@ -239,7 +243,6 @@ export const makeLambdaRenderStillPayload = async ({
|
|
|
239
243
|
inputProps,
|
|
240
244
|
imageFormat,
|
|
241
245
|
envVariables,
|
|
242
|
-
quality,
|
|
243
246
|
jpegQuality,
|
|
244
247
|
region,
|
|
245
248
|
maxRetries,
|
|
@@ -259,15 +262,10 @@ export const makeLambdaRenderStillPayload = async ({
|
|
|
259
262
|
deleteAfter,
|
|
260
263
|
forcePathStyle,
|
|
261
264
|
apiKey,
|
|
265
|
+
storageClass,
|
|
262
266
|
}: RenderStillOnLambdaNonNullInput): Promise<
|
|
263
267
|
ServerlessPayloads<AwsProvider>[ServerlessRoutines.still]
|
|
264
268
|
> => {
|
|
265
|
-
if (quality) {
|
|
266
|
-
throw new Error(
|
|
267
|
-
'The `quality` option is deprecated. Use `jpegQuality` instead.',
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
269
|
const stringifiedInputProps = serializeOrThrow(inputProps, 'input-props');
|
|
272
270
|
|
|
273
271
|
const serializedInputProps = await compressInputProps({
|
|
@@ -316,5 +314,6 @@ export const makeLambdaRenderStillPayload = async ({
|
|
|
316
314
|
forcePathStyle,
|
|
317
315
|
apiKey: apiKey ?? null,
|
|
318
316
|
offthreadVideoThreads: null,
|
|
317
|
+
storageClass: storageClass ?? null,
|
|
319
318
|
};
|
|
320
319
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type {StorageClass} from '@aws-sdk/client-s3';
|
|
1
2
|
import type {
|
|
2
3
|
AudioCodec,
|
|
3
4
|
BrowserSafeApis,
|
|
@@ -69,6 +70,7 @@ export type RenderMediaOnLambdaInput = {
|
|
|
69
70
|
dumpBrowserLogs?: boolean;
|
|
70
71
|
forcePathStyle?: boolean;
|
|
71
72
|
metadata?: Record<string, string> | null;
|
|
73
|
+
storageClass?: StorageClass | null;
|
|
72
74
|
} & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>>;
|
|
73
75
|
|
|
74
76
|
export type RenderMediaOnLambdaOutput = {
|
|
@@ -190,6 +192,7 @@ export const renderMediaOnLambdaOptionalToRequired = (
|
|
|
190
192
|
indent: false,
|
|
191
193
|
metadata: options.metadata ?? null,
|
|
192
194
|
apiKey: options.apiKey ?? null,
|
|
195
|
+
storageClass: options.storageClass ?? null,
|
|
193
196
|
};
|
|
194
197
|
};
|
|
195
198
|
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
} from '@remotion/serverless-client';
|
|
8
8
|
import {ServerlessRoutines} from '@remotion/serverless-client';
|
|
9
9
|
|
|
10
|
+
import type {StorageClass} from '@aws-sdk/client-s3';
|
|
10
11
|
import type {
|
|
11
12
|
CostsInfo,
|
|
12
13
|
OutNameInput,
|
|
@@ -34,10 +35,6 @@ type MandatoryParameters = {
|
|
|
34
35
|
type OptionalParameters = {
|
|
35
36
|
maxRetries: number;
|
|
36
37
|
envVariables: Record<string, string>;
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated Renamed to `jpegQuality`
|
|
39
|
-
*/
|
|
40
|
-
quality?: never;
|
|
41
38
|
frame: number;
|
|
42
39
|
outName: OutNameInput<AwsProvider> | null;
|
|
43
40
|
chromiumOptions: ChromiumOptions;
|
|
@@ -45,10 +42,6 @@ type OptionalParameters = {
|
|
|
45
42
|
forceWidth: number | null;
|
|
46
43
|
forceHeight: number | null;
|
|
47
44
|
forceBucketName: string | null;
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated Renamed to `logLevel`
|
|
50
|
-
*/
|
|
51
|
-
dumpBrowserLogs: boolean;
|
|
52
45
|
onInit: (data: {
|
|
53
46
|
renderId: string;
|
|
54
47
|
cloudWatchLogs: string;
|
|
@@ -56,6 +49,7 @@ type OptionalParameters = {
|
|
|
56
49
|
}) => void;
|
|
57
50
|
indent: boolean;
|
|
58
51
|
forcePathStyle: boolean;
|
|
52
|
+
storageClass: StorageClass | null;
|
|
59
53
|
} & ToOptions<typeof BrowserSafeApis.optionsMap.renderStillOnLambda>;
|
|
60
54
|
|
|
61
55
|
export type RenderStillOnLambdaNonNullInput = MandatoryParameters &
|
|
@@ -75,7 +69,7 @@ export type RenderStillOnLambdaOutput = {
|
|
|
75
69
|
artifacts: ReceivedArtifact<AwsProvider>[];
|
|
76
70
|
};
|
|
77
71
|
|
|
78
|
-
const
|
|
72
|
+
const innerRenderStillOnLambda = async (
|
|
79
73
|
input: RenderStillOnLambdaNonNullInput,
|
|
80
74
|
): Promise<RenderStillOnLambdaOutput> => {
|
|
81
75
|
const {functionName, region, onInit} = input;
|
|
@@ -154,14 +148,27 @@ const internalRenderStillOnLambda = async (
|
|
|
154
148
|
}
|
|
155
149
|
};
|
|
156
150
|
|
|
157
|
-
const
|
|
151
|
+
export const internalRenderStillOnLambda = wrapWithErrorHandling(
|
|
152
|
+
innerRenderStillOnLambda,
|
|
153
|
+
);
|
|
158
154
|
|
|
159
155
|
/*
|
|
160
156
|
* @description Renders a still image inside a lambda function and writes it to the specified output location.
|
|
161
157
|
* @see [Documentation](https://remotion.dev/docs/lambda/renderstillonlambda)
|
|
162
158
|
*/
|
|
163
|
-
export const renderStillOnLambda = (
|
|
164
|
-
|
|
159
|
+
export const renderStillOnLambda = (
|
|
160
|
+
input: RenderStillOnLambdaInput & {
|
|
161
|
+
/**
|
|
162
|
+
* @deprecated Renamed to `jpegQuality`
|
|
163
|
+
*/
|
|
164
|
+
quality?: never;
|
|
165
|
+
/**
|
|
166
|
+
* @deprecated Renamed to `logLevel`
|
|
167
|
+
*/
|
|
168
|
+
dumpBrowserLogs?: boolean;
|
|
169
|
+
},
|
|
170
|
+
) => {
|
|
171
|
+
return internalRenderStillOnLambda({
|
|
165
172
|
chromiumOptions: input.chromiumOptions ?? {},
|
|
166
173
|
composition: input.composition,
|
|
167
174
|
deleteAfter: input.deleteAfter ?? null,
|
|
@@ -179,18 +186,17 @@ export const renderStillOnLambda = (input: RenderStillOnLambdaInput) => {
|
|
|
179
186
|
onInit: input.onInit ?? (() => undefined),
|
|
180
187
|
outName: input.outName ?? null,
|
|
181
188
|
privacy: input.privacy,
|
|
182
|
-
quality: undefined,
|
|
183
189
|
region: input.region,
|
|
184
190
|
serveUrl: input.serveUrl,
|
|
185
|
-
jpegQuality: input.jpegQuality ?? 80,
|
|
191
|
+
jpegQuality: input.jpegQuality ?? input.quality ?? 80,
|
|
186
192
|
logLevel: input.dumpBrowserLogs ? 'verbose' : (input.logLevel ?? 'info'),
|
|
187
193
|
offthreadVideoCacheSizeInBytes:
|
|
188
194
|
input.offthreadVideoCacheSizeInBytes ?? null,
|
|
189
195
|
scale: input.scale ?? 1,
|
|
190
196
|
timeoutInMilliseconds: input.timeoutInMilliseconds ?? 30000,
|
|
191
|
-
dumpBrowserLogs: false,
|
|
192
197
|
forcePathStyle: input.forcePathStyle ?? false,
|
|
193
198
|
apiKey: input.apiKey ?? null,
|
|
194
199
|
offthreadVideoThreads: input.offthreadVideoThreads ?? null,
|
|
200
|
+
storageClass: input.storageClass ?? null,
|
|
195
201
|
});
|
|
196
202
|
};
|
package/src/write-file.ts
CHANGED
|
@@ -24,6 +24,7 @@ const tryLambdaWriteFile = async ({
|
|
|
24
24
|
downloadBehavior,
|
|
25
25
|
customCredentials,
|
|
26
26
|
forcePathStyle,
|
|
27
|
+
storageClass,
|
|
27
28
|
}: WriteFileInput<AwsProvider>): Promise<void> => {
|
|
28
29
|
const client = getS3Client({
|
|
29
30
|
region,
|
|
@@ -46,6 +47,7 @@ const tryLambdaWriteFile = async ({
|
|
|
46
47
|
: (expectedBucketOwner ?? undefined),
|
|
47
48
|
ContentType: mimeTypes.lookup(key) || 'application/octet-stream',
|
|
48
49
|
ContentDisposition: getContentDispositionHeader(downloadBehavior),
|
|
50
|
+
StorageClass: storageClass ?? undefined,
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
// Determine file size
|