userplex 0.4.0 → 0.5.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: 765c1873eeacaf34a97e425f74774ec55ecc2e359ea5796f7425099cc06f5bb3
4
- data.tar.gz: 4185d106d6180c41fcfa61e6317e2e9a06392147d8271f399ccb0da0a4c2d36e
3
+ metadata.gz: 7ee0aca7256c78b7a28f7c4412e04b9e6b85b348c8f3a8daf339542a1af438e0
4
+ data.tar.gz: 0be918b8e525d4a469f7a63a9e65d25b099a4c9e2bdfaeba0cb6d1ab655d6d24
5
5
  SHA512:
6
- metadata.gz: a8c74f8721c5033df8737f30a147d86b02801c39fcb1e0ede11ddd5622a246ef0a4f93e848a0557089ea956acfd6badc7d67fec7ece83e639099f598fd6c6567
7
- data.tar.gz: 6c350002c4da00c768fc4f3bcc21e18268a47f70cc7a707a8a6ad7281f57d5c0d6c1875aa87ed31e16ec3419d46068cf13991a578e1a2303b03a905518d4e497
6
+ metadata.gz: c57bb3276dd125585396354370449d33cd4b9197823e8a2ff767fc44d22ce077385e413dbc13f404f9045fb29fe2da8b6113426e7de504f2528e71c55604dd3d
7
+ data.tar.gz: 5e8bf1a3a79a56f6cc4cf93d15e401857d2a5a889f4b8a6b7a405848cfe4fd92ef1ccfde685eef6934817ebbf094e8f68943111fc6253bd9de8ba9b027225729
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 (2025-12-13)
4
+
5
+ Full Changelog: [v0.4.0...v0.5.0](https://github.com/dqnamo/userplex-ruby/compare/v0.4.0...v0.5.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([b33db1c](https://github.com/dqnamo/userplex-ruby/commit/b33db1c4c76aa53c7970c48a7d151fb7195cf764))
10
+
3
11
  ## 0.4.0 (2025-12-13)
4
12
 
5
13
  Full Changelog: [v0.3.0...v0.4.0](https://github.com/dqnamo/userplex-ruby/compare/v0.3.0...v0.4.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.4.0"
18
+ gem "userplex", "~> 0.5.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -30,7 +30,7 @@ userplex = Userplex::Client.new(
30
30
  api_key: ENV["USERPLEX_API_KEY"] # This is the default and can be omitted
31
31
  )
32
32
 
33
- response = userplex.users.identify(email: "REPLACE_ME", name: "REPLACE_ME", user_id: "REPLACE_ME")
33
+ response = userplex.users.identify(user_id: "user_id", email: "REPLACE_ME", name: "REPLACE_ME")
34
34
 
35
35
  puts(response.success)
36
36
  ```
@@ -41,7 +41,7 @@ When the library is unable to connect to the API, or if the API returns a non-su
41
41
 
42
42
  ```ruby
43
43
  begin
44
- user = userplex.users.identify(email: "REPLACE_ME", name: "REPLACE_ME", user_id: "REPLACE_ME")
44
+ user = userplex.users.identify(user_id: "user_id", email: "REPLACE_ME", name: "REPLACE_ME")
45
45
  rescue Userplex::Errors::APIConnectionError => e
46
46
  puts("The server could not be reached")
47
47
  puts(e.cause) # an underlying Exception, likely raised within `net/http`
@@ -85,9 +85,9 @@ userplex = Userplex::Client.new(
85
85
 
86
86
  # Or, configure per-request:
87
87
  userplex.users.identify(
88
+ user_id: "user_id",
88
89
  email: "REPLACE_ME",
89
90
  name: "REPLACE_ME",
90
- user_id: "REPLACE_ME",
91
91
  request_options: {max_retries: 5}
92
92
  )
93
93
  ```
@@ -104,9 +104,9 @@ userplex = Userplex::Client.new(
104
104
 
105
105
  # Or, configure per-request:
106
106
  userplex.users.identify(
107
+ user_id: "user_id",
107
108
  email: "REPLACE_ME",
108
109
  name: "REPLACE_ME",
109
- user_id: "REPLACE_ME",
110
110
  request_options: {timeout: 5}
111
111
  )
112
112
  ```
@@ -140,9 +140,9 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
140
140
  ```ruby
141
141
  response =
142
142
  userplex.users.identify(
143
+ user_id: "user_id",
143
144
  email: "REPLACE_ME",
144
145
  name: "REPLACE_ME",
145
- user_id: "REPLACE_ME",
146
146
  request_options: {
147
147
  extra_query: {my_query_parameter: value},
148
148
  extra_body: {my_body_parameter: value},
@@ -188,17 +188,17 @@ This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitio
188
188
  You can provide typesafe request parameters like so:
189
189
 
190
190
  ```ruby
191
- userplex.users.identify(email: "REPLACE_ME", name: "REPLACE_ME", user_id: "REPLACE_ME")
191
+ userplex.users.identify(user_id: "user_id", email: "REPLACE_ME", name: "REPLACE_ME")
192
192
  ```
193
193
 
194
194
  Or, equivalently:
195
195
 
196
196
  ```ruby
197
197
  # Hashes work, but are not typesafe:
198
- userplex.users.identify(email: "REPLACE_ME", name: "REPLACE_ME", user_id: "REPLACE_ME")
198
+ userplex.users.identify(user_id: "user_id", email: "REPLACE_ME", name: "REPLACE_ME")
199
199
 
200
200
  # You can also splat a full Params class:
201
- params = Userplex::UserIdentifyParams.new(email: "REPLACE_ME", name: "REPLACE_ME", user_id: "REPLACE_ME")
201
+ params = Userplex::UserIdentifyParams.new(user_id: "user_id", email: "REPLACE_ME", name: "REPLACE_ME")
202
202
  userplex.users.identify(**params)
203
203
  ```
204
204
 
@@ -7,23 +7,23 @@ module Userplex
7
7
  extend Userplex::Internal::Type::RequestParameters::Converter
8
8
  include Userplex::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute user_id
11
+ # Unique identifier for the user
12
+ #
13
+ # @return [String]
14
+ required :user_id, String
15
+
10
16
  # @!attribute email
11
17
  # User email address
12
18
  #
13
- # @return [String]
14
- required :email, String
19
+ # @return [String, nil]
20
+ optional :email, String
15
21
 
16
22
  # @!attribute name
17
23
  # User full name
18
24
  #
19
- # @return [String]
20
- required :name, String
21
-
22
- # @!attribute user_id
23
- # Unique identifier for the user
24
- #
25
- # @return [String]
26
- required :user_id, String, api_name: :userId
25
+ # @return [String, nil]
26
+ optional :name, String
27
27
 
28
28
  # @!attribute properties
29
29
  # Additional user properties
@@ -31,13 +31,13 @@ module Userplex
31
31
  # @return [Hash{Symbol=>Object, nil}, nil]
32
32
  optional :properties, Userplex::Internal::Type::HashOf[Userplex::Internal::Type::Unknown, nil?: true]
33
33
 
34
- # @!method initialize(email:, name:, user_id:, properties: nil, request_options: {})
34
+ # @!method initialize(user_id:, email: nil, name: nil, properties: nil, request_options: {})
35
+ # @param user_id [String] Unique identifier for the user
36
+ #
35
37
  # @param email [String] User email address
36
38
  #
37
39
  # @param name [String] User full name
38
40
  #
39
- # @param user_id [String] Unique identifier for the user
40
- #
41
41
  # @param properties [Hash{Symbol=>Object, nil}] Additional user properties
42
42
  #
43
43
  # @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}]
@@ -6,14 +6,14 @@ module Userplex
6
6
  # Creates or updates an end user in InstantDB with the provided information.
7
7
  # Requires a valid API key for authentication.
8
8
  #
9
- # @overload identify(email:, name:, user_id:, properties: nil, request_options: {})
9
+ # @overload identify(user_id:, email: nil, name: nil, properties: nil, request_options: {})
10
+ #
11
+ # @param user_id [String] Unique identifier for the user
10
12
  #
11
13
  # @param email [String] User email address
12
14
  #
13
15
  # @param name [String] User full name
14
16
  #
15
- # @param user_id [String] Unique identifier for the user
16
- #
17
17
  # @param properties [Hash{Symbol=>Object, nil}] Additional user properties
18
18
  #
19
19
  # @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Userplex
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -11,17 +11,23 @@ module Userplex
11
11
  T.any(Userplex::UserIdentifyParams, Userplex::Internal::AnyHash)
12
12
  end
13
13
 
14
- # User email address
14
+ # Unique identifier for the user
15
15
  sig { returns(String) }
16
- attr_accessor :email
16
+ attr_accessor :user_id
17
+
18
+ # User email address
19
+ sig { returns(T.nilable(String)) }
20
+ attr_reader :email
21
+
22
+ sig { params(email: String).void }
23
+ attr_writer :email
17
24
 
18
25
  # User full name
19
- sig { returns(String) }
20
- attr_accessor :name
26
+ sig { returns(T.nilable(String)) }
27
+ attr_reader :name
21
28
 
22
- # Unique identifier for the user
23
- sig { returns(String) }
24
- attr_accessor :user_id
29
+ sig { params(name: String).void }
30
+ attr_writer :name
25
31
 
26
32
  # Additional user properties
27
33
  sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
@@ -32,20 +38,20 @@ module Userplex
32
38
 
33
39
  sig do
34
40
  params(
41
+ user_id: String,
35
42
  email: String,
36
43
  name: String,
37
- user_id: String,
38
44
  properties: T::Hash[Symbol, T.nilable(T.anything)],
39
45
  request_options: Userplex::RequestOptions::OrHash
40
46
  ).returns(T.attached_class)
41
47
  end
42
48
  def self.new(
43
- # User email address
44
- email:,
45
- # User full name
46
- name:,
47
49
  # Unique identifier for the user
48
50
  user_id:,
51
+ # User email address
52
+ email: nil,
53
+ # User full name
54
+ name: nil,
49
55
  # Additional user properties
50
56
  properties: nil,
51
57
  request_options: {}
@@ -55,9 +61,9 @@ module Userplex
55
61
  sig do
56
62
  override.returns(
57
63
  {
64
+ user_id: String,
58
65
  email: String,
59
66
  name: String,
60
- user_id: String,
61
67
  properties: T::Hash[Symbol, T.nilable(T.anything)],
62
68
  request_options: Userplex::RequestOptions
63
69
  }
@@ -7,20 +7,20 @@ module Userplex
7
7
  # Requires a valid API key for authentication.
8
8
  sig do
9
9
  params(
10
+ user_id: String,
10
11
  email: String,
11
12
  name: String,
12
- user_id: String,
13
13
  properties: T::Hash[Symbol, T.nilable(T.anything)],
14
14
  request_options: Userplex::RequestOptions::OrHash
15
15
  ).returns(Userplex::Models::UserIdentifyResponse)
16
16
  end
17
17
  def identify(
18
- # User email address
19
- email:,
20
- # User full name
21
- name:,
22
18
  # Unique identifier for the user
23
19
  user_id:,
20
+ # User email address
21
+ email: nil,
22
+ # User full name
23
+ name: nil,
24
24
  # Additional user properties
25
25
  properties: nil,
26
26
  request_options: {}
@@ -2,9 +2,9 @@ module Userplex
2
2
  module Models
3
3
  type user_identify_params =
4
4
  {
5
+ user_id: String,
5
6
  email: String,
6
7
  name: String,
7
- user_id: String,
8
8
  properties: ::Hash[Symbol, top?]
9
9
  }
10
10
  & Userplex::Internal::Type::request_parameters
@@ -13,28 +13,32 @@ module Userplex
13
13
  extend Userplex::Internal::Type::RequestParameters::Converter
14
14
  include Userplex::Internal::Type::RequestParameters
15
15
 
16
- attr_accessor email: String
16
+ attr_accessor user_id: String
17
17
 
18
- attr_accessor name: String
18
+ attr_reader email: String?
19
19
 
20
- attr_accessor user_id: String
20
+ def email=: (String) -> String
21
+
22
+ attr_reader name: String?
23
+
24
+ def name=: (String) -> String
21
25
 
22
26
  attr_reader properties: ::Hash[Symbol, top?]?
23
27
 
24
28
  def properties=: (::Hash[Symbol, top?]) -> ::Hash[Symbol, top?]
25
29
 
26
30
  def initialize: (
27
- email: String,
28
- name: String,
29
31
  user_id: String,
32
+ ?email: String,
33
+ ?name: String,
30
34
  ?properties: ::Hash[Symbol, top?],
31
35
  ?request_options: Userplex::request_opts
32
36
  ) -> void
33
37
 
34
38
  def to_hash: -> {
39
+ user_id: String,
35
40
  email: String,
36
41
  name: String,
37
- user_id: String,
38
42
  properties: ::Hash[Symbol, top?],
39
43
  request_options: Userplex::RequestOptions
40
44
  }
@@ -2,9 +2,9 @@ module Userplex
2
2
  module Resources
3
3
  class Users
4
4
  def identify: (
5
- email: String,
6
- name: String,
7
5
  user_id: String,
6
+ ?email: String,
7
+ ?name: String,
8
8
  ?properties: ::Hash[Symbol, top?],
9
9
  ?request_options: Userplex::request_opts
10
10
  ) -> Userplex::Models::UserIdentifyResponse
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.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Userplex