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,101 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
# A webhook event type. Learn more about the payload of each
|
|
7
|
+
# [webhook event](https://imagekit.io/docs/webhooks#list-of-events).
|
|
8
|
+
module WebhookEventType
|
|
9
|
+
extend Imagekitio::Internal::Type::Enum
|
|
10
|
+
|
|
11
|
+
TaggedSymbol =
|
|
12
|
+
T.type_alias { T.all(Symbol, Imagekitio::Accounts::WebhookEventType) }
|
|
13
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
14
|
+
|
|
15
|
+
VIDEO_TRANSFORMATION_ACCEPTED =
|
|
16
|
+
T.let(
|
|
17
|
+
:"video.transformation.accepted",
|
|
18
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
19
|
+
)
|
|
20
|
+
VIDEO_TRANSFORMATION_READY =
|
|
21
|
+
T.let(
|
|
22
|
+
:"video.transformation.ready",
|
|
23
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
24
|
+
)
|
|
25
|
+
VIDEO_TRANSFORMATION_ERROR =
|
|
26
|
+
T.let(
|
|
27
|
+
:"video.transformation.error",
|
|
28
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
29
|
+
)
|
|
30
|
+
UPLOAD_PRE_TRANSFORM_SUCCESS =
|
|
31
|
+
T.let(
|
|
32
|
+
:"upload.pre-transform.success",
|
|
33
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
34
|
+
)
|
|
35
|
+
UPLOAD_PRE_TRANSFORM_ERROR =
|
|
36
|
+
T.let(
|
|
37
|
+
:"upload.pre-transform.error",
|
|
38
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
39
|
+
)
|
|
40
|
+
UPLOAD_POST_TRANSFORM_SUCCESS =
|
|
41
|
+
T.let(
|
|
42
|
+
:"upload.post-transform.success",
|
|
43
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
44
|
+
)
|
|
45
|
+
UPLOAD_POST_TRANSFORM_ERROR =
|
|
46
|
+
T.let(
|
|
47
|
+
:"upload.post-transform.error",
|
|
48
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
49
|
+
)
|
|
50
|
+
FILE_CREATED =
|
|
51
|
+
T.let(
|
|
52
|
+
:"file.created",
|
|
53
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
54
|
+
)
|
|
55
|
+
FILE_UPDATED =
|
|
56
|
+
T.let(
|
|
57
|
+
:"file.updated",
|
|
58
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
59
|
+
)
|
|
60
|
+
FILE_DELETED =
|
|
61
|
+
T.let(
|
|
62
|
+
:"file.deleted",
|
|
63
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
64
|
+
)
|
|
65
|
+
FILE_VERSION_CREATED =
|
|
66
|
+
T.let(
|
|
67
|
+
:"file-version.created",
|
|
68
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
69
|
+
)
|
|
70
|
+
FILE_VERSION_DELETED =
|
|
71
|
+
T.let(
|
|
72
|
+
:"file-version.deleted",
|
|
73
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
74
|
+
)
|
|
75
|
+
FOLDER_CREATED =
|
|
76
|
+
T.let(
|
|
77
|
+
:"folder.created",
|
|
78
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
79
|
+
)
|
|
80
|
+
FOLDER_UPDATED =
|
|
81
|
+
T.let(
|
|
82
|
+
:"folder.updated",
|
|
83
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
84
|
+
)
|
|
85
|
+
FOLDER_DELETED =
|
|
86
|
+
T.let(
|
|
87
|
+
:"folder.deleted",
|
|
88
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
sig do
|
|
92
|
+
override.returns(
|
|
93
|
+
T::Array[Imagekitio::Accounts::WebhookEventType::TaggedSymbol]
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
def self.values
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class WebhookGetParams < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Imagekitio::Accounts::WebhookGetParams,
|
|
14
|
+
Imagekitio::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Unique identifier for a webhook.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
id: String,
|
|
25
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
26
|
+
).returns(T.attached_class)
|
|
27
|
+
end
|
|
28
|
+
def self.new(
|
|
29
|
+
# Unique identifier for a webhook.
|
|
30
|
+
id:,
|
|
31
|
+
request_options: {}
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
override.returns(
|
|
37
|
+
{ id: String, request_options: Imagekitio::RequestOptions }
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
def to_hash
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class WebhookListParams < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Imagekitio::Accounts::WebhookListParams,
|
|
14
|
+
Imagekitio::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(request_options: Imagekitio::RequestOptions::OrHash).returns(
|
|
20
|
+
T.attached_class
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
def self.new(request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns({ request_options: Imagekitio::RequestOptions })
|
|
28
|
+
end
|
|
29
|
+
def to_hash
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class WebhookUpdateParams < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Imagekitio::Accounts::WebhookUpdateParams,
|
|
14
|
+
Imagekitio::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Unique identifier for a webhook.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Whether the webhook is enabled. Omit to leave the current value unchanged.
|
|
23
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
24
|
+
attr_reader :enabled
|
|
25
|
+
|
|
26
|
+
sig { params(enabled: T::Boolean).void }
|
|
27
|
+
attr_writer :enabled
|
|
28
|
+
|
|
29
|
+
# The URL where ImageKit sends webhook events as `POST` requests. Must use the
|
|
30
|
+
# `http` or `https` protocol, and must be unique across all webhooks for your
|
|
31
|
+
# account.
|
|
32
|
+
sig { returns(T.nilable(String)) }
|
|
33
|
+
attr_reader :endpoint
|
|
34
|
+
|
|
35
|
+
sig { params(endpoint: String).void }
|
|
36
|
+
attr_writer :endpoint
|
|
37
|
+
|
|
38
|
+
# The event types this webhook is subscribed to. Replaces the existing list. Omit
|
|
39
|
+
# to leave the current value unchanged.
|
|
40
|
+
sig do
|
|
41
|
+
returns(
|
|
42
|
+
T.nilable(
|
|
43
|
+
T::Array[Imagekitio::Accounts::WebhookEventType::OrSymbol]
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
attr_reader :events
|
|
48
|
+
|
|
49
|
+
sig do
|
|
50
|
+
params(
|
|
51
|
+
events: T::Array[Imagekitio::Accounts::WebhookEventType::OrSymbol]
|
|
52
|
+
).void
|
|
53
|
+
end
|
|
54
|
+
attr_writer :events
|
|
55
|
+
|
|
56
|
+
sig do
|
|
57
|
+
params(
|
|
58
|
+
id: String,
|
|
59
|
+
enabled: T::Boolean,
|
|
60
|
+
endpoint: String,
|
|
61
|
+
events: T::Array[Imagekitio::Accounts::WebhookEventType::OrSymbol],
|
|
62
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
63
|
+
).returns(T.attached_class)
|
|
64
|
+
end
|
|
65
|
+
def self.new(
|
|
66
|
+
# Unique identifier for a webhook.
|
|
67
|
+
id:,
|
|
68
|
+
# Whether the webhook is enabled. Omit to leave the current value unchanged.
|
|
69
|
+
enabled: nil,
|
|
70
|
+
# The URL where ImageKit sends webhook events as `POST` requests. Must use the
|
|
71
|
+
# `http` or `https` protocol, and must be unique across all webhooks for your
|
|
72
|
+
# account.
|
|
73
|
+
endpoint: nil,
|
|
74
|
+
# The event types this webhook is subscribed to. Replaces the existing list. Omit
|
|
75
|
+
# to leave the current value unchanged.
|
|
76
|
+
events: nil,
|
|
77
|
+
request_options: {}
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
sig do
|
|
82
|
+
override.returns(
|
|
83
|
+
{
|
|
84
|
+
id: String,
|
|
85
|
+
enabled: T::Boolean,
|
|
86
|
+
endpoint: String,
|
|
87
|
+
events:
|
|
88
|
+
T::Array[Imagekitio::Accounts::WebhookEventType::OrSymbol],
|
|
89
|
+
request_options: Imagekitio::RequestOptions
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
def to_hash
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -73,6 +73,15 @@ module Imagekitio
|
|
|
73
73
|
|
|
74
74
|
# Sort the results by one of the supported fields in ascending or descending
|
|
75
75
|
# order.
|
|
76
|
+
#
|
|
77
|
+
# `ASC_ORIGINAL_CREATION_DATE` and `DESC_ORIGINAL_CREATION_DATE` sort files by the
|
|
78
|
+
# value of the reserved `_internal_original_created_datetime` custom metadata
|
|
79
|
+
# field (labelled "Original creation date" in the dashboard). This field exists
|
|
80
|
+
# only after you enable the original creation date setting under the Custom
|
|
81
|
+
# Metadata tab of the media library settings. Files that have no value set for
|
|
82
|
+
# this field fall back to their upload time, so migrated assets carrying a
|
|
83
|
+
# preserved original date and natively uploaded assets are ordered together in a
|
|
84
|
+
# single timeline.
|
|
76
85
|
sig { returns(T.nilable(Imagekitio::AssetListParams::Sort::OrSymbol)) }
|
|
77
86
|
attr_reader :sort
|
|
78
87
|
|
|
@@ -137,6 +146,15 @@ module Imagekitio
|
|
|
137
146
|
skip: nil,
|
|
138
147
|
# Sort the results by one of the supported fields in ascending or descending
|
|
139
148
|
# order.
|
|
149
|
+
#
|
|
150
|
+
# `ASC_ORIGINAL_CREATION_DATE` and `DESC_ORIGINAL_CREATION_DATE` sort files by the
|
|
151
|
+
# value of the reserved `_internal_original_created_datetime` custom metadata
|
|
152
|
+
# field (labelled "Original creation date" in the dashboard). This field exists
|
|
153
|
+
# only after you enable the original creation date setting under the Custom
|
|
154
|
+
# Metadata tab of the media library settings. Files that have no value set for
|
|
155
|
+
# this field fall back to their upload time, so migrated assets carrying a
|
|
156
|
+
# preserved original date and natively uploaded assets are ordered together in a
|
|
157
|
+
# single timeline.
|
|
140
158
|
sort: nil,
|
|
141
159
|
# Filter results by asset type.
|
|
142
160
|
#
|
|
@@ -198,6 +216,15 @@ module Imagekitio
|
|
|
198
216
|
|
|
199
217
|
# Sort the results by one of the supported fields in ascending or descending
|
|
200
218
|
# order.
|
|
219
|
+
#
|
|
220
|
+
# `ASC_ORIGINAL_CREATION_DATE` and `DESC_ORIGINAL_CREATION_DATE` sort files by the
|
|
221
|
+
# value of the reserved `_internal_original_created_datetime` custom metadata
|
|
222
|
+
# field (labelled "Original creation date" in the dashboard). This field exists
|
|
223
|
+
# only after you enable the original creation date setting under the Custom
|
|
224
|
+
# Metadata tab of the media library settings. Files that have no value set for
|
|
225
|
+
# this field fall back to their upload time, so migrated assets carrying a
|
|
226
|
+
# preserved original date and natively uploaded assets are ordered together in a
|
|
227
|
+
# single timeline.
|
|
201
228
|
module Sort
|
|
202
229
|
extend Imagekitio::Internal::Type::Enum
|
|
203
230
|
|
|
@@ -75,7 +75,11 @@ module Imagekitio
|
|
|
75
75
|
attr_writer :custom_coordinates
|
|
76
76
|
|
|
77
77
|
# JSON key-value pairs to associate with the asset. Create the custom metadata
|
|
78
|
-
# fields before setting these values.
|
|
78
|
+
# fields before setting these values. To preserve the original creation date of an
|
|
79
|
+
# asset migrated from another system, set the reserved
|
|
80
|
+
# `_internal_original_created_datetime` key to an ISO 8601 date string. This key
|
|
81
|
+
# is available once the original creation date setting is enabled in the media
|
|
82
|
+
# library settings.
|
|
79
83
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
80
84
|
attr_reader :custom_metadata
|
|
81
85
|
|
|
@@ -349,7 +353,11 @@ module Imagekitio
|
|
|
349
353
|
# customCoordinates will be removed.
|
|
350
354
|
custom_coordinates: nil,
|
|
351
355
|
# JSON key-value pairs to associate with the asset. Create the custom metadata
|
|
352
|
-
# fields before setting these values.
|
|
356
|
+
# fields before setting these values. To preserve the original creation date of an
|
|
357
|
+
# asset migrated from another system, set the reserved
|
|
358
|
+
# `_internal_original_created_datetime` key to an ISO 8601 date string. This key
|
|
359
|
+
# is available once the original creation date setting is enabled in the media
|
|
360
|
+
# library settings.
|
|
353
361
|
custom_metadata: nil,
|
|
354
362
|
# Optional text to describe the contents of the file.
|
|
355
363
|
description: nil,
|
|
@@ -41,8 +41,21 @@ module Imagekitio
|
|
|
41
41
|
sig { params(description: String).void }
|
|
42
42
|
attr_writer :description
|
|
43
43
|
|
|
44
|
-
# Present and set to `true` when the field is reserved.
|
|
45
|
-
#
|
|
44
|
+
# Present and set to `true` when the field is reserved, i.e. created and managed
|
|
45
|
+
# by ImageKit rather than by you. Omitted for regular fields.
|
|
46
|
+
#
|
|
47
|
+
# Currently the only reserved field is `_internal_original_created_datetime`
|
|
48
|
+
# (label "Original creation date", type `Date`). ImageKit creates it when you
|
|
49
|
+
# enable the original creation date setting under the Custom Metadata tab of the
|
|
50
|
+
# media library settings in the dashboard. Use it to preserve the original
|
|
51
|
+
# creation date of assets migrated from another system: set its value through the
|
|
52
|
+
# `customMetadata` object in the upload or update file details API, then sort with
|
|
53
|
+
# `ASC_ORIGINAL_CREATION_DATE` or `DESC_ORIGINAL_CREATION_DATE` in the list and
|
|
54
|
+
# search assets API, or filter with
|
|
55
|
+
# `"customMetadata._internal_original_created_datetime"` in `searchQuery`.
|
|
56
|
+
#
|
|
57
|
+
# Reserved fields cannot be deleted, and their name cannot be reused when creating
|
|
58
|
+
# a new field.
|
|
46
59
|
sig { returns(T.nilable(T::Boolean)) }
|
|
47
60
|
attr_reader :reserved
|
|
48
61
|
|
|
@@ -76,8 +89,21 @@ module Imagekitio
|
|
|
76
89
|
# description has been set. Shown as a hint to the users while setting the field's
|
|
77
90
|
# value on an asset in the media library UI.
|
|
78
91
|
description: nil,
|
|
79
|
-
# Present and set to `true` when the field is reserved.
|
|
80
|
-
#
|
|
92
|
+
# Present and set to `true` when the field is reserved, i.e. created and managed
|
|
93
|
+
# by ImageKit rather than by you. Omitted for regular fields.
|
|
94
|
+
#
|
|
95
|
+
# Currently the only reserved field is `_internal_original_created_datetime`
|
|
96
|
+
# (label "Original creation date", type `Date`). ImageKit creates it when you
|
|
97
|
+
# enable the original creation date setting under the Custom Metadata tab of the
|
|
98
|
+
# media library settings in the dashboard. Use it to preserve the original
|
|
99
|
+
# creation date of assets migrated from another system: set its value through the
|
|
100
|
+
# `customMetadata` object in the upload or update file details API, then sort with
|
|
101
|
+
# `ASC_ORIGINAL_CREATION_DATE` or `DESC_ORIGINAL_CREATION_DATE` in the list and
|
|
102
|
+
# search assets API, or filter with
|
|
103
|
+
# `"customMetadata._internal_original_created_datetime"` in `searchQuery`.
|
|
104
|
+
#
|
|
105
|
+
# Reserved fields cannot be deleted, and their name cannot be reused when creating
|
|
106
|
+
# a new field.
|
|
81
107
|
reserved: nil
|
|
82
108
|
)
|
|
83
109
|
end
|
|
@@ -23,6 +23,10 @@ module Imagekitio
|
|
|
23
23
|
|
|
24
24
|
# API name of the custom metadata field. This should be unique across all
|
|
25
25
|
# (including deleted) custom metadata fields.
|
|
26
|
+
#
|
|
27
|
+
# `_internal_original_created_datetime` is a reserved name and cannot be used.
|
|
28
|
+
# ImageKit creates that field automatically when you enable the original creation
|
|
29
|
+
# date setting in the media library settings.
|
|
26
30
|
sig { returns(String) }
|
|
27
31
|
attr_accessor :name
|
|
28
32
|
|
|
@@ -62,6 +66,10 @@ module Imagekitio
|
|
|
62
66
|
label:,
|
|
63
67
|
# API name of the custom metadata field. This should be unique across all
|
|
64
68
|
# (including deleted) custom metadata fields.
|
|
69
|
+
#
|
|
70
|
+
# `_internal_original_created_datetime` is a reserved name and cannot be used.
|
|
71
|
+
# ImageKit creates that field automatically when you enable the original creation
|
|
72
|
+
# date setting in the media library settings.
|
|
65
73
|
name:,
|
|
66
74
|
schema:,
|
|
67
75
|
# Optional description for the custom metadata field. Can be up to 500 characters.
|
|
@@ -70,7 +70,11 @@ module Imagekitio
|
|
|
70
70
|
attr_writer :custom_coordinates
|
|
71
71
|
|
|
72
72
|
# JSON key-value pairs to associate with the asset. Create the custom metadata
|
|
73
|
-
# fields before setting these values.
|
|
73
|
+
# fields before setting these values. To preserve the original creation date of an
|
|
74
|
+
# asset migrated from another system, set the reserved
|
|
75
|
+
# `_internal_original_created_datetime` key to an ISO 8601 date string. This key
|
|
76
|
+
# is available once the original creation date setting is enabled in the media
|
|
77
|
+
# library settings.
|
|
74
78
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
75
79
|
attr_reader :custom_metadata
|
|
76
80
|
|
|
@@ -371,7 +375,11 @@ module Imagekitio
|
|
|
371
375
|
# customCoordinates will be removed.
|
|
372
376
|
custom_coordinates: nil,
|
|
373
377
|
# JSON key-value pairs to associate with the asset. Create the custom metadata
|
|
374
|
-
# fields before setting these values.
|
|
378
|
+
# fields before setting these values. To preserve the original creation date of an
|
|
379
|
+
# asset migrated from another system, set the reserved
|
|
380
|
+
# `_internal_original_created_datetime` key to an ISO 8601 date string. This key
|
|
381
|
+
# is available once the original creation date setting is enabled in the media
|
|
382
|
+
# library settings.
|
|
375
383
|
custom_metadata: nil,
|
|
376
384
|
# Optional text to describe the contents of the file.
|
|
377
385
|
description: nil,
|
|
@@ -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
|