imagekitio 4.7.0 → 4.9.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 +2 -2
- data/lib/imagekitio/client.rb +4 -0
- data/lib/imagekitio/internal/transport/base_client.rb +4 -1
- data/lib/imagekitio/models/accounts/request_bandwidth_entry.rb +26 -0
- data/lib/imagekitio/models/accounts/usage_analytics_get_params.rb +39 -0
- data/lib/imagekitio/models/accounts/usage_analytics_response.rb +1044 -0
- data/lib/imagekitio/models/custom_metadata_field.rb +11 -1
- data/lib/imagekitio/models/custom_metadata_field_create_params.rb +11 -1
- data/lib/imagekitio/models/custom_metadata_field_update_params.rb +12 -1
- data/lib/imagekitio/models/named_transformation.rb +60 -0
- data/lib/imagekitio/models/named_transformation_create_params.rb +45 -0
- data/lib/imagekitio/models/named_transformation_delete_params.rb +22 -0
- data/lib/imagekitio/models/named_transformation_get_params.rb +22 -0
- data/lib/imagekitio/models/named_transformation_list_params.rb +14 -0
- data/lib/imagekitio/models/named_transformation_list_response.rb +9 -0
- data/lib/imagekitio/models/named_transformation_update_params.rb +53 -0
- data/lib/imagekitio/models.rb +12 -0
- data/lib/imagekitio/resources/accounts/usage.rb +6 -0
- data/lib/imagekitio/resources/accounts/usage_analytics.rb +55 -0
- data/lib/imagekitio/resources/accounts.rb +4 -0
- data/lib/imagekitio/resources/custom_metadata_fields.rb +8 -3
- data/lib/imagekitio/resources/named_transformations.rb +151 -0
- data/lib/imagekitio/version.rb +1 -1
- data/lib/imagekitio.rb +12 -0
- data/rbi/imagekitio/client.rbi +3 -0
- data/rbi/imagekitio/models/accounts/request_bandwidth_entry.rbi +44 -0
- data/rbi/imagekitio/models/accounts/usage_analytics_get_params.rbi +64 -0
- data/rbi/imagekitio/models/accounts/usage_analytics_response.rbi +2097 -0
- data/rbi/imagekitio/models/custom_metadata_field.rbi +18 -3
- data/rbi/imagekitio/models/custom_metadata_field_create_params.rbi +15 -0
- data/rbi/imagekitio/models/custom_metadata_field_update_params.rbi +17 -0
- data/rbi/imagekitio/models/named_transformation.rbi +81 -0
- data/rbi/imagekitio/models/named_transformation_create_params.rbi +73 -0
- data/rbi/imagekitio/models/named_transformation_delete_params.rbi +43 -0
- data/rbi/imagekitio/models/named_transformation_get_params.rbi +43 -0
- data/rbi/imagekitio/models/named_transformation_list_params.rbi +30 -0
- data/rbi/imagekitio/models/named_transformation_list_response.rbi +11 -0
- data/rbi/imagekitio/models/named_transformation_update_params.rbi +87 -0
- data/rbi/imagekitio/models.rbi +17 -0
- data/rbi/imagekitio/resources/accounts/usage.rbi +6 -0
- data/rbi/imagekitio/resources/accounts/usage_analytics.rbi +46 -0
- data/rbi/imagekitio/resources/accounts.rbi +3 -0
- data/rbi/imagekitio/resources/custom_metadata_fields.rbi +13 -1
- data/rbi/imagekitio/resources/named_transformations.rbi +119 -0
- data/sig/imagekitio/client.rbs +2 -0
- data/sig/imagekitio/models/accounts/request_bandwidth_entry.rbs +18 -0
- data/sig/imagekitio/models/accounts/usage_analytics_get_params.rbs +30 -0
- data/sig/imagekitio/models/accounts/usage_analytics_response.rbs +785 -0
- data/sig/imagekitio/models/custom_metadata_field.rbs +10 -3
- data/sig/imagekitio/models/custom_metadata_field_create_params.rbs +8 -1
- data/sig/imagekitio/models/custom_metadata_field_update_params.rbs +7 -0
- data/sig/imagekitio/models/named_transformation.rbs +40 -0
- data/sig/imagekitio/models/named_transformation_create_params.rbs +34 -0
- data/sig/imagekitio/models/named_transformation_delete_params.rbs +23 -0
- data/sig/imagekitio/models/named_transformation_get_params.rbs +23 -0
- data/sig/imagekitio/models/named_transformation_list_params.rbs +15 -0
- data/sig/imagekitio/models/named_transformation_list_response.rbs +8 -0
- data/sig/imagekitio/models/named_transformation_update_params.rbs +42 -0
- data/sig/imagekitio/models.rbs +12 -0
- data/sig/imagekitio/resources/accounts/usage_analytics.rbs +15 -0
- data/sig/imagekitio/resources/accounts.rbs +2 -0
- data/sig/imagekitio/resources/custom_metadata_fields.rbs +2 -0
- data/sig/imagekitio/resources/named_transformations.rbs +33 -0
- metadata +38 -2
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Resources
|
|
5
|
+
class NamedTransformations
|
|
6
|
+
# Creates a new named transformation and returns the created object.
|
|
7
|
+
#
|
|
8
|
+
# A named transformation is a short, reusable name for a transformation string.
|
|
9
|
+
# Use it in image and video URLs as `tr:n-<name>`, and update the underlying
|
|
10
|
+
# transformation later without changing existing URLs. Learn more about
|
|
11
|
+
# [named transformations](https://imagekit.io/docs/transformations#named-transformations).
|
|
12
|
+
#
|
|
13
|
+
# You can create up to 250 named transformations per account.
|
|
14
|
+
sig do
|
|
15
|
+
params(
|
|
16
|
+
name: String,
|
|
17
|
+
transformation: String,
|
|
18
|
+
enabled: T::Boolean,
|
|
19
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
20
|
+
).returns(Imagekitio::NamedTransformation)
|
|
21
|
+
end
|
|
22
|
+
def create(
|
|
23
|
+
# Alias for the transformation string, used in URLs as `tr:n-<name>`. This is
|
|
24
|
+
# case-sensitive, contains only alphanumeric characters or `_` (underscore), and
|
|
25
|
+
# is unique across all named transformations for your account.
|
|
26
|
+
name:,
|
|
27
|
+
# The transformation string this named transformation refers to. Learn more about
|
|
28
|
+
# the [transformation string syntax](https://imagekit.io/docs/transformations).
|
|
29
|
+
transformation:,
|
|
30
|
+
# Whether the named transformation is currently enabled. When set to `false`,
|
|
31
|
+
# requests using this named transformation fail at delivery time.
|
|
32
|
+
enabled: nil,
|
|
33
|
+
request_options: {}
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Updates the named transformation identified by `id` and returns the updated
|
|
38
|
+
# object. Only the fields present in the request body are updated; other fields
|
|
39
|
+
# stay unchanged.
|
|
40
|
+
#
|
|
41
|
+
# Renaming or disabling a named transformation fails with a `409` error if it is
|
|
42
|
+
# still referenced (via the `n-<name>` token) by an upload pre-transformation or
|
|
43
|
+
# post-transformation setting. This check is best-effort and can't detect
|
|
44
|
+
# references in your own application code or in previously generated URLs.
|
|
45
|
+
sig do
|
|
46
|
+
params(
|
|
47
|
+
id: String,
|
|
48
|
+
enabled: T::Boolean,
|
|
49
|
+
name: String,
|
|
50
|
+
transformation: String,
|
|
51
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
52
|
+
).returns(Imagekitio::NamedTransformation)
|
|
53
|
+
end
|
|
54
|
+
def update(
|
|
55
|
+
# Unique identifier for a named transformation.
|
|
56
|
+
id,
|
|
57
|
+
# Whether the named transformation is enabled. Omit to leave the current value
|
|
58
|
+
# unchanged.
|
|
59
|
+
enabled: nil,
|
|
60
|
+
# Alias for the transformation string, used in URLs as `tr:n-<name>`. This is
|
|
61
|
+
# case-sensitive, contains only alphanumeric characters or `_` (underscore), and
|
|
62
|
+
# is unique across all named transformations for your account.
|
|
63
|
+
name: nil,
|
|
64
|
+
# The transformation string this named transformation refers to. Learn more about
|
|
65
|
+
# the [transformation string syntax](https://imagekit.io/docs/transformations).
|
|
66
|
+
transformation: nil,
|
|
67
|
+
request_options: {}
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns an array of all named transformations configured for your account.
|
|
72
|
+
sig do
|
|
73
|
+
params(request_options: Imagekitio::RequestOptions::OrHash).returns(
|
|
74
|
+
T::Array[Imagekitio::NamedTransformation]
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
def list(request_options: {})
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Permanently deletes the named transformation identified by `id`.
|
|
81
|
+
#
|
|
82
|
+
# Deletion fails with a `409` error if the named transformation is still
|
|
83
|
+
# referenced (via the `n-<name>` token) by an upload pre-transformation or
|
|
84
|
+
# post-transformation setting. This check is best-effort and can't detect
|
|
85
|
+
# references in your own application code or in previously generated URLs.
|
|
86
|
+
sig do
|
|
87
|
+
params(
|
|
88
|
+
id: String,
|
|
89
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
90
|
+
).void
|
|
91
|
+
end
|
|
92
|
+
def delete(
|
|
93
|
+
# Unique identifier for a named transformation.
|
|
94
|
+
id,
|
|
95
|
+
request_options: {}
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Retrieves the named transformation identified by `id`.
|
|
100
|
+
sig do
|
|
101
|
+
params(
|
|
102
|
+
id: String,
|
|
103
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
104
|
+
).returns(Imagekitio::NamedTransformation)
|
|
105
|
+
end
|
|
106
|
+
def get(
|
|
107
|
+
# Unique identifier for a named transformation.
|
|
108
|
+
id,
|
|
109
|
+
request_options: {}
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# @api private
|
|
114
|
+
sig { params(client: Imagekitio::Client).returns(T.attached_class) }
|
|
115
|
+
def self.new(client:)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
data/sig/imagekitio/client.rbs
CHANGED
|
@@ -20,6 +20,8 @@ module Imagekitio
|
|
|
20
20
|
|
|
21
21
|
attr_reader saved_extensions: Imagekitio::Resources::SavedExtensions
|
|
22
22
|
|
|
23
|
+
attr_reader named_transformations: Imagekitio::Resources::NamedTransformations
|
|
24
|
+
|
|
23
25
|
attr_reader assets: Imagekitio::Resources::Assets
|
|
24
26
|
|
|
25
27
|
attr_reader cache: Imagekitio::Resources::Cache
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module Imagekitio
|
|
2
|
+
module Models
|
|
3
|
+
module Accounts
|
|
4
|
+
type request_bandwidth_entry =
|
|
5
|
+
{ bandwidth_bytes: Float, request_count: Float }
|
|
6
|
+
|
|
7
|
+
class RequestBandwidthEntry < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
attr_accessor bandwidth_bytes: Float
|
|
9
|
+
|
|
10
|
+
attr_accessor request_count: Float
|
|
11
|
+
|
|
12
|
+
def initialize: (bandwidth_bytes: Float, request_count: Float) -> void
|
|
13
|
+
|
|
14
|
+
def to_hash: -> { bandwidth_bytes: Float, request_count: Float }
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module Imagekitio
|
|
2
|
+
module Models
|
|
3
|
+
module Accounts
|
|
4
|
+
type usage_analytics_get_params =
|
|
5
|
+
{ end_date: Date, start_date: Date }
|
|
6
|
+
& Imagekitio::Internal::Type::request_parameters
|
|
7
|
+
|
|
8
|
+
class UsageAnalyticsGetParams < Imagekitio::Internal::Type::BaseModel
|
|
9
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
10
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
11
|
+
|
|
12
|
+
attr_accessor end_date: Date
|
|
13
|
+
|
|
14
|
+
attr_accessor start_date: Date
|
|
15
|
+
|
|
16
|
+
def initialize: (
|
|
17
|
+
end_date: Date,
|
|
18
|
+
start_date: Date,
|
|
19
|
+
?request_options: Imagekitio::request_opts
|
|
20
|
+
) -> void
|
|
21
|
+
|
|
22
|
+
def to_hash: -> {
|
|
23
|
+
end_date: Date,
|
|
24
|
+
start_date: Date,
|
|
25
|
+
request_options: Imagekitio::RequestOptions
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|