imagekitio 4.2.0 → 4.3.0

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 (102) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/README.md +1 -1
  4. data/lib/imagekitio/client.rb +14 -0
  5. data/lib/imagekitio/helpers/helper.rb +6 -0
  6. data/lib/imagekitio/internal/transport/pooled_net_requester.rb +1 -1
  7. data/lib/imagekitio/internal/util.rb +51 -7
  8. data/lib/imagekitio/models/accounts/origin_create_params.rb +1 -9
  9. data/lib/imagekitio/models/accounts/origin_delete_params.rb +13 -1
  10. data/lib/imagekitio/models/accounts/origin_get_params.rb +13 -1
  11. data/lib/imagekitio/models/accounts/origin_update_params.rb +10 -6
  12. data/lib/imagekitio/models/accounts/url_endpoint_delete_params.rb +14 -1
  13. data/lib/imagekitio/models/accounts/url_endpoint_get_params.rb +14 -1
  14. data/lib/imagekitio/models/accounts/url_endpoint_update_params.rb +14 -1
  15. data/lib/imagekitio/models/cache/invalidation_get_params.rb +7 -1
  16. data/lib/imagekitio/models/custom_metadata_field_delete_params.rb +7 -1
  17. data/lib/imagekitio/models/custom_metadata_field_update_params.rb +8 -1
  18. data/lib/imagekitio/models/extension_config.rb +10 -5
  19. data/lib/imagekitio/models/extensions.rb +10 -5
  20. data/lib/imagekitio/models/file_delete_params.rb +7 -1
  21. data/lib/imagekitio/models/file_get_params.rb +7 -1
  22. data/lib/imagekitio/models/file_update_params.rb +5 -7
  23. data/lib/imagekitio/models/files/metadata_get_params.rb +7 -1
  24. data/lib/imagekitio/models/files/version_delete_params.rb +7 -1
  25. data/lib/imagekitio/models/files/version_get_params.rb +7 -1
  26. data/lib/imagekitio/models/files/version_list_params.rb +7 -1
  27. data/lib/imagekitio/models/files/version_restore_params.rb +7 -1
  28. data/lib/imagekitio/models/folders/job_get_params.rb +7 -1
  29. data/lib/imagekitio/models/overlay_position.rb +99 -5
  30. data/lib/imagekitio/models/saved_extension_delete_params.rb +7 -1
  31. data/lib/imagekitio/models/saved_extension_get_params.rb +7 -1
  32. data/lib/imagekitio/models/saved_extension_update_params.rb +8 -1
  33. data/lib/imagekitio/resources/accounts/origins.rb +4 -14
  34. data/lib/imagekitio/resources/accounts/usage.rb +2 -1
  35. data/lib/imagekitio/resources/assets.rb +2 -1
  36. data/lib/imagekitio/resources/beta/v2/files.rb +5 -4
  37. data/lib/imagekitio/resources/custom_metadata_fields.rb +2 -1
  38. data/lib/imagekitio/resources/files/metadata.rb +2 -1
  39. data/lib/imagekitio/resources/files.rb +7 -11
  40. data/lib/imagekitio/resources/webhooks.rb +11 -1
  41. data/lib/imagekitio/version.rb +1 -1
  42. data/lib/imagekitio.rb +1 -0
  43. data/rbi/imagekitio/client.rbi +13 -0
  44. data/rbi/imagekitio/internal/util.rbi +29 -1
  45. data/rbi/imagekitio/models/accounts/origin_create_params.rbi +4 -51
  46. data/rbi/imagekitio/models/accounts/origin_delete_params.rbi +18 -5
  47. data/rbi/imagekitio/models/accounts/origin_get_params.rbi +18 -5
  48. data/rbi/imagekitio/models/accounts/origin_update_params.rbi +9 -43
  49. data/rbi/imagekitio/models/accounts/url_endpoint_delete_params.rbi +20 -5
  50. data/rbi/imagekitio/models/accounts/url_endpoint_get_params.rbi +20 -5
  51. data/rbi/imagekitio/models/accounts/url_endpoint_update_params.rbi +20 -5
  52. data/rbi/imagekitio/models/cache/invalidation_get_params.rbi +11 -5
  53. data/rbi/imagekitio/models/custom_metadata_field_delete_params.rbi +13 -5
  54. data/rbi/imagekitio/models/custom_metadata_field_update_params.rbi +6 -0
  55. data/rbi/imagekitio/models/extension_config.rbi +16 -6
  56. data/rbi/imagekitio/models/extensions.rbi +16 -6
  57. data/rbi/imagekitio/models/file_delete_params.rbi +13 -5
  58. data/rbi/imagekitio/models/file_get_params.rbi +13 -5
  59. data/rbi/imagekitio/models/file_update_params.rbi +5 -28
  60. data/rbi/imagekitio/models/files/metadata_get_params.rbi +11 -5
  61. data/rbi/imagekitio/models/files/version_delete_params.rbi +10 -2
  62. data/rbi/imagekitio/models/files/version_get_params.rbi +10 -2
  63. data/rbi/imagekitio/models/files/version_list_params.rbi +11 -5
  64. data/rbi/imagekitio/models/files/version_restore_params.rbi +10 -2
  65. data/rbi/imagekitio/models/folders/job_get_params.rbi +11 -5
  66. data/rbi/imagekitio/models/overlay_position.rbi +165 -9
  67. data/rbi/imagekitio/models/saved_extension_delete_params.rbi +13 -5
  68. data/rbi/imagekitio/models/saved_extension_get_params.rbi +13 -5
  69. data/rbi/imagekitio/models/saved_extension_update_params.rbi +6 -0
  70. data/rbi/imagekitio/resources/accounts/origins.rbi +22 -2
  71. data/rbi/imagekitio/resources/beta/v2/files.rbi +5 -4
  72. data/rbi/imagekitio/resources/files.rbi +10 -5
  73. data/rbi/imagekitio/resources/webhooks.rbi +10 -2
  74. data/sig/imagekitio/client.rbs +3 -0
  75. data/sig/imagekitio/internal/util.rbs +14 -0
  76. data/sig/imagekitio/models/accounts/origin_create_params.rbs +3 -16
  77. data/sig/imagekitio/models/accounts/origin_delete_params.rbs +11 -3
  78. data/sig/imagekitio/models/accounts/origin_get_params.rbs +11 -3
  79. data/sig/imagekitio/models/accounts/origin_update_params.rbs +4 -9
  80. data/sig/imagekitio/models/accounts/url_endpoint_delete_params.rbs +11 -3
  81. data/sig/imagekitio/models/accounts/url_endpoint_get_params.rbs +11 -3
  82. data/sig/imagekitio/models/accounts/url_endpoint_update_params.rbs +13 -3
  83. data/sig/imagekitio/models/cache/invalidation_get_params.rbs +11 -3
  84. data/sig/imagekitio/models/custom_metadata_field_delete_params.rbs +11 -3
  85. data/sig/imagekitio/models/custom_metadata_field_update_params.rbs +5 -0
  86. data/sig/imagekitio/models/file_delete_params.rbs +11 -3
  87. data/sig/imagekitio/models/file_get_params.rbs +12 -3
  88. data/sig/imagekitio/models/file_update_params.rbs +4 -9
  89. data/sig/imagekitio/models/files/metadata_get_params.rbs +11 -3
  90. data/sig/imagekitio/models/files/version_delete_params.rbs +6 -1
  91. data/sig/imagekitio/models/files/version_get_params.rbs +6 -1
  92. data/sig/imagekitio/models/files/version_list_params.rbs +11 -3
  93. data/sig/imagekitio/models/files/version_restore_params.rbs +6 -1
  94. data/sig/imagekitio/models/folders/job_get_params.rbs +11 -3
  95. data/sig/imagekitio/models/overlay_position.rbs +73 -3
  96. data/sig/imagekitio/models/saved_extension_delete_params.rbs +11 -3
  97. data/sig/imagekitio/models/saved_extension_get_params.rbs +11 -3
  98. data/sig/imagekitio/models/saved_extension_update_params.rbs +5 -0
  99. data/sig/imagekitio/resources/accounts/origins.rbs +2 -2
  100. data/sig/imagekitio/resources/files.rbs +1 -1
  101. data/sig/imagekitio/resources/webhooks.rbs +3 -1
  102. metadata +16 -2
@@ -15,16 +15,22 @@ module Imagekitio
15
15
  )
16
16
  end
17
17
 
18
+ sig { returns(String) }
19
+ attr_accessor :file_id
20
+
18
21
  sig do
19
- params(request_options: Imagekitio::RequestOptions::OrHash).returns(
20
- T.attached_class
21
- )
22
+ params(
23
+ file_id: String,
24
+ request_options: Imagekitio::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
22
26
  end
23
- def self.new(request_options: {})
27
+ def self.new(file_id:, request_options: {})
24
28
  end
25
29
 
26
30
  sig do
27
- override.returns({ request_options: Imagekitio::RequestOptions })
31
+ override.returns(
32
+ { file_id: String, request_options: Imagekitio::RequestOptions }
33
+ )
28
34
  end
29
35
  def to_hash
30
36
  end
@@ -18,18 +18,26 @@ module Imagekitio
18
18
  sig { returns(String) }
19
19
  attr_accessor :file_id
20
20
 
21
+ sig { returns(String) }
22
+ attr_accessor :version_id
23
+
21
24
  sig do
22
25
  params(
23
26
  file_id: String,
27
+ version_id: String,
24
28
  request_options: Imagekitio::RequestOptions::OrHash
25
29
  ).returns(T.attached_class)
26
30
  end
27
- def self.new(file_id:, request_options: {})
31
+ def self.new(file_id:, version_id:, request_options: {})
28
32
  end
29
33
 
30
34
  sig do
31
35
  override.returns(
32
- { file_id: String, request_options: Imagekitio::RequestOptions }
36
+ {
37
+ file_id: String,
38
+ version_id: String,
39
+ request_options: Imagekitio::RequestOptions
40
+ }
33
41
  )
34
42
  end
35
43
  def to_hash
@@ -15,16 +15,22 @@ module Imagekitio
15
15
  )
16
16
  end
17
17
 
18
+ sig { returns(String) }
19
+ attr_accessor :job_id
20
+
18
21
  sig do
19
- params(request_options: Imagekitio::RequestOptions::OrHash).returns(
20
- T.attached_class
21
- )
22
+ params(
23
+ job_id: String,
24
+ request_options: Imagekitio::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
22
26
  end
23
- def self.new(request_options: {})
27
+ def self.new(job_id:, request_options: {})
24
28
  end
25
29
 
26
30
  sig do
27
- override.returns({ request_options: Imagekitio::RequestOptions })
31
+ override.returns(
32
+ { job_id: String, request_options: Imagekitio::RequestOptions }
33
+ )
28
34
  end
29
35
  def to_hash
30
36
  end
@@ -8,8 +8,24 @@ module Imagekitio
8
8
  T.any(Imagekitio::OverlayPosition, Imagekitio::Internal::AnyHash)
9
9
  end
10
10
 
11
- # Specifies the position of the overlay relative to the parent image or video.
12
- # Maps to `lfo` in the URL.
11
+ # Sets the anchor point on the base asset from which the overlay offset is
12
+ # calculated. The default value is `top_left`. Maps to `lap` in the URL. Can only
13
+ # be used with one or more of `x`, `y`, `xCenter`, or `yCenter`.
14
+ sig do
15
+ returns(T.nilable(Imagekitio::OverlayPosition::AnchorPoint::OrSymbol))
16
+ end
17
+ attr_reader :anchor_point
18
+
19
+ sig do
20
+ params(
21
+ anchor_point: Imagekitio::OverlayPosition::AnchorPoint::OrSymbol
22
+ ).void
23
+ end
24
+ attr_writer :anchor_point
25
+
26
+ # Specifies the position of the overlay relative to the parent image or video. If
27
+ # one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this
28
+ # parameter is ignored. Maps to `lfo` in the URL.
13
29
  sig { returns(T.nilable(Imagekitio::OverlayPosition::Focus::OrSymbol)) }
14
30
  attr_reader :focus
15
31
 
@@ -27,6 +43,19 @@ module Imagekitio
27
43
  sig { params(x: Imagekitio::OverlayPosition::X::Variants).void }
28
44
  attr_writer :x
29
45
 
46
+ # Specifies the x-coordinate on the base asset where the overlay's center will be
47
+ # positioned. It also accepts arithmetic expressions such as `bw_mul_0.4` or
48
+ # `bw_sub_cw`. Maps to `lxc` in the URL. Cannot be used together with `x`, but can
49
+ # be used with `y`. Learn about
50
+ # [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
51
+ sig { returns(T.nilable(Imagekitio::OverlayPosition::XCenter::Variants)) }
52
+ attr_reader :x_center
53
+
54
+ sig do
55
+ params(x_center: Imagekitio::OverlayPosition::XCenter::Variants).void
56
+ end
57
+ attr_writer :x_center
58
+
30
59
  # Specifies the y-coordinate of the top-left corner of the base asset where the
31
60
  # overlay's top-left corner will be positioned. It also accepts arithmetic
32
61
  # expressions such as `bh_mul_0.4` or `bh_sub_ch`. Maps to `ly` in the URL. Learn
@@ -38,16 +67,37 @@ module Imagekitio
38
67
  sig { params(y_: Imagekitio::OverlayPosition::Y::Variants).void }
39
68
  attr_writer :y_
40
69
 
70
+ # Specifies the y-coordinate on the base asset where the overlay's center will be
71
+ # positioned. It also accepts arithmetic expressions such as `bh_mul_0.4` or
72
+ # `bh_sub_ch`. Maps to `lyc` in the URL. Cannot be used together with `y`, but can
73
+ # be used with `x`. Learn about
74
+ # [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
75
+ sig { returns(T.nilable(Imagekitio::OverlayPosition::YCenter::Variants)) }
76
+ attr_reader :y_center
77
+
78
+ sig do
79
+ params(y_center: Imagekitio::OverlayPosition::YCenter::Variants).void
80
+ end
81
+ attr_writer :y_center
82
+
41
83
  sig do
42
84
  params(
85
+ anchor_point: Imagekitio::OverlayPosition::AnchorPoint::OrSymbol,
43
86
  focus: Imagekitio::OverlayPosition::Focus::OrSymbol,
44
87
  x: Imagekitio::OverlayPosition::X::Variants,
45
- y_: Imagekitio::OverlayPosition::Y::Variants
88
+ x_center: Imagekitio::OverlayPosition::XCenter::Variants,
89
+ y_: Imagekitio::OverlayPosition::Y::Variants,
90
+ y_center: Imagekitio::OverlayPosition::YCenter::Variants
46
91
  ).returns(T.attached_class)
47
92
  end
48
93
  def self.new(
49
- # Specifies the position of the overlay relative to the parent image or video.
50
- # Maps to `lfo` in the URL.
94
+ # Sets the anchor point on the base asset from which the overlay offset is
95
+ # calculated. The default value is `top_left`. Maps to `lap` in the URL. Can only
96
+ # be used with one or more of `x`, `y`, `xCenter`, or `yCenter`.
97
+ anchor_point: nil,
98
+ # Specifies the position of the overlay relative to the parent image or video. If
99
+ # one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this
100
+ # parameter is ignored. Maps to `lfo` in the URL.
51
101
  focus: nil,
52
102
  # Specifies the x-coordinate of the top-left corner of the base asset where the
53
103
  # overlay's top-left corner will be positioned. It also accepts arithmetic
@@ -55,29 +105,97 @@ module Imagekitio
55
105
  # about
56
106
  # [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
57
107
  x: nil,
108
+ # Specifies the x-coordinate on the base asset where the overlay's center will be
109
+ # positioned. It also accepts arithmetic expressions such as `bw_mul_0.4` or
110
+ # `bw_sub_cw`. Maps to `lxc` in the URL. Cannot be used together with `x`, but can
111
+ # be used with `y`. Learn about
112
+ # [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
113
+ x_center: nil,
58
114
  # Specifies the y-coordinate of the top-left corner of the base asset where the
59
115
  # overlay's top-left corner will be positioned. It also accepts arithmetic
60
116
  # expressions such as `bh_mul_0.4` or `bh_sub_ch`. Maps to `ly` in the URL. Learn
61
117
  # about
62
118
  # [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
63
- y_: nil
119
+ y_: nil,
120
+ # Specifies the y-coordinate on the base asset where the overlay's center will be
121
+ # positioned. It also accepts arithmetic expressions such as `bh_mul_0.4` or
122
+ # `bh_sub_ch`. Maps to `lyc` in the URL. Cannot be used together with `y`, but can
123
+ # be used with `x`. Learn about
124
+ # [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
125
+ y_center: nil
64
126
  )
65
127
  end
66
128
 
67
129
  sig do
68
130
  override.returns(
69
131
  {
132
+ anchor_point: Imagekitio::OverlayPosition::AnchorPoint::OrSymbol,
70
133
  focus: Imagekitio::OverlayPosition::Focus::OrSymbol,
71
134
  x: Imagekitio::OverlayPosition::X::Variants,
72
- y_: Imagekitio::OverlayPosition::Y::Variants
135
+ x_center: Imagekitio::OverlayPosition::XCenter::Variants,
136
+ y_: Imagekitio::OverlayPosition::Y::Variants,
137
+ y_center: Imagekitio::OverlayPosition::YCenter::Variants
73
138
  }
74
139
  )
75
140
  end
76
141
  def to_hash
77
142
  end
78
143
 
79
- # Specifies the position of the overlay relative to the parent image or video.
80
- # Maps to `lfo` in the URL.
144
+ # Sets the anchor point on the base asset from which the overlay offset is
145
+ # calculated. The default value is `top_left`. Maps to `lap` in the URL. Can only
146
+ # be used with one or more of `x`, `y`, `xCenter`, or `yCenter`.
147
+ module AnchorPoint
148
+ extend Imagekitio::Internal::Type::Enum
149
+
150
+ TaggedSymbol =
151
+ T.type_alias do
152
+ T.all(Symbol, Imagekitio::OverlayPosition::AnchorPoint)
153
+ end
154
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
155
+
156
+ TOP =
157
+ T.let(:top, Imagekitio::OverlayPosition::AnchorPoint::TaggedSymbol)
158
+ LEFT =
159
+ T.let(:left, Imagekitio::OverlayPosition::AnchorPoint::TaggedSymbol)
160
+ RIGHT =
161
+ T.let(:right, Imagekitio::OverlayPosition::AnchorPoint::TaggedSymbol)
162
+ BOTTOM =
163
+ T.let(:bottom, Imagekitio::OverlayPosition::AnchorPoint::TaggedSymbol)
164
+ TOP_LEFT =
165
+ T.let(
166
+ :top_left,
167
+ Imagekitio::OverlayPosition::AnchorPoint::TaggedSymbol
168
+ )
169
+ TOP_RIGHT =
170
+ T.let(
171
+ :top_right,
172
+ Imagekitio::OverlayPosition::AnchorPoint::TaggedSymbol
173
+ )
174
+ BOTTOM_LEFT =
175
+ T.let(
176
+ :bottom_left,
177
+ Imagekitio::OverlayPosition::AnchorPoint::TaggedSymbol
178
+ )
179
+ BOTTOM_RIGHT =
180
+ T.let(
181
+ :bottom_right,
182
+ Imagekitio::OverlayPosition::AnchorPoint::TaggedSymbol
183
+ )
184
+ CENTER =
185
+ T.let(:center, Imagekitio::OverlayPosition::AnchorPoint::TaggedSymbol)
186
+
187
+ sig do
188
+ override.returns(
189
+ T::Array[Imagekitio::OverlayPosition::AnchorPoint::TaggedSymbol]
190
+ )
191
+ end
192
+ def self.values
193
+ end
194
+ end
195
+
196
+ # Specifies the position of the overlay relative to the parent image or video. If
197
+ # one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this
198
+ # parameter is ignored. Maps to `lfo` in the URL.
81
199
  module Focus
82
200
  extend Imagekitio::Internal::Type::Enum
83
201
 
@@ -127,6 +245,25 @@ module Imagekitio
127
245
  end
128
246
  end
129
247
 
248
+ # Specifies the x-coordinate on the base asset where the overlay's center will be
249
+ # positioned. It also accepts arithmetic expressions such as `bw_mul_0.4` or
250
+ # `bw_sub_cw`. Maps to `lxc` in the URL. Cannot be used together with `x`, but can
251
+ # be used with `y`. Learn about
252
+ # [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
253
+ module XCenter
254
+ extend Imagekitio::Internal::Type::Union
255
+
256
+ Variants = T.type_alias { T.any(Float, String) }
257
+
258
+ sig do
259
+ override.returns(
260
+ T::Array[Imagekitio::OverlayPosition::XCenter::Variants]
261
+ )
262
+ end
263
+ def self.variants
264
+ end
265
+ end
266
+
130
267
  # Specifies the y-coordinate of the top-left corner of the base asset where the
131
268
  # overlay's top-left corner will be positioned. It also accepts arithmetic
132
269
  # expressions such as `bh_mul_0.4` or `bh_sub_ch`. Maps to `ly` in the URL. Learn
@@ -143,6 +280,25 @@ module Imagekitio
143
280
  def self.variants
144
281
  end
145
282
  end
283
+
284
+ # Specifies the y-coordinate on the base asset where the overlay's center will be
285
+ # positioned. It also accepts arithmetic expressions such as `bh_mul_0.4` or
286
+ # `bh_sub_ch`. Maps to `lyc` in the URL. Cannot be used together with `y`, but can
287
+ # be used with `x`. Learn about
288
+ # [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
289
+ module YCenter
290
+ extend Imagekitio::Internal::Type::Union
291
+
292
+ Variants = T.type_alias { T.any(Float, String) }
293
+
294
+ sig do
295
+ override.returns(
296
+ T::Array[Imagekitio::OverlayPosition::YCenter::Variants]
297
+ )
298
+ end
299
+ def self.variants
300
+ end
301
+ end
146
302
  end
147
303
  end
148
304
  end
@@ -14,15 +14,23 @@ module Imagekitio
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :id
19
+
17
20
  sig do
18
- params(request_options: Imagekitio::RequestOptions::OrHash).returns(
19
- T.attached_class
20
- )
21
+ params(
22
+ id: String,
23
+ request_options: Imagekitio::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
21
25
  end
22
- def self.new(request_options: {})
26
+ def self.new(id:, request_options: {})
23
27
  end
24
28
 
25
- sig { override.returns({ request_options: Imagekitio::RequestOptions }) }
29
+ sig do
30
+ override.returns(
31
+ { id: String, request_options: Imagekitio::RequestOptions }
32
+ )
33
+ end
26
34
  def to_hash
27
35
  end
28
36
  end
@@ -14,15 +14,23 @@ module Imagekitio
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :id
19
+
17
20
  sig do
18
- params(request_options: Imagekitio::RequestOptions::OrHash).returns(
19
- T.attached_class
20
- )
21
+ params(
22
+ id: String,
23
+ request_options: Imagekitio::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
21
25
  end
22
- def self.new(request_options: {})
26
+ def self.new(id:, request_options: {})
23
27
  end
24
28
 
25
- sig { override.returns({ request_options: Imagekitio::RequestOptions }) }
29
+ sig do
30
+ override.returns(
31
+ { id: String, request_options: Imagekitio::RequestOptions }
32
+ )
33
+ end
26
34
  def to_hash
27
35
  end
28
36
  end
@@ -14,6 +14,9 @@ module Imagekitio
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :id
19
+
17
20
  # Configuration object for an extension (base extensions only, not saved extension
18
21
  # references).
19
22
  sig do
@@ -59,6 +62,7 @@ module Imagekitio
59
62
 
60
63
  sig do
61
64
  params(
65
+ id: String,
62
66
  config:
63
67
  T.any(
64
68
  Imagekitio::ExtensionConfig::RemoveBg::OrHash,
@@ -72,6 +76,7 @@ module Imagekitio
72
76
  ).returns(T.attached_class)
73
77
  end
74
78
  def self.new(
79
+ id:,
75
80
  # Configuration object for an extension (base extensions only, not saved extension
76
81
  # references).
77
82
  config: nil,
@@ -86,6 +91,7 @@ module Imagekitio
86
91
  sig do
87
92
  override.returns(
88
93
  {
94
+ id: String,
89
95
  config:
90
96
  T.any(
91
97
  Imagekitio::ExtensionConfig::RemoveBg,
@@ -8,7 +8,17 @@ module Imagekitio
8
8
  # Creates a new origin and returns the origin object.
9
9
  sig do
10
10
  params(
11
- origin_request: Imagekitio::Accounts::OriginRequest,
11
+ origin_request:
12
+ T.any(
13
+ Imagekitio::Accounts::OriginRequest::S3::OrHash,
14
+ Imagekitio::Accounts::OriginRequest::S3Compatible::OrHash,
15
+ Imagekitio::Accounts::OriginRequest::CloudinaryBackup::OrHash,
16
+ Imagekitio::Accounts::OriginRequest::WebFolder::OrHash,
17
+ Imagekitio::Accounts::OriginRequest::WebProxy::OrHash,
18
+ Imagekitio::Accounts::OriginRequest::Gcs::OrHash,
19
+ Imagekitio::Accounts::OriginRequest::AzureBlob::OrHash,
20
+ Imagekitio::Accounts::OriginRequest::AkeneoPim::OrHash
21
+ ),
12
22
  request_options: Imagekitio::RequestOptions::OrHash
13
23
  ).returns(Imagekitio::Accounts::OriginResponse::Variants)
14
24
  end
@@ -24,7 +34,17 @@ module Imagekitio
24
34
  sig do
25
35
  params(
26
36
  id: String,
27
- origin_request: Imagekitio::Accounts::OriginRequest,
37
+ origin_request:
38
+ T.any(
39
+ Imagekitio::Accounts::OriginRequest::S3::OrHash,
40
+ Imagekitio::Accounts::OriginRequest::S3Compatible::OrHash,
41
+ Imagekitio::Accounts::OriginRequest::CloudinaryBackup::OrHash,
42
+ Imagekitio::Accounts::OriginRequest::WebFolder::OrHash,
43
+ Imagekitio::Accounts::OriginRequest::WebProxy::OrHash,
44
+ Imagekitio::Accounts::OriginRequest::Gcs::OrHash,
45
+ Imagekitio::Accounts::OriginRequest::AzureBlob::OrHash,
46
+ Imagekitio::Accounts::OriginRequest::AkeneoPim::OrHash
47
+ ),
28
48
  request_options: Imagekitio::RequestOptions::OrHash
29
49
  ).returns(Imagekitio::Accounts::OriginResponse::Variants)
30
50
  end
@@ -16,10 +16,11 @@ module Imagekitio
16
16
  # about how to implement secure client-side file upload.
17
17
  #
18
18
  # **File size limit** \
19
- # On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw
20
- # files, and 100MB for videos. On the paid plan, these limits increase to 40MB for
21
- # images, audio, and raw files, and 2GB for videos. These limits can be further increased
22
- # with higher-tier plans.
19
+ # On the free plan, the maximum upload file sizes are 25MB for images, audio, and raw
20
+ # files, and 100MB for videos. On the Lite paid plan, these limits increase to 40MB
21
+ # for images, audio, and raw files and 300MB for videos, whereas on the Pro paid plan,
22
+ # these limits increase to 50MB for images, audio, and raw files and 2GB for videos.
23
+ # These limits can be further increased with enterprise plans.
23
24
  #
24
25
  # **Version limit** \
25
26
  # A file can have a maximum of 100 versions.
@@ -18,7 +18,11 @@ module Imagekitio
18
18
  sig do
19
19
  params(
20
20
  file_id: String,
21
- update_file_request: Imagekitio::UpdateFileRequest,
21
+ update_file_request:
22
+ T.any(
23
+ Imagekitio::UpdateFileRequest::UpdateFileDetails::OrHash,
24
+ Imagekitio::UpdateFileRequest::ChangePublicationStatus::OrHash
25
+ ),
22
26
  request_options: Imagekitio::RequestOptions::OrHash
23
27
  ).returns(Imagekitio::Models::FileUpdateResponse)
24
28
  end
@@ -168,10 +172,11 @@ module Imagekitio
168
172
  # by verifying the entire payload using JWT.
169
173
  #
170
174
  # **File size limit** \
171
- # On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw
172
- # files and 100MB for videos. On the paid plan, these limits increase to 40MB for images,
173
- # audio, and raw files and 2GB for videos. These limits can be further increased with
174
- # higher-tier plans.
175
+ # On the free plan, the maximum upload file sizes are 25MB for images, audio, and raw
176
+ # files and 100MB for videos. On the Lite paid plan, these limits increase to 40MB
177
+ # for images, audio, and raw files and 300MB for videos, whereas on the Pro paid plan,
178
+ # these limits increase to 50MB for images, audio, and raw files and 2GB for videos.
179
+ # These limits can be further increased with enterprise plans.
175
180
  #
176
181
  # **Version limit** \
177
182
  # A file can have a maximum of 100 versions.
@@ -23,7 +23,11 @@ module Imagekitio
23
23
  end
24
24
 
25
25
  sig do
26
- params(payload: String).returns(
26
+ params(
27
+ payload: String,
28
+ headers: T::Hash[String, String],
29
+ key: T.nilable(String)
30
+ ).returns(
27
31
  T.any(
28
32
  Imagekitio::VideoTransformationAcceptedEvent,
29
33
  Imagekitio::VideoTransformationReadyEvent,
@@ -37,7 +41,11 @@ module Imagekitio
37
41
  end
38
42
  def unwrap(
39
43
  # The raw webhook payload as a string
40
- payload
44
+ payload,
45
+ # The raw HTTP headers that came with the payload
46
+ headers:,
47
+ # The webhook signing key
48
+ key: @client.webhook_secret
41
49
  )
42
50
  end
43
51
 
@@ -12,6 +12,8 @@ module Imagekitio
12
12
 
13
13
  attr_reader password: String?
14
14
 
15
+ attr_reader webhook_secret: String?
16
+
15
17
  attr_reader custom_metadata_fields: Imagekitio::Resources::CustomMetadataFields
16
18
 
17
19
  attr_reader files: Imagekitio::Resources::Files
@@ -39,6 +41,7 @@ module Imagekitio
39
41
  def initialize: (
40
42
  ?private_key: String?,
41
43
  ?password: String?,
44
+ ?webhook_secret: String?,
42
45
  ?base_url: String?,
43
46
  ?max_retries: Integer,
44
47
  ?timeout: Float,
@@ -45,8 +45,12 @@ module Imagekitio
45
45
  -> top?
46
46
  } -> top?
47
47
 
48
+ RFC_3986_NOT_PCHARS: Regexp
49
+
48
50
  def self?.uri_origin: (URI::Generic uri) -> String
49
51
 
52
+ def self?.encode_path: (String | Integer path) -> String
53
+
50
54
  def self?.interpolate_path: (String | ::Array[String] path) -> String
51
55
 
52
56
  def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]]
@@ -106,6 +110,16 @@ module Imagekitio
106
110
  JSON_CONTENT: Regexp
107
111
  JSONL_CONTENT: Regexp
108
112
 
113
+ def encode_query_params: (
114
+ ::Hash[Symbol, top] query
115
+ ) -> ::Hash[Symbol, top]
116
+
117
+ private def write_query_param_element!: (
118
+ ::Hash[Symbol, top] collection,
119
+ String key,
120
+ top element
121
+ ) -> nil
122
+
109
123
  def self?.write_multipart_content: (
110
124
  Enumerator::Yielder y,
111
125
  val: top,
@@ -2,28 +2,15 @@ module Imagekitio
2
2
  module Models
3
3
  module Accounts
4
4
  type origin_create_params =
5
- { origin_request: Imagekitio::Models::Accounts::origin_request }
6
- & Imagekitio::Internal::Type::request_parameters
5
+ { } & Imagekitio::Internal::Type::request_parameters
7
6
 
8
7
  class OriginCreateParams < Imagekitio::Internal::Type::BaseModel
9
8
  extend Imagekitio::Internal::Type::RequestParameters::Converter
10
9
  include Imagekitio::Internal::Type::RequestParameters
11
10
 
12
- def origin_request: -> Imagekitio::Models::Accounts::origin_request
11
+ def initialize: (?request_options: Imagekitio::request_opts) -> void
13
12
 
14
- def origin_request=: (
15
- Imagekitio::Models::Accounts::origin_request _
16
- ) -> Imagekitio::Models::Accounts::origin_request
17
-
18
- def initialize: (
19
- origin_request: Imagekitio::Models::Accounts::origin_request,
20
- ?request_options: Imagekitio::request_opts
21
- ) -> void
22
-
23
- def to_hash: -> {
24
- origin_request: Imagekitio::Models::Accounts::origin_request,
25
- request_options: Imagekitio::RequestOptions
26
- }
13
+ def to_hash: -> { request_options: Imagekitio::RequestOptions }
27
14
  end
28
15
  end
29
16
  end
@@ -2,15 +2,23 @@ module Imagekitio
2
2
  module Models
3
3
  module Accounts
4
4
  type origin_delete_params =
5
- { } & Imagekitio::Internal::Type::request_parameters
5
+ { id: String } & Imagekitio::Internal::Type::request_parameters
6
6
 
7
7
  class OriginDeleteParams < Imagekitio::Internal::Type::BaseModel
8
8
  extend Imagekitio::Internal::Type::RequestParameters::Converter
9
9
  include Imagekitio::Internal::Type::RequestParameters
10
10
 
11
- def initialize: (?request_options: Imagekitio::request_opts) -> void
11
+ attr_accessor id: String
12
12
 
13
- def to_hash: -> { request_options: Imagekitio::RequestOptions }
13
+ def initialize: (
14
+ id: String,
15
+ ?request_options: Imagekitio::request_opts
16
+ ) -> void
17
+
18
+ def to_hash: -> {
19
+ id: String,
20
+ request_options: Imagekitio::RequestOptions
21
+ }
14
22
  end
15
23
  end
16
24
  end
@@ -2,15 +2,23 @@ module Imagekitio
2
2
  module Models
3
3
  module Accounts
4
4
  type origin_get_params =
5
- { } & Imagekitio::Internal::Type::request_parameters
5
+ { id: String } & Imagekitio::Internal::Type::request_parameters
6
6
 
7
7
  class OriginGetParams < Imagekitio::Internal::Type::BaseModel
8
8
  extend Imagekitio::Internal::Type::RequestParameters::Converter
9
9
  include Imagekitio::Internal::Type::RequestParameters
10
10
 
11
- def initialize: (?request_options: Imagekitio::request_opts) -> void
11
+ attr_accessor id: String
12
12
 
13
- def to_hash: -> { request_options: Imagekitio::RequestOptions }
13
+ def initialize: (
14
+ id: String,
15
+ ?request_options: Imagekitio::request_opts
16
+ ) -> void
17
+
18
+ def to_hash: -> {
19
+ id: String,
20
+ request_options: Imagekitio::RequestOptions
21
+ }
14
22
  end
15
23
  end
16
24
  end