@remotion/lambda 4.0.187 → 4.0.188
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/api/__mocks__/clean-items.d.ts +2 -0
- package/dist/api/__mocks__/clean-items.js +24 -0
- package/dist/api/__mocks__/create-function.d.ts +2 -0
- package/dist/api/__mocks__/create-function.js +21 -0
- package/dist/api/__mocks__/delete-function.d.ts +2 -0
- package/dist/api/__mocks__/delete-function.js +9 -0
- package/dist/api/__mocks__/get-functions.d.ts +2 -0
- package/dist/api/__mocks__/get-functions.js +9 -0
- package/dist/api/__mocks__/upload-dir.d.ts +3 -0
- package/dist/api/__mocks__/upload-dir.js +47 -0
- package/dist/api/bucket-exists.d.ts +3 -6
- package/dist/api/bucket-exists.js +5 -5
- package/dist/api/clean-items.d.ts +4 -3
- package/dist/api/clean-items.js +7 -7
- package/dist/api/create-bucket.d.ts +3 -5
- package/dist/api/create-bucket.js +6 -6
- package/dist/api/create-function.d.ts +1 -1
- package/dist/api/delete-function.d.ts +1 -1
- package/dist/api/delete-render.d.ts +10 -3
- package/dist/api/delete-render.js +27 -19
- package/dist/api/delete-site.d.ts +7 -2
- package/dist/api/delete-site.js +23 -15
- package/dist/api/deploy-function.d.ts +1 -1
- package/dist/api/deploy-function.js +2 -2
- package/dist/api/deploy-site.d.ts +9 -5
- package/dist/api/deploy-site.js +11 -12
- package/dist/api/download-media.d.ts +8 -3
- package/dist/api/download-media.js +24 -15
- package/dist/api/estimate-price.d.ts +1 -1
- package/dist/api/get-aws-client.d.ts +4 -2
- package/dist/api/get-aws-client.js +2 -2
- package/dist/api/get-buckets.d.ts +4 -4
- package/dist/api/get-buckets.js +12 -14
- package/dist/api/get-compositions-on-lambda.js +7 -6
- package/dist/api/get-function-info.d.ts +1 -1
- package/dist/api/get-functions.d.ts +1 -1
- package/dist/api/get-or-create-bucket.d.ts +3 -19
- package/dist/api/get-or-create-bucket.js +5 -39
- package/dist/api/get-regions.d.ts +1 -1
- package/dist/api/get-regions.js +1 -2
- package/dist/api/get-render-progress.d.ts +4 -3
- package/dist/api/get-render-progress.js +2 -2
- package/dist/api/get-sites.d.ts +6 -1
- package/dist/api/get-sites.js +21 -14
- package/dist/api/iam-validation/role-permissions.js +2 -1
- package/dist/api/iam-validation/simulate-rule.d.ts +1 -1
- package/dist/api/iam-validation/simulate.d.ts +1 -1
- package/dist/api/iam-validation/user-permissions.js +2 -1
- package/dist/api/make-lambda-payload.d.ts +8 -9
- package/dist/api/make-lambda-payload.js +15 -13
- package/dist/api/mock-functions.d.ts +1 -1
- package/dist/api/presign-url.d.ts +1 -1
- package/dist/api/presign-url.js +4 -4
- package/dist/api/render-media-on-lambda.d.ts +5 -6
- package/dist/api/render-media-on-lambda.js +5 -5
- package/dist/api/render-still-on-lambda.d.ts +8 -6
- package/dist/api/render-still-on-lambda.js +6 -5
- package/dist/api/upload-dir.d.ts +2 -2
- package/dist/api/upload-dir.js +2 -2
- package/dist/cli/args.d.ts +2 -3
- package/dist/cli/commands/render/progress.d.ts +2 -2
- package/dist/cli/commands/render/progress.js +6 -5
- package/dist/cli/commands/render/render.d.ts +3 -1
- package/dist/cli/commands/render/render.js +3 -2
- package/dist/cli/commands/sites/create.d.ts +3 -1
- package/dist/cli/commands/sites/create.js +6 -5
- package/dist/cli/commands/sites/index.d.ts +3 -1
- package/dist/cli/commands/sites/index.js +4 -4
- package/dist/cli/commands/sites/rm.d.ts +3 -1
- package/dist/cli/commands/sites/rm.js +4 -3
- package/dist/cli/commands/sites/rmall.d.ts +3 -1
- package/dist/cli/commands/sites/rmall.js +4 -3
- package/dist/cli/commands/still.d.ts +3 -1
- package/dist/cli/commands/still.js +3 -2
- package/dist/cli/get-aws-region.d.ts +1 -1
- package/dist/cli/helpers/__mocks__/quit.d.ts +1 -0
- package/dist/cli/helpers/__mocks__/quit.js +7 -0
- package/dist/cli/index.d.ts +3 -1
- package/dist/cli/index.js +8 -7
- package/dist/client.d.ts +4 -5
- package/dist/functions/aws-implementation.d.ts +11 -0
- package/dist/functions/aws-implementation.js +49 -0
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +4 -1
- package/dist/functions/compositions.d.ts +3 -2
- package/dist/functions/compositions.js +18 -15
- package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +3 -0
- package/dist/functions/helpers/__mocks__/get-browser-instance.js +12 -0
- package/dist/functions/helpers/__mocks__/leak-detection.d.ts +4 -0
- package/dist/functions/helpers/__mocks__/leak-detection.js +9 -0
- package/dist/functions/helpers/__mocks__/timer.d.ts +2 -0
- package/dist/functions/helpers/__mocks__/timer.js +10 -0
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +5 -3
- package/dist/functions/helpers/calculate-price-from-bucket.js +2 -3
- package/dist/functions/helpers/cleanup-props.d.ts +4 -2
- package/dist/functions/helpers/cleanup-props.js +5 -4
- package/dist/functions/helpers/concat-videos.d.ts +2 -2
- package/dist/functions/helpers/create-post-render-data.d.ts +8 -8
- package/dist/functions/helpers/create-post-render-data.js +1 -1
- package/dist/functions/helpers/expected-out-name.d.ts +4 -4
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +8 -7
- package/dist/functions/helpers/find-output-file-in-bucket.js +5 -6
- package/dist/functions/helpers/get-browser-instance.d.ts +3 -2
- package/dist/functions/helpers/get-browser-instance.js +3 -4
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/get-current-region.js +3 -3
- package/dist/functions/helpers/get-custom-out-name.d.ts +5 -5
- package/dist/functions/helpers/get-folder-files.d.ts +2 -0
- package/dist/functions/helpers/get-folder-files.js +38 -0
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +4 -3
- package/dist/functions/helpers/get-output-url-from-metadata.js +4 -5
- package/dist/functions/helpers/get-overall-progress-s3.d.ts +5 -4
- package/dist/functions/helpers/get-overall-progress-s3.js +5 -7
- package/dist/functions/helpers/get-progress.d.ts +8 -7
- package/dist/functions/helpers/get-progress.js +7 -5
- package/dist/functions/helpers/inspect-errors.d.ts +1 -1
- package/dist/functions/helpers/inspect-errors.js +4 -4
- package/dist/functions/helpers/io.d.ts +3 -36
- package/dist/functions/helpers/io.js +3 -104
- package/dist/functions/helpers/lifecycle.d.ts +3 -9
- package/dist/functions/helpers/lifecycle.js +6 -16
- package/dist/functions/helpers/make-aws-artifact.d.ts +3 -0
- package/dist/functions/helpers/make-aws-artifact.js +12 -0
- package/dist/functions/helpers/make-timeout-error.d.ts +5 -4
- package/dist/functions/helpers/make-timeout-error.js +2 -1
- package/dist/functions/helpers/make-timeout-message.d.ts +5 -3
- package/dist/functions/helpers/make-timeout-message.js +8 -9
- package/dist/functions/helpers/merge-chunks.d.ts +10 -10
- package/dist/functions/helpers/merge-chunks.js +7 -8
- package/dist/functions/helpers/overall-render-progress.d.ts +18 -23
- package/dist/functions/helpers/overall-render-progress.js +5 -5
- package/dist/functions/helpers/print-cloudwatch-helper.d.ts +2 -2
- package/dist/functions/helpers/print-logging-helper.d.ts +4 -0
- package/dist/functions/helpers/print-logging-helper.js +12 -0
- package/dist/functions/helpers/read-with-progress.d.ts +4 -3
- package/dist/functions/helpers/read-with-progress.js +2 -2
- package/dist/functions/helpers/render-has-audio-video.d.ts +3 -2
- package/dist/functions/helpers/stream-renderer.d.ts +7 -4
- package/dist/functions/helpers/stream-renderer.js +11 -10
- package/dist/functions/helpers/streamify-response.d.ts +0 -20
- package/dist/functions/helpers/streamify-response.js +1 -62
- package/dist/functions/helpers/validate-composition.d.ts +5 -3
- package/dist/functions/helpers/validate-composition.js +2 -3
- package/dist/functions/index.d.ts +5 -3
- package/dist/functions/index.js +98 -72
- package/dist/functions/info.d.ts +1 -1
- package/dist/functions/info.js +2 -2
- package/dist/functions/launch.d.ts +3 -2
- package/dist/functions/launch.js +54 -41
- package/dist/functions/progress.d.ts +6 -3
- package/dist/functions/progress.js +5 -4
- package/dist/functions/provider-implementation.d.ts +0 -0
- package/dist/functions/provider-implementation.js +1 -0
- package/dist/functions/renderer.d.ts +9 -3
- package/dist/functions/renderer.js +30 -22
- package/dist/functions/start.d.ts +3 -2
- package/dist/functions/start.js +13 -16
- package/dist/functions/still.d.ts +8 -18
- package/dist/functions/still.js +47 -46
- package/dist/index.d.ts +4 -6
- package/dist/internals.d.ts +16 -14
- package/dist/io/delete-file.d.ts +3 -0
- package/dist/io/delete-file.js +12 -0
- package/dist/io/head-file.d.ts +3 -0
- package/dist/io/head-file.js +13 -0
- package/dist/io/list-objects.d.ts +3 -0
- package/dist/io/list-objects.js +58 -0
- package/dist/io/read-file.d.ts +9 -0
- package/dist/io/read-file.js +14 -0
- package/dist/io/write-file.d.ts +5 -0
- package/dist/io/write-file.js +51 -0
- package/dist/pricing/aws-regions.d.ts +0 -3
- package/dist/pricing/aws-regions.js +0 -44
- package/dist/pricing/price-per-1-s.d.ts +1 -1
- package/dist/regions.d.ts +3 -2
- package/dist/regions.js +43 -3
- package/dist/shared/__mocks__/aws-clients.d.ts +2 -0
- package/dist/shared/__mocks__/aws-clients.js +62 -0
- package/dist/shared/__mocks__/bundle-site.d.ts +2 -0
- package/dist/shared/__mocks__/bundle-site.js +32 -0
- package/dist/shared/__mocks__/check-credentials.d.ts +1 -0
- package/dist/shared/__mocks__/check-credentials.js +5 -0
- package/dist/shared/__mocks__/get-account-id.d.ts +2 -0
- package/dist/shared/__mocks__/get-account-id.js +11 -0
- package/dist/shared/__mocks__/read-dir.d.ts +2 -0
- package/dist/shared/__mocks__/read-dir.js +13 -0
- package/dist/shared/aws-clients.d.ts +6 -29
- package/dist/shared/aws-clients.js +7 -177
- package/dist/shared/call-lambda.d.ts +8 -9
- package/dist/shared/call-lambda.js +16 -3
- package/dist/shared/check-credentials.js +2 -2
- package/dist/shared/cleanup-serialized-input-props.d.ts +8 -6
- package/dist/shared/cleanup-serialized-input-props.js +7 -8
- package/dist/shared/compress-props.d.ts +8 -6
- package/dist/shared/compress-props.js +11 -14
- package/dist/shared/constants.d.ts +10 -288
- package/dist/shared/constants.js +1 -46
- package/dist/shared/content-disposition-header.d.ts +1 -6
- package/dist/shared/content-disposition-header.js +2 -2
- package/dist/shared/convert-to-serve-url.d.ts +2 -2
- package/dist/shared/convert-to-serve-url.js +3 -3
- package/dist/shared/get-account-id.d.ts +1 -1
- package/dist/shared/get-aws-urls.d.ts +2 -2
- package/dist/shared/get-credentials.d.ts +9 -0
- package/dist/shared/get-credentials.js +53 -0
- package/dist/shared/get-function-version.d.ts +1 -1
- package/dist/shared/get-function-version.js +2 -1
- package/dist/shared/get-s3-client.d.ts +5 -0
- package/dist/shared/get-s3-client.js +13 -0
- package/dist/shared/get-service-client.d.ts +22 -0
- package/dist/shared/get-service-client.js +117 -0
- package/dist/shared/hosted-layers.d.ts +1 -1
- package/dist/shared/invoke-webhook.d.ts +1 -1
- package/dist/shared/lambda-insights-extensions.d.ts +1 -1
- package/dist/shared/lifecycle-rules.d.ts +4 -3
- package/dist/shared/lifecycle-rules.js +3 -3
- package/dist/shared/make-s3-url.d.ts +1 -1
- package/dist/shared/random-hash.d.ts +1 -3
- package/dist/shared/random-hash.js +3 -4
- package/dist/shared/return-values.d.ts +10 -11
- package/dist/shared/validate-aws-region.d.ts +1 -1
- package/dist/shared/validate-aws-region.js +3 -3
- package/dist/shared/validate-bucketname.d.ts +0 -4
- package/dist/shared/validate-bucketname.js +3 -23
- package/dist/shared/validate-lambda-codec.d.ts +2 -4
- package/dist/shared/validate-lambda-codec.js +3 -13
- package/dist/shared/validate-outname.js +2 -2
- package/dist/shared/validate-privacy.d.ts +1 -1
- package/dist/shared/validate-webhook.d.ts +1 -1
- package/package.json +11 -9
- package/remotionlambda-arm64.zip +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getServiceClient = void 0;
|
|
4
|
+
const client_cloudwatch_logs_1 = require("@aws-sdk/client-cloudwatch-logs");
|
|
5
|
+
const client_iam_1 = require("@aws-sdk/client-iam");
|
|
6
|
+
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
7
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
8
|
+
const client_service_quotas_1 = require("@aws-sdk/client-service-quotas");
|
|
9
|
+
const client_sts_1 = require("@aws-sdk/client-sts");
|
|
10
|
+
const no_react_1 = require("remotion/no-react");
|
|
11
|
+
const check_credentials_1 = require("./check-credentials");
|
|
12
|
+
const constants_1 = require("./constants");
|
|
13
|
+
const get_credentials_1 = require("./get-credentials");
|
|
14
|
+
const getCredentialsHash = ({ customCredentials, region, service, }) => {
|
|
15
|
+
const hashComponents = {};
|
|
16
|
+
if (process.env.REMOTION_SKIP_AWS_CREDENTIALS_CHECK) {
|
|
17
|
+
hashComponents.credentials = {
|
|
18
|
+
credentialsSkipped: true,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
else if (process.env.REMOTION_AWS_PROFILE) {
|
|
22
|
+
hashComponents.credentials = {
|
|
23
|
+
awsProfile: process.env.REMOTION_AWS_PROFILE,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
else if (process.env.REMOTION_AWS_ACCESS_KEY_ID &&
|
|
27
|
+
process.env.REMOTION_AWS_SECRET_ACCESS_KEY) {
|
|
28
|
+
hashComponents.credentials = {
|
|
29
|
+
accessKeyId: process.env.REMOTION_AWS_ACCESS_KEY_ID,
|
|
30
|
+
secretAccessKey: process.env.REMOTION_AWS_SECRET_ACCESS_KEY,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
else if (process.env.AWS_PROFILE) {
|
|
34
|
+
hashComponents.credentials = {
|
|
35
|
+
awsProfile: process.env.AWS_PROFILE,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
else if (process.env.AWS_ACCESS_KEY_ID &&
|
|
39
|
+
process.env.AWS_SECRET_ACCESS_KEY) {
|
|
40
|
+
hashComponents.credentials = {
|
|
41
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
42
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
hashComponents.customCredentials = customCredentials;
|
|
46
|
+
hashComponents.region = region;
|
|
47
|
+
hashComponents.service = service;
|
|
48
|
+
return (0, no_react_1.random)(JSON.stringify(hashComponents)).toString().replace('0.', '');
|
|
49
|
+
};
|
|
50
|
+
const _clients = {};
|
|
51
|
+
const getServiceClient = ({ region, service, customCredentials, }) => {
|
|
52
|
+
var _a;
|
|
53
|
+
const Client = (() => {
|
|
54
|
+
if (service === 'cloudwatch') {
|
|
55
|
+
return client_cloudwatch_logs_1.CloudWatchLogsClient;
|
|
56
|
+
}
|
|
57
|
+
if (service === 'lambda') {
|
|
58
|
+
return client_lambda_1.LambdaClient;
|
|
59
|
+
}
|
|
60
|
+
if (service === 's3') {
|
|
61
|
+
return client_s3_1.S3Client;
|
|
62
|
+
}
|
|
63
|
+
if (service === 'iam') {
|
|
64
|
+
return client_iam_1.IAMClient;
|
|
65
|
+
}
|
|
66
|
+
if (service === 'servicequotas') {
|
|
67
|
+
return client_service_quotas_1.ServiceQuotasClient;
|
|
68
|
+
}
|
|
69
|
+
if (service === 'sts') {
|
|
70
|
+
return client_sts_1.STSClient;
|
|
71
|
+
}
|
|
72
|
+
throw new TypeError('unknown client ' + service);
|
|
73
|
+
})();
|
|
74
|
+
const key = getCredentialsHash({
|
|
75
|
+
region,
|
|
76
|
+
customCredentials,
|
|
77
|
+
service,
|
|
78
|
+
});
|
|
79
|
+
if (!_clients[key]) {
|
|
80
|
+
(0, check_credentials_1.checkCredentials)();
|
|
81
|
+
const lambdaOptions = service === 'lambda'
|
|
82
|
+
? {
|
|
83
|
+
httpsAgent: {
|
|
84
|
+
maxSockets: constants_1.MAX_FUNCTIONS_PER_RENDER * 2,
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
: undefined;
|
|
88
|
+
const client = customCredentials
|
|
89
|
+
? new Client({
|
|
90
|
+
region: (_a = customCredentials.region) !== null && _a !== void 0 ? _a : 'us-east-1',
|
|
91
|
+
credentials: customCredentials.accessKeyId && customCredentials.secretAccessKey
|
|
92
|
+
? {
|
|
93
|
+
accessKeyId: customCredentials.accessKeyId,
|
|
94
|
+
secretAccessKey: customCredentials.secretAccessKey,
|
|
95
|
+
}
|
|
96
|
+
: undefined,
|
|
97
|
+
endpoint: customCredentials.endpoint,
|
|
98
|
+
requestHandler: lambdaOptions,
|
|
99
|
+
})
|
|
100
|
+
: process.env.REMOTION_SKIP_AWS_CREDENTIALS_CHECK
|
|
101
|
+
? new Client({
|
|
102
|
+
region,
|
|
103
|
+
requestHandler: lambdaOptions,
|
|
104
|
+
})
|
|
105
|
+
: new Client({
|
|
106
|
+
region,
|
|
107
|
+
credentials: (0, get_credentials_1.getCredentials)(),
|
|
108
|
+
requestHandler: lambdaOptions,
|
|
109
|
+
});
|
|
110
|
+
if (process.env.REMOTION_DISABLE_AWS_CLIENT_CACHE) {
|
|
111
|
+
return client;
|
|
112
|
+
}
|
|
113
|
+
_clients[key] = client;
|
|
114
|
+
}
|
|
115
|
+
return _clients[key];
|
|
116
|
+
};
|
|
117
|
+
exports.getServiceClient = getServiceClient;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import type { LogLevel } from '@remotion/renderer';
|
|
4
|
+
import type { EnhancedErrorInfo } from '@remotion/serverless';
|
|
4
5
|
import https from 'https';
|
|
5
6
|
import http from 'node:http';
|
|
6
|
-
import type { EnhancedErrorInfo } from '../functions/helpers/write-lambda-error';
|
|
7
7
|
import type { AfterRenderCost } from './constants';
|
|
8
8
|
/**
|
|
9
9
|
* @description Calculates cryptographically secure signature for webhooks using Hmac.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { CustomCredentials } from '@remotion/serverless/client';
|
|
2
|
+
import type { AwsProvider } from '../functions/aws-implementation';
|
|
3
|
+
import type { AwsRegion } from '../regions';
|
|
3
4
|
export declare const applyLifeCyleOperation: ({ enableFolderExpiry, bucketName, region, customCredentials, }: {
|
|
4
5
|
enableFolderExpiry: boolean | null;
|
|
5
6
|
bucketName: string;
|
|
6
7
|
region: AwsRegion;
|
|
7
|
-
customCredentials: CustomCredentials | null;
|
|
8
|
+
customCredentials: CustomCredentials<AwsProvider> | null;
|
|
8
9
|
}) => Promise<void>;
|
|
@@ -4,7 +4,7 @@ exports.applyLifeCyleOperation = void 0;
|
|
|
4
4
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
5
|
const apply_lifecyle_1 = require("../functions/helpers/apply-lifecyle");
|
|
6
6
|
const lifecycle_1 = require("../functions/helpers/lifecycle");
|
|
7
|
-
const
|
|
7
|
+
const get_s3_client_1 = require("./get-s3-client");
|
|
8
8
|
const createLCRules = async ({ bucketName, region, customCredentials, }) => {
|
|
9
9
|
var _a;
|
|
10
10
|
const lcRules = (0, lifecycle_1.getLifeCycleRules)();
|
|
@@ -15,7 +15,7 @@ const createLCRules = async ({ bucketName, region, customCredentials, }) => {
|
|
|
15
15
|
});
|
|
16
16
|
const createCommand = new client_s3_1.PutBucketLifecycleConfigurationCommand(createCommandInput);
|
|
17
17
|
try {
|
|
18
|
-
await (0,
|
|
18
|
+
await (0, get_s3_client_1.getS3Client)(region, customCredentials).send(createCommand);
|
|
19
19
|
}
|
|
20
20
|
catch (err) {
|
|
21
21
|
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('AccessDenied')) {
|
|
@@ -29,7 +29,7 @@ const deleteLCRules = async ({ bucketName, region, customCredentials, }) => {
|
|
|
29
29
|
bucketName,
|
|
30
30
|
});
|
|
31
31
|
try {
|
|
32
|
-
await (0,
|
|
32
|
+
await (0, get_s3_client_1.getS3Client)(region, customCredentials).send(new client_s3_1.DeleteBucketLifecycleCommand(deleteCommandInput));
|
|
33
33
|
}
|
|
34
34
|
catch (err) {
|
|
35
35
|
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('AccessDenied')) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.randomHashImplementation = void 0;
|
|
4
4
|
const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
5
|
-
|
|
6
|
-
const randomHash = (_options) => {
|
|
5
|
+
const randomHashImplementation = () => {
|
|
7
6
|
return new Array(10)
|
|
8
7
|
.fill(1)
|
|
9
8
|
.map(() => {
|
|
@@ -11,4 +10,4 @@ const randomHash = (_options) => {
|
|
|
11
10
|
})
|
|
12
11
|
.join('');
|
|
13
12
|
};
|
|
14
|
-
exports.
|
|
13
|
+
exports.randomHashImplementation = randomHashImplementation;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type { compositionsHandler } from '
|
|
2
|
-
import type {
|
|
1
|
+
import type { CloudProvider, compositionsHandler, infoHandler } from '@remotion/serverless';
|
|
2
|
+
import type { ServerlessRoutines } from '@remotion/serverless/client';
|
|
3
3
|
import type { launchHandler } from '../functions/launch';
|
|
4
4
|
import type { progressHandler } from '../functions/progress';
|
|
5
5
|
import type { rendererHandler } from '../functions/renderer';
|
|
6
6
|
import type { startHandler } from '../functions/start';
|
|
7
7
|
import type { stillHandler } from '../functions/still';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[LambdaRoutines.compositions]: ReturnType<typeof compositionsHandler>;
|
|
8
|
+
export interface LambdaReturnValues<Provider extends CloudProvider> {
|
|
9
|
+
[ServerlessRoutines.start]: ReturnType<typeof startHandler>;
|
|
10
|
+
[ServerlessRoutines.launch]: ReturnType<typeof launchHandler>;
|
|
11
|
+
[ServerlessRoutines.renderer]: ReturnType<typeof rendererHandler>;
|
|
12
|
+
[ServerlessRoutines.status]: ReturnType<typeof progressHandler<Provider>>;
|
|
13
|
+
[ServerlessRoutines.info]: ReturnType<typeof infoHandler<Provider>>;
|
|
14
|
+
[ServerlessRoutines.still]: ReturnType<typeof stillHandler>;
|
|
15
|
+
[ServerlessRoutines.compositions]: ReturnType<typeof compositionsHandler>;
|
|
17
16
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AwsRegion } from '../
|
|
1
|
+
import type { AwsRegion } from '../regions';
|
|
2
2
|
export declare function validateAwsRegion(region: unknown): asserts region is AwsRegion;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateAwsRegion = void 0;
|
|
4
|
-
const
|
|
4
|
+
const regions_1 = require("../regions");
|
|
5
5
|
function validateAwsRegion(region) {
|
|
6
|
-
if (!
|
|
7
|
-
throw new TypeError(`${region} is not a valid AWS region. Must be one of: ${
|
|
6
|
+
if (!regions_1.AWS_REGIONS.includes(region)) {
|
|
7
|
+
throw new TypeError(`${region} is not a valid AWS region. Must be one of: ${regions_1.AWS_REGIONS.join(', ')}`);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.validateAwsRegion = validateAwsRegion;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { AwsRegion } from '../client';
|
|
2
|
-
export declare const validateBucketName: (bucketName: unknown, options: {
|
|
3
|
-
mustStartWithRemotion: boolean;
|
|
4
|
-
}) => void;
|
|
5
2
|
export declare const parseBucketName: (name: string) => {
|
|
6
3
|
region: AwsRegion | null;
|
|
7
4
|
};
|
|
8
|
-
export declare const makeBucketName: (region: AwsRegion) => string;
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parseBucketName = void 0;
|
|
4
|
+
const client_1 = require("@remotion/serverless/client");
|
|
4
5
|
const regions_1 = require("../regions");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
const random_hash_1 = require("./random-hash");
|
|
7
|
-
const validateBucketName = (bucketName, options) => {
|
|
8
|
-
if (typeof bucketName !== 'string') {
|
|
9
|
-
throw new TypeError(`'bucketName' must be a string, but is ${JSON.stringify(bucketName)}`);
|
|
10
|
-
}
|
|
11
|
-
if (options.mustStartWithRemotion &&
|
|
12
|
-
!bucketName.startsWith(constants_1.REMOTION_BUCKET_PREFIX)) {
|
|
13
|
-
throw new Error(`The bucketName parameter must start with ${constants_1.REMOTION_BUCKET_PREFIX}.`);
|
|
14
|
-
}
|
|
15
|
-
if (!bucketName.match(/^(?=^.{3,63}$)(?!^(\d+\.)+\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$)/)) {
|
|
16
|
-
throw new Error(`The bucket ${bucketName} `);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
exports.validateBucketName = validateBucketName;
|
|
20
6
|
const parseBucketName = (name) => {
|
|
21
|
-
const parsed = name.match(new RegExp(`^${
|
|
7
|
+
const parsed = name.match(new RegExp(`^${client_1.REMOTION_BUCKET_PREFIX}(.*)-([a-z0-9A-Z]+)$`));
|
|
22
8
|
const region = parsed === null || parsed === void 0 ? void 0 : parsed[1];
|
|
23
9
|
if (!region) {
|
|
24
10
|
return { region: null };
|
|
@@ -27,9 +13,3 @@ const parseBucketName = (name) => {
|
|
|
27
13
|
return { region: realRegionFound !== null && realRegionFound !== void 0 ? realRegionFound : null };
|
|
28
14
|
};
|
|
29
15
|
exports.parseBucketName = parseBucketName;
|
|
30
|
-
const makeBucketName = (region) => {
|
|
31
|
-
return `${constants_1.REMOTION_BUCKET_PREFIX}${region.replace(/-/g, '')}-${(0, random_hash_1.randomHash)({
|
|
32
|
-
randomInTests: false,
|
|
33
|
-
})}`;
|
|
34
|
-
};
|
|
35
|
-
exports.makeBucketName = makeBucketName;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export declare const validateLambdaCodec: (codec: unknown) => LambdaCodec;
|
|
4
|
-
export {};
|
|
1
|
+
import type { ServerlessCodec } from '@remotion/serverless/client';
|
|
2
|
+
export declare const validateLambdaCodec: (codec: unknown) => ServerlessCodec;
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateLambdaCodec = void 0;
|
|
4
|
-
const
|
|
5
|
-
'h264',
|
|
6
|
-
'h265',
|
|
7
|
-
'vp8',
|
|
8
|
-
'vp9',
|
|
9
|
-
'mp3',
|
|
10
|
-
'aac',
|
|
11
|
-
'wav',
|
|
12
|
-
'gif',
|
|
13
|
-
'prores',
|
|
14
|
-
];
|
|
4
|
+
const client_1 = require("@remotion/serverless/client");
|
|
15
5
|
const validateLambdaCodec = (codec) => {
|
|
16
6
|
if (typeof codec !== 'string') {
|
|
17
7
|
throw new TypeError('"codec" must be a string ');
|
|
18
8
|
}
|
|
19
|
-
if (!
|
|
9
|
+
if (!client_1.serverlessCodecs.includes(codec)) {
|
|
20
10
|
throw new TypeError("'" +
|
|
21
11
|
codec +
|
|
22
12
|
"' is not a valid codec for Lambda. The following values are supported: " +
|
|
23
|
-
|
|
13
|
+
client_1.serverlessCodecs.join(', '));
|
|
24
14
|
}
|
|
25
15
|
if (codec === 'h264-mkv') {
|
|
26
16
|
console.warn('The "h264-mkv" codec for renderMediaOnLambda() is deprecated - it\'s now just "h264".');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateOutname = void 0;
|
|
4
4
|
const pure_1 = require("@remotion/renderer/pure");
|
|
5
|
-
const
|
|
5
|
+
const client_1 = require("@remotion/serverless/client");
|
|
6
6
|
const validateS3Key = (s3Key) => {
|
|
7
7
|
if (typeof s3Key !== 'string') {
|
|
8
8
|
throw new TypeError('The S3 key must be a string. Passed an object of type ' + typeof s3Key);
|
|
@@ -20,7 +20,7 @@ const validateOutname = ({ outName, codec, audioCodecSetting, separateAudioTo, }
|
|
|
20
20
|
}
|
|
21
21
|
if (typeof outName !== 'string') {
|
|
22
22
|
validateS3Key(outName.key);
|
|
23
|
-
(0,
|
|
23
|
+
(0, client_1.validateBucketName)(outName.bucketName, { mustStartWithRemotion: false });
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
if (codec) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Privacy } from '
|
|
1
|
+
import type { Privacy } from '@remotion/serverless/client';
|
|
2
2
|
export declare function validatePrivacy(privacy: unknown, allowPrivate: boolean): asserts privacy is Privacy;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/lambda",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.188",
|
|
7
7
|
"description": "Render Remotion videos on AWS Lambda",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -22,11 +22,13 @@
|
|
|
22
22
|
"@aws-sdk/s3-request-presigner": "3.583.0",
|
|
23
23
|
"mime-types": "2.1.34",
|
|
24
24
|
"zod": "3.22.3",
|
|
25
|
-
"@remotion/
|
|
26
|
-
"@remotion/
|
|
27
|
-
"remotion": "4.0.
|
|
28
|
-
"@remotion/renderer": "4.0.
|
|
29
|
-
"@remotion/
|
|
25
|
+
"@remotion/cli": "4.0.188",
|
|
26
|
+
"@remotion/bundler": "4.0.188",
|
|
27
|
+
"@remotion/streaming": "4.0.188",
|
|
28
|
+
"@remotion/renderer": "4.0.188",
|
|
29
|
+
"@remotion/studio-server": "4.0.188",
|
|
30
|
+
"remotion": "4.0.188",
|
|
31
|
+
"@remotion/serverless": "4.0.188"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
34
|
"@types/mime-types": "2.1.1",
|
|
@@ -35,11 +37,11 @@
|
|
|
35
37
|
"pureimage": "0.4.13",
|
|
36
38
|
"vitest": "0.31.1",
|
|
37
39
|
"zip-lib": "^0.7.2",
|
|
38
|
-
"@remotion/
|
|
39
|
-
"@remotion/
|
|
40
|
+
"@remotion/bundler": "4.0.188",
|
|
41
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.188"
|
|
40
42
|
},
|
|
41
43
|
"peerDependencies": {
|
|
42
|
-
"@remotion/bundler": "4.0.
|
|
44
|
+
"@remotion/bundler": "4.0.188"
|
|
43
45
|
},
|
|
44
46
|
"publishConfig": {
|
|
45
47
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|