userplex 0.11.0 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1ff9fa78fe9bab439ced86e294ad900179c8ca864d53b5042ebda75261e45bf
4
- data.tar.gz: d715f5b46e3494c94d9c4abcc729eb8e0a2a640a98ad6e34bcfd5dce11e34607
3
+ metadata.gz: b4474fb917ace6a7ed179789609bd66064fdc3ba4992f9028e68643f0916f5c8
4
+ data.tar.gz: 6fdb6217c5bd87417eba1e118f9754c5de54623589c375fdf6fd7e61331d01cb
5
5
  SHA512:
6
- metadata.gz: 451247a5b266118ea1f67826480633c7c549d47151681d840adeebb9d29b177b527a7a91cfceeefa8493b7da996f823cf407d89c77fd38ab91c5cf6cf2d15c2e
7
- data.tar.gz: 64f49652f7cb2217d3256da89643ab3419409f01c21c87304ad8a47d286478fb68e64d29ff565e3e262aadeda16f3cfa52205b53660caa08a15c330833f4e3c7
6
+ metadata.gz: 6b1817878f54c458f555308942cd10a0041c21fcc01e35817587fdb44ad7d45470079eb2de2d1235078c83b812f338db72b3cbbc9d4ab1837666d9e56c814ee9
7
+ data.tar.gz: 2f622ad91b6030415e19632295c23cfc76f49d7202502e183c59922804eeb90591c81ba76c903d9bc421adc3f436ef2100a66a90fd1ca4f872f9d17962e1ba96
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.0 (2026-01-05)
4
+
5
+ Full Changelog: [v0.12.0...v0.13.0](https://github.com/dqnamo/userplex-ruby/compare/v0.12.0...v0.13.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([4e1dbe9](https://github.com/dqnamo/userplex-ruby/commit/4e1dbe93fc8479e90240f09d7ceddd850c053efa))
10
+
11
+ ## 0.12.0 (2026-01-05)
12
+
13
+ Full Changelog: [v0.11.0...v0.12.0](https://github.com/dqnamo/userplex-ruby/compare/v0.11.0...v0.12.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** api update ([364f01a](https://github.com/dqnamo/userplex-ruby/commit/364f01a66b2d7d990281687b5104b1ce796b692d))
18
+
3
19
  ## 0.11.0 (2026-01-05)
4
20
 
5
21
  Full Changelog: [v0.10.0...v0.11.0](https://github.com/dqnamo/userplex-ruby/compare/v0.10.0...v0.11.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.11.0"
18
+ gem "userplex", "~> 0.13.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -26,7 +26,9 @@ gem "userplex", "~> 0.11.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
  )
@@ -8,49 +8,40 @@ module Userplex
8
8
  include Userplex::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute body
11
- # A list of logs to ingest
12
11
  #
13
12
  # @return [Array<Userplex::Models::LogBatchParams::Body>, nil]
14
13
  optional :body, -> { Userplex::Internal::Type::ArrayOf[Userplex::LogBatchParams::Body] }
15
14
 
16
15
  # @!method initialize(body: nil, request_options: {})
17
- # @param body [Array<Userplex::Models::LogBatchParams::Body>] A list of logs to ingest
18
- #
16
+ # @param body [Array<Userplex::Models::LogBatchParams::Body>]
19
17
  # @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}]
20
18
 
21
19
  class Body < Userplex::Internal::Type::BaseModel
22
20
  # @!attribute name
23
- # Log name
24
21
  #
25
22
  # @return [String]
26
23
  required :name, String
27
24
 
28
25
  # @!attribute data
29
- # Additional log data
30
26
  #
31
27
  # @return [Hash{Symbol=>Object, nil}, nil]
32
28
  optional :data, Userplex::Internal::Type::HashOf[Userplex::Internal::Type::Unknown, nil?: true]
33
29
 
34
30
  # @!attribute timestamp
35
- # Log timestamp (ISO 8601)
36
31
  #
37
32
  # @return [Time, nil]
38
33
  optional :timestamp, Time
39
34
 
40
35
  # @!attribute user_id
41
- # External user ID
42
36
  #
43
37
  # @return [String, nil]
44
38
  optional :user_id, String
45
39
 
46
40
  # @!method initialize(name:, data: nil, timestamp: nil, user_id: nil)
47
- # @param name [String] Log name
48
- #
49
- # @param data [Hash{Symbol=>Object, nil}] Additional log data
50
- #
51
- # @param timestamp [Time] Log timestamp (ISO 8601)
52
- #
53
- # @param user_id [String] External user ID
41
+ # @param name [String]
42
+ # @param data [Hash{Symbol=>Object, nil}]
43
+ # @param timestamp [Time]
44
+ # @param user_id [String]
54
45
  end
55
46
  end
56
47
  end
@@ -8,38 +8,30 @@ module Userplex
8
8
  include Userplex::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute name
11
- # Log name
12
11
  #
13
12
  # @return [String]
14
13
  required :name, String
15
14
 
16
15
  # @!attribute data
17
- # Additional log data
18
16
  #
19
17
  # @return [Hash{Symbol=>Object, nil}, nil]
20
18
  optional :data, Userplex::Internal::Type::HashOf[Userplex::Internal::Type::Unknown, nil?: true]
21
19
 
22
20
  # @!attribute timestamp
23
- # Log timestamp (ISO 8601)
24
21
  #
25
22
  # @return [Time, nil]
26
23
  optional :timestamp, Time
27
24
 
28
25
  # @!attribute user_id
29
- # External user ID
30
26
  #
31
27
  # @return [String, nil]
32
28
  optional :user_id, String
33
29
 
34
30
  # @!method initialize(name:, data: nil, timestamp: nil, user_id: nil, request_options: {})
35
- # @param name [String] Log name
36
- #
37
- # @param data [Hash{Symbol=>Object, nil}] Additional log data
38
- #
39
- # @param timestamp [Time] Log timestamp (ISO 8601)
40
- #
41
- # @param user_id [String] External user ID
42
- #
31
+ # @param name [String]
32
+ # @param data [Hash{Symbol=>Object, nil}]
33
+ # @param timestamp [Time]
34
+ # @param user_id [String]
43
35
  # @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}]
44
36
  end
45
37
  end
@@ -8,38 +8,30 @@ module Userplex
8
8
  include Userplex::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute user_id
11
- # External user ID
12
11
  #
13
12
  # @return [String]
14
13
  required :user_id, String
15
14
 
16
15
  # @!attribute attributes
17
- # Additional user attributes
18
16
  #
19
17
  # @return [Hash{Symbol=>Object, nil}, nil]
20
18
  optional :attributes, Userplex::Internal::Type::HashOf[Userplex::Internal::Type::Unknown, nil?: true]
21
19
 
22
20
  # @!attribute email
23
- # User email
24
21
  #
25
22
  # @return [String, nil]
26
23
  optional :email, String
27
24
 
28
25
  # @!attribute name
29
- # User name
30
26
  #
31
27
  # @return [String, nil]
32
28
  optional :name, String
33
29
 
34
30
  # @!method initialize(user_id:, attributes: nil, email: nil, name: nil, request_options: {})
35
- # @param user_id [String] External user ID
36
- #
37
- # @param attributes [Hash{Symbol=>Object, nil}] Additional user attributes
38
- #
39
- # @param email [String] User email
40
- #
41
- # @param name [String] User name
42
- #
31
+ # @param user_id [String]
32
+ # @param attributes [Hash{Symbol=>Object, nil}]
33
+ # @param email [String]
34
+ # @param name [String]
43
35
  # @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}]
44
36
  end
45
37
  end
@@ -3,10 +3,11 @@
3
3
  module Userplex
4
4
  module Resources
5
5
  class Logs
6
- # @overload batch(body: nil, request_options: {})
6
+ # Log multiple events
7
7
  #
8
- # @param body [Array<Userplex::Models::LogBatchParams::Body>] A list of logs to ingest
8
+ # @overload batch(body: nil, request_options: {})
9
9
  #
10
+ # @param body [Array<Userplex::Models::LogBatchParams::Body>]
10
11
  # @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}, nil]
11
12
  #
12
13
  # @return [Userplex::Models::LogBatchResponse]
@@ -23,16 +24,14 @@ module Userplex
23
24
  )
24
25
  end
25
26
 
26
- # @overload new(name:, data: nil, timestamp: nil, user_id: nil, request_options: {})
27
- #
28
- # @param name [String] Log name
27
+ # Log a single event
29
28
  #
30
- # @param data [Hash{Symbol=>Object, nil}] Additional log data
31
- #
32
- # @param timestamp [Time] Log timestamp (ISO 8601)
33
- #
34
- # @param user_id [String] External user ID
29
+ # @overload new(name:, data: nil, timestamp: nil, user_id: nil, request_options: {})
35
30
  #
31
+ # @param name [String]
32
+ # @param data [Hash{Symbol=>Object, nil}]
33
+ # @param timestamp [Time]
34
+ # @param user_id [String]
36
35
  # @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}, nil]
37
36
  #
38
37
  # @return [Userplex::Models::LogNewResponse]
@@ -3,16 +3,14 @@
3
3
  module Userplex
4
4
  module Resources
5
5
  class Users
6
- # @overload identify(user_id:, attributes: nil, email: nil, name: nil, request_options: {})
7
- #
8
- # @param user_id [String] External user ID
9
- #
10
- # @param attributes [Hash{Symbol=>Object, nil}] Additional user attributes
6
+ # Identify a user
11
7
  #
12
- # @param email [String] User email
13
- #
14
- # @param name [String] User name
8
+ # @overload identify(user_id:, attributes: nil, email: nil, name: nil, request_options: {})
15
9
  #
10
+ # @param user_id [String]
11
+ # @param attributes [Hash{Symbol=>Object, nil}]
12
+ # @param email [String]
13
+ # @param name [String]
16
14
  # @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}, nil]
17
15
  #
18
16
  # @return [Userplex::Models::UserIdentifyResponse]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Userplex
4
- VERSION = "0.11.0"
4
+ VERSION = "0.13.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
@@ -11,7 +11,6 @@ module Userplex
11
11
  T.any(Userplex::LogBatchParams, Userplex::Internal::AnyHash)
12
12
  end
13
13
 
14
- # A list of logs to ingest
15
14
  sig { returns(T.nilable(T::Array[Userplex::LogBatchParams::Body])) }
16
15
  attr_reader :body
17
16
 
@@ -26,11 +25,7 @@ module Userplex
26
25
  request_options: Userplex::RequestOptions::OrHash
27
26
  ).returns(T.attached_class)
28
27
  end
29
- def self.new(
30
- # A list of logs to ingest
31
- body: nil,
32
- request_options: {}
33
- )
28
+ def self.new(body: nil, request_options: {})
34
29
  end
35
30
 
36
31
  sig do
@@ -50,25 +45,21 @@ module Userplex
50
45
  T.any(Userplex::LogBatchParams::Body, Userplex::Internal::AnyHash)
51
46
  end
52
47
 
53
- # Log name
54
48
  sig { returns(String) }
55
49
  attr_accessor :name
56
50
 
57
- # Additional log data
58
51
  sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
59
52
  attr_reader :data
60
53
 
61
54
  sig { params(data: T::Hash[Symbol, T.nilable(T.anything)]).void }
62
55
  attr_writer :data
63
56
 
64
- # Log timestamp (ISO 8601)
65
57
  sig { returns(T.nilable(Time)) }
66
58
  attr_reader :timestamp
67
59
 
68
60
  sig { params(timestamp: Time).void }
69
61
  attr_writer :timestamp
70
62
 
71
- # External user ID
72
63
  sig { returns(T.nilable(String)) }
73
64
  attr_reader :user_id
74
65
 
@@ -83,16 +74,7 @@ module Userplex
83
74
  user_id: String
84
75
  ).returns(T.attached_class)
85
76
  end
86
- def self.new(
87
- # Log name
88
- name:,
89
- # Additional log data
90
- data: nil,
91
- # Log timestamp (ISO 8601)
92
- timestamp: nil,
93
- # External user ID
94
- user_id: nil
95
- )
77
+ def self.new(name:, data: nil, timestamp: nil, user_id: nil)
96
78
  end
97
79
 
98
80
  sig do
@@ -11,25 +11,21 @@ module Userplex
11
11
  T.any(Userplex::LogNewParams, Userplex::Internal::AnyHash)
12
12
  end
13
13
 
14
- # Log name
15
14
  sig { returns(String) }
16
15
  attr_accessor :name
17
16
 
18
- # Additional log data
19
17
  sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
20
18
  attr_reader :data
21
19
 
22
20
  sig { params(data: T::Hash[Symbol, T.nilable(T.anything)]).void }
23
21
  attr_writer :data
24
22
 
25
- # Log timestamp (ISO 8601)
26
23
  sig { returns(T.nilable(Time)) }
27
24
  attr_reader :timestamp
28
25
 
29
26
  sig { params(timestamp: Time).void }
30
27
  attr_writer :timestamp
31
28
 
32
- # External user ID
33
29
  sig { returns(T.nilable(String)) }
34
30
  attr_reader :user_id
35
31
 
@@ -46,13 +42,9 @@ module Userplex
46
42
  ).returns(T.attached_class)
47
43
  end
48
44
  def self.new(
49
- # Log name
50
45
  name:,
51
- # Additional log data
52
46
  data: nil,
53
- # Log timestamp (ISO 8601)
54
47
  timestamp: nil,
55
- # External user ID
56
48
  user_id: nil,
57
49
  request_options: {}
58
50
  )
@@ -11,25 +11,21 @@ module Userplex
11
11
  T.any(Userplex::UserIdentifyParams, Userplex::Internal::AnyHash)
12
12
  end
13
13
 
14
- # External user ID
15
14
  sig { returns(String) }
16
15
  attr_accessor :user_id
17
16
 
18
- # Additional user attributes
19
17
  sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
20
18
  attr_reader :attributes
21
19
 
22
20
  sig { params(attributes: T::Hash[Symbol, T.nilable(T.anything)]).void }
23
21
  attr_writer :attributes
24
22
 
25
- # User email
26
23
  sig { returns(T.nilable(String)) }
27
24
  attr_reader :email
28
25
 
29
26
  sig { params(email: String).void }
30
27
  attr_writer :email
31
28
 
32
- # User name
33
29
  sig { returns(T.nilable(String)) }
34
30
  attr_reader :name
35
31
 
@@ -46,13 +42,9 @@ module Userplex
46
42
  ).returns(T.attached_class)
47
43
  end
48
44
  def self.new(
49
- # External user ID
50
45
  user_id:,
51
- # Additional user attributes
52
46
  attributes: nil,
53
- # User email
54
47
  email: nil,
55
- # User name
56
48
  name: nil,
57
49
  request_options: {}
58
50
  )
@@ -3,19 +3,17 @@
3
3
  module Userplex
4
4
  module Resources
5
5
  class Logs
6
+ # Log multiple events
6
7
  sig do
7
8
  params(
8
9
  body: T::Array[Userplex::LogBatchParams::Body::OrHash],
9
10
  request_options: Userplex::RequestOptions::OrHash
10
11
  ).returns(Userplex::Models::LogBatchResponse)
11
12
  end
12
- def batch(
13
- # A list of logs to ingest
14
- body: nil,
15
- request_options: {}
16
- )
13
+ def batch(body: nil, request_options: {})
17
14
  end
18
15
 
16
+ # Log a single event
19
17
  sig do
20
18
  params(
21
19
  name: String,
@@ -26,13 +24,9 @@ module Userplex
26
24
  ).returns(Userplex::Models::LogNewResponse)
27
25
  end
28
26
  def new(
29
- # Log name
30
27
  name:,
31
- # Additional log data
32
28
  data: nil,
33
- # Log timestamp (ISO 8601)
34
29
  timestamp: nil,
35
- # External user ID
36
30
  user_id: nil,
37
31
  request_options: {}
38
32
  )
@@ -3,6 +3,7 @@
3
3
  module Userplex
4
4
  module Resources
5
5
  class Users
6
+ # Identify a user
6
7
  sig do
7
8
  params(
8
9
  user_id: String,
@@ -13,13 +14,9 @@ module Userplex
13
14
  ).returns(Userplex::Models::UserIdentifyResponse)
14
15
  end
15
16
  def identify(
16
- # External user ID
17
17
  user_id:,
18
- # Additional user attributes
19
18
  attributes: nil,
20
- # User email
21
19
  email: nil,
22
- # User name
23
20
  name: nil,
24
21
  request_options: {}
25
22
  )
@@ -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.11.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Userplex