@remotion/lambda 4.0.244 → 4.0.246

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 (258) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/admin/make-layer-public.js +10 -11
  3. package/dist/api/app-router-webhook.d.ts +10 -0
  4. package/dist/api/app-router-webhook.js +43 -0
  5. package/dist/api/create-function.d.ts +1 -2
  6. package/dist/api/create-function.js +10 -10
  7. package/dist/api/delete-function.d.ts +4 -13
  8. package/dist/api/delete-function.js +2 -5
  9. package/dist/api/delete-render.d.ts +0 -8
  10. package/dist/api/delete-render.js +4 -10
  11. package/dist/api/delete-site.d.ts +0 -10
  12. package/dist/api/delete-site.js +4 -11
  13. package/dist/api/deploy-function.d.ts +8 -15
  14. package/dist/api/deploy-function.js +21 -27
  15. package/dist/api/deploy-site.d.ts +2 -11
  16. package/dist/api/deploy-site.js +14 -22
  17. package/dist/api/download-media.d.ts +0 -11
  18. package/dist/api/download-media.js +3 -12
  19. package/dist/api/estimate-price.d.ts +0 -6
  20. package/dist/api/estimate-price.js +1 -3
  21. package/dist/api/get-aws-client.d.ts +1 -9
  22. package/dist/api/get-aws-client.js +2 -6
  23. package/dist/api/get-compositions-on-lambda.d.ts +1 -14
  24. package/dist/api/get-compositions-on-lambda.js +12 -17
  25. package/dist/api/get-function-info.d.ts +1 -14
  26. package/dist/api/get-function-info.js +2 -5
  27. package/dist/api/get-functions.d.ts +1 -8
  28. package/dist/api/get-functions.js +2 -5
  29. package/dist/api/get-or-create-bucket.d.ts +0 -6
  30. package/dist/api/get-or-create-bucket.js +3 -5
  31. package/dist/api/get-regions.d.ts +0 -5
  32. package/dist/api/get-regions.js +3 -4
  33. package/dist/api/get-render-progress.d.ts +0 -10
  34. package/dist/api/get-render-progress.js +3 -11
  35. package/dist/api/get-sites.d.ts +0 -6
  36. package/dist/api/get-sites.js +4 -7
  37. package/dist/api/iam-validation/simulate.d.ts +0 -7
  38. package/dist/api/iam-validation/simulate.js +2 -5
  39. package/dist/api/iam-validation/suggested-policy.d.ts +0 -10
  40. package/dist/api/iam-validation/suggested-policy.js +2 -4
  41. package/dist/api/make-lambda-payload.d.ts +2 -1
  42. package/dist/api/make-lambda-payload.js +19 -13
  43. package/dist/api/pages-router-webhook.d.ts +3 -0
  44. package/dist/api/pages-router-webhook.js +47 -0
  45. package/dist/api/presign-url.d.ts +0 -10
  46. package/dist/api/presign-url.js +2 -8
  47. package/dist/api/render-media-on-lambda.d.ts +1 -20
  48. package/dist/api/render-media-on-lambda.js +4 -19
  49. package/dist/api/render-still-on-lambda.d.ts +2 -19
  50. package/dist/api/render-still-on-lambda.js +6 -17
  51. package/dist/api/speculate-function-name.d.ts +0 -8
  52. package/dist/api/speculate-function-name.js +3 -7
  53. package/dist/api/upload-dir.d.ts +1 -7
  54. package/dist/api/upload-dir.js +1 -5
  55. package/dist/api/validate-webhook-signature.d.ts +0 -8
  56. package/dist/api/validate-webhook-signature.js +3 -7
  57. package/dist/cli/args.d.ts +2 -1
  58. package/dist/cli/commands/compositions/index.d.ts +7 -1
  59. package/dist/cli/commands/compositions/index.js +2 -2
  60. package/dist/cli/commands/functions/deploy.d.ts +7 -1
  61. package/dist/cli/commands/functions/deploy.js +7 -2
  62. package/dist/cli/commands/functions/index.d.ts +8 -1
  63. package/dist/cli/commands/functions/index.js +8 -4
  64. package/dist/cli/commands/functions/ls.d.ts +6 -1
  65. package/dist/cli/commands/functions/ls.js +2 -3
  66. package/dist/cli/commands/functions/rmall.d.ts +6 -1
  67. package/dist/cli/commands/functions/rmall.js +2 -3
  68. package/dist/cli/commands/render/render.d.ts +6 -1
  69. package/dist/cli/commands/render/render.js +9 -7
  70. package/dist/cli/commands/sites/create.js +2 -0
  71. package/dist/cli/commands/sites/index.d.ts +1 -1
  72. package/dist/cli/commands/sites/index.js +4 -4
  73. package/dist/cli/commands/still.d.ts +2 -2
  74. package/dist/cli/commands/still.js +5 -5
  75. package/dist/cli/get-aws-region.js +0 -4
  76. package/dist/cli/helpers/find-function-name.d.ts +6 -1
  77. package/dist/cli/helpers/find-function-name.js +4 -5
  78. package/dist/cli/index.d.ts +2 -2
  79. package/dist/cli/index.js +36 -16
  80. package/dist/client.d.ts +17 -22
  81. package/dist/client.js +17 -13
  82. package/dist/functions/aws-implementation.d.ts +13 -1
  83. package/dist/functions/aws-implementation.js +46 -0
  84. package/dist/functions/aws-server-implementation.d.ts +2 -0
  85. package/dist/functions/aws-server-implementation.js +25 -0
  86. package/dist/functions/full-client-implementation.d.ts +3 -0
  87. package/dist/functions/full-client-implementation.js +16 -0
  88. package/dist/functions/helpers/clean-tmpdir.js +1 -3
  89. package/dist/functions/helpers/get-current-region.js +0 -4
  90. package/dist/functions/helpers/get-output-url-from-metadata.d.ts +3 -7
  91. package/dist/functions/helpers/get-output-url-from-metadata.js +1 -1
  92. package/dist/functions/helpers/lifecycle.d.ts +4 -2
  93. package/dist/functions/helpers/lifecycle.js +3 -18
  94. package/dist/functions/helpers/timer.d.ts +2 -4
  95. package/dist/functions/http-client.d.ts +7 -0
  96. package/dist/functions/http-client.js +22 -0
  97. package/dist/functions/index.d.ts +1 -8
  98. package/dist/functions/index.js +12 -235
  99. package/dist/index.d.ts +6 -6
  100. package/dist/index.js +27 -6
  101. package/dist/internals.d.ts +6 -5
  102. package/dist/pricing/price-per-1-s.js +102 -0
  103. package/dist/regions.d.ts +1 -1
  104. package/dist/regions.js +3 -0
  105. package/dist/shared/call-lambda-async.d.ts +3 -0
  106. package/dist/shared/call-lambda-async.js +20 -0
  107. package/dist/shared/call-lambda-streaming.d.ts +7 -0
  108. package/dist/shared/{call-lambda.js → call-lambda-streaming.js} +36 -61
  109. package/dist/shared/call-lambda-sync.d.ts +3 -0
  110. package/dist/shared/call-lambda-sync.js +30 -0
  111. package/dist/shared/check-credentials.js +2 -3
  112. package/dist/shared/constants.d.ts +2 -91
  113. package/dist/shared/constants.js +1 -8
  114. package/dist/shared/convert-to-serve-url.js +2 -2
  115. package/dist/shared/get-account-id.d.ts +3 -4
  116. package/dist/shared/get-account-id.js +3 -3
  117. package/dist/shared/get-aws-urls.d.ts +4 -8
  118. package/dist/shared/get-aws-urls.js +1 -1
  119. package/dist/shared/get-function-version.js +4 -4
  120. package/dist/shared/get-layers.d.ts +1 -2
  121. package/dist/shared/get-layers.js +2 -4
  122. package/dist/shared/get-s3-operations.d.ts +4 -1
  123. package/dist/shared/get-s3-operations.js +2 -3
  124. package/dist/shared/get-service-client.js +2 -2
  125. package/dist/shared/hosted-layers.d.ts +0 -1
  126. package/dist/shared/hosted-layers.js +139 -537
  127. package/dist/shared/lambda-insights-extensions.d.ts +1 -1
  128. package/dist/shared/lambda-insights-extensions.js +3 -0
  129. package/dist/shared/read-dir.d.ts +2 -10
  130. package/dist/shared/read-dir.js +5 -4
  131. package/dist/shared/validate-aws-region.js +1 -1
  132. package/dist/shared/validate-bucketname.d.ts +1 -1
  133. package/package.json +15 -15
  134. package/remotionlambda-arm64.zip +0 -0
  135. package/dist/api/__mocks__/clean-items.d.ts +0 -2
  136. package/dist/api/__mocks__/clean-items.js +0 -24
  137. package/dist/api/__mocks__/create-function.d.ts +0 -2
  138. package/dist/api/__mocks__/create-function.js +0 -21
  139. package/dist/api/__mocks__/delete-function.d.ts +0 -2
  140. package/dist/api/__mocks__/delete-function.js +0 -9
  141. package/dist/api/__mocks__/get-functions.d.ts +0 -2
  142. package/dist/api/__mocks__/get-functions.js +0 -9
  143. package/dist/api/__mocks__/upload-dir.d.ts +0 -3
  144. package/dist/api/__mocks__/upload-dir.js +0 -47
  145. package/dist/api/mock-functions.d.ts +0 -18
  146. package/dist/api/mock-functions.js +0 -36
  147. package/dist/cli/helpers/__mocks__/quit.d.ts +0 -1
  148. package/dist/cli/helpers/__mocks__/quit.js +0 -7
  149. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +0 -7
  150. package/dist/functions/chunk-optimization/plan-frame-ranges.js +0 -17
  151. package/dist/functions/chunk-optimization/types.d.ts +0 -8
  152. package/dist/functions/chunk-optimization/types.js +0 -2
  153. package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +0 -3
  154. package/dist/functions/helpers/__mocks__/get-browser-instance.js +0 -12
  155. package/dist/functions/helpers/__mocks__/leak-detection.d.ts +0 -4
  156. package/dist/functions/helpers/__mocks__/leak-detection.js +0 -9
  157. package/dist/functions/helpers/__mocks__/timer.d.ts +0 -2
  158. package/dist/functions/helpers/__mocks__/timer.js +0 -10
  159. package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -1
  160. package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -17
  161. package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -5
  162. package/dist/functions/helpers/calculate-chunk-times.js +0 -29
  163. package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -15
  164. package/dist/functions/helpers/calculate-price-from-bucket.js +0 -30
  165. package/dist/functions/helpers/can-concat-seamlessly.d.ts +0 -3
  166. package/dist/functions/helpers/can-concat-seamlessly.js +0 -17
  167. package/dist/functions/helpers/cleanup-props.d.ts +0 -8
  168. package/dist/functions/helpers/cleanup-props.js +0 -23
  169. package/dist/functions/helpers/concat-videos.d.ts +0 -23
  170. package/dist/functions/helpers/concat-videos.js +0 -54
  171. package/dist/functions/helpers/create-post-render-data.d.ts +0 -17
  172. package/dist/functions/helpers/create-post-render-data.js +0 -67
  173. package/dist/functions/helpers/find-output-file-in-bucket.d.ts +0 -14
  174. package/dist/functions/helpers/find-output-file-in-bucket.js +0 -38
  175. package/dist/functions/helpers/format-costs-info.d.ts +0 -2
  176. package/dist/functions/helpers/format-costs-info.js +0 -23
  177. package/dist/functions/helpers/get-overall-progress-s3.d.ts +0 -10
  178. package/dist/functions/helpers/get-overall-progress-s3.js +0 -24
  179. package/dist/functions/helpers/get-overall-progress.d.ts +0 -9
  180. package/dist/functions/helpers/get-overall-progress.js +0 -23
  181. package/dist/functions/helpers/get-progress.d.ts +0 -15
  182. package/dist/functions/helpers/get-progress.js +0 -254
  183. package/dist/functions/helpers/get-retry-stats.d.ts +0 -5
  184. package/dist/functions/helpers/get-retry-stats.js +0 -2
  185. package/dist/functions/helpers/inspect-errors.d.ts +0 -4
  186. package/dist/functions/helpers/inspect-errors.js +0 -39
  187. package/dist/functions/helpers/is-warm.d.ts +0 -2
  188. package/dist/functions/helpers/is-warm.js +0 -10
  189. package/dist/functions/helpers/leak-detection.d.ts +0 -4
  190. package/dist/functions/helpers/leak-detection.js +0 -40
  191. package/dist/functions/helpers/make-timeout-error.d.ts +0 -10
  192. package/dist/functions/helpers/make-timeout-error.js +0 -31
  193. package/dist/functions/helpers/make-timeout-message.d.ts +0 -10
  194. package/dist/functions/helpers/make-timeout-message.js +0 -75
  195. package/dist/functions/helpers/merge-chunks.d.ts +0 -36
  196. package/dist/functions/helpers/merge-chunks.js +0 -84
  197. package/dist/functions/helpers/min-max.d.ts +0 -2
  198. package/dist/functions/helpers/min-max.js +0 -33
  199. package/dist/functions/helpers/on-downloads-logger.d.ts +0 -2
  200. package/dist/functions/helpers/on-downloads-logger.js +0 -29
  201. package/dist/functions/helpers/overall-render-progress.d.ts +0 -59
  202. package/dist/functions/helpers/overall-render-progress.js +0 -180
  203. package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -1
  204. package/dist/functions/helpers/print-concurrency-curve.js +0 -8
  205. package/dist/functions/helpers/print-logging-helper.d.ts +0 -4
  206. package/dist/functions/helpers/print-logging-helper.js +0 -12
  207. package/dist/functions/helpers/render-has-audio-video.d.ts +0 -6
  208. package/dist/functions/helpers/render-has-audio-video.js +0 -21
  209. package/dist/functions/helpers/request-context.d.ts +0 -5
  210. package/dist/functions/helpers/request-context.js +0 -2
  211. package/dist/functions/helpers/stream-renderer.d.ts +0 -17
  212. package/dist/functions/helpers/stream-renderer.js +0 -148
  213. package/dist/functions/launch.d.ts +0 -10
  214. package/dist/functions/launch.js +0 -596
  215. package/dist/functions/progress.d.ts +0 -11
  216. package/dist/functions/progress.js +0 -51
  217. package/dist/functions/renderer.d.ts +0 -17
  218. package/dist/functions/renderer.js +0 -341
  219. package/dist/functions/start.d.ts +0 -13
  220. package/dist/functions/start.js +0 -113
  221. package/dist/functions/still.d.ts +0 -19
  222. package/dist/functions/still.js +0 -330
  223. package/dist/shared/__mocks__/aws-clients.d.ts +0 -2
  224. package/dist/shared/__mocks__/aws-clients.js +0 -62
  225. package/dist/shared/__mocks__/bundle-site.d.ts +0 -2
  226. package/dist/shared/__mocks__/bundle-site.js +0 -32
  227. package/dist/shared/__mocks__/check-credentials.d.ts +0 -1
  228. package/dist/shared/__mocks__/check-credentials.js +0 -5
  229. package/dist/shared/__mocks__/get-account-id.d.ts +0 -2
  230. package/dist/shared/__mocks__/get-account-id.js +0 -11
  231. package/dist/shared/__mocks__/read-dir.d.ts +0 -2
  232. package/dist/shared/__mocks__/read-dir.js +0 -13
  233. package/dist/shared/call-lambda.d.ts +0 -16
  234. package/dist/shared/cleanup-serialized-input-props.d.ts +0 -14
  235. package/dist/shared/cleanup-serialized-input-props.js +0 -34
  236. package/dist/shared/docs-url.d.ts +0 -1
  237. package/dist/shared/docs-url.js +0 -4
  238. package/dist/shared/get-most-expensive-chunks.d.ts +0 -8
  239. package/dist/shared/get-most-expensive-chunks.js +0 -28
  240. package/dist/shared/invoke-webhook.d.ts +0 -48
  241. package/dist/shared/invoke-webhook.js +0 -140
  242. package/dist/shared/parse-lambda-timings-key.d.ts +0 -5
  243. package/dist/shared/parse-lambda-timings-key.js +0 -2
  244. package/dist/shared/return-values.d.ts +0 -16
  245. package/dist/shared/return-values.js +0 -2
  246. package/dist/shared/stackback.d.ts +0 -6
  247. package/dist/shared/stackback.js +0 -59
  248. package/dist/shared/validate-download-behavior.d.ts +0 -1
  249. package/dist/shared/validate-download-behavior.js +0 -21
  250. package/dist/shared/validate-frames-per-lambda.d.ts +0 -4
  251. package/dist/shared/validate-frames-per-lambda.js +0 -29
  252. package/dist/shared/validate-privacy.d.ts +0 -2
  253. package/dist/shared/validate-privacy.js +0 -14
  254. package/dist/shared/validate.d.ts +0 -4
  255. package/dist/shared/validate.js +0 -8
  256. package/dist/shared/why-is-node-running.d.ts +0 -15
  257. package/dist/shared/why-is-node-running.js +0 -88
  258. package/vitest.config.mts +0 -11
package/LICENSE.md CHANGED
@@ -11,7 +11,7 @@ Depending on the type of your legal entity, you are granted permission to use Re
11
11
 
12
12
  ## Free license
13
13
 
14
- Copyright © 2024 [Remotion](https://www.remotion.dev)
14
+ Copyright © 2025 [Remotion](https://www.remotion.dev)
15
15
 
16
16
  ### Eligibility
17
17
 
@@ -27,10 +27,15 @@ const layerInfo = {
27
27
  'me-south-1': [],
28
28
  'sa-east-1': [],
29
29
  'us-west-1': [],
30
+ 'ap-southeast-4': [],
31
+ 'ap-southeast-5': [],
32
+ 'eu-central-2': [],
33
+ };
34
+ const getBucketName = (region) => {
35
+ return `remotionlambda-binaries-${region}`;
30
36
  };
31
- const V5_RUNTIME = true;
32
37
  const makeLayerPublic = async () => {
33
- const runtimes = [V5_RUNTIME ? 'nodejs20.x' : 'nodejs18.x'];
38
+ const runtimes = ['nodejs20.x'];
34
39
  const layers = [
35
40
  'fonts',
36
41
  'chromium',
@@ -43,18 +48,12 @@ const makeLayerPublic = async () => {
43
48
  const layerName = `remotion-binaries-${layer}-arm64`;
44
49
  const { Version, LayerArn } = await (0, aws_clients_1.getLambdaClient)(region).send(new client_lambda_1.PublishLayerVersionCommand({
45
50
  Content: {
46
- S3Bucket: 'remotionlambda-binaries-' + region,
47
- S3Key: layer === 'emoji-apple'
48
- ? 'remotion-layer-emoji-v1-arm64.zip'
49
- : V5_RUNTIME
50
- ? `remotion-layer-${layer}-v11-arm64.zip`
51
- : `remotion-layer-${layer}-v10-arm64.zip`,
51
+ S3Bucket: getBucketName(region),
52
+ S3Key: `remotion-layer-${layer}-v12-arm64.zip`,
52
53
  },
53
54
  LayerName: layerName,
54
55
  LicenseInfo: layer === 'chromium'
55
- ? V5_RUNTIME
56
- ? 'Chromium 123.0.6312.86, compiled from source. Read Chromium License: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE'
57
- : 'Chromium 114, compiled from source. Read Chromium License: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE'
56
+ ? 'Chromium 123.0.6312.86, compiled from source. Read Chromium License: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE'
58
57
  : layer === 'emoji-apple'
59
58
  ? 'Apple Emojis (https://github.com/samuelngs/apple-emoji-linux). For educational purposes only - Apple is a trademark of Apple Inc., registered in the U.S. and other countries.'
60
59
  : layer === 'emoji-google'
@@ -0,0 +1,10 @@
1
+ import type { WebhookErrorPayload, WebhookSuccessPayload, WebhookTimeoutPayload } from '@remotion/serverless';
2
+ export type NextWebhookArgs = {
3
+ testing?: boolean;
4
+ extraHeaders?: Record<string, string>;
5
+ secret: string;
6
+ onSuccess?: (payload: WebhookSuccessPayload) => void;
7
+ onTimeout?: (payload: WebhookTimeoutPayload) => void;
8
+ onError?: (payload: WebhookErrorPayload) => void;
9
+ };
10
+ export declare const appRouterWebhook: (options: NextWebhookArgs) => ((req: Request) => Promise<Response>);
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.appRouterWebhook = void 0;
4
+ const validate_webhook_signature_1 = require("./validate-webhook-signature");
5
+ const appRouterWebhook = (options) => {
6
+ const { testing, extraHeaders, secret, onSuccess, onTimeout, onError } = options;
7
+ return async function (req) {
8
+ let headers = extraHeaders || {};
9
+ if (testing) {
10
+ const testingheaders = {
11
+ 'Access-Control-Allow-Origin': 'https://www.remotion.dev',
12
+ 'Access-Control-Allow-Headers': 'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version, X-Remotion-Status, X-Remotion-Signature, X-Remotion-Mode',
13
+ 'Access-Control-Allow-Methods': 'OPTIONS,POST',
14
+ };
15
+ headers = { ...headers, ...testingheaders };
16
+ }
17
+ if (req.method === 'OPTIONS') {
18
+ // do we have any use of the OPTIONS method other than the tester on webhooks page ? if so we can add a condition here to only return this if testing mode enabled
19
+ return new Response(null, {
20
+ headers,
21
+ });
22
+ }
23
+ // Parse the body properly
24
+ const body = await req.json();
25
+ (0, validate_webhook_signature_1.validateWebhookSignature)({
26
+ secret,
27
+ body,
28
+ signatureHeader: req.headers.get('X-Remotion-Signature'),
29
+ });
30
+ const payload = body;
31
+ if (payload.type === 'success' && onSuccess) {
32
+ onSuccess(payload);
33
+ }
34
+ else if (payload.type === 'timeout' && onTimeout) {
35
+ onTimeout(payload);
36
+ }
37
+ else if (payload.type === 'error' && onError) {
38
+ onError(payload);
39
+ }
40
+ return new Response(JSON.stringify({ success: true }), { headers });
41
+ };
42
+ };
43
+ exports.appRouterWebhook = appRouterWebhook;
@@ -1,7 +1,7 @@
1
1
  import type { LogLevel } from '@remotion/renderer';
2
2
  import type { AwsRegion } from '../regions';
3
3
  import type { RuntimePreference } from '../shared/get-layers';
4
- export declare const createFunction: ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights, enableV5Runtime, logLevel, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, }: {
4
+ export declare const createFunction: ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights, logLevel, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, }: {
5
5
  createCloudWatchLogGroup: boolean;
6
6
  region: AwsRegion;
7
7
  zipFile: string;
@@ -14,7 +14,6 @@ export declare const createFunction: ({ createCloudWatchLogGroup, region, zipFil
14
14
  ephemerealStorageInMb: number;
15
15
  customRoleArn: string;
16
16
  enableLambdaInsights: boolean;
17
- enableV5Runtime: boolean;
18
17
  logLevel: LogLevel;
19
18
  vpcSubnetIds: string;
20
19
  vpcSecurityGroupIds: string;
@@ -11,7 +11,7 @@ const aws_clients_1 = require("../shared/aws-clients");
11
11
  const get_layers_1 = require("../shared/get-layers");
12
12
  const lambda_insights_extensions_1 = require("../shared/lambda-insights-extensions");
13
13
  const suggested_policy_1 = require("./iam-validation/suggested-policy");
14
- const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights, enableV5Runtime, logLevel, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, }) => {
14
+ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights, logLevel, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, }) => {
15
15
  var _a;
16
16
  if (createCloudWatchLogGroup) {
17
17
  renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Creating CloudWatch group');
@@ -45,11 +45,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
45
45
  const layers = (0, get_layers_1.getLayers)({
46
46
  option: runtimePreference,
47
47
  region,
48
- enableV5Runtime,
49
48
  });
50
- if (enableV5Runtime) {
51
- renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'New V5 runtime enabled https://remotion.dev/docs/lambda/runtime#runtime-changes-in-remotion-50');
52
- }
53
49
  let vpcConfig;
54
50
  if (vpcSubnetIds && vpcSecurityGroupIds) {
55
51
  vpcConfig = {
@@ -58,6 +54,12 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
58
54
  };
59
55
  }
60
56
  renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Deploying new Lambda function');
57
+ const insightsLayer = enableLambdaInsights
58
+ ? lambda_insights_extensions_1.lambdaInsightsExtensions[region]
59
+ : null;
60
+ if (enableLambdaInsights && !insightsLayer) {
61
+ throw new Error(`Lambda Insights is not supported by AWS in region ${region}. Please disable Lambda Insights. See http://remotion.dev/docs/lambda/insights#unsupported-regions`);
62
+ }
61
63
  const { FunctionName, FunctionArn } = await (0, aws_clients_1.getLambdaClient)(region).send(new client_lambda_1.CreateFunctionCommand({
62
64
  Code: {
63
65
  ZipFile: (0, node_fs_1.readFileSync)(zipFile),
@@ -65,13 +67,13 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
65
67
  FunctionName: functionName,
66
68
  Handler: 'index.handler',
67
69
  Role: customRoleArn !== null && customRoleArn !== void 0 ? customRoleArn : defaultRoleName,
68
- Runtime: enableV5Runtime ? 'nodejs20.x' : 'nodejs18.x',
70
+ Runtime: 'nodejs20.x',
69
71
  Description: 'Renders a Remotion video.',
70
72
  MemorySize: memorySizeInMb,
71
73
  Timeout: timeoutInSeconds,
72
74
  Layers: layers
73
75
  .map(({ layerArn, version }) => `${layerArn}:${version}`)
74
- .concat(enableLambdaInsights ? lambda_insights_extensions_1.lambdaInsightsExtensions[region] : []),
76
+ .concat(insightsLayer ? [insightsLayer] : []),
75
77
  Architectures: ['arm64'],
76
78
  EphemeralStorage: {
77
79
  Size: ephemerealStorageInMb,
@@ -119,9 +121,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
119
121
  }
120
122
  renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Function is now ready.');
121
123
  renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Locking the runtime version of the function...');
122
- const RuntimeVersionArn = enableV5Runtime
123
- ? `arn:aws:lambda:${region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72`
124
- : `arn:aws:lambda:${region}::runtime:b97ad873eb5228db2e7d5727cd116734cc24c92ff1381739c4400c095404a2d3`;
124
+ const RuntimeVersionArn = `arn:aws:lambda:${region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72`;
125
125
  try {
126
126
  await (0, aws_clients_1.getLambdaClient)(region).send(new client_lambda_1.PutRuntimeManagementConfigCommand({
127
127
  FunctionName,
@@ -1,13 +1,4 @@
1
- import type { AwsRegion } from '../regions';
2
- export type DeleteFunctionInput = {
3
- region: AwsRegion;
4
- functionName: string;
5
- };
6
- /**
7
- * @description Deletes a function from AWS Lambda.
8
- * @see [Documentation](https://remotion.dev/docs/lambda/deletefunction)
9
- * @param params.region The region the function was deployed to.
10
- * @param params.functionName The name of the function.
11
- * @returns {Promise<void>} Nothing. Throws if the function failed to delete.
12
- */
13
- export declare const deleteFunction: ({ region, functionName, }: DeleteFunctionInput) => Promise<void>;
1
+ import type { DeleteFunction, DeleteFunctionInput as GenericDeleteFunctionInput } from '@remotion/serverless';
2
+ import type { AwsProvider } from '../functions/aws-implementation';
3
+ export type DeleteFunctionInput = GenericDeleteFunctionInput<AwsProvider>;
4
+ export declare const deleteFunction: DeleteFunction<AwsProvider>;
@@ -3,12 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deleteFunction = void 0;
4
4
  const client_lambda_1 = require("@aws-sdk/client-lambda");
5
5
  const aws_clients_1 = require("../shared/aws-clients");
6
- /**
7
- * @description Deletes a function from AWS Lambda.
6
+ /*
7
+ * @description Deletes a deployed Lambda function based on its name.
8
8
  * @see [Documentation](https://remotion.dev/docs/lambda/deletefunction)
9
- * @param params.region The region the function was deployed to.
10
- * @param params.functionName The name of the function.
11
- * @returns {Promise<void>} Nothing. Throws if the function failed to delete.
12
9
  */
13
10
  const deleteFunction = async ({ region, functionName, }) => {
14
11
  await (0, aws_clients_1.getLambdaClient)(region).send(new client_lambda_1.DeleteFunctionCommand({
@@ -15,14 +15,6 @@ export declare const internalDeleteRender: (input: DeleteRenderInput & {
15
15
  }) => Promise<{
16
16
  freedBytes: number;
17
17
  }>;
18
- /**
19
- * @description Deletes a render artifact and it's metadata given it's renderId.
20
- * @see [Documentation](https://remotion.dev/docs/lambda/deleterender)
21
- * @param params.region The AWS region in which the media resides.
22
- * @param params.bucketName The `bucketName` that was specified during the render
23
- * @param params.renderId The `renderId` that was obtained after triggering the render.
24
- * @param params.customCredentials If the file was saved to a foreign cloud, pass credentials for reading from it.
25
- */
26
18
  export declare const deleteRender: (input: DeleteRenderInput) => Promise<{
27
19
  freedBytes: number;
28
20
  }>;
@@ -3,15 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deleteRender = exports.internalDeleteRender = void 0;
4
4
  const client_1 = require("@remotion/serverless/client");
5
5
  const aws_implementation_1 = require("../functions/aws-implementation");
6
- const get_overall_progress_s3_1 = require("../functions/helpers/get-overall-progress-s3");
7
- const get_account_id_1 = require("../shared/get-account-id");
8
6
  const clean_items_1 = require("./clean-items");
9
7
  const internalDeleteRender = async (input) => {
10
8
  var _a;
11
- const expectedBucketOwner = await (0, get_account_id_1.getAccountId)({
9
+ const expectedBucketOwner = await input.providerSpecifics.getAccountId({
12
10
  region: input.region,
13
11
  });
14
- const progress = await (0, get_overall_progress_s3_1.getOverallProgressS3)({
12
+ const progress = await (0, client_1.getOverallProgressFromStorage)({
15
13
  bucketName: input.bucketName,
16
14
  expectedBucketOwner,
17
15
  region: input.region,
@@ -66,13 +64,9 @@ const internalDeleteRender = async (input) => {
66
64
  };
67
65
  };
68
66
  exports.internalDeleteRender = internalDeleteRender;
69
- /**
70
- * @description Deletes a render artifact and it's metadata given it's renderId.
67
+ /*
68
+ * @description Deletes a rendered video, audio or still and its associated metadata.
71
69
  * @see [Documentation](https://remotion.dev/docs/lambda/deleterender)
72
- * @param params.region The AWS region in which the media resides.
73
- * @param params.bucketName The `bucketName` that was specified during the render
74
- * @param params.renderId The `renderId` that was obtained after triggering the render.
75
- * @param params.customCredentials If the file was saved to a foreign cloud, pass credentials for reading from it.
76
70
  */
77
71
  const deleteRender = (input) => {
78
72
  return (0, exports.internalDeleteRender)({
@@ -21,15 +21,5 @@ export type DeleteSiteOutput = {
21
21
  export declare const internalDeleteSite: ({ bucketName, siteName, region, onAfterItemDeleted, providerSpecifics, forcePathStyle, }: DeleteSiteInput & {
22
22
  providerSpecifics: ProviderSpecifics<AwsProvider>;
23
23
  }) => Promise<DeleteSiteOutput>;
24
- /**
25
- *
26
- * @description Deletes a deployed site from your S3 bucket. The opposite of deploySite().
27
- * @see [Documentation](https://remotion.dev/docs/lambda/deletesite)
28
- * @param params.bucketName The S3 bucket name where the site resides in.
29
- * @param params.siteName The ID of the site that you want to delete.
30
- * @param {AwsRegion} params.region The region in where the S3 bucket resides in.
31
- * @param params.onAfterItemDeleted Function that gets called after each file that gets deleted, useful for showing progress.
32
- * @returns {Promise<DeleteSiteOutput>} Object containing info about how much space was freed.
33
- */
34
24
  export declare const deleteSite: (props: DeleteSiteOptionalInput) => Promise<DeleteSiteOutput>;
35
25
  export {};
@@ -3,10 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deleteSite = exports.internalDeleteSite = void 0;
4
4
  const defaults_1 = require("../defaults");
5
5
  const aws_implementation_1 = require("../functions/aws-implementation");
6
- const get_account_id_1 = require("../shared/get-account-id");
7
6
  const clean_items_1 = require("./clean-items");
8
7
  const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDeleted, providerSpecifics, forcePathStyle, }) => {
9
- const accountId = await (0, get_account_id_1.getAccountId)({ region });
8
+ const accountId = await providerSpecifics.getAccountId({ region });
10
9
  let files = await providerSpecifics.listObjects({
11
10
  bucketName,
12
11
  // The `/` is important to not accidentially delete sites with the same name but containing a suffix.
@@ -44,15 +43,9 @@ const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDel
44
43
  };
45
44
  };
46
45
  exports.internalDeleteSite = internalDeleteSite;
47
- /**
48
- *
49
- * @description Deletes a deployed site from your S3 bucket. The opposite of deploySite().
50
- * @see [Documentation](https://remotion.dev/docs/lambda/deletesite)
51
- * @param params.bucketName The S3 bucket name where the site resides in.
52
- * @param params.siteName The ID of the site that you want to delete.
53
- * @param {AwsRegion} params.region The region in where the S3 bucket resides in.
54
- * @param params.onAfterItemDeleted Function that gets called after each file that gets deleted, useful for showing progress.
55
- * @returns {Promise<DeleteSiteOutput>} Object containing info about how much space was freed.
46
+ /*
47
+ * @description Removes a Remotion project from your Cloud Storage bucket.
48
+ * @see [Documentation](https://remotion.dev/docs/cloudrun/deletesite)
56
49
  */
57
50
  const deleteSite = (props) => {
58
51
  var _a, _b;
@@ -1,4 +1,5 @@
1
1
  import type { LogLevel } from '@remotion/renderer';
2
+ import type { CloudProvider, FullClientSpecifics, ProviderSpecifics } from '@remotion/serverless';
2
3
  import type { AwsRegion } from '../regions';
3
4
  import { type RuntimePreference } from '../shared/get-layers';
4
5
  type MandatoryParameters = {
@@ -14,7 +15,6 @@ type OptionalParameters = {
14
15
  enableLambdaInsights: boolean;
15
16
  indent: boolean;
16
17
  logLevel: LogLevel;
17
- enableV5Runtime: boolean;
18
18
  vpcSubnetIds: string | undefined;
19
19
  vpcSecurityGroupIds: string | undefined;
20
20
  runtimePreference: RuntimePreference;
@@ -24,18 +24,11 @@ export type DeployFunctionOutput = {
24
24
  functionName: string;
25
25
  alreadyExisted: boolean;
26
26
  };
27
- export declare const internalDeployFunction: (params: MandatoryParameters & OptionalParameters) => Promise<DeployFunctionOutput>;
28
- /**
29
- * @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
30
- * @see [Documentation](https://www.remotion.dev/docs/lambda/deployfunction)
31
- * @param params.createCloudWatchLogGroup Whether you'd like to create a CloudWatch Log Group to store the logs for this function.
32
- * @param params.cloudWatchLogRetentionPeriodInDays (optional) The number of days to retain the CloudWatch logs for this function. Default is 14 days.
33
- * @param params.region The region you want to deploy your function to.
34
- * @param params.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
35
- * @param params.memorySizeInMb How much memory should be allocated to the Lambda function.
36
- * @param params.architecture The architecture Lambda should run on. One of x86_64 and x64
37
- * @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
38
- * @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
39
- */
40
- export declare const deployFunction: ({ createCloudWatchLogGroup, memorySizeInMb, region, timeoutInSeconds, cloudWatchLogRetentionPeriodInDays, customRoleArn, enableLambdaInsights, indent, logLevel, enableV5Runtime, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, diskSizeInMb, }: DeployFunctionInput) => Promise<DeployFunctionOutput>;
27
+ export declare const internalDeployFunction: <Provider extends CloudProvider>(params: MandatoryParameters & OptionalParameters & {
28
+ providerSpecifics: ProviderSpecifics<Provider>;
29
+ fullClientSpecifics: FullClientSpecifics<Provider>;
30
+ }) => Promise<DeployFunctionOutput>;
31
+ export declare const deployFunction: ({ createCloudWatchLogGroup, memorySizeInMb, region, timeoutInSeconds, cloudWatchLogRetentionPeriodInDays, customRoleArn, enableLambdaInsights, indent, logLevel, enableV5Runtime, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, diskSizeInMb, }: DeployFunctionInput & {
32
+ enableV5Runtime?: boolean;
33
+ }) => Promise<DeployFunctionOutput>;
41
34
  export {};
@@ -2,21 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deployFunction = exports.internalDeployFunction = void 0;
4
4
  const error_handling_1 = require("@remotion/renderer/error-handling");
5
- const no_react_1 = require("remotion/no-react");
6
5
  const version_1 = require("remotion/version");
7
- const get_functions_1 = require("../api/get-functions");
6
+ const aws_implementation_1 = require("../functions/aws-implementation");
7
+ const full_client_implementation_1 = require("../functions/full-client-implementation");
8
8
  const constants_1 = require("../shared/constants");
9
9
  const function_zip_path_1 = require("../shared/function-zip-path");
10
- const get_account_id_1 = require("../shared/get-account-id");
11
10
  const get_layers_1 = require("../shared/get-layers");
12
- const lambda_version_string_1 = require("../shared/lambda-version-string");
13
11
  const validate_aws_region_1 = require("../shared/validate-aws-region");
14
12
  const validate_custom_role_arn_1 = require("../shared/validate-custom-role-arn");
15
13
  const validate_disk_size_in_mb_1 = require("../shared/validate-disk-size-in-mb");
16
14
  const validate_memory_size_1 = require("../shared/validate-memory-size");
17
15
  const validate_retention_period_1 = require("../shared/validate-retention-period");
18
16
  const validate_timeout_1 = require("../shared/validate-timeout");
19
- const create_function_1 = require("./create-function");
17
+ const speculate_function_name_1 = require("./speculate-function-name");
20
18
  const internalDeployFunction = async (params) => {
21
19
  var _a, _b;
22
20
  (0, validate_memory_size_1.validateMemorySize)(params.memorySizeInMb);
@@ -26,14 +24,15 @@ const internalDeployFunction = async (params) => {
26
24
  (0, validate_disk_size_in_mb_1.validateDiskSizeInMb)(params.diskSizeInMb);
27
25
  (0, validate_custom_role_arn_1.validateCustomRoleArn)(params.customRoleArn);
28
26
  (0, get_layers_1.validateRuntimePreference)(params.runtimePreference);
29
- const fnNameRender = [
30
- `${constants_1.RENDER_FN_PREFIX}${lambda_version_string_1.LAMBDA_VERSION_STRING}`,
31
- `mem${params.memorySizeInMb}mb`,
32
- `disk${params.diskSizeInMb}mb`,
33
- `${params.timeoutInSeconds}sec`,
34
- ].join('-');
35
- const accountId = await (0, get_account_id_1.getAccountId)({ region: params.region });
36
- const fns = await (0, get_functions_1.getFunctions)({
27
+ const functionName = (0, speculate_function_name_1.speculateFunctionName)({
28
+ diskSizeInMb: params.diskSizeInMb,
29
+ memorySizeInMb: params.memorySizeInMb,
30
+ timeoutInSeconds: params.timeoutInSeconds,
31
+ });
32
+ const accountId = await params.providerSpecifics.getAccountId({
33
+ region: params.region,
34
+ });
35
+ const fns = await params.providerSpecifics.getFunctions({
37
36
  compatibleOnly: true,
38
37
  region: params.region,
39
38
  });
@@ -41,11 +40,11 @@ const internalDeployFunction = async (params) => {
41
40
  f.memorySizeInMb === params.memorySizeInMb &&
42
41
  f.timeoutInSeconds === params.timeoutInSeconds &&
43
42
  f.diskSizeInMb === params.diskSizeInMb);
44
- const created = await (0, create_function_1.createFunction)({
43
+ const created = await params.fullClientSpecifics.createFunction({
45
44
  createCloudWatchLogGroup: params.createCloudWatchLogGroup,
46
45
  region: params.region,
47
46
  zipFile: function_zip_path_1.FUNCTION_ZIP_ARM64,
48
- functionName: fnNameRender,
47
+ functionName,
49
48
  accountId,
50
49
  memorySizeInMb: params.memorySizeInMb,
51
50
  timeoutInSeconds: params.timeoutInSeconds,
@@ -54,7 +53,6 @@ const internalDeployFunction = async (params) => {
54
53
  ephemerealStorageInMb: params.diskSizeInMb,
55
54
  customRoleArn: params.customRoleArn,
56
55
  enableLambdaInsights: (_b = params.enableLambdaInsights) !== null && _b !== void 0 ? _b : false,
57
- enableV5Runtime: params.enableV5Runtime,
58
56
  logLevel: params.logLevel,
59
57
  vpcSubnetIds: params.vpcSubnetIds,
60
58
  vpcSecurityGroupIds: params.vpcSecurityGroupIds,
@@ -70,19 +68,14 @@ const internalDeployFunction = async (params) => {
70
68
  };
71
69
  exports.internalDeployFunction = internalDeployFunction;
72
70
  const errorHandled = (0, error_handling_1.wrapWithErrorHandling)(exports.internalDeployFunction);
73
- /**
71
+ /*
74
72
  * @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
75
- * @see [Documentation](https://www.remotion.dev/docs/lambda/deployfunction)
76
- * @param params.createCloudWatchLogGroup Whether you'd like to create a CloudWatch Log Group to store the logs for this function.
77
- * @param params.cloudWatchLogRetentionPeriodInDays (optional) The number of days to retain the CloudWatch logs for this function. Default is 14 days.
78
- * @param params.region The region you want to deploy your function to.
79
- * @param params.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
80
- * @param params.memorySizeInMb How much memory should be allocated to the Lambda function.
81
- * @param params.architecture The architecture Lambda should run on. One of x86_64 and x64
82
- * @param params.diskSizeInMb The amount of storage the function should be allocated. The higher, the longer videos you can render. Default 512.
83
- * @returns {Promise<DeployFunctionOutput>} An object that contains the `functionName` property
73
+ * @see [Documentation](https://remotion.dev/docs/lambda/deployfunction)
84
74
  */
85
75
  const deployFunction = ({ createCloudWatchLogGroup, memorySizeInMb, region, timeoutInSeconds, cloudWatchLogRetentionPeriodInDays, customRoleArn, enableLambdaInsights, indent, logLevel, enableV5Runtime, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, diskSizeInMb, }) => {
76
+ if (enableV5Runtime) {
77
+ console.warn('The `enableV5Runtime` option is now on by default. No need to specify it anymore.');
78
+ }
86
79
  return errorHandled({
87
80
  indent: indent !== null && indent !== void 0 ? indent : false,
88
81
  logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
@@ -94,10 +87,11 @@ const deployFunction = ({ createCloudWatchLogGroup, memorySizeInMb, region, time
94
87
  region,
95
88
  timeoutInSeconds,
96
89
  cloudWatchLogRetentionPeriodInDays,
97
- enableV5Runtime: enableV5Runtime !== null && enableV5Runtime !== void 0 ? enableV5Runtime : no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES,
98
90
  vpcSubnetIds,
99
91
  vpcSecurityGroupIds,
100
92
  runtimePreference: runtimePreference !== null && runtimePreference !== void 0 ? runtimePreference : 'default',
93
+ providerSpecifics: aws_implementation_1.awsImplementation,
94
+ fullClientSpecifics: full_client_implementation_1.awsFullClientSpecifics,
101
95
  });
102
96
  };
103
97
  exports.deployFunction = deployFunction;
@@ -1,10 +1,9 @@
1
1
  import { type GitSource, type WebpackOverrideFn } from '@remotion/bundler';
2
2
  import type { ToOptions } from '@remotion/renderer';
3
3
  import type { BrowserSafeApis } from '@remotion/renderer/client';
4
- import type { ProviderSpecifics } from '@remotion/serverless';
4
+ import type { FullClientSpecifics, ProviderSpecifics, UploadDirProgress } from '@remotion/serverless';
5
5
  import type { AwsProvider } from '../functions/aws-implementation';
6
6
  import type { AwsRegion } from '../regions';
7
- import type { UploadDirProgress } from './upload-dir';
8
7
  type MandatoryParameters = {
9
8
  entryPoint: string;
10
9
  bucketName: string;
@@ -88,6 +87,7 @@ export declare const internalDeploySite: (args_0: MandatoryParameters & {
88
87
  };
89
88
  }> & {
90
89
  providerSpecifics: ProviderSpecifics<AwsProvider>;
90
+ fullClientSpecifics: FullClientSpecifics<AwsProvider>;
91
91
  }) => Promise<{
92
92
  serveUrl: string;
93
93
  siteName: string;
@@ -97,15 +97,6 @@ export declare const internalDeploySite: (args_0: MandatoryParameters & {
97
97
  untouchedFiles: number;
98
98
  };
99
99
  }>;
100
- /**
101
- * @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
102
- * @see [Documentation](https://remotion.dev/docs/lambda/deploysite)
103
- * @param {AwsRegion} params.region The region in which the S3 bucket resides in.
104
- * @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
105
- * @param {string} params.bucketName The name of the bucket to deploy your project into.
106
- * @param {string} params.siteName The name of the folder in which the project gets deployed to.
107
- * @param {object} params.options Further options, see documentation page for this function.
108
- */
109
100
  export declare const deploySite: (args: DeploySiteInput) => Promise<{
110
101
  serveUrl: string;
111
102
  siteName: string;
@@ -8,24 +8,21 @@ const error_handling_1 = require("@remotion/renderer/error-handling");
8
8
  const client_1 = require("@remotion/serverless/client");
9
9
  const node_fs_1 = __importDefault(require("node:fs"));
10
10
  const aws_implementation_1 = require("../functions/aws-implementation");
11
- const bundle_site_1 = require("../shared/bundle-site");
11
+ const full_client_implementation_1 = require("../functions/full-client-implementation");
12
12
  const constants_1 = require("../shared/constants");
13
- const get_account_id_1 = require("../shared/get-account-id");
14
13
  const get_s3_operations_1 = require("../shared/get-s3-operations");
15
14
  const make_s3_url_1 = require("../shared/make-s3-url");
16
15
  const validate_aws_region_1 = require("../shared/validate-aws-region");
17
- const validate_privacy_1 = require("../shared/validate-privacy");
18
16
  const validate_site_name_1 = require("../shared/validate-site-name");
19
- const upload_dir_1 = require("./upload-dir");
20
- const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy, gitSource, throwIfSiteExists, providerSpecifics, forcePathStyle, }) => {
17
+ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy, gitSource, throwIfSiteExists, providerSpecifics, forcePathStyle, fullClientSpecifics, }) => {
21
18
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
22
19
  (0, validate_aws_region_1.validateAwsRegion)(region);
23
20
  (0, client_1.validateBucketName)(bucketName, {
24
21
  mustStartWithRemotion: !(options === null || options === void 0 ? void 0 : options.bypassBucketNameValidation),
25
22
  });
26
23
  (0, validate_site_name_1.validateSiteName)(siteName);
27
- (0, validate_privacy_1.validatePrivacy)(privacy, false);
28
- const accountId = await (0, get_account_id_1.getAccountId)({ region });
24
+ (0, client_1.validatePrivacy)(privacy, false);
25
+ const accountId = await providerSpecifics.getAccountId({ region });
29
26
  const bucketExists = await providerSpecifics.bucketExists({
30
27
  bucketName,
31
28
  region,
@@ -45,7 +42,7 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
45
42
  prefix: `${subFolder}/`,
46
43
  forcePathStyle,
47
44
  }),
48
- (0, bundle_site_1.bundleSite)({
45
+ fullClientSpecifics.bundleSite({
49
46
  publicPath: `/${subFolder}/`,
50
47
  webpackOverride: (_a = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _a !== void 0 ? _a : ((f) => f),
51
48
  enableCaching: (_b = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _b !== void 0 ? _b : true,
@@ -81,10 +78,11 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
81
78
  totalBytes = bytes;
82
79
  (_a = options.onDiffingProgress) === null || _a === void 0 ? void 0 : _a.call(options, bytes, false);
83
80
  },
81
+ fullClientSpecifics,
84
82
  });
85
83
  (_h = options.onDiffingProgress) === null || _h === void 0 ? void 0 : _h.call(options, totalBytes, true);
86
84
  await Promise.all([
87
- (0, upload_dir_1.uploadDir)({
85
+ fullClientSpecifics.uploadDir({
88
86
  bucket: bucketName,
89
87
  region,
90
88
  localDir: bundled,
@@ -104,11 +102,9 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
104
102
  });
105
103
  })),
106
104
  ]);
107
- if (!process.env.VITEST) {
108
- node_fs_1.default.rmSync(bundled, {
109
- recursive: true,
110
- });
111
- }
105
+ node_fs_1.default.rmSync(bundled, {
106
+ recursive: true,
107
+ });
112
108
  return {
113
109
  serveUrl: (0, make_s3_url_1.makeS3ServeUrl)({ bucketName, subFolder, region }),
114
110
  siteName,
@@ -120,14 +116,9 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
120
116
  };
121
117
  };
122
118
  exports.internalDeploySite = (0, error_handling_1.wrapWithErrorHandling)(mandatoryDeploySite);
123
- /**
124
- * @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
125
- * @see [Documentation](https://remotion.dev/docs/lambda/deploysite)
126
- * @param {AwsRegion} params.region The region in which the S3 bucket resides in.
127
- * @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
128
- * @param {string} params.bucketName The name of the bucket to deploy your project into.
129
- * @param {string} params.siteName The name of the folder in which the project gets deployed to.
130
- * @param {object} params.options Further options, see documentation page for this function.
119
+ /*
120
+ * @description Deploys a Remotion project to a GCP storage bucket to prepare it for rendering on Cloud Run.
121
+ * @see [Documentation](https://remotion.dev/docs/cloudrun/deploysite)
131
122
  */
132
123
  const deploySite = (args) => {
133
124
  var _a, _b, _c, _d, _e, _f;
@@ -144,6 +135,7 @@ const deploySite = (args) => {
144
135
  throwIfSiteExists: (_e = args.throwIfSiteExists) !== null && _e !== void 0 ? _e : false,
145
136
  providerSpecifics: aws_implementation_1.awsImplementation,
146
137
  forcePathStyle: (_f = args.forcePathStyle) !== null && _f !== void 0 ? _f : false,
138
+ fullClientSpecifics: full_client_implementation_1.awsFullClientSpecifics,
147
139
  });
148
140
  };
149
141
  exports.deploySite = deploySite;
@@ -22,15 +22,4 @@ export declare const internalDownloadMedia: (input: DownloadMediaInput & {
22
22
  providerSpecifics: ProviderSpecifics<AwsProvider>;
23
23
  forcePathStyle: boolean;
24
24
  }) => Promise<DownloadMediaOutput>;
25
- /**
26
- * @description Downloads a rendered video, audio or still to the disk of the machine this API is called from.
27
- * @see [Documentation](https://remotion.dev/docs/lambda/downloadmedia)
28
- * @param params.region The AWS region in which the media resides.
29
- * @param params.bucketName The `bucketName` that was specified during the render.
30
- * @param params.renderId The `renderId` that was obtained after triggering the render.
31
- * @param params.outPath Where to save the media.
32
- * @param params.onProgress Progress callback function - see docs for details.
33
- * @param params.customCredentials If the file was saved to a foreign cloud, pass credentials for reading from it.
34
- * @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
35
- */
36
25
  export declare const downloadMedia: (input: DownloadMediaInput) => Promise<DownloadMediaOutput>;