@remotion/lambda 4.0.256 → 4.0.258

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.
Files changed (134) hide show
  1. package/dist/cli/get-aws-region.js +2 -1
  2. package/dist/cli/index.js +5 -4
  3. package/dist/shared/check-credentials.js +7 -6
  4. package/dist/shared/get-credentials.js +25 -23
  5. package/dist/shared/get-env-variable.d.ts +1 -0
  6. package/dist/shared/get-env-variable.js +15 -0
  7. package/dist/shared/get-service-client.js +16 -15
  8. package/dist/shared/is-likely-to-have-aws-profile.js +7 -1
  9. package/package.json +21 -21
  10. package/remotionlambda-arm64.zip +0 -0
  11. package/dist/api/__mocks__/clean-items.d.ts +0 -2
  12. package/dist/api/__mocks__/clean-items.js +0 -24
  13. package/dist/api/__mocks__/create-function.d.ts +0 -2
  14. package/dist/api/__mocks__/create-function.js +0 -21
  15. package/dist/api/__mocks__/delete-function.d.ts +0 -2
  16. package/dist/api/__mocks__/delete-function.js +0 -9
  17. package/dist/api/__mocks__/get-functions.d.ts +0 -2
  18. package/dist/api/__mocks__/get-functions.js +0 -9
  19. package/dist/api/__mocks__/upload-dir.d.ts +0 -3
  20. package/dist/api/__mocks__/upload-dir.js +0 -47
  21. package/dist/api/mock-functions.d.ts +0 -18
  22. package/dist/api/mock-functions.js +0 -36
  23. package/dist/cli/helpers/__mocks__/quit.d.ts +0 -1
  24. package/dist/cli/helpers/__mocks__/quit.js +0 -7
  25. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +0 -7
  26. package/dist/functions/chunk-optimization/plan-frame-ranges.js +0 -17
  27. package/dist/functions/chunk-optimization/types.d.ts +0 -8
  28. package/dist/functions/chunk-optimization/types.js +0 -2
  29. package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +0 -3
  30. package/dist/functions/helpers/__mocks__/get-browser-instance.js +0 -12
  31. package/dist/functions/helpers/__mocks__/leak-detection.d.ts +0 -4
  32. package/dist/functions/helpers/__mocks__/leak-detection.js +0 -9
  33. package/dist/functions/helpers/__mocks__/timer.d.ts +0 -2
  34. package/dist/functions/helpers/__mocks__/timer.js +0 -10
  35. package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -1
  36. package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -17
  37. package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -5
  38. package/dist/functions/helpers/calculate-chunk-times.js +0 -29
  39. package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -15
  40. package/dist/functions/helpers/calculate-price-from-bucket.js +0 -30
  41. package/dist/functions/helpers/can-concat-seamlessly.d.ts +0 -3
  42. package/dist/functions/helpers/can-concat-seamlessly.js +0 -17
  43. package/dist/functions/helpers/cleanup-props.d.ts +0 -8
  44. package/dist/functions/helpers/cleanup-props.js +0 -23
  45. package/dist/functions/helpers/concat-videos.d.ts +0 -23
  46. package/dist/functions/helpers/concat-videos.js +0 -54
  47. package/dist/functions/helpers/create-post-render-data.d.ts +0 -17
  48. package/dist/functions/helpers/create-post-render-data.js +0 -67
  49. package/dist/functions/helpers/find-output-file-in-bucket.d.ts +0 -14
  50. package/dist/functions/helpers/find-output-file-in-bucket.js +0 -38
  51. package/dist/functions/helpers/format-costs-info.d.ts +0 -2
  52. package/dist/functions/helpers/format-costs-info.js +0 -23
  53. package/dist/functions/helpers/get-overall-progress-s3.d.ts +0 -10
  54. package/dist/functions/helpers/get-overall-progress-s3.js +0 -24
  55. package/dist/functions/helpers/get-overall-progress.d.ts +0 -9
  56. package/dist/functions/helpers/get-overall-progress.js +0 -23
  57. package/dist/functions/helpers/get-progress.d.ts +0 -15
  58. package/dist/functions/helpers/get-progress.js +0 -254
  59. package/dist/functions/helpers/get-retry-stats.d.ts +0 -5
  60. package/dist/functions/helpers/get-retry-stats.js +0 -2
  61. package/dist/functions/helpers/inspect-errors.d.ts +0 -4
  62. package/dist/functions/helpers/inspect-errors.js +0 -39
  63. package/dist/functions/helpers/is-warm.d.ts +0 -2
  64. package/dist/functions/helpers/is-warm.js +0 -10
  65. package/dist/functions/helpers/leak-detection.d.ts +0 -4
  66. package/dist/functions/helpers/leak-detection.js +0 -40
  67. package/dist/functions/helpers/make-timeout-error.d.ts +0 -10
  68. package/dist/functions/helpers/make-timeout-error.js +0 -31
  69. package/dist/functions/helpers/make-timeout-message.d.ts +0 -10
  70. package/dist/functions/helpers/make-timeout-message.js +0 -75
  71. package/dist/functions/helpers/merge-chunks.d.ts +0 -36
  72. package/dist/functions/helpers/merge-chunks.js +0 -84
  73. package/dist/functions/helpers/min-max.d.ts +0 -2
  74. package/dist/functions/helpers/min-max.js +0 -33
  75. package/dist/functions/helpers/on-downloads-logger.d.ts +0 -2
  76. package/dist/functions/helpers/on-downloads-logger.js +0 -29
  77. package/dist/functions/helpers/overall-render-progress.d.ts +0 -59
  78. package/dist/functions/helpers/overall-render-progress.js +0 -180
  79. package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -1
  80. package/dist/functions/helpers/print-concurrency-curve.js +0 -8
  81. package/dist/functions/helpers/print-logging-helper.d.ts +0 -4
  82. package/dist/functions/helpers/print-logging-helper.js +0 -12
  83. package/dist/functions/helpers/render-has-audio-video.d.ts +0 -6
  84. package/dist/functions/helpers/render-has-audio-video.js +0 -21
  85. package/dist/functions/helpers/request-context.d.ts +0 -5
  86. package/dist/functions/helpers/request-context.js +0 -2
  87. package/dist/functions/helpers/stream-renderer.d.ts +0 -17
  88. package/dist/functions/helpers/stream-renderer.js +0 -148
  89. package/dist/functions/launch.d.ts +0 -10
  90. package/dist/functions/launch.js +0 -595
  91. package/dist/functions/progress.d.ts +0 -11
  92. package/dist/functions/progress.js +0 -51
  93. package/dist/functions/renderer.d.ts +0 -17
  94. package/dist/functions/renderer.js +0 -341
  95. package/dist/functions/start.d.ts +0 -13
  96. package/dist/functions/start.js +0 -112
  97. package/dist/functions/still.d.ts +0 -19
  98. package/dist/functions/still.js +0 -329
  99. package/dist/shared/__mocks__/aws-clients.d.ts +0 -2
  100. package/dist/shared/__mocks__/aws-clients.js +0 -62
  101. package/dist/shared/__mocks__/bundle-site.d.ts +0 -2
  102. package/dist/shared/__mocks__/bundle-site.js +0 -32
  103. package/dist/shared/__mocks__/check-credentials.d.ts +0 -1
  104. package/dist/shared/__mocks__/check-credentials.js +0 -5
  105. package/dist/shared/__mocks__/get-account-id.d.ts +0 -2
  106. package/dist/shared/__mocks__/get-account-id.js +0 -11
  107. package/dist/shared/__mocks__/read-dir.d.ts +0 -2
  108. package/dist/shared/__mocks__/read-dir.js +0 -13
  109. package/dist/shared/call-lambda.d.ts +0 -16
  110. package/dist/shared/call-lambda.js +0 -149
  111. package/dist/shared/cleanup-serialized-input-props.d.ts +0 -14
  112. package/dist/shared/cleanup-serialized-input-props.js +0 -34
  113. package/dist/shared/docs-url.d.ts +0 -1
  114. package/dist/shared/docs-url.js +0 -4
  115. package/dist/shared/get-most-expensive-chunks.d.ts +0 -8
  116. package/dist/shared/get-most-expensive-chunks.js +0 -28
  117. package/dist/shared/invoke-webhook.d.ts +0 -48
  118. package/dist/shared/invoke-webhook.js +0 -140
  119. package/dist/shared/parse-lambda-timings-key.d.ts +0 -5
  120. package/dist/shared/parse-lambda-timings-key.js +0 -2
  121. package/dist/shared/return-values.d.ts +0 -16
  122. package/dist/shared/return-values.js +0 -2
  123. package/dist/shared/stackback.d.ts +0 -6
  124. package/dist/shared/stackback.js +0 -59
  125. package/dist/shared/validate-download-behavior.d.ts +0 -1
  126. package/dist/shared/validate-download-behavior.js +0 -21
  127. package/dist/shared/validate-frames-per-lambda.d.ts +0 -4
  128. package/dist/shared/validate-frames-per-lambda.js +0 -29
  129. package/dist/shared/validate-privacy.d.ts +0 -2
  130. package/dist/shared/validate-privacy.js +0 -14
  131. package/dist/shared/validate.d.ts +0 -4
  132. package/dist/shared/validate.js +0 -8
  133. package/dist/shared/why-is-node-running.d.ts +0 -15
  134. package/dist/shared/why-is-node-running.js +0 -88
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAwsRegion = void 0;
4
4
  const constants_1 = require("../shared/constants");
5
+ const get_env_variable_1 = require("../shared/get-env-variable");
5
6
  const validate_aws_region_1 = require("../shared/validate-aws-region");
6
7
  const args_1 = require("./args");
7
8
  const getAwsRegion = () => {
@@ -10,7 +11,7 @@ const getAwsRegion = () => {
10
11
  (0, validate_aws_region_1.validateAwsRegion)(args_1.parsedLambdaCli.region);
11
12
  return args_1.parsedLambdaCli.region;
12
13
  }
13
- const envVariable = (_a = process.env.REMOTION_AWS_REGION) !== null && _a !== void 0 ? _a : process.env.AWS_REGION;
14
+ const envVariable = (_a = (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_REGION')) !== null && _a !== void 0 ? _a : (0, get_env_variable_1.getEnvVariable)('AWS_REGION');
14
15
  if (envVariable) {
15
16
  (0, validate_aws_region_1.validateAwsRegion)(envVariable);
16
17
  return envVariable;
package/dist/cli/index.js CHANGED
@@ -8,6 +8,7 @@ const suggested_policy_1 = require("../api/iam-validation/suggested-policy");
8
8
  const defaults_1 = require("../defaults");
9
9
  const aws_implementation_1 = require("../functions/aws-implementation");
10
10
  const full_client_implementation_1 = require("../functions/full-client-implementation");
11
+ const get_env_variable_1 = require("../shared/get-env-variable");
11
12
  const args_1 = require("./args");
12
13
  const compositions_1 = require("./commands/compositions");
13
14
  const functions_1 = require("./commands/functions");
@@ -159,10 +160,10 @@ AWS returned an "TooManyRequestsException" error message which could mean you re
159
160
  `.trim());
160
161
  }
161
162
  if ((_c = error.stack) === null || _c === void 0 ? void 0 : _c.includes('The security token included in the request is invalid')) {
162
- const keyButDoesntStartWithAki = process.env.REMOTION_AWS_ACCESS_KEY_ID &&
163
- !process.env.REMOTION_AWS_ACCESS_KEY_ID.startsWith('AKI');
164
- const pureKeyButDoesntStartWithAki = process.env.AWS_ACCESS_KEY_ID &&
165
- !process.env.AWS_ACCESS_KEY_ID.startsWith('AKI');
163
+ const keyButDoesntStartWithAki = (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID') &&
164
+ !(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID').startsWith('AKI');
165
+ const pureKeyButDoesntStartWithAki = (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
166
+ !(0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID').startsWith('AKI');
166
167
  if (keyButDoesntStartWithAki || pureKeyButDoesntStartWithAki) {
167
168
  log_1.Log.error({ indent: false, logLevel }, `
168
169
  AWS returned an error message "The security token included in the request is invalid". A possible reason is that your AWS Access key ID is set but doesn't start with "AKI", which it usually should. The original message is:
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkCredentials = void 0;
4
4
  const client_1 = require("@remotion/serverless/client");
5
5
  const is_cli_1 = require("../cli/is-cli");
6
+ const get_env_variable_1 = require("./get-env-variable");
6
7
  const is_likely_to_have_aws_profile_1 = require("./is-likely-to-have-aws-profile");
7
8
  const messageForVariable = (variable) => {
8
9
  return [
@@ -17,21 +18,21 @@ const messageForVariable = (variable) => {
17
18
  .join('\n');
18
19
  };
19
20
  const checkCredentials = () => {
20
- if (process.env.REMOTION_SKIP_AWS_CREDENTIALS_CHECK) {
21
+ if ((0, get_env_variable_1.getEnvVariable)('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')) {
21
22
  return;
22
23
  }
23
- if (process.env.REMOTION_AWS_PROFILE || process.env.AWS_PROFILE) {
24
+ if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE') || (0, get_env_variable_1.getEnvVariable)('AWS_PROFILE')) {
24
25
  return;
25
26
  }
26
27
  if ((0, is_likely_to_have_aws_profile_1.isLikelyToHaveAwsProfile)()) {
27
28
  return;
28
29
  }
29
- if (!process.env.AWS_ACCESS_KEY_ID &&
30
- !process.env.REMOTION_AWS_ACCESS_KEY_ID) {
30
+ if (!(0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
31
+ !(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_ACCESS_KEY_ID')) {
31
32
  throw new Error(messageForVariable('AWS_ACCESS_KEY_ID or REMOTION_AWS_ACCESS_KEY_ID'));
32
33
  }
33
- if (!process.env.AWS_SECRET_ACCESS_KEY &&
34
- !process.env.REMOTION_AWS_SECRET_ACCESS_KEY) {
34
+ if (!(0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY') &&
35
+ !(0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_SECRET_ACCESS_KEY')) {
35
36
  throw new Error(messageForVariable('AWS_SECRET_ACCESS_KEY or REMOTION_AWS_SECRET_ACCESS_KEY'));
36
37
  }
37
38
  };
@@ -2,50 +2,52 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCredentials = void 0;
4
4
  const credential_providers_1 = require("@aws-sdk/credential-providers");
5
+ const get_env_variable_1 = require("./get-env-variable");
5
6
  const is_in_lambda_1 = require("./is-in-lambda");
6
7
  const getCredentials = () => {
7
8
  if ((0, is_in_lambda_1.isInsideLambda)()) {
8
9
  return undefined;
9
10
  }
10
- if (process.env.REMOTION_AWS_PROFILE) {
11
+ if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE')) {
11
12
  return (0, credential_providers_1.fromIni)({
12
- profile: process.env.REMOTION_AWS_PROFILE,
13
+ profile: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE'),
13
14
  });
14
15
  }
15
- if (process.env.REMOTION_AWS_ACCESS_KEY_ID &&
16
- process.env.REMOTION_AWS_SECRET_ACCESS_KEY &&
17
- process.env.REMOTION_AWS_SESSION_TOKEN) {
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')) {
18
19
  return {
19
- accessKeyId: process.env.REMOTION_AWS_ACCESS_KEY_ID,
20
- secretAccessKey: process.env.REMOTION_AWS_SECRET_ACCESS_KEY,
21
- sessionToken: process.env.REMOTION_AWS_SESSION_TOKEN,
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'),
22
23
  };
23
24
  }
24
- if (process.env.REMOTION_AWS_ACCESS_KEY_ID &&
25
- process.env.REMOTION_AWS_SECRET_ACCESS_KEY) {
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')) {
26
27
  return {
27
- accessKeyId: process.env.REMOTION_AWS_ACCESS_KEY_ID,
28
- secretAccessKey: process.env.REMOTION_AWS_SECRET_ACCESS_KEY,
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'),
29
30
  };
30
31
  }
31
- if (process.env.AWS_PROFILE) {
32
+ if ((0, get_env_variable_1.getEnvVariable)('AWS_PROFILE')) {
32
33
  return (0, credential_providers_1.fromIni)({
33
- profile: process.env.AWS_PROFILE,
34
+ profile: (0, get_env_variable_1.getEnvVariable)('AWS_PROFILE'),
34
35
  });
35
36
  }
36
- if (process.env.AWS_ACCESS_KEY_ID &&
37
- process.env.AWS_SECRET_ACCESS_KEY &&
38
- process.env.AWS_SESSION_TOKEN) {
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')) {
39
40
  return {
40
- accessKeyId: process.env.AWS_ACCESS_KEY_ID,
41
- secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
42
- sessionToken: process.env.AWS_SESSION_TOKEN,
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'),
43
44
  };
44
45
  }
45
- if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY) {
46
+ if ((0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
47
+ (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY')) {
46
48
  return {
47
- accessKeyId: process.env.AWS_ACCESS_KEY_ID,
48
- secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
49
+ accessKeyId: (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID'),
50
+ secretAccessKey: (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY'),
49
51
  };
50
52
  }
51
53
  return undefined;
@@ -0,0 +1 @@
1
+ export declare const getEnvVariable: (name: string) => string | undefined;
@@ -0,0 +1,15 @@
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;
@@ -11,35 +11,36 @@ const client_1 = require("@remotion/serverless/client");
11
11
  const no_react_1 = require("remotion/no-react");
12
12
  const check_credentials_1 = require("./check-credentials");
13
13
  const get_credentials_1 = require("./get-credentials");
14
+ const get_env_variable_1 = require("./get-env-variable");
14
15
  const getCredentialsHash = ({ customCredentials, region, service, forcePathStyle, }) => {
15
16
  const hashComponents = {};
16
- if (process.env.REMOTION_SKIP_AWS_CREDENTIALS_CHECK) {
17
+ if ((0, get_env_variable_1.getEnvVariable)('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')) {
17
18
  hashComponents.credentials = {
18
19
  credentialsSkipped: true,
19
20
  };
20
21
  }
21
- else if (process.env.REMOTION_AWS_PROFILE) {
22
+ else if ((0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE')) {
22
23
  hashComponents.credentials = {
23
- awsProfile: process.env.REMOTION_AWS_PROFILE,
24
+ awsProfile: (0, get_env_variable_1.getEnvVariable)('REMOTION_AWS_PROFILE'),
24
25
  };
25
26
  }
26
- else if (process.env.REMOTION_AWS_ACCESS_KEY_ID &&
27
- process.env.REMOTION_AWS_SECRET_ACCESS_KEY) {
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')) {
28
29
  hashComponents.credentials = {
29
- accessKeyId: process.env.REMOTION_AWS_ACCESS_KEY_ID,
30
- secretAccessKey: process.env.REMOTION_AWS_SECRET_ACCESS_KEY,
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'),
31
32
  };
32
33
  }
33
- else if (process.env.AWS_PROFILE) {
34
+ else if ((0, get_env_variable_1.getEnvVariable)('AWS_PROFILE')) {
34
35
  hashComponents.credentials = {
35
- awsProfile: process.env.AWS_PROFILE,
36
+ awsProfile: (0, get_env_variable_1.getEnvVariable)('AWS_PROFILE'),
36
37
  };
37
38
  }
38
- else if (process.env.AWS_ACCESS_KEY_ID &&
39
- process.env.AWS_SECRET_ACCESS_KEY) {
39
+ else if ((0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID') &&
40
+ (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY')) {
40
41
  hashComponents.credentials = {
41
- accessKeyId: process.env.AWS_ACCESS_KEY_ID,
42
- secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
42
+ accessKeyId: (0, get_env_variable_1.getEnvVariable)('AWS_ACCESS_KEY_ID'),
43
+ secretAccessKey: (0, get_env_variable_1.getEnvVariable)('AWS_SECRET_ACCESS_KEY'),
43
44
  };
44
45
  }
45
46
  hashComponents.customCredentials = customCredentials;
@@ -99,7 +100,7 @@ const getServiceClient = ({ region, service, customCredentials, forcePathStyle,
99
100
  endpoint: customCredentials.endpoint,
100
101
  requestHandler: lambdaOptions,
101
102
  })
102
- : process.env.REMOTION_SKIP_AWS_CREDENTIALS_CHECK
103
+ : (0, get_env_variable_1.getEnvVariable)('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')
103
104
  ? new Client({
104
105
  region,
105
106
  requestHandler: lambdaOptions,
@@ -109,7 +110,7 @@ const getServiceClient = ({ region, service, customCredentials, forcePathStyle,
109
110
  credentials: (0, get_credentials_1.getCredentials)(),
110
111
  requestHandler: lambdaOptions,
111
112
  });
112
- if (process.env.REMOTION_DISABLE_AWS_CLIENT_CACHE) {
113
+ if ((0, get_env_variable_1.getEnvVariable)('REMOTION_DISABLE_AWS_CLIENT_CACHE')) {
113
114
  return client;
114
115
  }
115
116
  _clients[key] = client;
@@ -4,6 +4,7 @@ exports.isLikelyToHaveAwsProfile = void 0;
4
4
  const fs_1 = require("fs");
5
5
  const os_1 = require("os");
6
6
  const path_1 = require("path");
7
+ const get_env_variable_1 = require("./get-env-variable");
7
8
  const homeDirCache = {};
8
9
  const getHomeDirCacheKey = () => {
9
10
  // geteuid is only available on POSIX platforms (i.e. not Windows or Android).
@@ -28,10 +29,15 @@ const getHomeDir = () => {
28
29
  const ENV_CREDENTIALS_PATH = 'AWS_SHARED_CREDENTIALS_FILE';
29
30
  // Logic is inline to https://github.com/smithy-lang/smithy-typescript/blob/main/packages/shared-ini-file-loader/src/getCredentialsFilepath.ts#L7
30
31
  const pathOfCredentialsFile = () => {
31
- return (process.env[ENV_CREDENTIALS_PATH] ||
32
+ return ((0, get_env_variable_1.getEnvVariable)(ENV_CREDENTIALS_PATH) ||
32
33
  (0, path_1.join)(getHomeDir(), '.aws', 'credentials'));
33
34
  };
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
+ }
35
41
  const credentialsFile = pathOfCredentialsFile();
36
42
  try {
37
43
  const content = (0, fs_1.readFileSync)(credentialsFile, 'utf-8');
package/package.json CHANGED
@@ -3,32 +3,32 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
4
4
  },
5
5
  "name": "@remotion/lambda",
6
- "version": "4.0.256",
6
+ "version": "4.0.258",
7
7
  "description": "Render Remotion videos on AWS Lambda",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
10
10
  "author": "Jonny Burger <jonny@remotion.dev>",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@aws-sdk/client-cloudwatch-logs": "3.734.0",
14
- "@aws-sdk/client-iam": "3.734.0",
15
- "@aws-sdk/client-lambda": "3.734.0",
16
- "@aws-sdk/client-s3": "3.734.0",
17
- "@aws-sdk/client-service-quotas": "3.734.0",
18
- "@aws-sdk/client-sts": "3.734.0",
19
- "@aws-sdk/credential-providers": "3.734.0",
20
- "@aws-sdk/lib-storage": "3.734.0",
21
- "@aws-sdk/s3-request-presigner": "3.734.0",
13
+ "@aws-sdk/client-cloudwatch-logs": "3.738.0",
14
+ "@aws-sdk/client-iam": "3.738.0",
15
+ "@aws-sdk/client-lambda": "3.738.0",
16
+ "@aws-sdk/client-s3": "3.738.0",
17
+ "@aws-sdk/client-service-quotas": "3.738.0",
18
+ "@aws-sdk/client-sts": "3.738.0",
19
+ "@aws-sdk/credential-providers": "3.738.0",
20
+ "@aws-sdk/lib-storage": "3.738.0",
21
+ "@aws-sdk/s3-request-presigner": "3.738.0",
22
22
  "@smithy/abort-controller": "3.1.1",
23
23
  "mime-types": "2.1.34",
24
24
  "zod": "3.22.3",
25
- "@remotion/bundler": "4.0.256",
26
- "@remotion/serverless": "4.0.256",
27
- "@remotion/cli": "4.0.256",
28
- "remotion": "4.0.256",
29
- "@remotion/studio-server": "4.0.256",
30
- "@remotion/renderer": "4.0.256",
31
- "@remotion/streaming": "4.0.256"
25
+ "@remotion/cli": "4.0.258",
26
+ "@remotion/bundler": "4.0.258",
27
+ "@remotion/renderer": "4.0.258",
28
+ "@remotion/serverless": "4.0.258",
29
+ "@remotion/streaming": "4.0.258",
30
+ "@remotion/studio-server": "4.0.258",
31
+ "remotion": "4.0.258"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/express": "^5.0.0",
@@ -40,12 +40,12 @@
40
40
  "next": "15.1.2",
41
41
  "pureimage": "0.4.13",
42
42
  "zip-lib": "^0.7.2",
43
- "@remotion/bundler": "4.0.256",
44
- "@remotion/compositor-linux-arm64-gnu": "4.0.256",
45
- "@remotion/eslint-config-internal": "4.0.256"
43
+ "@remotion/compositor-linux-arm64-gnu": "4.0.258",
44
+ "@remotion/eslint-config-internal": "4.0.258",
45
+ "@remotion/bundler": "4.0.258"
46
46
  },
47
47
  "peerDependencies": {
48
- "@remotion/bundler": "4.0.256"
48
+ "@remotion/bundler": "4.0.258"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"
Binary file
@@ -1,2 +0,0 @@
1
- import type { cleanItems as original } from '../clean-items';
2
- export declare const cleanItems: typeof original;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanItems = void 0;
4
- const mock_store_1 = require("../../test/mocks/mock-store");
5
- const cleanItems = (input) => {
6
- var _a, _b;
7
- for (const item of input.list) {
8
- (_a = input.onBeforeItemDeleted) === null || _a === void 0 ? void 0 : _a.call(input, {
9
- bucketName: input.bucket,
10
- itemName: item,
11
- });
12
- (0, mock_store_1.mockDeleteS3File)({
13
- key: item,
14
- bucketName: input.bucket,
15
- region: input.region,
16
- });
17
- (_b = input.onAfterItemDeleted) === null || _b === void 0 ? void 0 : _b.call(input, {
18
- bucketName: input.bucket,
19
- itemName: item,
20
- });
21
- }
22
- return Promise.resolve([]);
23
- };
24
- exports.cleanItems = cleanItems;
@@ -1,2 +0,0 @@
1
- import type { createFunction as original } from '../create-function';
2
- export declare const createFunction: typeof original;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createFunction = void 0;
4
- const version_1 = require("remotion/version");
5
- const defaults_1 = require("../../defaults");
6
- const mock_functions_1 = require("../mock-functions");
7
- const createFunction = (input) => {
8
- if (!input.alreadyCreated) {
9
- (0, mock_functions_1.addFunction)({
10
- functionName: input.functionName,
11
- memorySizeInMb: defaults_1.DEFAULT_MEMORY_SIZE,
12
- timeoutInSeconds: input.timeoutInSeconds,
13
- version: version_1.VERSION,
14
- diskSizeInMb: defaults_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB,
15
- }, input.region);
16
- }
17
- return Promise.resolve({
18
- FunctionName: input.functionName,
19
- });
20
- };
21
- exports.createFunction = createFunction;
@@ -1,2 +0,0 @@
1
- import type { deleteFunction as original } from '../delete-function';
2
- export declare const deleteFunction: typeof original;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteFunction = void 0;
4
- const mock_functions_1 = require("../mock-functions");
5
- const deleteFunction = ({ region, functionName }) => {
6
- (0, mock_functions_1.deleteMockFunction)(functionName, region);
7
- return Promise.resolve();
8
- };
9
- exports.deleteFunction = deleteFunction;
@@ -1,2 +0,0 @@
1
- import type { getFunctions as original } from '../get-functions';
2
- export declare const getFunctions: typeof original;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFunctions = void 0;
4
- const version_1 = require("remotion/version");
5
- const mock_functions_1 = require("../mock-functions");
6
- const getFunctions = ({ region, compatibleOnly }) => {
7
- return Promise.resolve((0, mock_functions_1.getAllMockFunctions)(region, compatibleOnly ? version_1.VERSION : null));
8
- };
9
- exports.getFunctions = getFunctions;
@@ -1,3 +0,0 @@
1
- import type { MockFile, uploadDir as original } from '../upload-dir';
2
- export declare const getDirFiles: (dir: string) => MockFile[];
3
- export declare const uploadDir: typeof original;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uploadDir = exports.getDirFiles = void 0;
4
- const mock_store_1 = require("../../test/mocks/mock-store");
5
- const getDirFiles = (dir) => {
6
- if (dir === '/path/to/bundle-1') {
7
- return [
8
- {
9
- name: 'bundle.js',
10
- content: 'console.log("Hello World")',
11
- },
12
- {
13
- name: 'styles.css',
14
- content: 'body {background: red}',
15
- },
16
- ];
17
- }
18
- if (dir === '/path/to/bundle-2') {
19
- return [
20
- {
21
- name: 'bundle.js',
22
- content: 'console.log("Hello World")',
23
- },
24
- {
25
- name: 'styles2.css',
26
- content: 'body {background: red}',
27
- },
28
- ];
29
- }
30
- throw new Error('could not get dir for ' + dir);
31
- };
32
- exports.getDirFiles = getDirFiles;
33
- const uploadDir = (input) => {
34
- const files = (0, exports.getDirFiles)(input.localDir);
35
- for (const file of files) {
36
- (0, mock_store_1.writeMockS3File)({
37
- privacy: input.privacy,
38
- bucketName: input.bucket,
39
- body: file.content,
40
- // Should not use path.join here because on Windows it's not / separator
41
- key: [input.keyPrefix, file.name].join('/'),
42
- region: input.region,
43
- });
44
- }
45
- return Promise.resolve();
46
- };
47
- exports.uploadDir = uploadDir;
@@ -1,18 +0,0 @@
1
- import type { AwsRegion } from '../regions';
2
- import type { FunctionInfo } from './get-function-info';
3
- export declare let mockFunctionsStore: (FunctionInfo & {
4
- region: AwsRegion;
5
- version: string;
6
- })[];
7
- export declare const addFunction: (fn: FunctionInfo, region: AwsRegion) => void;
8
- export declare const deleteMockFunction: (name: string, region: string) => void;
9
- export declare const findFunction: (name: string, region: string) => (FunctionInfo & {
10
- region: AwsRegion;
11
- version: string;
12
- }) | undefined;
13
- export declare const getAllMockFunctions: (region: string, version: string | null) => (FunctionInfo & {
14
- region: AwsRegion;
15
- version: string;
16
- })[];
17
- export declare const cleanFnStore: () => void;
18
- export declare const markFunctionAsIncompatible: (functionName: string) => void;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.markFunctionAsIncompatible = exports.cleanFnStore = exports.getAllMockFunctions = exports.findFunction = exports.deleteMockFunction = exports.addFunction = exports.mockFunctionsStore = void 0;
4
- exports.mockFunctionsStore = [];
5
- const addFunction = (fn, region) => {
6
- exports.mockFunctionsStore.push({
7
- ...fn,
8
- region,
9
- version: fn.version,
10
- });
11
- };
12
- exports.addFunction = addFunction;
13
- const deleteMockFunction = (name, region) => {
14
- exports.mockFunctionsStore = exports.mockFunctionsStore.filter((fn) => fn.functionName !== name && fn.region !== region);
15
- };
16
- exports.deleteMockFunction = deleteMockFunction;
17
- const findFunction = (name, region) => {
18
- return exports.mockFunctionsStore.find((n) => n.functionName === name && region === n.region);
19
- };
20
- exports.findFunction = findFunction;
21
- const getAllMockFunctions = (region, version) => {
22
- return exports.mockFunctionsStore.filter((f) => f.region === region && (version ? f.version === version : true));
23
- };
24
- exports.getAllMockFunctions = getAllMockFunctions;
25
- const cleanFnStore = () => {
26
- exports.mockFunctionsStore = [];
27
- };
28
- exports.cleanFnStore = cleanFnStore;
29
- const markFunctionAsIncompatible = (functionName) => {
30
- for (const fn of exports.mockFunctionsStore) {
31
- if (fn.functionName === functionName) {
32
- fn.version = '2021-06-23';
33
- }
34
- }
35
- };
36
- exports.markFunctionAsIncompatible = markFunctionAsIncompatible;
@@ -1 +0,0 @@
1
- export declare const quit: (exitCode: number) => never;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.quit = void 0;
4
- const quit = (exitCode) => {
5
- throw new Error(`Exited process with code ${exitCode}`);
6
- };
7
- exports.quit = quit;
@@ -1,7 +0,0 @@
1
- export declare const planFrameRanges: ({ framesPerLambda, frameRange, everyNthFrame, }: {
2
- framesPerLambda: number;
3
- frameRange: [number, number];
4
- everyNthFrame: number;
5
- }) => {
6
- chunks: [number, number][];
7
- };
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.planFrameRanges = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- const planFrameRanges = ({ framesPerLambda, frameRange, everyNthFrame, }) => {
6
- const framesToRender = renderer_1.RenderInternals.getFramesToRender(frameRange, everyNthFrame);
7
- const chunkCount = Math.ceil(framesToRender.length / framesPerLambda);
8
- const firstFrame = frameRange[0];
9
- return {
10
- chunks: new Array(chunkCount).fill(1).map((_, i) => {
11
- const start = i * framesPerLambda * everyNthFrame + firstFrame;
12
- const end = Math.min(framesToRender[framesToRender.length - 1], (i + 1) * framesPerLambda * everyNthFrame - 1 + firstFrame);
13
- return [start, end];
14
- }),
15
- };
16
- };
17
- exports.planFrameRanges = planFrameRanges;
@@ -1,8 +0,0 @@
1
- export type ObjectChunkTimingData = {
2
- chunk: number;
3
- frameRange: [number, number];
4
- startDate: number;
5
- timings: {
6
- [key: number]: number;
7
- };
8
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import type { forgetBrowserEventLoop as originalForget, getBrowserInstance as originalGetBrowserInstance } from '@remotion/serverless';
2
- export declare const getBrowserInstance: typeof originalGetBrowserInstance;
3
- export declare const forgetBrowserEventLoop: typeof originalForget;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.forgetBrowserEventLoop = exports.getBrowserInstance = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- let _browserInstance;
6
- const getBrowserInstance = async () => {
7
- _browserInstance = await (0, renderer_1.openBrowser)('chrome');
8
- return { instance: _browserInstance, configurationString: 'chrome' };
9
- };
10
- exports.getBrowserInstance = getBrowserInstance;
11
- const forgetBrowserEventLoop = () => { };
12
- exports.forgetBrowserEventLoop = forgetBrowserEventLoop;
@@ -1,4 +0,0 @@
1
- import type { setCurrentRequestId as originalSetCurrentRequestId, startLeakDetection as originalStartLeakDetection, stopLeakDetection as originalStopLeakDetection } from '../leak-detection';
2
- export declare const stopLeakDetection: typeof originalStopLeakDetection;
3
- export declare const setCurrentRequestId: typeof originalSetCurrentRequestId;
4
- export declare const startLeakDetection: typeof originalStartLeakDetection;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.startLeakDetection = exports.setCurrentRequestId = exports.stopLeakDetection = void 0;
4
- const stopLeakDetection = () => { };
5
- exports.stopLeakDetection = stopLeakDetection;
6
- const setCurrentRequestId = () => { };
7
- exports.setCurrentRequestId = setCurrentRequestId;
8
- const startLeakDetection = () => { };
9
- exports.startLeakDetection = startLeakDetection;
@@ -1,2 +0,0 @@
1
- import type { timer as original } from '../../../functions/helpers/timer';
2
- export declare const timer: typeof original;