Skip to content

Commit f9bee87

Browse files
feat(api): manual updates
1 parent 2f5a40a commit f9bee87

File tree

7 files changed

+39
-39
lines changed

7 files changed

+39
-39
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml
33
openapi_spec_hash: 1d382866fce3284f26d341f112988d9d
4-
config_hash: 54c05a157f2cc730fac9e1df5dc3ca29
4+
config_hash: 29a2351fe2be89392b15719be8bc964f

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require "bundler/setup"
2929
require "imagekit"
3030

3131
image_kit = Imagekit::Client.new(
32-
private_api_key: ENV["IMAGEKIT_PRIVATE_API_KEY"], # This is the default and can be omitted
32+
private_key: ENV["IMAGEKIT_PRIVATE_API_KEY"], # This is the default and can be omitted
3333
password: ENV["OPTIONAL_IMAGEKIT_IGNORES_THIS"] # This is the default and can be omitted
3434
)
3535

lib/imagekit/client.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class Client < Imagekit::Internal::Transport::BaseClient
1919
# manage API keys in the
2020
# [dashboard](https://imagekit.io/dashboard/developer/api-keys).
2121
# @return [String]
22-
attr_reader :private_api_key
22+
attr_reader :private_key
2323

24-
# ImageKit Basic Auth only uses the username field and ignores the password. This
25-
# field is unused.
24+
# ImageKit Basic Auth only uses the `private_key` as username and ignores the
25+
# password.
2626
# @return [String, nil]
2727
attr_reader :password
2828

@@ -54,9 +54,9 @@ class Client < Imagekit::Internal::Transport::BaseClient
5454
#
5555
# @return [Hash{String=>String}]
5656
private def auth_headers
57-
return {} if @private_api_key.nil? || @password.nil?
57+
return {} if @private_key.nil? || @password.nil?
5858

59-
base64_credentials = ["#{@private_api_key}:#{@password}"].pack("m0")
59+
base64_credentials = ["#{@private_key}:#{@password}"].pack("m0")
6060
{"authorization" => "Basic #{base64_credentials}"}
6161
end
6262

@@ -67,13 +67,13 @@ def base_url_overridden? = @base_url_overridden
6767

6868
# Creates and returns a new client for interacting with the API.
6969
#
70-
# @param private_api_key [String, nil] Your ImageKit private API key (it starts with `private_`). You can view and
70+
# @param private_key [String, nil] Your ImageKit private API key (it starts with `private_`). You can view and
7171
# manage API keys in the
7272
# [dashboard](https://imagekit.io/dashboard/developer/api-keys). Defaults to
7373
# `ENV["IMAGEKIT_PRIVATE_API_KEY"]`
7474
#
75-
# @param password [String, nil] ImageKit Basic Auth only uses the username field and ignores the password. This
76-
# field is unused. Defaults to `ENV["OPTIONAL_IMAGEKIT_IGNORES_THIS"]`
75+
# @param password [String, nil] ImageKit Basic Auth only uses the `private_key` as username and ignores the
76+
# password. Defaults to `ENV["OPTIONAL_IMAGEKIT_IGNORES_THIS"]`
7777
#
7878
# @param base_url [String, nil] Override the default base URL for the API, e.g.,
7979
# `"https://api.example.com/v2/"`. Defaults to `ENV["IMAGE_KIT_BASE_URL"]`
@@ -86,7 +86,7 @@ def base_url_overridden? = @base_url_overridden
8686
#
8787
# @param max_retry_delay [Float]
8888
def initialize(
89-
private_api_key: ENV["IMAGEKIT_PRIVATE_API_KEY"],
89+
private_key: ENV["IMAGEKIT_PRIVATE_API_KEY"],
9090
password: ENV.fetch("OPTIONAL_IMAGEKIT_IGNORES_THIS", "do_not_set"),
9191
base_url: ENV["IMAGE_KIT_BASE_URL"],
9292
max_retries: self.class::DEFAULT_MAX_RETRIES,
@@ -98,11 +98,11 @@ def initialize(
9898

9999
base_url ||= "https://api.imagekit.io"
100100

101-
if private_api_key.nil?
102-
raise ArgumentError.new("private_api_key is required, and can be set via environ: \"IMAGEKIT_PRIVATE_API_KEY\"")
101+
if private_key.nil?
102+
raise ArgumentError.new("private_key is required, and can be set via environ: \"IMAGEKIT_PRIVATE_API_KEY\"")
103103
end
104104

105-
@private_api_key = private_api_key.to_s
105+
@private_key = private_key.to_s
106106
@password = password.to_s
107107

108108
super(

rbi/imagekit/client.rbi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ module Imagekit
1414
# manage API keys in the
1515
# [dashboard](https://imagekit.io/dashboard/developer/api-keys).
1616
sig { returns(String) }
17-
attr_reader :private_api_key
17+
attr_reader :private_key
1818

19-
# ImageKit Basic Auth only uses the username field and ignores the password. This
20-
# field is unused.
19+
# ImageKit Basic Auth only uses the `private_key` as username and ignores the
20+
# password.
2121
sig { returns(T.nilable(String)) }
2222
attr_reader :password
2323

@@ -58,7 +58,7 @@ module Imagekit
5858
# Creates and returns a new client for interacting with the API.
5959
sig do
6060
params(
61-
private_api_key: T.nilable(String),
61+
private_key: T.nilable(String),
6262
password: T.nilable(String),
6363
base_url: T.nilable(String),
6464
max_retries: Integer,
@@ -72,9 +72,9 @@ module Imagekit
7272
# manage API keys in the
7373
# [dashboard](https://imagekit.io/dashboard/developer/api-keys). Defaults to
7474
# `ENV["IMAGEKIT_PRIVATE_API_KEY"]`
75-
private_api_key: ENV["IMAGEKIT_PRIVATE_API_KEY"],
76-
# ImageKit Basic Auth only uses the username field and ignores the password. This
77-
# field is unused. Defaults to `ENV["OPTIONAL_IMAGEKIT_IGNORES_THIS"]`
75+
private_key: ENV["IMAGEKIT_PRIVATE_API_KEY"],
76+
# ImageKit Basic Auth only uses the `private_key` as username and ignores the
77+
# password. Defaults to `ENV["OPTIONAL_IMAGEKIT_IGNORES_THIS"]`
7878
password: ENV.fetch("OPTIONAL_IMAGEKIT_IGNORES_THIS", "do_not_set"),
7979
# Override the default base URL for the API, e.g.,
8080
# `"https://api.example.com/v2/"`. Defaults to `ENV["IMAGE_KIT_BASE_URL"]`

sig/imagekit/client.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Imagekit
88

99
DEFAULT_MAX_RETRY_DELAY: Float
1010

11-
attr_reader private_api_key: String
11+
attr_reader private_key: String
1212

1313
attr_reader password: String?
1414

@@ -33,7 +33,7 @@ module Imagekit
3333
def base_url_overridden?: -> bool
3434

3535
def initialize: (
36-
?private_api_key: String?,
36+
?private_key: String?,
3737
?password: String?,
3838
?base_url: String?,
3939
?max_retries: Integer,

test/imagekit/client_test.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_client_default_request_default_retry_attempts
4040
image_kit =
4141
Imagekit::Client.new(
4242
base_url: "http://localhost",
43-
private_api_key: "My Private API Key",
43+
private_key: "My Private Key",
4444
password: "My Password"
4545
)
4646

@@ -57,7 +57,7 @@ def test_client_given_request_default_retry_attempts
5757
image_kit =
5858
Imagekit::Client.new(
5959
base_url: "http://localhost",
60-
private_api_key: "My Private API Key",
60+
private_key: "My Private Key",
6161
password: "My Password",
6262
max_retries: 3
6363
)
@@ -75,7 +75,7 @@ def test_client_default_request_given_retry_attempts
7575
image_kit =
7676
Imagekit::Client.new(
7777
base_url: "http://localhost",
78-
private_api_key: "My Private API Key",
78+
private_key: "My Private Key",
7979
password: "My Password"
8080
)
8181

@@ -96,7 +96,7 @@ def test_client_given_request_given_retry_attempts
9696
image_kit =
9797
Imagekit::Client.new(
9898
base_url: "http://localhost",
99-
private_api_key: "My Private API Key",
99+
private_key: "My Private Key",
100100
password: "My Password",
101101
max_retries: 3
102102
)
@@ -122,7 +122,7 @@ def test_client_retry_after_seconds
122122
image_kit =
123123
Imagekit::Client.new(
124124
base_url: "http://localhost",
125-
private_api_key: "My Private API Key",
125+
private_key: "My Private Key",
126126
password: "My Password",
127127
max_retries: 1
128128
)
@@ -145,7 +145,7 @@ def test_client_retry_after_date
145145
image_kit =
146146
Imagekit::Client.new(
147147
base_url: "http://localhost",
148-
private_api_key: "My Private API Key",
148+
private_key: "My Private Key",
149149
password: "My Password",
150150
max_retries: 1
151151
)
@@ -170,7 +170,7 @@ def test_client_retry_after_ms
170170
image_kit =
171171
Imagekit::Client.new(
172172
base_url: "http://localhost",
173-
private_api_key: "My Private API Key",
173+
private_key: "My Private Key",
174174
password: "My Password",
175175
max_retries: 1
176176
)
@@ -189,7 +189,7 @@ def test_retry_count_header
189189
image_kit =
190190
Imagekit::Client.new(
191191
base_url: "http://localhost",
192-
private_api_key: "My Private API Key",
192+
private_key: "My Private Key",
193193
password: "My Password"
194194
)
195195

@@ -208,7 +208,7 @@ def test_omit_retry_count_header
208208
image_kit =
209209
Imagekit::Client.new(
210210
base_url: "http://localhost",
211-
private_api_key: "My Private API Key",
211+
private_key: "My Private Key",
212212
password: "My Password"
213213
)
214214

@@ -231,7 +231,7 @@ def test_overwrite_retry_count_header
231231
image_kit =
232232
Imagekit::Client.new(
233233
base_url: "http://localhost",
234-
private_api_key: "My Private API Key",
234+
private_key: "My Private Key",
235235
password: "My Password"
236236
)
237237

@@ -260,7 +260,7 @@ def test_client_redirect_307
260260
image_kit =
261261
Imagekit::Client.new(
262262
base_url: "http://localhost",
263-
private_api_key: "My Private API Key",
263+
private_key: "My Private Key",
264264
password: "My Password"
265265
)
266266

@@ -298,7 +298,7 @@ def test_client_redirect_303
298298
image_kit =
299299
Imagekit::Client.new(
300300
base_url: "http://localhost",
301-
private_api_key: "My Private API Key",
301+
private_key: "My Private Key",
302302
password: "My Password"
303303
)
304304

@@ -331,7 +331,7 @@ def test_client_redirect_auth_keep_same_origin
331331
image_kit =
332332
Imagekit::Client.new(
333333
base_url: "http://localhost",
334-
private_api_key: "My Private API Key",
334+
private_key: "My Private Key",
335335
password: "My Password"
336336
)
337337

@@ -367,7 +367,7 @@ def test_client_redirect_auth_strip_cross_origin
367367
image_kit =
368368
Imagekit::Client.new(
369369
base_url: "http://localhost",
370-
private_api_key: "My Private API Key",
370+
private_key: "My Private Key",
371371
password: "My Password"
372372
)
373373

@@ -391,7 +391,7 @@ def test_default_headers
391391
image_kit =
392392
Imagekit::Client.new(
393393
base_url: "http://localhost",
394-
private_api_key: "My Private API Key",
394+
private_key: "My Private Key",
395395
password: "My Password"
396396
)
397397

test/imagekit/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Imagekit::Test::SingletonClient < Imagekit::Client
5050
def initialize
5151
super(
5252
base_url: Imagekit::Test::SingletonClient::TEST_API_BASE_URL,
53-
private_api_key: "My Private API Key",
53+
private_key: "My Private Key",
5454
password: "My Password"
5555
)
5656
end

0 commit comments

Comments
 (0)