imagekitio 4.10.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 +23 -0
- data/README.md +1 -1
- 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 +18 -0
- data/lib/imagekitio/models/beta/v2/file_upload_params.rb +5 -1
- data/lib/imagekitio/models/custom_metadata_field.rb +16 -3
- 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/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 +27 -0
- data/rbi/imagekitio/models/beta/v2/file_upload_params.rbi +10 -2
- data/rbi/imagekitio/models/custom_metadata_field.rbi +30 -4
- 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/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/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/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
|
@@ -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
|
|
@@ -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
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module Imagekitio
|
|
2
|
+
module Models
|
|
3
|
+
module Accounts
|
|
4
|
+
type webhook =
|
|
5
|
+
{
|
|
6
|
+
id: String,
|
|
7
|
+
created_at: Time,
|
|
8
|
+
enabled: bool,
|
|
9
|
+
endpoint: String,
|
|
10
|
+
events: ::Array[Imagekitio::Models::Accounts::webhook_event_type],
|
|
11
|
+
secret: String,
|
|
12
|
+
updated_at: Time
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
class Webhook < Imagekitio::Internal::Type::BaseModel
|
|
16
|
+
attr_accessor id: String
|
|
17
|
+
|
|
18
|
+
attr_accessor created_at: Time
|
|
19
|
+
|
|
20
|
+
attr_accessor enabled: bool
|
|
21
|
+
|
|
22
|
+
attr_accessor endpoint: String
|
|
23
|
+
|
|
24
|
+
attr_accessor events: ::Array[Imagekitio::Models::Accounts::webhook_event_type]
|
|
25
|
+
|
|
26
|
+
attr_accessor secret: String
|
|
27
|
+
|
|
28
|
+
attr_accessor updated_at: Time
|
|
29
|
+
|
|
30
|
+
def initialize: (
|
|
31
|
+
id: String,
|
|
32
|
+
created_at: Time,
|
|
33
|
+
enabled: bool,
|
|
34
|
+
endpoint: String,
|
|
35
|
+
events: ::Array[Imagekitio::Models::Accounts::webhook_event_type],
|
|
36
|
+
secret: String,
|
|
37
|
+
updated_at: Time
|
|
38
|
+
) -> void
|
|
39
|
+
|
|
40
|
+
def to_hash: -> {
|
|
41
|
+
id: String,
|
|
42
|
+
created_at: Time,
|
|
43
|
+
enabled: bool,
|
|
44
|
+
endpoint: String,
|
|
45
|
+
events: ::Array[Imagekitio::Models::Accounts::webhook_event_type],
|
|
46
|
+
secret: String,
|
|
47
|
+
updated_at: Time
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module Imagekitio
|
|
2
|
+
module Models
|
|
3
|
+
module Accounts
|
|
4
|
+
type webhook_create_params =
|
|
5
|
+
{
|
|
6
|
+
endpoint: String,
|
|
7
|
+
events: ::Array[Imagekitio::Models::Accounts::webhook_event_type],
|
|
8
|
+
enabled: bool
|
|
9
|
+
}
|
|
10
|
+
& Imagekitio::Internal::Type::request_parameters
|
|
11
|
+
|
|
12
|
+
class WebhookCreateParams < Imagekitio::Internal::Type::BaseModel
|
|
13
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
14
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
15
|
+
|
|
16
|
+
attr_accessor endpoint: String
|
|
17
|
+
|
|
18
|
+
attr_accessor events: ::Array[Imagekitio::Models::Accounts::webhook_event_type]
|
|
19
|
+
|
|
20
|
+
attr_reader enabled: bool?
|
|
21
|
+
|
|
22
|
+
def enabled=: (bool) -> bool
|
|
23
|
+
|
|
24
|
+
def initialize: (
|
|
25
|
+
endpoint: String,
|
|
26
|
+
events: ::Array[Imagekitio::Models::Accounts::webhook_event_type],
|
|
27
|
+
?enabled: bool,
|
|
28
|
+
?request_options: Imagekitio::request_opts
|
|
29
|
+
) -> void
|
|
30
|
+
|
|
31
|
+
def to_hash: -> {
|
|
32
|
+
endpoint: String,
|
|
33
|
+
events: ::Array[Imagekitio::Models::Accounts::webhook_event_type],
|
|
34
|
+
enabled: bool,
|
|
35
|
+
request_options: Imagekitio::RequestOptions
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module Imagekitio
|
|
2
|
+
module Models
|
|
3
|
+
module Accounts
|
|
4
|
+
type webhook_delete_params =
|
|
5
|
+
{ id: String } & Imagekitio::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class WebhookDeleteParams < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
attr_accessor id: String
|
|
12
|
+
|
|
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
|
+
}
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module Imagekitio
|
|
2
|
+
module Models
|
|
3
|
+
module Accounts
|
|
4
|
+
type webhook_event_type =
|
|
5
|
+
:"video.transformation.accepted"
|
|
6
|
+
| :"video.transformation.ready"
|
|
7
|
+
| :"video.transformation.error"
|
|
8
|
+
| :"upload.pre-transform.success"
|
|
9
|
+
| :"upload.pre-transform.error"
|
|
10
|
+
| :"upload.post-transform.success"
|
|
11
|
+
| :"upload.post-transform.error"
|
|
12
|
+
| :"file.created"
|
|
13
|
+
| :"file.updated"
|
|
14
|
+
| :"file.deleted"
|
|
15
|
+
| :"file-version.created"
|
|
16
|
+
| :"file-version.deleted"
|
|
17
|
+
| :"folder.created"
|
|
18
|
+
| :"folder.updated"
|
|
19
|
+
| :"folder.deleted"
|
|
20
|
+
|
|
21
|
+
module WebhookEventType
|
|
22
|
+
extend Imagekitio::Internal::Type::Enum
|
|
23
|
+
|
|
24
|
+
VIDEO_TRANSFORMATION_ACCEPTED: :"video.transformation.accepted"
|
|
25
|
+
VIDEO_TRANSFORMATION_READY: :"video.transformation.ready"
|
|
26
|
+
VIDEO_TRANSFORMATION_ERROR: :"video.transformation.error"
|
|
27
|
+
UPLOAD_PRE_TRANSFORM_SUCCESS: :"upload.pre-transform.success"
|
|
28
|
+
UPLOAD_PRE_TRANSFORM_ERROR: :"upload.pre-transform.error"
|
|
29
|
+
UPLOAD_POST_TRANSFORM_SUCCESS: :"upload.post-transform.success"
|
|
30
|
+
UPLOAD_POST_TRANSFORM_ERROR: :"upload.post-transform.error"
|
|
31
|
+
FILE_CREATED: :"file.created"
|
|
32
|
+
FILE_UPDATED: :"file.updated"
|
|
33
|
+
FILE_DELETED: :"file.deleted"
|
|
34
|
+
FILE_VERSION_CREATED: :"file-version.created"
|
|
35
|
+
FILE_VERSION_DELETED: :"file-version.deleted"
|
|
36
|
+
FOLDER_CREATED: :"folder.created"
|
|
37
|
+
FOLDER_UPDATED: :"folder.updated"
|
|
38
|
+
FOLDER_DELETED: :"folder.deleted"
|
|
39
|
+
|
|
40
|
+
def self?.values: -> ::Array[Imagekitio::Models::Accounts::webhook_event_type]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module Imagekitio
|
|
2
|
+
module Models
|
|
3
|
+
module Accounts
|
|
4
|
+
type webhook_get_params =
|
|
5
|
+
{ id: String } & Imagekitio::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class WebhookGetParams < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
attr_accessor id: String
|
|
12
|
+
|
|
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
|
+
}
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Imagekitio
|
|
2
|
+
module Models
|
|
3
|
+
module Accounts
|
|
4
|
+
type webhook_list_params =
|
|
5
|
+
{ } & Imagekitio::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class WebhookListParams < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
def initialize: (?request_options: Imagekitio::request_opts) -> void
|
|
12
|
+
|
|
13
|
+
def to_hash: -> { request_options: Imagekitio::RequestOptions }
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module Imagekitio
|
|
2
|
+
module Models
|
|
3
|
+
module Accounts
|
|
4
|
+
type webhook_update_params =
|
|
5
|
+
{
|
|
6
|
+
id: String,
|
|
7
|
+
enabled: bool,
|
|
8
|
+
endpoint: String,
|
|
9
|
+
events: ::Array[Imagekitio::Models::Accounts::webhook_event_type]
|
|
10
|
+
}
|
|
11
|
+
& Imagekitio::Internal::Type::request_parameters
|
|
12
|
+
|
|
13
|
+
class WebhookUpdateParams < Imagekitio::Internal::Type::BaseModel
|
|
14
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
15
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
16
|
+
|
|
17
|
+
attr_accessor id: String
|
|
18
|
+
|
|
19
|
+
attr_reader enabled: bool?
|
|
20
|
+
|
|
21
|
+
def enabled=: (bool) -> bool
|
|
22
|
+
|
|
23
|
+
attr_reader endpoint: String?
|
|
24
|
+
|
|
25
|
+
def endpoint=: (String) -> String
|
|
26
|
+
|
|
27
|
+
attr_reader events: ::Array[Imagekitio::Models::Accounts::webhook_event_type]?
|
|
28
|
+
|
|
29
|
+
def events=: (
|
|
30
|
+
::Array[Imagekitio::Models::Accounts::webhook_event_type]
|
|
31
|
+
) -> ::Array[Imagekitio::Models::Accounts::webhook_event_type]
|
|
32
|
+
|
|
33
|
+
def initialize: (
|
|
34
|
+
id: String,
|
|
35
|
+
?enabled: bool,
|
|
36
|
+
?endpoint: String,
|
|
37
|
+
?events: ::Array[Imagekitio::Models::Accounts::webhook_event_type],
|
|
38
|
+
?request_options: Imagekitio::request_opts
|
|
39
|
+
) -> void
|
|
40
|
+
|
|
41
|
+
def to_hash: -> {
|
|
42
|
+
id: String,
|
|
43
|
+
enabled: bool,
|
|
44
|
+
endpoint: String,
|
|
45
|
+
events: ::Array[Imagekitio::Models::Accounts::webhook_event_type],
|
|
46
|
+
request_options: Imagekitio::RequestOptions
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|