@remotion/lambda 4.0.201 → 4.0.204

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 (133) hide show
  1. package/dist/api/bucket-exists.js +6 -2
  2. package/dist/api/clean-items.d.ts +2 -1
  3. package/dist/api/clean-items.js +2 -1
  4. package/dist/api/create-bucket.js +5 -5
  5. package/dist/api/delete-render.d.ts +2 -0
  6. package/dist/api/delete-render.js +6 -0
  7. package/dist/api/delete-site.d.ts +11 -5
  8. package/dist/api/delete-site.js +7 -1
  9. package/dist/api/deploy-site.d.ts +5 -3
  10. package/dist/api/deploy-site.js +7 -2
  11. package/dist/api/download-media.d.ts +2 -0
  12. package/dist/api/download-media.js +4 -1
  13. package/dist/api/get-aws-client.d.ts +2 -1
  14. package/dist/api/get-aws-client.js +2 -1
  15. package/dist/api/get-buckets.js +11 -3
  16. package/dist/api/get-compositions-on-lambda.d.ts +2 -1
  17. package/dist/api/get-compositions-on-lambda.js +3 -1
  18. package/dist/api/get-or-create-bucket.js +1 -0
  19. package/dist/api/get-render-progress.d.ts +1 -0
  20. package/dist/api/get-sites.d.ts +9 -4
  21. package/dist/api/get-sites.js +15 -5
  22. package/dist/api/make-lambda-payload.d.ts +4 -3
  23. package/dist/api/make-lambda-payload.js +9 -4
  24. package/dist/api/presign-url.d.ts +8 -3
  25. package/dist/api/presign-url.js +26 -12
  26. package/dist/api/render-media-on-lambda.d.ts +1 -0
  27. package/dist/api/render-media-on-lambda.js +2 -1
  28. package/dist/api/render-still-on-lambda.d.ts +1 -0
  29. package/dist/api/render-still-on-lambda.js +2 -1
  30. package/dist/api/upload-dir.d.ts +2 -1
  31. package/dist/api/upload-dir.js +2 -2
  32. package/dist/cli/args.d.ts +1 -0
  33. package/dist/cli/commands/render/render.js +3 -1
  34. package/dist/cli/commands/sites/create.js +3 -1
  35. package/dist/cli/commands/sites/rm.js +1 -0
  36. package/dist/cli/commands/sites/rmall.js +1 -0
  37. package/dist/cli/commands/still.d.ts +6 -1
  38. package/dist/cli/commands/still.js +2 -1
  39. package/dist/cli/index.js +6 -1
  40. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
  41. package/dist/functions/helpers/cleanup-props.d.ts +2 -1
  42. package/dist/functions/helpers/cleanup-props.js +3 -1
  43. package/dist/functions/helpers/expected-out-name.d.ts +1 -1
  44. package/dist/functions/helpers/find-output-file-in-bucket.d.ts +2 -1
  45. package/dist/functions/helpers/find-output-file-in-bucket.js +2 -1
  46. package/dist/functions/helpers/get-browser-instance.d.ts +3 -2
  47. package/dist/functions/helpers/get-browser-instance.js +3 -4
  48. package/dist/functions/helpers/get-current-region.d.ts +1 -1
  49. package/dist/functions/helpers/get-custom-out-name.d.ts +1 -1
  50. package/dist/functions/helpers/get-overall-progress-s3.d.ts +2 -1
  51. package/dist/functions/helpers/get-overall-progress-s3.js +2 -1
  52. package/dist/functions/helpers/get-progress.d.ts +2 -1
  53. package/dist/functions/helpers/get-progress.js +2 -1
  54. package/dist/functions/helpers/io.d.ts +3 -33
  55. package/dist/functions/helpers/io.js +3 -104
  56. package/dist/functions/helpers/merge-chunks.d.ts +1 -0
  57. package/dist/functions/helpers/merge-chunks.js +2 -0
  58. package/dist/functions/helpers/overall-render-progress.d.ts +2 -1
  59. package/dist/functions/helpers/overall-render-progress.js +2 -1
  60. package/dist/functions/helpers/print-cloudwatch-helper.d.ts +1 -1
  61. package/dist/functions/helpers/print-cloudwatch-helper.js +3 -3
  62. package/dist/functions/helpers/read-with-progress.d.ts +2 -1
  63. package/dist/functions/helpers/read-with-progress.js +2 -2
  64. package/dist/functions/helpers/write-lambda-error.d.ts +2 -3
  65. package/dist/functions/helpers/write-lambda-error.js +3 -2
  66. package/dist/functions/launch.js +8 -0
  67. package/dist/functions/progress.js +1 -0
  68. package/dist/functions/provider-implementation.d.ts +0 -0
  69. package/dist/functions/provider-implementation.js +1 -0
  70. package/dist/functions/renderer.js +2 -0
  71. package/dist/functions/start.js +3 -0
  72. package/dist/functions/still.js +6 -0
  73. package/dist/index.d.ts +2 -2
  74. package/dist/internals.d.ts +11 -9
  75. package/dist/io/delete-file.js +2 -2
  76. package/dist/io/head-file.js +6 -2
  77. package/dist/io/list-objects.js +12 -3
  78. package/dist/io/read-file.d.ts +2 -1
  79. package/dist/io/read-file.js +6 -2
  80. package/dist/io/write-file.js +6 -2
  81. package/dist/shared/aws-clients.js +15 -2
  82. package/dist/shared/cleanup-serialized-input-props.d.ts +4 -2
  83. package/dist/shared/cleanup-serialized-input-props.js +4 -2
  84. package/dist/shared/compress-props.d.ts +8 -6
  85. package/dist/shared/compress-props.js +11 -14
  86. package/dist/shared/get-s3-client.d.ts +5 -1
  87. package/dist/shared/get-s3-client.js +2 -1
  88. package/dist/shared/get-service-client.d.ts +2 -1
  89. package/dist/shared/get-service-client.js +4 -2
  90. package/dist/shared/lifecycle-rules.d.ts +2 -1
  91. package/dist/shared/lifecycle-rules.js +17 -7
  92. package/package.json +11 -11
  93. package/remotionlambda-arm64.zip +0 -0
  94. package/dist/functions/helpers/check-if-render-exists.d.ts +0 -3
  95. package/dist/functions/helpers/check-if-render-exists.js +0 -15
  96. package/dist/functions/helpers/delete-chunks.d.ts +0 -9
  97. package/dist/functions/helpers/delete-chunks.js +0 -25
  98. package/dist/functions/helpers/get-cleanup-progress.d.ts +0 -10
  99. package/dist/functions/helpers/get-cleanup-progress.js +0 -35
  100. package/dist/functions/helpers/get-encoding-metadata.d.ts +0 -7
  101. package/dist/functions/helpers/get-encoding-metadata.js +0 -15
  102. package/dist/functions/helpers/get-encoding-progress-step-size.d.ts +0 -1
  103. package/dist/functions/helpers/get-encoding-progress-step-size.js +0 -7
  104. package/dist/functions/helpers/get-files-to-delete.d.ts +0 -10
  105. package/dist/functions/helpers/get-files-to-delete.js +0 -52
  106. package/dist/functions/helpers/get-final-encoding-status.d.ts +0 -6
  107. package/dist/functions/helpers/get-final-encoding-status.js +0 -18
  108. package/dist/functions/helpers/get-folder-size.d.ts +0 -1
  109. package/dist/functions/helpers/get-folder-size.js +0 -8
  110. package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +0 -8
  111. package/dist/functions/helpers/get-lambdas-invoked-stats.js +0 -14
  112. package/dist/functions/helpers/get-post-render-data.d.ts +0 -8
  113. package/dist/functions/helpers/get-post-render-data.js +0 -22
  114. package/dist/functions/helpers/get-render-metadata.d.ts +0 -8
  115. package/dist/functions/helpers/get-render-metadata.js +0 -17
  116. package/dist/functions/helpers/get-rendered-frames-progress.d.ts +0 -8
  117. package/dist/functions/helpers/get-rendered-frames-progress.js +0 -37
  118. package/dist/functions/helpers/get-time-to-finish.d.ts +0 -5
  119. package/dist/functions/helpers/get-time-to-finish.js +0 -13
  120. package/dist/functions/helpers/streaming-payloads.d.ts +0 -19
  121. package/dist/functions/helpers/streaming-payloads.js +0 -25
  122. package/dist/functions/helpers/write-post-render-data.d.ts +0 -9
  123. package/dist/functions/helpers/write-post-render-data.js +0 -18
  124. package/dist/functions/merge.d.ts +0 -9
  125. package/dist/functions/merge.js +0 -61
  126. package/dist/shared/chunk-progress.d.ts +0 -9
  127. package/dist/shared/chunk-progress.js +0 -2034
  128. package/dist/shared/parse-chunk-key.d.ts +0 -5
  129. package/dist/shared/parse-chunk-key.js +0 -15
  130. package/dist/shared/parse-lambda-initialized-key.d.ts +0 -5
  131. package/dist/shared/parse-lambda-initialized-key.js +0 -15
  132. package/dist/shared/serialize-props.d.ts +0 -14
  133. package/dist/shared/serialize-props.js +0 -36
@@ -7,6 +7,7 @@ const getCloudWatchLogsClient = (region) => {
7
7
  region,
8
8
  service: 'cloudwatch',
9
9
  customCredentials: null,
10
+ forcePathStyle: false,
10
11
  });
11
12
  };
12
13
  exports.getCloudWatchLogsClient = getCloudWatchLogsClient;
@@ -17,11 +18,17 @@ _timeoutInTest) => {
17
18
  region,
18
19
  service: 'lambda',
19
20
  customCredentials: null,
21
+ forcePathStyle: false,
20
22
  });
21
23
  };
22
24
  exports.getLambdaClient = getLambdaClient;
23
25
  const getIamClient = (region) => {
24
- return (0, get_service_client_1.getServiceClient)({ region, service: 'iam', customCredentials: null });
26
+ return (0, get_service_client_1.getServiceClient)({
27
+ region,
28
+ service: 'iam',
29
+ customCredentials: null,
30
+ forcePathStyle: false,
31
+ });
25
32
  };
26
33
  exports.getIamClient = getIamClient;
27
34
  const getServiceQuotasClient = (region) => {
@@ -29,10 +36,16 @@ const getServiceQuotasClient = (region) => {
29
36
  region,
30
37
  service: 'servicequotas',
31
38
  customCredentials: null,
39
+ forcePathStyle: false,
32
40
  });
33
41
  };
34
42
  exports.getServiceQuotasClient = getServiceQuotasClient;
35
43
  const getStsClient = (region) => {
36
- return (0, get_service_client_1.getServiceClient)({ region, service: 'sts', customCredentials: null });
44
+ return (0, get_service_client_1.getServiceClient)({
45
+ region,
46
+ service: 'sts',
47
+ customCredentials: null,
48
+ forcePathStyle: false,
49
+ });
37
50
  };
38
51
  exports.getStsClient = getStsClient;
@@ -1,12 +1,14 @@
1
1
  import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
2
2
  import { type SerializedInputProps } from '@remotion/serverless/client';
3
- export declare const cleanupSerializedInputProps: <Provider extends CloudProvider<string, Record<string, unknown>>>({ serialized, region, providerSpecifics, }: {
3
+ export declare const cleanupSerializedInputProps: <Provider extends CloudProvider<string, Record<string, unknown>>>({ serialized, region, providerSpecifics, forcePathStyle, }: {
4
4
  serialized: SerializedInputProps;
5
5
  region: Provider["region"];
6
6
  providerSpecifics: ProviderSpecifics<Provider>;
7
+ forcePathStyle: boolean;
7
8
  }) => Promise<number>;
8
- export declare const cleanupSerializedResolvedProps: <Provider extends CloudProvider<string, Record<string, unknown>>>({ serialized, region, providerSpecifics, }: {
9
+ export declare const cleanupSerializedResolvedProps: <Provider extends CloudProvider<string, Record<string, unknown>>>({ serialized, region, providerSpecifics, forcePathStyle, }: {
9
10
  serialized: SerializedInputProps;
10
11
  region: Provider["region"];
11
12
  providerSpecifics: ProviderSpecifics<Provider>;
13
+ forcePathStyle: boolean;
12
14
  }) => Promise<number>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cleanupSerializedResolvedProps = exports.cleanupSerializedInputProps = void 0;
4
4
  const client_1 = require("@remotion/serverless/client");
5
- const cleanupSerializedInputProps = async ({ serialized, region, providerSpecifics, }) => {
5
+ const cleanupSerializedInputProps = async ({ serialized, region, providerSpecifics, forcePathStyle, }) => {
6
6
  if (serialized.type === 'payload') {
7
7
  return 0;
8
8
  }
@@ -12,11 +12,12 @@ const cleanupSerializedInputProps = async ({ serialized, region, providerSpecifi
12
12
  key: (0, client_1.inputPropsKey)(serialized.hash),
13
13
  region,
14
14
  customCredentials: null,
15
+ forcePathStyle,
15
16
  });
16
17
  return Date.now() - time;
17
18
  };
18
19
  exports.cleanupSerializedInputProps = cleanupSerializedInputProps;
19
- const cleanupSerializedResolvedProps = async ({ serialized, region, providerSpecifics, }) => {
20
+ const cleanupSerializedResolvedProps = async ({ serialized, region, providerSpecifics, forcePathStyle, }) => {
20
21
  if (serialized.type === 'payload') {
21
22
  return 0;
22
23
  }
@@ -26,6 +27,7 @@ const cleanupSerializedResolvedProps = async ({ serialized, region, providerSpec
26
27
  key: (0, client_1.resolvedPropsKey)(serialized.hash),
27
28
  region,
28
29
  customCredentials: null,
30
+ forcePathStyle,
29
31
  });
30
32
  return Date.now() - time;
31
33
  };
@@ -1,20 +1,22 @@
1
- import type { SerializedInputProps } from '@remotion/serverless/client';
2
- import type { AwsRegion } from '../client';
1
+ import type { ProviderSpecifics } from '@remotion/serverless';
2
+ import { type SerializedInputProps } from '@remotion/serverless/client';
3
3
  type PropsType = 'input-props' | 'resolved-props';
4
4
  export declare const serializeOrThrow: (inputProps: Record<string, unknown>, propsType: PropsType) => string;
5
5
  export declare const getNeedsToUpload: (type: 'still' | 'video-or-audio', sizes: number[]) => boolean;
6
- export declare const compressInputProps: ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, }: {
6
+ export declare const compressInputProps: <Region extends string>({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, providerSpecifics, }: {
7
7
  stringifiedInputProps: string;
8
- region: AwsRegion;
8
+ region: Region;
9
9
  userSpecifiedBucketName: string | null;
10
10
  propsType: PropsType;
11
11
  needsToUpload: boolean;
12
+ providerSpecifics: ProviderSpecifics<Region>;
12
13
  }) => Promise<SerializedInputProps>;
13
- export declare const decompressInputProps: ({ serialized, region, bucketName, expectedBucketOwner, propsType, }: {
14
+ export declare const decompressInputProps: <Region extends string>({ serialized, region, bucketName, expectedBucketOwner, propsType, providerSpecifics, }: {
14
15
  serialized: SerializedInputProps;
15
- region: AwsRegion;
16
+ region: Region;
16
17
  bucketName: string;
17
18
  expectedBucketOwner: string;
18
19
  propsType: PropsType;
20
+ providerSpecifics: ProviderSpecifics<Region>;
19
21
  }) => Promise<string>;
20
22
  export {};
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.decompressInputProps = exports.compressInputProps = exports.getNeedsToUpload = exports.serializeOrThrow = void 0;
4
+ const client_1 = require("@remotion/serverless/client");
4
5
  const no_react_1 = require("remotion/no-react");
5
- const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
6
- const io_1 = require("../functions/helpers/io");
7
- const constants_1 = require("./constants");
8
- const random_hash_1 = require("./random-hash");
9
- const stream_to_string_1 = require("./stream-to-string");
10
6
  const validate_webhook_1 = require("./validate-webhook");
11
7
  const makeKey = (type, hash) => {
12
8
  if (type === 'input-props') {
13
- return (0, constants_1.inputPropsKey)(hash);
9
+ return (0, client_1.inputPropsKey)(hash);
14
10
  }
15
- return (0, constants_1.resolvedPropsKey)(hash);
11
+ return (0, client_1.resolvedPropsKey)(hash);
16
12
  };
17
13
  const serializeOrThrow = (inputProps, propsType) => {
18
14
  try {
@@ -39,15 +35,16 @@ const getNeedsToUpload = (type, sizes) => {
39
35
  return false;
40
36
  };
41
37
  exports.getNeedsToUpload = getNeedsToUpload;
42
- const compressInputProps = async ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, }) => {
43
- const hash = (0, random_hash_1.randomHash)();
38
+ const compressInputProps = async ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, providerSpecifics, }) => {
39
+ const hash = providerSpecifics.randomHash();
44
40
  if (needsToUpload) {
45
- const bucketName = userSpecifiedBucketName !== null && userSpecifiedBucketName !== void 0 ? userSpecifiedBucketName : (await (0, get_or_create_bucket_1.internalGetOrCreateBucket)({
41
+ const bucketName = userSpecifiedBucketName !== null && userSpecifiedBucketName !== void 0 ? userSpecifiedBucketName : (await (0, client_1.internalGetOrCreateBucket)({
46
42
  region,
47
43
  enableFolderExpiry: null,
48
44
  customCredentials: null,
45
+ providerSpecifics,
49
46
  })).bucketName;
50
- await (0, io_1.lambdaWriteFile)({
47
+ await providerSpecifics.writeFile({
51
48
  body: stringifiedInputProps,
52
49
  bucketName,
53
50
  region,
@@ -69,18 +66,18 @@ const compressInputProps = async ({ stringifiedInputProps, region, userSpecified
69
66
  };
70
67
  };
71
68
  exports.compressInputProps = compressInputProps;
72
- const decompressInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, propsType, }) => {
69
+ const decompressInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, propsType, providerSpecifics, }) => {
73
70
  if (serialized.type === 'payload') {
74
71
  return serialized.payload;
75
72
  }
76
73
  try {
77
- const response = await (0, io_1.lambdaReadFile)({
74
+ const response = await providerSpecifics.readFile({
78
75
  bucketName,
79
76
  expectedBucketOwner,
80
77
  key: makeKey(propsType, serialized.hash),
81
78
  region,
82
79
  });
83
- const body = await (0, stream_to_string_1.streamToString)(response);
80
+ const body = await (0, client_1.streamToString)(response);
84
81
  const payload = body;
85
82
  return payload;
86
83
  }
@@ -2,4 +2,8 @@ import type { S3Client } from '@aws-sdk/client-s3';
2
2
  import type { CustomCredentials } from '../client';
3
3
  import type { AwsProvider } from '../functions/aws-implementation';
4
4
  import type { AwsRegion } from '../regions';
5
- export declare const getS3Client: (region: AwsRegion, customCredentials: CustomCredentials<AwsProvider> | null) => S3Client;
5
+ export declare const getS3Client: ({ region, customCredentials, forcePathStyle, }: {
6
+ region: AwsRegion;
7
+ customCredentials: CustomCredentials<AwsProvider> | null;
8
+ forcePathStyle: boolean;
9
+ }) => S3Client;
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getS3Client = void 0;
4
4
  const get_service_client_1 = require("./get-service-client");
5
- const getS3Client = (region, customCredentials) => {
5
+ const getS3Client = ({ region, customCredentials, forcePathStyle, }) => {
6
6
  var _a;
7
7
  return (0, get_service_client_1.getServiceClient)({
8
8
  region: (_a = customCredentials === null || customCredentials === void 0 ? void 0 : customCredentials.region) !== null && _a !== void 0 ? _a : region,
9
9
  service: 's3',
10
10
  customCredentials,
11
+ forcePathStyle,
11
12
  });
12
13
  };
13
14
  exports.getS3Client = getS3Client;
@@ -15,8 +15,9 @@ export type ServiceMapping = {
15
15
  servicequotas: ServiceQuotasClient;
16
16
  sts: STSClient;
17
17
  };
18
- export declare const getServiceClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, }: {
18
+ export declare const getServiceClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, forcePathStyle, }: {
19
19
  region: AwsRegion;
20
20
  service: T;
21
21
  customCredentials: CustomCredentials<AwsProvider> | null;
22
+ forcePathStyle: boolean;
22
23
  }) => ServiceMapping[T];
@@ -11,7 +11,7 @@ const no_react_1 = require("remotion/no-react");
11
11
  const check_credentials_1 = require("./check-credentials");
12
12
  const constants_1 = require("./constants");
13
13
  const get_credentials_1 = require("./get-credentials");
14
- const getCredentialsHash = ({ customCredentials, region, service, }) => {
14
+ const getCredentialsHash = ({ customCredentials, region, service, forcePathStyle, }) => {
15
15
  const hashComponents = {};
16
16
  if (process.env.REMOTION_SKIP_AWS_CREDENTIALS_CHECK) {
17
17
  hashComponents.credentials = {
@@ -45,10 +45,11 @@ const getCredentialsHash = ({ customCredentials, region, service, }) => {
45
45
  hashComponents.customCredentials = customCredentials;
46
46
  hashComponents.region = region;
47
47
  hashComponents.service = service;
48
+ hashComponents.forcePathStyle = forcePathStyle;
48
49
  return (0, no_react_1.random)(JSON.stringify(hashComponents)).toString().replace('0.', '');
49
50
  };
50
51
  const _clients = {};
51
- const getServiceClient = ({ region, service, customCredentials, }) => {
52
+ const getServiceClient = ({ region, service, customCredentials, forcePathStyle, }) => {
52
53
  var _a;
53
54
  const Client = (() => {
54
55
  if (service === 'cloudwatch') {
@@ -75,6 +76,7 @@ const getServiceClient = ({ region, service, customCredentials, }) => {
75
76
  region,
76
77
  customCredentials,
77
78
  service,
79
+ forcePathStyle,
78
80
  });
79
81
  if (!_clients[key]) {
80
82
  (0, check_credentials_1.checkCredentials)();
@@ -1,9 +1,10 @@
1
1
  import type { CustomCredentials } from '@remotion/serverless/client';
2
2
  import type { AwsProvider } from '../functions/aws-implementation';
3
3
  import type { AwsRegion } from '../regions';
4
- export declare const applyLifeCyleOperation: ({ enableFolderExpiry, bucketName, region, customCredentials, }: {
4
+ export declare const applyLifeCyleOperation: ({ enableFolderExpiry, bucketName, region, customCredentials, forcePathStyle, }: {
5
5
  enableFolderExpiry: boolean | null;
6
6
  bucketName: string;
7
7
  region: AwsRegion;
8
8
  customCredentials: CustomCredentials<AwsProvider> | null;
9
+ forcePathStyle: boolean;
9
10
  }) => Promise<void>;
@@ -5,7 +5,7 @@ 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
7
  const get_s3_client_1 = require("./get-s3-client");
8
- const createLCRules = async ({ bucketName, region, customCredentials, }) => {
8
+ const createLCRules = async ({ bucketName, region, customCredentials, forcePathStyle, }) => {
9
9
  var _a;
10
10
  const lcRules = (0, lifecycle_1.getLifeCycleRules)();
11
11
  // create the lifecyle rules
@@ -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, get_s3_client_1.getS3Client)(region, customCredentials).send(createCommand);
18
+ await (0, get_s3_client_1.getS3Client)({ region, customCredentials, forcePathStyle }).send(createCommand);
19
19
  }
20
20
  catch (err) {
21
21
  if ((_a = err.stack) === null || _a === void 0 ? void 0 : _a.includes('AccessDenied')) {
@@ -23,13 +23,13 @@ const createLCRules = async ({ bucketName, region, customCredentials, }) => {
23
23
  }
24
24
  }
25
25
  };
26
- const deleteLCRules = async ({ bucketName, region, customCredentials, }) => {
26
+ const deleteLCRules = async ({ bucketName, region, customCredentials, forcePathStyle, }) => {
27
27
  var _a;
28
28
  const deleteCommandInput = (0, apply_lifecyle_1.deleteLifeCycleInput)({
29
29
  bucketName,
30
30
  });
31
31
  try {
32
- await (0, get_s3_client_1.getS3Client)(region, customCredentials).send(new client_s3_1.DeleteBucketLifecycleCommand(deleteCommandInput));
32
+ await (0, get_s3_client_1.getS3Client)({ region, customCredentials, forcePathStyle }).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')) {
@@ -37,15 +37,25 @@ const deleteLCRules = async ({ bucketName, region, customCredentials, }) => {
37
37
  }
38
38
  }
39
39
  };
40
- const applyLifeCyleOperation = async ({ enableFolderExpiry, bucketName, region, customCredentials, }) => {
40
+ const applyLifeCyleOperation = async ({ enableFolderExpiry, bucketName, region, customCredentials, forcePathStyle, }) => {
41
41
  if (enableFolderExpiry === null) {
42
42
  return;
43
43
  }
44
44
  if (enableFolderExpiry === true) {
45
- await createLCRules({ bucketName, region, customCredentials });
45
+ await createLCRules({
46
+ bucketName,
47
+ region,
48
+ customCredentials,
49
+ forcePathStyle,
50
+ });
46
51
  }
47
52
  else {
48
- await deleteLCRules({ bucketName, region, customCredentials });
53
+ await deleteLCRules({
54
+ bucketName,
55
+ region,
56
+ customCredentials,
57
+ forcePathStyle,
58
+ });
49
59
  }
50
60
  };
51
61
  exports.applyLifeCyleOperation = applyLifeCyleOperation;
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.201",
6
+ "version": "4.0.204",
7
7
  "description": "Render Remotion videos on AWS Lambda",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -22,13 +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.201",
26
- "@remotion/cli": "4.0.201",
27
- "@remotion/renderer": "4.0.201",
28
- "@remotion/studio-server": "4.0.201",
29
- "@remotion/streaming": "4.0.201",
30
- "@remotion/serverless": "4.0.201",
31
- "remotion": "4.0.201"
25
+ "@remotion/bundler": "4.0.204",
26
+ "@remotion/cli": "4.0.204",
27
+ "@remotion/renderer": "4.0.204",
28
+ "@remotion/studio-server": "4.0.204",
29
+ "@remotion/streaming": "4.0.204",
30
+ "@remotion/serverless": "4.0.204",
31
+ "remotion": "4.0.204"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/mime-types": "2.1.1",
@@ -37,11 +37,11 @@
37
37
  "pureimage": "0.4.13",
38
38
  "vitest": "0.31.1",
39
39
  "zip-lib": "^0.7.2",
40
- "@remotion/bundler": "4.0.201",
41
- "@remotion/compositor-linux-arm64-gnu": "4.0.201"
40
+ "@remotion/bundler": "4.0.204",
41
+ "@remotion/compositor-linux-arm64-gnu": "4.0.204"
42
42
  },
43
43
  "peerDependencies": {
44
- "@remotion/bundler": "4.0.201"
44
+ "@remotion/bundler": "4.0.204"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
Binary file
@@ -1,3 +0,0 @@
1
- import type { _Object } from '@aws-sdk/client-s3';
2
- import type { AwsRegion } from '../../client';
3
- export declare const checkIfRenderExists: (contents: _Object[], renderId: string, bucketName: string, region: AwsRegion) => void;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkIfRenderExists = void 0;
4
- const constants_1 = require("../../shared/constants");
5
- const checkIfRenderExists = (contents, renderId, bucketName, region) => {
6
- const initializedExists = Boolean(contents.find((c) => {
7
- var _a;
8
- return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith((0, constants_1.initalizedMetadataKey)(renderId));
9
- }));
10
- if (!initializedExists) {
11
- // ! Error message is checked in progress handler and will be retried. Make sure to update
12
- throw new TypeError(`No render with ID "${renderId}" found in bucket ${bucketName} and region ${region}`);
13
- }
14
- };
15
- exports.checkIfRenderExists = checkIfRenderExists;
@@ -1,9 +0,0 @@
1
- import type { _Object } from '@aws-sdk/client-s3';
2
- import type { AwsRegion } from '../../pricing/aws-regions';
3
- import type { CleanupJob } from './get-files-to-delete';
4
- export declare const cleanupFiles: ({ bucket, region, contents, jobs, }: {
5
- bucket: string;
6
- region: AwsRegion;
7
- contents: _Object[];
8
- jobs: CleanupJob[];
9
- }) => Promise<number>;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanupFiles = void 0;
4
- const clean_items_1 = require("../../api/clean-items");
5
- const cleanupFiles = async ({ bucket, region, contents, jobs, }) => {
6
- const start = Date.now();
7
- await (0, clean_items_1.cleanItems)({
8
- bucket,
9
- region,
10
- list: jobs.map((item) => {
11
- var _a;
12
- if (item.type === 'exact') {
13
- return item.name;
14
- }
15
- if (item.type === 'prefix') {
16
- return (_a = contents.find((c) => { var _a; return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith(item.name); })) === null || _a === void 0 ? void 0 : _a.Key;
17
- }
18
- throw new Error('unexpected in deleteChunks()');
19
- }),
20
- onAfterItemDeleted: () => undefined,
21
- onBeforeItemDeleted: () => undefined,
22
- });
23
- return Date.now() - start;
24
- };
25
- exports.cleanupFiles = cleanupFiles;
@@ -1,10 +0,0 @@
1
- import type { _Object } from '@aws-sdk/client-s3';
2
- import type { CleanupInfo } from '../../shared/constants';
3
- export declare const getCleanupProgress: ({ contents, output, chunkCount, renderId, hasAudio, hasVideo, }: {
4
- contents: _Object[];
5
- output: string | null;
6
- chunkCount: number;
7
- renderId: string;
8
- hasAudio: boolean;
9
- hasVideo: boolean;
10
- }) => null | CleanupInfo;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCleanupProgress = void 0;
4
- const get_files_to_delete_1 = require("./get-files-to-delete");
5
- const getCleanupProgress = ({ contents, output, chunkCount, renderId, hasAudio, hasVideo, }) => {
6
- if (output === null) {
7
- return null;
8
- }
9
- const filesToDelete = (0, get_files_to_delete_1.getFilesToDelete)({
10
- chunkCount,
11
- renderId,
12
- hasAudio,
13
- hasVideo,
14
- });
15
- const filesStillThere = contents.filter((c) => {
16
- return filesToDelete.find((f) => {
17
- var _a;
18
- if (f.type === 'exact') {
19
- return f.name === c.Key;
20
- }
21
- if (f.type === 'prefix') {
22
- return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith(f.name);
23
- }
24
- throw new Error('Unexpected in getCleanupProgress');
25
- });
26
- });
27
- const filesDeleted = Math.max(0, filesToDelete.length - filesStillThere.length);
28
- return {
29
- minFilesToDelete: filesToDelete.length,
30
- filesDeleted,
31
- // We don't know. Only if post render data is saved, we know the timing
32
- doneIn: null,
33
- };
34
- };
35
- exports.getCleanupProgress = getCleanupProgress;
@@ -1,7 +0,0 @@
1
- import type { _Object } from '@aws-sdk/client-s3';
2
- import type { EncodingProgress } from '../../defaults';
3
- export declare const getEncodingMetadata: ({ exists, frameCount, stepSize, }: {
4
- exists: _Object | undefined;
5
- frameCount: number;
6
- stepSize: number;
7
- }) => EncodingProgress | null;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEncodingMetadata = void 0;
4
- const chunk_progress_1 = require("../../shared/chunk-progress");
5
- const getEncodingMetadata = ({ exists, frameCount, stepSize, }) => {
6
- if (!exists) {
7
- return null;
8
- }
9
- const framesEncoded = (0, chunk_progress_1.getProgressOfChunk)(exists.ETag);
10
- // We only report every 100 frames encoded so that we are able to report up to 2000 * 100 ETags => 200000 frames
11
- return {
12
- framesEncoded: Math.min(frameCount, framesEncoded * stepSize),
13
- };
14
- };
15
- exports.getEncodingMetadata = getEncodingMetadata;
@@ -1 +0,0 @@
1
- export declare const getEncodingProgressStepSize: (totalFrames: number) => number;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEncodingProgressStepSize = void 0;
4
- const getEncodingProgressStepSize = (totalFrames) => {
5
- return Math.min(100, Math.max(5, totalFrames / 10));
6
- };
7
- exports.getEncodingProgressStepSize = getEncodingProgressStepSize;
@@ -1,10 +0,0 @@
1
- export type CleanupJob = {
2
- name: string;
3
- type: 'exact' | 'prefix';
4
- };
5
- export declare const getFilesToDelete: ({ chunkCount, renderId, hasVideo, hasAudio, }: {
6
- chunkCount: number;
7
- renderId: string;
8
- hasVideo: boolean;
9
- hasAudio: boolean;
10
- }) => CleanupJob[];
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFilesToDelete = void 0;
4
- const constants_1 = require("../../shared/constants");
5
- const getFilesToDelete = ({ chunkCount, renderId, hasVideo, hasAudio, }) => {
6
- const videoChunks = hasVideo
7
- ? new Array(chunkCount).fill(true).map((_x, i) => (0, constants_1.chunkKeyForIndex)({
8
- index: i,
9
- renderId,
10
- type: 'video',
11
- }))
12
- : [];
13
- const audioChunks = hasAudio
14
- ? new Array(chunkCount).fill(true).map((_x, i) => (0, constants_1.chunkKeyForIndex)({
15
- index: i,
16
- renderId,
17
- type: 'audio',
18
- }))
19
- : [];
20
- const lambdaTimings = new Array(chunkCount)
21
- .fill(true)
22
- .map((_x, i) => (0, constants_1.lambdaTimingsPrefixForChunk)(renderId, i));
23
- return [
24
- {
25
- name: (0, constants_1.lambdaChunkInitializedPrefix)(renderId),
26
- type: 'prefix',
27
- },
28
- ...videoChunks.map((i) => {
29
- return {
30
- name: i,
31
- type: 'exact',
32
- };
33
- }),
34
- ...audioChunks.map((i) => {
35
- return {
36
- name: i,
37
- type: 'exact',
38
- };
39
- }),
40
- ...lambdaTimings.map((i) => {
41
- return {
42
- name: i,
43
- type: 'prefix',
44
- };
45
- }),
46
- {
47
- name: (0, constants_1.encodingProgressKey)(renderId),
48
- type: 'exact',
49
- },
50
- ];
51
- };
52
- exports.getFilesToDelete = getFilesToDelete;
@@ -1,6 +0,0 @@
1
- import type { EncodingProgress, RenderMetadata } from '../../shared/constants';
2
- export declare const getFinalEncodingStatus: ({ encodingProgress, renderMetadata, outputFileExists, }: {
3
- encodingProgress: EncodingProgress | null;
4
- renderMetadata: RenderMetadata | null;
5
- outputFileExists: boolean;
6
- }) => EncodingProgress | null;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFinalEncodingStatus = void 0;
4
- const getFinalEncodingStatus = ({ encodingProgress, renderMetadata, outputFileExists, }) => {
5
- if (!renderMetadata) {
6
- return null;
7
- }
8
- if (encodingProgress) {
9
- return encodingProgress;
10
- }
11
- if (outputFileExists) {
12
- return {
13
- framesEncoded: renderMetadata.videoConfig.durationInFrames,
14
- };
15
- }
16
- return null;
17
- };
18
- exports.getFinalEncodingStatus = getFinalEncodingStatus;
@@ -1 +0,0 @@
1
- export declare function getFolderSizeRecursively(folder: string): number;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFolderSizeRecursively = void 0;
4
- const get_files_in_folder_1 = require("./get-files-in-folder");
5
- function getFolderSizeRecursively(folder) {
6
- return (0, get_files_in_folder_1.getFolderFiles)(folder).reduce((a, b) => a + b.size, 0);
7
- }
8
- exports.getFolderSizeRecursively = getFolderSizeRecursively;
@@ -1,8 +0,0 @@
1
- import type { _Object } from '@aws-sdk/client-s3';
2
- export type LambdaInvokeStats = {
3
- lambdasInvoked: number;
4
- };
5
- export declare const getLambdasInvokedStats: ({ contents, renderId, }: {
6
- contents: _Object[];
7
- renderId: string;
8
- }) => LambdaInvokeStats;