userplex 0.9.0 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccc461e8d1af92a26c98de1c70db8c715b417e06938ed86cb8f8fb1a44b7b5ad
4
- data.tar.gz: 3bce0ceaddbc3900107fc0241c341ab7d5dcfeb6eb1c32973452bfaac1e4ef88
3
+ metadata.gz: e502616a2af232f8ae57aed98a20b63cbb2692c63d605b767daa98c405ae1f79
4
+ data.tar.gz: 4f0c7af74f7ef8360334bab9b3f95b080017fc54ed8bcf048aec0f9713f55b57
5
5
  SHA512:
6
- metadata.gz: fe33e8b3d4f264cf611171829a4f46b898d73b074e0fdc0279fd48c195436b7ae5f48b029a8c7230e776431a3d26e336dd3fd6d73883cdd7028fe885d7e5d799
7
- data.tar.gz: e56c69c304b83299744f3466795320332173db9fabc07b7dcc98f6d4570361da4010a3013f544456186110a4d061638f32bd1e3537ecab0ad5b49ee5b9e36832
6
+ metadata.gz: 4f81a8ae1df9d5dc2dbacdd9b4fedb8f92d452c5dd51dfd6b573d7e130ef084876a66b33831a9687a0b95434fbb9bee627aa988a5b70fb462cae15b8e17197ef
7
+ data.tar.gz: 9a231d973f6c51f82982fc6daf5c82c30a7eb9609c543f454c9358e41953b904f050a1d28ade6285f125eaaed8708ea3e9bdd55fb53b1c98e2dc03db5d8b62c0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0 (2025-12-23)
4
+
5
+ Full Changelog: [v0.9.0...v0.10.0](https://github.com/dqnamo/userplex-ruby/compare/v0.9.0...v0.10.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([8469f14](https://github.com/dqnamo/userplex-ruby/commit/8469f14d559a6c989951efbf344740ba46b2018b))
10
+
3
11
  ## 0.9.0 (2025-12-23)
4
12
 
5
13
  Full Changelog: [v0.8.0...v0.9.0](https://github.com/dqnamo/userplex-ruby/compare/v0.8.0...v0.9.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "userplex", "~> 0.9.0"
18
+ gem "userplex", "~> 0.10.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -26,7 +26,9 @@ gem "userplex", "~> 0.9.0"
26
26
  require "bundler/setup"
27
27
  require "userplex"
28
28
 
29
- userplex = Userplex::Client.new(api_key: "My API Key")
29
+ userplex = Userplex::Client.new(
30
+ api_key: ENV["USERPLEX_API_KEY"] # This is the default and can be omitted
31
+ )
30
32
 
31
33
  response = userplex.logs.new(name: "REPLACE_ME")
32
34
 
@@ -78,8 +80,7 @@ You can use the `max_retries` option to configure or disable this:
78
80
  ```ruby
79
81
  # Configure the default for all requests:
80
82
  userplex = Userplex::Client.new(
81
- max_retries: 0, # default is 2
82
- api_key: "My API Key"
83
+ max_retries: 0 # default is 2
83
84
  )
84
85
 
85
86
  # Or, configure per-request:
@@ -93,8 +94,7 @@ By default, requests will time out after 60 seconds. You can use the timeout opt
93
94
  ```ruby
94
95
  # Configure the default for all requests:
95
96
  userplex = Userplex::Client.new(
96
- timeout: nil, # default is 60
97
- api_key: "My API Key"
97
+ timeout: nil # default is 60
98
98
  )
99
99
 
100
100
  # Or, configure per-request:
@@ -25,6 +25,15 @@ module Userplex
25
25
  # @return [Userplex::Resources::Logs]
26
26
  attr_reader :logs
27
27
 
28
+ # @api private
29
+ #
30
+ # @return [Hash{String=>String}]
31
+ private def auth_headers
32
+ return {} if @api_key.nil?
33
+
34
+ {"authorization" => "Bearer #{@api_key}"}
35
+ end
36
+
28
37
  # Creates and returns a new client for interacting with the API.
29
38
  #
30
39
  # @param api_key [String, nil] Enter your API key from your project settings Defaults to
@@ -215,6 +215,11 @@ module Userplex
215
215
  @max_retry_delay = max_retry_delay
216
216
  end
217
217
 
218
+ # @api private
219
+ #
220
+ # @return [Hash{String=>String}]
221
+ private def auth_headers = {}
222
+
218
223
  # @api private
219
224
  #
220
225
  # @return [String]
@@ -271,6 +276,7 @@ module Userplex
271
276
 
272
277
  headers = Userplex::Internal::Util.normalized_headers(
273
278
  @headers,
279
+ auth_headers,
274
280
  req[:headers].to_h,
275
281
  opts[:extra_headers].to_h
276
282
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Userplex
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  end
@@ -20,6 +20,11 @@ module Userplex
20
20
  sig { returns(Userplex::Resources::Logs) }
21
21
  attr_reader :logs
22
22
 
23
+ # @api private
24
+ sig { override.returns(T::Hash[String, String]) }
25
+ private def auth_headers
26
+ end
27
+
23
28
  # Creates and returns a new client for interacting with the API.
24
29
  sig do
25
30
  params(
@@ -171,6 +171,11 @@ module Userplex
171
171
  )
172
172
  end
173
173
 
174
+ # @api private
175
+ sig { overridable.returns(T::Hash[String, String]) }
176
+ private def auth_headers
177
+ end
178
+
174
179
  # @api private
175
180
  sig { returns(String) }
176
181
  private def user_agent
@@ -14,6 +14,8 @@ module Userplex
14
14
 
15
15
  attr_reader logs: Userplex::Resources::Logs
16
16
 
17
+ private def auth_headers: -> ::Hash[String, String]
18
+
17
19
  def initialize: (
18
20
  ?api_key: String?,
19
21
  ?base_url: String?,
@@ -85,6 +85,8 @@ module Userplex
85
85
  ?idempotency_header: String?
86
86
  ) -> void
87
87
 
88
+ private def auth_headers: -> ::Hash[String, String]
89
+
88
90
  private def user_agent: -> String
89
91
 
90
92
  private def generate_idempotency_key: -> String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: userplex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Userplex