@remotion/lambda 4.0.260 → 4.0.261
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 +7 -4
- 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,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCredentials = void 0;
|
|
4
|
-
const credential_providers_1 = require("@aws-sdk/credential-providers");
|
|
5
|
-
const get_env_variable_1 = require("./get-env-variable");
|
|
6
|
-
const is_in_lambda_1 = require("./is-in-lambda");
|
|
7
|
-
const getCredentials = () => {
|
|
8
|
-
if ((0, is_in_lambda_1.isInsideLambda)()) {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE')) {
|
|
12
|
-
return (0, credential_providers_1.fromIni)({
|
|
13
|
-
profile: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE'),
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID') &&
|
|
17
|
-
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY') &&
|
|
18
|
-
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SESSION_TOKEN')) {
|
|
19
|
-
return {
|
|
20
|
-
accessKeyId: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID'),
|
|
21
|
-
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY'),
|
|
22
|
-
sessionToken: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SESSION_TOKEN'),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID') &&
|
|
26
|
-
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY')) {
|
|
27
|
-
return {
|
|
28
|
-
accessKeyId: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID'),
|
|
29
|
-
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY'),
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
if ((0, get_env_variable_1.getEnvVariable)('AWS_PROFILE')) {
|
|
33
|
-
return (0, credential_providers_1.fromIni)({
|
|
34
|
-
profile: (0, get_env_variable_1.getEnvVariable)('AWS_PROFILE'),
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
if ((0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
|
|
38
|
-
(0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY') &&
|
|
39
|
-
(0, get_env_variable_1.getEnvVariable)('AWS_SESSION_TOKEN')) {
|
|
40
|
-
return {
|
|
41
|
-
accessKeyId: (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID'),
|
|
42
|
-
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY'),
|
|
43
|
-
sessionToken: (0, get_env_variable_1.getEnvVariable)('AWS_SESSION_TOKEN'),
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
if ((0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
|
|
47
|
-
(0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY')) {
|
|
48
|
-
return {
|
|
49
|
-
accessKeyId: (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID'),
|
|
50
|
-
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY'),
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
return undefined;
|
|
54
|
-
};
|
|
55
|
-
exports.getCredentials = getCredentials;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getEnvVariable: (name: string) => string | undefined;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEnvVariable = void 0;
|
|
4
|
-
const getEnvVariable = (name) => {
|
|
5
|
-
if (typeof process !== 'undefined' &&
|
|
6
|
-
typeof process.env !== 'undefined' &&
|
|
7
|
-
process.env[name]) {
|
|
8
|
-
return process.env[name];
|
|
9
|
-
}
|
|
10
|
-
if (typeof Deno !== 'undefined' && Deno.env.has(name)) {
|
|
11
|
-
return Deno.env.get(name);
|
|
12
|
-
}
|
|
13
|
-
return undefined;
|
|
14
|
-
};
|
|
15
|
-
exports.getEnvVariable = getEnvVariable;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
-
import type { AwsRegion } from '../regions';
|
|
3
|
-
export declare const getFunctionVersion: ({ functionName, region, logLevel, }: {
|
|
4
|
-
functionName: string;
|
|
5
|
-
region: AwsRegion;
|
|
6
|
-
logLevel: LogLevel;
|
|
7
|
-
}) => Promise<string>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFunctionVersion = void 0;
|
|
4
|
-
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
6
|
-
const getFunctionVersion = async ({ functionName, region, logLevel, }) => {
|
|
7
|
-
try {
|
|
8
|
-
const result = await aws_implementation_1.awsImplementation.callFunctionSync({
|
|
9
|
-
functionName,
|
|
10
|
-
payload: {
|
|
11
|
-
logLevel,
|
|
12
|
-
type: client_1.ServerlessRoutines.info,
|
|
13
|
-
},
|
|
14
|
-
region,
|
|
15
|
-
type: client_1.ServerlessRoutines.info,
|
|
16
|
-
timeoutInTest: 120000,
|
|
17
|
-
});
|
|
18
|
-
return result.version;
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
// Prerelease versions had no info command
|
|
22
|
-
if (err.message.includes(client_1.COMMAND_NOT_FOUND)) {
|
|
23
|
-
return 'n/a';
|
|
24
|
-
}
|
|
25
|
-
// Bug in certain version of AWS S3 kit
|
|
26
|
-
if (err.message.includes('AWS CRT binary not present ')) {
|
|
27
|
-
return 'n/a';
|
|
28
|
-
}
|
|
29
|
-
throw err;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
exports.getFunctionVersion = getFunctionVersion;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { S3Client } from '@aws-sdk/client-s3';
|
|
2
|
-
import type { CustomCredentials } from '../client';
|
|
3
|
-
import type { AwsProvider } from '../functions/aws-implementation';
|
|
4
|
-
import type { AwsRegion } from '../regions';
|
|
5
|
-
export declare const getS3Client: ({ region, customCredentials, forcePathStyle, }: {
|
|
6
|
-
region: AwsRegion;
|
|
7
|
-
customCredentials: CustomCredentials<AwsProvider> | null;
|
|
8
|
-
forcePathStyle: boolean;
|
|
9
|
-
}) => S3Client;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getS3Client = void 0;
|
|
4
|
-
const get_service_client_1 = require("./get-service-client");
|
|
5
|
-
const getS3Client = ({ region, customCredentials, forcePathStyle, }) => {
|
|
6
|
-
var _a;
|
|
7
|
-
return (0, get_service_client_1.getServiceClient)({
|
|
8
|
-
region: (_a = customCredentials === null || customCredentials === void 0 ? void 0 : customCredentials.region) !== null && _a !== void 0 ? _a : region,
|
|
9
|
-
service: 's3',
|
|
10
|
-
customCredentials,
|
|
11
|
-
forcePathStyle,
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
exports.getS3Client = getS3Client;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs';
|
|
2
|
-
import { IAMClient } from '@aws-sdk/client-iam';
|
|
3
|
-
import { LambdaClient } from '@aws-sdk/client-lambda';
|
|
4
|
-
import { S3Client } from '@aws-sdk/client-s3';
|
|
5
|
-
import { ServiceQuotasClient } from '@aws-sdk/client-service-quotas';
|
|
6
|
-
import { STSClient } from '@aws-sdk/client-sts';
|
|
7
|
-
import type { CustomCredentials } from '../client';
|
|
8
|
-
import type { AwsProvider } from '../functions/aws-implementation';
|
|
9
|
-
import type { AwsRegion } from '../regions';
|
|
10
|
-
export type ServiceMapping = {
|
|
11
|
-
s3: S3Client;
|
|
12
|
-
cloudwatch: CloudWatchLogsClient;
|
|
13
|
-
iam: IAMClient;
|
|
14
|
-
lambda: LambdaClient;
|
|
15
|
-
servicequotas: ServiceQuotasClient;
|
|
16
|
-
sts: STSClient;
|
|
17
|
-
};
|
|
18
|
-
export declare const getServiceClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, forcePathStyle, }: {
|
|
19
|
-
region: AwsRegion;
|
|
20
|
-
service: T;
|
|
21
|
-
customCredentials: CustomCredentials<AwsProvider> | null;
|
|
22
|
-
forcePathStyle: boolean;
|
|
23
|
-
}) => ServiceMapping[T];
|
|
@@ -1,121 +0,0 @@
|
|
|
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 client_1 = require("@remotion/serverless/client");
|
|
11
|
-
const no_react_1 = require("remotion/no-react");
|
|
12
|
-
const check_credentials_1 = require("./check-credentials");
|
|
13
|
-
const get_credentials_1 = require("./get-credentials");
|
|
14
|
-
const get_env_variable_1 = require("./get-env-variable");
|
|
15
|
-
const getCredentialsHash = ({ customCredentials, region, service, forcePathStyle, }) => {
|
|
16
|
-
const hashComponents = {};
|
|
17
|
-
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')) {
|
|
18
|
-
hashComponents.credentials = {
|
|
19
|
-
credentialsSkipped: true,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
else if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE')) {
|
|
23
|
-
hashComponents.credentials = {
|
|
24
|
-
awsProfile: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE'),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
else if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID') &&
|
|
28
|
-
(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY')) {
|
|
29
|
-
hashComponents.credentials = {
|
|
30
|
-
accessKeyId: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID'),
|
|
31
|
-
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY'),
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
else if ((0, get_env_variable_1.getEnvVariable)('AWS_PROFILE')) {
|
|
35
|
-
hashComponents.credentials = {
|
|
36
|
-
awsProfile: (0, get_env_variable_1.getEnvVariable)('AWS_PROFILE'),
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
else if ((0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
|
|
40
|
-
(0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY')) {
|
|
41
|
-
hashComponents.credentials = {
|
|
42
|
-
accessKeyId: (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID'),
|
|
43
|
-
secretAccessKey: (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY'),
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
hashComponents.customCredentials = customCredentials;
|
|
47
|
-
hashComponents.region = region;
|
|
48
|
-
hashComponents.service = service;
|
|
49
|
-
hashComponents.forcePathStyle = forcePathStyle;
|
|
50
|
-
return (0, no_react_1.random)(JSON.stringify(hashComponents)).toString().replace('0.', '');
|
|
51
|
-
};
|
|
52
|
-
const _clients = {};
|
|
53
|
-
const getServiceClient = ({ region, service, customCredentials, forcePathStyle, }) => {
|
|
54
|
-
var _a;
|
|
55
|
-
const Client = (() => {
|
|
56
|
-
if (service === 'cloudwatch') {
|
|
57
|
-
return client_cloudwatch_logs_1.CloudWatchLogsClient;
|
|
58
|
-
}
|
|
59
|
-
if (service === 'lambda') {
|
|
60
|
-
return client_lambda_1.LambdaClient;
|
|
61
|
-
}
|
|
62
|
-
if (service === 's3') {
|
|
63
|
-
return client_s3_1.S3Client;
|
|
64
|
-
}
|
|
65
|
-
if (service === 'iam') {
|
|
66
|
-
return client_iam_1.IAMClient;
|
|
67
|
-
}
|
|
68
|
-
if (service === 'servicequotas') {
|
|
69
|
-
return client_service_quotas_1.ServiceQuotasClient;
|
|
70
|
-
}
|
|
71
|
-
if (service === 'sts') {
|
|
72
|
-
return client_sts_1.STSClient;
|
|
73
|
-
}
|
|
74
|
-
throw new TypeError('unknown client ' + service);
|
|
75
|
-
})();
|
|
76
|
-
const key = getCredentialsHash({
|
|
77
|
-
region,
|
|
78
|
-
customCredentials,
|
|
79
|
-
service,
|
|
80
|
-
forcePathStyle,
|
|
81
|
-
});
|
|
82
|
-
if (!_clients[key]) {
|
|
83
|
-
(0, check_credentials_1.checkCredentials)();
|
|
84
|
-
const lambdaOptions = service === 'lambda'
|
|
85
|
-
? {
|
|
86
|
-
httpsAgent: {
|
|
87
|
-
maxSockets: client_1.MAX_FUNCTIONS_PER_RENDER * 2,
|
|
88
|
-
},
|
|
89
|
-
}
|
|
90
|
-
: undefined;
|
|
91
|
-
const client = customCredentials
|
|
92
|
-
? new Client({
|
|
93
|
-
region: (_a = customCredentials.region) !== null && _a !== void 0 ? _a : 'us-east-1',
|
|
94
|
-
credentials: customCredentials.accessKeyId && customCredentials.secretAccessKey
|
|
95
|
-
? {
|
|
96
|
-
accessKeyId: customCredentials.accessKeyId,
|
|
97
|
-
secretAccessKey: customCredentials.secretAccessKey,
|
|
98
|
-
}
|
|
99
|
-
: undefined,
|
|
100
|
-
endpoint: customCredentials.endpoint,
|
|
101
|
-
requestHandler: lambdaOptions,
|
|
102
|
-
forcePathStyle: customCredentials.forcePathStyle,
|
|
103
|
-
})
|
|
104
|
-
: (0, get_env_variable_1.getEnvVariable)('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')
|
|
105
|
-
? new Client({
|
|
106
|
-
region,
|
|
107
|
-
requestHandler: lambdaOptions,
|
|
108
|
-
})
|
|
109
|
-
: new Client({
|
|
110
|
-
region,
|
|
111
|
-
credentials: (0, get_credentials_1.getCredentials)(),
|
|
112
|
-
requestHandler: lambdaOptions,
|
|
113
|
-
});
|
|
114
|
-
if ((0, get_env_variable_1.getEnvVariable)('REMOTION_DISABLE_AWS_CLIENT_CACHE')) {
|
|
115
|
-
return client;
|
|
116
|
-
}
|
|
117
|
-
_clients[key] = client;
|
|
118
|
-
}
|
|
119
|
-
return _clients[key];
|
|
120
|
-
};
|
|
121
|
-
exports.getServiceClient = getServiceClient;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isFlakyError: (err: Error) => boolean;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFlakyError = void 0;
|
|
4
|
-
const isFlakyError = (err) => {
|
|
5
|
-
var _a;
|
|
6
|
-
const message = (_a = err.stack) !== null && _a !== void 0 ? _a : '';
|
|
7
|
-
// storage.googleapis.com sometimes returns 500s, and Video does not have retry on its own
|
|
8
|
-
if ((message.includes('Format error') || message.includes('audio metadata')) &&
|
|
9
|
-
message.includes('storage.googleapis.com')) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
if (message.includes('FATAL:zygote_communication_linux.cc')) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
if (message.includes('error while loading shared libraries: libnss3.so')) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
if (message.includes('but the server sent no data')) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
if (message.includes('Compositor panicked')) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
// S3 in rare occasions
|
|
25
|
-
if (message.includes('We encountered an internal error.')) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
if (message.includes('Compositor exited') && !message.includes('SIGSEGV')) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
if (message.includes('Timed out while setting up the headless browser')) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
// https://github.com/remotion-dev/remotion/issues/2742
|
|
35
|
-
if (message.includes('while trying to connect to the browser')) {
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
// https://discord.com/channels/809501355504959528/1131234931863998665/1131998442219118622
|
|
39
|
-
if (message.includes('RequestTimeout: Your socket connection to the server')) {
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
if (message.includes('waiting for the page to render the React component')) {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
// In puppeteer-evaluate.ts
|
|
46
|
-
if (message.includes('Timed out evaluating page function')) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
if (message.includes('Timeout exceeded rendering the component')) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
// CDN slowness
|
|
53
|
-
if (message.includes('Loading root component')) {
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
// Internet flakiness
|
|
57
|
-
if (message.includes('getaddrinfo') ||
|
|
58
|
-
message.includes('ECONNRESET') ||
|
|
59
|
-
message.includes('ERR_CONNECTION_TIMED_OUT') ||
|
|
60
|
-
message.includes('ERR_NETWORK_CHANGED') ||
|
|
61
|
-
message.includes('A network error occurred') ||
|
|
62
|
-
message.includes('socket hang up')) {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
if (message.includes('Target closed') || message.includes('Session closed')) {
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
if (message.includes('SIGKILL')) {
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
// ServiceException: We currently do not have sufficient capacity in the region you requested. Our system will be working on provisioning additional capacity. You can avoid getting this error by temporarily reducing your request rate.
|
|
72
|
-
if (message.includes('ServiceException: We currently do not have sufficient capacity in the region you requested')) {
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
return false;
|
|
76
|
-
};
|
|
77
|
-
exports.isFlakyError = isFlakyError;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isInsideLambda: () => boolean;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isInsideLambda = void 0;
|
|
4
|
-
const isInsideLambda = () => {
|
|
5
|
-
var _a;
|
|
6
|
-
return Boolean(typeof process !== 'undefined' &&
|
|
7
|
-
((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.__RESERVED_IS_INSIDE_REMOTION_LAMBDA));
|
|
8
|
-
};
|
|
9
|
-
exports.isInsideLambda = isInsideLambda;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isLikelyToHaveAwsProfile: () => boolean;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isLikelyToHaveAwsProfile = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const os_1 = require("os");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
const get_env_variable_1 = require("./get-env-variable");
|
|
8
|
-
const homeDirCache = {};
|
|
9
|
-
const getHomeDirCacheKey = () => {
|
|
10
|
-
// geteuid is only available on POSIX platforms (i.e. not Windows or Android).
|
|
11
|
-
if (process && process.geteuid) {
|
|
12
|
-
return `${process.geteuid()}`;
|
|
13
|
-
}
|
|
14
|
-
return 'DEFAULT';
|
|
15
|
-
};
|
|
16
|
-
const getHomeDir = () => {
|
|
17
|
-
const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env;
|
|
18
|
-
if (HOME)
|
|
19
|
-
return HOME;
|
|
20
|
-
if (USERPROFILE)
|
|
21
|
-
return USERPROFILE;
|
|
22
|
-
if (HOMEPATH)
|
|
23
|
-
return `${HOMEDRIVE}${HOMEPATH}`;
|
|
24
|
-
const homeDirCacheKey = getHomeDirCacheKey();
|
|
25
|
-
if (!homeDirCache[homeDirCacheKey])
|
|
26
|
-
homeDirCache[homeDirCacheKey] = (0, os_1.homedir)();
|
|
27
|
-
return homeDirCache[homeDirCacheKey];
|
|
28
|
-
};
|
|
29
|
-
const ENV_CREDENTIALS_PATH = 'AWS_SHARED_CREDENTIALS_FILE';
|
|
30
|
-
// Logic is inline to https://github.com/smithy-lang/smithy-typescript/blob/main/packages/shared-ini-file-loader/src/getCredentialsFilepath.ts#L7
|
|
31
|
-
const pathOfCredentialsFile = () => {
|
|
32
|
-
return ((0, get_env_variable_1.getEnvVariable)(ENV_CREDENTIALS_PATH) ||
|
|
33
|
-
(0, path_1.join)(getHomeDir(), '.aws', 'credentials'));
|
|
34
|
-
};
|
|
35
|
-
const isLikelyToHaveAwsProfile = () => {
|
|
36
|
-
// Supabase uses Deno and does not support readFile
|
|
37
|
-
// https://github.com/remotion-dev/remotion/issues/4844
|
|
38
|
-
if (typeof Deno !== 'undefined') {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
const credentialsFile = pathOfCredentialsFile();
|
|
42
|
-
try {
|
|
43
|
-
const content = (0, fs_1.readFileSync)(credentialsFile, 'utf-8');
|
|
44
|
-
return content.includes('[default]');
|
|
45
|
-
}
|
|
46
|
-
catch (_a) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
exports.isLikelyToHaveAwsProfile = isLikelyToHaveAwsProfile;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const LAMBDA_VERSION_STRING: string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LAMBDA_VERSION_STRING = void 0;
|
|
4
|
-
const version_1 = require("remotion/version");
|
|
5
|
-
exports.LAMBDA_VERSION_STRING = version_1.VERSION.replace(/\./g, '-')
|
|
6
|
-
.replace(/\+/g, '-')
|
|
7
|
-
.substring(0, 10);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CustomCredentials } from '@remotion/serverless/client';
|
|
2
|
-
import type { AwsProvider } from '../functions/aws-implementation';
|
|
3
|
-
import type { AwsRegion } from '../regions';
|
|
4
|
-
export declare const applyLifeCyleOperation: ({ enableFolderExpiry, bucketName, region, customCredentials, forcePathStyle, }: {
|
|
5
|
-
enableFolderExpiry: boolean | null;
|
|
6
|
-
bucketName: string;
|
|
7
|
-
region: AwsRegion;
|
|
8
|
-
customCredentials: CustomCredentials<AwsProvider> | null;
|
|
9
|
-
forcePathStyle: boolean;
|
|
10
|
-
}) => Promise<void>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyLifeCyleOperation = void 0;
|
|
4
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
5
|
-
const apply_lifecyle_1 = require("../functions/helpers/apply-lifecyle");
|
|
6
|
-
const lifecycle_1 = require("../functions/helpers/lifecycle");
|
|
7
|
-
const get_s3_client_1 = require("./get-s3-client");
|
|
8
|
-
const createLCRules = async ({ bucketName, region, customCredentials, forcePathStyle, }) => {
|
|
9
|
-
var _a;
|
|
10
|
-
const lcRules = (0, lifecycle_1.getLifeCycleRules)();
|
|
11
|
-
// create the lifecyle rules
|
|
12
|
-
const createCommandInput = (0, apply_lifecyle_1.createLifeCycleInput)({
|
|
13
|
-
bucketName,
|
|
14
|
-
lcRules,
|
|
15
|
-
});
|
|
16
|
-
const createCommand = new client_s3_1.PutBucketLifecycleConfigurationCommand(createCommandInput);
|
|
17
|
-
try {
|
|
18
|
-
await (0, get_s3_client_1.getS3Client)({ region, customCredentials, forcePathStyle }).send(createCommand);
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('AccessDenied')) {
|
|
22
|
-
throw new Error(`You don't have the required permissions to create lifecycle rules on the bucket "${bucketName}", but the "enableFolderExpiry" was set to true. Ensure that your user has the "s3:PutLifecycleConfiguration" permission.`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const deleteLCRules = async ({ bucketName, region, customCredentials, forcePathStyle, }) => {
|
|
27
|
-
var _a;
|
|
28
|
-
const deleteCommandInput = (0, apply_lifecyle_1.deleteLifeCycleInput)({
|
|
29
|
-
bucketName,
|
|
30
|
-
});
|
|
31
|
-
try {
|
|
32
|
-
await (0, get_s3_client_1.getS3Client)({ region, customCredentials, forcePathStyle }).send(new client_s3_1.DeleteBucketLifecycleCommand(deleteCommandInput));
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('AccessDenied')) {
|
|
36
|
-
throw new Error(`You don't have the required permissions to delete lifecycle rules on the bucket "${bucketName}", but the "enableFolderExpiry" option was set to "false". Ensure that your user has the "s3:PutLifecycleConfiguration" permission. Set "enableFolderExpiry" to "null" to not overwrite any existing lifecycle rules.`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const applyLifeCyleOperation = async ({ enableFolderExpiry, bucketName, region, customCredentials, forcePathStyle, }) => {
|
|
41
|
-
if (enableFolderExpiry === null) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (enableFolderExpiry === true) {
|
|
45
|
-
await createLCRules({
|
|
46
|
-
bucketName,
|
|
47
|
-
region,
|
|
48
|
-
customCredentials,
|
|
49
|
-
forcePathStyle,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
await deleteLCRules({
|
|
54
|
-
bucketName,
|
|
55
|
-
region,
|
|
56
|
-
customCredentials,
|
|
57
|
-
forcePathStyle,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
exports.applyLifeCyleOperation = applyLifeCyleOperation;
|
|
@@ -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/shared/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/shared/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 +0,0 @@
|
|
|
1
|
-
export declare const randomHashImplementation: () => string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.randomHashImplementation = void 0;
|
|
4
|
-
const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
5
|
-
const randomHashImplementation = () => {
|
|
6
|
-
return new Array(10)
|
|
7
|
-
.fill(1)
|
|
8
|
-
.map(() => {
|
|
9
|
-
return alphabet[Math.floor(Math.random() * alphabet.length)];
|
|
10
|
-
})
|
|
11
|
-
.join('');
|
|
12
|
-
};
|
|
13
|
-
exports.randomHashImplementation = randomHashImplementation;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateAwsRegion = validateAwsRegion;
|
|
4
|
-
const regions_1 = require("../regions");
|
|
5
|
-
function validateAwsRegion(region) {
|
|
6
|
-
if (!regions_1.AWS_REGIONS.includes(region)) {
|
|
7
|
-
throw new TypeError(`${region} is not a supported AWS region. Must be one of: ${regions_1.AWS_REGIONS.join(', ')}`);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseBucketName = void 0;
|
|
4
|
-
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const regions_1 = require("../regions");
|
|
6
|
-
const parseBucketName = (name) => {
|
|
7
|
-
const parsed = name.match(new RegExp(`^${client_1.REMOTION_BUCKET_PREFIX}(.*)-([a-z0-9A-Z]+)$`));
|
|
8
|
-
const region = parsed === null || parsed === void 0 ? void 0 : parsed[1];
|
|
9
|
-
if (!region) {
|
|
10
|
-
return { region: null };
|
|
11
|
-
}
|
|
12
|
-
const realRegionFound = regions_1.AWS_REGIONS.find((r) => r.replace(/-/g, '') === region);
|
|
13
|
-
return { region: realRegionFound !== null && realRegionFound !== void 0 ? realRegionFound : null };
|
|
14
|
-
};
|
|
15
|
-
exports.parseBucketName = parseBucketName;
|