imagekitio 4.9.0 → 4.11.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +1 -1
- data/lib/imagekitio/helpers/transformation_utils.rb +1 -0
- data/lib/imagekitio/models/accounts/webhook.rb +81 -0
- data/lib/imagekitio/models/accounts/webhook_create_params.rb +47 -0
- data/lib/imagekitio/models/accounts/webhook_delete_params.rb +24 -0
- data/lib/imagekitio/models/accounts/webhook_event_type.rb +32 -0
- data/lib/imagekitio/models/accounts/webhook_get_params.rb +24 -0
- data/lib/imagekitio/models/accounts/webhook_list_params.rb +16 -0
- data/lib/imagekitio/models/accounts/webhook_list_response.rb +10 -0
- data/lib/imagekitio/models/accounts/webhook_update_params.rb +54 -0
- data/lib/imagekitio/models/asset_list_params.rb +22 -0
- data/lib/imagekitio/models/beta/v2/file_upload_params.rb +5 -1
- data/lib/imagekitio/models/custom_metadata_field.rb +23 -1
- data/lib/imagekitio/models/custom_metadata_field_create_params.rb +4 -0
- data/lib/imagekitio/models/file_upload_params.rb +5 -1
- data/lib/imagekitio/models/folder.rb +33 -1
- data/lib/imagekitio/models/folder_create_event.rb +35 -0
- data/lib/imagekitio/models/folder_delete_event.rb +47 -0
- data/lib/imagekitio/models/folder_update_event.rb +35 -0
- data/lib/imagekitio/models/transformation.rb +33 -1
- data/lib/imagekitio/models/unsafe_unwrap_webhook_event.rb +10 -1
- data/lib/imagekitio/models/unwrap_webhook_event.rb +10 -1
- data/lib/imagekitio/models/update_file_request.rb +5 -0
- data/lib/imagekitio/models.rb +6 -0
- data/lib/imagekitio/resources/accounts/webhooks.rb +146 -0
- data/lib/imagekitio/resources/accounts.rb +4 -0
- data/lib/imagekitio/resources/custom_metadata_fields.rb +2 -2
- data/lib/imagekitio/resources/files/versions.rb +2 -2
- data/lib/imagekitio/resources/files.rb +4 -16
- data/lib/imagekitio/resources/folders.rb +2 -8
- data/lib/imagekitio/resources/webhooks.rb +2 -2
- data/lib/imagekitio/version.rb +1 -1
- data/lib/imagekitio.rb +12 -5
- data/rbi/imagekitio/models/accounts/webhook.rbi +109 -0
- data/rbi/imagekitio/models/accounts/webhook_create_params.rbi +78 -0
- data/rbi/imagekitio/models/accounts/webhook_delete_params.rbi +45 -0
- data/rbi/imagekitio/models/accounts/webhook_event_type.rbi +101 -0
- data/rbi/imagekitio/models/accounts/webhook_get_params.rbi +45 -0
- data/rbi/imagekitio/models/accounts/webhook_list_params.rbi +34 -0
- data/rbi/imagekitio/models/accounts/webhook_list_response.rbi +13 -0
- data/rbi/imagekitio/models/accounts/webhook_update_params.rbi +98 -0
- data/rbi/imagekitio/models/asset_list_params.rbi +41 -0
- data/rbi/imagekitio/models/beta/v2/file_upload_params.rbi +10 -2
- data/rbi/imagekitio/models/custom_metadata_field.rbi +42 -3
- data/rbi/imagekitio/models/custom_metadata_field_create_params.rbi +8 -0
- data/rbi/imagekitio/models/file_upload_params.rbi +10 -2
- data/rbi/imagekitio/models/folder.rbi +49 -0
- data/rbi/imagekitio/models/folder_create_event.rbi +53 -0
- data/rbi/imagekitio/models/folder_delete_event.rbi +83 -0
- data/rbi/imagekitio/models/folder_update_event.rbi +53 -0
- data/rbi/imagekitio/models/transformation.rbi +43 -0
- data/rbi/imagekitio/models/unsafe_unwrap_webhook_event.rbi +4 -1
- data/rbi/imagekitio/models/unwrap_webhook_event.rbi +4 -1
- data/rbi/imagekitio/models/update_file_request.rbi +10 -0
- data/rbi/imagekitio/models.rbi +6 -0
- data/rbi/imagekitio/resources/accounts/webhooks.rbi +113 -0
- data/rbi/imagekitio/resources/accounts.rbi +3 -0
- data/rbi/imagekitio/resources/assets.rbi +9 -0
- data/rbi/imagekitio/resources/beta/v2/files.rbi +5 -1
- data/rbi/imagekitio/resources/custom_metadata_fields.rbi +5 -1
- data/rbi/imagekitio/resources/files/versions.rbi +1 -1
- data/rbi/imagekitio/resources/files.rbi +7 -3
- data/rbi/imagekitio/resources/folders.rbi +1 -1
- data/rbi/imagekitio/resources/webhooks.rbi +8 -2
- data/sig/imagekitio/models/accounts/webhook.rbs +52 -0
- data/sig/imagekitio/models/accounts/webhook_create_params.rbs +40 -0
- data/sig/imagekitio/models/accounts/webhook_delete_params.rbs +25 -0
- data/sig/imagekitio/models/accounts/webhook_event_type.rbs +44 -0
- data/sig/imagekitio/models/accounts/webhook_get_params.rbs +25 -0
- data/sig/imagekitio/models/accounts/webhook_list_params.rbs +17 -0
- data/sig/imagekitio/models/accounts/webhook_list_response.rbs +9 -0
- data/sig/imagekitio/models/accounts/webhook_update_params.rbs +51 -0
- data/sig/imagekitio/models/asset_list_params.rbs +8 -0
- data/sig/imagekitio/models/custom_metadata_field.rbs +10 -3
- data/sig/imagekitio/models/folder.rbs +32 -5
- data/sig/imagekitio/models/folder_create_event.rbs +32 -0
- data/sig/imagekitio/models/folder_delete_event.rbs +48 -0
- data/sig/imagekitio/models/folder_update_event.rbs +32 -0
- data/sig/imagekitio/models/transformation.rbs +17 -0
- data/sig/imagekitio/models/unsafe_unwrap_webhook_event.rbs +3 -0
- data/sig/imagekitio/models/unwrap_webhook_event.rbs +3 -0
- data/sig/imagekitio/models.rbs +6 -0
- data/sig/imagekitio/resources/accounts/webhooks.rbs +38 -0
- data/sig/imagekitio/resources/accounts.rbs +2 -0
- data/sig/imagekitio/resources/custom_metadata_fields.rbs +1 -4
- data/sig/imagekitio/resources/files/versions.rbs +1 -1
- data/sig/imagekitio/resources/files.rbs +2 -2
- data/sig/imagekitio/resources/folders.rbs +1 -1
- data/sig/imagekitio/resources/webhooks.rbs +8 -2
- metadata +38 -17
- data/lib/imagekitio/models/custom_metadata_field_delete_response.rb +0 -10
- data/lib/imagekitio/models/file_copy_response.rb +0 -10
- data/lib/imagekitio/models/file_move_response.rb +0 -10
- data/lib/imagekitio/models/files/version_delete_response.rb +0 -12
- data/lib/imagekitio/models/folder_delete_response.rb +0 -10
- data/rbi/imagekitio/models/custom_metadata_field_delete_response.rbi +0 -23
- data/rbi/imagekitio/models/file_copy_response.rbi +0 -23
- data/rbi/imagekitio/models/file_move_response.rbi +0 -23
- data/rbi/imagekitio/models/files/version_delete_response.rbi +0 -25
- data/rbi/imagekitio/models/folder_delete_response.rbi +0 -23
- data/sig/imagekitio/models/custom_metadata_field_delete_response.rbs +0 -11
- data/sig/imagekitio/models/file_copy_response.rbs +0 -11
- data/sig/imagekitio/models/file_move_response.rbs +0 -11
- data/sig/imagekitio/models/files/version_delete_response.rbs +0 -13
- data/sig/imagekitio/models/folder_delete_response.rbs +0 -11
|
@@ -16,6 +16,14 @@ module Imagekitio
|
|
|
16
16
|
sig { params(created_at: Time).void }
|
|
17
17
|
attr_writer :created_at
|
|
18
18
|
|
|
19
|
+
# Details of the user who created the folder. Present only when this information
|
|
20
|
+
# is available. The `name` is the name of the user at the time of folder creation.
|
|
21
|
+
sig { returns(T.nilable(Imagekitio::Folder::CreatedBy)) }
|
|
22
|
+
attr_reader :created_by
|
|
23
|
+
|
|
24
|
+
sig { params(created_by: Imagekitio::Folder::CreatedBy::OrHash).void }
|
|
25
|
+
attr_writer :created_by
|
|
26
|
+
|
|
19
27
|
# An object with custom metadata for the folder. Returns empty object if no custom
|
|
20
28
|
# metadata is set.
|
|
21
29
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
@@ -66,6 +74,7 @@ module Imagekitio
|
|
|
66
74
|
sig do
|
|
67
75
|
params(
|
|
68
76
|
created_at: Time,
|
|
77
|
+
created_by: Imagekitio::Folder::CreatedBy::OrHash,
|
|
69
78
|
custom_metadata: T::Hash[Symbol, T.anything],
|
|
70
79
|
folder_id: String,
|
|
71
80
|
folder_path: String,
|
|
@@ -78,6 +87,9 @@ module Imagekitio
|
|
|
78
87
|
# Date and time when the folder was created. The date and time is in ISO8601
|
|
79
88
|
# format.
|
|
80
89
|
created_at: nil,
|
|
90
|
+
# Details of the user who created the folder. Present only when this information
|
|
91
|
+
# is available. The `name` is the name of the user at the time of folder creation.
|
|
92
|
+
created_by: nil,
|
|
81
93
|
# An object with custom metadata for the folder. Returns empty object if no custom
|
|
82
94
|
# metadata is set.
|
|
83
95
|
custom_metadata: nil,
|
|
@@ -102,6 +114,7 @@ module Imagekitio
|
|
|
102
114
|
override.returns(
|
|
103
115
|
{
|
|
104
116
|
created_at: Time,
|
|
117
|
+
created_by: Imagekitio::Folder::CreatedBy,
|
|
105
118
|
custom_metadata: T::Hash[Symbol, T.anything],
|
|
106
119
|
folder_id: String,
|
|
107
120
|
folder_path: String,
|
|
@@ -114,6 +127,42 @@ module Imagekitio
|
|
|
114
127
|
def to_hash
|
|
115
128
|
end
|
|
116
129
|
|
|
130
|
+
class CreatedBy < Imagekitio::Internal::Type::BaseModel
|
|
131
|
+
OrHash =
|
|
132
|
+
T.type_alias do
|
|
133
|
+
T.any(Imagekitio::Folder::CreatedBy, Imagekitio::Internal::AnyHash)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Email of the user who created the folder.
|
|
137
|
+
sig { returns(T.nilable(String)) }
|
|
138
|
+
attr_reader :email
|
|
139
|
+
|
|
140
|
+
sig { params(email: String).void }
|
|
141
|
+
attr_writer :email
|
|
142
|
+
|
|
143
|
+
# Name of the user who created the folder.
|
|
144
|
+
sig { returns(T.nilable(String)) }
|
|
145
|
+
attr_reader :name
|
|
146
|
+
|
|
147
|
+
sig { params(name: String).void }
|
|
148
|
+
attr_writer :name
|
|
149
|
+
|
|
150
|
+
# Details of the user who created the folder. Present only when this information
|
|
151
|
+
# is available. The `name` is the name of the user at the time of folder creation.
|
|
152
|
+
sig { params(email: String, name: String).returns(T.attached_class) }
|
|
153
|
+
def self.new(
|
|
154
|
+
# Email of the user who created the folder.
|
|
155
|
+
email: nil,
|
|
156
|
+
# Name of the user who created the folder.
|
|
157
|
+
name: nil
|
|
158
|
+
)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
sig { override.returns({ email: String, name: String }) }
|
|
162
|
+
def to_hash
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
117
166
|
# Type of the asset.
|
|
118
167
|
module Type
|
|
119
168
|
extend Imagekitio::Internal::Type::Enum
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
class FolderCreateEvent < Imagekitio::Models::BaseWebhookEvent
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Imagekitio::FolderCreateEvent, Imagekitio::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Timestamp of when the event occurred in ISO8601 format.
|
|
12
|
+
sig { returns(Time) }
|
|
13
|
+
attr_accessor :created_at
|
|
14
|
+
|
|
15
|
+
sig { returns(Imagekitio::Folder) }
|
|
16
|
+
attr_reader :data
|
|
17
|
+
|
|
18
|
+
sig { params(data: Imagekitio::Folder::OrHash).void }
|
|
19
|
+
attr_writer :data
|
|
20
|
+
|
|
21
|
+
# Type of the webhook event.
|
|
22
|
+
sig { returns(Symbol) }
|
|
23
|
+
attr_accessor :type
|
|
24
|
+
|
|
25
|
+
# Triggered when a folder is created, whether explicitly, by copying or moving a
|
|
26
|
+
# folder, or implicitly when an upload creates missing parent folders. Copying or
|
|
27
|
+
# moving a folder tree sends one event per folder in the tree.
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
created_at: Time,
|
|
31
|
+
data: Imagekitio::Folder::OrHash,
|
|
32
|
+
type: Symbol
|
|
33
|
+
).returns(T.attached_class)
|
|
34
|
+
end
|
|
35
|
+
def self.new(
|
|
36
|
+
# Timestamp of when the event occurred in ISO8601 format.
|
|
37
|
+
created_at:,
|
|
38
|
+
data:,
|
|
39
|
+
# Type of the webhook event.
|
|
40
|
+
type: :"folder.created"
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
override.returns(
|
|
46
|
+
{ created_at: Time, data: Imagekitio::Folder, type: Symbol }
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
def to_hash
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
class FolderDeleteEvent < Imagekitio::Models::BaseWebhookEvent
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Imagekitio::FolderDeleteEvent, Imagekitio::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Timestamp of when the event occurred in ISO8601 format.
|
|
12
|
+
sig { returns(Time) }
|
|
13
|
+
attr_accessor :created_at
|
|
14
|
+
|
|
15
|
+
sig { returns(Imagekitio::FolderDeleteEvent::Data) }
|
|
16
|
+
attr_reader :data
|
|
17
|
+
|
|
18
|
+
sig { params(data: Imagekitio::FolderDeleteEvent::Data::OrHash).void }
|
|
19
|
+
attr_writer :data
|
|
20
|
+
|
|
21
|
+
# Type of the webhook event.
|
|
22
|
+
sig { returns(Symbol) }
|
|
23
|
+
attr_accessor :type
|
|
24
|
+
|
|
25
|
+
# Triggered when a folder is deleted. Deleting a folder tree sends one event per
|
|
26
|
+
# folder in the tree; the files inside it send `file.deleted` events and their
|
|
27
|
+
# versions send `file-version.deleted` events. Moving a folder sends this event
|
|
28
|
+
# for the old `folderId` and `folder.created` for the new one.
|
|
29
|
+
sig do
|
|
30
|
+
params(
|
|
31
|
+
created_at: Time,
|
|
32
|
+
data: Imagekitio::FolderDeleteEvent::Data::OrHash,
|
|
33
|
+
type: Symbol
|
|
34
|
+
).returns(T.attached_class)
|
|
35
|
+
end
|
|
36
|
+
def self.new(
|
|
37
|
+
# Timestamp of when the event occurred in ISO8601 format.
|
|
38
|
+
created_at:,
|
|
39
|
+
data:,
|
|
40
|
+
# Type of the webhook event.
|
|
41
|
+
type: :"folder.deleted"
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
sig do
|
|
46
|
+
override.returns(
|
|
47
|
+
{
|
|
48
|
+
created_at: Time,
|
|
49
|
+
data: Imagekitio::FolderDeleteEvent::Data,
|
|
50
|
+
type: Symbol
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
def to_hash
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class Data < Imagekitio::Internal::Type::BaseModel
|
|
58
|
+
OrHash =
|
|
59
|
+
T.type_alias do
|
|
60
|
+
T.any(
|
|
61
|
+
Imagekitio::FolderDeleteEvent::Data,
|
|
62
|
+
Imagekitio::Internal::AnyHash
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# The unique `folderId` of the deleted folder.
|
|
67
|
+
sig { returns(String) }
|
|
68
|
+
attr_accessor :folder_id
|
|
69
|
+
|
|
70
|
+
sig { params(folder_id: String).returns(T.attached_class) }
|
|
71
|
+
def self.new(
|
|
72
|
+
# The unique `folderId` of the deleted folder.
|
|
73
|
+
folder_id:
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
sig { override.returns({ folder_id: String }) }
|
|
78
|
+
def to_hash
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
class FolderUpdateEvent < Imagekitio::Models::BaseWebhookEvent
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Imagekitio::FolderUpdateEvent, Imagekitio::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Timestamp of when the event occurred in ISO8601 format.
|
|
12
|
+
sig { returns(Time) }
|
|
13
|
+
attr_accessor :created_at
|
|
14
|
+
|
|
15
|
+
sig { returns(Imagekitio::Folder) }
|
|
16
|
+
attr_reader :data
|
|
17
|
+
|
|
18
|
+
sig { params(data: Imagekitio::Folder::OrHash).void }
|
|
19
|
+
attr_writer :data
|
|
20
|
+
|
|
21
|
+
# Type of the webhook event.
|
|
22
|
+
sig { returns(Symbol) }
|
|
23
|
+
attr_accessor :type
|
|
24
|
+
|
|
25
|
+
# Triggered when a folder is updated, for example when its custom metadata changes
|
|
26
|
+
# or it is renamed. Renaming a folder sends one event per folder in the tree, each
|
|
27
|
+
# with its new `folderPath`.
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
created_at: Time,
|
|
31
|
+
data: Imagekitio::Folder::OrHash,
|
|
32
|
+
type: Symbol
|
|
33
|
+
).returns(T.attached_class)
|
|
34
|
+
end
|
|
35
|
+
def self.new(
|
|
36
|
+
# Timestamp of when the event occurred in ISO8601 format.
|
|
37
|
+
created_at:,
|
|
38
|
+
data:,
|
|
39
|
+
# Type of the webhook event.
|
|
40
|
+
type: :"folder.updated"
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
override.returns(
|
|
46
|
+
{ created_at: Time, data: Imagekitio::Folder, type: Symbol }
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
def to_hash
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -277,6 +277,20 @@ module Imagekitio
|
|
|
277
277
|
sig { params(default_image: String).void }
|
|
278
278
|
attr_writer :default_image
|
|
279
279
|
|
|
280
|
+
# Sets the output image density in dots per inch (DPI). Accepts an integer from 1
|
|
281
|
+
# to 1200 or an arithmetic expression using the `idn` variable, such as
|
|
282
|
+
# `idn_mul_2`. For raster images, this updates density metadata without changing
|
|
283
|
+
# dimensions. For vector images, it controls the DPI used during rasterization.
|
|
284
|
+
# Cannot be used inside layers. See
|
|
285
|
+
# [Density](https://imagekit.io/docs/image-optimization#density---dn).
|
|
286
|
+
sig { returns(T.nilable(Imagekitio::Transformation::Density::Variants)) }
|
|
287
|
+
attr_reader :density
|
|
288
|
+
|
|
289
|
+
sig do
|
|
290
|
+
params(density: Imagekitio::Transformation::Density::Variants).void
|
|
291
|
+
end
|
|
292
|
+
attr_writer :density
|
|
293
|
+
|
|
280
294
|
# Distorts the shape of an image. Supports two modes:
|
|
281
295
|
#
|
|
282
296
|
# - Perspective distortion: `p-x1_y1_x2_y2_x3_y3_x4_y4` changes the position of
|
|
@@ -685,6 +699,7 @@ module Imagekitio
|
|
|
685
699
|
crop: Imagekitio::Transformation::Crop::OrSymbol,
|
|
686
700
|
crop_mode: Imagekitio::Transformation::CropMode::OrSymbol,
|
|
687
701
|
default_image: String,
|
|
702
|
+
density: Imagekitio::Transformation::Density::Variants,
|
|
688
703
|
distort: String,
|
|
689
704
|
dpr: Float,
|
|
690
705
|
duration: Imagekitio::Transformation::Duration::Variants,
|
|
@@ -832,6 +847,13 @@ module Imagekitio
|
|
|
832
847
|
# path. See
|
|
833
848
|
# [Default image](https://imagekit.io/docs/image-transformation#default-image---di).
|
|
834
849
|
default_image: nil,
|
|
850
|
+
# Sets the output image density in dots per inch (DPI). Accepts an integer from 1
|
|
851
|
+
# to 1200 or an arithmetic expression using the `idn` variable, such as
|
|
852
|
+
# `idn_mul_2`. For raster images, this updates density metadata without changing
|
|
853
|
+
# dimensions. For vector images, it controls the DPI used during rasterization.
|
|
854
|
+
# Cannot be used inside layers. See
|
|
855
|
+
# [Density](https://imagekit.io/docs/image-optimization#density---dn).
|
|
856
|
+
density: nil,
|
|
835
857
|
# Distorts the shape of an image. Supports two modes:
|
|
836
858
|
#
|
|
837
859
|
# - Perspective distortion: `p-x1_y1_x2_y2_x3_y3_x4_y4` changes the position of
|
|
@@ -1028,6 +1050,7 @@ module Imagekitio
|
|
|
1028
1050
|
crop: Imagekitio::Transformation::Crop::OrSymbol,
|
|
1029
1051
|
crop_mode: Imagekitio::Transformation::CropMode::OrSymbol,
|
|
1030
1052
|
default_image: String,
|
|
1053
|
+
density: Imagekitio::Transformation::Density::Variants,
|
|
1031
1054
|
distort: String,
|
|
1032
1055
|
dpr: Float,
|
|
1033
1056
|
duration: Imagekitio::Transformation::Duration::Variants,
|
|
@@ -1361,6 +1384,26 @@ module Imagekitio
|
|
|
1361
1384
|
end
|
|
1362
1385
|
end
|
|
1363
1386
|
|
|
1387
|
+
# Sets the output image density in dots per inch (DPI). Accepts an integer from 1
|
|
1388
|
+
# to 1200 or an arithmetic expression using the `idn` variable, such as
|
|
1389
|
+
# `idn_mul_2`. For raster images, this updates density metadata without changing
|
|
1390
|
+
# dimensions. For vector images, it controls the DPI used during rasterization.
|
|
1391
|
+
# Cannot be used inside layers. See
|
|
1392
|
+
# [Density](https://imagekit.io/docs/image-optimization#density---dn).
|
|
1393
|
+
module Density
|
|
1394
|
+
extend Imagekitio::Internal::Type::Union
|
|
1395
|
+
|
|
1396
|
+
Variants = T.type_alias { T.any(Integer, String) }
|
|
1397
|
+
|
|
1398
|
+
sig do
|
|
1399
|
+
override.returns(
|
|
1400
|
+
T::Array[Imagekitio::Transformation::Density::Variants]
|
|
1401
|
+
)
|
|
1402
|
+
end
|
|
1403
|
+
def self.variants
|
|
1404
|
+
end
|
|
1405
|
+
end
|
|
1406
|
+
|
|
1364
1407
|
# Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`.
|
|
1365
1408
|
# Typically used with startOffset to indicate the length from the start offset.
|
|
1366
1409
|
# Arithmetic expressions are supported. See
|
|
@@ -22,7 +22,10 @@ module Imagekitio
|
|
|
22
22
|
Imagekitio::FileUpdateEvent,
|
|
23
23
|
Imagekitio::FileDeleteEvent,
|
|
24
24
|
Imagekitio::FileVersionCreateEvent,
|
|
25
|
-
Imagekitio::FileVersionDeleteEvent
|
|
25
|
+
Imagekitio::FileVersionDeleteEvent,
|
|
26
|
+
Imagekitio::FolderCreateEvent,
|
|
27
|
+
Imagekitio::FolderUpdateEvent,
|
|
28
|
+
Imagekitio::FolderDeleteEvent
|
|
26
29
|
)
|
|
27
30
|
end
|
|
28
31
|
|
|
@@ -22,7 +22,10 @@ module Imagekitio
|
|
|
22
22
|
Imagekitio::FileUpdateEvent,
|
|
23
23
|
Imagekitio::FileDeleteEvent,
|
|
24
24
|
Imagekitio::FileVersionCreateEvent,
|
|
25
|
-
Imagekitio::FileVersionDeleteEvent
|
|
25
|
+
Imagekitio::FileVersionDeleteEvent,
|
|
26
|
+
Imagekitio::FolderCreateEvent,
|
|
27
|
+
Imagekitio::FolderUpdateEvent,
|
|
28
|
+
Imagekitio::FolderDeleteEvent
|
|
26
29
|
)
|
|
27
30
|
end
|
|
28
31
|
|
|
@@ -31,6 +31,11 @@ module Imagekitio
|
|
|
31
31
|
# A key-value data to be associated with the asset. To unset a key, send `null`
|
|
32
32
|
# value for that key. Before setting any custom metadata on an asset you have to
|
|
33
33
|
# create the field using custom metadata fields API.
|
|
34
|
+
#
|
|
35
|
+
# To preserve the original creation date of an asset migrated from another system,
|
|
36
|
+
# set the reserved `_internal_original_created_datetime` key to an ISO 8601 date
|
|
37
|
+
# string. This key is available once the original creation date setting is enabled
|
|
38
|
+
# in the media library settings.
|
|
34
39
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
35
40
|
attr_reader :custom_metadata
|
|
36
41
|
|
|
@@ -135,6 +140,11 @@ module Imagekitio
|
|
|
135
140
|
# A key-value data to be associated with the asset. To unset a key, send `null`
|
|
136
141
|
# value for that key. Before setting any custom metadata on an asset you have to
|
|
137
142
|
# create the field using custom metadata fields API.
|
|
143
|
+
#
|
|
144
|
+
# To preserve the original creation date of an asset migrated from another system,
|
|
145
|
+
# set the reserved `_internal_original_created_datetime` key to an ISO 8601 date
|
|
146
|
+
# string. This key is available once the original creation date setting is enabled
|
|
147
|
+
# in the media library settings.
|
|
138
148
|
custom_metadata: nil,
|
|
139
149
|
# Optional text to describe the contents of the file.
|
|
140
150
|
description: nil,
|
data/rbi/imagekitio/models.rbi
CHANGED
|
@@ -80,8 +80,12 @@ module Imagekitio
|
|
|
80
80
|
|
|
81
81
|
FolderCopyParams = Imagekitio::Models::FolderCopyParams
|
|
82
82
|
|
|
83
|
+
FolderCreateEvent = Imagekitio::Models::FolderCreateEvent
|
|
84
|
+
|
|
83
85
|
FolderCreateParams = Imagekitio::Models::FolderCreateParams
|
|
84
86
|
|
|
87
|
+
FolderDeleteEvent = Imagekitio::Models::FolderDeleteEvent
|
|
88
|
+
|
|
85
89
|
FolderDeleteParams = Imagekitio::Models::FolderDeleteParams
|
|
86
90
|
|
|
87
91
|
FolderMoveParams = Imagekitio::Models::FolderMoveParams
|
|
@@ -90,6 +94,8 @@ module Imagekitio
|
|
|
90
94
|
|
|
91
95
|
Folders = Imagekitio::Models::Folders
|
|
92
96
|
|
|
97
|
+
FolderUpdateEvent = Imagekitio::Models::FolderUpdateEvent
|
|
98
|
+
|
|
93
99
|
GetImageAttributesOptions = Imagekitio::Models::GetImageAttributesOptions
|
|
94
100
|
|
|
95
101
|
ImageOverlay = Imagekitio::Models::ImageOverlay
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Resources
|
|
5
|
+
class Accounts
|
|
6
|
+
class Webhooks
|
|
7
|
+
# Creates a new webhook and returns the created object, including the generated
|
|
8
|
+
# signing `secret`.
|
|
9
|
+
#
|
|
10
|
+
# ImageKit sends a `POST` request to the webhook `endpoint` whenever one of the
|
|
11
|
+
# subscribed `events` occurs. Use the `secret` to verify the signature of each
|
|
12
|
+
# request. Learn more about [webhooks](https://imagekit.io/docs/webhooks).
|
|
13
|
+
#
|
|
14
|
+
# You can create up to 3 webhooks per account.
|
|
15
|
+
sig do
|
|
16
|
+
params(
|
|
17
|
+
endpoint: String,
|
|
18
|
+
events: T::Array[Imagekitio::Accounts::WebhookEventType::OrSymbol],
|
|
19
|
+
enabled: T::Boolean,
|
|
20
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
21
|
+
).returns(Imagekitio::Accounts::Webhook)
|
|
22
|
+
end
|
|
23
|
+
def create(
|
|
24
|
+
# The URL where ImageKit sends webhook events as `POST` requests. Must use the
|
|
25
|
+
# `http` or `https` protocol, and must be unique across all webhooks for your
|
|
26
|
+
# account.
|
|
27
|
+
endpoint:,
|
|
28
|
+
# The event types this webhook is subscribed to. ImageKit sends a request to the
|
|
29
|
+
# `endpoint` only for these events.
|
|
30
|
+
events:,
|
|
31
|
+
# Whether the webhook is enabled. When `false`, ImageKit doesn't send any events
|
|
32
|
+
# to the `endpoint`.
|
|
33
|
+
enabled: nil,
|
|
34
|
+
request_options: {}
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Updates the webhook identified by `id` and returns the updated object. Only the
|
|
39
|
+
# fields included in the request body are changed.
|
|
40
|
+
#
|
|
41
|
+
# When `events` is provided, it replaces the existing list of subscribed events.
|
|
42
|
+
# The signing `secret` can't be changed.
|
|
43
|
+
sig do
|
|
44
|
+
params(
|
|
45
|
+
id: String,
|
|
46
|
+
enabled: T::Boolean,
|
|
47
|
+
endpoint: String,
|
|
48
|
+
events: T::Array[Imagekitio::Accounts::WebhookEventType::OrSymbol],
|
|
49
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
50
|
+
).returns(Imagekitio::Accounts::Webhook)
|
|
51
|
+
end
|
|
52
|
+
def update(
|
|
53
|
+
# Unique identifier for a webhook.
|
|
54
|
+
id,
|
|
55
|
+
# Whether the webhook is enabled. Omit to leave the current value unchanged.
|
|
56
|
+
enabled: nil,
|
|
57
|
+
# The URL where ImageKit sends webhook events as `POST` requests. Must use the
|
|
58
|
+
# `http` or `https` protocol, and must be unique across all webhooks for your
|
|
59
|
+
# account.
|
|
60
|
+
endpoint: nil,
|
|
61
|
+
# The event types this webhook is subscribed to. Replaces the existing list. Omit
|
|
62
|
+
# to leave the current value unchanged.
|
|
63
|
+
events: nil,
|
|
64
|
+
request_options: {}
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Returns an array of all webhooks configured for your account.
|
|
69
|
+
sig do
|
|
70
|
+
params(request_options: Imagekitio::RequestOptions::OrHash).returns(
|
|
71
|
+
T::Array[Imagekitio::Accounts::Webhook]
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
def list(request_options: {})
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Permanently deletes the webhook identified by `id`. ImageKit stops sending
|
|
78
|
+
# events to its endpoint.
|
|
79
|
+
sig do
|
|
80
|
+
params(
|
|
81
|
+
id: String,
|
|
82
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
83
|
+
).void
|
|
84
|
+
end
|
|
85
|
+
def delete(
|
|
86
|
+
# Unique identifier for a webhook.
|
|
87
|
+
id,
|
|
88
|
+
request_options: {}
|
|
89
|
+
)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Retrieves the webhook identified by `id`.
|
|
93
|
+
sig do
|
|
94
|
+
params(
|
|
95
|
+
id: String,
|
|
96
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
97
|
+
).returns(Imagekitio::Accounts::Webhook)
|
|
98
|
+
end
|
|
99
|
+
def get(
|
|
100
|
+
# Unique identifier for a webhook.
|
|
101
|
+
id,
|
|
102
|
+
request_options: {}
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# @api private
|
|
107
|
+
sig { params(client: Imagekitio::Client).returns(T.attached_class) }
|
|
108
|
+
def self.new(client:)
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
@@ -15,6 +15,9 @@ module Imagekitio
|
|
|
15
15
|
sig { returns(Imagekitio::Resources::Accounts::URLEndpoints) }
|
|
16
16
|
attr_reader :url_endpoints
|
|
17
17
|
|
|
18
|
+
sig { returns(Imagekitio::Resources::Accounts::Webhooks) }
|
|
19
|
+
attr_reader :webhooks
|
|
20
|
+
|
|
18
21
|
# @api private
|
|
19
22
|
sig { params(client: Imagekitio::Client).returns(T.attached_class) }
|
|
20
23
|
def self.new(client:)
|
|
@@ -53,6 +53,15 @@ module Imagekitio
|
|
|
53
53
|
skip: nil,
|
|
54
54
|
# Sort the results by one of the supported fields in ascending or descending
|
|
55
55
|
# order.
|
|
56
|
+
#
|
|
57
|
+
# `ASC_ORIGINAL_CREATION_DATE` and `DESC_ORIGINAL_CREATION_DATE` sort files by the
|
|
58
|
+
# value of the reserved `_internal_original_created_datetime` custom metadata
|
|
59
|
+
# field (labelled "Original creation date" in the dashboard). This field exists
|
|
60
|
+
# only after you enable the original creation date setting under the Custom
|
|
61
|
+
# Metadata tab of the media library settings. Files that have no value set for
|
|
62
|
+
# this field fall back to their upload time, so migrated assets carrying a
|
|
63
|
+
# preserved original date and natively uploaded assets are ordered together in a
|
|
64
|
+
# single timeline.
|
|
56
65
|
sort: nil,
|
|
57
66
|
# Filter results by asset type.
|
|
58
67
|
#
|
|
@@ -112,7 +112,11 @@ module Imagekitio
|
|
|
112
112
|
# customCoordinates will be removed.
|
|
113
113
|
custom_coordinates: nil,
|
|
114
114
|
# JSON key-value pairs to associate with the asset. Create the custom metadata
|
|
115
|
-
# fields before setting these values.
|
|
115
|
+
# fields before setting these values. To preserve the original creation date of an
|
|
116
|
+
# asset migrated from another system, set the reserved
|
|
117
|
+
# `_internal_original_created_datetime` key to an ISO 8601 date string. This key
|
|
118
|
+
# is available once the original creation date setting is enabled in the media
|
|
119
|
+
# library settings.
|
|
116
120
|
custom_metadata: nil,
|
|
117
121
|
# Optional text to describe the contents of the file.
|
|
118
122
|
description: nil,
|
|
@@ -24,6 +24,10 @@ module Imagekitio
|
|
|
24
24
|
label:,
|
|
25
25
|
# API name of the custom metadata field. This should be unique across all
|
|
26
26
|
# (including deleted) custom metadata fields.
|
|
27
|
+
#
|
|
28
|
+
# `_internal_original_created_datetime` is a reserved name and cannot be used.
|
|
29
|
+
# ImageKit creates that field automatically when you enable the original creation
|
|
30
|
+
# date setting in the media library settings.
|
|
27
31
|
name:,
|
|
28
32
|
schema:,
|
|
29
33
|
# Optional description for the custom metadata field. Can be up to 500 characters.
|
|
@@ -100,7 +104,7 @@ module Imagekitio
|
|
|
100
104
|
params(
|
|
101
105
|
id: String,
|
|
102
106
|
request_options: Imagekitio::RequestOptions::OrHash
|
|
103
|
-
).
|
|
107
|
+
).void
|
|
104
108
|
end
|
|
105
109
|
def delete(
|
|
106
110
|
# Should be a valid custom metadata field id.
|
|
@@ -28,7 +28,7 @@ module Imagekitio
|
|
|
28
28
|
version_id: String,
|
|
29
29
|
file_id: String,
|
|
30
30
|
request_options: Imagekitio::RequestOptions::OrHash
|
|
31
|
-
).
|
|
31
|
+
).void
|
|
32
32
|
end
|
|
33
33
|
def delete(
|
|
34
34
|
# The unique `versionId` of the uploaded file. `versionId` is returned in list and
|
|
@@ -66,7 +66,7 @@ module Imagekitio
|
|
|
66
66
|
source_file_path: String,
|
|
67
67
|
include_file_versions: T::Boolean,
|
|
68
68
|
request_options: Imagekitio::RequestOptions::OrHash
|
|
69
|
-
).
|
|
69
|
+
).void
|
|
70
70
|
end
|
|
71
71
|
def copy(
|
|
72
72
|
# Full path to the folder you want to copy the above file into.
|
|
@@ -106,7 +106,7 @@ module Imagekitio
|
|
|
106
106
|
destination_path: String,
|
|
107
107
|
source_file_path: String,
|
|
108
108
|
request_options: Imagekitio::RequestOptions::OrHash
|
|
109
|
-
).
|
|
109
|
+
).void
|
|
110
110
|
end
|
|
111
111
|
def move(
|
|
112
112
|
# Full path to the folder you want to move the above file into.
|
|
@@ -268,7 +268,11 @@ module Imagekitio
|
|
|
268
268
|
# customCoordinates will be removed.
|
|
269
269
|
custom_coordinates: nil,
|
|
270
270
|
# JSON key-value pairs to associate with the asset. Create the custom metadata
|
|
271
|
-
# fields before setting these values.
|
|
271
|
+
# fields before setting these values. To preserve the original creation date of an
|
|
272
|
+
# asset migrated from another system, set the reserved
|
|
273
|
+
# `_internal_original_created_datetime` key to an ISO 8601 date string. This key
|
|
274
|
+
# is available once the original creation date setting is enabled in the media
|
|
275
|
+
# library settings.
|
|
272
276
|
custom_metadata: nil,
|
|
273
277
|
# Optional text to describe the contents of the file.
|
|
274
278
|
description: nil,
|
|
@@ -40,7 +40,7 @@ module Imagekitio
|
|
|
40
40
|
params(
|
|
41
41
|
folder_path: String,
|
|
42
42
|
request_options: Imagekitio::RequestOptions::OrHash
|
|
43
|
-
).
|
|
43
|
+
).void
|
|
44
44
|
end
|
|
45
45
|
def delete(
|
|
46
46
|
# Full path to the folder you want to delete. For example `/folder/to/delete/`.
|
|
@@ -17,7 +17,10 @@ module Imagekitio
|
|
|
17
17
|
Imagekitio::FileUpdateEvent,
|
|
18
18
|
Imagekitio::FileDeleteEvent,
|
|
19
19
|
Imagekitio::FileVersionCreateEvent,
|
|
20
|
-
Imagekitio::FileVersionDeleteEvent
|
|
20
|
+
Imagekitio::FileVersionDeleteEvent,
|
|
21
|
+
Imagekitio::FolderCreateEvent,
|
|
22
|
+
Imagekitio::FolderUpdateEvent,
|
|
23
|
+
Imagekitio::FolderDeleteEvent
|
|
21
24
|
)
|
|
22
25
|
)
|
|
23
26
|
end
|
|
@@ -45,7 +48,10 @@ module Imagekitio
|
|
|
45
48
|
Imagekitio::FileUpdateEvent,
|
|
46
49
|
Imagekitio::FileDeleteEvent,
|
|
47
50
|
Imagekitio::FileVersionCreateEvent,
|
|
48
|
-
Imagekitio::FileVersionDeleteEvent
|
|
51
|
+
Imagekitio::FileVersionDeleteEvent,
|
|
52
|
+
Imagekitio::FolderCreateEvent,
|
|
53
|
+
Imagekitio::FolderUpdateEvent,
|
|
54
|
+
Imagekitio::FolderDeleteEvent
|
|
49
55
|
)
|
|
50
56
|
)
|
|
51
57
|
end
|