@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.
Files changed (230) hide show
  1. package/dist/api/__mocks__/clean-items.d.ts +2 -0
  2. package/dist/api/__mocks__/clean-items.js +24 -0
  3. package/dist/api/__mocks__/create-function.d.ts +2 -0
  4. package/dist/api/__mocks__/create-function.js +21 -0
  5. package/dist/api/__mocks__/delete-function.d.ts +2 -0
  6. package/dist/api/__mocks__/delete-function.js +9 -0
  7. package/dist/api/__mocks__/get-functions.d.ts +2 -0
  8. package/dist/api/__mocks__/get-functions.js +9 -0
  9. package/dist/api/__mocks__/upload-dir.d.ts +3 -0
  10. package/dist/api/__mocks__/upload-dir.js +47 -0
  11. package/dist/api/bucket-exists.d.ts +3 -6
  12. package/dist/api/bucket-exists.js +5 -5
  13. package/dist/api/clean-items.d.ts +4 -3
  14. package/dist/api/clean-items.js +7 -7
  15. package/dist/api/create-bucket.d.ts +3 -5
  16. package/dist/api/create-bucket.js +6 -6
  17. package/dist/api/create-function.d.ts +1 -1
  18. package/dist/api/delete-function.d.ts +1 -1
  19. package/dist/api/delete-render.d.ts +10 -3
  20. package/dist/api/delete-render.js +27 -19
  21. package/dist/api/delete-site.d.ts +7 -2
  22. package/dist/api/delete-site.js +23 -15
  23. package/dist/api/deploy-function.d.ts +1 -1
  24. package/dist/api/deploy-function.js +2 -2
  25. package/dist/api/deploy-site.d.ts +9 -5
  26. package/dist/api/deploy-site.js +11 -12
  27. package/dist/api/download-media.d.ts +8 -3
  28. package/dist/api/download-media.js +24 -15
  29. package/dist/api/estimate-price.d.ts +1 -1
  30. package/dist/api/get-aws-client.d.ts +4 -2
  31. package/dist/api/get-aws-client.js +2 -2
  32. package/dist/api/get-buckets.d.ts +4 -4
  33. package/dist/api/get-buckets.js +12 -14
  34. package/dist/api/get-compositions-on-lambda.js +7 -6
  35. package/dist/api/get-function-info.d.ts +1 -1
  36. package/dist/api/get-functions.d.ts +1 -1
  37. package/dist/api/get-or-create-bucket.d.ts +3 -19
  38. package/dist/api/get-or-create-bucket.js +5 -39
  39. package/dist/api/get-regions.d.ts +1 -1
  40. package/dist/api/get-regions.js +1 -2
  41. package/dist/api/get-render-progress.d.ts +4 -3
  42. package/dist/api/get-render-progress.js +2 -2
  43. package/dist/api/get-sites.d.ts +6 -1
  44. package/dist/api/get-sites.js +21 -14
  45. package/dist/api/iam-validation/role-permissions.js +2 -1
  46. package/dist/api/iam-validation/simulate-rule.d.ts +1 -1
  47. package/dist/api/iam-validation/simulate.d.ts +1 -1
  48. package/dist/api/iam-validation/user-permissions.js +2 -1
  49. package/dist/api/make-lambda-payload.d.ts +8 -9
  50. package/dist/api/make-lambda-payload.js +15 -13
  51. package/dist/api/mock-functions.d.ts +1 -1
  52. package/dist/api/presign-url.d.ts +1 -1
  53. package/dist/api/presign-url.js +4 -4
  54. package/dist/api/render-media-on-lambda.d.ts +5 -6
  55. package/dist/api/render-media-on-lambda.js +5 -5
  56. package/dist/api/render-still-on-lambda.d.ts +8 -6
  57. package/dist/api/render-still-on-lambda.js +6 -5
  58. package/dist/api/upload-dir.d.ts +2 -2
  59. package/dist/api/upload-dir.js +2 -2
  60. package/dist/cli/args.d.ts +2 -3
  61. package/dist/cli/commands/render/progress.d.ts +2 -2
  62. package/dist/cli/commands/render/progress.js +6 -5
  63. package/dist/cli/commands/render/render.d.ts +3 -1
  64. package/dist/cli/commands/render/render.js +3 -2
  65. package/dist/cli/commands/sites/create.d.ts +3 -1
  66. package/dist/cli/commands/sites/create.js +6 -5
  67. package/dist/cli/commands/sites/index.d.ts +3 -1
  68. package/dist/cli/commands/sites/index.js +4 -4
  69. package/dist/cli/commands/sites/rm.d.ts +3 -1
  70. package/dist/cli/commands/sites/rm.js +4 -3
  71. package/dist/cli/commands/sites/rmall.d.ts +3 -1
  72. package/dist/cli/commands/sites/rmall.js +4 -3
  73. package/dist/cli/commands/still.d.ts +3 -1
  74. package/dist/cli/commands/still.js +3 -2
  75. package/dist/cli/get-aws-region.d.ts +1 -1
  76. package/dist/cli/helpers/__mocks__/quit.d.ts +1 -0
  77. package/dist/cli/helpers/__mocks__/quit.js +7 -0
  78. package/dist/cli/index.d.ts +3 -1
  79. package/dist/cli/index.js +8 -7
  80. package/dist/client.d.ts +4 -5
  81. package/dist/functions/aws-implementation.d.ts +11 -0
  82. package/dist/functions/aws-implementation.js +49 -0
  83. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +4 -1
  84. package/dist/functions/compositions.d.ts +3 -2
  85. package/dist/functions/compositions.js +18 -15
  86. package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +3 -0
  87. package/dist/functions/helpers/__mocks__/get-browser-instance.js +12 -0
  88. package/dist/functions/helpers/__mocks__/leak-detection.d.ts +4 -0
  89. package/dist/functions/helpers/__mocks__/leak-detection.js +9 -0
  90. package/dist/functions/helpers/__mocks__/timer.d.ts +2 -0
  91. package/dist/functions/helpers/__mocks__/timer.js +10 -0
  92. package/dist/functions/helpers/calculate-price-from-bucket.d.ts +5 -3
  93. package/dist/functions/helpers/calculate-price-from-bucket.js +2 -3
  94. package/dist/functions/helpers/cleanup-props.d.ts +4 -2
  95. package/dist/functions/helpers/cleanup-props.js +5 -4
  96. package/dist/functions/helpers/concat-videos.d.ts +2 -2
  97. package/dist/functions/helpers/create-post-render-data.d.ts +8 -8
  98. package/dist/functions/helpers/create-post-render-data.js +1 -1
  99. package/dist/functions/helpers/expected-out-name.d.ts +4 -4
  100. package/dist/functions/helpers/find-output-file-in-bucket.d.ts +8 -7
  101. package/dist/functions/helpers/find-output-file-in-bucket.js +5 -6
  102. package/dist/functions/helpers/get-browser-instance.d.ts +3 -2
  103. package/dist/functions/helpers/get-browser-instance.js +3 -4
  104. package/dist/functions/helpers/get-current-region.d.ts +1 -1
  105. package/dist/functions/helpers/get-current-region.js +3 -3
  106. package/dist/functions/helpers/get-custom-out-name.d.ts +5 -5
  107. package/dist/functions/helpers/get-folder-files.d.ts +2 -0
  108. package/dist/functions/helpers/get-folder-files.js +38 -0
  109. package/dist/functions/helpers/get-output-url-from-metadata.d.ts +4 -3
  110. package/dist/functions/helpers/get-output-url-from-metadata.js +4 -5
  111. package/dist/functions/helpers/get-overall-progress-s3.d.ts +5 -4
  112. package/dist/functions/helpers/get-overall-progress-s3.js +5 -7
  113. package/dist/functions/helpers/get-progress.d.ts +8 -7
  114. package/dist/functions/helpers/get-progress.js +7 -5
  115. package/dist/functions/helpers/inspect-errors.d.ts +1 -1
  116. package/dist/functions/helpers/inspect-errors.js +4 -4
  117. package/dist/functions/helpers/io.d.ts +3 -36
  118. package/dist/functions/helpers/io.js +3 -104
  119. package/dist/functions/helpers/lifecycle.d.ts +3 -9
  120. package/dist/functions/helpers/lifecycle.js +6 -16
  121. package/dist/functions/helpers/make-aws-artifact.d.ts +3 -0
  122. package/dist/functions/helpers/make-aws-artifact.js +12 -0
  123. package/dist/functions/helpers/make-timeout-error.d.ts +5 -4
  124. package/dist/functions/helpers/make-timeout-error.js +2 -1
  125. package/dist/functions/helpers/make-timeout-message.d.ts +5 -3
  126. package/dist/functions/helpers/make-timeout-message.js +8 -9
  127. package/dist/functions/helpers/merge-chunks.d.ts +10 -10
  128. package/dist/functions/helpers/merge-chunks.js +7 -8
  129. package/dist/functions/helpers/overall-render-progress.d.ts +18 -23
  130. package/dist/functions/helpers/overall-render-progress.js +5 -5
  131. package/dist/functions/helpers/print-cloudwatch-helper.d.ts +2 -2
  132. package/dist/functions/helpers/print-logging-helper.d.ts +4 -0
  133. package/dist/functions/helpers/print-logging-helper.js +12 -0
  134. package/dist/functions/helpers/read-with-progress.d.ts +4 -3
  135. package/dist/functions/helpers/read-with-progress.js +2 -2
  136. package/dist/functions/helpers/render-has-audio-video.d.ts +3 -2
  137. package/dist/functions/helpers/stream-renderer.d.ts +7 -4
  138. package/dist/functions/helpers/stream-renderer.js +11 -10
  139. package/dist/functions/helpers/streamify-response.d.ts +0 -20
  140. package/dist/functions/helpers/streamify-response.js +1 -62
  141. package/dist/functions/helpers/validate-composition.d.ts +5 -3
  142. package/dist/functions/helpers/validate-composition.js +2 -3
  143. package/dist/functions/index.d.ts +5 -3
  144. package/dist/functions/index.js +98 -72
  145. package/dist/functions/info.d.ts +1 -1
  146. package/dist/functions/info.js +2 -2
  147. package/dist/functions/launch.d.ts +3 -2
  148. package/dist/functions/launch.js +54 -41
  149. package/dist/functions/progress.d.ts +6 -3
  150. package/dist/functions/progress.js +5 -4
  151. package/dist/functions/provider-implementation.d.ts +0 -0
  152. package/dist/functions/provider-implementation.js +1 -0
  153. package/dist/functions/renderer.d.ts +9 -3
  154. package/dist/functions/renderer.js +30 -22
  155. package/dist/functions/start.d.ts +3 -2
  156. package/dist/functions/start.js +13 -16
  157. package/dist/functions/still.d.ts +8 -18
  158. package/dist/functions/still.js +47 -46
  159. package/dist/index.d.ts +4 -6
  160. package/dist/internals.d.ts +16 -14
  161. package/dist/io/delete-file.d.ts +3 -0
  162. package/dist/io/delete-file.js +12 -0
  163. package/dist/io/head-file.d.ts +3 -0
  164. package/dist/io/head-file.js +13 -0
  165. package/dist/io/list-objects.d.ts +3 -0
  166. package/dist/io/list-objects.js +58 -0
  167. package/dist/io/read-file.d.ts +9 -0
  168. package/dist/io/read-file.js +14 -0
  169. package/dist/io/write-file.d.ts +5 -0
  170. package/dist/io/write-file.js +51 -0
  171. package/dist/pricing/aws-regions.d.ts +0 -3
  172. package/dist/pricing/aws-regions.js +0 -44
  173. package/dist/pricing/price-per-1-s.d.ts +1 -1
  174. package/dist/regions.d.ts +3 -2
  175. package/dist/regions.js +43 -3
  176. package/dist/shared/__mocks__/aws-clients.d.ts +2 -0
  177. package/dist/shared/__mocks__/aws-clients.js +62 -0
  178. package/dist/shared/__mocks__/bundle-site.d.ts +2 -0
  179. package/dist/shared/__mocks__/bundle-site.js +32 -0
  180. package/dist/shared/__mocks__/check-credentials.d.ts +1 -0
  181. package/dist/shared/__mocks__/check-credentials.js +5 -0
  182. package/dist/shared/__mocks__/get-account-id.d.ts +2 -0
  183. package/dist/shared/__mocks__/get-account-id.js +11 -0
  184. package/dist/shared/__mocks__/read-dir.d.ts +2 -0
  185. package/dist/shared/__mocks__/read-dir.js +13 -0
  186. package/dist/shared/aws-clients.d.ts +6 -29
  187. package/dist/shared/aws-clients.js +7 -177
  188. package/dist/shared/call-lambda.d.ts +8 -9
  189. package/dist/shared/call-lambda.js +16 -3
  190. package/dist/shared/check-credentials.js +2 -2
  191. package/dist/shared/cleanup-serialized-input-props.d.ts +8 -6
  192. package/dist/shared/cleanup-serialized-input-props.js +7 -8
  193. package/dist/shared/compress-props.d.ts +8 -6
  194. package/dist/shared/compress-props.js +11 -14
  195. package/dist/shared/constants.d.ts +10 -288
  196. package/dist/shared/constants.js +1 -46
  197. package/dist/shared/content-disposition-header.d.ts +1 -6
  198. package/dist/shared/content-disposition-header.js +2 -2
  199. package/dist/shared/convert-to-serve-url.d.ts +2 -2
  200. package/dist/shared/convert-to-serve-url.js +3 -3
  201. package/dist/shared/get-account-id.d.ts +1 -1
  202. package/dist/shared/get-aws-urls.d.ts +2 -2
  203. package/dist/shared/get-credentials.d.ts +9 -0
  204. package/dist/shared/get-credentials.js +53 -0
  205. package/dist/shared/get-function-version.d.ts +1 -1
  206. package/dist/shared/get-function-version.js +2 -1
  207. package/dist/shared/get-s3-client.d.ts +5 -0
  208. package/dist/shared/get-s3-client.js +13 -0
  209. package/dist/shared/get-service-client.d.ts +22 -0
  210. package/dist/shared/get-service-client.js +117 -0
  211. package/dist/shared/hosted-layers.d.ts +1 -1
  212. package/dist/shared/invoke-webhook.d.ts +1 -1
  213. package/dist/shared/lambda-insights-extensions.d.ts +1 -1
  214. package/dist/shared/lifecycle-rules.d.ts +4 -3
  215. package/dist/shared/lifecycle-rules.js +3 -3
  216. package/dist/shared/make-s3-url.d.ts +1 -1
  217. package/dist/shared/random-hash.d.ts +1 -3
  218. package/dist/shared/random-hash.js +3 -4
  219. package/dist/shared/return-values.d.ts +10 -11
  220. package/dist/shared/validate-aws-region.d.ts +1 -1
  221. package/dist/shared/validate-aws-region.js +3 -3
  222. package/dist/shared/validate-bucketname.d.ts +0 -4
  223. package/dist/shared/validate-bucketname.js +3 -23
  224. package/dist/shared/validate-lambda-codec.d.ts +2 -4
  225. package/dist/shared/validate-lambda-codec.js +3 -13
  226. package/dist/shared/validate-outname.js +2 -2
  227. package/dist/shared/validate-privacy.d.ts +1 -1
  228. package/dist/shared/validate-webhook.d.ts +1 -1
  229. package/package.json +11 -9
  230. 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,4 +1,4 @@
1
- import type { AwsRegion } from '../pricing/aws-regions';
1
+ import type { AwsRegion } from '../regions';
2
2
  export declare const REMOTION_HOSTED_LAYER_ARN = "arn:aws:lambda:*:678892195805:layer:remotion-binaries-*";
3
3
  export type HostedLayers = {
4
4
  [region in AwsRegion]: {
@@ -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,4 +1,4 @@
1
- import type { AwsRegion } from '../pricing/aws-regions';
1
+ import type { AwsRegion } from '../regions';
2
2
  export declare const lambdaInsightsExtensions: {
3
3
  [region in AwsRegion]: string;
4
4
  };
@@ -1,8 +1,9 @@
1
- import type { AwsRegion } from '../client';
2
- import type { CustomCredentials } from './aws-clients';
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 aws_clients_1 = require("./aws-clients");
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, aws_clients_1.getS3Client)(region, customCredentials).send(createCommand);
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, aws_clients_1.getS3Client)(region, customCredentials).send(new client_s3_1.DeleteBucketLifecycleCommand(deleteCommandInput));
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,4 +1,4 @@
1
- import type { AwsRegion } from '../pricing/aws-regions';
1
+ import type { AwsRegion } from '../regions';
2
2
  export declare const makeS3ServeUrl: ({ bucketName, subFolder, region, }: {
3
3
  bucketName: string;
4
4
  subFolder: string;
@@ -1,3 +1 @@
1
- export declare const randomHash: (_options?: {
2
- randomInTests: boolean;
3
- }) => string;
1
+ export declare const randomHashImplementation: () => string;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.randomHash = void 0;
3
+ exports.randomHashImplementation = void 0;
4
4
  const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
5
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
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.randomHash = randomHash;
13
+ exports.randomHashImplementation = randomHashImplementation;
@@ -1,17 +1,16 @@
1
- import type { compositionsHandler } from '../functions/compositions';
2
- import type { infoHandler } from '../functions/info';
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
- import type { LambdaRoutines } from './constants';
9
- export interface LambdaReturnValues {
10
- [LambdaRoutines.start]: ReturnType<typeof startHandler>;
11
- [LambdaRoutines.launch]: ReturnType<typeof launchHandler>;
12
- [LambdaRoutines.renderer]: ReturnType<typeof rendererHandler>;
13
- [LambdaRoutines.status]: ReturnType<typeof progressHandler>;
14
- [LambdaRoutines.info]: ReturnType<typeof infoHandler>;
15
- [LambdaRoutines.still]: ReturnType<typeof stillHandler>;
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 '../pricing/aws-regions';
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 aws_regions_1 = require("../pricing/aws-regions");
4
+ const regions_1 = require("../regions");
5
5
  function validateAwsRegion(region) {
6
- if (!aws_regions_1.AWS_REGIONS.includes(region)) {
7
- throw new TypeError(`${region} is not a valid AWS region. Must be one of: ${aws_regions_1.AWS_REGIONS.join(', ')}`);
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.makeBucketName = exports.parseBucketName = exports.validateBucketName = void 0;
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(`^${constants_1.REMOTION_BUCKET_PREFIX}(.*)-([a-z0-9A-Z]+)$`));
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
- declare const lambdaCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "gif", "prores"];
2
- export type LambdaCodec = (typeof lambdaCodecs)[number];
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 lambdaCodecs = [
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 (!lambdaCodecs.includes(codec)) {
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
- lambdaCodecs.join(', '));
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 validate_bucketname_1 = require("./validate-bucketname");
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, validate_bucketname_1.validateBucketName)(outName.bucketName, { mustStartWithRemotion: false });
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 './constants';
1
+ import type { Privacy } from '@remotion/serverless/client';
2
2
  export declare function validatePrivacy(privacy: unknown, allowPrivate: boolean): asserts privacy is Privacy;
@@ -1,3 +1,3 @@
1
- import type { WebhookOption } from './constants';
1
+ import type { WebhookOption } from '@remotion/serverless/client';
2
2
  export declare const MAX_WEBHOOK_CUSTOM_DATA_SIZE = 1024;
3
3
  export declare const validateWebhook: (webhook?: WebhookOption | null) => void;
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.187",
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/bundler": "4.0.187",
26
- "@remotion/streaming": "4.0.187",
27
- "remotion": "4.0.187",
28
- "@remotion/renderer": "4.0.187",
29
- "@remotion/cli": "4.0.187"
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/compositor-linux-arm64-gnu": "4.0.187",
39
- "@remotion/bundler": "4.0.187"
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.187"
44
+ "@remotion/bundler": "4.0.188"
43
45
  },
44
46
  "publishConfig": {
45
47
  "access": "public"
Binary file