@remotion/lambda-client 4.0.387 → 4.0.388
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.js +33 -33
- package/dist/esm/index.mjs +20 -20
- 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
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { AudioCodec, BrowserSafeApis, ChromiumOptions, ColorSpace, DeleteAfter, DownloadBehavior, FrameRange, LogLevel, OutNameInput, PixelFormat, Privacy, ProResProfile, ServerlessCodec, ServerlessPayloads, ServerlessStartPayload, ServerlessStatusPayload, ToOptions, VideoImageFormat, WebhookOption, X264Preset } from '@remotion/serverless-client';
|
|
2
|
-
import { ServerlessRoutines } from '@remotion/serverless-client';
|
|
3
|
-
import type { AwsProvider } from './aws-provider';
|
|
4
|
-
import type { StorageClass } from '@aws-sdk/client-s3';
|
|
5
|
-
import type { GetRenderProgressInput } from './get-render-progress';
|
|
6
|
-
import type { AwsRegion } from './regions';
|
|
7
|
-
import type { RenderStillOnLambdaNonNullInput } from './render-still-on-lambda';
|
|
8
|
-
import type { RequestHandler } from './types';
|
|
9
|
-
export type InnerRenderMediaOnLambdaInput = {
|
|
10
|
-
region: AwsRegion;
|
|
11
|
-
functionName: string;
|
|
12
|
-
serveUrl: string;
|
|
13
|
-
composition: string;
|
|
14
|
-
inputProps: Record<string, unknown>;
|
|
15
|
-
codec: ServerlessCodec;
|
|
16
|
-
imageFormat: VideoImageFormat;
|
|
17
|
-
crf: number | undefined;
|
|
18
|
-
envVariables: Record<string, string>;
|
|
19
|
-
pixelFormat: PixelFormat | undefined;
|
|
20
|
-
proResProfile: ProResProfile | undefined;
|
|
21
|
-
x264Preset: X264Preset | null;
|
|
22
|
-
privacy: Privacy;
|
|
23
|
-
jpegQuality: number;
|
|
24
|
-
maxRetries: number;
|
|
25
|
-
framesPerLambda: number | null;
|
|
26
|
-
concurrency: number | null;
|
|
27
|
-
logLevel: LogLevel;
|
|
28
|
-
frameRange: FrameRange | null;
|
|
29
|
-
outName: OutNameInput<AwsProvider> | null;
|
|
30
|
-
timeoutInMilliseconds: number;
|
|
31
|
-
chromiumOptions: ChromiumOptions;
|
|
32
|
-
scale: number;
|
|
33
|
-
everyNthFrame: number;
|
|
34
|
-
numberOfGifLoops: number | null;
|
|
35
|
-
concurrencyPerLambda: number;
|
|
36
|
-
downloadBehavior: DownloadBehavior;
|
|
37
|
-
muted: boolean;
|
|
38
|
-
overwrite: boolean;
|
|
39
|
-
audioBitrate: string | null;
|
|
40
|
-
videoBitrate: string | null;
|
|
41
|
-
encodingMaxRate: string | null;
|
|
42
|
-
encodingBufferSize: string | null;
|
|
43
|
-
webhook: WebhookOption | null;
|
|
44
|
-
forceWidth: number | null;
|
|
45
|
-
forceHeight: number | null;
|
|
46
|
-
rendererFunctionName: string | null;
|
|
47
|
-
forceBucketName: string | null;
|
|
48
|
-
audioCodec: AudioCodec | null;
|
|
49
|
-
colorSpace: ColorSpace | null;
|
|
50
|
-
deleteAfter: DeleteAfter | null;
|
|
51
|
-
indent: boolean;
|
|
52
|
-
forcePathStyle: boolean;
|
|
53
|
-
metadata: Record<string, string> | null;
|
|
54
|
-
storageClass: StorageClass | null;
|
|
55
|
-
requestHandler: RequestHandler | null;
|
|
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>>;
|
|
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]>;
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeLambdaRenderStillPayload = exports.getRenderProgressPayload = exports.makeLambdaRenderMediaPayload = void 0;
|
|
4
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
5
|
-
const aws_provider_1 = require("./aws-provider");
|
|
6
|
-
const serverless_client_2 = require("@remotion/serverless-client");
|
|
7
|
-
const validate_lambda_codec_1 = require("./validate-lambda-codec");
|
|
8
|
-
const validate_serveurl_1 = require("./validate-serveurl");
|
|
9
|
-
const makeLambdaRenderMediaPayload = async ({ 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, }) => {
|
|
10
|
-
const actualCodec = (0, validate_lambda_codec_1.validateLambdaCodec)(codec);
|
|
11
|
-
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
12
|
-
(0, serverless_client_1.validateDownloadBehavior)(downloadBehavior);
|
|
13
|
-
(0, serverless_client_2.validateWebhook)(webhook);
|
|
14
|
-
const stringifiedInputProps = (0, serverless_client_1.serializeOrThrow)(inputProps !== null && inputProps !== void 0 ? inputProps : {}, 'input-props');
|
|
15
|
-
const serialized = await (0, serverless_client_1.compressInputProps)({
|
|
16
|
-
stringifiedInputProps,
|
|
17
|
-
region,
|
|
18
|
-
needsToUpload: (0, serverless_client_1.getNeedsToUpload)({
|
|
19
|
-
type: 'video-or-audio',
|
|
20
|
-
sizes: [
|
|
21
|
-
stringifiedInputProps.length,
|
|
22
|
-
JSON.stringify(envVariables).length,
|
|
23
|
-
],
|
|
24
|
-
providerSpecifics: aws_provider_1.awsImplementation,
|
|
25
|
-
}),
|
|
26
|
-
userSpecifiedBucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
27
|
-
propsType: 'input-props',
|
|
28
|
-
providerSpecifics: aws_provider_1.awsImplementation,
|
|
29
|
-
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
30
|
-
skipPutAcl: privacy === 'no-acl',
|
|
31
|
-
requestHandler: requestHandler !== null && requestHandler !== void 0 ? requestHandler : null,
|
|
32
|
-
});
|
|
33
|
-
return {
|
|
34
|
-
rendererFunctionName,
|
|
35
|
-
framesPerLambda,
|
|
36
|
-
concurrency,
|
|
37
|
-
composition,
|
|
38
|
-
serveUrl,
|
|
39
|
-
inputProps: serialized,
|
|
40
|
-
codec: actualCodec,
|
|
41
|
-
imageFormat,
|
|
42
|
-
crf: crf !== null && crf !== void 0 ? crf : null,
|
|
43
|
-
envVariables,
|
|
44
|
-
pixelFormat: pixelFormat !== null && pixelFormat !== void 0 ? pixelFormat : null,
|
|
45
|
-
proResProfile: proResProfile !== null && proResProfile !== void 0 ? proResProfile : null,
|
|
46
|
-
x264Preset,
|
|
47
|
-
jpegQuality,
|
|
48
|
-
maxRetries,
|
|
49
|
-
privacy,
|
|
50
|
-
logLevel,
|
|
51
|
-
frameRange,
|
|
52
|
-
outName,
|
|
53
|
-
timeoutInMilliseconds,
|
|
54
|
-
chromiumOptions,
|
|
55
|
-
scale,
|
|
56
|
-
everyNthFrame,
|
|
57
|
-
numberOfGifLoops,
|
|
58
|
-
concurrencyPerLambda,
|
|
59
|
-
downloadBehavior,
|
|
60
|
-
muted,
|
|
61
|
-
version: serverless_client_1.VERSION,
|
|
62
|
-
overwrite: overwrite !== null && overwrite !== void 0 ? overwrite : serverless_client_1.ENABLE_V5_BREAKING_CHANGES,
|
|
63
|
-
audioBitrate: audioBitrate !== null && audioBitrate !== void 0 ? audioBitrate : null,
|
|
64
|
-
videoBitrate: videoBitrate !== null && videoBitrate !== void 0 ? videoBitrate : null,
|
|
65
|
-
encodingBufferSize: encodingBufferSize !== null && encodingBufferSize !== void 0 ? encodingBufferSize : null,
|
|
66
|
-
encodingMaxRate: encodingMaxRate !== null && encodingMaxRate !== void 0 ? encodingMaxRate : null,
|
|
67
|
-
webhook: webhook !== null && webhook !== void 0 ? webhook : null,
|
|
68
|
-
forceHeight: forceHeight !== null && forceHeight !== void 0 ? forceHeight : null,
|
|
69
|
-
forceWidth: forceWidth !== null && forceWidth !== void 0 ? forceWidth : null,
|
|
70
|
-
bucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
|
|
71
|
-
audioCodec: audioCodec !== null && audioCodec !== void 0 ? audioCodec : null,
|
|
72
|
-
type: serverless_client_1.ServerlessRoutines.start,
|
|
73
|
-
offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes !== null && offthreadVideoCacheSizeInBytes !== void 0 ? offthreadVideoCacheSizeInBytes : null,
|
|
74
|
-
deleteAfter: deleteAfter !== null && deleteAfter !== void 0 ? deleteAfter : null,
|
|
75
|
-
colorSpace: colorSpace !== null && colorSpace !== void 0 ? colorSpace : null,
|
|
76
|
-
preferLossless: preferLossless !== null && preferLossless !== void 0 ? preferLossless : false,
|
|
77
|
-
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
78
|
-
metadata: metadata !== null && metadata !== void 0 ? metadata : null,
|
|
79
|
-
apiKey: apiKey !== null && apiKey !== void 0 ? apiKey : null,
|
|
80
|
-
offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
|
|
81
|
-
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
82
|
-
storageClass: storageClass !== null && storageClass !== void 0 ? storageClass : null,
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
exports.makeLambdaRenderMediaPayload = makeLambdaRenderMediaPayload;
|
|
86
|
-
const getRenderProgressPayload = ({ bucketName, renderId, s3OutputProvider, logLevel, forcePathStyle, }) => {
|
|
87
|
-
return {
|
|
88
|
-
type: serverless_client_1.ServerlessRoutines.status,
|
|
89
|
-
bucketName,
|
|
90
|
-
renderId,
|
|
91
|
-
version: serverless_client_1.VERSION,
|
|
92
|
-
s3OutputProvider: s3OutputProvider !== null && s3OutputProvider !== void 0 ? s3OutputProvider : null,
|
|
93
|
-
logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
|
|
94
|
-
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
exports.getRenderProgressPayload = getRenderProgressPayload;
|
|
98
|
-
const makeLambdaRenderStillPayload = async ({ 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, }) => {
|
|
99
|
-
const stringifiedInputProps = (0, serverless_client_1.serializeOrThrow)(inputProps, 'input-props');
|
|
100
|
-
const serializedInputProps = await (0, serverless_client_1.compressInputProps)({
|
|
101
|
-
stringifiedInputProps,
|
|
102
|
-
region,
|
|
103
|
-
needsToUpload: (0, serverless_client_1.getNeedsToUpload)({
|
|
104
|
-
type: 'still',
|
|
105
|
-
sizes: [
|
|
106
|
-
stringifiedInputProps.length,
|
|
107
|
-
JSON.stringify(envVariables).length,
|
|
108
|
-
],
|
|
109
|
-
providerSpecifics: aws_provider_1.awsImplementation,
|
|
110
|
-
}),
|
|
111
|
-
userSpecifiedBucketName: forceBucketName !== null && forceBucketName !== void 0 ? forceBucketName : null,
|
|
112
|
-
propsType: 'input-props',
|
|
113
|
-
providerSpecifics: aws_provider_1.awsImplementation,
|
|
114
|
-
forcePathStyle,
|
|
115
|
-
skipPutAcl: privacy === 'no-acl',
|
|
116
|
-
requestHandler,
|
|
117
|
-
});
|
|
118
|
-
return {
|
|
119
|
-
composition,
|
|
120
|
-
serveUrl,
|
|
121
|
-
inputProps: serializedInputProps,
|
|
122
|
-
imageFormat,
|
|
123
|
-
envVariables,
|
|
124
|
-
jpegQuality,
|
|
125
|
-
maxRetries,
|
|
126
|
-
frame,
|
|
127
|
-
privacy,
|
|
128
|
-
attempt: 1,
|
|
129
|
-
logLevel,
|
|
130
|
-
outName,
|
|
131
|
-
timeoutInMilliseconds,
|
|
132
|
-
chromiumOptions,
|
|
133
|
-
scale,
|
|
134
|
-
downloadBehavior,
|
|
135
|
-
version: serverless_client_1.VERSION,
|
|
136
|
-
forceHeight,
|
|
137
|
-
forceWidth,
|
|
138
|
-
bucketName: forceBucketName,
|
|
139
|
-
offthreadVideoCacheSizeInBytes,
|
|
140
|
-
deleteAfter,
|
|
141
|
-
type: serverless_client_1.ServerlessRoutines.still,
|
|
142
|
-
streamed: true,
|
|
143
|
-
forcePathStyle,
|
|
144
|
-
apiKey: apiKey !== null && apiKey !== void 0 ? apiKey : null,
|
|
145
|
-
offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
|
|
146
|
-
mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
|
|
147
|
-
storageClass: storageClass !== null && storageClass !== void 0 ? storageClass : null,
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
exports.makeLambdaRenderStillPayload = makeLambdaRenderStillPayload;
|
package/dist/make-s3-url.d.ts
DELETED
package/dist/make-s3-url.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeS3ServeUrl = void 0;
|
|
4
|
-
const makeS3ServeUrl = ({ bucketName, subFolder, region, }) => {
|
|
5
|
-
return `https://${bucketName}.s3.${region}.amazonaws.com/${subFolder}/index.html`;
|
|
6
|
-
};
|
|
7
|
-
exports.makeS3ServeUrl = makeS3ServeUrl;
|
package/dist/p-limit.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const pLimit: (concurrency: number) => <Arguments extends unknown[], ReturnType>(fn: (..._arguments: Arguments) => PromiseLike<ReturnType> | ReturnType, ...args: Arguments) => Promise<ReturnType>;
|
package/dist/p-limit.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pLimit = void 0;
|
|
4
|
-
const pLimit = (concurrency) => {
|
|
5
|
-
const queue = [];
|
|
6
|
-
let activeCount = 0;
|
|
7
|
-
const next = () => {
|
|
8
|
-
var _a;
|
|
9
|
-
activeCount--;
|
|
10
|
-
if (queue.length > 0) {
|
|
11
|
-
(_a = queue.shift()) === null || _a === void 0 ? void 0 : _a();
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
const run = async (fn, resolve, ...args) => {
|
|
15
|
-
activeCount++;
|
|
16
|
-
// eslint-disable-next-line require-await
|
|
17
|
-
const result = (async () => fn(...args))();
|
|
18
|
-
resolve(result);
|
|
19
|
-
try {
|
|
20
|
-
await result;
|
|
21
|
-
}
|
|
22
|
-
catch (_a) { }
|
|
23
|
-
next();
|
|
24
|
-
};
|
|
25
|
-
const enqueue = (fn, resolve, ...args) => {
|
|
26
|
-
queue.push(() => run(fn, resolve, ...args));
|
|
27
|
-
(async () => {
|
|
28
|
-
var _a;
|
|
29
|
-
// This function needs to wait until the next microtask before comparing
|
|
30
|
-
// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
|
|
31
|
-
// when the run function is dequeued and called. The comparison in the if-statement
|
|
32
|
-
// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
|
|
33
|
-
await Promise.resolve();
|
|
34
|
-
if (activeCount < concurrency && queue.length > 0) {
|
|
35
|
-
(_a = queue.shift()) === null || _a === void 0 ? void 0 : _a();
|
|
36
|
-
}
|
|
37
|
-
})();
|
|
38
|
-
};
|
|
39
|
-
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
40
|
-
enqueue(fn, resolve, ...args);
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperties(generator, {
|
|
43
|
-
activeCount: {
|
|
44
|
-
get: () => activeCount,
|
|
45
|
-
},
|
|
46
|
-
pendingCount: {
|
|
47
|
-
get: () => queue.length,
|
|
48
|
-
},
|
|
49
|
-
clearQueue: {
|
|
50
|
-
value: () => {
|
|
51
|
-
queue.length = 0;
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
return generator;
|
|
56
|
-
};
|
|
57
|
-
exports.pLimit = pLimit;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Response } from 'express';
|
|
2
|
-
import type { NextApiRequest, NextApiResponse } from 'next';
|
|
3
|
-
import type { NextWebhookArgs } from './app-router-webhook';
|
|
4
|
-
export declare const addHeaders: (res: NextApiResponse | Response, headers: Record<string, string>) => void;
|
|
5
|
-
export declare const pagesRouterWebhook: (options: NextWebhookArgs) => (req: NextApiRequest, res: NextApiResponse) => void;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pagesRouterWebhook = exports.addHeaders = void 0;
|
|
4
|
-
const validate_webhook_signature_1 = require("./validate-webhook-signature");
|
|
5
|
-
const addHeaders = (res, headers) => {
|
|
6
|
-
Object.entries(headers).forEach(([key, value]) => {
|
|
7
|
-
res.setHeader(key, value);
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
exports.addHeaders = addHeaders;
|
|
11
|
-
const pagesRouterWebhook = (options) => {
|
|
12
|
-
const { testing, extraHeaders, secret, onSuccess, onTimeout, onError } = options;
|
|
13
|
-
return function (req, res) {
|
|
14
|
-
(0, exports.addHeaders)(res, extraHeaders || {});
|
|
15
|
-
if (testing) {
|
|
16
|
-
const testingheaders = {
|
|
17
|
-
'Access-Control-Allow-Origin': 'https://www.remotion.dev',
|
|
18
|
-
'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',
|
|
19
|
-
'Access-Control-Allow-Methods': 'OPTIONS,POST',
|
|
20
|
-
};
|
|
21
|
-
(0, exports.addHeaders)(res, testingheaders);
|
|
22
|
-
}
|
|
23
|
-
if (req.method === 'OPTIONS') {
|
|
24
|
-
res.status(200).end();
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
(0, validate_webhook_signature_1.validateWebhookSignature)({
|
|
28
|
-
secret,
|
|
29
|
-
body: req.body,
|
|
30
|
-
signatureHeader: req.headers['x-remotion-signature'],
|
|
31
|
-
});
|
|
32
|
-
// If code reaches this path, the webhook is authentic.
|
|
33
|
-
const payload = req.body;
|
|
34
|
-
if (payload.type === 'success' && onSuccess) {
|
|
35
|
-
onSuccess(payload);
|
|
36
|
-
}
|
|
37
|
-
else if (payload.type === 'timeout' && onTimeout) {
|
|
38
|
-
onTimeout(payload);
|
|
39
|
-
}
|
|
40
|
-
else if (payload.type === 'error' && onError) {
|
|
41
|
-
onError(payload);
|
|
42
|
-
}
|
|
43
|
-
res.status(200).json({
|
|
44
|
-
success: true,
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
exports.pagesRouterWebhook = pagesRouterWebhook;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseFunctionName = void 0;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
const parseFunctionName = (functionName) => {
|
|
6
|
-
const match = functionName.match(new RegExp(constants_1.RENDER_FN_PREFIX + '(.*)-mem(\\d+)mb-disk(\\d+)mb-(\\d+)sec$'));
|
|
7
|
-
if (!match) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
return {
|
|
11
|
-
version: match[1],
|
|
12
|
-
memorySizeInMb: parseInt(match[2], 10),
|
|
13
|
-
diskSizeInMb: parseInt(match[3], 10),
|
|
14
|
-
timeoutInSeconds: parseInt(match[4], 10),
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
exports.parseFunctionName = parseFunctionName;
|
package/dist/presign-url.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { AwsRegion } from './regions';
|
|
2
|
-
import type { RequestHandler } from './types';
|
|
3
|
-
type MandatoryParameters = {
|
|
4
|
-
region: AwsRegion;
|
|
5
|
-
bucketName: string;
|
|
6
|
-
objectKey: string;
|
|
7
|
-
expiresInSeconds: number;
|
|
8
|
-
};
|
|
9
|
-
type OptionalParameters<CheckIfObjectExists extends boolean> = {
|
|
10
|
-
checkIfObjectExists: CheckIfObjectExists;
|
|
11
|
-
forcePathStyle: boolean;
|
|
12
|
-
};
|
|
13
|
-
export type PresignUrlInput<CheckIfObjectExists extends boolean = boolean> = MandatoryParameters & Partial<OptionalParameters<CheckIfObjectExists>> & {
|
|
14
|
-
requestHandler?: RequestHandler;
|
|
15
|
-
};
|
|
16
|
-
export declare const presignUrl: <CheckIfObjectExists extends boolean = false>({ region, bucketName, objectKey, checkIfObjectExists, expiresInSeconds, forcePathStyle, requestHandler, }: PresignUrlInput<CheckIfObjectExists>) => Promise<CheckIfObjectExists extends true ? string | null : string>;
|
|
17
|
-
export {};
|
package/dist/presign-url.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.presignUrl = void 0;
|
|
4
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
-
const s3_request_presigner_1 = require("@aws-sdk/s3-request-presigner");
|
|
6
|
-
const serverless_client_1 = require("@remotion/serverless-client");
|
|
7
|
-
const constants_1 = require("./constants");
|
|
8
|
-
const get_s3_client_1 = require("./get-s3-client");
|
|
9
|
-
const validate_presign_expiration_1 = require("./validate-presign-expiration");
|
|
10
|
-
const internalPresignUrl = async ({ region, bucketName, objectKey, checkIfObjectExists, expiresInSeconds, forcePathStyle, requestHandler, }) => {
|
|
11
|
-
(0, serverless_client_1.validateBucketName)({
|
|
12
|
-
bucketName,
|
|
13
|
-
bucketNamePrefix: constants_1.REMOTION_BUCKET_PREFIX,
|
|
14
|
-
options: { mustStartWithRemotion: false },
|
|
15
|
-
});
|
|
16
|
-
(0, validate_presign_expiration_1.validatePresignExpiration)(expiresInSeconds);
|
|
17
|
-
const s3Client = (0, get_s3_client_1.getS3Client)({
|
|
18
|
-
region,
|
|
19
|
-
customCredentials: null,
|
|
20
|
-
forcePathStyle,
|
|
21
|
-
requestHandler: requestHandler !== null && requestHandler !== void 0 ? requestHandler : null,
|
|
22
|
-
});
|
|
23
|
-
if (checkIfObjectExists === true) {
|
|
24
|
-
try {
|
|
25
|
-
await s3Client.send(new client_s3_1.HeadObjectCommand({
|
|
26
|
-
Bucket: bucketName,
|
|
27
|
-
Key: objectKey,
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
catch (err) {
|
|
31
|
-
if (err.name === 'NotFound') {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
if (err.message === 'UnknownError' ||
|
|
35
|
-
err.$metadata
|
|
36
|
-
.httpStatusCode === 403) {
|
|
37
|
-
throw new Error(`Unable to access item "${objectKey}" from bucket "${bucketName}". You must have permission for both "s3:GetObject" and "s3:ListBucket" actions.`);
|
|
38
|
-
}
|
|
39
|
-
throw err;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const objCommand = new client_s3_1.GetObjectCommand({
|
|
43
|
-
Bucket: bucketName,
|
|
44
|
-
Key: objectKey,
|
|
45
|
-
});
|
|
46
|
-
const publicUrl = await (0, s3_request_presigner_1.getSignedUrl)(s3Client, objCommand, {
|
|
47
|
-
expiresIn: expiresInSeconds,
|
|
48
|
-
});
|
|
49
|
-
return publicUrl;
|
|
50
|
-
};
|
|
51
|
-
/*
|
|
52
|
-
* @description Takes a private S3 object and turns it into a public URL by signing it with your AWS credentials.
|
|
53
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/presignurl)
|
|
54
|
-
*/
|
|
55
|
-
const presignUrl = ({ region, bucketName, objectKey, checkIfObjectExists, expiresInSeconds, forcePathStyle, requestHandler, }) => {
|
|
56
|
-
return internalPresignUrl({
|
|
57
|
-
region,
|
|
58
|
-
bucketName,
|
|
59
|
-
objectKey,
|
|
60
|
-
checkIfObjectExists: checkIfObjectExists !== null && checkIfObjectExists !== void 0 ? checkIfObjectExists : false,
|
|
61
|
-
expiresInSeconds,
|
|
62
|
-
forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
|
|
63
|
-
requestHandler,
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
exports.presignUrl = presignUrl;
|
package/dist/price-per-1s.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { AwsRegion } from './regions';
|
|
2
|
-
export declare const pricing: {
|
|
3
|
-
[key in AwsRegion]: {
|
|
4
|
-
'Lambda Duration': {
|
|
5
|
-
rateCode: string;
|
|
6
|
-
price: string;
|
|
7
|
-
};
|
|
8
|
-
'Lambda Duration-Provisioned': {
|
|
9
|
-
rateCode: string;
|
|
10
|
-
price: string;
|
|
11
|
-
};
|
|
12
|
-
'Lambda Provisioned-Concurrency': {
|
|
13
|
-
rateCode: string;
|
|
14
|
-
price: string;
|
|
15
|
-
};
|
|
16
|
-
'Lambda Requests': {
|
|
17
|
-
rateCode: string;
|
|
18
|
-
price: string;
|
|
19
|
-
};
|
|
20
|
-
'Lambda Duration-ARM': {
|
|
21
|
-
rateCode: string;
|
|
22
|
-
price: string;
|
|
23
|
-
};
|
|
24
|
-
'Lambda Requests-ARM': {
|
|
25
|
-
rateCode: string;
|
|
26
|
-
price: string;
|
|
27
|
-
};
|
|
28
|
-
'Lambda Storage-Duration': {
|
|
29
|
-
rateCode: string;
|
|
30
|
-
price: string;
|
|
31
|
-
};
|
|
32
|
-
'Lambda Storage-Duration-ARM': {
|
|
33
|
-
rateCode: string;
|
|
34
|
-
price: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
};
|