@remotion/lambda 4.0.259 → 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.
Files changed (221) hide show
  1. package/build.ts +1 -1
  2. package/dist/admin/make-layer-public.js +3 -3
  3. package/dist/api/create-function.d.ts +1 -2
  4. package/dist/api/create-function.js +8 -8
  5. package/dist/api/delete-site.d.ts +2 -2
  6. package/dist/api/delete-site.js +3 -4
  7. package/dist/api/deploy-function.d.ts +2 -2
  8. package/dist/api/deploy-function.js +9 -13
  9. package/dist/api/deploy-site.d.ts +2 -2
  10. package/dist/api/deploy-site.js +19 -13
  11. package/dist/api/download-media.d.ts +3 -3
  12. package/dist/api/download-media.js +11 -5
  13. package/dist/api/get-function-info.d.ts +1 -1
  14. package/dist/api/get-function-info.js +6 -8
  15. package/dist/api/get-or-create-bucket.d.ts +3 -3
  16. package/dist/api/get-or-create-bucket.js +4 -4
  17. package/dist/api/get-regions.d.ts +1 -1
  18. package/dist/api/get-regions.js +1 -1
  19. package/dist/api/iam-validation/role-permissions.js +6 -7
  20. package/dist/api/iam-validation/simulate-rule.d.ts +1 -1
  21. package/dist/api/iam-validation/simulate-rule.js +2 -2
  22. package/dist/api/iam-validation/simulate.d.ts +1 -1
  23. package/dist/api/iam-validation/simulate.js +2 -2
  24. package/dist/api/iam-validation/user-permissions.js +4 -5
  25. package/dist/api/upload-dir.d.ts +2 -3
  26. package/dist/api/upload-dir.js +7 -4
  27. package/dist/cli/args.d.ts +2 -4
  28. package/dist/cli/commands/compositions/index.d.ts +1 -1
  29. package/dist/cli/commands/compositions/index.js +5 -6
  30. package/dist/cli/commands/functions/deploy.d.ts +1 -1
  31. package/dist/cli/commands/functions/deploy.js +8 -9
  32. package/dist/cli/commands/functions/index.d.ts +1 -1
  33. package/dist/cli/commands/functions/index.js +6 -6
  34. package/dist/cli/commands/functions/ls.d.ts +1 -1
  35. package/dist/cli/commands/functions/rm.js +4 -4
  36. package/dist/cli/commands/functions/rmall.d.ts +1 -1
  37. package/dist/cli/commands/functions/rmall.js +2 -2
  38. package/dist/cli/commands/policies/policies.js +5 -5
  39. package/dist/cli/commands/quotas/increase.js +5 -5
  40. package/dist/cli/commands/quotas/list.js +4 -4
  41. package/dist/cli/commands/render/progress.js +4 -4
  42. package/dist/cli/commands/render/render.d.ts +1 -1
  43. package/dist/cli/commands/render/render.js +13 -16
  44. package/dist/cli/commands/sites/create.d.ts +1 -1
  45. package/dist/cli/commands/sites/create.js +9 -5
  46. package/dist/cli/commands/sites/index.d.ts +1 -1
  47. package/dist/cli/commands/sites/index.js +6 -6
  48. package/dist/cli/commands/sites/ls.js +2 -2
  49. package/dist/cli/commands/sites/rm.d.ts +1 -1
  50. package/dist/cli/commands/sites/rm.js +4 -4
  51. package/dist/cli/commands/sites/rmall.d.ts +1 -1
  52. package/dist/cli/commands/sites/rmall.js +4 -4
  53. package/dist/cli/commands/still.d.ts +1 -1
  54. package/dist/cli/commands/still.js +10 -12
  55. package/dist/cli/get-aws-region.d.ts +1 -1
  56. package/dist/cli/get-aws-region.js +6 -7
  57. package/dist/cli/help.js +10 -10
  58. package/dist/cli/helpers/find-function-name.d.ts +1 -1
  59. package/dist/cli/helpers/find-function-name.js +5 -5
  60. package/dist/cli/index.d.ts +2 -2
  61. package/dist/cli/index.js +15 -17
  62. package/dist/cli/log.d.ts +5 -5
  63. package/dist/client.d.ts +1 -19
  64. package/dist/client.js +15 -30
  65. package/dist/defaults.d.ts +1 -1
  66. package/dist/defaults.js +1 -1
  67. package/dist/functions/aws-server-implementation.d.ts +2 -1
  68. package/dist/functions/aws-server-implementation.js +11 -2
  69. package/dist/functions/full-client-implementation.d.ts +1 -1
  70. package/dist/functions/full-client-implementation.js +0 -2
  71. package/dist/functions/helpers/get-current-region.d.ts +1 -1
  72. package/dist/functions/helpers/get-folder-files.d.ts +1 -1
  73. package/dist/functions/helpers/make-aws-artifact.d.ts +1 -1
  74. package/dist/functions/helpers/read-with-progress.d.ts +2 -3
  75. package/dist/functions/helpers/read-with-progress.js +6 -2
  76. package/dist/functions/index.d.ts +2 -3
  77. package/dist/functions/index.js +2 -4
  78. package/dist/index.d.ts +13 -32
  79. package/dist/index.js +24 -35
  80. package/dist/internals.d.ts +8 -12
  81. package/dist/internals.js +0 -4
  82. package/dist/shared/get-layers.d.ts +1 -4
  83. package/dist/shared/get-layers.js +3 -3
  84. package/dist/shared/get-s3-operations.d.ts +1 -1
  85. package/dist/shared/hosted-layers.d.ts +1 -1
  86. package/dist/shared/lambda-insights-extensions.d.ts +1 -1
  87. package/dist/shared/validate-timeout.js +3 -3
  88. package/package.json +22 -30
  89. package/remotionlambda-arm64.zip +0 -0
  90. package/dist/api/app-router-webhook.d.ts +0 -10
  91. package/dist/api/app-router-webhook.js +0 -43
  92. package/dist/api/bucket-exists.d.ts +0 -3
  93. package/dist/api/bucket-exists.js +0 -26
  94. package/dist/api/clean-items.d.ts +0 -16
  95. package/dist/api/clean-items.js +0 -25
  96. package/dist/api/create-bucket.d.ts +0 -3
  97. package/dist/api/create-bucket.js +0 -45
  98. package/dist/api/delete-function.d.ts +0 -4
  99. package/dist/api/delete-function.js +0 -15
  100. package/dist/api/delete-render.d.ts +0 -20
  101. package/dist/api/delete-render.js +0 -78
  102. package/dist/api/estimate-price.d.ts +0 -17
  103. package/dist/api/estimate-price.js +0 -45
  104. package/dist/api/express-webhook.d.ts +0 -3
  105. package/dist/api/express-webhook.js +0 -46
  106. package/dist/api/get-aws-client.d.ts +0 -30
  107. package/dist/api/get-aws-client.js +0 -56
  108. package/dist/api/get-buckets.d.ts +0 -9
  109. package/dist/api/get-buckets.js +0 -62
  110. package/dist/api/get-compositions-on-lambda.d.ts +0 -20
  111. package/dist/api/get-compositions-on-lambda.js +0 -60
  112. package/dist/api/get-functions.d.ts +0 -9
  113. package/dist/api/get-functions.js +0 -77
  114. package/dist/api/get-render-progress.d.ts +0 -16
  115. package/dist/api/get-render-progress.js +0 -45
  116. package/dist/api/get-sites.d.ts +0 -29
  117. package/dist/api/get-sites.js +0 -79
  118. package/dist/api/make-lambda-payload.d.ts +0 -57
  119. package/dist/api/make-lambda-payload.js +0 -150
  120. package/dist/api/pages-router-webhook.d.ts +0 -5
  121. package/dist/api/pages-router-webhook.js +0 -48
  122. package/dist/api/presign-url.d.ts +0 -14
  123. package/dist/api/presign-url.js +0 -59
  124. package/dist/api/render-media-on-lambda.d.ts +0 -63
  125. package/dist/api/render-media-on-lambda.js +0 -128
  126. package/dist/api/render-still-on-lambda.d.ts +0 -56
  127. package/dist/api/render-still-on-lambda.js +0 -118
  128. package/dist/api/speculate-function-name.d.ts +0 -6
  129. package/dist/api/speculate-function-name.js +0 -20
  130. package/dist/api/validate-webhook-signature.d.ts +0 -5
  131. package/dist/api/validate-webhook-signature.js +0 -28
  132. package/dist/cli/is-cli.d.ts +0 -2
  133. package/dist/cli/is-cli.js +0 -10
  134. package/dist/functions/aws-implementation.d.ts +0 -23
  135. package/dist/functions/aws-implementation.js +0 -97
  136. package/dist/functions/helpers/apply-lifecyle.d.ts +0 -8
  137. package/dist/functions/helpers/apply-lifecyle.js +0 -18
  138. package/dist/functions/helpers/get-output-url-from-metadata.d.ts +0 -3
  139. package/dist/functions/helpers/get-output-url-from-metadata.js +0 -12
  140. package/dist/functions/helpers/lifecycle.d.ts +0 -8
  141. package/dist/functions/helpers/lifecycle.js +0 -24
  142. package/dist/functions/helpers/parse-function-name.d.ts +0 -8
  143. package/dist/functions/helpers/parse-function-name.js +0 -17
  144. package/dist/functions/http-client.d.ts +0 -2
  145. package/dist/functions/http-client.js +0 -18
  146. package/dist/io/delete-file.d.ts +0 -3
  147. package/dist/io/delete-file.js +0 -12
  148. package/dist/io/head-file.d.ts +0 -3
  149. package/dist/io/head-file.js +0 -17
  150. package/dist/io/list-objects.d.ts +0 -3
  151. package/dist/io/list-objects.js +0 -67
  152. package/dist/io/read-file.d.ts +0 -9
  153. package/dist/io/read-file.js +0 -18
  154. package/dist/io/write-file.d.ts +0 -5
  155. package/dist/io/write-file.js +0 -55
  156. package/dist/pricing/price-per-1-s.d.ts +0 -37
  157. package/dist/pricing/price-per-1-s.js +0 -822
  158. package/dist/regions.d.ts +0 -3
  159. package/dist/regions.js +0 -48
  160. package/dist/shared/aws-clients.d.ts +0 -11
  161. package/dist/shared/aws-clients.js +0 -51
  162. package/dist/shared/call-lambda-async.d.ts +0 -3
  163. package/dist/shared/call-lambda-async.js +0 -20
  164. package/dist/shared/call-lambda-streaming.d.ts +0 -7
  165. package/dist/shared/call-lambda-streaming.js +0 -126
  166. package/dist/shared/call-lambda-sync.d.ts +0 -3
  167. package/dist/shared/call-lambda-sync.js +0 -30
  168. package/dist/shared/check-credentials.d.ts +0 -1
  169. package/dist/shared/check-credentials.js +0 -39
  170. package/dist/shared/constants.d.ts +0 -26
  171. package/dist/shared/constants.js +0 -29
  172. package/dist/shared/content-disposition-header.d.ts +0 -2
  173. package/dist/shared/content-disposition-header.js +0 -50
  174. package/dist/shared/convert-to-serve-url.d.ts +0 -6
  175. package/dist/shared/convert-to-serve-url.js +0 -14
  176. package/dist/shared/encode-aws-url-params.d.ts +0 -1
  177. package/dist/shared/encode-aws-url-params.js +0 -7
  178. package/dist/shared/get-account-id.d.ts +0 -3
  179. package/dist/shared/get-account-id.js +0 -15
  180. package/dist/shared/get-aws-urls.d.ts +0 -26
  181. package/dist/shared/get-aws-urls.js +0 -31
  182. package/dist/shared/get-credentials.d.ts +0 -9
  183. package/dist/shared/get-credentials.js +0 -55
  184. package/dist/shared/get-env-variable.d.ts +0 -1
  185. package/dist/shared/get-env-variable.js +0 -15
  186. package/dist/shared/get-function-version.d.ts +0 -7
  187. package/dist/shared/get-function-version.js +0 -32
  188. package/dist/shared/get-s3-client.d.ts +0 -9
  189. package/dist/shared/get-s3-client.js +0 -14
  190. package/dist/shared/get-service-client.d.ts +0 -23
  191. package/dist/shared/get-service-client.js +0 -121
  192. package/dist/shared/is-flaky-error.d.ts +0 -1
  193. package/dist/shared/is-flaky-error.js +0 -77
  194. package/dist/shared/is-in-lambda.d.ts +0 -1
  195. package/dist/shared/is-in-lambda.js +0 -9
  196. package/dist/shared/is-likely-to-have-aws-profile.d.ts +0 -1
  197. package/dist/shared/is-likely-to-have-aws-profile.js +0 -50
  198. package/dist/shared/lambda-version-string.d.ts +0 -1
  199. package/dist/shared/lambda-version-string.js +0 -7
  200. package/dist/shared/lifecycle-rules.d.ts +0 -10
  201. package/dist/shared/lifecycle-rules.js +0 -61
  202. package/dist/shared/make-s3-url.d.ts +0 -6
  203. package/dist/shared/make-s3-url.js +0 -7
  204. package/dist/shared/p-limit.d.ts +0 -1
  205. package/dist/shared/p-limit.js +0 -57
  206. package/dist/shared/random-hash.d.ts +0 -1
  207. package/dist/shared/random-hash.js +0 -13
  208. package/dist/shared/validate-aws-region.d.ts +0 -2
  209. package/dist/shared/validate-aws-region.js +0 -9
  210. package/dist/shared/validate-bucketname.d.ts +0 -4
  211. package/dist/shared/validate-bucketname.js +0 -15
  212. package/dist/shared/validate-disk-size-in-mb.d.ts +0 -1
  213. package/dist/shared/validate-disk-size-in-mb.js +0 -23
  214. package/dist/shared/validate-lambda-codec.d.ts +0 -2
  215. package/dist/shared/validate-lambda-codec.js +0 -21
  216. package/dist/shared/validate-memory-size.d.ts +0 -1
  217. package/dist/shared/validate-memory-size.js +0 -22
  218. package/dist/shared/validate-presign-expiration.d.ts +0 -1
  219. package/dist/shared/validate-presign-expiration.js +0 -29
  220. package/dist/shared/validate-serveurl.d.ts +0 -1
  221. package/dist/shared/validate-serveurl.js +0 -9
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lambdaDeleteFileImplementation = void 0;
4
- const client_s3_1 = require("@aws-sdk/client-s3");
5
- const get_s3_client_1 = require("../shared/get-s3-client");
6
- const lambdaDeleteFileImplementation = async ({ bucketName, key, region, customCredentials, forcePathStyle, }) => {
7
- await (0, get_s3_client_1.getS3Client)({ region, customCredentials, forcePathStyle }).send(new client_s3_1.DeleteObjectCommand({
8
- Bucket: bucketName,
9
- Key: key,
10
- }));
11
- };
12
- exports.lambdaDeleteFileImplementation = lambdaDeleteFileImplementation;
@@ -1,3 +0,0 @@
1
- import type { ProviderSpecifics } from '@remotion/serverless';
2
- import type { AwsProvider } from '../functions/aws-implementation';
3
- export declare const lambdaHeadFileImplementation: ProviderSpecifics<AwsProvider>['headFile'];
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lambdaHeadFileImplementation = void 0;
4
- const client_s3_1 = require("@aws-sdk/client-s3");
5
- const get_s3_client_1 = require("../shared/get-s3-client");
6
- const lambdaHeadFileImplementation = async ({ bucketName, key, region, customCredentials, forcePathStyle, }) => {
7
- const head = await (0, get_s3_client_1.getS3Client)({
8
- region,
9
- customCredentials,
10
- forcePathStyle,
11
- }).send(new client_s3_1.HeadObjectCommand({
12
- Bucket: bucketName,
13
- Key: key,
14
- }));
15
- return head;
16
- };
17
- exports.lambdaHeadFileImplementation = lambdaHeadFileImplementation;
@@ -1,3 +0,0 @@
1
- import type { ProviderSpecifics } from '@remotion/serverless';
2
- import type { AwsProvider } from '../functions/aws-implementation';
3
- export declare const lambdaLsImplementation: ProviderSpecifics<AwsProvider>['listObjects'];
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lambdaLsImplementation = void 0;
4
- const client_s3_1 = require("@aws-sdk/client-s3");
5
- const get_s3_client_1 = require("../shared/get-s3-client");
6
- const lambdaLsImplementation = async ({ bucketName, prefix, region, expectedBucketOwner, continuationToken, forcePathStyle, }) => {
7
- var _a, _b, _c, _d;
8
- try {
9
- const list = await (0, get_s3_client_1.getS3Client)({
10
- region,
11
- customCredentials: null,
12
- forcePathStyle,
13
- }).send(new client_s3_1.ListObjectsV2Command({
14
- Bucket: bucketName,
15
- Prefix: prefix,
16
- ExpectedBucketOwner: expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined,
17
- ContinuationToken: continuationToken,
18
- }));
19
- if (list.NextContinuationToken) {
20
- return [
21
- ...((_a = list.Contents) !== null && _a !== void 0 ? _a : []).map((o) => {
22
- return {
23
- Key: o.Key,
24
- LastModified: o.LastModified,
25
- ETag: o.ETag,
26
- Size: o.Size,
27
- };
28
- }),
29
- ...(await (0, exports.lambdaLsImplementation)({
30
- bucketName,
31
- prefix,
32
- expectedBucketOwner,
33
- region,
34
- continuationToken: list.NextContinuationToken,
35
- forcePathStyle,
36
- })),
37
- ];
38
- }
39
- return ((_c = (_b = (list.Contents || [])) === null || _b === void 0 ? void 0 : _b.map((o) => {
40
- return {
41
- Key: o.Key,
42
- LastModified: o.LastModified,
43
- ETag: o.ETag,
44
- Size: o.Size,
45
- };
46
- })) !== null && _c !== void 0 ? _c : []);
47
- }
48
- catch (err) {
49
- if (!expectedBucketOwner) {
50
- throw err;
51
- }
52
- // Prevent from accessing a foreign bucket, retry without ExpectedBucketOwner and see if it works. If it works then it's an owner mismatch.
53
- if ((_d = err.stack) === null || _d === void 0 ? void 0 : _d.includes('AccessDenied')) {
54
- await (0, get_s3_client_1.getS3Client)({
55
- region,
56
- customCredentials: null,
57
- forcePathStyle,
58
- }).send(new client_s3_1.ListObjectsV2Command({
59
- Bucket: bucketName,
60
- Prefix: prefix,
61
- }));
62
- throw new Error(`Bucket owner mismatch: Expected the bucket ${bucketName} to be owned by you (AWS Account ID: ${expectedBucketOwner}) but it's not the case. Did you accidentially specify the wrong bucket?`);
63
- }
64
- throw err;
65
- }
66
- };
67
- exports.lambdaLsImplementation = lambdaLsImplementation;
@@ -1,9 +0,0 @@
1
- import type { Readable } from 'stream';
2
- import type { AwsRegion } from '../regions';
3
- export declare const lambdaReadFileImplementation: ({ bucketName, key, region, expectedBucketOwner, forcePathStyle, }: {
4
- bucketName: string;
5
- key: string;
6
- region: AwsRegion;
7
- expectedBucketOwner: string | null;
8
- forcePathStyle: boolean;
9
- }) => Promise<Readable>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lambdaReadFileImplementation = void 0;
4
- const client_s3_1 = require("@aws-sdk/client-s3");
5
- const get_s3_client_1 = require("../shared/get-s3-client");
6
- const lambdaReadFileImplementation = async ({ bucketName, key, region, expectedBucketOwner, forcePathStyle, }) => {
7
- const { Body } = await (0, get_s3_client_1.getS3Client)({
8
- region,
9
- customCredentials: null,
10
- forcePathStyle,
11
- }).send(new client_s3_1.GetObjectCommand({
12
- Bucket: bucketName,
13
- Key: key,
14
- ExpectedBucketOwner: expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined,
15
- }));
16
- return Body;
17
- };
18
- exports.lambdaReadFileImplementation = lambdaReadFileImplementation;
@@ -1,5 +0,0 @@
1
- import type { WriteFileInput } from '@remotion/serverless';
2
- import type { AwsProvider } from '../functions/aws-implementation';
3
- export declare const lambdaWriteFileImplementation: (params: WriteFileInput<AwsProvider> & {
4
- retries?: number;
5
- }) => Promise<void>;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.lambdaWriteFileImplementation = void 0;
7
- const client_s3_1 = require("@aws-sdk/client-s3");
8
- const mime_types_1 = __importDefault(require("mime-types"));
9
- const content_disposition_header_1 = require("../shared/content-disposition-header");
10
- const get_s3_client_1 = require("../shared/get-s3-client");
11
- const tryLambdaWriteFile = async ({ bucketName, key, body, region, privacy, expectedBucketOwner, downloadBehavior, customCredentials, forcePathStyle, }) => {
12
- await (0, get_s3_client_1.getS3Client)({
13
- region,
14
- customCredentials: customCredentials,
15
- forcePathStyle,
16
- }).send(new client_s3_1.PutObjectCommand({
17
- Bucket: bucketName,
18
- Key: key,
19
- Body: body,
20
- ACL: privacy === 'no-acl'
21
- ? undefined
22
- : privacy === 'private'
23
- ? 'private'
24
- : 'public-read',
25
- ExpectedBucketOwner: customCredentials
26
- ? undefined
27
- : (expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined),
28
- ContentType: mime_types_1.default.lookup(key) || 'application/octet-stream',
29
- ContentDisposition: (0, content_disposition_header_1.getContentDispositionHeader)(downloadBehavior),
30
- }));
31
- };
32
- const lambdaWriteFileImplementation = async (params) => {
33
- var _a;
34
- const remainingRetries = (_a = params.retries) !== null && _a !== void 0 ? _a : 2;
35
- try {
36
- await tryLambdaWriteFile(params);
37
- }
38
- catch (err) {
39
- if (remainingRetries === 0) {
40
- throw err;
41
- }
42
- const backoff = 2 ** (2 - remainingRetries) * 2000;
43
- await new Promise((resolve) => {
44
- setTimeout(resolve, backoff);
45
- });
46
- console.warn('Failed to write file to storage:');
47
- console.warn(err);
48
- console.warn(`Retrying (${remainingRetries} retries remaining)...`);
49
- return (0, exports.lambdaWriteFileImplementation)({
50
- ...params,
51
- retries: remainingRetries - 1,
52
- });
53
- }
54
- };
55
- exports.lambdaWriteFileImplementation = lambdaWriteFileImplementation;
@@ -1,37 +0,0 @@
1
- import type { AwsRegion } from '../regions';
2
- export declare const pricing: {
3
- [key in AwsRegion]: {
4
- 'Lambda Duration': {
5
- rateCode: string;
6
- price: string;
7
- };
8
- 'Lambda Duration-Provisioned': {
9
- rateCode: string;
10
- price: string;
11
- };
12
- 'Lambda Provisioned-Concurrency': {
13
- rateCode: string;
14
- price: string;
15
- };
16
- 'Lambda Requests': {
17
- rateCode: string;
18
- price: string;
19
- };
20
- 'Lambda Duration-ARM': {
21
- rateCode: string;
22
- price: string;
23
- };
24
- 'Lambda Requests-ARM': {
25
- rateCode: string;
26
- price: string;
27
- };
28
- 'Lambda Storage-Duration': {
29
- rateCode: string;
30
- price: string;
31
- };
32
- 'Lambda Storage-Duration-ARM': {
33
- rateCode: string;
34
- price: string;
35
- };
36
- };
37
- };