@remotion/lambda 4.0.0-copy.4 → 4.0.0-esm.17

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 (100) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/admin/bundle-lambda.js +20 -4
  3. package/dist/admin/generate-etag-list.d.ts +1 -0
  4. package/dist/admin/generate-etag-list.js +14 -0
  5. package/dist/admin/make-layer-public.js +23 -1
  6. package/dist/api/deploy-function.js +3 -1
  7. package/dist/api/deploy-site.d.ts +5 -0
  8. package/dist/api/deploy-site.js +39 -21
  9. package/dist/api/get-aws-client.d.ts +2 -0
  10. package/dist/api/get-aws-client.js +2 -0
  11. package/dist/api/get-buckets.js +26 -9
  12. package/dist/api/get-compositions-on-lambda.d.ts +2 -1
  13. package/dist/api/get-compositions-on-lambda.js +1 -3
  14. package/dist/api/get-or-create-bucket.js +2 -7
  15. package/dist/api/get-regions.d.ts +5 -1
  16. package/dist/api/get-regions.js +5 -2
  17. package/dist/api/iam-validation/simulate-rule.js +0 -22
  18. package/dist/api/iam-validation/simulate.js +24 -5
  19. package/dist/api/iam-validation/user-permissions.js +0 -8
  20. package/dist/api/render-media-on-lambda.d.ts +2 -1
  21. package/dist/api/render-media-on-lambda.js +6 -10
  22. package/dist/api/render-still-on-lambda.d.ts +2 -1
  23. package/dist/api/render-still-on-lambda.js +1 -3
  24. package/dist/api/upload-dir.d.ts +4 -3
  25. package/dist/api/upload-dir.js +33 -19
  26. package/dist/cli/args.d.ts +1 -0
  27. package/dist/cli/commands/compositions/index.js +1 -3
  28. package/dist/cli/commands/regions.js +5 -1
  29. package/dist/cli/commands/render/progress.d.ts +6 -3
  30. package/dist/cli/commands/render/progress.js +49 -39
  31. package/dist/cli/commands/render/render.js +17 -4
  32. package/dist/cli/commands/sites/create.js +12 -4
  33. package/dist/cli/commands/still.js +5 -9
  34. package/dist/cli/helpers/progress-bar.d.ts +9 -3
  35. package/dist/cli/helpers/progress-bar.js +19 -3
  36. package/dist/cli/index.js +6 -1
  37. package/dist/functions/compositions.js +10 -3
  38. package/dist/functions/helpers/concat-videos.d.ts +10 -6
  39. package/dist/functions/helpers/concat-videos.js +8 -25
  40. package/dist/functions/helpers/create-post-render-data.js +0 -12
  41. package/dist/functions/helpers/expected-out-name.js +1 -1
  42. package/dist/functions/helpers/get-chromium-executable-path.js +2 -1
  43. package/dist/functions/helpers/get-current-region.d.ts +1 -1
  44. package/dist/functions/helpers/get-encoding-metadata.d.ts +4 -8
  45. package/dist/functions/helpers/get-encoding-metadata.js +4 -18
  46. package/dist/functions/helpers/get-final-encoding-status.d.ts +2 -4
  47. package/dist/functions/helpers/get-final-encoding-status.js +1 -4
  48. package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +1 -5
  49. package/dist/functions/helpers/get-lambdas-invoked-stats.js +1 -9
  50. package/dist/functions/helpers/get-overall-progress.d.ts +2 -1
  51. package/dist/functions/helpers/get-overall-progress.js +7 -5
  52. package/dist/functions/helpers/get-progress.js +40 -26
  53. package/dist/functions/helpers/get-rendered-frames-progress.d.ts +8 -0
  54. package/dist/functions/helpers/get-rendered-frames-progress.js +37 -0
  55. package/dist/functions/launch.js +50 -38
  56. package/dist/functions/renderer.js +19 -24
  57. package/dist/functions/start.js +9 -2
  58. package/dist/functions/still.js +16 -5
  59. package/dist/index.d.ts +9 -2
  60. package/dist/index.js +10 -2
  61. package/dist/pricing/aws-regions.d.ts +2 -1
  62. package/dist/pricing/aws-regions.js +31 -1
  63. package/dist/pricing/price-per-1-s.js +413 -39
  64. package/dist/shared/aws-clients.d.ts +3 -0
  65. package/dist/shared/aws-clients.js +75 -13
  66. package/dist/shared/check-credentials.js +3 -0
  67. package/dist/shared/chunk-progress.d.ts +9 -0
  68. package/dist/shared/chunk-progress.js +2034 -0
  69. package/dist/shared/constants.d.ts +13 -12
  70. package/dist/shared/convert-to-serve-url.d.ts +5 -1
  71. package/dist/shared/convert-to-serve-url.js +1 -5
  72. package/dist/shared/deserialize-input-props.d.ts +1 -1
  73. package/dist/shared/deserialize-input-props.js +1 -1
  74. package/dist/shared/function-zip-path.d.ts +2 -1
  75. package/dist/shared/function-zip-path.js +3 -2
  76. package/dist/shared/get-account-id.js +4 -6
  77. package/dist/shared/get-etag.d.ts +1 -0
  78. package/dist/shared/get-etag.js +24 -0
  79. package/dist/shared/get-s3-operations.d.ts +10 -0
  80. package/dist/shared/get-s3-operations.js +36 -0
  81. package/dist/shared/hosted-layers.js +368 -60
  82. package/dist/shared/invoke-webhook.d.ts +2 -0
  83. package/dist/shared/parse-chunk-key.d.ts +4 -0
  84. package/dist/shared/parse-chunk-key.js +14 -0
  85. package/dist/shared/read-dir.d.ts +9 -0
  86. package/dist/shared/read-dir.js +57 -0
  87. package/dist/shared/validate-bucketname.d.ts +5 -0
  88. package/dist/shared/validate-bucketname.js +19 -1
  89. package/dist/shared/validate-lambda-codec.d.ts +1 -1
  90. package/dist/shared/validate-lambda-codec.js +0 -1
  91. package/package.json +18 -14
  92. package/remotionlambda-arm64.zip +0 -0
  93. package/remotionlambda-x64.zip +0 -0
  94. package/remotionlambda.zip +0 -0
  95. package/.prettierrc.js +0 -14
  96. package/dist/api/enable-s3-website.d.ts +0 -5
  97. package/dist/api/enable-s3-website.js +0 -16
  98. package/dist/shared/get-cloudwatch-stream-url.d.ts +0 -8
  99. package/dist/shared/get-cloudwatch-stream-url.js +0 -7
  100. package/tsconfig.json +0 -16
@@ -0,0 +1,9 @@
1
+ export declare function readDirectory({ dir, etags, originalDir, }: {
2
+ dir: string;
3
+ etags: {
4
+ [key: string]: string;
5
+ };
6
+ originalDir: string;
7
+ }): Promise<{
8
+ [key: string]: string;
9
+ }>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.readDirectory = void 0;
27
+ const fs = __importStar(require("fs"));
28
+ const path = __importStar(require("path"));
29
+ const get_etag_1 = require("./get-etag");
30
+ // Function to recursively read a directory and return a list of files
31
+ // with their etags and file names
32
+ async function readDirectory({ dir, etags, originalDir, }) {
33
+ const files = fs.readdirSync(dir);
34
+ for (const file of files) {
35
+ if (file.startsWith('.DS_Store'))
36
+ continue;
37
+ const filePath = path.join(dir, file);
38
+ if (fs.lstatSync(filePath).isDirectory()) {
39
+ etags = {
40
+ ...etags,
41
+ ...(await readDirectory({ dir: filePath, etags, originalDir })),
42
+ };
43
+ continue;
44
+ }
45
+ // eslint-disable-next-line no-lonely-if
46
+ if (fs.lstatSync(filePath).isSymbolicLink()) {
47
+ const realPath = fs.realpathSync(filePath);
48
+ etags[path.relative(originalDir, filePath)] = await (0, get_etag_1.getEtagOfFile)(realPath);
49
+ }
50
+ else {
51
+ etags[path.relative(originalDir, filePath)] = await (0, get_etag_1.getEtagOfFile)(filePath);
52
+ }
53
+ }
54
+ // Return the list of files with their etags and file names
55
+ return etags;
56
+ }
57
+ exports.readDirectory = readDirectory;
@@ -1,3 +1,8 @@
1
+ import type { AwsRegion } from '../client';
1
2
  export declare const validateBucketName: (bucketName: unknown, options: {
2
3
  mustStartWithRemotion: boolean;
3
4
  }) => void;
5
+ export declare const parseBucketName: (name: string) => {
6
+ region: AwsRegion | null;
7
+ };
8
+ export declare const makeBucketName: (region: AwsRegion) => string;
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateBucketName = void 0;
3
+ exports.makeBucketName = exports.parseBucketName = exports.validateBucketName = void 0;
4
+ const regions_1 = require("../regions");
4
5
  const constants_1 = require("./constants");
6
+ const random_hash_1 = require("./random-hash");
5
7
  const validateBucketName = (bucketName, options) => {
6
8
  if (typeof bucketName !== 'string') {
7
9
  throw new TypeError(`'bucketName' must be a string, but is ${JSON.stringify(bucketName)}`);
@@ -15,3 +17,19 @@ const validateBucketName = (bucketName, options) => {
15
17
  }
16
18
  };
17
19
  exports.validateBucketName = validateBucketName;
20
+ const parseBucketName = (name) => {
21
+ const parsed = name.match(new RegExp(`^${constants_1.REMOTION_BUCKET_PREFIX}(.*)-([a-z0-9A-Z]+)$`));
22
+ const region = parsed === null || parsed === void 0 ? void 0 : parsed[1];
23
+ if (!region) {
24
+ return { region: null };
25
+ }
26
+ const realRegionFound = regions_1.AWS_REGIONS.find((r) => r.replace(/-/g, '') === region);
27
+ return { region: realRegionFound !== null && realRegionFound !== void 0 ? realRegionFound : null };
28
+ };
29
+ 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,4 @@
1
- declare const lambdaCodecs: readonly ["h264-mkv", "h264", "vp8", "mp3", "aac", "wav", "gif", "prores"];
1
+ declare const lambdaCodecs: readonly ["h264", "vp8", "mp3", "aac", "wav", "gif", "prores"];
2
2
  export declare type LambdaCodec = typeof lambdaCodecs[number];
3
3
  export declare const validateLambdaCodec: (codec: unknown) => LambdaCodec;
4
4
  export {};
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateLambdaCodec = void 0;
4
4
  const lambdaCodecs = [
5
- 'h264-mkv',
6
5
  'h264',
7
6
  'vp8',
8
7
  'mp3',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "4.0.0-copy.4+07d4897fb",
3
+ "version": "4.0.0-esm.17+da08690d2",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -23,20 +23,22 @@
23
23
  "url": "https://github.com/JonnyBurger/remotion"
24
24
  },
25
25
  "dependencies": {
26
- "@aws-sdk/abort-controller": "3.190.0",
27
- "@aws-sdk/client-cloudwatch-logs": "3.190.0",
28
- "@aws-sdk/client-iam": "3.190.0",
29
- "@aws-sdk/client-lambda": "3.190.0",
30
- "@aws-sdk/client-s3": "3.190.0",
31
- "@aws-sdk/client-service-quotas": "3.190.0",
32
- "@aws-sdk/lib-storage": "3.190.0",
33
- "@aws-sdk/s3-request-presigner": "3.190.0",
34
- "@remotion/bundler": "4.0.0-copy.4+07d4897fb",
35
- "@remotion/cli": "4.0.0-copy.4+07d4897fb",
36
- "@remotion/renderer": "4.0.0-copy.4+07d4897fb",
26
+ "@aws-sdk/abort-controller": "3.215.0",
27
+ "@aws-sdk/client-cloudwatch-logs": "3.215.0",
28
+ "@aws-sdk/client-iam": "3.215.0",
29
+ "@aws-sdk/client-lambda": "3.215.0",
30
+ "@aws-sdk/client-s3": "3.215.0",
31
+ "@aws-sdk/client-service-quotas": "3.215.0",
32
+ "@aws-sdk/client-sts": "3.215.0",
33
+ "@aws-sdk/credential-providers": "3.215.0",
34
+ "@aws-sdk/lib-storage": "3.215.0",
35
+ "@aws-sdk/s3-request-presigner": "3.215.0",
36
+ "@remotion/bundler": "4.0.0-esm.17+da08690d2",
37
+ "@remotion/cli": "4.0.0-esm.17+da08690d2",
38
+ "@remotion/renderer": "4.0.0-esm.17+da08690d2",
37
39
  "aws-policies": "^1.0.1",
38
40
  "mime-types": "2.1.34",
39
- "remotion": "4.0.0-copy.4+07d4897fb"
41
+ "remotion": "4.0.0-esm.17+da08690d2"
40
42
  },
41
43
  "peerDependencies": {
42
44
  "react": ">=16.8.0",
@@ -44,6 +46,8 @@
44
46
  },
45
47
  "devDependencies": {
46
48
  "@jonny/eslint-config": "3.0.266",
49
+ "@remotion/compositor-linux-arm64-musl": "4.0.0-esm.17+da08690d2",
50
+ "@remotion/compositor-linux-x64-musl": "4.0.0-esm.17+da08690d2",
47
51
  "@types/mime-types": "2.1.1",
48
52
  "@types/minimist": "1.2.2",
49
53
  "@types/node": "^14.14.14",
@@ -59,5 +63,5 @@
59
63
  "publishConfig": {
60
64
  "access": "public"
61
65
  },
62
- "gitHead": "07d4897fb44920b58dc85cf7465d990a0a139994"
66
+ "gitHead": "da08690d241e1f5d6dde8a8d89f3379a54ec7681"
63
67
  }
Binary file
Binary file
Binary file
package/.prettierrc.js DELETED
@@ -1,14 +0,0 @@
1
- module.exports = {
2
- singleQuote: true,
3
- bracketSpacing: false,
4
- useTabs: true,
5
- overrides: [
6
- {
7
- files: ['*.yml'],
8
- options: {
9
- singleQuote: false,
10
- },
11
- },
12
- ],
13
- plugins: [require.resolve('prettier-plugin-organize-imports')],
14
- };
@@ -1,5 +0,0 @@
1
- import type { AwsRegion } from '../pricing/aws-regions';
2
- export declare const enableS3Website: ({ region, bucketName, }: {
3
- region: AwsRegion;
4
- bucketName: string;
5
- }) => Promise<void>;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.enableS3Website = void 0;
4
- const client_s3_1 = require("@aws-sdk/client-s3");
5
- const aws_clients_1 = require("../shared/aws-clients");
6
- const enableS3Website = async ({ region, bucketName, }) => {
7
- await (0, aws_clients_1.getS3Client)(region, null).send(new client_s3_1.PutBucketWebsiteCommand({
8
- Bucket: bucketName,
9
- WebsiteConfiguration: {
10
- IndexDocument: {
11
- Suffix: 'index.html',
12
- },
13
- },
14
- }));
15
- };
16
- exports.enableS3Website = enableS3Website;
@@ -1,8 +0,0 @@
1
- import type { AwsRegion } from '../client';
2
- import type { LambdaRoutines } from './constants';
3
- export declare const getCloudwatchStreamUrl: ({ region, functionName, method, renderId, }: {
4
- region: AwsRegion;
5
- functionName: string;
6
- method: LambdaRoutines;
7
- renderId: string;
8
- }) => string;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCloudwatchStreamUrl = void 0;
4
- const getCloudwatchStreamUrl = ({ region, functionName, method, renderId, }) => {
5
- return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logsV2:log-groups/log-group/$252Faws$252Flambda$252F${functionName}/log-events$3FfilterPattern$3D$2522method$253D${method}$252CrenderId$253D${renderId}$2522`;
6
- };
7
- exports.getCloudwatchStreamUrl = getCloudwatchStreamUrl;
package/tsconfig.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "extends": "../tsconfig.settings.json",
3
- "compilerOptions": {
4
- "composite": true,
5
- "rootDir": "src",
6
- "outDir": "dist",
7
- "lib": ["es2019", "dom"]
8
- },
9
- "include": ["src"],
10
- "exclude": ["**/__mocks__/*"],
11
- "references": [
12
- {"path": "../core"},
13
- {"path": "../bundler"},
14
- {"path": "../renderer"}
15
- ]
16
- }