@remotion/lambda-client 4.0.398 → 4.0.400
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/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/make-lambda-payload.d.ts +2 -2
- package/dist/esm/index.mjs +7 -1
- package/package.json +3 -3
- package/dist/app-router-webhook.d.ts +0 -10
- package/dist/app-router-webhook.js +0 -43
- package/dist/apply-lifecycle.d.ts +0 -8
- package/dist/apply-lifecycle.js +0 -18
- package/dist/aws-clients.d.ts +0 -12
- package/dist/aws-clients.js +0 -56
- package/dist/aws-provider.d.ts +0 -27
- package/dist/aws-provider.js +0 -94
- package/dist/bucket-exists.d.ts +0 -3
- package/dist/bucket-exists.js +0 -27
- package/dist/call-lambda-async.d.ts +0 -2
- package/dist/call-lambda-async.js +0 -20
- package/dist/call-lambda-streaming.d.ts +0 -6
- package/dist/call-lambda-streaming.js +0 -126
- package/dist/call-lambda-sync.d.ts +0 -2
- package/dist/call-lambda-sync.js +0 -30
- package/dist/check-credentials.d.ts +0 -1
- package/dist/check-credentials.js +0 -39
- package/dist/clean-items.d.ts +0 -17
- package/dist/clean-items.js +0 -26
- package/dist/constants.d.ts +0 -25
- package/dist/constants.js +0 -26
- package/dist/content-disposition-header.d.ts +0 -2
- package/dist/content-disposition-header.js +0 -50
- package/dist/convert-to-serve-url.d.ts +0 -6
- package/dist/convert-to-serve-url.js +0 -14
- package/dist/create-bucket.d.ts +0 -3
- package/dist/create-bucket.js +0 -65
- package/dist/delete-file.d.ts +0 -3
- package/dist/delete-file.js +0 -17
- package/dist/delete-function.d.ts +0 -7
- package/dist/delete-function.js +0 -15
- package/dist/delete-render.d.ts +0 -22
- package/dist/delete-render.js +0 -90
- package/dist/encode-aws-url-params.d.ts +0 -1
- package/dist/encode-aws-url-params.js +0 -7
- package/dist/estimate-price.d.ts +0 -17
- package/dist/estimate-price.js +0 -45
- package/dist/express-webhook.d.ts +0 -3
- package/dist/express-webhook.js +0 -46
- package/dist/get-account-id.d.ts +0 -3
- package/dist/get-account-id.js +0 -15
- package/dist/get-aws-client.d.ts +0 -32
- package/dist/get-aws-client.js +0 -67
- package/dist/get-aws-urls.d.ts +0 -25
- package/dist/get-aws-urls.js +0 -31
- package/dist/get-buckets.d.ts +0 -9
- package/dist/get-buckets.js +0 -64
- package/dist/get-compositions-on-lambda.d.ts +0 -20
- package/dist/get-compositions-on-lambda.js +0 -62
- package/dist/get-credentials.d.ts +0 -9
- package/dist/get-credentials.js +0 -55
- package/dist/get-env-variable.d.ts +0 -1
- package/dist/get-env-variable.js +0 -15
- package/dist/get-function-name.d.ts +0 -8
- package/dist/get-function-name.js +0 -17
- package/dist/get-function-version.d.ts +0 -9
- package/dist/get-function-version.js +0 -35
- package/dist/get-functions.d.ts +0 -10
- package/dist/get-functions.js +0 -80
- package/dist/get-output-url-from-metadata.d.ts +0 -3
- package/dist/get-output-url-from-metadata.js +0 -18
- package/dist/get-render-progress.d.ts +0 -17
- package/dist/get-render-progress.js +0 -47
- package/dist/get-s3-client.d.ts +0 -11
- package/dist/get-s3-client.js +0 -15
- package/dist/get-service-client.d.ts +0 -25
- package/dist/get-service-client.js +0 -131
- package/dist/get-sites.d.ts +0 -31
- package/dist/get-sites.js +0 -83
- package/dist/head-file.d.ts +0 -3
- package/dist/head-file.js +0 -18
- package/dist/index.d.ts +0 -129
- package/dist/index.js +0 -108
- package/dist/is-cli.d.ts +0 -2
- package/dist/is-cli.js +0 -10
- package/dist/is-flaky-error.d.ts +0 -1
- package/dist/is-flaky-error.js +0 -78
- package/dist/is-in-lambda.d.ts +0 -1
- package/dist/is-in-lambda.js +0 -9
- package/dist/is-likely-to-have-aws-profile.d.ts +0 -1
- package/dist/is-likely-to-have-aws-profile.js +0 -50
- package/dist/lambda-version-string.d.ts +0 -1
- package/dist/lambda-version-string.js +0 -7
- package/dist/lifecycle-rules.d.ts +0 -12
- package/dist/lifecycle-rules.js +0 -73
- package/dist/lifecycle.d.ts +0 -7
- package/dist/lifecycle.js +0 -24
- package/dist/list-objects.d.ts +0 -3
- package/dist/list-objects.js +0 -70
- package/dist/make-lambda-payload.d.ts +0 -59
- package/dist/make-lambda-payload.js +0 -150
- package/dist/make-s3-url.d.ts +0 -6
- package/dist/make-s3-url.js +0 -7
- package/dist/p-limit.d.ts +0 -1
- package/dist/p-limit.js +0 -57
- package/dist/pages-router-webhook.d.ts +0 -5
- package/dist/pages-router-webhook.js +0 -48
- package/dist/parse-function-name.d.ts +0 -8
- package/dist/parse-function-name.js +0 -17
- package/dist/presign-url.d.ts +0 -17
- package/dist/presign-url.js +0 -66
- package/dist/price-per-1s.d.ts +0 -37
- package/dist/price-per-1s.js +0 -822
- package/dist/random-hash.d.ts +0 -1
- package/dist/random-hash.js +0 -13
- package/dist/read-file.d.ts +0 -11
- package/dist/read-file.js +0 -19
- package/dist/regions.d.ts +0 -3
- package/dist/regions.js +0 -48
- package/dist/render-media-on-lambda.d.ts +0 -66
- package/dist/render-media-on-lambda.js +0 -133
- package/dist/render-still-on-lambda.d.ts +0 -61
- package/dist/render-still-on-lambda.js +0 -121
- package/dist/runtime-preference.d.ts +0 -2
- package/dist/runtime-preference.js +0 -8
- package/dist/speculate-function-name.d.ts +0 -7
- package/dist/speculate-function-name.js +0 -39
- package/dist/types.d.ts +0 -4
- package/dist/types.js +0 -2
- package/dist/validate-aws-region.d.ts +0 -2
- package/dist/validate-aws-region.js +0 -9
- package/dist/validate-bucketname.d.ts +0 -4
- package/dist/validate-bucketname.js +0 -15
- package/dist/validate-disk-size-in-mb.d.ts +0 -1
- package/dist/validate-disk-size-in-mb.js +0 -23
- package/dist/validate-lambda-codec.d.ts +0 -2
- package/dist/validate-lambda-codec.js +0 -21
- package/dist/validate-memory-size.d.ts +0 -1
- package/dist/validate-memory-size.js +0 -22
- package/dist/validate-presign-expiration.d.ts +0 -1
- package/dist/validate-presign-expiration.js +0 -29
- package/dist/validate-serveurl.d.ts +0 -1
- package/dist/validate-serveurl.js +0 -9
- package/dist/validate-webhook-signature.d.ts +0 -5
- package/dist/validate-webhook-signature.js +0 -28
- package/dist/write-file.d.ts +0 -5
- package/dist/write-file.js +0 -83
package/dist/cjs/index.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ export declare const LambdaClientInternals: {
|
|
|
71
71
|
parseBucketName: (name: string) => {
|
|
72
72
|
region: import("./regions").AwsRegion | null;
|
|
73
73
|
};
|
|
74
|
-
makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, concurrency, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, mediaCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, forcePathStyle, metadata, apiKey, offthreadVideoThreads, storageClass, requestHandler, }: import("./make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("@remotion/serverless-client").ServerlessStartPayload<import("./aws-provider").AwsProvider>>;
|
|
74
|
+
makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, concurrency, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, mediaCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, forcePathStyle, metadata, apiKey, licenseKey, offthreadVideoThreads, storageClass, requestHandler, }: import("./make-lambda-payload").InnerRenderMediaOnLambdaInput) => Promise<import("@remotion/serverless-client").ServerlessStartPayload<import("./aws-provider").AwsProvider>>;
|
|
75
75
|
renderMediaOnLambdaOptionalToRequired: (options: import("./render-media-on-lambda").RenderMediaOnLambdaInput) => import("./make-lambda-payload").InnerRenderMediaOnLambdaInput;
|
|
76
76
|
internalDeleteRender: (input: import("./delete-render").DeleteRenderInput & {
|
|
77
77
|
providerSpecifics: import("@remotion/serverless-client").ProviderSpecifics<import("./aws-provider").AwsProvider>;
|
|
@@ -123,7 +123,7 @@ export declare const LambdaClientInternals: {
|
|
|
123
123
|
forcePathStyle: boolean;
|
|
124
124
|
requestHandler: Provider["requestHandler"] | null;
|
|
125
125
|
}) => Promise<void[]>;
|
|
126
|
-
makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, storageClass, requestHandler, offthreadVideoThreads, mediaCacheSizeInBytes, }: import("./render-still-on-lambda").RenderStillOnLambdaNonNullInput) => Promise<import("@remotion/serverless-client").ServerlessPayloads<import("./aws-provider").AwsProvider>[import("@remotion/serverless-client").ServerlessRoutines.still]>;
|
|
126
|
+
makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, licenseKey, storageClass, requestHandler, offthreadVideoThreads, mediaCacheSizeInBytes, }: import("./render-still-on-lambda").RenderStillOnLambdaNonNullInput) => Promise<import("@remotion/serverless-client").ServerlessPayloads<import("./aws-provider").AwsProvider>[import("@remotion/serverless-client").ServerlessRoutines.still]>;
|
|
127
127
|
getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, forcePathStyle, }: import("./get-render-progress").GetRenderProgressInput) => import("@remotion/serverless-client").ServerlessStatusPayload<import("./aws-provider").AwsProvider>;
|
|
128
128
|
innerSpeculateFunctionName: ({ diskSizeInMb, memorySizeInMb, timeoutInSeconds, }: import("./speculate-function-name").SpeculateFunctionNameInput) => string;
|
|
129
129
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -66556,7 +66556,7 @@ var validateDownloadBehavior = (downloadBehavior) => {
|
|
|
66556
66556
|
}
|
|
66557
66557
|
}
|
|
66558
66558
|
};
|
|
66559
|
-
var VERSION = "4.0.
|
|
66559
|
+
var VERSION = "4.0.400";
|
|
66560
66560
|
var isColorSupported = () => {
|
|
66561
66561
|
const env = process.env || {};
|
|
66562
66562
|
const isForceDisabled = "NO_COLOR" in env;
|
|
@@ -71018,6 +71018,7 @@ var makeLambdaRenderMediaPayload = async ({
|
|
|
71018
71018
|
forcePathStyle,
|
|
71019
71019
|
metadata,
|
|
71020
71020
|
apiKey,
|
|
71021
|
+
licenseKey,
|
|
71021
71022
|
offthreadVideoThreads,
|
|
71022
71023
|
storageClass,
|
|
71023
71024
|
requestHandler
|
|
@@ -71092,6 +71093,7 @@ var makeLambdaRenderMediaPayload = async ({
|
|
|
71092
71093
|
forcePathStyle: forcePathStyle ?? false,
|
|
71093
71094
|
metadata: metadata ?? null,
|
|
71094
71095
|
apiKey: apiKey ?? null,
|
|
71096
|
+
licenseKey: licenseKey ?? null,
|
|
71095
71097
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
71096
71098
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
|
|
71097
71099
|
storageClass: storageClass ?? null
|
|
@@ -71138,6 +71140,7 @@ var makeLambdaRenderStillPayload = async ({
|
|
|
71138
71140
|
deleteAfter,
|
|
71139
71141
|
forcePathStyle,
|
|
71140
71142
|
apiKey,
|
|
71143
|
+
licenseKey,
|
|
71141
71144
|
storageClass,
|
|
71142
71145
|
requestHandler,
|
|
71143
71146
|
offthreadVideoThreads,
|
|
@@ -71189,6 +71192,7 @@ var makeLambdaRenderStillPayload = async ({
|
|
|
71189
71192
|
streamed: true,
|
|
71190
71193
|
forcePathStyle,
|
|
71191
71194
|
apiKey: apiKey ?? null,
|
|
71195
|
+
licenseKey: licenseKey ?? null,
|
|
71192
71196
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
71193
71197
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
|
|
71194
71198
|
storageClass: storageClass ?? null
|
|
@@ -71296,6 +71300,7 @@ var renderMediaOnLambdaOptionalToRequired = (options) => {
|
|
|
71296
71300
|
indent: false,
|
|
71297
71301
|
metadata: options.metadata ?? null,
|
|
71298
71302
|
apiKey: options.apiKey ?? null,
|
|
71303
|
+
licenseKey: options.licenseKey ?? null,
|
|
71299
71304
|
storageClass: options.storageClass ?? null,
|
|
71300
71305
|
requestHandler: options.requestHandler ?? null,
|
|
71301
71306
|
mediaCacheSizeInBytes: options.mediaCacheSizeInBytes ?? null
|
|
@@ -71408,6 +71413,7 @@ var renderStillOnLambda = (input) => {
|
|
|
71408
71413
|
timeoutInMilliseconds: input.timeoutInMilliseconds ?? 30000,
|
|
71409
71414
|
forcePathStyle: input.forcePathStyle ?? false,
|
|
71410
71415
|
apiKey: input.apiKey ?? null,
|
|
71416
|
+
licenseKey: input.licenseKey ?? null,
|
|
71411
71417
|
offthreadVideoThreads: input.offthreadVideoThreads ?? null,
|
|
71412
71418
|
storageClass: input.storageClass ?? null,
|
|
71413
71419
|
requestHandler: input.requestHandler ?? null,
|
|
@@ -54,6 +54,6 @@ export type InnerRenderMediaOnLambdaInput = {
|
|
|
54
54
|
storageClass: StorageClass | null;
|
|
55
55
|
requestHandler: RequestHandler | null;
|
|
56
56
|
} & ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>;
|
|
57
|
-
export declare const makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, concurrency, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, mediaCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, forcePathStyle, metadata, apiKey, offthreadVideoThreads, storageClass, requestHandler, }: InnerRenderMediaOnLambdaInput) => Promise<ServerlessStartPayload<AwsProvider>>;
|
|
57
|
+
export declare const makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, concurrency, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, mediaCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, forcePathStyle, metadata, apiKey, licenseKey, offthreadVideoThreads, storageClass, requestHandler, }: InnerRenderMediaOnLambdaInput) => Promise<ServerlessStartPayload<AwsProvider>>;
|
|
58
58
|
export declare const getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, forcePathStyle, }: GetRenderProgressInput) => ServerlessStatusPayload<AwsProvider>;
|
|
59
|
-
export declare const makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, storageClass, requestHandler, offthreadVideoThreads, mediaCacheSizeInBytes, }: RenderStillOnLambdaNonNullInput) => Promise<ServerlessPayloads<AwsProvider>[ServerlessRoutines.still]>;
|
|
59
|
+
export declare const makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, apiKey, licenseKey, storageClass, requestHandler, offthreadVideoThreads, mediaCacheSizeInBytes, }: RenderStillOnLambdaNonNullInput) => Promise<ServerlessPayloads<AwsProvider>[ServerlessRoutines.still]>;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -65899,7 +65899,7 @@ var validateDownloadBehavior = (downloadBehavior) => {
|
|
|
65899
65899
|
}
|
|
65900
65900
|
}
|
|
65901
65901
|
};
|
|
65902
|
-
var VERSION = "4.0.
|
|
65902
|
+
var VERSION = "4.0.400";
|
|
65903
65903
|
var isColorSupported = () => {
|
|
65904
65904
|
const env = process.env || {};
|
|
65905
65905
|
const isForceDisabled = "NO_COLOR" in env;
|
|
@@ -70845,6 +70845,7 @@ var makeLambdaRenderMediaPayload = async ({
|
|
|
70845
70845
|
forcePathStyle,
|
|
70846
70846
|
metadata,
|
|
70847
70847
|
apiKey,
|
|
70848
|
+
licenseKey,
|
|
70848
70849
|
offthreadVideoThreads,
|
|
70849
70850
|
storageClass,
|
|
70850
70851
|
requestHandler
|
|
@@ -70919,6 +70920,7 @@ var makeLambdaRenderMediaPayload = async ({
|
|
|
70919
70920
|
forcePathStyle: forcePathStyle ?? false,
|
|
70920
70921
|
metadata: metadata ?? null,
|
|
70921
70922
|
apiKey: apiKey ?? null,
|
|
70923
|
+
licenseKey: licenseKey ?? null,
|
|
70922
70924
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
70923
70925
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
|
|
70924
70926
|
storageClass: storageClass ?? null
|
|
@@ -70965,6 +70967,7 @@ var makeLambdaRenderStillPayload = async ({
|
|
|
70965
70967
|
deleteAfter,
|
|
70966
70968
|
forcePathStyle,
|
|
70967
70969
|
apiKey,
|
|
70970
|
+
licenseKey,
|
|
70968
70971
|
storageClass,
|
|
70969
70972
|
requestHandler,
|
|
70970
70973
|
offthreadVideoThreads,
|
|
@@ -71016,6 +71019,7 @@ var makeLambdaRenderStillPayload = async ({
|
|
|
71016
71019
|
streamed: true,
|
|
71017
71020
|
forcePathStyle,
|
|
71018
71021
|
apiKey: apiKey ?? null,
|
|
71022
|
+
licenseKey: licenseKey ?? null,
|
|
71019
71023
|
offthreadVideoThreads: offthreadVideoThreads ?? null,
|
|
71020
71024
|
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
|
|
71021
71025
|
storageClass: storageClass ?? null
|
|
@@ -71123,6 +71127,7 @@ var renderMediaOnLambdaOptionalToRequired = (options) => {
|
|
|
71123
71127
|
indent: false,
|
|
71124
71128
|
metadata: options.metadata ?? null,
|
|
71125
71129
|
apiKey: options.apiKey ?? null,
|
|
71130
|
+
licenseKey: options.licenseKey ?? null,
|
|
71126
71131
|
storageClass: options.storageClass ?? null,
|
|
71127
71132
|
requestHandler: options.requestHandler ?? null,
|
|
71128
71133
|
mediaCacheSizeInBytes: options.mediaCacheSizeInBytes ?? null
|
|
@@ -71235,6 +71240,7 @@ var renderStillOnLambda = (input) => {
|
|
|
71235
71240
|
timeoutInMilliseconds: input.timeoutInMilliseconds ?? 30000,
|
|
71236
71241
|
forcePathStyle: input.forcePathStyle ?? false,
|
|
71237
71242
|
apiKey: input.apiKey ?? null,
|
|
71243
|
+
licenseKey: input.licenseKey ?? null,
|
|
71238
71244
|
offthreadVideoThreads: input.offthreadVideoThreads ?? null,
|
|
71239
71245
|
storageClass: input.storageClass ?? null,
|
|
71240
71246
|
requestHandler: input.requestHandler ?? null,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda-client"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/lambda-client",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.400",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"scripts": {
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"@aws-sdk/lib-storage": "3.936.0",
|
|
27
27
|
"mime-types": "2.1.34",
|
|
28
28
|
"@aws-sdk/credential-provider-ini": "3.936.0",
|
|
29
|
-
"@remotion/serverless-client": "4.0.
|
|
29
|
+
"@remotion/serverless-client": "4.0.400",
|
|
30
30
|
"@types/express": "^5.0.0",
|
|
31
31
|
"express": "4.21.0",
|
|
32
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
32
|
+
"@remotion/eslint-config-internal": "4.0.400",
|
|
33
33
|
"eslint": "9.19.0",
|
|
34
34
|
"next": "16.0.10",
|
|
35
35
|
"@types/mime-types": "2.1.1"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { WebhookErrorPayload, WebhookSuccessPayload, WebhookTimeoutPayload } from '@remotion/serverless-client';
|
|
2
|
-
export type NextWebhookArgs = {
|
|
3
|
-
testing?: boolean;
|
|
4
|
-
extraHeaders?: Record<string, string>;
|
|
5
|
-
secret: string;
|
|
6
|
-
onSuccess?: (payload: WebhookSuccessPayload) => void;
|
|
7
|
-
onTimeout?: (payload: WebhookTimeoutPayload) => void;
|
|
8
|
-
onError?: (payload: WebhookErrorPayload) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const appRouterWebhook: (options: NextWebhookArgs) => ((req: Request) => Promise<Response>);
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appRouterWebhook = void 0;
|
|
4
|
-
const validate_webhook_signature_1 = require("./validate-webhook-signature");
|
|
5
|
-
const appRouterWebhook = (options) => {
|
|
6
|
-
const { testing, extraHeaders, secret, onSuccess, onTimeout, onError } = options;
|
|
7
|
-
return async function (req) {
|
|
8
|
-
let headers = extraHeaders || {};
|
|
9
|
-
if (testing) {
|
|
10
|
-
const testingheaders = {
|
|
11
|
-
'Access-Control-Allow-Origin': 'https://www.remotion.dev',
|
|
12
|
-
'Access-Control-Allow-Headers': 'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version, X-Remotion-Status, X-Remotion-Signature, X-Remotion-Mode',
|
|
13
|
-
'Access-Control-Allow-Methods': 'OPTIONS,POST',
|
|
14
|
-
};
|
|
15
|
-
headers = { ...headers, ...testingheaders };
|
|
16
|
-
}
|
|
17
|
-
if (req.method === 'OPTIONS') {
|
|
18
|
-
// do we have any use of the OPTIONS method other than the tester on webhooks page ? if so we can add a condition here to only return this if testing mode enabled
|
|
19
|
-
return new Response(null, {
|
|
20
|
-
headers,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
// Parse the body properly
|
|
24
|
-
const body = await req.json();
|
|
25
|
-
(0, validate_webhook_signature_1.validateWebhookSignature)({
|
|
26
|
-
secret,
|
|
27
|
-
body,
|
|
28
|
-
signatureHeader: req.headers.get('X-Remotion-Signature'),
|
|
29
|
-
});
|
|
30
|
-
const payload = body;
|
|
31
|
-
if (payload.type === 'success' && onSuccess) {
|
|
32
|
-
onSuccess(payload);
|
|
33
|
-
}
|
|
34
|
-
else if (payload.type === 'timeout' && onTimeout) {
|
|
35
|
-
onTimeout(payload);
|
|
36
|
-
}
|
|
37
|
-
else if (payload.type === 'error' && onError) {
|
|
38
|
-
onError(payload);
|
|
39
|
-
}
|
|
40
|
-
return new Response(JSON.stringify({ success: true }), { headers });
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
exports.appRouterWebhook = appRouterWebhook;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { DeleteBucketLifecycleCommandInput, LifecycleRule, PutBucketLifecycleConfigurationCommandInput } from '@aws-sdk/client-s3';
|
|
2
|
-
export declare const deleteLifeCycleInput: ({ bucketName, }: {
|
|
3
|
-
bucketName: string;
|
|
4
|
-
}) => DeleteBucketLifecycleCommandInput;
|
|
5
|
-
export declare const createLifeCycleInput: ({ bucketName, lcRules, }: {
|
|
6
|
-
bucketName: string;
|
|
7
|
-
lcRules: LifecycleRule[];
|
|
8
|
-
}) => PutBucketLifecycleConfigurationCommandInput;
|
package/dist/apply-lifecycle.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLifeCycleInput = exports.deleteLifeCycleInput = void 0;
|
|
4
|
-
const deleteLifeCycleInput = ({ bucketName, }) => {
|
|
5
|
-
return {
|
|
6
|
-
Bucket: bucketName,
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
exports.deleteLifeCycleInput = deleteLifeCycleInput;
|
|
10
|
-
const createLifeCycleInput = ({ bucketName, lcRules, }) => {
|
|
11
|
-
return {
|
|
12
|
-
Bucket: bucketName,
|
|
13
|
-
LifecycleConfiguration: {
|
|
14
|
-
Rules: lcRules,
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
exports.createLifeCycleInput = createLifeCycleInput;
|
package/dist/aws-clients.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs';
|
|
2
|
-
import type { IAMClient } from '@aws-sdk/client-iam';
|
|
3
|
-
import type { LambdaClient } from '@aws-sdk/client-lambda';
|
|
4
|
-
import type { ServiceQuotasClient } from '@aws-sdk/client-service-quotas';
|
|
5
|
-
import type { STSClient } from '@aws-sdk/client-sts';
|
|
6
|
-
import type { AwsRegion } from './regions';
|
|
7
|
-
import type { RequestHandler } from './types';
|
|
8
|
-
export declare const getCloudWatchLogsClient: (region: AwsRegion, requestHandler: RequestHandler | null) => CloudWatchLogsClient;
|
|
9
|
-
export declare const getLambdaClient: (region: AwsRegion, _timeoutInTest: number | undefined, requestHandler: RequestHandler | null) => LambdaClient;
|
|
10
|
-
export declare const getIamClient: (region: AwsRegion, requestHandler: RequestHandler | null) => IAMClient;
|
|
11
|
-
export declare const getServiceQuotasClient: (region: AwsRegion, requestHandler: RequestHandler | null) => ServiceQuotasClient;
|
|
12
|
-
export declare const getStsClient: (region: AwsRegion, requestHandler: RequestHandler | null) => STSClient;
|
package/dist/aws-clients.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getStsClient = exports.getServiceQuotasClient = exports.getIamClient = exports.getLambdaClient = exports.getCloudWatchLogsClient = void 0;
|
|
4
|
-
const get_service_client_1 = require("./get-service-client");
|
|
5
|
-
const getCloudWatchLogsClient = (region, requestHandler) => {
|
|
6
|
-
return (0, get_service_client_1.getServiceClient)({
|
|
7
|
-
region,
|
|
8
|
-
service: 'cloudwatch',
|
|
9
|
-
customCredentials: null,
|
|
10
|
-
forcePathStyle: false,
|
|
11
|
-
requestHandler,
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
exports.getCloudWatchLogsClient = getCloudWatchLogsClient;
|
|
15
|
-
const getLambdaClient = (region,
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17
|
-
_timeoutInTest, requestHandler) => {
|
|
18
|
-
return (0, get_service_client_1.getServiceClient)({
|
|
19
|
-
region,
|
|
20
|
-
service: 'lambda',
|
|
21
|
-
customCredentials: null,
|
|
22
|
-
forcePathStyle: false,
|
|
23
|
-
requestHandler,
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
exports.getLambdaClient = getLambdaClient;
|
|
27
|
-
const getIamClient = (region, requestHandler) => {
|
|
28
|
-
return (0, get_service_client_1.getServiceClient)({
|
|
29
|
-
region,
|
|
30
|
-
service: 'iam',
|
|
31
|
-
customCredentials: null,
|
|
32
|
-
forcePathStyle: false,
|
|
33
|
-
requestHandler,
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
exports.getIamClient = getIamClient;
|
|
37
|
-
const getServiceQuotasClient = (region, requestHandler) => {
|
|
38
|
-
return (0, get_service_client_1.getServiceClient)({
|
|
39
|
-
region,
|
|
40
|
-
service: 'servicequotas',
|
|
41
|
-
customCredentials: null,
|
|
42
|
-
forcePathStyle: false,
|
|
43
|
-
requestHandler,
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
exports.getServiceQuotasClient = getServiceQuotasClient;
|
|
47
|
-
const getStsClient = (region, requestHandler) => {
|
|
48
|
-
return (0, get_service_client_1.getServiceClient)({
|
|
49
|
-
region,
|
|
50
|
-
service: 'sts',
|
|
51
|
-
customCredentials: null,
|
|
52
|
-
forcePathStyle: false,
|
|
53
|
-
requestHandler,
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
exports.getStsClient = getStsClient;
|
package/dist/aws-provider.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { AwsRegion } from './regions';
|
|
2
|
-
export type AwsProvider = {
|
|
3
|
-
type: 'aws';
|
|
4
|
-
region: AwsRegion;
|
|
5
|
-
receivedArtifactType: {
|
|
6
|
-
s3Key: string;
|
|
7
|
-
s3Url: string;
|
|
8
|
-
};
|
|
9
|
-
creationFunctionOptions: {
|
|
10
|
-
createCloudWatchLogGroup: boolean;
|
|
11
|
-
accountId: string;
|
|
12
|
-
alreadyCreated: boolean;
|
|
13
|
-
retentionInDays: number;
|
|
14
|
-
customRoleArn: string;
|
|
15
|
-
enableLambdaInsights: boolean;
|
|
16
|
-
vpcSubnetIds: string;
|
|
17
|
-
vpcSecurityGroupIds: string;
|
|
18
|
-
runtimePreference: RuntimePreference;
|
|
19
|
-
};
|
|
20
|
-
storageClass: StorageClass;
|
|
21
|
-
requestHandler: RequestHandler | null | undefined;
|
|
22
|
-
};
|
|
23
|
-
import type { StorageClass } from '@aws-sdk/client-s3';
|
|
24
|
-
import type { ProviderSpecifics } from '@remotion/serverless-client';
|
|
25
|
-
import type { RuntimePreference } from './runtime-preference';
|
|
26
|
-
import type { RequestHandler } from './types';
|
|
27
|
-
export declare const awsImplementation: ProviderSpecifics<AwsProvider>;
|
package/dist/aws-provider.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.awsImplementation = void 0;
|
|
5
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
6
|
-
const node_events_1 = require("node:events");
|
|
7
|
-
const bucket_exists_1 = require("./bucket-exists");
|
|
8
|
-
const call_lambda_async_1 = require("./call-lambda-async");
|
|
9
|
-
const call_lambda_streaming_1 = require("./call-lambda-streaming");
|
|
10
|
-
const call_lambda_sync_1 = require("./call-lambda-sync");
|
|
11
|
-
const check_credentials_1 = require("./check-credentials");
|
|
12
|
-
const constants_1 = require("./constants");
|
|
13
|
-
const convert_to_serve_url_1 = require("./convert-to-serve-url");
|
|
14
|
-
const create_bucket_1 = require("./create-bucket");
|
|
15
|
-
const delete_file_1 = require("./delete-file");
|
|
16
|
-
const delete_function_1 = require("./delete-function");
|
|
17
|
-
const estimate_price_1 = require("./estimate-price");
|
|
18
|
-
const get_account_id_1 = require("./get-account-id");
|
|
19
|
-
const get_aws_urls_1 = require("./get-aws-urls");
|
|
20
|
-
const get_buckets_1 = require("./get-buckets");
|
|
21
|
-
const get_functions_1 = require("./get-functions");
|
|
22
|
-
const get_output_url_from_metadata_1 = require("./get-output-url-from-metadata");
|
|
23
|
-
const head_file_1 = require("./head-file");
|
|
24
|
-
const is_flaky_error_1 = require("./is-flaky-error");
|
|
25
|
-
const lifecycle_rules_1 = require("./lifecycle-rules");
|
|
26
|
-
const list_objects_1 = require("./list-objects");
|
|
27
|
-
const parse_function_name_1 = require("./parse-function-name");
|
|
28
|
-
const random_hash_1 = require("./random-hash");
|
|
29
|
-
const read_file_1 = require("./read-file");
|
|
30
|
-
const write_file_1 = require("./write-file");
|
|
31
|
-
if (/^AWS_Lambda_nodejs(?:18|20)[.]x$/.test((_a = process.env.AWS_EXECUTION_ENV) !== null && _a !== void 0 ? _a : '') === true) {
|
|
32
|
-
process.env.FONTCONFIG_PATH = '/opt';
|
|
33
|
-
process.env.FONTCONFIG_FILE = '/opt/fonts.conf';
|
|
34
|
-
process.env.DISABLE_FROM_SURFACE = '1';
|
|
35
|
-
process.env.NO_COLOR = '1';
|
|
36
|
-
// @ts-expect-error
|
|
37
|
-
globalThis._dumpUnreleasedBuffers = new node_events_1.EventEmitter();
|
|
38
|
-
// @ts-expect-error
|
|
39
|
-
globalThis._dumpUnreleasedBuffers.setMaxListeners(201);
|
|
40
|
-
}
|
|
41
|
-
const validateDeleteAfter = (lifeCycleValue) => {
|
|
42
|
-
if (lifeCycleValue === null) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (lifeCycleValue === undefined) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (typeof lifeCycleValue !== 'string') {
|
|
49
|
-
throw new TypeError(`Expected life cycle value to be a string, got ${JSON.stringify(lifeCycleValue)}`);
|
|
50
|
-
}
|
|
51
|
-
if (!(lifeCycleValue in serverless_client_1.expiryDays)) {
|
|
52
|
-
throw new TypeError(`Expected deleteAfter value to be one of ${Object.keys(serverless_client_1.expiryDays).join(', ')}, got ${lifeCycleValue}`);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
exports.awsImplementation = {
|
|
56
|
-
getChromiumPath() {
|
|
57
|
-
return '/opt/bin/chromium';
|
|
58
|
-
},
|
|
59
|
-
getBuckets: get_buckets_1.getRemotionBuckets,
|
|
60
|
-
createBucket: create_bucket_1.createBucket,
|
|
61
|
-
applyLifeCycle: lifecycle_rules_1.applyLifeCyleOperation,
|
|
62
|
-
listObjects: list_objects_1.lambdaLsImplementation,
|
|
63
|
-
deleteFile: delete_file_1.lambdaDeleteFileImplementation,
|
|
64
|
-
bucketExists: bucket_exists_1.bucketExistsInRegionImplementation,
|
|
65
|
-
randomHash: random_hash_1.randomHashImplementation,
|
|
66
|
-
readFile: read_file_1.lambdaReadFileImplementation,
|
|
67
|
-
writeFile: write_file_1.lambdaWriteFileImplementation,
|
|
68
|
-
headFile: head_file_1.lambdaHeadFileImplementation,
|
|
69
|
-
convertToServeUrl: convert_to_serve_url_1.convertToServeUrlImplementation,
|
|
70
|
-
printLoggingHelper: true,
|
|
71
|
-
validateDeleteAfter,
|
|
72
|
-
callFunctionAsync: call_lambda_async_1.callFunctionAsyncImplementation,
|
|
73
|
-
callFunctionStreaming: call_lambda_streaming_1.callFunctionWithStreamingImplementation,
|
|
74
|
-
callFunctionSync: call_lambda_sync_1.callFunctionSyncImplementation,
|
|
75
|
-
getEphemeralStorageForPriceCalculation() {
|
|
76
|
-
// We cannot determine the ephemeral storage size, so we
|
|
77
|
-
// overestimate the price, but will only have a miniscule effect (~0.2%)
|
|
78
|
-
return constants_1.MAX_EPHEMERAL_STORAGE_IN_MB;
|
|
79
|
-
},
|
|
80
|
-
estimatePrice: estimate_price_1.estimatePrice,
|
|
81
|
-
getLoggingUrlForMethod: get_aws_urls_1.getCloudwatchMethodUrl,
|
|
82
|
-
getLoggingUrlForRendererFunction: get_aws_urls_1.getCloudwatchRendererUrl,
|
|
83
|
-
isFlakyError: is_flaky_error_1.isFlakyError,
|
|
84
|
-
getOutputUrl: get_output_url_from_metadata_1.getOutputUrlFromMetadata,
|
|
85
|
-
serverStorageProductName: () => 'S3',
|
|
86
|
-
getMaxStillInlinePayloadSize: () => 5000000,
|
|
87
|
-
getMaxNonInlinePayloadSizePerFunction: () => 200000,
|
|
88
|
-
getAccountId: get_account_id_1.getAccountIdImplementation,
|
|
89
|
-
deleteFunction: delete_function_1.deleteFunction,
|
|
90
|
-
getFunctions: get_functions_1.getFunctions,
|
|
91
|
-
parseFunctionName: parse_function_name_1.parseFunctionName,
|
|
92
|
-
checkCredentials: check_credentials_1.checkCredentials,
|
|
93
|
-
getBucketPrefix: () => constants_1.REMOTION_BUCKET_PREFIX,
|
|
94
|
-
};
|
package/dist/bucket-exists.d.ts
DELETED
package/dist/bucket-exists.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bucketExistsInRegionImplementation = void 0;
|
|
4
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
-
const get_s3_client_1 = require("./get-s3-client");
|
|
6
|
-
const bucketExistsInRegionImplementation = async ({ bucketName, region, expectedBucketOwner, forcePathStyle, requestHandler, }) => {
|
|
7
|
-
var _a;
|
|
8
|
-
try {
|
|
9
|
-
const bucket = await (0, get_s3_client_1.getS3Client)({
|
|
10
|
-
region,
|
|
11
|
-
customCredentials: null,
|
|
12
|
-
forcePathStyle,
|
|
13
|
-
requestHandler,
|
|
14
|
-
}).send(new client_s3_1.GetBucketLocationCommand({
|
|
15
|
-
Bucket: bucketName,
|
|
16
|
-
ExpectedBucketOwner: expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined,
|
|
17
|
-
}));
|
|
18
|
-
return ((_a = bucket.LocationConstraint) !== null && _a !== void 0 ? _a : 'us-east-1') === region;
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
if (err.Code === 'NoSuchBucket') {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
throw err;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
exports.bucketExistsInRegionImplementation = bucketExistsInRegionImplementation;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { CallFunctionOptions, CloudProvider, ServerlessRoutines } from '@remotion/serverless-client';
|
|
2
|
-
export declare const callFunctionAsyncImplementation: <T extends ServerlessRoutines, Provider extends CloudProvider>({ functionName, payload, region, timeoutInTest, }: CallFunctionOptions<T, Provider>) => Promise<void>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.callFunctionAsyncImplementation = void 0;
|
|
4
|
-
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
-
const aws_clients_1 = require("./aws-clients");
|
|
6
|
-
const callFunctionAsyncImplementation = async ({ functionName, payload, region, timeoutInTest, }) => {
|
|
7
|
-
const stringifiedPayload = JSON.stringify(payload);
|
|
8
|
-
if (stringifiedPayload.length > 256 * 1024) {
|
|
9
|
-
throw new Error(`Payload is too big: ${stringifiedPayload.length} bytes. Maximum size is 256 KB. This should not happen, please report this to the Remotion team. Payload: ${stringifiedPayload}`);
|
|
10
|
-
}
|
|
11
|
-
const result = await (0, aws_clients_1.getLambdaClient)(region, timeoutInTest, null).send(new client_lambda_1.InvokeCommand({
|
|
12
|
-
FunctionName: functionName,
|
|
13
|
-
Payload: stringifiedPayload,
|
|
14
|
-
InvocationType: 'Event',
|
|
15
|
-
}));
|
|
16
|
-
if (result.FunctionError) {
|
|
17
|
-
throw new Error(`Lambda function returned error: ${result.FunctionError} ${result.LogResult}`);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
exports.callFunctionAsyncImplementation = callFunctionAsyncImplementation;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CallFunctionOptions, CloudProvider, OnMessage, ServerlessRoutines } from '@remotion/serverless-client';
|
|
2
|
-
export declare const parseJsonOrThrowSource: (data: Uint8Array, type: string) => any;
|
|
3
|
-
export declare const callFunctionWithStreamingImplementation: <Provider extends CloudProvider, T extends ServerlessRoutines>(options: CallFunctionOptions<T, Provider> & {
|
|
4
|
-
receivedStreamingPayload: OnMessage<Provider>;
|
|
5
|
-
retriesRemaining: number;
|
|
6
|
-
}) => Promise<void>;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.callFunctionWithStreamingImplementation = exports.parseJsonOrThrowSource = void 0;
|
|
4
|
-
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
6
|
-
const aws_clients_1 = require("./aws-clients");
|
|
7
|
-
const STREAM_STALL_TIMEOUT = 30000;
|
|
8
|
-
const LAMBDA_STREAM_STALL = `AWS did not invoke Lambda in ${STREAM_STALL_TIMEOUT}ms`;
|
|
9
|
-
const parseJsonOrThrowSource = (data, type) => {
|
|
10
|
-
const asString = new TextDecoder('utf-8').decode(data);
|
|
11
|
-
try {
|
|
12
|
-
return JSON.parse(asString);
|
|
13
|
-
}
|
|
14
|
-
catch (_a) {
|
|
15
|
-
throw new Error(`Invalid JSON (${type}): ${asString}`);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
exports.parseJsonOrThrowSource = parseJsonOrThrowSource;
|
|
19
|
-
const invokeStreamOrTimeout = async ({ region, timeoutInTest, functionName, type, payload, }) => {
|
|
20
|
-
const resProm = (0, aws_clients_1.getLambdaClient)(region, timeoutInTest, null).send(new client_lambda_1.InvokeWithResponseStreamCommand({
|
|
21
|
-
FunctionName: functionName,
|
|
22
|
-
Payload: JSON.stringify({ type, ...payload }),
|
|
23
|
-
}));
|
|
24
|
-
let cleanup = () => undefined;
|
|
25
|
-
const timeout = new Promise((_resolve, reject) => {
|
|
26
|
-
const int = setTimeout(() => {
|
|
27
|
-
reject(new Error(LAMBDA_STREAM_STALL));
|
|
28
|
-
}, STREAM_STALL_TIMEOUT);
|
|
29
|
-
cleanup = () => {
|
|
30
|
-
clearTimeout(int);
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
const res = await Promise.race([resProm, timeout]);
|
|
34
|
-
cleanup();
|
|
35
|
-
return res;
|
|
36
|
-
};
|
|
37
|
-
const INVALID_JSON_MESSAGE = 'Cannot parse Lambda response as JSON';
|
|
38
|
-
const callLambdaWithStreamingWithoutRetry = async ({ functionName, type, payload, region, timeoutInTest, receivedStreamingPayload, }) => {
|
|
39
|
-
const res = await invokeStreamOrTimeout({
|
|
40
|
-
functionName,
|
|
41
|
-
payload,
|
|
42
|
-
region,
|
|
43
|
-
timeoutInTest,
|
|
44
|
-
type,
|
|
45
|
-
});
|
|
46
|
-
const { onData, clear } = (0, serverless_client_1.makeStreamer)((status, messageTypeId, data) => {
|
|
47
|
-
const messageType = (0, serverless_client_1.messageTypeIdToMessageType)(messageTypeId);
|
|
48
|
-
const innerPayload = serverless_client_1.formatMap[messageType] === 'json'
|
|
49
|
-
? (0, exports.parseJsonOrThrowSource)(data, messageType)
|
|
50
|
-
: data;
|
|
51
|
-
const message = {
|
|
52
|
-
successType: status,
|
|
53
|
-
message: {
|
|
54
|
-
type: messageType,
|
|
55
|
-
payload: innerPayload,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
receivedStreamingPayload(message);
|
|
59
|
-
});
|
|
60
|
-
const dumpBuffers = () => {
|
|
61
|
-
clear();
|
|
62
|
-
};
|
|
63
|
-
// @ts-expect-error - We are adding a listener to a global variable
|
|
64
|
-
if (globalThis._dumpUnreleasedBuffers) {
|
|
65
|
-
// @ts-expect-error - We are adding a listener to a global variable
|
|
66
|
-
globalThis._dumpUnreleasedBuffers.addListener('dump-unreleased-buffers', dumpBuffers);
|
|
67
|
-
}
|
|
68
|
-
const events = res.EventStream;
|
|
69
|
-
for await (const event of events) {
|
|
70
|
-
// There are two types of events you can get on a stream.
|
|
71
|
-
// `PayloadChunk`: These contain the actual raw bytes of the chunk
|
|
72
|
-
// It has a single property: `Payload`
|
|
73
|
-
if (event.PayloadChunk && event.PayloadChunk.Payload) {
|
|
74
|
-
onData(event.PayloadChunk.Payload);
|
|
75
|
-
}
|
|
76
|
-
if (event.InvokeComplete) {
|
|
77
|
-
if (event.InvokeComplete.ErrorCode) {
|
|
78
|
-
const logs = `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-3600~timeType~'RELATIVE~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40requestId*2c*20*40message*0a*7c*20filter*20*40requestId*20like*20*${res.$metadata.requestId}*22*0a*7c*20sort*20*40timestamp*20asc~source~(~'*2faws*2flambda*2f${functionName}))`;
|
|
79
|
-
if (event.InvokeComplete.ErrorCode === 'Unhandled') {
|
|
80
|
-
throw new Error(`Lambda function ${functionName} failed with an unhandled error: ${event.InvokeComplete.ErrorDetails} See ${logs} to see the logs of this invocation.`);
|
|
81
|
-
}
|
|
82
|
-
throw new Error(`Lambda function ${functionName} failed with error code ${event.InvokeComplete.ErrorCode}: ${event.InvokeComplete.ErrorDetails}. See ${logs} to see the logs of this invocation.`);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
// Don't put a `break` statement here, as it will cause the socket to not properly exit.
|
|
86
|
-
}
|
|
87
|
-
// @ts-expect-error - We are adding a listener to a global variable
|
|
88
|
-
if (globalThis._dumpUnreleasedBuffers) {
|
|
89
|
-
// @ts-expect-error - We are adding a listener to a global variable
|
|
90
|
-
globalThis._dumpUnreleasedBuffers.removeListener('dump-unreleased-buffers', dumpBuffers);
|
|
91
|
-
}
|
|
92
|
-
clear();
|
|
93
|
-
};
|
|
94
|
-
const callFunctionWithStreamingImplementation = async (options) => {
|
|
95
|
-
// As of August 2023, Lambda streaming sometimes misses parts of the JSON response.
|
|
96
|
-
// Handling this for now by applying a retry mechanism.
|
|
97
|
-
var _a, _b;
|
|
98
|
-
try {
|
|
99
|
-
// Do not remove this await
|
|
100
|
-
await callLambdaWithStreamingWithoutRetry(options);
|
|
101
|
-
}
|
|
102
|
-
catch (err) {
|
|
103
|
-
if (((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('TooManyRequestsException')) ||
|
|
104
|
-
((_b = err.message) === null || _b === void 0 ? void 0 : _b.includes('ConcurrentInvocationLimitExceeded'))) {
|
|
105
|
-
throw new Error(`AWS Concurrency limit reached (Original Error: ${err.message}). See https://www.remotion.dev/docs/lambda/troubleshooting/rate-limit for tips to fix this.`);
|
|
106
|
-
}
|
|
107
|
-
if (!err.message.includes(INVALID_JSON_MESSAGE) &&
|
|
108
|
-
!err.message.includes(LAMBDA_STREAM_STALL) &&
|
|
109
|
-
// https://discord.com/channels/809501355504959528/1332166561242288220/1332166561242288220
|
|
110
|
-
!err.message.includes('Runtime.TruncatedResponse') &&
|
|
111
|
-
!err.message.includes('aborted')) {
|
|
112
|
-
throw err;
|
|
113
|
-
}
|
|
114
|
-
console.error('Retries remaining:', options.retriesRemaining);
|
|
115
|
-
if (options.retriesRemaining === 0) {
|
|
116
|
-
console.error('Throwing error:');
|
|
117
|
-
throw err;
|
|
118
|
-
}
|
|
119
|
-
console.error(err);
|
|
120
|
-
return (0, exports.callFunctionWithStreamingImplementation)({
|
|
121
|
-
...options,
|
|
122
|
-
retriesRemaining: options.retriesRemaining - 1,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
exports.callFunctionWithStreamingImplementation = callFunctionWithStreamingImplementation;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { CallFunctionOptions, CloudProvider, ServerlessReturnValues, ServerlessRoutines } from '@remotion/serverless-client';
|
|
2
|
-
export declare const callFunctionSyncImplementation: <Provider extends CloudProvider, T extends ServerlessRoutines>(options: CallFunctionOptions<T, Provider>) => Promise<ServerlessReturnValues<Provider>[T]>;
|