imagekitio 4.11.0 → 4.13.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 +22 -0
- data/README.md +28 -1
- data/lib/imagekitio/client.rb +4 -0
- data/lib/imagekitio/helpers/helper.rb +18 -4
- data/lib/imagekitio/helpers/transformation_utils.rb +1 -0
- data/lib/imagekitio/internal/tag_cursor.rb +86 -0
- data/lib/imagekitio/models/accounts/contract_get_params.rb +16 -0
- data/lib/imagekitio/models/accounts/contract_get_response.rb +82 -0
- data/lib/imagekitio/models/accounts/contract_units.rb +42 -0
- data/lib/imagekitio/models/accounts/url_endpoint_request.rb +17 -1
- data/lib/imagekitio/models/accounts/url_endpoint_response.rb +17 -1
- data/lib/imagekitio/models/folder_delete_event.rb +13 -1
- data/lib/imagekitio/models/folder_update_event.rb +30 -3
- data/lib/imagekitio/models/tag.rb +52 -0
- data/lib/imagekitio/models/tag_list_params.rb +143 -0
- data/lib/imagekitio/models/transformation.rb +13 -1
- data/lib/imagekitio/models/unsafe_unwrap_webhook_event.rb +1 -1
- data/lib/imagekitio/models/unwrap_webhook_event.rb +1 -1
- data/lib/imagekitio/models.rb +4 -0
- data/lib/imagekitio/resources/accounts/contract.rb +47 -0
- data/lib/imagekitio/resources/accounts.rb +4 -0
- data/lib/imagekitio/resources/tags.rb +65 -0
- data/lib/imagekitio/version.rb +1 -1
- data/lib/imagekitio.rb +8 -0
- data/rbi/imagekitio/client.rbi +3 -0
- data/rbi/imagekitio/internal/tag_cursor.rbi +22 -0
- data/rbi/imagekitio/models/accounts/contract_get_params.rbi +34 -0
- data/rbi/imagekitio/models/accounts/contract_get_response.rbi +126 -0
- data/rbi/imagekitio/models/accounts/contract_units.rbi +66 -0
- data/rbi/imagekitio/models/accounts/url_endpoint_request.rbi +19 -1
- data/rbi/imagekitio/models/accounts/url_endpoint_response.rbi +19 -1
- data/rbi/imagekitio/models/folder_delete_event.rbi +18 -3
- data/rbi/imagekitio/models/folder_update_event.rbi +50 -3
- data/rbi/imagekitio/models/tag.rbi +71 -0
- data/rbi/imagekitio/models/tag_list_params.rbi +236 -0
- data/rbi/imagekitio/models/transformation.rbi +19 -0
- data/rbi/imagekitio/models.rbi +4 -0
- data/rbi/imagekitio/resources/accounts/contract.rbi +36 -0
- data/rbi/imagekitio/resources/accounts.rbi +3 -0
- data/rbi/imagekitio/resources/tags.rbi +74 -0
- data/sig/imagekitio/client.rbs +2 -0
- data/sig/imagekitio/internal/tag_cursor.rbs +13 -0
- data/sig/imagekitio/models/accounts/contract_get_params.rbs +17 -0
- data/sig/imagekitio/models/accounts/contract_get_response.rbs +73 -0
- data/sig/imagekitio/models/accounts/contract_units.rbs +37 -0
- data/sig/imagekitio/models/accounts/url_endpoint_request.rbs +12 -2
- data/sig/imagekitio/models/accounts/url_endpoint_response.rbs +12 -2
- data/sig/imagekitio/models/folder_delete_event.rbs +7 -3
- data/sig/imagekitio/models/folder_update_event.rbs +25 -2
- data/sig/imagekitio/models/tag.rbs +30 -0
- data/sig/imagekitio/models/tag_list_params.rbs +114 -0
- data/sig/imagekitio/models/transformation.rbs +7 -0
- data/sig/imagekitio/models.rbs +4 -0
- data/sig/imagekitio/resources/accounts/contract.rbs +13 -0
- data/sig/imagekitio/resources/accounts.rbs +2 -0
- data/sig/imagekitio/resources/tags.rbs +18 -0
- metadata +26 -2
|
@@ -138,22 +138,40 @@ module Imagekitio
|
|
|
138
138
|
sig { params(preserve_asset_delivery_types: T::Boolean).void }
|
|
139
139
|
attr_writer :preserve_asset_delivery_types
|
|
140
140
|
|
|
141
|
+
# Whether to always rewrite Cloudinary layers to the improved ImageKit layer
|
|
142
|
+
# specification (`l-image`, `l-text`, ..., `l-end`). When `false` or omitted, the
|
|
143
|
+
# improved specification is used only for transformations that require it.
|
|
144
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
145
|
+
attr_reader :use_improved_layer_spec
|
|
146
|
+
|
|
147
|
+
sig { params(use_improved_layer_spec: T::Boolean).void }
|
|
148
|
+
attr_writer :use_improved_layer_spec
|
|
149
|
+
|
|
141
150
|
sig do
|
|
142
151
|
params(
|
|
143
152
|
preserve_asset_delivery_types: T::Boolean,
|
|
153
|
+
use_improved_layer_spec: T::Boolean,
|
|
144
154
|
type: Symbol
|
|
145
155
|
).returns(T.attached_class)
|
|
146
156
|
end
|
|
147
157
|
def self.new(
|
|
148
158
|
# Whether to preserve `<asset_type>/<delivery_type>` in the rewritten URL.
|
|
149
159
|
preserve_asset_delivery_types: nil,
|
|
160
|
+
# Whether to always rewrite Cloudinary layers to the improved ImageKit layer
|
|
161
|
+
# specification (`l-image`, `l-text`, ..., `l-end`). When `false` or omitted, the
|
|
162
|
+
# improved specification is used only for transformations that require it.
|
|
163
|
+
use_improved_layer_spec: nil,
|
|
150
164
|
type: :CLOUDINARY
|
|
151
165
|
)
|
|
152
166
|
end
|
|
153
167
|
|
|
154
168
|
sig do
|
|
155
169
|
override.returns(
|
|
156
|
-
{
|
|
170
|
+
{
|
|
171
|
+
type: Symbol,
|
|
172
|
+
preserve_asset_delivery_types: T::Boolean,
|
|
173
|
+
use_improved_layer_spec: T::Boolean
|
|
174
|
+
}
|
|
157
175
|
)
|
|
158
176
|
end
|
|
159
177
|
def to_hash
|
|
@@ -133,22 +133,40 @@ module Imagekitio
|
|
|
133
133
|
sig { returns(Symbol) }
|
|
134
134
|
attr_accessor :type
|
|
135
135
|
|
|
136
|
+
# Whether to always rewrite Cloudinary layers to the improved ImageKit layer
|
|
137
|
+
# specification (`l-image`, `l-text`, ..., `l-end`). When `false` or omitted, the
|
|
138
|
+
# improved specification is used only for transformations that require it.
|
|
139
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
140
|
+
attr_reader :use_improved_layer_spec
|
|
141
|
+
|
|
142
|
+
sig { params(use_improved_layer_spec: T::Boolean).void }
|
|
143
|
+
attr_writer :use_improved_layer_spec
|
|
144
|
+
|
|
136
145
|
sig do
|
|
137
146
|
params(
|
|
138
147
|
preserve_asset_delivery_types: T::Boolean,
|
|
148
|
+
use_improved_layer_spec: T::Boolean,
|
|
139
149
|
type: Symbol
|
|
140
150
|
).returns(T.attached_class)
|
|
141
151
|
end
|
|
142
152
|
def self.new(
|
|
143
153
|
# Whether to preserve `<asset_type>/<delivery_type>` in the rewritten URL.
|
|
144
154
|
preserve_asset_delivery_types:,
|
|
155
|
+
# Whether to always rewrite Cloudinary layers to the improved ImageKit layer
|
|
156
|
+
# specification (`l-image`, `l-text`, ..., `l-end`). When `false` or omitted, the
|
|
157
|
+
# improved specification is used only for transformations that require it.
|
|
158
|
+
use_improved_layer_spec: nil,
|
|
145
159
|
type: :CLOUDINARY
|
|
146
160
|
)
|
|
147
161
|
end
|
|
148
162
|
|
|
149
163
|
sig do
|
|
150
164
|
override.returns(
|
|
151
|
-
{
|
|
165
|
+
{
|
|
166
|
+
preserve_asset_delivery_types: T::Boolean,
|
|
167
|
+
type: Symbol,
|
|
168
|
+
use_improved_layer_spec: T::Boolean
|
|
169
|
+
}
|
|
152
170
|
)
|
|
153
171
|
end
|
|
154
172
|
def to_hash
|
|
@@ -67,14 +67,29 @@ module Imagekitio
|
|
|
67
67
|
sig { returns(String) }
|
|
68
68
|
attr_accessor :folder_id
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
# Path of the deleted folder. For a moved folder, this is its path before the
|
|
71
|
+
# move.
|
|
72
|
+
sig { returns(T.nilable(String)) }
|
|
73
|
+
attr_reader :folder_path
|
|
74
|
+
|
|
75
|
+
sig { params(folder_path: String).void }
|
|
76
|
+
attr_writer :folder_path
|
|
77
|
+
|
|
78
|
+
sig do
|
|
79
|
+
params(folder_id: String, folder_path: String).returns(
|
|
80
|
+
T.attached_class
|
|
81
|
+
)
|
|
82
|
+
end
|
|
71
83
|
def self.new(
|
|
72
84
|
# The unique `folderId` of the deleted folder.
|
|
73
|
-
folder_id
|
|
85
|
+
folder_id:,
|
|
86
|
+
# Path of the deleted folder. For a moved folder, this is its path before the
|
|
87
|
+
# move.
|
|
88
|
+
folder_path: nil
|
|
74
89
|
)
|
|
75
90
|
end
|
|
76
91
|
|
|
77
|
-
sig { override.returns({ folder_id: String }) }
|
|
92
|
+
sig { override.returns({ folder_id: String, folder_path: String }) }
|
|
78
93
|
def to_hash
|
|
79
94
|
end
|
|
80
95
|
end
|
|
@@ -22,13 +22,25 @@ module Imagekitio
|
|
|
22
22
|
sig { returns(Symbol) }
|
|
23
23
|
attr_accessor :type
|
|
24
24
|
|
|
25
|
+
# Present only when the folder or one of its parent folders was renamed. Contains
|
|
26
|
+
# the folder's path before the rename.
|
|
27
|
+
sig { returns(T.nilable(Imagekitio::FolderUpdateEvent::Previous)) }
|
|
28
|
+
attr_reader :previous
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(previous: Imagekitio::FolderUpdateEvent::Previous::OrHash).void
|
|
32
|
+
end
|
|
33
|
+
attr_writer :previous
|
|
34
|
+
|
|
25
35
|
# 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
|
|
27
|
-
#
|
|
36
|
+
# or it is renamed. Renaming a folder sends one event per folder in the tree. In
|
|
37
|
+
# each of these events, `data.folderPath` is the folder's new path and
|
|
38
|
+
# `previous.folderPath` is its path before the rename.
|
|
28
39
|
sig do
|
|
29
40
|
params(
|
|
30
41
|
created_at: Time,
|
|
31
42
|
data: Imagekitio::Folder::OrHash,
|
|
43
|
+
previous: Imagekitio::FolderUpdateEvent::Previous::OrHash,
|
|
32
44
|
type: Symbol
|
|
33
45
|
).returns(T.attached_class)
|
|
34
46
|
end
|
|
@@ -36,6 +48,9 @@ module Imagekitio
|
|
|
36
48
|
# Timestamp of when the event occurred in ISO8601 format.
|
|
37
49
|
created_at:,
|
|
38
50
|
data:,
|
|
51
|
+
# Present only when the folder or one of its parent folders was renamed. Contains
|
|
52
|
+
# the folder's path before the rename.
|
|
53
|
+
previous: nil,
|
|
39
54
|
# Type of the webhook event.
|
|
40
55
|
type: :"folder.updated"
|
|
41
56
|
)
|
|
@@ -43,11 +58,43 @@ module Imagekitio
|
|
|
43
58
|
|
|
44
59
|
sig do
|
|
45
60
|
override.returns(
|
|
46
|
-
{
|
|
61
|
+
{
|
|
62
|
+
created_at: Time,
|
|
63
|
+
data: Imagekitio::Folder,
|
|
64
|
+
type: Symbol,
|
|
65
|
+
previous: Imagekitio::FolderUpdateEvent::Previous
|
|
66
|
+
}
|
|
47
67
|
)
|
|
48
68
|
end
|
|
49
69
|
def to_hash
|
|
50
70
|
end
|
|
71
|
+
|
|
72
|
+
class Previous < Imagekitio::Internal::Type::BaseModel
|
|
73
|
+
OrHash =
|
|
74
|
+
T.type_alias do
|
|
75
|
+
T.any(
|
|
76
|
+
Imagekitio::FolderUpdateEvent::Previous,
|
|
77
|
+
Imagekitio::Internal::AnyHash
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Path of the folder before it was renamed.
|
|
82
|
+
sig { returns(String) }
|
|
83
|
+
attr_accessor :folder_path
|
|
84
|
+
|
|
85
|
+
# Present only when the folder or one of its parent folders was renamed. Contains
|
|
86
|
+
# the folder's path before the rename.
|
|
87
|
+
sig { params(folder_path: String).returns(T.attached_class) }
|
|
88
|
+
def self.new(
|
|
89
|
+
# Path of the folder before it was renamed.
|
|
90
|
+
folder_path:
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
sig { override.returns({ folder_path: String }) }
|
|
95
|
+
def to_hash
|
|
96
|
+
end
|
|
97
|
+
end
|
|
51
98
|
end
|
|
52
99
|
end
|
|
53
100
|
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
class Tag < Imagekitio::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Imagekitio::Tag, Imagekitio::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
# The number of assets carrying the tag, counted across both tag sources
|
|
10
|
+
# (user-generated tags and AI-generated tags) and all file types regardless of the
|
|
11
|
+
# request's filters.
|
|
12
|
+
sig { returns(Integer) }
|
|
13
|
+
attr_accessor :asset_count
|
|
14
|
+
|
|
15
|
+
# The tag as it was spelled when it was last applied to any asset. Use it for
|
|
16
|
+
# display.
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :label
|
|
19
|
+
|
|
20
|
+
# When the tag was last applied to an asset matching the `tagSource` and
|
|
21
|
+
# `fileType` filters of the request, in ISO 8601 format.
|
|
22
|
+
sig { returns(Time) }
|
|
23
|
+
attr_accessor :last_used_at
|
|
24
|
+
|
|
25
|
+
# The tag in lowercase. Tags are case-insensitive, so this is the unique key of
|
|
26
|
+
# the tag within your account.
|
|
27
|
+
sig { returns(String) }
|
|
28
|
+
attr_accessor :name
|
|
29
|
+
|
|
30
|
+
# A tag in use in your media library, aggregated case-insensitively across the
|
|
31
|
+
# assets that carry it.
|
|
32
|
+
sig do
|
|
33
|
+
params(
|
|
34
|
+
asset_count: Integer,
|
|
35
|
+
label: String,
|
|
36
|
+
last_used_at: Time,
|
|
37
|
+
name: String
|
|
38
|
+
).returns(T.attached_class)
|
|
39
|
+
end
|
|
40
|
+
def self.new(
|
|
41
|
+
# The number of assets carrying the tag, counted across both tag sources
|
|
42
|
+
# (user-generated tags and AI-generated tags) and all file types regardless of the
|
|
43
|
+
# request's filters.
|
|
44
|
+
asset_count:,
|
|
45
|
+
# The tag as it was spelled when it was last applied to any asset. Use it for
|
|
46
|
+
# display.
|
|
47
|
+
label:,
|
|
48
|
+
# When the tag was last applied to an asset matching the `tagSource` and
|
|
49
|
+
# `fileType` filters of the request, in ISO 8601 format.
|
|
50
|
+
last_used_at:,
|
|
51
|
+
# The tag in lowercase. Tags are case-insensitive, so this is the unique key of
|
|
52
|
+
# the tag within your account.
|
|
53
|
+
name:
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
sig do
|
|
58
|
+
override.returns(
|
|
59
|
+
{
|
|
60
|
+
asset_count: Integer,
|
|
61
|
+
label: String,
|
|
62
|
+
last_used_at: Time,
|
|
63
|
+
name: String
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
def to_hash
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
class TagListParams < Imagekitio::Internal::Type::BaseModel
|
|
6
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Imagekitio::TagListParams, Imagekitio::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The `nextCursor` value from the previous response, to fetch the next page. A
|
|
15
|
+
# cursor is bound to the `tagSource`, `fileType`, `sort`, `search` and `prefix` it
|
|
16
|
+
# was issued with; sending it with different values returns a 400.
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :cursor
|
|
19
|
+
|
|
20
|
+
sig { params(cursor: String).void }
|
|
21
|
+
attr_writer :cursor
|
|
22
|
+
|
|
23
|
+
# Filter tags by the type of asset they are applied to.
|
|
24
|
+
#
|
|
25
|
+
# - `image` — tags in use on images
|
|
26
|
+
# - `video` — tags in use on videos
|
|
27
|
+
# - `static` — tags in use on any other file, such as documents, scripts and
|
|
28
|
+
# stylesheets
|
|
29
|
+
# - `all` — tags in use on any asset
|
|
30
|
+
sig { returns(T.nilable(Imagekitio::TagListParams::FileType::OrSymbol)) }
|
|
31
|
+
attr_reader :file_type
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
params(file_type: Imagekitio::TagListParams::FileType::OrSymbol).void
|
|
35
|
+
end
|
|
36
|
+
attr_writer :file_type
|
|
37
|
+
|
|
38
|
+
# The maximum number of tags to return in response.
|
|
39
|
+
sig { returns(T.nilable(Integer)) }
|
|
40
|
+
attr_reader :limit
|
|
41
|
+
|
|
42
|
+
sig { params(limit: Integer).void }
|
|
43
|
+
attr_writer :limit
|
|
44
|
+
|
|
45
|
+
# Only return tags that begin with this value. Matching is case-insensitive.
|
|
46
|
+
sig { returns(T.nilable(String)) }
|
|
47
|
+
attr_reader :prefix
|
|
48
|
+
|
|
49
|
+
sig { params(prefix: String).void }
|
|
50
|
+
attr_writer :prefix
|
|
51
|
+
|
|
52
|
+
# Only return tags that contain this text. Every word in the value must appear in
|
|
53
|
+
# the tag and the last word may be incomplete, which suits search-as-you-type.
|
|
54
|
+
# Matching is case-insensitive.
|
|
55
|
+
sig { returns(T.nilable(String)) }
|
|
56
|
+
attr_reader :search
|
|
57
|
+
|
|
58
|
+
sig { params(search: String).void }
|
|
59
|
+
attr_writer :search
|
|
60
|
+
|
|
61
|
+
# Sort the results.
|
|
62
|
+
#
|
|
63
|
+
# - `ASC_NAME` / `DESC_NAME` — by `name`
|
|
64
|
+
# - `ASC_LAST_USED` / `DESC_LAST_USED` — by `lastUsedAt` within the requested
|
|
65
|
+
# `tagSource` and `fileType`, ties broken by `name`
|
|
66
|
+
sig { returns(T.nilable(Imagekitio::TagListParams::Sort::OrSymbol)) }
|
|
67
|
+
attr_reader :sort
|
|
68
|
+
|
|
69
|
+
sig { params(sort: Imagekitio::TagListParams::Sort::OrSymbol).void }
|
|
70
|
+
attr_writer :sort
|
|
71
|
+
|
|
72
|
+
# Filter tags by who added them.
|
|
73
|
+
#
|
|
74
|
+
# - `user` — tags added by users through the dashboard or the API
|
|
75
|
+
# - `ai` — tags added by AI auto-tagging extensions
|
|
76
|
+
# - `all` — both
|
|
77
|
+
sig { returns(T.nilable(Imagekitio::TagListParams::TagSource::OrSymbol)) }
|
|
78
|
+
attr_reader :tag_source
|
|
79
|
+
|
|
80
|
+
sig do
|
|
81
|
+
params(tag_source: Imagekitio::TagListParams::TagSource::OrSymbol).void
|
|
82
|
+
end
|
|
83
|
+
attr_writer :tag_source
|
|
84
|
+
|
|
85
|
+
sig do
|
|
86
|
+
params(
|
|
87
|
+
cursor: String,
|
|
88
|
+
file_type: Imagekitio::TagListParams::FileType::OrSymbol,
|
|
89
|
+
limit: Integer,
|
|
90
|
+
prefix: String,
|
|
91
|
+
search: String,
|
|
92
|
+
sort: Imagekitio::TagListParams::Sort::OrSymbol,
|
|
93
|
+
tag_source: Imagekitio::TagListParams::TagSource::OrSymbol,
|
|
94
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
95
|
+
).returns(T.attached_class)
|
|
96
|
+
end
|
|
97
|
+
def self.new(
|
|
98
|
+
# The `nextCursor` value from the previous response, to fetch the next page. A
|
|
99
|
+
# cursor is bound to the `tagSource`, `fileType`, `sort`, `search` and `prefix` it
|
|
100
|
+
# was issued with; sending it with different values returns a 400.
|
|
101
|
+
cursor: nil,
|
|
102
|
+
# Filter tags by the type of asset they are applied to.
|
|
103
|
+
#
|
|
104
|
+
# - `image` — tags in use on images
|
|
105
|
+
# - `video` — tags in use on videos
|
|
106
|
+
# - `static` — tags in use on any other file, such as documents, scripts and
|
|
107
|
+
# stylesheets
|
|
108
|
+
# - `all` — tags in use on any asset
|
|
109
|
+
file_type: nil,
|
|
110
|
+
# The maximum number of tags to return in response.
|
|
111
|
+
limit: nil,
|
|
112
|
+
# Only return tags that begin with this value. Matching is case-insensitive.
|
|
113
|
+
prefix: nil,
|
|
114
|
+
# Only return tags that contain this text. Every word in the value must appear in
|
|
115
|
+
# the tag and the last word may be incomplete, which suits search-as-you-type.
|
|
116
|
+
# Matching is case-insensitive.
|
|
117
|
+
search: nil,
|
|
118
|
+
# Sort the results.
|
|
119
|
+
#
|
|
120
|
+
# - `ASC_NAME` / `DESC_NAME` — by `name`
|
|
121
|
+
# - `ASC_LAST_USED` / `DESC_LAST_USED` — by `lastUsedAt` within the requested
|
|
122
|
+
# `tagSource` and `fileType`, ties broken by `name`
|
|
123
|
+
sort: nil,
|
|
124
|
+
# Filter tags by who added them.
|
|
125
|
+
#
|
|
126
|
+
# - `user` — tags added by users through the dashboard or the API
|
|
127
|
+
# - `ai` — tags added by AI auto-tagging extensions
|
|
128
|
+
# - `all` — both
|
|
129
|
+
tag_source: nil,
|
|
130
|
+
request_options: {}
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
sig do
|
|
135
|
+
override.returns(
|
|
136
|
+
{
|
|
137
|
+
cursor: String,
|
|
138
|
+
file_type: Imagekitio::TagListParams::FileType::OrSymbol,
|
|
139
|
+
limit: Integer,
|
|
140
|
+
prefix: String,
|
|
141
|
+
search: String,
|
|
142
|
+
sort: Imagekitio::TagListParams::Sort::OrSymbol,
|
|
143
|
+
tag_source: Imagekitio::TagListParams::TagSource::OrSymbol,
|
|
144
|
+
request_options: Imagekitio::RequestOptions
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
end
|
|
148
|
+
def to_hash
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Filter tags by the type of asset they are applied to.
|
|
152
|
+
#
|
|
153
|
+
# - `image` — tags in use on images
|
|
154
|
+
# - `video` — tags in use on videos
|
|
155
|
+
# - `static` — tags in use on any other file, such as documents, scripts and
|
|
156
|
+
# stylesheets
|
|
157
|
+
# - `all` — tags in use on any asset
|
|
158
|
+
module FileType
|
|
159
|
+
extend Imagekitio::Internal::Type::Enum
|
|
160
|
+
|
|
161
|
+
TaggedSymbol =
|
|
162
|
+
T.type_alias { T.all(Symbol, Imagekitio::TagListParams::FileType) }
|
|
163
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
164
|
+
|
|
165
|
+
IMAGE = T.let(:image, Imagekitio::TagListParams::FileType::TaggedSymbol)
|
|
166
|
+
VIDEO = T.let(:video, Imagekitio::TagListParams::FileType::TaggedSymbol)
|
|
167
|
+
STATIC =
|
|
168
|
+
T.let(:static, Imagekitio::TagListParams::FileType::TaggedSymbol)
|
|
169
|
+
ALL = T.let(:all, Imagekitio::TagListParams::FileType::TaggedSymbol)
|
|
170
|
+
|
|
171
|
+
sig do
|
|
172
|
+
override.returns(
|
|
173
|
+
T::Array[Imagekitio::TagListParams::FileType::TaggedSymbol]
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
def self.values
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Sort the results.
|
|
181
|
+
#
|
|
182
|
+
# - `ASC_NAME` / `DESC_NAME` — by `name`
|
|
183
|
+
# - `ASC_LAST_USED` / `DESC_LAST_USED` — by `lastUsedAt` within the requested
|
|
184
|
+
# `tagSource` and `fileType`, ties broken by `name`
|
|
185
|
+
module Sort
|
|
186
|
+
extend Imagekitio::Internal::Type::Enum
|
|
187
|
+
|
|
188
|
+
TaggedSymbol =
|
|
189
|
+
T.type_alias { T.all(Symbol, Imagekitio::TagListParams::Sort) }
|
|
190
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
191
|
+
|
|
192
|
+
ASC_NAME =
|
|
193
|
+
T.let(:ASC_NAME, Imagekitio::TagListParams::Sort::TaggedSymbol)
|
|
194
|
+
DESC_NAME =
|
|
195
|
+
T.let(:DESC_NAME, Imagekitio::TagListParams::Sort::TaggedSymbol)
|
|
196
|
+
ASC_LAST_USED =
|
|
197
|
+
T.let(:ASC_LAST_USED, Imagekitio::TagListParams::Sort::TaggedSymbol)
|
|
198
|
+
DESC_LAST_USED =
|
|
199
|
+
T.let(:DESC_LAST_USED, Imagekitio::TagListParams::Sort::TaggedSymbol)
|
|
200
|
+
|
|
201
|
+
sig do
|
|
202
|
+
override.returns(
|
|
203
|
+
T::Array[Imagekitio::TagListParams::Sort::TaggedSymbol]
|
|
204
|
+
)
|
|
205
|
+
end
|
|
206
|
+
def self.values
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Filter tags by who added them.
|
|
211
|
+
#
|
|
212
|
+
# - `user` — tags added by users through the dashboard or the API
|
|
213
|
+
# - `ai` — tags added by AI auto-tagging extensions
|
|
214
|
+
# - `all` — both
|
|
215
|
+
module TagSource
|
|
216
|
+
extend Imagekitio::Internal::Type::Enum
|
|
217
|
+
|
|
218
|
+
TaggedSymbol =
|
|
219
|
+
T.type_alias { T.all(Symbol, Imagekitio::TagListParams::TagSource) }
|
|
220
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
221
|
+
|
|
222
|
+
USER = T.let(:user, Imagekitio::TagListParams::TagSource::TaggedSymbol)
|
|
223
|
+
AI = T.let(:ai, Imagekitio::TagListParams::TagSource::TaggedSymbol)
|
|
224
|
+
ALL = T.let(:all, Imagekitio::TagListParams::TagSource::TaggedSymbol)
|
|
225
|
+
|
|
226
|
+
sig do
|
|
227
|
+
override.returns(
|
|
228
|
+
T::Array[Imagekitio::TagListParams::TagSource::TaggedSymbol]
|
|
229
|
+
)
|
|
230
|
+
end
|
|
231
|
+
def self.values
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
end
|
|
@@ -529,6 +529,17 @@ module Imagekitio
|
|
|
529
529
|
end
|
|
530
530
|
attr_writer :rotation
|
|
531
531
|
|
|
532
|
+
# Adjusts the color saturation of the image. Accepts an integer from -100 to 100.
|
|
533
|
+
# Negative values desaturate (`-100` is fully gray), positive values increase
|
|
534
|
+
# saturation, and `0` leaves the image unchanged. Supported inside image overlays.
|
|
535
|
+
# Not supported for animated images. See
|
|
536
|
+
# [Saturation](https://imagekit.io/docs/effects-and-enhancements#saturation---e-saturation).
|
|
537
|
+
sig { returns(T.nilable(Integer)) }
|
|
538
|
+
attr_reader :saturation
|
|
539
|
+
|
|
540
|
+
sig { params(saturation: Integer).void }
|
|
541
|
+
attr_writer :saturation
|
|
542
|
+
|
|
532
543
|
# Adds a shadow beneath solid objects in an image with a transparent background.
|
|
533
544
|
# For AI-based drop shadows, refer to aiDropShadow. Pass `true` for a default
|
|
534
545
|
# shadow, or provide a string for a custom shadow. See
|
|
@@ -722,6 +733,7 @@ module Imagekitio
|
|
|
722
733
|
radius: T.any(Float, Symbol, String),
|
|
723
734
|
raw: String,
|
|
724
735
|
rotation: Imagekitio::Transformation::Rotation::Variants,
|
|
736
|
+
saturation: Integer,
|
|
725
737
|
shadow: T.any(T::Boolean, String),
|
|
726
738
|
sharpen: T.any(T::Boolean, Float),
|
|
727
739
|
start_offset: Imagekitio::Transformation::StartOffset::Variants,
|
|
@@ -970,6 +982,12 @@ module Imagekitio
|
|
|
970
982
|
# only the following values are supported: 0, 90, 180, 270, or 360. See
|
|
971
983
|
# [Rotate](https://imagekit.io/docs/effects-and-enhancements#rotate---rt).
|
|
972
984
|
rotation: nil,
|
|
985
|
+
# Adjusts the color saturation of the image. Accepts an integer from -100 to 100.
|
|
986
|
+
# Negative values desaturate (`-100` is fully gray), positive values increase
|
|
987
|
+
# saturation, and `0` leaves the image unchanged. Supported inside image overlays.
|
|
988
|
+
# Not supported for animated images. See
|
|
989
|
+
# [Saturation](https://imagekit.io/docs/effects-and-enhancements#saturation---e-saturation).
|
|
990
|
+
saturation: nil,
|
|
973
991
|
# Adds a shadow beneath solid objects in an image with a transparent background.
|
|
974
992
|
# For AI-based drop shadows, refer to aiDropShadow. Pass `true` for a default
|
|
975
993
|
# shadow, or provide a string for a custom shadow. See
|
|
@@ -1073,6 +1091,7 @@ module Imagekitio
|
|
|
1073
1091
|
radius: T.any(Float, Symbol, String),
|
|
1074
1092
|
raw: String,
|
|
1075
1093
|
rotation: Imagekitio::Transformation::Rotation::Variants,
|
|
1094
|
+
saturation: Integer,
|
|
1076
1095
|
shadow: T.any(T::Boolean, String),
|
|
1077
1096
|
sharpen: T.any(T::Boolean, Float),
|
|
1078
1097
|
start_offset: Imagekitio::Transformation::StartOffset::Variants,
|
data/rbi/imagekitio/models.rbi
CHANGED
|
@@ -161,6 +161,10 @@ module Imagekitio
|
|
|
161
161
|
SubtitleOverlayTransformation =
|
|
162
162
|
Imagekitio::Models::SubtitleOverlayTransformation
|
|
163
163
|
|
|
164
|
+
Tag = Imagekitio::Models::Tag
|
|
165
|
+
|
|
166
|
+
TagListParams = Imagekitio::Models::TagListParams
|
|
167
|
+
|
|
164
168
|
TextOverlay = Imagekitio::Models::TextOverlay
|
|
165
169
|
|
|
166
170
|
TextOverlayTransformation = Imagekitio::Models::TextOverlayTransformation
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Resources
|
|
5
|
+
class Accounts
|
|
6
|
+
class Contract
|
|
7
|
+
# Get the account's contract terms and the usage consumed against them in the
|
|
8
|
+
# current contract term. Bandwidth is in bytes; video processing units, extension
|
|
9
|
+
# units and purge cache requests are counts.
|
|
10
|
+
#
|
|
11
|
+
# For an agency account, consumption includes the child accounts billed to it. A
|
|
12
|
+
# child account billed to its parent cannot call this endpoint; call it with the
|
|
13
|
+
# parent account's credentials instead.
|
|
14
|
+
#
|
|
15
|
+
# Contract terms are read live; consumption is refreshed periodically, not on
|
|
16
|
+
# every request. Use `asOf` to check how fresh it is. Contracts of one month or
|
|
17
|
+
# less are reported as `hasContract: false`. The response is cached for 5 minutes
|
|
18
|
+
# per account.
|
|
19
|
+
#
|
|
20
|
+
# Requires an API key with account management access.
|
|
21
|
+
sig do
|
|
22
|
+
params(request_options: Imagekitio::RequestOptions::OrHash).returns(
|
|
23
|
+
Imagekitio::Models::Accounts::ContractGetResponse
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
def get(request_options: {})
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# @api private
|
|
30
|
+
sig { params(client: Imagekitio::Client).returns(T.attached_class) }
|
|
31
|
+
def self.new(client:)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -9,6 +9,9 @@ module Imagekitio
|
|
|
9
9
|
sig { returns(Imagekitio::Resources::Accounts::UsageAnalytics) }
|
|
10
10
|
attr_reader :usage_analytics
|
|
11
11
|
|
|
12
|
+
sig { returns(Imagekitio::Resources::Accounts::Contract) }
|
|
13
|
+
attr_reader :contract
|
|
14
|
+
|
|
12
15
|
sig { returns(Imagekitio::Resources::Accounts::Origins) }
|
|
13
16
|
attr_reader :origins
|
|
14
17
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Resources
|
|
5
|
+
class Tags
|
|
6
|
+
# This API lists the distinct tags in use across your media library, with the
|
|
7
|
+
# number of assets each tag is applied to and when it was last used. Tags are
|
|
8
|
+
# matched case-insensitively, so `Summer` and `summer` are one entry: `name` is
|
|
9
|
+
# the lowercased form and `label` is the spelling that was used most recently.
|
|
10
|
+
#
|
|
11
|
+
# Use `tagSource` and `fileType` to list only the tags in use on matching assets.
|
|
12
|
+
# `lastUsedAt` and the `ASC_LAST_USED` / `DESC_LAST_USED` sorts follow those
|
|
13
|
+
# filters, while `assetCount` always counts every asset carrying the tag. Use
|
|
14
|
+
# `search` or `prefix` to narrow the listing and `cursor` to page through it.
|
|
15
|
+
#
|
|
16
|
+
# Tag counts are updated asynchronously. Changes to a file's tags usually appear
|
|
17
|
+
# in this list within about a minute, but can take longer during heavy tagging
|
|
18
|
+
# activity, so a tag you just added or removed may not be reflected immediately.
|
|
19
|
+
sig do
|
|
20
|
+
params(
|
|
21
|
+
cursor: String,
|
|
22
|
+
file_type: Imagekitio::TagListParams::FileType::OrSymbol,
|
|
23
|
+
limit: Integer,
|
|
24
|
+
prefix: String,
|
|
25
|
+
search: String,
|
|
26
|
+
sort: Imagekitio::TagListParams::Sort::OrSymbol,
|
|
27
|
+
tag_source: Imagekitio::TagListParams::TagSource::OrSymbol,
|
|
28
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
29
|
+
).returns(Imagekitio::Internal::TagCursor[Imagekitio::Tag])
|
|
30
|
+
end
|
|
31
|
+
def list(
|
|
32
|
+
# The `nextCursor` value from the previous response, to fetch the next page. A
|
|
33
|
+
# cursor is bound to the `tagSource`, `fileType`, `sort`, `search` and `prefix` it
|
|
34
|
+
# was issued with; sending it with different values returns a 400.
|
|
35
|
+
cursor: nil,
|
|
36
|
+
# Filter tags by the type of asset they are applied to.
|
|
37
|
+
#
|
|
38
|
+
# - `image` — tags in use on images
|
|
39
|
+
# - `video` — tags in use on videos
|
|
40
|
+
# - `static` — tags in use on any other file, such as documents, scripts and
|
|
41
|
+
# stylesheets
|
|
42
|
+
# - `all` — tags in use on any asset
|
|
43
|
+
file_type: nil,
|
|
44
|
+
# The maximum number of tags to return in response.
|
|
45
|
+
limit: nil,
|
|
46
|
+
# Only return tags that begin with this value. Matching is case-insensitive.
|
|
47
|
+
prefix: nil,
|
|
48
|
+
# Only return tags that contain this text. Every word in the value must appear in
|
|
49
|
+
# the tag and the last word may be incomplete, which suits search-as-you-type.
|
|
50
|
+
# Matching is case-insensitive.
|
|
51
|
+
search: nil,
|
|
52
|
+
# Sort the results.
|
|
53
|
+
#
|
|
54
|
+
# - `ASC_NAME` / `DESC_NAME` — by `name`
|
|
55
|
+
# - `ASC_LAST_USED` / `DESC_LAST_USED` — by `lastUsedAt` within the requested
|
|
56
|
+
# `tagSource` and `fileType`, ties broken by `name`
|
|
57
|
+
sort: nil,
|
|
58
|
+
# Filter tags by who added them.
|
|
59
|
+
#
|
|
60
|
+
# - `user` — tags added by users through the dashboard or the API
|
|
61
|
+
# - `ai` — tags added by AI auto-tagging extensions
|
|
62
|
+
# - `all` — both
|
|
63
|
+
tag_source: nil,
|
|
64
|
+
request_options: {}
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# @api private
|
|
69
|
+
sig { params(client: Imagekitio::Client).returns(T.attached_class) }
|
|
70
|
+
def self.new(client:)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|