@remotion/lambda 4.0.260 → 4.0.262
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/build.ts +1 -1
- package/dist/admin/make-layer-public.js +3 -3
- package/dist/api/create-function.d.ts +1 -2
- package/dist/api/create-function.js +8 -8
- package/dist/api/delete-site.d.ts +2 -2
- package/dist/api/delete-site.js +3 -4
- package/dist/api/deploy-function.d.ts +2 -2
- package/dist/api/deploy-function.js +9 -13
- package/dist/api/deploy-site.d.ts +2 -2
- package/dist/api/deploy-site.js +19 -13
- package/dist/api/download-media.d.ts +3 -3
- package/dist/api/download-media.js +11 -5
- package/dist/api/get-function-info.d.ts +1 -1
- package/dist/api/get-function-info.js +6 -8
- package/dist/api/get-or-create-bucket.d.ts +3 -3
- package/dist/api/get-or-create-bucket.js +4 -4
- package/dist/api/get-regions.d.ts +1 -1
- package/dist/api/get-regions.js +1 -1
- package/dist/api/iam-validation/role-permissions.js +6 -7
- package/dist/api/iam-validation/simulate-rule.d.ts +1 -1
- package/dist/api/iam-validation/simulate-rule.js +2 -2
- package/dist/api/iam-validation/simulate.d.ts +1 -1
- package/dist/api/iam-validation/simulate.js +2 -2
- package/dist/api/iam-validation/user-permissions.js +4 -5
- package/dist/api/upload-dir.d.ts +2 -3
- package/dist/api/upload-dir.js +12 -9
- package/dist/cli/args.d.ts +2 -4
- package/dist/cli/commands/compositions/index.d.ts +1 -1
- package/dist/cli/commands/compositions/index.js +5 -6
- package/dist/cli/commands/functions/deploy.d.ts +1 -1
- package/dist/cli/commands/functions/deploy.js +8 -9
- package/dist/cli/commands/functions/index.d.ts +1 -1
- package/dist/cli/commands/functions/index.js +6 -6
- package/dist/cli/commands/functions/ls.d.ts +1 -1
- package/dist/cli/commands/functions/rm.js +4 -4
- package/dist/cli/commands/functions/rmall.d.ts +1 -1
- package/dist/cli/commands/functions/rmall.js +2 -2
- package/dist/cli/commands/policies/policies.js +5 -5
- package/dist/cli/commands/quotas/increase.js +5 -5
- package/dist/cli/commands/quotas/list.js +4 -4
- package/dist/cli/commands/render/progress.js +4 -4
- package/dist/cli/commands/render/render.d.ts +1 -1
- package/dist/cli/commands/render/render.js +13 -16
- package/dist/cli/commands/sites/create.d.ts +1 -1
- package/dist/cli/commands/sites/create.js +4 -4
- package/dist/cli/commands/sites/index.d.ts +1 -1
- package/dist/cli/commands/sites/index.js +6 -6
- package/dist/cli/commands/sites/ls.js +2 -2
- package/dist/cli/commands/sites/rm.d.ts +1 -1
- package/dist/cli/commands/sites/rm.js +4 -4
- package/dist/cli/commands/sites/rmall.d.ts +1 -1
- package/dist/cli/commands/sites/rmall.js +4 -4
- package/dist/cli/commands/still.d.ts +1 -1
- package/dist/cli/commands/still.js +10 -12
- package/dist/cli/get-aws-region.d.ts +1 -1
- package/dist/cli/get-aws-region.js +6 -7
- package/dist/cli/help.js +10 -10
- package/dist/cli/helpers/find-function-name.d.ts +1 -1
- package/dist/cli/helpers/find-function-name.js +5 -5
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +15 -17
- package/dist/cli/log.d.ts +5 -5
- package/dist/client.d.ts +1 -19
- package/dist/client.js +15 -30
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +1 -1
- package/dist/functions/aws-server-implementation.d.ts +2 -1
- package/dist/functions/aws-server-implementation.js +11 -2
- package/dist/functions/full-client-implementation.d.ts +1 -1
- package/dist/functions/full-client-implementation.js +0 -2
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/get-folder-files.d.ts +1 -1
- package/dist/functions/helpers/make-aws-artifact.d.ts +1 -1
- package/dist/functions/helpers/read-with-progress.d.ts +2 -3
- package/dist/functions/helpers/read-with-progress.js +6 -2
- package/dist/functions/index.d.ts +2 -3
- package/dist/functions/index.js +2 -4
- package/dist/index.d.ts +13 -32
- package/dist/index.js +24 -35
- package/dist/internals.d.ts +8 -12
- package/dist/internals.js +0 -4
- package/dist/shared/get-layers.d.ts +1 -4
- package/dist/shared/get-layers.js +3 -3
- package/dist/shared/get-s3-operations.d.ts +1 -1
- package/dist/shared/hosted-layers.d.ts +1 -1
- package/dist/shared/lambda-insights-extensions.d.ts +1 -1
- package/dist/shared/validate-timeout.js +3 -3
- package/package.json +20 -28
- package/remotionlambda-arm64.zip +0 -0
- package/dist/api/app-router-webhook.d.ts +0 -10
- package/dist/api/app-router-webhook.js +0 -43
- package/dist/api/bucket-exists.d.ts +0 -3
- package/dist/api/bucket-exists.js +0 -26
- package/dist/api/clean-items.d.ts +0 -16
- package/dist/api/clean-items.js +0 -25
- package/dist/api/create-bucket.d.ts +0 -3
- package/dist/api/create-bucket.js +0 -45
- package/dist/api/delete-function.d.ts +0 -4
- package/dist/api/delete-function.js +0 -15
- package/dist/api/delete-render.d.ts +0 -20
- package/dist/api/delete-render.js +0 -78
- package/dist/api/estimate-price.d.ts +0 -17
- package/dist/api/estimate-price.js +0 -45
- package/dist/api/express-webhook.d.ts +0 -3
- package/dist/api/express-webhook.js +0 -46
- package/dist/api/get-aws-client.d.ts +0 -30
- package/dist/api/get-aws-client.js +0 -56
- package/dist/api/get-buckets.d.ts +0 -9
- package/dist/api/get-buckets.js +0 -62
- package/dist/api/get-compositions-on-lambda.d.ts +0 -20
- package/dist/api/get-compositions-on-lambda.js +0 -60
- package/dist/api/get-functions.d.ts +0 -9
- package/dist/api/get-functions.js +0 -77
- package/dist/api/get-render-progress.d.ts +0 -16
- package/dist/api/get-render-progress.js +0 -45
- package/dist/api/get-sites.d.ts +0 -29
- package/dist/api/get-sites.js +0 -79
- package/dist/api/make-lambda-payload.d.ts +0 -57
- package/dist/api/make-lambda-payload.js +0 -150
- package/dist/api/pages-router-webhook.d.ts +0 -5
- package/dist/api/pages-router-webhook.js +0 -48
- package/dist/api/presign-url.d.ts +0 -14
- package/dist/api/presign-url.js +0 -59
- package/dist/api/render-media-on-lambda.d.ts +0 -63
- package/dist/api/render-media-on-lambda.js +0 -128
- package/dist/api/render-still-on-lambda.d.ts +0 -56
- package/dist/api/render-still-on-lambda.js +0 -118
- package/dist/api/speculate-function-name.d.ts +0 -6
- package/dist/api/speculate-function-name.js +0 -20
- package/dist/api/validate-webhook-signature.d.ts +0 -5
- package/dist/api/validate-webhook-signature.js +0 -28
- package/dist/cli/is-cli.d.ts +0 -2
- package/dist/cli/is-cli.js +0 -10
- package/dist/functions/aws-implementation.d.ts +0 -23
- package/dist/functions/aws-implementation.js +0 -97
- package/dist/functions/helpers/apply-lifecyle.d.ts +0 -8
- package/dist/functions/helpers/apply-lifecyle.js +0 -18
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +0 -3
- package/dist/functions/helpers/get-output-url-from-metadata.js +0 -12
- package/dist/functions/helpers/lifecycle.d.ts +0 -8
- package/dist/functions/helpers/lifecycle.js +0 -24
- package/dist/functions/helpers/parse-function-name.d.ts +0 -8
- package/dist/functions/helpers/parse-function-name.js +0 -17
- package/dist/functions/http-client.d.ts +0 -2
- package/dist/functions/http-client.js +0 -18
- package/dist/io/delete-file.d.ts +0 -3
- package/dist/io/delete-file.js +0 -12
- package/dist/io/head-file.d.ts +0 -3
- package/dist/io/head-file.js +0 -17
- package/dist/io/list-objects.d.ts +0 -3
- package/dist/io/list-objects.js +0 -67
- package/dist/io/read-file.d.ts +0 -9
- package/dist/io/read-file.js +0 -18
- package/dist/io/write-file.d.ts +0 -5
- package/dist/io/write-file.js +0 -55
- package/dist/pricing/price-per-1-s.d.ts +0 -37
- package/dist/pricing/price-per-1-s.js +0 -822
- package/dist/regions.d.ts +0 -3
- package/dist/regions.js +0 -48
- package/dist/shared/aws-clients.d.ts +0 -11
- package/dist/shared/aws-clients.js +0 -51
- package/dist/shared/call-lambda-async.d.ts +0 -3
- package/dist/shared/call-lambda-async.js +0 -20
- package/dist/shared/call-lambda-streaming.d.ts +0 -7
- package/dist/shared/call-lambda-streaming.js +0 -126
- package/dist/shared/call-lambda-sync.d.ts +0 -3
- package/dist/shared/call-lambda-sync.js +0 -30
- package/dist/shared/check-credentials.d.ts +0 -1
- package/dist/shared/check-credentials.js +0 -39
- package/dist/shared/constants.d.ts +0 -26
- package/dist/shared/constants.js +0 -29
- package/dist/shared/content-disposition-header.d.ts +0 -2
- package/dist/shared/content-disposition-header.js +0 -50
- package/dist/shared/convert-to-serve-url.d.ts +0 -6
- package/dist/shared/convert-to-serve-url.js +0 -14
- package/dist/shared/encode-aws-url-params.d.ts +0 -1
- package/dist/shared/encode-aws-url-params.js +0 -7
- package/dist/shared/get-account-id.d.ts +0 -3
- package/dist/shared/get-account-id.js +0 -15
- package/dist/shared/get-aws-urls.d.ts +0 -26
- package/dist/shared/get-aws-urls.js +0 -31
- package/dist/shared/get-credentials.d.ts +0 -9
- package/dist/shared/get-credentials.js +0 -55
- package/dist/shared/get-env-variable.d.ts +0 -1
- package/dist/shared/get-env-variable.js +0 -15
- package/dist/shared/get-function-version.d.ts +0 -7
- package/dist/shared/get-function-version.js +0 -32
- package/dist/shared/get-s3-client.d.ts +0 -9
- package/dist/shared/get-s3-client.js +0 -14
- package/dist/shared/get-service-client.d.ts +0 -23
- package/dist/shared/get-service-client.js +0 -121
- package/dist/shared/is-flaky-error.d.ts +0 -1
- package/dist/shared/is-flaky-error.js +0 -77
- package/dist/shared/is-in-lambda.d.ts +0 -1
- package/dist/shared/is-in-lambda.js +0 -9
- package/dist/shared/is-likely-to-have-aws-profile.d.ts +0 -1
- package/dist/shared/is-likely-to-have-aws-profile.js +0 -50
- package/dist/shared/lambda-version-string.d.ts +0 -1
- package/dist/shared/lambda-version-string.js +0 -7
- package/dist/shared/lifecycle-rules.d.ts +0 -10
- package/dist/shared/lifecycle-rules.js +0 -61
- package/dist/shared/make-s3-url.d.ts +0 -6
- package/dist/shared/make-s3-url.js +0 -7
- package/dist/shared/p-limit.d.ts +0 -1
- package/dist/shared/p-limit.js +0 -57
- package/dist/shared/random-hash.d.ts +0 -1
- package/dist/shared/random-hash.js +0 -13
- package/dist/shared/validate-aws-region.d.ts +0 -2
- package/dist/shared/validate-aws-region.js +0 -9
- package/dist/shared/validate-bucketname.d.ts +0 -4
- package/dist/shared/validate-bucketname.js +0 -15
- package/dist/shared/validate-disk-size-in-mb.d.ts +0 -1
- package/dist/shared/validate-disk-size-in-mb.js +0 -23
- package/dist/shared/validate-lambda-codec.d.ts +0 -2
- package/dist/shared/validate-lambda-codec.js +0 -21
- package/dist/shared/validate-memory-size.d.ts +0 -1
- package/dist/shared/validate-memory-size.js +0 -22
- package/dist/shared/validate-presign-expiration.d.ts +0 -1
- package/dist/shared/validate-presign-expiration.js +0 -29
- package/dist/shared/validate-serveurl.d.ts +0 -1
- package/dist/shared/validate-serveurl.js +0 -9
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderVideoOnLambda = exports.renderMediaOnLambda = exports.renderMediaOnLambdaOptionalToRequired = exports.internalRenderMediaOnLambdaRaw = void 0;
|
|
4
|
-
const error_handling_1 = require("@remotion/renderer/error-handling");
|
|
5
|
-
const client_1 = require("@remotion/serverless/client");
|
|
6
|
-
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
7
|
-
const get_aws_urls_1 = require("../shared/get-aws-urls");
|
|
8
|
-
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
9
|
-
const internalRenderMediaOnLambdaRaw = async (input) => {
|
|
10
|
-
var _a;
|
|
11
|
-
const { functionName, region, rendererFunctionName } = input;
|
|
12
|
-
try {
|
|
13
|
-
const res = await aws_implementation_1.awsImplementation.callFunctionSync({
|
|
14
|
-
functionName,
|
|
15
|
-
type: client_1.ServerlessRoutines.start,
|
|
16
|
-
payload: await (0, make_lambda_payload_1.makeLambdaRenderMediaPayload)(input),
|
|
17
|
-
region,
|
|
18
|
-
timeoutInTest: 120000,
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
renderId: res.renderId,
|
|
22
|
-
bucketName: res.bucketName,
|
|
23
|
-
cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchRendererUrl)({
|
|
24
|
-
functionName,
|
|
25
|
-
region,
|
|
26
|
-
renderId: res.renderId,
|
|
27
|
-
rendererFunctionName: rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : null,
|
|
28
|
-
chunk: null,
|
|
29
|
-
}),
|
|
30
|
-
cloudWatchMainLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
31
|
-
renderId: res.renderId,
|
|
32
|
-
functionName,
|
|
33
|
-
method: client_1.ServerlessRoutines.launch,
|
|
34
|
-
region,
|
|
35
|
-
rendererFunctionName: rendererFunctionName !== null && rendererFunctionName !== void 0 ? rendererFunctionName : null,
|
|
36
|
-
}),
|
|
37
|
-
folderInS3Console: (0, get_aws_urls_1.getS3RenderUrl)({
|
|
38
|
-
bucketName: res.bucketName,
|
|
39
|
-
renderId: res.renderId,
|
|
40
|
-
region,
|
|
41
|
-
}),
|
|
42
|
-
lambdaInsightsLogs: (0, get_aws_urls_1.getLambdaInsightsUrl)({
|
|
43
|
-
functionName,
|
|
44
|
-
region,
|
|
45
|
-
}),
|
|
46
|
-
progressJsonInConsole: (0, get_aws_urls_1.getProgressJsonUrl)({
|
|
47
|
-
bucketName: res.bucketName,
|
|
48
|
-
renderId: res.renderId,
|
|
49
|
-
region,
|
|
50
|
-
}),
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
catch (err) {
|
|
54
|
-
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('UnrecognizedClientException')) {
|
|
55
|
-
throw new Error('UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception');
|
|
56
|
-
}
|
|
57
|
-
throw err;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
exports.internalRenderMediaOnLambdaRaw = internalRenderMediaOnLambdaRaw;
|
|
61
|
-
const renderMediaOnLambdaOptionalToRequired = (options) => {
|
|
62
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
|
|
63
|
-
return {
|
|
64
|
-
audioBitrate: (_a = options.audioBitrate) !== null && _a !== void 0 ? _a : null,
|
|
65
|
-
audioCodec: (_b = options.audioCodec) !== null && _b !== void 0 ? _b : null,
|
|
66
|
-
chromiumOptions: (_c = options.chromiumOptions) !== null && _c !== void 0 ? _c : {},
|
|
67
|
-
codec: options.codec,
|
|
68
|
-
colorSpace: (_d = options.colorSpace) !== null && _d !== void 0 ? _d : null,
|
|
69
|
-
composition: options.composition,
|
|
70
|
-
concurrencyPerLambda: (_e = options.concurrencyPerLambda) !== null && _e !== void 0 ? _e : 1,
|
|
71
|
-
crf: options.crf,
|
|
72
|
-
downloadBehavior: (_f = options.downloadBehavior) !== null && _f !== void 0 ? _f : { type: 'play-in-browser' },
|
|
73
|
-
envVariables: (_g = options.envVariables) !== null && _g !== void 0 ? _g : {},
|
|
74
|
-
everyNthFrame: (_h = options.everyNthFrame) !== null && _h !== void 0 ? _h : 1,
|
|
75
|
-
forceBucketName: (_j = options.forceBucketName) !== null && _j !== void 0 ? _j : null,
|
|
76
|
-
forceHeight: (_k = options.forceHeight) !== null && _k !== void 0 ? _k : null,
|
|
77
|
-
forceWidth: (_l = options.forceWidth) !== null && _l !== void 0 ? _l : null,
|
|
78
|
-
frameRange: (_m = options.frameRange) !== null && _m !== void 0 ? _m : null,
|
|
79
|
-
framesPerLambda: (_o = options.framesPerLambda) !== null && _o !== void 0 ? _o : null,
|
|
80
|
-
functionName: options.functionName,
|
|
81
|
-
imageFormat: (_p = options.imageFormat) !== null && _p !== void 0 ? _p : 'jpeg',
|
|
82
|
-
inputProps: (_q = options.inputProps) !== null && _q !== void 0 ? _q : {},
|
|
83
|
-
jpegQuality: (_r = options.jpegQuality) !== null && _r !== void 0 ? _r : 80,
|
|
84
|
-
logLevel: (_s = options.logLevel) !== null && _s !== void 0 ? _s : 'info',
|
|
85
|
-
maxRetries: (_t = options.maxRetries) !== null && _t !== void 0 ? _t : 1,
|
|
86
|
-
muted: (_u = options.muted) !== null && _u !== void 0 ? _u : false,
|
|
87
|
-
numberOfGifLoops: (_v = options.numberOfGifLoops) !== null && _v !== void 0 ? _v : null,
|
|
88
|
-
offthreadVideoCacheSizeInBytes: (_w = options.offthreadVideoCacheSizeInBytes) !== null && _w !== void 0 ? _w : null,
|
|
89
|
-
outName: (_x = options.outName) !== null && _x !== void 0 ? _x : null,
|
|
90
|
-
overwrite: (_y = options.overwrite) !== null && _y !== void 0 ? _y : false,
|
|
91
|
-
pixelFormat: (_z = options.pixelFormat) !== null && _z !== void 0 ? _z : undefined,
|
|
92
|
-
privacy: (_0 = options.privacy) !== null && _0 !== void 0 ? _0 : 'public',
|
|
93
|
-
proResProfile: (_1 = options.proResProfile) !== null && _1 !== void 0 ? _1 : undefined,
|
|
94
|
-
region: options.region,
|
|
95
|
-
rendererFunctionName: (_2 = options.rendererFunctionName) !== null && _2 !== void 0 ? _2 : null,
|
|
96
|
-
scale: (_3 = options.scale) !== null && _3 !== void 0 ? _3 : 1,
|
|
97
|
-
serveUrl: options.serveUrl,
|
|
98
|
-
timeoutInMilliseconds: (_4 = options.timeoutInMilliseconds) !== null && _4 !== void 0 ? _4 : 30000,
|
|
99
|
-
videoBitrate: (_5 = options.videoBitrate) !== null && _5 !== void 0 ? _5 : null,
|
|
100
|
-
encodingMaxRate: (_6 = options.encodingMaxRate) !== null && _6 !== void 0 ? _6 : null,
|
|
101
|
-
encodingBufferSize: (_7 = options.encodingBufferSize) !== null && _7 !== void 0 ? _7 : null,
|
|
102
|
-
webhook: (_8 = options.webhook) !== null && _8 !== void 0 ? _8 : null,
|
|
103
|
-
x264Preset: (_9 = options.x264Preset) !== null && _9 !== void 0 ? _9 : null,
|
|
104
|
-
deleteAfter: (_10 = options.deleteAfter) !== null && _10 !== void 0 ? _10 : null,
|
|
105
|
-
preferLossless: (_11 = options.preferLossless) !== null && _11 !== void 0 ? _11 : false,
|
|
106
|
-
forcePathStyle: (_12 = options.forcePathStyle) !== null && _12 !== void 0 ? _12 : false,
|
|
107
|
-
indent: false,
|
|
108
|
-
metadata: (_13 = options.metadata) !== null && _13 !== void 0 ? _13 : null,
|
|
109
|
-
apiKey: (_14 = options.apiKey) !== null && _14 !== void 0 ? _14 : null,
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
exports.renderMediaOnLambdaOptionalToRequired = renderMediaOnLambdaOptionalToRequired;
|
|
113
|
-
const wrapped = (0, error_handling_1.wrapWithErrorHandling)(exports.internalRenderMediaOnLambdaRaw);
|
|
114
|
-
/*
|
|
115
|
-
* @description Kicks off a render process on Remotion Lambda. The progress can be tracked using getRenderProgress().
|
|
116
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/rendermediaonlambda)
|
|
117
|
-
*/
|
|
118
|
-
const renderMediaOnLambda = (options) => {
|
|
119
|
-
if (options.quality) {
|
|
120
|
-
throw new Error('quality has been renamed to jpegQuality. Please rename the option.');
|
|
121
|
-
}
|
|
122
|
-
return wrapped((0, exports.renderMediaOnLambdaOptionalToRequired)(options));
|
|
123
|
-
};
|
|
124
|
-
exports.renderMediaOnLambda = renderMediaOnLambda;
|
|
125
|
-
/**
|
|
126
|
-
* @deprecated Renamed to renderMediaOnLambda()
|
|
127
|
-
*/
|
|
128
|
-
exports.renderVideoOnLambda = exports.renderMediaOnLambda;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { ChromiumOptions, StillImageFormat, ToOptions } from '@remotion/renderer';
|
|
2
|
-
import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
3
|
-
import type { DownloadBehavior } from '@remotion/serverless/client';
|
|
4
|
-
import type { CostsInfo, ReceivedArtifact } from '@remotion/serverless';
|
|
5
|
-
import type { OutNameInput, Privacy } from '@remotion/serverless/client';
|
|
6
|
-
import { type AwsProvider } from '../functions/aws-implementation';
|
|
7
|
-
import type { AwsRegion } from '../regions';
|
|
8
|
-
type MandatoryParameters = {
|
|
9
|
-
region: AwsRegion;
|
|
10
|
-
functionName: string;
|
|
11
|
-
serveUrl: string;
|
|
12
|
-
composition: string;
|
|
13
|
-
inputProps: Record<string, unknown>;
|
|
14
|
-
imageFormat: StillImageFormat;
|
|
15
|
-
privacy: Privacy;
|
|
16
|
-
};
|
|
17
|
-
type OptionalParameters = {
|
|
18
|
-
maxRetries: number;
|
|
19
|
-
envVariables: Record<string, string>;
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated Renamed to `jpegQuality`
|
|
22
|
-
*/
|
|
23
|
-
quality?: never;
|
|
24
|
-
frame: number;
|
|
25
|
-
outName: OutNameInput<AwsProvider> | null;
|
|
26
|
-
chromiumOptions: ChromiumOptions;
|
|
27
|
-
downloadBehavior: DownloadBehavior;
|
|
28
|
-
forceWidth: number | null;
|
|
29
|
-
forceHeight: number | null;
|
|
30
|
-
forceBucketName: string | null;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated Renamed to `logLevel`
|
|
33
|
-
*/
|
|
34
|
-
dumpBrowserLogs: boolean;
|
|
35
|
-
onInit: (data: {
|
|
36
|
-
renderId: string;
|
|
37
|
-
cloudWatchLogs: string;
|
|
38
|
-
lambdaInsightsUrl: string;
|
|
39
|
-
}) => void;
|
|
40
|
-
indent: boolean;
|
|
41
|
-
forcePathStyle: boolean;
|
|
42
|
-
} & ToOptions<typeof BrowserSafeApis.optionsMap.renderStillOnLambda>;
|
|
43
|
-
export type RenderStillOnLambdaNonNullInput = MandatoryParameters & OptionalParameters;
|
|
44
|
-
export type RenderStillOnLambdaInput = MandatoryParameters & Partial<OptionalParameters>;
|
|
45
|
-
export type RenderStillOnLambdaOutput = {
|
|
46
|
-
estimatedPrice: CostsInfo;
|
|
47
|
-
url: string;
|
|
48
|
-
outKey: string;
|
|
49
|
-
sizeInBytes: number;
|
|
50
|
-
bucketName: string;
|
|
51
|
-
renderId: string;
|
|
52
|
-
cloudWatchLogs: string;
|
|
53
|
-
artifacts: ReceivedArtifact<AwsProvider>[];
|
|
54
|
-
};
|
|
55
|
-
export declare const renderStillOnLambda: (input: RenderStillOnLambdaInput) => Promise<RenderStillOnLambdaOutput>;
|
|
56
|
-
export {};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderStillOnLambda = void 0;
|
|
4
|
-
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const error_handling_1 = require("@remotion/renderer/error-handling");
|
|
6
|
-
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
7
|
-
const constants_1 = require("../shared/constants");
|
|
8
|
-
const get_aws_urls_1 = require("../shared/get-aws-urls");
|
|
9
|
-
const make_lambda_payload_1 = require("./make-lambda-payload");
|
|
10
|
-
const internalRenderStillOnLambda = async (input) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const { functionName, region, onInit } = input;
|
|
13
|
-
try {
|
|
14
|
-
const payload = await (0, make_lambda_payload_1.makeLambdaRenderStillPayload)(input);
|
|
15
|
-
const res = await new Promise((resolve, reject) => {
|
|
16
|
-
aws_implementation_1.awsImplementation
|
|
17
|
-
.callFunctionStreaming({
|
|
18
|
-
functionName,
|
|
19
|
-
type: client_1.ServerlessRoutines.still,
|
|
20
|
-
payload,
|
|
21
|
-
region,
|
|
22
|
-
receivedStreamingPayload: ({ message }) => {
|
|
23
|
-
if (message.type === 'render-id-determined') {
|
|
24
|
-
onInit === null || onInit === void 0 ? void 0 : onInit({
|
|
25
|
-
renderId: message.payload.renderId,
|
|
26
|
-
cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
27
|
-
functionName,
|
|
28
|
-
method: client_1.ServerlessRoutines.still,
|
|
29
|
-
region,
|
|
30
|
-
rendererFunctionName: null,
|
|
31
|
-
renderId: message.payload.renderId,
|
|
32
|
-
}),
|
|
33
|
-
lambdaInsightsUrl: (0, get_aws_urls_1.getLambdaInsightsUrl)({
|
|
34
|
-
functionName,
|
|
35
|
-
region,
|
|
36
|
-
}),
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
if (message.type === 'error-occurred') {
|
|
40
|
-
reject(new Error(message.payload.error));
|
|
41
|
-
}
|
|
42
|
-
if (message.type === 'still-rendered') {
|
|
43
|
-
resolve(message.payload);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
timeoutInTest: 120000,
|
|
47
|
-
retriesRemaining: input.maxRetries,
|
|
48
|
-
})
|
|
49
|
-
.then(() => {
|
|
50
|
-
reject(new Error('Expected response to be streamed'));
|
|
51
|
-
})
|
|
52
|
-
.catch((err) => {
|
|
53
|
-
reject(err);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
return {
|
|
57
|
-
estimatedPrice: res.estimatedPrice,
|
|
58
|
-
url: res.output,
|
|
59
|
-
outKey: res.outKey,
|
|
60
|
-
sizeInBytes: res.size,
|
|
61
|
-
bucketName: res.bucketName,
|
|
62
|
-
renderId: res.renderId,
|
|
63
|
-
cloudWatchLogs: (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
64
|
-
functionName,
|
|
65
|
-
method: client_1.ServerlessRoutines.still,
|
|
66
|
-
region,
|
|
67
|
-
renderId: res.renderId,
|
|
68
|
-
rendererFunctionName: null,
|
|
69
|
-
}),
|
|
70
|
-
artifacts: res.receivedArtifacts,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('UnrecognizedClientException')) {
|
|
75
|
-
throw new Error('UnrecognizedClientException: The AWS credentials provided were probably mixed up. Learn how to fix this issue here: https://remotion.dev/docs/lambda/troubleshooting/unrecognizedclientexception');
|
|
76
|
-
}
|
|
77
|
-
throw err;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
const errorHandled = (0, error_handling_1.wrapWithErrorHandling)(internalRenderStillOnLambda);
|
|
81
|
-
/*
|
|
82
|
-
* @description Renders a still image inside a lambda function and writes it to the specified output location.
|
|
83
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/renderstillonlambda)
|
|
84
|
-
*/
|
|
85
|
-
const renderStillOnLambda = (input) => {
|
|
86
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
87
|
-
return errorHandled({
|
|
88
|
-
chromiumOptions: (_a = input.chromiumOptions) !== null && _a !== void 0 ? _a : {},
|
|
89
|
-
composition: input.composition,
|
|
90
|
-
deleteAfter: (_b = input.deleteAfter) !== null && _b !== void 0 ? _b : null,
|
|
91
|
-
downloadBehavior: (_c = input.downloadBehavior) !== null && _c !== void 0 ? _c : { type: 'play-in-browser' },
|
|
92
|
-
envVariables: (_d = input.envVariables) !== null && _d !== void 0 ? _d : {},
|
|
93
|
-
forceBucketName: (_e = input.forceBucketName) !== null && _e !== void 0 ? _e : null,
|
|
94
|
-
forceHeight: (_f = input.forceHeight) !== null && _f !== void 0 ? _f : null,
|
|
95
|
-
forceWidth: (_g = input.forceWidth) !== null && _g !== void 0 ? _g : null,
|
|
96
|
-
frame: (_h = input.frame) !== null && _h !== void 0 ? _h : 0,
|
|
97
|
-
functionName: input.functionName,
|
|
98
|
-
imageFormat: input.imageFormat,
|
|
99
|
-
indent: false,
|
|
100
|
-
inputProps: input.inputProps,
|
|
101
|
-
maxRetries: (_j = input.maxRetries) !== null && _j !== void 0 ? _j : constants_1.DEFAULT_MAX_RETRIES,
|
|
102
|
-
onInit: (_k = input.onInit) !== null && _k !== void 0 ? _k : (() => undefined),
|
|
103
|
-
outName: (_l = input.outName) !== null && _l !== void 0 ? _l : null,
|
|
104
|
-
privacy: input.privacy,
|
|
105
|
-
quality: undefined,
|
|
106
|
-
region: input.region,
|
|
107
|
-
serveUrl: input.serveUrl,
|
|
108
|
-
jpegQuality: (_m = input.jpegQuality) !== null && _m !== void 0 ? _m : 80,
|
|
109
|
-
logLevel: input.dumpBrowserLogs ? 'verbose' : ((_o = input.logLevel) !== null && _o !== void 0 ? _o : 'info'),
|
|
110
|
-
offthreadVideoCacheSizeInBytes: (_p = input.offthreadVideoCacheSizeInBytes) !== null && _p !== void 0 ? _p : null,
|
|
111
|
-
scale: (_q = input.scale) !== null && _q !== void 0 ? _q : 1,
|
|
112
|
-
timeoutInMilliseconds: (_r = input.timeoutInMilliseconds) !== null && _r !== void 0 ? _r : 30000,
|
|
113
|
-
dumpBrowserLogs: false,
|
|
114
|
-
forcePathStyle: (_s = input.forcePathStyle) !== null && _s !== void 0 ? _s : false,
|
|
115
|
-
apiKey: (_t = input.apiKey) !== null && _t !== void 0 ? _t : null,
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
exports.renderStillOnLambda = renderStillOnLambda;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type SpeculateFunctionNameInput = {
|
|
2
|
-
memorySizeInMb: string | number;
|
|
3
|
-
diskSizeInMb: string | number;
|
|
4
|
-
timeoutInSeconds: string | number;
|
|
5
|
-
};
|
|
6
|
-
export declare const speculateFunctionName: ({ memorySizeInMb, diskSizeInMb, timeoutInSeconds, }: SpeculateFunctionNameInput) => string;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.speculateFunctionName = void 0;
|
|
4
|
-
const defaults_1 = require("../defaults");
|
|
5
|
-
const lambda_version_string_1 = require("../shared/lambda-version-string");
|
|
6
|
-
/*
|
|
7
|
-
* @description Speculate the name of the Lambda function that will be created by `deployFunction()` or its CLI equivalent, based on the function configuration.
|
|
8
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/speculatefunctionname)
|
|
9
|
-
*/
|
|
10
|
-
const speculateFunctionName = ({ memorySizeInMb, diskSizeInMb, timeoutInSeconds, }) => {
|
|
11
|
-
// find-function-name.ts uses this for templating
|
|
12
|
-
// consider this before adding any validation here
|
|
13
|
-
return [
|
|
14
|
-
`${defaults_1.RENDER_FN_PREFIX}${lambda_version_string_1.LAMBDA_VERSION_STRING}`,
|
|
15
|
-
`mem${memorySizeInMb}mb`,
|
|
16
|
-
`disk${diskSizeInMb}mb`,
|
|
17
|
-
`${timeoutInSeconds}sec`,
|
|
18
|
-
].join('-');
|
|
19
|
-
};
|
|
20
|
-
exports.speculateFunctionName = speculateFunctionName;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateWebhookSignature = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* @description Validates that the signature received by a webhook endpoint is authentic. If validation fails, an error is thrown.
|
|
6
|
-
* @see [Documentation](https://remotion.dev/docs/lambda/validatewebhooksignature)
|
|
7
|
-
*/
|
|
8
|
-
const validateWebhookSignature = ({ secret, body, signatureHeader, }) => {
|
|
9
|
-
if (!secret) {
|
|
10
|
-
throw new TypeError("No 'secret' was provided to validateWebhookSignature().");
|
|
11
|
-
}
|
|
12
|
-
if (!body) {
|
|
13
|
-
throw new TypeError("No 'body' was provided to validateWebhookSignature().");
|
|
14
|
-
}
|
|
15
|
-
if (typeof require === 'undefined') {
|
|
16
|
-
throw new Error('validateWebhookSignature can only be called from Node.JS');
|
|
17
|
-
}
|
|
18
|
-
const Crypto = require('crypto');
|
|
19
|
-
const hmac = Crypto.createHmac('sha512', secret);
|
|
20
|
-
const signature = `sha512=${hmac.update(JSON.stringify(body)).digest('hex')}`;
|
|
21
|
-
if (!signatureHeader || signatureHeader === 'NO_SECRET_PROVIDED') {
|
|
22
|
-
throw new Error('No webhook signature was provided');
|
|
23
|
-
}
|
|
24
|
-
if (signatureHeader !== signature) {
|
|
25
|
-
throw new Error('Signatures do not match');
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
exports.validateWebhookSignature = validateWebhookSignature;
|
package/dist/cli/is-cli.d.ts
DELETED
package/dist/cli/is-cli.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setIsCli = exports.getIsCli = void 0;
|
|
4
|
-
let isCli = false;
|
|
5
|
-
const getIsCli = () => isCli;
|
|
6
|
-
exports.getIsCli = getIsCli;
|
|
7
|
-
const setIsCli = (cli) => {
|
|
8
|
-
isCli = cli;
|
|
9
|
-
};
|
|
10
|
-
exports.setIsCli = setIsCli;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
-
import type { AwsRegion } from '../regions';
|
|
3
|
-
import type { RuntimePreference } from '../shared/get-layers';
|
|
4
|
-
export type AwsProvider = {
|
|
5
|
-
type: 'aws';
|
|
6
|
-
region: AwsRegion;
|
|
7
|
-
receivedArtifactType: {
|
|
8
|
-
s3Key: string;
|
|
9
|
-
s3Url: string;
|
|
10
|
-
};
|
|
11
|
-
creationFunctionOptions: {
|
|
12
|
-
createCloudWatchLogGroup: boolean;
|
|
13
|
-
accountId: string;
|
|
14
|
-
alreadyCreated: boolean;
|
|
15
|
-
retentionInDays: number;
|
|
16
|
-
customRoleArn: string;
|
|
17
|
-
enableLambdaInsights: boolean;
|
|
18
|
-
vpcSubnetIds: string;
|
|
19
|
-
vpcSecurityGroupIds: string;
|
|
20
|
-
runtimePreference: RuntimePreference;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export declare const awsImplementation: ProviderSpecifics<AwsProvider>;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.awsImplementation = void 0;
|
|
5
|
-
const client_1 = require("@remotion/serverless/client");
|
|
6
|
-
const node_events_1 = require("node:events");
|
|
7
|
-
const bucket_exists_1 = require("../api/bucket-exists");
|
|
8
|
-
const create_bucket_1 = require("../api/create-bucket");
|
|
9
|
-
const delete_function_1 = require("../api/delete-function");
|
|
10
|
-
const estimate_price_1 = require("../api/estimate-price");
|
|
11
|
-
const get_buckets_1 = require("../api/get-buckets");
|
|
12
|
-
const get_functions_1 = require("../api/get-functions");
|
|
13
|
-
const defaults_1 = require("../defaults");
|
|
14
|
-
const delete_file_1 = require("../io/delete-file");
|
|
15
|
-
const head_file_1 = require("../io/head-file");
|
|
16
|
-
const list_objects_1 = require("../io/list-objects");
|
|
17
|
-
const read_file_1 = require("../io/read-file");
|
|
18
|
-
const write_file_1 = require("../io/write-file");
|
|
19
|
-
const call_lambda_async_1 = require("../shared/call-lambda-async");
|
|
20
|
-
const call_lambda_streaming_1 = require("../shared/call-lambda-streaming");
|
|
21
|
-
const call_lambda_sync_1 = require("../shared/call-lambda-sync");
|
|
22
|
-
const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
|
|
23
|
-
const get_account_id_1 = require("../shared/get-account-id");
|
|
24
|
-
const get_aws_urls_1 = require("../shared/get-aws-urls");
|
|
25
|
-
const is_flaky_error_1 = require("../shared/is-flaky-error");
|
|
26
|
-
const lifecycle_rules_1 = require("../shared/lifecycle-rules");
|
|
27
|
-
const random_hash_1 = require("../shared/random-hash");
|
|
28
|
-
const get_current_region_1 = require("./helpers/get-current-region");
|
|
29
|
-
const get_folder_files_1 = require("./helpers/get-folder-files");
|
|
30
|
-
const get_output_url_from_metadata_1 = require("./helpers/get-output-url-from-metadata");
|
|
31
|
-
const make_aws_artifact_1 = require("./helpers/make-aws-artifact");
|
|
32
|
-
const parse_function_name_1 = require("./helpers/parse-function-name");
|
|
33
|
-
if (/^AWS_Lambda_nodejs(?:18|20)[.]x$/.test((_a = process.env.AWS_EXECUTION_ENV) !== null && _a !== void 0 ? _a : '') === true) {
|
|
34
|
-
process.env.FONTCONFIG_PATH = '/opt';
|
|
35
|
-
process.env.FONTCONFIG_FILE = '/opt/fonts.conf';
|
|
36
|
-
process.env.DISABLE_FROM_SURFACE = '1';
|
|
37
|
-
process.env.NO_COLOR = '1';
|
|
38
|
-
// @ts-expect-error
|
|
39
|
-
globalThis._dumpUnreleasedBuffers = new node_events_1.EventEmitter();
|
|
40
|
-
// @ts-expect-error
|
|
41
|
-
globalThis._dumpUnreleasedBuffers.setMaxListeners(201);
|
|
42
|
-
}
|
|
43
|
-
const validateDeleteAfter = (lifeCycleValue) => {
|
|
44
|
-
if (lifeCycleValue === null) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (lifeCycleValue === undefined) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (typeof lifeCycleValue !== 'string') {
|
|
51
|
-
throw new TypeError(`Expected life cycle value to be a string, got ${JSON.stringify(lifeCycleValue)}`);
|
|
52
|
-
}
|
|
53
|
-
if (!(lifeCycleValue in client_1.expiryDays)) {
|
|
54
|
-
throw new TypeError(`Expected deleteAfter value to be one of ${Object.keys(client_1.expiryDays).join(', ')}, got ${lifeCycleValue}`);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
exports.awsImplementation = {
|
|
58
|
-
getChromiumPath() {
|
|
59
|
-
return '/opt/bin/chromium';
|
|
60
|
-
},
|
|
61
|
-
getCurrentRegionInFunction: get_current_region_1.getCurrentRegionInFunctionImplementation,
|
|
62
|
-
getBuckets: get_buckets_1.getRemotionBuckets,
|
|
63
|
-
createBucket: create_bucket_1.createBucket,
|
|
64
|
-
applyLifeCycle: lifecycle_rules_1.applyLifeCyleOperation,
|
|
65
|
-
listObjects: list_objects_1.lambdaLsImplementation,
|
|
66
|
-
deleteFile: delete_file_1.lambdaDeleteFileImplementation,
|
|
67
|
-
bucketExists: bucket_exists_1.bucketExistsInRegionImplementation,
|
|
68
|
-
randomHash: random_hash_1.randomHashImplementation,
|
|
69
|
-
readFile: read_file_1.lambdaReadFileImplementation,
|
|
70
|
-
writeFile: write_file_1.lambdaWriteFileImplementation,
|
|
71
|
-
headFile: head_file_1.lambdaHeadFileImplementation,
|
|
72
|
-
convertToServeUrl: convert_to_serve_url_1.convertToServeUrlImplementation,
|
|
73
|
-
printLoggingHelper: true,
|
|
74
|
-
getFolderFiles: get_folder_files_1.getFolderFiles,
|
|
75
|
-
makeArtifactWithDetails: make_aws_artifact_1.makeAwsArtifact,
|
|
76
|
-
validateDeleteAfter,
|
|
77
|
-
callFunctionAsync: call_lambda_async_1.callFunctionAsyncImplementation,
|
|
78
|
-
callFunctionStreaming: call_lambda_streaming_1.callFunctionWithStreamingImplementation,
|
|
79
|
-
callFunctionSync: call_lambda_sync_1.callFunctionSyncImplementation,
|
|
80
|
-
getEphemeralStorageForPriceCalculation() {
|
|
81
|
-
// We cannot determine the ephemeral storage size, so we
|
|
82
|
-
// overestimate the price, but will only have a miniscule effect (~0.2%)
|
|
83
|
-
return defaults_1.MAX_EPHEMERAL_STORAGE_IN_MB;
|
|
84
|
-
},
|
|
85
|
-
estimatePrice: estimate_price_1.estimatePrice,
|
|
86
|
-
getLoggingUrlForMethod: get_aws_urls_1.getCloudwatchMethodUrl,
|
|
87
|
-
getLoggingUrlForRendererFunction: get_aws_urls_1.getCloudwatchRendererUrl,
|
|
88
|
-
isFlakyError: is_flaky_error_1.isFlakyError,
|
|
89
|
-
getOutputUrl: get_output_url_from_metadata_1.getOutputUrlFromMetadata,
|
|
90
|
-
serverStorageProductName: () => 'S3',
|
|
91
|
-
getMaxStillInlinePayloadSize: () => 5000000,
|
|
92
|
-
getMaxNonInlinePayloadSizePerFunction: () => 200000,
|
|
93
|
-
getAccountId: get_account_id_1.getAccountIdImplementation,
|
|
94
|
-
deleteFunction: delete_function_1.deleteFunction,
|
|
95
|
-
getFunctions: get_functions_1.getFunctions,
|
|
96
|
-
parseFunctionName: parse_function_name_1.parseFunctionName,
|
|
97
|
-
};
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOutputUrlFromMetadata = void 0;
|
|
4
|
-
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const getOutputUrlFromMetadata = ({ renderMetadata, bucketName, customCredentials, currentRegion, }) => {
|
|
6
|
-
const { key, renderBucketName } = (0, client_1.getExpectedOutName)(renderMetadata, bucketName, customCredentials);
|
|
7
|
-
return {
|
|
8
|
-
url: `https://s3.${currentRegion}.amazonaws.com/${renderBucketName}/${key}`,
|
|
9
|
-
key,
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
exports.getOutputUrlFromMetadata = getOutputUrlFromMetadata;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { LifecycleRule } from '@aws-sdk/client-s3';
|
|
2
|
-
import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
|
|
3
|
-
import type { DeleteAfter } from '@remotion/serverless/client';
|
|
4
|
-
export declare const getLifeCycleRules: () => LifecycleRule[];
|
|
5
|
-
export declare const generateRandomHashWithLifeCycleRule: <Provider extends CloudProvider>({ deleteAfter, randomHashFn, }: {
|
|
6
|
-
deleteAfter: DeleteAfter | null;
|
|
7
|
-
randomHashFn: ProviderSpecifics<Provider>["randomHash"];
|
|
8
|
-
}) => string;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateRandomHashWithLifeCycleRule = exports.getLifeCycleRules = void 0;
|
|
4
|
-
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const getEnabledLifeCycleRule = ({ key, value, }) => {
|
|
6
|
-
return {
|
|
7
|
-
Expiration: {
|
|
8
|
-
Days: value,
|
|
9
|
-
},
|
|
10
|
-
Filter: {
|
|
11
|
-
Prefix: `renders/${key}`,
|
|
12
|
-
},
|
|
13
|
-
ID: `delete-after-${key}`,
|
|
14
|
-
Status: 'Enabled',
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
const getLifeCycleRules = () => {
|
|
18
|
-
return Object.entries(client_1.expiryDays).map(([key, value]) => getEnabledLifeCycleRule({ key, value }));
|
|
19
|
-
};
|
|
20
|
-
exports.getLifeCycleRules = getLifeCycleRules;
|
|
21
|
-
const generateRandomHashWithLifeCycleRule = ({ deleteAfter, randomHashFn, }) => {
|
|
22
|
-
return [deleteAfter, randomHashFn()].filter(client_1.truthy).join('-');
|
|
23
|
-
};
|
|
24
|
-
exports.generateRandomHashWithLifeCycleRule = generateRandomHashWithLifeCycleRule;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseFunctionName = void 0;
|
|
4
|
-
const defaults_1 = require("../../defaults");
|
|
5
|
-
const parseFunctionName = (functionName) => {
|
|
6
|
-
const match = functionName.match(new RegExp(defaults_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;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getWebhookClient = void 0;
|
|
7
|
-
const node_http_1 = __importDefault(require("node:http"));
|
|
8
|
-
const node_https_1 = __importDefault(require("node:https"));
|
|
9
|
-
const getWebhookClient = (url) => {
|
|
10
|
-
if (url.startsWith('https://')) {
|
|
11
|
-
return node_https_1.default.request;
|
|
12
|
-
}
|
|
13
|
-
if (url.startsWith('http://')) {
|
|
14
|
-
return node_http_1.default.request;
|
|
15
|
-
}
|
|
16
|
-
throw new Error('Can only request URLs starting with http:// or https://');
|
|
17
|
-
};
|
|
18
|
-
exports.getWebhookClient = getWebhookClient;
|
package/dist/io/delete-file.d.ts
DELETED