userplex 0.4.0 → 0.6.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 +16 -0
- data/README.md +9 -9
- data/lib/userplex/client.rb +1 -1
- data/lib/userplex/models/user_identify_params.rb +13 -13
- data/lib/userplex/resources/users.rb +3 -3
- data/lib/userplex/version.rb +1 -1
- data/rbi/userplex/models/user_identify_params.rbi +19 -13
- data/rbi/userplex/resources/users.rbi +5 -5
- data/sig/userplex/models/user_identify_params.rbs +11 -7
- data/sig/userplex/resources/users.rbs +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d84e7cc96c594d4bc6c2ac390245bf18161980bbaa48147eef3a6b60e5a53290
|
|
4
|
+
data.tar.gz: 8872e64264e661438d509f48e3829980dd2b3ef9629fd9b438694d791fe596c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ebc51eed68f8a441d5f3484da283b382f80c81079623803d9cb7bc4092c1bf859274278a7b51d0947346cb0094b987e2953fb5ee0c44d59240c13d12240e8321
|
|
7
|
+
data.tar.gz: '08924285ad50ca9a4b1b521749a415dc5eeb74ec18d465021f9297411ca90ea1213a870b1884cbc6631d11161565813048b5b8245817b43171229f26c68f1c1f'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.0 (2025-12-13)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.5.0...v0.6.0](https://github.com/dqnamo/userplex-ruby/compare/v0.5.0...v0.6.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([3d15220](https://github.com/dqnamo/userplex-ruby/commit/3d1522099c36bcbaeebd49d5441d4f2deaf4fca6))
|
|
10
|
+
|
|
11
|
+
## 0.5.0 (2025-12-13)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.4.0...v0.5.0](https://github.com/dqnamo/userplex-ruby/compare/v0.4.0...v0.5.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** api update ([b33db1c](https://github.com/dqnamo/userplex-ruby/commit/b33db1c4c76aa53c7970c48a7d151fb7195cf764))
|
|
18
|
+
|
|
3
19
|
## 0.4.0 (2025-12-13)
|
|
4
20
|
|
|
5
21
|
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.
|
|
18
|
+
gem "userplex", "~> 0.6.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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
data/lib/userplex/client.rb
CHANGED
|
@@ -57,7 +57,7 @@ module Userplex
|
|
|
57
57
|
initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY,
|
|
58
58
|
max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY
|
|
59
59
|
)
|
|
60
|
-
base_url ||= "https://userplex.app"
|
|
60
|
+
base_url ||= "https://api.userplex.app"
|
|
61
61
|
|
|
62
62
|
if api_key.nil?
|
|
63
63
|
raise ArgumentError.new("api_key is required, and can be set via environ: \"USERPLEX_API_KEY\"")
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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]
|
data/lib/userplex/version.rb
CHANGED
|
@@ -11,17 +11,23 @@ module Userplex
|
|
|
11
11
|
T.any(Userplex::UserIdentifyParams, Userplex::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
#
|
|
14
|
+
# Unique identifier for the user
|
|
15
15
|
sig { returns(String) }
|
|
16
|
-
attr_accessor :
|
|
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
|
-
|
|
26
|
+
sig { returns(T.nilable(String)) }
|
|
27
|
+
attr_reader :name
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
16
|
+
attr_accessor user_id: String
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
attr_reader email: String?
|
|
19
19
|
|
|
20
|
-
|
|
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
|