remotion_lambda 4.0.547 → 4.0.548

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc7fe9da8e379f958996efaa89c1dd1a383a5116ba1d29faba0554479c28862a
4
- data.tar.gz: d7a9f5fcf938fc64323a5bfd793dfc17b5b93166e3c737c0c16d3e450991835e
3
+ metadata.gz: 2fa70f91707f97341bbe0380e38682e84ad6e909d6edbb1af41295e254595239
4
+ data.tar.gz: 3403a9b147ca853273a11430db32242a75587f1c605953455d83904f98ae94cc
5
5
  SHA512:
6
- metadata.gz: 3c1956ba369d5c141d08629e23874dfe0d19d7a4ce4cdf3ec55d3ea66ab7c6e89f81a612bf42783656998d89899a41834888b146f89774455de9df3f0171bd27
7
- data.tar.gz: 776f2290eba00f0c3a3e717d39a03da9ccbe1c24a4312947e80f6c091b9e6adba2198868ac38990c6549750f384929b920d5319b22315a0f490245d67dc1033a
6
+ metadata.gz: d6cec72c897db1af0c6e739c010e6c2ca6cd0f6dfc024b87fccd3f34f33b4dc41b858c7bc7f7a4ce0e35f52c04a7cc685b039a942745371daddf7d58266b1138
7
+ data.tar.gz: 8304368a49f4276c75d9766f06bf30570b45a053badaa80e540213b466286898fed8c3566de0d3137b4fd5c460cd42f915b3b72146b7c8caa572a3cccbb37a79
@@ -1,5 +1,16 @@
1
+ require 'logger'
1
2
  require_relative 'version'
2
3
 
4
+ module RemotionLambda
5
+ def self.log_deprecated_still_license_key(license_key, log_level, api, option)
6
+ return if license_key.nil? || license_key == "free-license" || %w[warn error].include?(log_level)
7
+
8
+ Logger.new($stderr).info(
9
+ "Still renders don't need to be tracked anymore, an unlimited amount is now included in any Remotion License. You can now remove `#{option}` from #{api}."
10
+ )
11
+ end
12
+ end
13
+
3
14
  def get_render_still_on_lambda_payload(
4
15
  bucket_name: nil,
5
16
  composition: nil,
@@ -11,6 +22,7 @@ def get_render_still_on_lambda_payload(
11
22
  force_duration_in_frames: nil,
12
23
  force_path_style: false,
13
24
  force_width: nil,
25
+ # Deprecated: Still renders do not send usage telemetry.
14
26
  api_key: nil,
15
27
  license_key: nil,
16
28
  image_format: "jpeg",
@@ -35,9 +47,12 @@ def get_render_still_on_lambda_payload(
35
47
  is_production: nil
36
48
  )
37
49
 
38
- if api_key != nil
39
- warn "[DEPRECATED] The 'api_key' parameter is deprecated and will be removed in a future version. Please use 'license_key' instead."
40
- end
50
+ RemotionLambda.log_deprecated_still_license_key(
51
+ license_key || api_key,
52
+ log_level,
53
+ "get_render_still_on_lambda_payload()",
54
+ license_key.nil? ? "api_key" : "license_key"
55
+ )
41
56
 
42
57
  payload = {
43
58
  composition: composition,
@@ -50,7 +65,7 @@ payload = {
50
65
  forceDurationInFrames: force_duration_in_frames,
51
66
  forcePathStyle: force_path_style,
52
67
  forceWidth: force_width,
53
- licenseKey: license_key || api_key,
68
+ licenseKey: nil,
54
69
  imageFormat: image_format,
55
70
  inputProps: {
56
71
  type: "payload",
@@ -75,7 +90,7 @@ payload = {
75
90
  attempt: 1,
76
91
  streamed: false,
77
92
  frame: frame,
78
- isProduction: is_production
93
+ isProduction: nil
79
94
  }
80
95
  payload
81
96
  end
@@ -3,6 +3,7 @@ require 'aws-sdk-s3'
3
3
  require 'json'
4
4
  require 'logger'
5
5
  require_relative 'input_props_serializer'
6
+ require_relative 'render_still_on_lambda_payload'
6
7
  require_relative 'version'
7
8
 
8
9
  module RemotionLambda
@@ -47,6 +48,14 @@ module RemotionLambda
47
48
  end
48
49
 
49
50
  def render_still_on_lambda(function_name, payload)
51
+ RemotionLambda.log_deprecated_still_license_key(
52
+ payload[:licenseKey] || payload['licenseKey'],
53
+ payload[:logLevel] || payload['logLevel'],
54
+ 'render_still_on_lambda()',
55
+ 'licenseKey'
56
+ )
57
+ payload = payload.reject { |key, _| %w[licenseKey isProduction].include?(key.to_s) }
58
+ payload = payload.merge(licenseKey: nil, isProduction: nil)
50
59
  payload = InputPropsSerializer.upload_oversized_input_props(payload, s3_client, 'still', @region)
51
60
  body = invoke(function_name, payload)
52
61
  raise "Failed to call renderStillOnLambda: #{body['message']}" if body["type"] == "error"
@@ -1 +1 @@
1
- VERSION = "4.0.547"
1
+ VERSION = "4.0.548"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remotion_lambda
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.547
4
+ version: 4.0.548
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonny Burger