@remotion/lambda 4.0.200 → 4.0.202

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 (142) 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 +7 -3
  10. package/dist/api/deploy-site.js +17 -4
  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 +22 -2
  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/helpers/progress-bar.d.ts +5 -0
  40. package/dist/cli/helpers/progress-bar.js +19 -1
  41. package/dist/cli/index.js +6 -1
  42. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
  43. package/dist/functions/helpers/check-if-render-exists.d.ts +3 -0
  44. package/dist/functions/helpers/check-if-render-exists.js +15 -0
  45. package/dist/functions/helpers/cleanup-props.d.ts +6 -2
  46. package/dist/functions/helpers/cleanup-props.js +3 -1
  47. package/dist/functions/helpers/delete-chunks.d.ts +9 -0
  48. package/dist/functions/helpers/delete-chunks.js +25 -0
  49. package/dist/functions/helpers/expected-out-name.d.ts +1 -1
  50. package/dist/functions/helpers/find-output-file-in-bucket.d.ts +2 -1
  51. package/dist/functions/helpers/find-output-file-in-bucket.js +2 -1
  52. package/dist/functions/helpers/get-browser-instance.d.ts +2 -3
  53. package/dist/functions/helpers/get-browser-instance.js +4 -3
  54. package/dist/functions/helpers/get-cleanup-progress.d.ts +10 -0
  55. package/dist/functions/helpers/get-cleanup-progress.js +35 -0
  56. package/dist/functions/helpers/get-current-region.d.ts +1 -1
  57. package/dist/functions/helpers/get-custom-out-name.d.ts +1 -1
  58. package/dist/functions/helpers/get-encoding-metadata.d.ts +7 -0
  59. package/dist/functions/helpers/get-encoding-metadata.js +15 -0
  60. package/dist/functions/helpers/get-encoding-progress-step-size.d.ts +1 -0
  61. package/dist/functions/helpers/get-encoding-progress-step-size.js +7 -0
  62. package/dist/functions/helpers/get-files-to-delete.d.ts +10 -0
  63. package/dist/functions/helpers/get-files-to-delete.js +52 -0
  64. package/dist/functions/helpers/get-final-encoding-status.d.ts +6 -0
  65. package/dist/functions/helpers/get-final-encoding-status.js +18 -0
  66. package/dist/functions/helpers/get-folder-size.d.ts +1 -0
  67. package/dist/functions/helpers/get-folder-size.js +8 -0
  68. package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +8 -0
  69. package/dist/functions/helpers/get-lambdas-invoked-stats.js +14 -0
  70. package/dist/functions/helpers/get-overall-progress-s3.d.ts +2 -1
  71. package/dist/functions/helpers/get-overall-progress-s3.js +2 -1
  72. package/dist/functions/helpers/get-post-render-data.d.ts +8 -0
  73. package/dist/functions/helpers/get-post-render-data.js +22 -0
  74. package/dist/functions/helpers/get-progress.d.ts +2 -1
  75. package/dist/functions/helpers/get-progress.js +2 -1
  76. package/dist/functions/helpers/get-render-metadata.d.ts +8 -0
  77. package/dist/functions/helpers/get-render-metadata.js +17 -0
  78. package/dist/functions/helpers/get-rendered-frames-progress.d.ts +8 -0
  79. package/dist/functions/helpers/get-rendered-frames-progress.js +37 -0
  80. package/dist/functions/helpers/get-time-to-finish.d.ts +5 -0
  81. package/dist/functions/helpers/get-time-to-finish.js +13 -0
  82. package/dist/functions/helpers/io.d.ts +33 -3
  83. package/dist/functions/helpers/io.js +104 -3
  84. package/dist/functions/helpers/merge-chunks.d.ts +1 -0
  85. package/dist/functions/helpers/merge-chunks.js +2 -0
  86. package/dist/functions/helpers/overall-render-progress.d.ts +2 -1
  87. package/dist/functions/helpers/overall-render-progress.js +2 -1
  88. package/dist/functions/helpers/print-cloudwatch-helper.d.ts +1 -1
  89. package/dist/functions/helpers/print-cloudwatch-helper.js +3 -3
  90. package/dist/functions/helpers/read-with-progress.d.ts +2 -1
  91. package/dist/functions/helpers/read-with-progress.js +2 -2
  92. package/dist/functions/helpers/streaming-payloads.d.ts +19 -0
  93. package/dist/functions/helpers/streaming-payloads.js +25 -0
  94. package/dist/functions/helpers/write-lambda-error.d.ts +3 -2
  95. package/dist/functions/helpers/write-lambda-error.js +2 -3
  96. package/dist/functions/helpers/write-post-render-data.d.ts +9 -0
  97. package/dist/functions/helpers/write-post-render-data.js +18 -0
  98. package/dist/functions/launch.js +8 -0
  99. package/dist/functions/merge.d.ts +9 -0
  100. package/dist/functions/merge.js +61 -0
  101. package/dist/functions/progress.js +1 -0
  102. package/dist/functions/renderer.js +2 -0
  103. package/dist/functions/start.js +3 -0
  104. package/dist/functions/still.js +6 -0
  105. package/dist/index.d.ts +2 -2
  106. package/dist/internals.d.ts +12 -9
  107. package/dist/io/delete-file.js +2 -2
  108. package/dist/io/head-file.js +6 -2
  109. package/dist/io/list-objects.js +12 -3
  110. package/dist/io/read-file.d.ts +2 -1
  111. package/dist/io/read-file.js +6 -2
  112. package/dist/io/write-file.js +6 -2
  113. package/dist/shared/__mocks__/read-dir.js +2 -2
  114. package/dist/shared/aws-clients.js +15 -2
  115. package/dist/shared/chunk-progress.d.ts +9 -0
  116. package/dist/shared/chunk-progress.js +2034 -0
  117. package/dist/shared/cleanup-serialized-input-props.d.ts +4 -2
  118. package/dist/shared/cleanup-serialized-input-props.js +4 -2
  119. package/dist/shared/compress-props.d.ts +6 -8
  120. package/dist/shared/compress-props.js +14 -11
  121. package/dist/shared/get-etag.d.ts +1 -1
  122. package/dist/shared/get-etag.js +33 -12
  123. package/dist/shared/get-s3-client.d.ts +5 -1
  124. package/dist/shared/get-s3-client.js +2 -1
  125. package/dist/shared/get-s3-operations.d.ts +2 -1
  126. package/dist/shared/get-s3-operations.js +38 -20
  127. package/dist/shared/get-service-client.d.ts +2 -1
  128. package/dist/shared/get-service-client.js +4 -2
  129. package/dist/shared/lifecycle-rules.d.ts +2 -1
  130. package/dist/shared/lifecycle-rules.js +17 -7
  131. package/dist/shared/parse-chunk-key.d.ts +5 -0
  132. package/dist/shared/parse-chunk-key.js +15 -0
  133. package/dist/shared/parse-lambda-initialized-key.d.ts +5 -0
  134. package/dist/shared/parse-lambda-initialized-key.js +15 -0
  135. package/dist/shared/read-dir.d.ts +6 -5
  136. package/dist/shared/read-dir.js +9 -6
  137. package/dist/shared/serialize-props.d.ts +14 -0
  138. package/dist/shared/serialize-props.js +36 -0
  139. package/package.json +11 -11
  140. package/remotionlambda-arm64.zip +0 -0
  141. package/dist/functions/provider-implementation.d.ts +0 -0
  142. package/dist/functions/provider-implementation.js +0 -1
@@ -3,10 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.bucketExistsInRegionImplementation = void 0;
4
4
  const client_s3_1 = require("@aws-sdk/client-s3");
5
5
  const get_s3_client_1 = require("../shared/get-s3-client");
6
- const bucketExistsInRegionImplementation = async ({ bucketName, region, expectedBucketOwner }) => {
6
+ const bucketExistsInRegionImplementation = async ({ bucketName, region, expectedBucketOwner, forcePathStyle }) => {
7
7
  var _a;
8
8
  try {
9
- const bucket = await (0, get_s3_client_1.getS3Client)(region, null).send(new client_s3_1.GetBucketLocationCommand({
9
+ const bucket = await (0, get_s3_client_1.getS3Client)({
10
+ region,
11
+ customCredentials: null,
12
+ forcePathStyle,
13
+ }).send(new client_s3_1.GetBucketLocationCommand({
10
14
  Bucket: bucketName,
11
15
  ExpectedBucketOwner: expectedBucketOwner !== null && expectedBucketOwner !== void 0 ? expectedBucketOwner : undefined,
12
16
  }));
@@ -1,5 +1,5 @@
1
1
  import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
2
- export declare const cleanItems: <Provider extends CloudProvider<string, Record<string, unknown>>>({ bucket, onAfterItemDeleted, onBeforeItemDeleted, region, list, providerSpecifics, }: {
2
+ export declare const cleanItems: <Provider extends CloudProvider<string, Record<string, unknown>>>({ bucket, onAfterItemDeleted, onBeforeItemDeleted, region, list, providerSpecifics, forcePathStyle, }: {
3
3
  bucket: string;
4
4
  region: Provider["region"];
5
5
  list: string[];
@@ -12,4 +12,5 @@ export declare const cleanItems: <Provider extends CloudProvider<string, Record<
12
12
  itemName: string;
13
13
  }) => void;
14
14
  providerSpecifics: ProviderSpecifics<Provider>;
15
+ forcePathStyle: boolean;
15
16
  }) => Promise<void[]>;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cleanItems = void 0;
4
4
  const p_limit_1 = require("../shared/p-limit");
5
5
  const limit = (0, p_limit_1.pLimit)(10);
6
- const cleanItems = ({ bucket, onAfterItemDeleted, onBeforeItemDeleted, region, list, providerSpecifics, }) => {
6
+ const cleanItems = ({ bucket, onAfterItemDeleted, onBeforeItemDeleted, region, list, providerSpecifics, forcePathStyle, }) => {
7
7
  return Promise.all(list.map((object) => limit(async () => {
8
8
  onBeforeItemDeleted({
9
9
  bucketName: bucket,
@@ -14,6 +14,7 @@ const cleanItems = ({ bucket, onAfterItemDeleted, onBeforeItemDeleted, region, l
14
14
  key: object,
15
15
  region,
16
16
  customCredentials: null,
17
+ forcePathStyle,
17
18
  });
18
19
  onAfterItemDeleted({
19
20
  bucketName: bucket,
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createBucket = void 0;
4
4
  const client_s3_1 = require("@aws-sdk/client-s3");
5
5
  const get_s3_client_1 = require("../shared/get-s3-client");
6
- const createBucket = async ({ region, bucketName }) => {
7
- await (0, get_s3_client_1.getS3Client)(region, null).send(new client_s3_1.CreateBucketCommand({
6
+ const createBucket = async ({ region, bucketName, forcePathStyle }) => {
7
+ await (0, get_s3_client_1.getS3Client)({ region, customCredentials: null, forcePathStyle }).send(new client_s3_1.CreateBucketCommand({
8
8
  Bucket: bucketName,
9
9
  }));
10
10
  try {
11
- await (0, get_s3_client_1.getS3Client)(region, null).send(new client_s3_1.DeleteBucketOwnershipControlsCommand({
11
+ await (0, get_s3_client_1.getS3Client)({ region, customCredentials: null, forcePathStyle }).send(new client_s3_1.DeleteBucketOwnershipControlsCommand({
12
12
  Bucket: bucketName,
13
13
  }));
14
14
  }
@@ -19,7 +19,7 @@ const createBucket = async ({ region, bucketName }) => {
19
19
  throw err;
20
20
  }
21
21
  try {
22
- await (0, get_s3_client_1.getS3Client)(region, null).send(new client_s3_1.DeletePublicAccessBlockCommand({
22
+ await (0, get_s3_client_1.getS3Client)({ region, customCredentials: null, forcePathStyle }).send(new client_s3_1.DeletePublicAccessBlockCommand({
23
23
  Bucket: bucketName,
24
24
  }));
25
25
  }
@@ -30,7 +30,7 @@ const createBucket = async ({ region, bucketName }) => {
30
30
  throw err;
31
31
  }
32
32
  try {
33
- await (0, get_s3_client_1.getS3Client)(region, null).send(new client_s3_1.PutBucketAclCommand({
33
+ await (0, get_s3_client_1.getS3Client)({ region, customCredentials: null, forcePathStyle }).send(new client_s3_1.PutBucketAclCommand({
34
34
  Bucket: bucketName,
35
35
  ACL: 'public-read',
36
36
  }));
@@ -7,9 +7,11 @@ export type DeleteRenderInput = {
7
7
  bucketName: string;
8
8
  renderId: string;
9
9
  customCredentials?: CustomCredentials<AwsProvider>;
10
+ forcePathStyle?: boolean;
10
11
  };
11
12
  export declare const internalDeleteRender: (input: DeleteRenderInput & {
12
13
  providerSpecifics: ProviderSpecifics<AwsProvider>;
14
+ forcePathStyle: boolean;
13
15
  }) => Promise<{
14
16
  freedBytes: number;
15
17
  }>;
@@ -17,6 +17,7 @@ const internalDeleteRender = async (input) => {
17
17
  region: input.region,
18
18
  renderId: input.renderId,
19
19
  providerSpecifics: input.providerSpecifics,
20
+ forcePathStyle: input.forcePathStyle,
20
21
  });
21
22
  // Render did not start yet
22
23
  if (progress.renderMetadata === null) {
@@ -28,12 +29,14 @@ const internalDeleteRender = async (input) => {
28
29
  customCredentials,
29
30
  key,
30
31
  region: input.region,
32
+ forcePathStyle: input.forcePathStyle,
31
33
  });
32
34
  let files = await input.providerSpecifics.listObjects({
33
35
  bucketName: input.bucketName,
34
36
  prefix: (0, client_1.rendersPrefix)(input.renderId),
35
37
  region: input.region,
36
38
  expectedBucketOwner,
39
+ forcePathStyle: input.forcePathStyle,
37
40
  });
38
41
  let totalSize = 0;
39
42
  while (files.length > 0) {
@@ -48,12 +51,14 @@ const internalDeleteRender = async (input) => {
48
51
  onBeforeItemDeleted: () => undefined,
49
52
  region: input.region,
50
53
  providerSpecifics: input.providerSpecifics,
54
+ forcePathStyle: input.forcePathStyle,
51
55
  });
52
56
  files = await input.providerSpecifics.listObjects({
53
57
  bucketName: input.bucketName,
54
58
  prefix: (0, client_1.rendersPrefix)(input.renderId),
55
59
  region: input.region,
56
60
  expectedBucketOwner,
61
+ forcePathStyle: input.forcePathStyle,
57
62
  });
58
63
  }
59
64
  return {
@@ -73,6 +78,7 @@ const deleteRender = (input) => {
73
78
  return (0, exports.internalDeleteRender)({
74
79
  ...input,
75
80
  providerSpecifics: aws_implementation_1.awsImplementation,
81
+ forcePathStyle: false,
76
82
  });
77
83
  };
78
84
  exports.deleteRender = deleteRender;
@@ -1,19 +1,24 @@
1
1
  import type { ProviderSpecifics } from '@remotion/serverless';
2
2
  import type { AwsProvider } from '../functions/aws-implementation';
3
3
  import type { AwsRegion } from '../regions';
4
- export type DeleteSiteInput = {
4
+ type MandatoryParameters = {
5
5
  bucketName: string;
6
6
  siteName: string;
7
7
  region: AwsRegion;
8
- onAfterItemDeleted?: (data: {
8
+ };
9
+ type OptionalParameters = {
10
+ onAfterItemDeleted: ((data: {
9
11
  bucketName: string;
10
12
  itemName: string;
11
- }) => void;
13
+ }) => void) | null;
14
+ forcePathStyle: boolean;
12
15
  };
16
+ export type DeleteSiteInput = MandatoryParameters & OptionalParameters;
17
+ export type DeleteSiteOptionalInput = MandatoryParameters & Partial<OptionalParameters>;
13
18
  export type DeleteSiteOutput = {
14
19
  totalSizeInBytes: number;
15
20
  };
16
- export declare const internalDeleteSite: ({ bucketName, siteName, region, onAfterItemDeleted, providerSpecifics, }: DeleteSiteInput & {
21
+ export declare const internalDeleteSite: ({ bucketName, siteName, region, onAfterItemDeleted, providerSpecifics, forcePathStyle, }: MandatoryParameters & OptionalParameters & {
17
22
  providerSpecifics: ProviderSpecifics<AwsProvider>;
18
23
  }) => Promise<DeleteSiteOutput>;
19
24
  /**
@@ -26,4 +31,5 @@ export declare const internalDeleteSite: ({ bucketName, siteName, region, onAfte
26
31
  * @param params.onAfterItemDeleted Function that gets called after each file that gets deleted, useful for showing progress.
27
32
  * @returns {Promise<DeleteSiteOutput>} Object containing info about how much space was freed.
28
33
  */
29
- export declare const deleteSite: (props: DeleteSiteInput) => Promise<DeleteSiteOutput>;
34
+ export declare const deleteSite: (props: DeleteSiteOptionalInput) => Promise<DeleteSiteOutput>;
35
+ export {};
@@ -5,7 +5,7 @@ const defaults_1 = require("../defaults");
5
5
  const aws_implementation_1 = require("../functions/aws-implementation");
6
6
  const get_account_id_1 = require("../shared/get-account-id");
7
7
  const clean_items_1 = require("./clean-items");
8
- const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDeleted, providerSpecifics, }) => {
8
+ const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDeleted, providerSpecifics, forcePathStyle, }) => {
9
9
  const accountId = await (0, get_account_id_1.getAccountId)({ region });
10
10
  let files = await providerSpecifics.listObjects({
11
11
  bucketName,
@@ -13,6 +13,7 @@ const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDel
13
13
  prefix: `${(0, defaults_1.getSitesKey)(siteName)}/`,
14
14
  region,
15
15
  expectedBucketOwner: accountId,
16
+ forcePathStyle,
16
17
  });
17
18
  let totalSize = 0;
18
19
  while (files.length > 0) {
@@ -27,6 +28,7 @@ const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDel
27
28
  onBeforeItemDeleted: () => undefined,
28
29
  region,
29
30
  providerSpecifics,
31
+ forcePathStyle,
30
32
  });
31
33
  files = await providerSpecifics.listObjects({
32
34
  bucketName,
@@ -34,6 +36,7 @@ const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDel
34
36
  prefix: `${(0, defaults_1.getSitesKey)(siteName)}/`,
35
37
  region,
36
38
  expectedBucketOwner: accountId,
39
+ forcePathStyle,
37
40
  });
38
41
  }
39
42
  return {
@@ -52,8 +55,11 @@ exports.internalDeleteSite = internalDeleteSite;
52
55
  * @returns {Promise<DeleteSiteOutput>} Object containing info about how much space was freed.
53
56
  */
54
57
  const deleteSite = (props) => {
58
+ var _a, _b;
55
59
  return (0, exports.internalDeleteSite)({
56
60
  ...props,
61
+ onAfterItemDeleted: (_a = props.onAfterItemDeleted) !== null && _a !== void 0 ? _a : null,
62
+ forcePathStyle: (_b = props.forcePathStyle) !== null && _b !== void 0 ? _b : false,
57
63
  providerSpecifics: aws_implementation_1.awsImplementation,
58
64
  });
59
65
  };
@@ -15,6 +15,7 @@ type OptionalParameters = {
15
15
  options: {
16
16
  onBundleProgress?: (progress: number) => void;
17
17
  onUploadProgress?: (upload: UploadDirProgress) => void;
18
+ onDiffingProgress?: (bytes: number, done: boolean) => void;
18
19
  webpackOverride?: WebpackOverrideFn;
19
20
  ignoreRegisterRootWarning?: boolean;
20
21
  enableCaching?: boolean;
@@ -25,6 +26,7 @@ type OptionalParameters = {
25
26
  privacy: 'public' | 'no-acl';
26
27
  gitSource: GitSource | null;
27
28
  indent: boolean;
29
+ forcePathStyle: boolean;
28
30
  } & ToOptions<typeof BrowserSafeApis.optionsMap.deploySiteLambda>;
29
31
  export type DeploySiteInput = MandatoryParameters & Partial<OptionalParameters>;
30
32
  export type DeploySiteOutput = Promise<{
@@ -41,6 +43,7 @@ export declare const internalDeploySite: (args_0: MandatoryParameters & {
41
43
  options: {
42
44
  onBundleProgress?: ((progress: number) => void) | undefined;
43
45
  onUploadProgress?: ((upload: UploadDirProgress) => void) | undefined;
46
+ onDiffingProgress?: ((bytes: number, done: boolean) => void) | undefined;
44
47
  webpackOverride?: WebpackOverrideFn | undefined;
45
48
  ignoreRegisterRootWarning?: boolean | undefined;
46
49
  enableCaching?: boolean | undefined;
@@ -51,6 +54,7 @@ export declare const internalDeploySite: (args_0: MandatoryParameters & {
51
54
  privacy: 'public' | 'no-acl';
52
55
  gitSource: GitSource | null;
53
56
  indent: boolean;
57
+ forcePathStyle: boolean;
54
58
  } & ToOptions<{
55
59
  readonly logLevel: {
56
60
  cliFlag: "log";
@@ -61,11 +65,11 @@ export declare const internalDeploySite: (args_0: MandatoryParameters & {
61
65
  getValue: ({ commandLine }: {
62
66
  commandLine: Record<string, unknown>;
63
67
  }) => {
64
- value: "verbose" | "info" | "warn" | "error";
68
+ value: "error" | "verbose" | "info" | "warn";
65
69
  source: string;
66
70
  };
67
- setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
68
- type: "verbose" | "info" | "warn" | "error";
71
+ setConfig: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
72
+ type: "error" | "verbose" | "info" | "warn";
69
73
  };
70
74
  readonly throwIfSiteExists: {
71
75
  cliFlag: string;
@@ -17,8 +17,8 @@ const validate_aws_region_1 = require("../shared/validate-aws-region");
17
17
  const validate_privacy_1 = require("../shared/validate-privacy");
18
18
  const validate_site_name_1 = require("../shared/validate-site-name");
19
19
  const upload_dir_1 = require("./upload-dir");
20
- const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy, gitSource, throwIfSiteExists, providerSpecifics, }) => {
21
- var _a, _b, _c, _d, _e, _f, _g;
20
+ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy, gitSource, throwIfSiteExists, providerSpecifics, forcePathStyle, }) => {
21
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
22
22
  (0, validate_aws_region_1.validateAwsRegion)(region);
23
23
  (0, client_1.validateBucketName)(bucketName, {
24
24
  mustStartWithRemotion: !(options === null || options === void 0 ? void 0 : options.bypassBucketNameValidation),
@@ -30,6 +30,7 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
30
30
  bucketName,
31
31
  region,
32
32
  expectedBucketOwner: accountId,
33
+ forcePathStyle,
33
34
  });
34
35
  if (!bucketExists) {
35
36
  throw new Error(`No bucket with the name ${bucketName} exists`);
@@ -42,6 +43,7 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
42
43
  region,
43
44
  // The `/` is important to not accidentially delete sites with the same name but containing a suffix.
44
45
  prefix: `${subFolder}/`,
46
+ forcePathStyle,
45
47
  }),
46
48
  (0, bundle_site_1.bundleSite)({
47
49
  publicPath: `/${subFolder}/`,
@@ -68,20 +70,29 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
68
70
  .map((f) => f.Key)
69
71
  .join(', '));
70
72
  }
73
+ (_g = options.onDiffingProgress) === null || _g === void 0 ? void 0 : _g.call(options, 0, false);
74
+ let totalBytes = 0;
71
75
  const { toDelete, toUpload, existingCount } = await (0, get_s3_operations_1.getS3DiffOperations)({
72
76
  objects: files,
73
77
  bundle: bundled,
74
78
  prefix: subFolder,
79
+ onProgress: (bytes) => {
80
+ var _a;
81
+ totalBytes = bytes;
82
+ (_a = options.onDiffingProgress) === null || _a === void 0 ? void 0 : _a.call(options, bytes, false);
83
+ },
75
84
  });
85
+ (_h = options.onDiffingProgress) === null || _h === void 0 ? void 0 : _h.call(options, totalBytes, true);
76
86
  await Promise.all([
77
87
  (0, upload_dir_1.uploadDir)({
78
88
  bucket: bucketName,
79
89
  region,
80
90
  localDir: bundled,
81
- onProgress: (_g = options === null || options === void 0 ? void 0 : options.onUploadProgress) !== null && _g !== void 0 ? _g : (() => undefined),
91
+ onProgress: (_j = options === null || options === void 0 ? void 0 : options.onUploadProgress) !== null && _j !== void 0 ? _j : (() => undefined),
82
92
  keyPrefix: subFolder,
83
93
  privacy: privacy !== null && privacy !== void 0 ? privacy : 'public',
84
94
  toUpload,
95
+ forcePathStyle,
85
96
  }),
86
97
  Promise.all(toDelete.map((d) => {
87
98
  return providerSpecifics.deleteFile({
@@ -89,6 +100,7 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
89
100
  customCredentials: null,
90
101
  key: d.Key,
91
102
  region,
103
+ forcePathStyle,
92
104
  });
93
105
  })),
94
106
  ]);
@@ -118,7 +130,7 @@ exports.internalDeploySite = (0, error_handling_1.wrapWithErrorHandling)(mandato
118
130
  * @param {object} params.options Further options, see documentation page for this function.
119
131
  */
120
132
  const deploySite = (args) => {
121
- var _a, _b, _c, _d, _e;
133
+ var _a, _b, _c, _d, _e, _f;
122
134
  return (0, exports.internalDeploySite)({
123
135
  bucketName: args.bucketName,
124
136
  entryPoint: args.entryPoint,
@@ -131,6 +143,7 @@ const deploySite = (args) => {
131
143
  logLevel: 'info',
132
144
  throwIfSiteExists: (_e = args.throwIfSiteExists) !== null && _e !== void 0 ? _e : false,
133
145
  providerSpecifics: aws_implementation_1.awsImplementation,
146
+ forcePathStyle: (_f = args.forcePathStyle) !== null && _f !== void 0 ? _f : false,
134
147
  });
135
148
  };
136
149
  exports.deploySite = deploySite;
@@ -12,6 +12,7 @@ export type DownloadMediaInput = {
12
12
  onProgress?: LambdaReadFileProgress;
13
13
  customCredentials?: CustomCredentials<AwsProvider>;
14
14
  logLevel?: LogLevel;
15
+ forcePathStyle?: boolean;
15
16
  };
16
17
  export type DownloadMediaOutput = {
17
18
  outputPath: string;
@@ -19,6 +20,7 @@ export type DownloadMediaOutput = {
19
20
  };
20
21
  export declare const internalDownloadMedia: (input: DownloadMediaInput & {
21
22
  providerSpecifics: ProviderSpecifics<AwsProvider>;
23
+ forcePathStyle: boolean;
22
24
  }) => Promise<DownloadMediaOutput>;
23
25
  /**
24
26
  * @description Downloads a rendered video, audio or still to the disk of the machine this API is called from.
@@ -12,7 +12,7 @@ const get_overall_progress_s3_1 = require("../functions/helpers/get-overall-prog
12
12
  const read_with_progress_1 = require("../functions/helpers/read-with-progress");
13
13
  const get_account_id_1 = require("../shared/get-account-id");
14
14
  const internalDownloadMedia = async (input) => {
15
- var _a, _b, _c;
15
+ var _a, _b, _c, _d;
16
16
  const expectedBucketOwner = await (0, get_account_id_1.getAccountId)({
17
17
  region: input.region,
18
18
  });
@@ -22,6 +22,7 @@ const internalDownloadMedia = async (input) => {
22
22
  region: input.region,
23
23
  renderId: input.renderId,
24
24
  providerSpecifics: input.providerSpecifics,
25
+ forcePathStyle: input.forcePathStyle,
25
26
  });
26
27
  if (!overallProgress.renderMetadata) {
27
28
  throw new Error('Render did not finish yet');
@@ -38,6 +39,7 @@ const internalDownloadMedia = async (input) => {
38
39
  outputPath,
39
40
  customCredentials,
40
41
  logLevel: (_c = input.logLevel) !== null && _c !== void 0 ? _c : 'info',
42
+ forcePathStyle: (_d = input.forcePathStyle) !== null && _d !== void 0 ? _d : false,
41
43
  });
42
44
  return {
43
45
  outputPath,
@@ -60,6 +62,7 @@ const downloadMedia = (input) => {
60
62
  return (0, exports.internalDownloadMedia)({
61
63
  ...input,
62
64
  providerSpecifics: aws_implementation_1.awsImplementation,
65
+ forcePathStyle: false,
63
66
  });
64
67
  };
65
68
  exports.downloadMedia = downloadMedia;
@@ -12,6 +12,7 @@ export type GetAwsClientInput<T extends keyof ServiceMapping> = {
12
12
  region: AwsRegion;
13
13
  service: T;
14
14
  customCredentials?: CustomCredentials<AwsProvider> | null;
15
+ forcePathStyle?: boolean;
15
16
  };
16
17
  type SdkMapping = {
17
18
  s3: typeof S3SDK;
@@ -33,5 +34,5 @@ export type GetAwsClientOutput<T extends keyof ServiceMapping> = {
33
34
  * @param {CustomCredentials} params.customCredentials Pass endpoint and credentials if you want to connect to a different cloud for S3
34
35
  * @returns {GetAwsClientOutput<T>} Returns `client` and `sdk` of a AWS service
35
36
  */
36
- export declare const getAwsClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, }: GetAwsClientInput<T>) => GetAwsClientOutput<T>;
37
+ export declare const getAwsClient: <T extends keyof ServiceMapping>({ region, service, customCredentials, forcePathStyle, }: GetAwsClientInput<T>) => GetAwsClientOutput<T>;
37
38
  export {};
@@ -39,12 +39,13 @@ const get_service_client_1 = require("../shared/get-service-client");
39
39
  * @param {CustomCredentials} params.customCredentials Pass endpoint and credentials if you want to connect to a different cloud for S3
40
40
  * @returns {GetAwsClientOutput<T>} Returns `client` and `sdk` of a AWS service
41
41
  */
42
- const getAwsClient = ({ region, service, customCredentials, }) => {
42
+ const getAwsClient = ({ region, service, customCredentials, forcePathStyle, }) => {
43
43
  return {
44
44
  client: (0, get_service_client_1.getServiceClient)({
45
45
  region,
46
46
  service,
47
47
  customCredentials: customCredentials !== null && customCredentials !== void 0 ? customCredentials : null,
48
+ forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
48
49
  }),
49
50
  sdk: {
50
51
  lambda: LambdaSDK,
@@ -5,8 +5,12 @@ const client_s3_1 = require("@aws-sdk/client-s3");
5
5
  const client_1 = require("@remotion/serverless/client");
6
6
  const get_s3_client_1 = require("../shared/get-s3-client");
7
7
  const validate_bucketname_1 = require("../shared/validate-bucketname");
8
- const getRemotionBuckets = async (region, forceBucketName) => {
9
- const { Buckets } = await (0, get_s3_client_1.getS3Client)(region, null).send(new client_s3_1.ListBucketsCommand({}));
8
+ const getRemotionBuckets = async ({ region, forceBucketName, forcePathStyle, }) => {
9
+ const { Buckets } = await (0, get_s3_client_1.getS3Client)({
10
+ region,
11
+ customCredentials: null,
12
+ forcePathStyle,
13
+ }).send(new client_s3_1.ListBucketsCommand({}));
10
14
  if (!Buckets) {
11
15
  return [];
12
16
  }
@@ -24,7 +28,11 @@ const getRemotionBuckets = async (region, forceBucketName) => {
24
28
  return parsedRegion;
25
29
  }
26
30
  try {
27
- const result = await (0, get_s3_client_1.getS3Client)(region, null).send(new client_s3_1.GetBucketLocationCommand({
31
+ const result = await (0, get_s3_client_1.getS3Client)({
32
+ region,
33
+ customCredentials: null,
34
+ forcePathStyle,
35
+ }).send(new client_s3_1.GetBucketLocationCommand({
28
36
  Bucket: bucket.Name,
29
37
  }));
30
38
  // AWS docs: Buckets in Region us-east-1 have a LocationConstraint of null!!
@@ -14,6 +14,7 @@ export type GetCompositionsOnLambdaInput = {
14
14
  * @deprecated in favor of `logLevel`: true
15
15
  */
16
16
  dumpBrowserLogs?: boolean;
17
+ forcePathStyle?: boolean;
17
18
  } & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.getCompositionsOnLambda>>;
18
19
  export type GetCompositionsOnLambdaOutput = VideoConfig[];
19
20
  /**
@@ -29,4 +30,4 @@ export type GetCompositionsOnLambdaOutput = VideoConfig[];
29
30
  * @param params.chromiumOptions The options to pass to Chromium
30
31
  * @returns The compositions
31
32
  */
32
- export declare const getCompositionsOnLambda: ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, offthreadVideoCacheSizeInBytes, }: GetCompositionsOnLambdaInput) => Promise<GetCompositionsOnLambdaOutput>;
33
+ export declare const getCompositionsOnLambda: ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, offthreadVideoCacheSizeInBytes, forcePathStyle, }: GetCompositionsOnLambdaInput) => Promise<GetCompositionsOnLambdaOutput>;
@@ -18,7 +18,7 @@ const call_lambda_1 = require("../shared/call-lambda");
18
18
  * @param params.chromiumOptions The options to pass to Chromium
19
19
  * @returns The compositions
20
20
  */
21
- const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, offthreadVideoCacheSizeInBytes, }) => {
21
+ const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inputProps, functionName, envVariables, logLevel, timeoutInMilliseconds, forceBucketName: bucketName, dumpBrowserLogs, offthreadVideoCacheSizeInBytes, forcePathStyle, }) => {
22
22
  var _a;
23
23
  const stringifiedInputProps = (0, client_1.serializeOrThrow)(inputProps, 'input-props');
24
24
  const serializedInputProps = await (0, client_1.compressInputProps)({
@@ -31,6 +31,7 @@ const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inpu
31
31
  JSON.stringify(envVariables).length,
32
32
  ]),
33
33
  providerSpecifics: aws_implementation_1.awsImplementation,
34
+ forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
34
35
  });
35
36
  try {
36
37
  const res = await (0, call_lambda_1.callLambda)({
@@ -46,6 +47,7 @@ const getCompositionsOnLambda = async ({ chromiumOptions, serveUrl, region, inpu
46
47
  version: version_1.VERSION,
47
48
  bucketName: bucketName !== null && bucketName !== void 0 ? bucketName : null,
48
49
  offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes !== null && offthreadVideoCacheSizeInBytes !== void 0 ? offthreadVideoCacheSizeInBytes : null,
50
+ forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
49
51
  },
50
52
  region,
51
53
  timeoutInTest: 120000,
@@ -16,6 +16,7 @@ const getOrCreateBucket = (options) => {
16
16
  enableFolderExpiry: (_a = options.enableFolderExpiry) !== null && _a !== void 0 ? _a : null,
17
17
  customCredentials: (_b = options.customCredentials) !== null && _b !== void 0 ? _b : null,
18
18
  providerSpecifics: aws_implementation_1.awsImplementation,
19
+ forcePathStyle: false,
19
20
  });
20
21
  };
21
22
  exports.getOrCreateBucket = getOrCreateBucket;
@@ -10,6 +10,7 @@ export type GetRenderProgressInput = {
10
10
  region: AwsRegion;
11
11
  logLevel?: LogLevel;
12
12
  s3OutputProvider?: CustomCredentials<AwsProvider>;
13
+ forcePathStyle?: boolean;
13
14
  };
14
15
  /**
15
16
  * @description Gets the current status of a render originally triggered via renderMediaOnLambda().
@@ -9,15 +9,20 @@ type Site = {
9
9
  id: string;
10
10
  serveUrl: string;
11
11
  };
12
- export type GetSitesInput = {
12
+ type MandatoryParameters = {
13
13
  region: AwsRegion;
14
- forceBucketName?: string;
15
14
  };
15
+ type OptionalParameters = {
16
+ forceBucketName: string | null;
17
+ forcePathStyle: boolean;
18
+ };
19
+ type GetSitesInternalInput = MandatoryParameters & OptionalParameters;
20
+ export type GetSitesInput = MandatoryParameters & Partial<OptionalParameters>;
16
21
  export type GetSitesOutput = {
17
22
  sites: Site[];
18
23
  buckets: BucketWithLocation[];
19
24
  };
20
- export declare const internalGetSites: ({ region, forceBucketName, providerSpecifics, }: GetSitesInput & {
25
+ export declare const internalGetSites: ({ region, forceBucketName, providerSpecifics, forcePathStyle, }: MandatoryParameters & OptionalParameters & {
21
26
  providerSpecifics: ProviderSpecifics<AwsProvider>;
22
27
  }) => Promise<GetSitesOutput>;
23
28
  /**
@@ -26,5 +31,5 @@ export declare const internalGetSites: ({ region, forceBucketName, providerSpeci
26
31
  * @param {AwsRegion} params.region The AWS region that you want to query for.
27
32
  * @returns {Promise<GetSitesOutput>} A Promise containing an object with `sites` and `bucket` keys. Consult documentation for details.
28
33
  */
29
- export declare const getSites: ({ region, forceBucketName, }: GetSitesInput) => Promise<GetSitesOutput>;
34
+ export declare const getSites: ({ region, forceBucketName, forcePathStyle, }: GetSitesInput) => Promise<GetSitesOutput>;
30
35
  export {};
@@ -5,11 +5,19 @@ const aws_implementation_1 = require("../functions/aws-implementation");
5
5
  const constants_1 = require("../shared/constants");
6
6
  const get_account_id_1 = require("../shared/get-account-id");
7
7
  const make_s3_url_1 = require("../shared/make-s3-url");
8
- const internalGetSites = async ({ region, forceBucketName, providerSpecifics, }) => {
8
+ const internalGetSites = async ({ region, forceBucketName, providerSpecifics, forcePathStyle, }) => {
9
9
  var _a;
10
10
  const remotionBuckets = forceBucketName
11
- ? await providerSpecifics.getBuckets(region, forceBucketName)
12
- : await providerSpecifics.getBuckets(region);
11
+ ? await providerSpecifics.getBuckets({
12
+ region,
13
+ forceBucketName,
14
+ forcePathStyle,
15
+ })
16
+ : await providerSpecifics.getBuckets({
17
+ region,
18
+ forceBucketName: null,
19
+ forcePathStyle,
20
+ });
13
21
  const accountId = await (0, get_account_id_1.getAccountId)({ region });
14
22
  const sites = {};
15
23
  for (const bucket of remotionBuckets) {
@@ -18,6 +26,7 @@ const internalGetSites = async ({ region, forceBucketName, providerSpecifics, })
18
26
  prefix: (0, constants_1.getSitesKey)(''),
19
27
  region,
20
28
  expectedBucketOwner: accountId,
29
+ forcePathStyle,
21
30
  });
22
31
  for (const file of ls) {
23
32
  const siteKeyMatch = (_a = file.Key) === null || _a === void 0 ? void 0 : _a.match(/sites\/([0-9a-zA-Z-!_.*'()]+)\/(.*)$/);
@@ -62,10 +71,11 @@ exports.internalGetSites = internalGetSites;
62
71
  * @param {AwsRegion} params.region The AWS region that you want to query for.
63
72
  * @returns {Promise<GetSitesOutput>} A Promise containing an object with `sites` and `bucket` keys. Consult documentation for details.
64
73
  */
65
- const getSites = ({ region, forceBucketName, }) => {
74
+ const getSites = ({ region, forceBucketName, forcePathStyle, }) => {
66
75
  return (0, exports.internalGetSites)({
67
76
  region,
68
- forceBucketName,
77
+ forceBucketName: forceBucketName !== null && forceBucketName !== void 0 ? forceBucketName : null,
78
+ forcePathStyle: forcePathStyle !== null && forcePathStyle !== void 0 ? forcePathStyle : false,
69
79
  providerSpecifics: aws_implementation_1.awsImplementation,
70
80
  });
71
81
  };
@@ -48,7 +48,8 @@ export type InnerRenderMediaOnLambdaInput = {
48
48
  colorSpace: ColorSpace | null;
49
49
  deleteAfter: DeleteAfter | null;
50
50
  indent: boolean;
51
+ forcePathStyle: boolean;
51
52
  } & ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>;
52
- export declare const makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, }: InnerRenderMediaOnLambdaInput) => Promise<ServerlessStartPayload<AwsProvider>>;
53
- export declare const getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, }: GetRenderProgressInput) => ServerlessStatusPayload<AwsProvider>;
54
- export declare const makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, }: RenderStillOnLambdaNonNullInput) => Promise<ServerlessPayloads<AwsProvider>[ServerlessRoutines.still]>;
53
+ export declare const makeLambdaRenderMediaPayload: ({ rendererFunctionName, frameRange, framesPerLambda, forceBucketName: bucketName, codec, composition, serveUrl, imageFormat, inputProps, region, crf, envVariables, pixelFormat, proResProfile, x264Preset, maxRetries, privacy, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, everyNthFrame, numberOfGifLoops, audioBitrate, concurrencyPerLambda, audioCodec, forceHeight, forceWidth, webhook, videoBitrate, encodingMaxRate, encodingBufferSize, downloadBehavior, muted, overwrite, jpegQuality, offthreadVideoCacheSizeInBytes, deleteAfter, colorSpace, preferLossless, forcePathStyle, }: InnerRenderMediaOnLambdaInput) => Promise<ServerlessStartPayload<AwsProvider>>;
54
+ export declare const getRenderProgressPayload: ({ bucketName, renderId, s3OutputProvider, logLevel, forcePathStyle, }: GetRenderProgressInput) => ServerlessStatusPayload<AwsProvider>;
55
+ export declare const makeLambdaRenderStillPayload: ({ serveUrl, inputProps, imageFormat, envVariables, quality, jpegQuality, region, maxRetries, composition, privacy, frame, logLevel, outName, timeoutInMilliseconds, chromiumOptions, scale, downloadBehavior, forceHeight, forceWidth, forceBucketName, offthreadVideoCacheSizeInBytes, deleteAfter, forcePathStyle, }: RenderStillOnLambdaNonNullInput) => Promise<ServerlessPayloads<AwsProvider>[ServerlessRoutines.still]>;