@remotion/lambda 3.3.76 → 3.3.78

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.
@@ -5,6 +5,7 @@ export declare type GetOrCreateBucketInput = {
5
5
  };
6
6
  export declare type GetOrCreateBucketOutput = {
7
7
  bucketName: string;
8
+ alreadyExisted: boolean;
8
9
  };
9
10
  /**
10
11
  * @description Creates a bucket for Remotion Lambda in your S3 account. If one already exists, it will get returned instead.
@@ -19,7 +19,7 @@ const getOrCreateBucket = async (options) => {
19
19
  }
20
20
  if (remotionBuckets.length === 1) {
21
21
  (_a = options.onBucketEnsured) === null || _a === void 0 ? void 0 : _a.call(options);
22
- return { bucketName: remotionBuckets[0].name };
22
+ return { bucketName: remotionBuckets[0].name, alreadyExisted: true };
23
23
  }
24
24
  const bucketName = (0, validate_bucketname_1.makeBucketName)(options.region);
25
25
  await (0, create_bucket_1.createBucket)({
@@ -27,6 +27,6 @@ const getOrCreateBucket = async (options) => {
27
27
  region: options.region,
28
28
  });
29
29
  (_b = options.onBucketEnsured) === null || _b === void 0 ? void 0 : _b.call(options);
30
- return { bucketName };
30
+ return { bucketName, alreadyExisted: false };
31
31
  };
32
32
  exports.getOrCreateBucket = getOrCreateBucket;
@@ -2,15 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.quotasIncreaseCommand = exports.INCREASE_SUBCOMMAND = void 0;
4
4
  const client_service_quotas_1 = require("@aws-sdk/client-service-quotas");
5
- const cli_1 = require("@remotion/cli");
6
5
  const process_1 = require("process");
7
6
  const _1 = require(".");
8
7
  const defaults_1 = require("../../../defaults");
9
8
  const aws_clients_1 = require("../../../shared/aws-clients");
9
+ const args_1 = require("../../args");
10
10
  const get_aws_region_1 = require("../../get-aws-region");
11
11
  const confirm_1 = require("../../helpers/confirm");
12
12
  const quit_1 = require("../../helpers/quit");
13
+ const log_1 = require("../../log");
13
14
  exports.INCREASE_SUBCOMMAND = 'increase';
15
+ const makeQuotaUrl = ({ region, quotaId, }) => {
16
+ return `https://${region}.console.aws.amazon.com/servicequotas/home/services/lambda/quotas/${quotaId}`;
17
+ };
14
18
  const quotasIncreaseCommand = async () => {
15
19
  var _a, _b, _c;
16
20
  const region = (0, get_aws_region_1.getAwsRegion)();
@@ -30,28 +34,44 @@ const quotasIncreaseCommand = async () => {
30
34
  ]);
31
35
  const openCase = (_a = changes.RequestedQuotas) === null || _a === void 0 ? void 0 : _a.find((r) => r.Status === 'CASE_OPENED');
32
36
  if (openCase) {
33
- cli_1.CliInternals.Log.warn(`A request to increase it to ${openCase.DesiredValue} is already pending:`);
34
- cli_1.CliInternals.Log.warn(`https://${region}.console.aws.amazon.com/support/home#/case/?displayId=${openCase.CaseId}`);
37
+ log_1.Log.warn(`A request to increase it to ${openCase.DesiredValue} is already pending:`);
38
+ log_1.Log.warn(`https://${region}.console.aws.amazon.com/support/home#/case/?displayId=${openCase.CaseId}`);
35
39
  (0, process_1.exit)(1);
36
40
  }
37
41
  const concurrencyCurrent = (_b = concurrencyLimit.Quota) === null || _b === void 0 ? void 0 : _b.Value;
38
42
  const defaultConcurrency = (_c = defaultConcurrencyLimit.Quota) === null || _c === void 0 ? void 0 : _c.Value;
39
43
  const increaseRecommended = concurrencyCurrent <= defaultConcurrency;
40
- if (!increaseRecommended) {
41
- cli_1.CliInternals.Log.info(`Current limit of ${concurrencyCurrent} is already increased over the default (${defaultConcurrency}). Increase it further via the AWS console.`);
44
+ if (!increaseRecommended && !args_1.forceFlagProvided) {
45
+ log_1.Log.error(`Current limit of ${concurrencyCurrent} is already increased over the default (${defaultConcurrency}).`);
46
+ log_1.Log.info('You can force the increase with the --force flag.');
47
+ log_1.Log.info('You are more likely to get an increase if you attach a reason. Go so by going to the AWS console:');
48
+ log_1.Log.info(makeQuotaUrl({ quotaId: defaults_1.LAMBDA_CONCURRENCY_LIMIT_QUOTA, region }));
42
49
  (0, quit_1.quit)(1);
43
50
  }
44
51
  const newLimit = Math.floor(concurrencyCurrent / 5000) * 5000 + 5000;
45
- cli_1.CliInternals.Log.info(`Sending request to AWS to increase concurrency limit from ${concurrencyCurrent} to ${newLimit}.`);
52
+ log_1.Log.info(`Sending request to AWS to increase concurrency limit from ${concurrencyCurrent} to ${newLimit}.`);
46
53
  await (0, confirm_1.confirmCli)({
47
54
  allowForceFlag: true,
48
55
  delMessage: 'Send? (Y/n)',
49
56
  });
50
- await (0, aws_clients_1.getServiceQuotasClient)(region).send(new client_service_quotas_1.RequestServiceQuotaIncreaseCommand({
51
- QuotaCode: defaults_1.LAMBDA_CONCURRENCY_LIMIT_QUOTA,
52
- DesiredValue: newLimit,
53
- ServiceCode: 'lambda',
54
- }));
55
- cli_1.CliInternals.Log.info(`Requested increase successfully. Run "${defaults_1.BINARY_NAME} ${_1.QUOTAS_COMMAND}" to check whether your request was approved.`);
57
+ try {
58
+ await (0, aws_clients_1.getServiceQuotasClient)(region).send(new client_service_quotas_1.RequestServiceQuotaIncreaseCommand({
59
+ QuotaCode: defaults_1.LAMBDA_CONCURRENCY_LIMIT_QUOTA,
60
+ DesiredValue: newLimit,
61
+ ServiceCode: 'lambda',
62
+ }));
63
+ }
64
+ catch (err) {
65
+ if (err.name === 'DependencyAccessDeniedException') {
66
+ log_1.Log.error('Could not request increase because this is a sub-account of another AWS account.');
67
+ log_1.Log.error(`Please go to ${makeQuotaUrl({
68
+ quotaId: defaults_1.LAMBDA_CONCURRENCY_LIMIT_QUOTA,
69
+ region,
70
+ })} to request the increase via the AWS console.`);
71
+ return;
72
+ }
73
+ throw err;
74
+ }
75
+ log_1.Log.info(`Requested increase successfully. Run "${defaults_1.BINARY_NAME} ${_1.QUOTAS_COMMAND}" to check whether your request was approved.`);
56
76
  };
57
77
  exports.quotasIncreaseCommand = quotasIncreaseCommand;
@@ -3,5 +3,8 @@ export declare const planFrameRanges: ({ framesPerLambda, frameRange, everyNthFr
3
3
  frameRange: [number, number];
4
4
  everyNthFrame: number;
5
5
  }) => {
6
- chunks: [number, number][];
6
+ chunks: [
7
+ number,
8
+ number
9
+ ][];
7
10
  };
@@ -1 +1 @@
1
- export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-south-1" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "af-south-1" | "ap-south-1" | "ap-east-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "me-south-1" | "sa-east-1";
1
+ export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "sa-east-1" | "eu-south-1" | "af-south-1" | "ap-east-1" | "me-south-1";
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import http from 'http';
4
2
  import https from 'https';
5
3
  import type { EnhancedErrorInfo } from '../functions/helpers/write-lambda-error';
@@ -7,8 +7,9 @@ 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);
9
9
  }
10
- if (!s3Key.match(/^([0-9a-zA-Z-!_.*'()/]+)$/g)) {
11
- throw new Error("The S3 Key must match the RegExp `/([0-9a-zA-Z-!_.*'()/]+)/g`. You passed: " +
10
+ // https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
11
+ if (!s3Key.match(/^([0-9a-zA-Z-!_.*'()/:&$@=;+,?]+)/g)) {
12
+ throw new Error("The S3 Key must match the RegExp `/^([0-9a-zA-Z-!_.*'()/:&$@=;+,?]+)/g`. You passed: " +
12
13
  s3Key +
13
14
  '. Check for invalid characters.');
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "3.3.76",
3
+ "version": "3.3.78",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -23,18 +23,18 @@
23
23
  "@aws-sdk/credential-providers": "3.272.0",
24
24
  "@aws-sdk/lib-storage": "3.272.0",
25
25
  "@aws-sdk/s3-request-presigner": "3.272.0",
26
- "@remotion/bundler": "3.3.76",
27
- "@remotion/cli": "3.3.76",
28
- "@remotion/renderer": "3.3.76",
26
+ "@remotion/bundler": "3.3.78",
27
+ "@remotion/cli": "3.3.78",
28
+ "@remotion/renderer": "3.3.78",
29
29
  "aws-policies": "^1.0.1",
30
30
  "mime-types": "2.1.34",
31
- "remotion": "3.3.76"
31
+ "remotion": "3.3.78"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@jonny/eslint-config": "3.0.266",
35
- "@remotion/bundler": "3.3.76",
36
- "@remotion/compositor-linux-arm64-musl": "3.3.76",
37
- "@remotion/compositor-linux-x64-musl": "3.3.76",
35
+ "@remotion/bundler": "3.3.78",
36
+ "@remotion/compositor-linux-arm64-musl": "3.3.78",
37
+ "@remotion/compositor-linux-x64-musl": "3.3.78",
38
38
  "@types/mime-types": "2.1.1",
39
39
  "@types/minimist": "1.2.2",
40
40
  "@types/node": "^14.14.14",
@@ -48,7 +48,7 @@
48
48
  "zip-lib": "^0.7.2"
49
49
  },
50
50
  "peerDependencies": {
51
- "@remotion/bundler": "3.3.76"
51
+ "@remotion/bundler": "3.3.78"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
Binary file
Binary file