userplex 0.13.0 → 0.15.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 +10 -11
- data/lib/userplex/client.rb +4 -4
- data/lib/userplex/internal/type/base_model.rb +2 -2
- data/lib/userplex/models/{log_new_params.rb → event_capture_params.rb} +2 -2
- data/lib/userplex/models/{log_batch_response.rb → event_capture_response.rb} +2 -2
- data/lib/userplex/models.rb +1 -3
- data/lib/userplex/resources/events.rb +38 -0
- data/lib/userplex/version.rb +1 -1
- data/lib/userplex.rb +3 -5
- data/rbi/userplex/client.rbi +3 -3
- data/rbi/userplex/models/{log_new_params.rbi → event_capture_params.rbi} +2 -2
- data/rbi/userplex/models/{log_batch_response.rbi → event_capture_response.rbi} +5 -2
- data/rbi/userplex/models.rbi +1 -3
- data/rbi/userplex/resources/{logs.rbi → events.rbi} +4 -14
- data/sig/userplex/client.rbs +2 -2
- data/sig/userplex/models/{log_new_params.rbs → event_capture_params.rbs} +2 -2
- data/sig/userplex/models/{log_batch_response.rbs → event_capture_response.rbs} +2 -2
- data/sig/userplex/models.rbs +1 -3
- data/sig/userplex/resources/{logs.rbs → events.rbs} +3 -8
- metadata +11 -17
- data/lib/userplex/models/log_batch_params.rb +0 -48
- data/lib/userplex/models/log_new_response.rb +0 -16
- data/lib/userplex/resources/logs.rb +0 -59
- data/rbi/userplex/models/log_batch_params.rbi +0 -95
- data/rbi/userplex/models/log_new_response.rbi +0 -23
- data/sig/userplex/models/log_batch_params.rbs +0 -66
- data/sig/userplex/models/log_new_response.rbs +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9278b955d15f31b3a6584f80a78b5d75fba4d6202e72d777a763beeea2f16472
|
|
4
|
+
data.tar.gz: 57c4ca2e8a0a1493d9b28e29669f4f756c70a8cdf74c93867fcf45015bcf55d9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '002386a33fc5fd3a1b48af9f754974056cce27e4860604afb9f4edca9d85fc3189923694c1d6262ef56bd07b430c3f67329841a25a2d2e22794df77e849bec21'
|
|
7
|
+
data.tar.gz: 390655b679cbe659c7626a501054ca25c836bee3e6d96d65e14f8222bf41f2fe70322f9ebcbe79531d65120a65694176d71081795fa24c3295dcb77344a8ad4c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.0 (2026-01-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.14.0...v0.15.0](https://github.com/dqnamo/userplex-ruby/compare/v0.14.0...v0.15.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([c04700c](https://github.com/dqnamo/userplex-ruby/commit/c04700c7a9731ed3995d988c8ecfc191ae2d1c85))
|
|
10
|
+
|
|
11
|
+
## 0.14.0 (2026-01-06)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.13.0...v0.14.0](https://github.com/dqnamo/userplex-ruby/compare/v0.13.0...v0.14.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** api update ([8db291a](https://github.com/dqnamo/userplex-ruby/commit/8db291a972c3f71ec5c45cb8554e9808a8c67f5a))
|
|
18
|
+
|
|
3
19
|
## 0.13.0 (2026-01-05)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v0.12.0...v0.13.0](https://github.com/dqnamo/userplex-ruby/compare/v0.12.0...v0.13.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.15.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.
|
|
33
|
+
response = userplex.events.capture
|
|
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
|
-
|
|
44
|
+
event = userplex.events.capture
|
|
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`
|
|
@@ -84,7 +84,7 @@ userplex = Userplex::Client.new(
|
|
|
84
84
|
)
|
|
85
85
|
|
|
86
86
|
# Or, configure per-request:
|
|
87
|
-
userplex.
|
|
87
|
+
userplex.events.capture(request_options: {max_retries: 5})
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
### Timeouts
|
|
@@ -98,7 +98,7 @@ userplex = Userplex::Client.new(
|
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
# Or, configure per-request:
|
|
101
|
-
userplex.
|
|
101
|
+
userplex.events.capture(request_options: {timeout: 5})
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
On timeout, `Userplex::Errors::APITimeoutError` is raised.
|
|
@@ -129,8 +129,7 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
|
|
|
129
129
|
|
|
130
130
|
```ruby
|
|
131
131
|
response =
|
|
132
|
-
userplex.
|
|
133
|
-
name: "REPLACE_ME",
|
|
132
|
+
userplex.events.capture(
|
|
134
133
|
request_options: {
|
|
135
134
|
extra_query: {my_query_parameter: value},
|
|
136
135
|
extra_body: {my_body_parameter: value},
|
|
@@ -176,18 +175,18 @@ This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitio
|
|
|
176
175
|
You can provide typesafe request parameters like so:
|
|
177
176
|
|
|
178
177
|
```ruby
|
|
179
|
-
userplex.
|
|
178
|
+
userplex.events.capture
|
|
180
179
|
```
|
|
181
180
|
|
|
182
181
|
Or, equivalently:
|
|
183
182
|
|
|
184
183
|
```ruby
|
|
185
184
|
# Hashes work, but are not typesafe:
|
|
186
|
-
userplex.
|
|
185
|
+
userplex.events.capture
|
|
187
186
|
|
|
188
187
|
# You can also splat a full Params class:
|
|
189
|
-
params = Userplex::
|
|
190
|
-
userplex.
|
|
188
|
+
params = Userplex::EventCaptureParams.new
|
|
189
|
+
userplex.events.capture(**params)
|
|
191
190
|
```
|
|
192
191
|
|
|
193
192
|
## Versioning
|
data/lib/userplex/client.rb
CHANGED
|
@@ -19,12 +19,12 @@ module Userplex
|
|
|
19
19
|
# @return [String]
|
|
20
20
|
attr_reader :api_key
|
|
21
21
|
|
|
22
|
+
# @return [Userplex::Resources::Events]
|
|
23
|
+
attr_reader :events
|
|
24
|
+
|
|
22
25
|
# @return [Userplex::Resources::Users]
|
|
23
26
|
attr_reader :users
|
|
24
27
|
|
|
25
|
-
# @return [Userplex::Resources::Logs]
|
|
26
|
-
attr_reader :logs
|
|
27
|
-
|
|
28
28
|
# @api private
|
|
29
29
|
#
|
|
30
30
|
# @return [Hash{String=>String}]
|
|
@@ -73,8 +73,8 @@ module Userplex
|
|
|
73
73
|
max_retry_delay: max_retry_delay
|
|
74
74
|
)
|
|
75
75
|
|
|
76
|
+
@events = Userplex::Resources::Events.new(client: self)
|
|
76
77
|
@users = Userplex::Resources::Users.new(client: self)
|
|
77
|
-
@logs = Userplex::Resources::Logs.new(client: self)
|
|
78
78
|
end
|
|
79
79
|
end
|
|
80
80
|
end
|
|
@@ -438,8 +438,8 @@ module Userplex
|
|
|
438
438
|
# @return [Hash{Symbol=>Object}]
|
|
439
439
|
#
|
|
440
440
|
# @example
|
|
441
|
-
# # `
|
|
442
|
-
#
|
|
441
|
+
# # `event_capture_response` is a `Userplex::Models::EventCaptureResponse`
|
|
442
|
+
# event_capture_response => {
|
|
443
443
|
# success: success
|
|
444
444
|
# }
|
|
445
445
|
def deconstruct_keys(keys)
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Userplex
|
|
4
4
|
module Models
|
|
5
|
-
# @see Userplex::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see Userplex::Resources::Events#capture
|
|
6
|
+
class EventCaptureParams < Userplex::Internal::Type::BaseModel
|
|
7
7
|
extend Userplex::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Userplex::Internal::Type::RequestParameters
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Userplex
|
|
4
4
|
module Models
|
|
5
|
-
# @see Userplex::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see Userplex::Resources::Events#capture
|
|
6
|
+
class EventCaptureResponse < Userplex::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute success
|
|
8
8
|
#
|
|
9
9
|
# @return [Boolean]
|
data/lib/userplex/models.rb
CHANGED
|
@@ -39,9 +39,7 @@ module Userplex
|
|
|
39
39
|
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
LogNewParams = Userplex::Models::LogNewParams
|
|
42
|
+
EventCaptureParams = Userplex::Models::EventCaptureParams
|
|
45
43
|
|
|
46
44
|
UserIdentifyParams = Userplex::Models::UserIdentifyParams
|
|
47
45
|
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Userplex
|
|
4
|
+
module Resources
|
|
5
|
+
class Events
|
|
6
|
+
# Capture an event
|
|
7
|
+
#
|
|
8
|
+
# @overload capture(name:, data: nil, timestamp: nil, user_id: nil, request_options: {})
|
|
9
|
+
#
|
|
10
|
+
# @param name [String]
|
|
11
|
+
# @param data [Hash{Symbol=>Object, nil}]
|
|
12
|
+
# @param timestamp [Time]
|
|
13
|
+
# @param user_id [String]
|
|
14
|
+
# @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
15
|
+
#
|
|
16
|
+
# @return [Userplex::Models::EventCaptureResponse]
|
|
17
|
+
#
|
|
18
|
+
# @see Userplex::Models::EventCaptureParams
|
|
19
|
+
def capture(params)
|
|
20
|
+
parsed, options = Userplex::EventCaptureParams.dump_request(params)
|
|
21
|
+
@client.request(
|
|
22
|
+
method: :post,
|
|
23
|
+
path: "capture",
|
|
24
|
+
body: parsed,
|
|
25
|
+
model: Userplex::Models::EventCaptureResponse,
|
|
26
|
+
options: options
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @api private
|
|
31
|
+
#
|
|
32
|
+
# @param client [Userplex::Client]
|
|
33
|
+
def initialize(client:)
|
|
34
|
+
@client = client
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/userplex/version.rb
CHANGED
data/lib/userplex.rb
CHANGED
|
@@ -52,12 +52,10 @@ require_relative "userplex/errors"
|
|
|
52
52
|
require_relative "userplex/internal/transport/base_client"
|
|
53
53
|
require_relative "userplex/internal/transport/pooled_net_requester"
|
|
54
54
|
require_relative "userplex/client"
|
|
55
|
-
require_relative "userplex/models/
|
|
56
|
-
require_relative "userplex/models/
|
|
57
|
-
require_relative "userplex/models/log_new_params"
|
|
58
|
-
require_relative "userplex/models/log_new_response"
|
|
55
|
+
require_relative "userplex/models/event_capture_params"
|
|
56
|
+
require_relative "userplex/models/event_capture_response"
|
|
59
57
|
require_relative "userplex/models/user_identify_params"
|
|
60
58
|
require_relative "userplex/models/user_identify_response"
|
|
61
59
|
require_relative "userplex/models"
|
|
62
|
-
require_relative "userplex/resources/
|
|
60
|
+
require_relative "userplex/resources/events"
|
|
63
61
|
require_relative "userplex/resources/users"
|
data/rbi/userplex/client.rbi
CHANGED
|
@@ -14,12 +14,12 @@ module Userplex
|
|
|
14
14
|
sig { returns(String) }
|
|
15
15
|
attr_reader :api_key
|
|
16
16
|
|
|
17
|
+
sig { returns(Userplex::Resources::Events) }
|
|
18
|
+
attr_reader :events
|
|
19
|
+
|
|
17
20
|
sig { returns(Userplex::Resources::Users) }
|
|
18
21
|
attr_reader :users
|
|
19
22
|
|
|
20
|
-
sig { returns(Userplex::Resources::Logs) }
|
|
21
|
-
attr_reader :logs
|
|
22
|
-
|
|
23
23
|
# @api private
|
|
24
24
|
sig { override.returns(T::Hash[String, String]) }
|
|
25
25
|
private def auth_headers
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module Userplex
|
|
4
4
|
module Models
|
|
5
|
-
class
|
|
5
|
+
class EventCaptureParams < Userplex::Internal::Type::BaseModel
|
|
6
6
|
extend Userplex::Internal::Type::RequestParameters::Converter
|
|
7
7
|
include Userplex::Internal::Type::RequestParameters
|
|
8
8
|
|
|
9
9
|
OrHash =
|
|
10
10
|
T.type_alias do
|
|
11
|
-
T.any(Userplex::
|
|
11
|
+
T.any(Userplex::EventCaptureParams, Userplex::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
sig { returns(String) }
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module Userplex
|
|
4
4
|
module Models
|
|
5
|
-
class
|
|
5
|
+
class EventCaptureResponse < Userplex::Internal::Type::BaseModel
|
|
6
6
|
OrHash =
|
|
7
7
|
T.type_alias do
|
|
8
|
-
T.any(
|
|
8
|
+
T.any(
|
|
9
|
+
Userplex::Models::EventCaptureResponse,
|
|
10
|
+
Userplex::Internal::AnyHash
|
|
11
|
+
)
|
|
9
12
|
end
|
|
10
13
|
|
|
11
14
|
sig { returns(T::Boolean) }
|
data/rbi/userplex/models.rbi
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# typed: strong
|
|
2
2
|
|
|
3
3
|
module Userplex
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
LogNewParams = Userplex::Models::LogNewParams
|
|
4
|
+
EventCaptureParams = Userplex::Models::EventCaptureParams
|
|
7
5
|
|
|
8
6
|
UserIdentifyParams = Userplex::Models::UserIdentifyParams
|
|
9
7
|
end
|
|
@@ -2,18 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Userplex
|
|
4
4
|
module Resources
|
|
5
|
-
class
|
|
6
|
-
#
|
|
7
|
-
sig do
|
|
8
|
-
params(
|
|
9
|
-
body: T::Array[Userplex::LogBatchParams::Body::OrHash],
|
|
10
|
-
request_options: Userplex::RequestOptions::OrHash
|
|
11
|
-
).returns(Userplex::Models::LogBatchResponse)
|
|
12
|
-
end
|
|
13
|
-
def batch(body: nil, request_options: {})
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# Log a single event
|
|
5
|
+
class Events
|
|
6
|
+
# Capture an event
|
|
17
7
|
sig do
|
|
18
8
|
params(
|
|
19
9
|
name: String,
|
|
@@ -21,9 +11,9 @@ module Userplex
|
|
|
21
11
|
timestamp: Time,
|
|
22
12
|
user_id: String,
|
|
23
13
|
request_options: Userplex::RequestOptions::OrHash
|
|
24
|
-
).returns(Userplex::Models::
|
|
14
|
+
).returns(Userplex::Models::EventCaptureResponse)
|
|
25
15
|
end
|
|
26
|
-
def
|
|
16
|
+
def capture(
|
|
27
17
|
name:,
|
|
28
18
|
data: nil,
|
|
29
19
|
timestamp: nil,
|
data/sig/userplex/client.rbs
CHANGED
|
@@ -10,9 +10,9 @@ module Userplex
|
|
|
10
10
|
|
|
11
11
|
attr_reader api_key: String
|
|
12
12
|
|
|
13
|
-
attr_reader
|
|
13
|
+
attr_reader events: Userplex::Resources::Events
|
|
14
14
|
|
|
15
|
-
attr_reader
|
|
15
|
+
attr_reader users: Userplex::Resources::Users
|
|
16
16
|
|
|
17
17
|
private def auth_headers: -> ::Hash[String, String]
|
|
18
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Userplex
|
|
2
2
|
module Models
|
|
3
|
-
type
|
|
3
|
+
type event_capture_params =
|
|
4
4
|
{
|
|
5
5
|
name: String,
|
|
6
6
|
data: ::Hash[Symbol, top?],
|
|
@@ -9,7 +9,7 @@ module Userplex
|
|
|
9
9
|
}
|
|
10
10
|
& Userplex::Internal::Type::request_parameters
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class EventCaptureParams < Userplex::Internal::Type::BaseModel
|
|
13
13
|
extend Userplex::Internal::Type::RequestParameters::Converter
|
|
14
14
|
include Userplex::Internal::Type::RequestParameters
|
|
15
15
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module Userplex
|
|
2
2
|
module Models
|
|
3
|
-
type
|
|
3
|
+
type event_capture_response = { success: bool }
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class EventCaptureResponse < Userplex::Internal::Type::BaseModel
|
|
6
6
|
attr_accessor success: bool
|
|
7
7
|
|
|
8
8
|
def initialize: (success: bool) -> void
|
data/sig/userplex/models.rbs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
module Userplex
|
|
2
|
-
class
|
|
3
|
-
|
|
4
|
-
class LogNewParams = Userplex::Models::LogNewParams
|
|
2
|
+
class EventCaptureParams = Userplex::Models::EventCaptureParams
|
|
5
3
|
|
|
6
4
|
class UserIdentifyParams = Userplex::Models::UserIdentifyParams
|
|
7
5
|
end
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
module Userplex
|
|
2
2
|
module Resources
|
|
3
|
-
class
|
|
4
|
-
def
|
|
5
|
-
?body: ::Array[Userplex::LogBatchParams::Body],
|
|
6
|
-
?request_options: Userplex::request_opts
|
|
7
|
-
) -> Userplex::Models::LogBatchResponse
|
|
8
|
-
|
|
9
|
-
def new: (
|
|
3
|
+
class Events
|
|
4
|
+
def capture: (
|
|
10
5
|
name: String,
|
|
11
6
|
?data: ::Hash[Symbol, top?],
|
|
12
7
|
?timestamp: Time,
|
|
13
8
|
?user_id: String,
|
|
14
9
|
?request_options: Userplex::request_opts
|
|
15
|
-
) -> Userplex::Models::
|
|
10
|
+
) -> Userplex::Models::EventCaptureResponse
|
|
16
11
|
|
|
17
12
|
def initialize: (client: Userplex::Client) -> void
|
|
18
13
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: userplex
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Userplex
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|
|
@@ -55,14 +55,12 @@ files:
|
|
|
55
55
|
- lib/userplex/internal/type/unknown.rb
|
|
56
56
|
- lib/userplex/internal/util.rb
|
|
57
57
|
- lib/userplex/models.rb
|
|
58
|
-
- lib/userplex/models/
|
|
59
|
-
- lib/userplex/models/
|
|
60
|
-
- lib/userplex/models/log_new_params.rb
|
|
61
|
-
- lib/userplex/models/log_new_response.rb
|
|
58
|
+
- lib/userplex/models/event_capture_params.rb
|
|
59
|
+
- lib/userplex/models/event_capture_response.rb
|
|
62
60
|
- lib/userplex/models/user_identify_params.rb
|
|
63
61
|
- lib/userplex/models/user_identify_response.rb
|
|
64
62
|
- lib/userplex/request_options.rb
|
|
65
|
-
- lib/userplex/resources/
|
|
63
|
+
- lib/userplex/resources/events.rb
|
|
66
64
|
- lib/userplex/resources/users.rb
|
|
67
65
|
- lib/userplex/version.rb
|
|
68
66
|
- manifest.yaml
|
|
@@ -85,14 +83,12 @@ files:
|
|
|
85
83
|
- rbi/userplex/internal/type/unknown.rbi
|
|
86
84
|
- rbi/userplex/internal/util.rbi
|
|
87
85
|
- rbi/userplex/models.rbi
|
|
88
|
-
- rbi/userplex/models/
|
|
89
|
-
- rbi/userplex/models/
|
|
90
|
-
- rbi/userplex/models/log_new_params.rbi
|
|
91
|
-
- rbi/userplex/models/log_new_response.rbi
|
|
86
|
+
- rbi/userplex/models/event_capture_params.rbi
|
|
87
|
+
- rbi/userplex/models/event_capture_response.rbi
|
|
92
88
|
- rbi/userplex/models/user_identify_params.rbi
|
|
93
89
|
- rbi/userplex/models/user_identify_response.rbi
|
|
94
90
|
- rbi/userplex/request_options.rbi
|
|
95
|
-
- rbi/userplex/resources/
|
|
91
|
+
- rbi/userplex/resources/events.rbi
|
|
96
92
|
- rbi/userplex/resources/users.rbi
|
|
97
93
|
- rbi/userplex/version.rbi
|
|
98
94
|
- sig/userplex/client.rbs
|
|
@@ -114,14 +110,12 @@ files:
|
|
|
114
110
|
- sig/userplex/internal/type/unknown.rbs
|
|
115
111
|
- sig/userplex/internal/util.rbs
|
|
116
112
|
- sig/userplex/models.rbs
|
|
117
|
-
- sig/userplex/models/
|
|
118
|
-
- sig/userplex/models/
|
|
119
|
-
- sig/userplex/models/log_new_params.rbs
|
|
120
|
-
- sig/userplex/models/log_new_response.rbs
|
|
113
|
+
- sig/userplex/models/event_capture_params.rbs
|
|
114
|
+
- sig/userplex/models/event_capture_response.rbs
|
|
121
115
|
- sig/userplex/models/user_identify_params.rbs
|
|
122
116
|
- sig/userplex/models/user_identify_response.rbs
|
|
123
117
|
- sig/userplex/request_options.rbs
|
|
124
|
-
- sig/userplex/resources/
|
|
118
|
+
- sig/userplex/resources/events.rbs
|
|
125
119
|
- sig/userplex/resources/users.rbs
|
|
126
120
|
- sig/userplex/version.rbs
|
|
127
121
|
homepage: https://gemdocs.org/gems/userplex
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Userplex
|
|
4
|
-
module Models
|
|
5
|
-
# @see Userplex::Resources::Logs#batch
|
|
6
|
-
class LogBatchParams < Userplex::Internal::Type::BaseModel
|
|
7
|
-
extend Userplex::Internal::Type::RequestParameters::Converter
|
|
8
|
-
include Userplex::Internal::Type::RequestParameters
|
|
9
|
-
|
|
10
|
-
# @!attribute body
|
|
11
|
-
#
|
|
12
|
-
# @return [Array<Userplex::Models::LogBatchParams::Body>, nil]
|
|
13
|
-
optional :body, -> { Userplex::Internal::Type::ArrayOf[Userplex::LogBatchParams::Body] }
|
|
14
|
-
|
|
15
|
-
# @!method initialize(body: nil, request_options: {})
|
|
16
|
-
# @param body [Array<Userplex::Models::LogBatchParams::Body>]
|
|
17
|
-
# @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
-
|
|
19
|
-
class Body < Userplex::Internal::Type::BaseModel
|
|
20
|
-
# @!attribute name
|
|
21
|
-
#
|
|
22
|
-
# @return [String]
|
|
23
|
-
required :name, String
|
|
24
|
-
|
|
25
|
-
# @!attribute data
|
|
26
|
-
#
|
|
27
|
-
# @return [Hash{Symbol=>Object, nil}, nil]
|
|
28
|
-
optional :data, Userplex::Internal::Type::HashOf[Userplex::Internal::Type::Unknown, nil?: true]
|
|
29
|
-
|
|
30
|
-
# @!attribute timestamp
|
|
31
|
-
#
|
|
32
|
-
# @return [Time, nil]
|
|
33
|
-
optional :timestamp, Time
|
|
34
|
-
|
|
35
|
-
# @!attribute user_id
|
|
36
|
-
#
|
|
37
|
-
# @return [String, nil]
|
|
38
|
-
optional :user_id, String
|
|
39
|
-
|
|
40
|
-
# @!method initialize(name:, data: nil, timestamp: nil, user_id: nil)
|
|
41
|
-
# @param name [String]
|
|
42
|
-
# @param data [Hash{Symbol=>Object, nil}]
|
|
43
|
-
# @param timestamp [Time]
|
|
44
|
-
# @param user_id [String]
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Userplex
|
|
4
|
-
module Models
|
|
5
|
-
# @see Userplex::Resources::Logs#new
|
|
6
|
-
class LogNewResponse < Userplex::Internal::Type::BaseModel
|
|
7
|
-
# @!attribute success
|
|
8
|
-
#
|
|
9
|
-
# @return [Boolean]
|
|
10
|
-
required :success, Userplex::Internal::Type::Boolean
|
|
11
|
-
|
|
12
|
-
# @!method initialize(success:)
|
|
13
|
-
# @param success [Boolean]
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Userplex
|
|
4
|
-
module Resources
|
|
5
|
-
class Logs
|
|
6
|
-
# Log multiple events
|
|
7
|
-
#
|
|
8
|
-
# @overload batch(body: nil, request_options: {})
|
|
9
|
-
#
|
|
10
|
-
# @param body [Array<Userplex::Models::LogBatchParams::Body>]
|
|
11
|
-
# @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
12
|
-
#
|
|
13
|
-
# @return [Userplex::Models::LogBatchResponse]
|
|
14
|
-
#
|
|
15
|
-
# @see Userplex::Models::LogBatchParams
|
|
16
|
-
def batch(params = {})
|
|
17
|
-
parsed, options = Userplex::LogBatchParams.dump_request(params)
|
|
18
|
-
@client.request(
|
|
19
|
-
method: :post,
|
|
20
|
-
path: "logs",
|
|
21
|
-
body: parsed[:body],
|
|
22
|
-
model: Userplex::Models::LogBatchResponse,
|
|
23
|
-
options: options
|
|
24
|
-
)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# Log a single event
|
|
28
|
-
#
|
|
29
|
-
# @overload new(name:, data: nil, timestamp: nil, user_id: nil, request_options: {})
|
|
30
|
-
#
|
|
31
|
-
# @param name [String]
|
|
32
|
-
# @param data [Hash{Symbol=>Object, nil}]
|
|
33
|
-
# @param timestamp [Time]
|
|
34
|
-
# @param user_id [String]
|
|
35
|
-
# @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
36
|
-
#
|
|
37
|
-
# @return [Userplex::Models::LogNewResponse]
|
|
38
|
-
#
|
|
39
|
-
# @see Userplex::Models::LogNewParams
|
|
40
|
-
def new(params)
|
|
41
|
-
parsed, options = Userplex::LogNewParams.dump_request(params)
|
|
42
|
-
@client.request(
|
|
43
|
-
method: :post,
|
|
44
|
-
path: "log",
|
|
45
|
-
body: parsed,
|
|
46
|
-
model: Userplex::Models::LogNewResponse,
|
|
47
|
-
options: options
|
|
48
|
-
)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# @api private
|
|
52
|
-
#
|
|
53
|
-
# @param client [Userplex::Client]
|
|
54
|
-
def initialize(client:)
|
|
55
|
-
@client = client
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module Userplex
|
|
4
|
-
module Models
|
|
5
|
-
class LogBatchParams < Userplex::Internal::Type::BaseModel
|
|
6
|
-
extend Userplex::Internal::Type::RequestParameters::Converter
|
|
7
|
-
include Userplex::Internal::Type::RequestParameters
|
|
8
|
-
|
|
9
|
-
OrHash =
|
|
10
|
-
T.type_alias do
|
|
11
|
-
T.any(Userplex::LogBatchParams, Userplex::Internal::AnyHash)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
sig { returns(T.nilable(T::Array[Userplex::LogBatchParams::Body])) }
|
|
15
|
-
attr_reader :body
|
|
16
|
-
|
|
17
|
-
sig do
|
|
18
|
-
params(body: T::Array[Userplex::LogBatchParams::Body::OrHash]).void
|
|
19
|
-
end
|
|
20
|
-
attr_writer :body
|
|
21
|
-
|
|
22
|
-
sig do
|
|
23
|
-
params(
|
|
24
|
-
body: T::Array[Userplex::LogBatchParams::Body::OrHash],
|
|
25
|
-
request_options: Userplex::RequestOptions::OrHash
|
|
26
|
-
).returns(T.attached_class)
|
|
27
|
-
end
|
|
28
|
-
def self.new(body: nil, request_options: {})
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
sig do
|
|
32
|
-
override.returns(
|
|
33
|
-
{
|
|
34
|
-
body: T::Array[Userplex::LogBatchParams::Body],
|
|
35
|
-
request_options: Userplex::RequestOptions
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
end
|
|
39
|
-
def to_hash
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
class Body < Userplex::Internal::Type::BaseModel
|
|
43
|
-
OrHash =
|
|
44
|
-
T.type_alias do
|
|
45
|
-
T.any(Userplex::LogBatchParams::Body, Userplex::Internal::AnyHash)
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
sig { returns(String) }
|
|
49
|
-
attr_accessor :name
|
|
50
|
-
|
|
51
|
-
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
|
|
52
|
-
attr_reader :data
|
|
53
|
-
|
|
54
|
-
sig { params(data: T::Hash[Symbol, T.nilable(T.anything)]).void }
|
|
55
|
-
attr_writer :data
|
|
56
|
-
|
|
57
|
-
sig { returns(T.nilable(Time)) }
|
|
58
|
-
attr_reader :timestamp
|
|
59
|
-
|
|
60
|
-
sig { params(timestamp: Time).void }
|
|
61
|
-
attr_writer :timestamp
|
|
62
|
-
|
|
63
|
-
sig { returns(T.nilable(String)) }
|
|
64
|
-
attr_reader :user_id
|
|
65
|
-
|
|
66
|
-
sig { params(user_id: String).void }
|
|
67
|
-
attr_writer :user_id
|
|
68
|
-
|
|
69
|
-
sig do
|
|
70
|
-
params(
|
|
71
|
-
name: String,
|
|
72
|
-
data: T::Hash[Symbol, T.nilable(T.anything)],
|
|
73
|
-
timestamp: Time,
|
|
74
|
-
user_id: String
|
|
75
|
-
).returns(T.attached_class)
|
|
76
|
-
end
|
|
77
|
-
def self.new(name:, data: nil, timestamp: nil, user_id: nil)
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
sig do
|
|
81
|
-
override.returns(
|
|
82
|
-
{
|
|
83
|
-
name: String,
|
|
84
|
-
data: T::Hash[Symbol, T.nilable(T.anything)],
|
|
85
|
-
timestamp: Time,
|
|
86
|
-
user_id: String
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
end
|
|
90
|
-
def to_hash
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module Userplex
|
|
4
|
-
module Models
|
|
5
|
-
class LogNewResponse < Userplex::Internal::Type::BaseModel
|
|
6
|
-
OrHash =
|
|
7
|
-
T.type_alias do
|
|
8
|
-
T.any(Userplex::Models::LogNewResponse, Userplex::Internal::AnyHash)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
sig { returns(T::Boolean) }
|
|
12
|
-
attr_accessor :success
|
|
13
|
-
|
|
14
|
-
sig { params(success: T::Boolean).returns(T.attached_class) }
|
|
15
|
-
def self.new(success:)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
sig { override.returns({ success: T::Boolean }) }
|
|
19
|
-
def to_hash
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
module Userplex
|
|
2
|
-
module Models
|
|
3
|
-
type log_batch_params =
|
|
4
|
-
{ body: ::Array[Userplex::LogBatchParams::Body] }
|
|
5
|
-
& Userplex::Internal::Type::request_parameters
|
|
6
|
-
|
|
7
|
-
class LogBatchParams < Userplex::Internal::Type::BaseModel
|
|
8
|
-
extend Userplex::Internal::Type::RequestParameters::Converter
|
|
9
|
-
include Userplex::Internal::Type::RequestParameters
|
|
10
|
-
|
|
11
|
-
attr_reader body: ::Array[Userplex::LogBatchParams::Body]?
|
|
12
|
-
|
|
13
|
-
def body=: (
|
|
14
|
-
::Array[Userplex::LogBatchParams::Body]
|
|
15
|
-
) -> ::Array[Userplex::LogBatchParams::Body]
|
|
16
|
-
|
|
17
|
-
def initialize: (
|
|
18
|
-
?body: ::Array[Userplex::LogBatchParams::Body],
|
|
19
|
-
?request_options: Userplex::request_opts
|
|
20
|
-
) -> void
|
|
21
|
-
|
|
22
|
-
def to_hash: -> {
|
|
23
|
-
body: ::Array[Userplex::LogBatchParams::Body],
|
|
24
|
-
request_options: Userplex::RequestOptions
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
type body =
|
|
28
|
-
{
|
|
29
|
-
name: String,
|
|
30
|
-
data: ::Hash[Symbol, top?],
|
|
31
|
-
timestamp: Time,
|
|
32
|
-
user_id: String
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
class Body < Userplex::Internal::Type::BaseModel
|
|
36
|
-
attr_accessor name: String
|
|
37
|
-
|
|
38
|
-
attr_reader data: ::Hash[Symbol, top?]?
|
|
39
|
-
|
|
40
|
-
def data=: (::Hash[Symbol, top?]) -> ::Hash[Symbol, top?]
|
|
41
|
-
|
|
42
|
-
attr_reader timestamp: Time?
|
|
43
|
-
|
|
44
|
-
def timestamp=: (Time) -> Time
|
|
45
|
-
|
|
46
|
-
attr_reader user_id: String?
|
|
47
|
-
|
|
48
|
-
def user_id=: (String) -> String
|
|
49
|
-
|
|
50
|
-
def initialize: (
|
|
51
|
-
name: String,
|
|
52
|
-
?data: ::Hash[Symbol, top?],
|
|
53
|
-
?timestamp: Time,
|
|
54
|
-
?user_id: String
|
|
55
|
-
) -> void
|
|
56
|
-
|
|
57
|
-
def to_hash: -> {
|
|
58
|
-
name: String,
|
|
59
|
-
data: ::Hash[Symbol, top?],
|
|
60
|
-
timestamp: Time,
|
|
61
|
-
user_id: String
|
|
62
|
-
}
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module Userplex
|
|
2
|
-
module Models
|
|
3
|
-
type log_new_response = { success: bool }
|
|
4
|
-
|
|
5
|
-
class LogNewResponse < Userplex::Internal::Type::BaseModel
|
|
6
|
-
attr_accessor success: bool
|
|
7
|
-
|
|
8
|
-
def initialize: (success: bool) -> void
|
|
9
|
-
|
|
10
|
-
def to_hash: -> { success: bool }
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|