userplex 0.6.2 → 0.8.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 +1 -1
- data/lib/userplex/client.rb +3 -3
- data/lib/userplex/models/log_batch_params.rb +64 -0
- data/lib/userplex/models/log_batch_response.rb +25 -0
- data/lib/userplex/models/{event_new_params.rb → log_new_params.rb} +15 -7
- data/lib/userplex/models/{event_new_response.rb → log_new_response.rb} +2 -2
- data/lib/userplex/models.rb +3 -1
- data/lib/userplex/resources/logs.rb +68 -0
- data/lib/userplex/version.rb +1 -1
- data/lib/userplex.rb +5 -3
- data/rbi/userplex/client.rbi +2 -2
- data/rbi/userplex/models/log_batch_params.rbi +114 -0
- data/rbi/userplex/models/log_batch_response.rbi +35 -0
- data/rbi/userplex/models/{event_new_params.rbi → log_new_params.rbi} +17 -6
- data/rbi/userplex/models/{event_new_response.rbi → log_new_response.rbi} +2 -2
- data/rbi/userplex/models.rbi +3 -1
- data/rbi/userplex/resources/logs.rbi +53 -0
- data/sig/userplex/client.rbs +1 -1
- data/sig/userplex/models/log_batch_params.rbs +67 -0
- data/sig/userplex/models/log_batch_response.rbs +15 -0
- data/sig/userplex/models/{event_new_params.rbs → log_new_params.rbs} +9 -2
- data/sig/userplex/models/{event_new_response.rbs → log_new_response.rbs} +2 -2
- data/sig/userplex/models.rbs +3 -1
- data/sig/userplex/resources/{events.rbs → logs.rbs} +8 -2
- metadata +16 -10
- data/lib/userplex/resources/events.rb +0 -43
- data/rbi/userplex/resources/events.rbi +0 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4d15b3f2600757eaea69bef89c368a83ee17770824246337ca19f1a5cc0b9134
|
|
4
|
+
data.tar.gz: d7f5e13e583e3587f5846740377a8bee94362de04d348f42b2140994510ce948
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c21885b9570c997d901948c0190123d03aea674e42ee0d384709c88d18e74883ae917755cc1f32eab442df4e57e9c12fd48794f24175adbfd87a38df17537f7
|
|
7
|
+
data.tar.gz: 5a2521da9ed97aea8eb46113a19ae6e998cce4fb5b95e81979dbacbfebb427e37d7ed61f955d90d79991b52255b0f997059f669e081d037ed887ccdfa1eb2824
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.0 (2025-12-19)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.7.0...v0.8.0](https://github.com/dqnamo/userplex-ruby/compare/v0.7.0...v0.8.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([300604c](https://github.com/dqnamo/userplex-ruby/commit/300604ca424ea6571bf0263b236d635847ff8866))
|
|
10
|
+
|
|
11
|
+
## 0.7.0 (2025-12-19)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.6.2...v0.7.0](https://github.com/dqnamo/userplex-ruby/compare/v0.6.2...v0.7.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** api update ([aa5d72f](https://github.com/dqnamo/userplex-ruby/commit/aa5d72fced4bcd10cc2301a5f118d48c138df517))
|
|
18
|
+
|
|
3
19
|
## 0.6.2 (2025-12-19)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v0.6.1...v0.6.2](https://github.com/dqnamo/userplex-ruby/compare/v0.6.1...v0.6.2)
|
data/README.md
CHANGED
data/lib/userplex/client.rb
CHANGED
|
@@ -22,8 +22,8 @@ module Userplex
|
|
|
22
22
|
# @return [Userplex::Resources::Users]
|
|
23
23
|
attr_reader :users
|
|
24
24
|
|
|
25
|
-
# @return [Userplex::Resources::
|
|
26
|
-
attr_reader :
|
|
25
|
+
# @return [Userplex::Resources::Logs]
|
|
26
|
+
attr_reader :logs
|
|
27
27
|
|
|
28
28
|
# @api private
|
|
29
29
|
#
|
|
@@ -74,7 +74,7 @@ module Userplex
|
|
|
74
74
|
)
|
|
75
75
|
|
|
76
76
|
@users = Userplex::Resources::Users.new(client: self)
|
|
77
|
-
@
|
|
77
|
+
@logs = Userplex::Resources::Logs.new(client: self)
|
|
78
78
|
end
|
|
79
79
|
end
|
|
80
80
|
end
|
|
@@ -0,0 +1,64 @@
|
|
|
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 logs
|
|
11
|
+
# List of logs to track
|
|
12
|
+
#
|
|
13
|
+
# @return [Array<Userplex::Models::LogBatchParams::Log>]
|
|
14
|
+
required :logs, -> { Userplex::Internal::Type::ArrayOf[Userplex::LogBatchParams::Log] }
|
|
15
|
+
|
|
16
|
+
# @!method initialize(logs:, request_options: {})
|
|
17
|
+
# @param logs [Array<Userplex::Models::LogBatchParams::Log>] List of logs to track
|
|
18
|
+
#
|
|
19
|
+
# @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}]
|
|
20
|
+
|
|
21
|
+
class Log < Userplex::Internal::Type::BaseModel
|
|
22
|
+
# @!attribute name
|
|
23
|
+
#
|
|
24
|
+
# @return [String]
|
|
25
|
+
required :name, String
|
|
26
|
+
|
|
27
|
+
# @!attribute user_id
|
|
28
|
+
# External user ID
|
|
29
|
+
#
|
|
30
|
+
# @return [String]
|
|
31
|
+
required :user_id, String
|
|
32
|
+
|
|
33
|
+
# @!attribute data
|
|
34
|
+
# Additional log data
|
|
35
|
+
#
|
|
36
|
+
# @return [Hash{Symbol=>Object, nil}, nil]
|
|
37
|
+
optional :data, Userplex::Internal::Type::HashOf[Userplex::Internal::Type::Unknown, nil?: true]
|
|
38
|
+
|
|
39
|
+
# @!attribute properties
|
|
40
|
+
# Alias for data, for compatibility
|
|
41
|
+
#
|
|
42
|
+
# @return [Hash{Symbol=>Object, nil}, nil]
|
|
43
|
+
optional :properties, Userplex::Internal::Type::HashOf[Userplex::Internal::Type::Unknown, nil?: true]
|
|
44
|
+
|
|
45
|
+
# @!attribute timestamp
|
|
46
|
+
# Log timestamp (ISO 8601)
|
|
47
|
+
#
|
|
48
|
+
# @return [Time, nil]
|
|
49
|
+
optional :timestamp, Time
|
|
50
|
+
|
|
51
|
+
# @!method initialize(name:, user_id:, data: nil, properties: nil, timestamp: nil)
|
|
52
|
+
# @param name [String]
|
|
53
|
+
#
|
|
54
|
+
# @param user_id [String] External user ID
|
|
55
|
+
#
|
|
56
|
+
# @param data [Hash{Symbol=>Object, nil}] Additional log data
|
|
57
|
+
#
|
|
58
|
+
# @param properties [Hash{Symbol=>Object, nil}] Alias for data, for compatibility
|
|
59
|
+
#
|
|
60
|
+
# @param timestamp [Time] Log timestamp (ISO 8601)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Userplex
|
|
4
|
+
module Models
|
|
5
|
+
# @see Userplex::Resources::Logs#batch
|
|
6
|
+
class LogBatchResponse < Userplex::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute count
|
|
8
|
+
# Number of logs processed
|
|
9
|
+
#
|
|
10
|
+
# @return [Float]
|
|
11
|
+
required :count, Float
|
|
12
|
+
|
|
13
|
+
# @!attribute success
|
|
14
|
+
# Operation success status
|
|
15
|
+
#
|
|
16
|
+
# @return [Boolean]
|
|
17
|
+
required :success, Userplex::Internal::Type::Boolean
|
|
18
|
+
|
|
19
|
+
# @!method initialize(count:, success:)
|
|
20
|
+
# @param count [Float] Number of logs processed
|
|
21
|
+
#
|
|
22
|
+
# @param success [Boolean] Operation success status
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Userplex
|
|
4
4
|
module Models
|
|
5
|
-
# @see Userplex::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see Userplex::Resources::Logs#new
|
|
6
|
+
class LogNewParams < Userplex::Internal::Type::BaseModel
|
|
7
7
|
extend Userplex::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Userplex::Internal::Type::RequestParameters
|
|
9
9
|
|
|
@@ -18,26 +18,34 @@ module Userplex
|
|
|
18
18
|
# @return [String]
|
|
19
19
|
required :user_id, String
|
|
20
20
|
|
|
21
|
+
# @!attribute data
|
|
22
|
+
# Additional log data
|
|
23
|
+
#
|
|
24
|
+
# @return [Hash{Symbol=>Object, nil}, nil]
|
|
25
|
+
optional :data, Userplex::Internal::Type::HashOf[Userplex::Internal::Type::Unknown, nil?: true]
|
|
26
|
+
|
|
21
27
|
# @!attribute properties
|
|
22
|
-
#
|
|
28
|
+
# Alias for data, for compatibility
|
|
23
29
|
#
|
|
24
30
|
# @return [Hash{Symbol=>Object, nil}, nil]
|
|
25
31
|
optional :properties, Userplex::Internal::Type::HashOf[Userplex::Internal::Type::Unknown, nil?: true]
|
|
26
32
|
|
|
27
33
|
# @!attribute timestamp
|
|
28
|
-
#
|
|
34
|
+
# Log timestamp (ISO 8601)
|
|
29
35
|
#
|
|
30
36
|
# @return [Time, nil]
|
|
31
37
|
optional :timestamp, Time
|
|
32
38
|
|
|
33
|
-
# @!method initialize(name:, user_id:, properties: nil, timestamp: nil, request_options: {})
|
|
39
|
+
# @!method initialize(name:, user_id:, data: nil, properties: nil, timestamp: nil, request_options: {})
|
|
34
40
|
# @param name [String]
|
|
35
41
|
#
|
|
36
42
|
# @param user_id [String] External user ID
|
|
37
43
|
#
|
|
38
|
-
# @param
|
|
44
|
+
# @param data [Hash{Symbol=>Object, nil}] Additional log data
|
|
45
|
+
#
|
|
46
|
+
# @param properties [Hash{Symbol=>Object, nil}] Alias for data, for compatibility
|
|
39
47
|
#
|
|
40
|
-
# @param timestamp [Time]
|
|
48
|
+
# @param timestamp [Time] Log timestamp (ISO 8601)
|
|
41
49
|
#
|
|
42
50
|
# @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}]
|
|
43
51
|
end
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Userplex
|
|
4
4
|
module Models
|
|
5
|
-
# @see Userplex::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see Userplex::Resources::Logs#new
|
|
6
|
+
class LogNewResponse < Userplex::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute success
|
|
8
8
|
# Operation success status
|
|
9
9
|
#
|
data/lib/userplex/models.rb
CHANGED
|
@@ -39,7 +39,9 @@ module Userplex
|
|
|
39
39
|
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
LogBatchParams = Userplex::Models::LogBatchParams
|
|
43
|
+
|
|
44
|
+
LogNewParams = Userplex::Models::LogNewParams
|
|
43
45
|
|
|
44
46
|
UserIdentifyParams = Userplex::Models::UserIdentifyParams
|
|
45
47
|
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Userplex
|
|
4
|
+
module Resources
|
|
5
|
+
class Logs
|
|
6
|
+
# Records multiple log occurrences in a single request. Requires a valid API key
|
|
7
|
+
# for authentication.
|
|
8
|
+
#
|
|
9
|
+
# @overload batch(logs:, request_options: {})
|
|
10
|
+
#
|
|
11
|
+
# @param logs [Array<Userplex::Models::LogBatchParams::Log>] List of logs to track
|
|
12
|
+
#
|
|
13
|
+
# @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
14
|
+
#
|
|
15
|
+
# @return [Userplex::Models::LogBatchResponse]
|
|
16
|
+
#
|
|
17
|
+
# @see Userplex::Models::LogBatchParams
|
|
18
|
+
def batch(params)
|
|
19
|
+
parsed, options = Userplex::LogBatchParams.dump_request(params)
|
|
20
|
+
@client.request(
|
|
21
|
+
method: :post,
|
|
22
|
+
path: "api/logs/batch",
|
|
23
|
+
body: parsed,
|
|
24
|
+
model: Userplex::Models::LogBatchResponse,
|
|
25
|
+
options: options
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Creates or uses an existing log and records a log occurrence for an end user.
|
|
30
|
+
# Requires a valid API key for authentication.
|
|
31
|
+
#
|
|
32
|
+
# @overload new(name:, user_id:, data: nil, properties: nil, timestamp: nil, request_options: {})
|
|
33
|
+
#
|
|
34
|
+
# @param name [String]
|
|
35
|
+
#
|
|
36
|
+
# @param user_id [String] External user ID
|
|
37
|
+
#
|
|
38
|
+
# @param data [Hash{Symbol=>Object, nil}] Additional log data
|
|
39
|
+
#
|
|
40
|
+
# @param properties [Hash{Symbol=>Object, nil}] Alias for data, for compatibility
|
|
41
|
+
#
|
|
42
|
+
# @param timestamp [Time] Log timestamp (ISO 8601)
|
|
43
|
+
#
|
|
44
|
+
# @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
45
|
+
#
|
|
46
|
+
# @return [Userplex::Models::LogNewResponse]
|
|
47
|
+
#
|
|
48
|
+
# @see Userplex::Models::LogNewParams
|
|
49
|
+
def new(params)
|
|
50
|
+
parsed, options = Userplex::LogNewParams.dump_request(params)
|
|
51
|
+
@client.request(
|
|
52
|
+
method: :post,
|
|
53
|
+
path: "api/log",
|
|
54
|
+
body: parsed,
|
|
55
|
+
model: Userplex::Models::LogNewResponse,
|
|
56
|
+
options: options
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# @api private
|
|
61
|
+
#
|
|
62
|
+
# @param client [Userplex::Client]
|
|
63
|
+
def initialize(client:)
|
|
64
|
+
@client = client
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
data/lib/userplex/version.rb
CHANGED
data/lib/userplex.rb
CHANGED
|
@@ -52,10 +52,12 @@ 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/
|
|
55
|
+
require_relative "userplex/models/log_batch_params"
|
|
56
|
+
require_relative "userplex/models/log_batch_response"
|
|
57
|
+
require_relative "userplex/models/log_new_params"
|
|
58
|
+
require_relative "userplex/models/log_new_response"
|
|
57
59
|
require_relative "userplex/models/user_identify_params"
|
|
58
60
|
require_relative "userplex/models/user_identify_response"
|
|
59
61
|
require_relative "userplex/models"
|
|
60
|
-
require_relative "userplex/resources/
|
|
62
|
+
require_relative "userplex/resources/logs"
|
|
61
63
|
require_relative "userplex/resources/users"
|
data/rbi/userplex/client.rbi
CHANGED
|
@@ -17,8 +17,8 @@ module Userplex
|
|
|
17
17
|
sig { returns(Userplex::Resources::Users) }
|
|
18
18
|
attr_reader :users
|
|
19
19
|
|
|
20
|
-
sig { returns(Userplex::Resources::
|
|
21
|
-
attr_reader :
|
|
20
|
+
sig { returns(Userplex::Resources::Logs) }
|
|
21
|
+
attr_reader :logs
|
|
22
22
|
|
|
23
23
|
# @api private
|
|
24
24
|
sig { override.returns(T::Hash[String, String]) }
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
# List of logs to track
|
|
15
|
+
sig { returns(T::Array[Userplex::LogBatchParams::Log]) }
|
|
16
|
+
attr_accessor :logs
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(
|
|
20
|
+
logs: T::Array[Userplex::LogBatchParams::Log::OrHash],
|
|
21
|
+
request_options: Userplex::RequestOptions::OrHash
|
|
22
|
+
).returns(T.attached_class)
|
|
23
|
+
end
|
|
24
|
+
def self.new(
|
|
25
|
+
# List of logs to track
|
|
26
|
+
logs:,
|
|
27
|
+
request_options: {}
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
sig do
|
|
32
|
+
override.returns(
|
|
33
|
+
{
|
|
34
|
+
logs: T::Array[Userplex::LogBatchParams::Log],
|
|
35
|
+
request_options: Userplex::RequestOptions
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
def to_hash
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
class Log < Userplex::Internal::Type::BaseModel
|
|
43
|
+
OrHash =
|
|
44
|
+
T.type_alias do
|
|
45
|
+
T.any(Userplex::LogBatchParams::Log, Userplex::Internal::AnyHash)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
sig { returns(String) }
|
|
49
|
+
attr_accessor :name
|
|
50
|
+
|
|
51
|
+
# External user ID
|
|
52
|
+
sig { returns(String) }
|
|
53
|
+
attr_accessor :user_id
|
|
54
|
+
|
|
55
|
+
# Additional log data
|
|
56
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
|
|
57
|
+
attr_reader :data
|
|
58
|
+
|
|
59
|
+
sig { params(data: T::Hash[Symbol, T.nilable(T.anything)]).void }
|
|
60
|
+
attr_writer :data
|
|
61
|
+
|
|
62
|
+
# Alias for data, for compatibility
|
|
63
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
|
|
64
|
+
attr_reader :properties
|
|
65
|
+
|
|
66
|
+
sig { params(properties: T::Hash[Symbol, T.nilable(T.anything)]).void }
|
|
67
|
+
attr_writer :properties
|
|
68
|
+
|
|
69
|
+
# Log timestamp (ISO 8601)
|
|
70
|
+
sig { returns(T.nilable(Time)) }
|
|
71
|
+
attr_reader :timestamp
|
|
72
|
+
|
|
73
|
+
sig { params(timestamp: Time).void }
|
|
74
|
+
attr_writer :timestamp
|
|
75
|
+
|
|
76
|
+
sig do
|
|
77
|
+
params(
|
|
78
|
+
name: String,
|
|
79
|
+
user_id: String,
|
|
80
|
+
data: T::Hash[Symbol, T.nilable(T.anything)],
|
|
81
|
+
properties: T::Hash[Symbol, T.nilable(T.anything)],
|
|
82
|
+
timestamp: Time
|
|
83
|
+
).returns(T.attached_class)
|
|
84
|
+
end
|
|
85
|
+
def self.new(
|
|
86
|
+
name:,
|
|
87
|
+
# External user ID
|
|
88
|
+
user_id:,
|
|
89
|
+
# Additional log data
|
|
90
|
+
data: nil,
|
|
91
|
+
# Alias for data, for compatibility
|
|
92
|
+
properties: nil,
|
|
93
|
+
# Log timestamp (ISO 8601)
|
|
94
|
+
timestamp: nil
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
sig do
|
|
99
|
+
override.returns(
|
|
100
|
+
{
|
|
101
|
+
name: String,
|
|
102
|
+
user_id: String,
|
|
103
|
+
data: T::Hash[Symbol, T.nilable(T.anything)],
|
|
104
|
+
properties: T::Hash[Symbol, T.nilable(T.anything)],
|
|
105
|
+
timestamp: Time
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
def to_hash
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Userplex
|
|
4
|
+
module Models
|
|
5
|
+
class LogBatchResponse < Userplex::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Userplex::Models::LogBatchResponse, Userplex::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Number of logs processed
|
|
12
|
+
sig { returns(Float) }
|
|
13
|
+
attr_accessor :count
|
|
14
|
+
|
|
15
|
+
# Operation success status
|
|
16
|
+
sig { returns(T::Boolean) }
|
|
17
|
+
attr_accessor :success
|
|
18
|
+
|
|
19
|
+
sig do
|
|
20
|
+
params(count: Float, success: T::Boolean).returns(T.attached_class)
|
|
21
|
+
end
|
|
22
|
+
def self.new(
|
|
23
|
+
# Number of logs processed
|
|
24
|
+
count:,
|
|
25
|
+
# Operation success status
|
|
26
|
+
success:
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig { override.returns({ count: Float, success: T::Boolean }) }
|
|
31
|
+
def to_hash
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module Userplex
|
|
4
4
|
module Models
|
|
5
|
-
class
|
|
5
|
+
class LogNewParams < 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::LogNewParams, Userplex::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
sig { returns(String) }
|
|
@@ -18,14 +18,21 @@ module Userplex
|
|
|
18
18
|
sig { returns(String) }
|
|
19
19
|
attr_accessor :user_id
|
|
20
20
|
|
|
21
|
-
# Additional
|
|
21
|
+
# Additional log data
|
|
22
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
|
|
23
|
+
attr_reader :data
|
|
24
|
+
|
|
25
|
+
sig { params(data: T::Hash[Symbol, T.nilable(T.anything)]).void }
|
|
26
|
+
attr_writer :data
|
|
27
|
+
|
|
28
|
+
# Alias for data, for compatibility
|
|
22
29
|
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
|
|
23
30
|
attr_reader :properties
|
|
24
31
|
|
|
25
32
|
sig { params(properties: T::Hash[Symbol, T.nilable(T.anything)]).void }
|
|
26
33
|
attr_writer :properties
|
|
27
34
|
|
|
28
|
-
#
|
|
35
|
+
# Log timestamp (ISO 8601)
|
|
29
36
|
sig { returns(T.nilable(Time)) }
|
|
30
37
|
attr_reader :timestamp
|
|
31
38
|
|
|
@@ -36,6 +43,7 @@ module Userplex
|
|
|
36
43
|
params(
|
|
37
44
|
name: String,
|
|
38
45
|
user_id: String,
|
|
46
|
+
data: T::Hash[Symbol, T.nilable(T.anything)],
|
|
39
47
|
properties: T::Hash[Symbol, T.nilable(T.anything)],
|
|
40
48
|
timestamp: Time,
|
|
41
49
|
request_options: Userplex::RequestOptions::OrHash
|
|
@@ -45,9 +53,11 @@ module Userplex
|
|
|
45
53
|
name:,
|
|
46
54
|
# External user ID
|
|
47
55
|
user_id:,
|
|
48
|
-
# Additional
|
|
56
|
+
# Additional log data
|
|
57
|
+
data: nil,
|
|
58
|
+
# Alias for data, for compatibility
|
|
49
59
|
properties: nil,
|
|
50
|
-
#
|
|
60
|
+
# Log timestamp (ISO 8601)
|
|
51
61
|
timestamp: nil,
|
|
52
62
|
request_options: {}
|
|
53
63
|
)
|
|
@@ -58,6 +68,7 @@ module Userplex
|
|
|
58
68
|
{
|
|
59
69
|
name: String,
|
|
60
70
|
user_id: String,
|
|
71
|
+
data: T::Hash[Symbol, T.nilable(T.anything)],
|
|
61
72
|
properties: T::Hash[Symbol, T.nilable(T.anything)],
|
|
62
73
|
timestamp: Time,
|
|
63
74
|
request_options: Userplex::RequestOptions
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module Userplex
|
|
4
4
|
module Models
|
|
5
|
-
class
|
|
5
|
+
class LogNewResponse < Userplex::Internal::Type::BaseModel
|
|
6
6
|
OrHash =
|
|
7
7
|
T.type_alias do
|
|
8
|
-
T.any(Userplex::Models::
|
|
8
|
+
T.any(Userplex::Models::LogNewResponse, Userplex::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
# Operation success status
|
data/rbi/userplex/models.rbi
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Userplex
|
|
4
|
+
module Resources
|
|
5
|
+
class Logs
|
|
6
|
+
# Records multiple log occurrences in a single request. Requires a valid API key
|
|
7
|
+
# for authentication.
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
logs: T::Array[Userplex::LogBatchParams::Log::OrHash],
|
|
11
|
+
request_options: Userplex::RequestOptions::OrHash
|
|
12
|
+
).returns(Userplex::Models::LogBatchResponse)
|
|
13
|
+
end
|
|
14
|
+
def batch(
|
|
15
|
+
# List of logs to track
|
|
16
|
+
logs:,
|
|
17
|
+
request_options: {}
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Creates or uses an existing log and records a log occurrence for an end user.
|
|
22
|
+
# Requires a valid API key for authentication.
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
name: String,
|
|
26
|
+
user_id: String,
|
|
27
|
+
data: T::Hash[Symbol, T.nilable(T.anything)],
|
|
28
|
+
properties: T::Hash[Symbol, T.nilable(T.anything)],
|
|
29
|
+
timestamp: Time,
|
|
30
|
+
request_options: Userplex::RequestOptions::OrHash
|
|
31
|
+
).returns(Userplex::Models::LogNewResponse)
|
|
32
|
+
end
|
|
33
|
+
def new(
|
|
34
|
+
name:,
|
|
35
|
+
# External user ID
|
|
36
|
+
user_id:,
|
|
37
|
+
# Additional log data
|
|
38
|
+
data: nil,
|
|
39
|
+
# Alias for data, for compatibility
|
|
40
|
+
properties: nil,
|
|
41
|
+
# Log timestamp (ISO 8601)
|
|
42
|
+
timestamp: nil,
|
|
43
|
+
request_options: {}
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# @api private
|
|
48
|
+
sig { params(client: Userplex::Client).returns(T.attached_class) }
|
|
49
|
+
def self.new(client:)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
data/sig/userplex/client.rbs
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
module Userplex
|
|
2
|
+
module Models
|
|
3
|
+
type log_batch_params =
|
|
4
|
+
{ logs: ::Array[Userplex::LogBatchParams::Log] }
|
|
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_accessor logs: ::Array[Userplex::LogBatchParams::Log]
|
|
12
|
+
|
|
13
|
+
def initialize: (
|
|
14
|
+
logs: ::Array[Userplex::LogBatchParams::Log],
|
|
15
|
+
?request_options: Userplex::request_opts
|
|
16
|
+
) -> void
|
|
17
|
+
|
|
18
|
+
def to_hash: -> {
|
|
19
|
+
logs: ::Array[Userplex::LogBatchParams::Log],
|
|
20
|
+
request_options: Userplex::RequestOptions
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type log =
|
|
24
|
+
{
|
|
25
|
+
name: String,
|
|
26
|
+
user_id: String,
|
|
27
|
+
data: ::Hash[Symbol, top?],
|
|
28
|
+
properties: ::Hash[Symbol, top?],
|
|
29
|
+
timestamp: Time
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
class Log < Userplex::Internal::Type::BaseModel
|
|
33
|
+
attr_accessor name: String
|
|
34
|
+
|
|
35
|
+
attr_accessor user_id: String
|
|
36
|
+
|
|
37
|
+
attr_reader data: ::Hash[Symbol, top?]?
|
|
38
|
+
|
|
39
|
+
def data=: (::Hash[Symbol, top?]) -> ::Hash[Symbol, top?]
|
|
40
|
+
|
|
41
|
+
attr_reader properties: ::Hash[Symbol, top?]?
|
|
42
|
+
|
|
43
|
+
def properties=: (::Hash[Symbol, top?]) -> ::Hash[Symbol, top?]
|
|
44
|
+
|
|
45
|
+
attr_reader timestamp: Time?
|
|
46
|
+
|
|
47
|
+
def timestamp=: (Time) -> Time
|
|
48
|
+
|
|
49
|
+
def initialize: (
|
|
50
|
+
name: String,
|
|
51
|
+
user_id: String,
|
|
52
|
+
?data: ::Hash[Symbol, top?],
|
|
53
|
+
?properties: ::Hash[Symbol, top?],
|
|
54
|
+
?timestamp: Time
|
|
55
|
+
) -> void
|
|
56
|
+
|
|
57
|
+
def to_hash: -> {
|
|
58
|
+
name: String,
|
|
59
|
+
user_id: String,
|
|
60
|
+
data: ::Hash[Symbol, top?],
|
|
61
|
+
properties: ::Hash[Symbol, top?],
|
|
62
|
+
timestamp: Time
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Userplex
|
|
2
|
+
module Models
|
|
3
|
+
type log_batch_response = { count: Float, success: bool }
|
|
4
|
+
|
|
5
|
+
class LogBatchResponse < Userplex::Internal::Type::BaseModel
|
|
6
|
+
attr_accessor count: Float
|
|
7
|
+
|
|
8
|
+
attr_accessor success: bool
|
|
9
|
+
|
|
10
|
+
def initialize: (count: Float, success: bool) -> void
|
|
11
|
+
|
|
12
|
+
def to_hash: -> { count: Float, success: bool }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
module Userplex
|
|
2
2
|
module Models
|
|
3
|
-
type
|
|
3
|
+
type log_new_params =
|
|
4
4
|
{
|
|
5
5
|
name: String,
|
|
6
6
|
user_id: String,
|
|
7
|
+
data: ::Hash[Symbol, top?],
|
|
7
8
|
properties: ::Hash[Symbol, top?],
|
|
8
9
|
timestamp: Time
|
|
9
10
|
}
|
|
10
11
|
& Userplex::Internal::Type::request_parameters
|
|
11
12
|
|
|
12
|
-
class
|
|
13
|
+
class LogNewParams < Userplex::Internal::Type::BaseModel
|
|
13
14
|
extend Userplex::Internal::Type::RequestParameters::Converter
|
|
14
15
|
include Userplex::Internal::Type::RequestParameters
|
|
15
16
|
|
|
@@ -17,6 +18,10 @@ module Userplex
|
|
|
17
18
|
|
|
18
19
|
attr_accessor user_id: String
|
|
19
20
|
|
|
21
|
+
attr_reader data: ::Hash[Symbol, top?]?
|
|
22
|
+
|
|
23
|
+
def data=: (::Hash[Symbol, top?]) -> ::Hash[Symbol, top?]
|
|
24
|
+
|
|
20
25
|
attr_reader properties: ::Hash[Symbol, top?]?
|
|
21
26
|
|
|
22
27
|
def properties=: (::Hash[Symbol, top?]) -> ::Hash[Symbol, top?]
|
|
@@ -28,6 +33,7 @@ module Userplex
|
|
|
28
33
|
def initialize: (
|
|
29
34
|
name: String,
|
|
30
35
|
user_id: String,
|
|
36
|
+
?data: ::Hash[Symbol, top?],
|
|
31
37
|
?properties: ::Hash[Symbol, top?],
|
|
32
38
|
?timestamp: Time,
|
|
33
39
|
?request_options: Userplex::request_opts
|
|
@@ -36,6 +42,7 @@ module Userplex
|
|
|
36
42
|
def to_hash: -> {
|
|
37
43
|
name: String,
|
|
38
44
|
user_id: String,
|
|
45
|
+
data: ::Hash[Symbol, top?],
|
|
39
46
|
properties: ::Hash[Symbol, top?],
|
|
40
47
|
timestamp: Time,
|
|
41
48
|
request_options: Userplex::RequestOptions
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module Userplex
|
|
2
2
|
module Models
|
|
3
|
-
type
|
|
3
|
+
type log_new_response = { success: bool }
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class LogNewResponse < 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,13 +1,19 @@
|
|
|
1
1
|
module Userplex
|
|
2
2
|
module Resources
|
|
3
|
-
class
|
|
3
|
+
class Logs
|
|
4
|
+
def batch: (
|
|
5
|
+
logs: ::Array[Userplex::LogBatchParams::Log],
|
|
6
|
+
?request_options: Userplex::request_opts
|
|
7
|
+
) -> Userplex::Models::LogBatchResponse
|
|
8
|
+
|
|
4
9
|
def new: (
|
|
5
10
|
name: String,
|
|
6
11
|
user_id: String,
|
|
12
|
+
?data: ::Hash[Symbol, top?],
|
|
7
13
|
?properties: ::Hash[Symbol, top?],
|
|
8
14
|
?timestamp: Time,
|
|
9
15
|
?request_options: Userplex::request_opts
|
|
10
|
-
) -> Userplex::Models::
|
|
16
|
+
) -> Userplex::Models::LogNewResponse
|
|
11
17
|
|
|
12
18
|
def initialize: (client: Userplex::Client) -> void
|
|
13
19
|
end
|
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
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Userplex
|
|
@@ -55,12 +55,14 @@ 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/
|
|
58
|
+
- lib/userplex/models/log_batch_params.rb
|
|
59
|
+
- lib/userplex/models/log_batch_response.rb
|
|
60
|
+
- lib/userplex/models/log_new_params.rb
|
|
61
|
+
- lib/userplex/models/log_new_response.rb
|
|
60
62
|
- lib/userplex/models/user_identify_params.rb
|
|
61
63
|
- lib/userplex/models/user_identify_response.rb
|
|
62
64
|
- lib/userplex/request_options.rb
|
|
63
|
-
- lib/userplex/resources/
|
|
65
|
+
- lib/userplex/resources/logs.rb
|
|
64
66
|
- lib/userplex/resources/users.rb
|
|
65
67
|
- lib/userplex/version.rb
|
|
66
68
|
- manifest.yaml
|
|
@@ -83,12 +85,14 @@ files:
|
|
|
83
85
|
- rbi/userplex/internal/type/unknown.rbi
|
|
84
86
|
- rbi/userplex/internal/util.rbi
|
|
85
87
|
- rbi/userplex/models.rbi
|
|
86
|
-
- rbi/userplex/models/
|
|
87
|
-
- rbi/userplex/models/
|
|
88
|
+
- rbi/userplex/models/log_batch_params.rbi
|
|
89
|
+
- rbi/userplex/models/log_batch_response.rbi
|
|
90
|
+
- rbi/userplex/models/log_new_params.rbi
|
|
91
|
+
- rbi/userplex/models/log_new_response.rbi
|
|
88
92
|
- rbi/userplex/models/user_identify_params.rbi
|
|
89
93
|
- rbi/userplex/models/user_identify_response.rbi
|
|
90
94
|
- rbi/userplex/request_options.rbi
|
|
91
|
-
- rbi/userplex/resources/
|
|
95
|
+
- rbi/userplex/resources/logs.rbi
|
|
92
96
|
- rbi/userplex/resources/users.rbi
|
|
93
97
|
- rbi/userplex/version.rbi
|
|
94
98
|
- sig/userplex/client.rbs
|
|
@@ -110,12 +114,14 @@ files:
|
|
|
110
114
|
- sig/userplex/internal/type/unknown.rbs
|
|
111
115
|
- sig/userplex/internal/util.rbs
|
|
112
116
|
- sig/userplex/models.rbs
|
|
113
|
-
- sig/userplex/models/
|
|
114
|
-
- sig/userplex/models/
|
|
117
|
+
- sig/userplex/models/log_batch_params.rbs
|
|
118
|
+
- sig/userplex/models/log_batch_response.rbs
|
|
119
|
+
- sig/userplex/models/log_new_params.rbs
|
|
120
|
+
- sig/userplex/models/log_new_response.rbs
|
|
115
121
|
- sig/userplex/models/user_identify_params.rbs
|
|
116
122
|
- sig/userplex/models/user_identify_response.rbs
|
|
117
123
|
- sig/userplex/request_options.rbs
|
|
118
|
-
- sig/userplex/resources/
|
|
124
|
+
- sig/userplex/resources/logs.rbs
|
|
119
125
|
- sig/userplex/resources/users.rbs
|
|
120
126
|
- sig/userplex/version.rbs
|
|
121
127
|
homepage: https://gemdocs.org/gems/userplex
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Userplex
|
|
4
|
-
module Resources
|
|
5
|
-
class Events
|
|
6
|
-
# Creates or uses an existing event and records an event occurrence for an end
|
|
7
|
-
# user. Requires a valid API key for authentication.
|
|
8
|
-
#
|
|
9
|
-
# @overload new(name:, user_id:, properties: nil, timestamp: nil, request_options: {})
|
|
10
|
-
#
|
|
11
|
-
# @param name [String]
|
|
12
|
-
#
|
|
13
|
-
# @param user_id [String] External user ID
|
|
14
|
-
#
|
|
15
|
-
# @param properties [Hash{Symbol=>Object, nil}] Additional event properties
|
|
16
|
-
#
|
|
17
|
-
# @param timestamp [Time] Event timestamp (ISO 8601)
|
|
18
|
-
#
|
|
19
|
-
# @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
20
|
-
#
|
|
21
|
-
# @return [Userplex::Models::EventNewResponse]
|
|
22
|
-
#
|
|
23
|
-
# @see Userplex::Models::EventNewParams
|
|
24
|
-
def new(params)
|
|
25
|
-
parsed, options = Userplex::EventNewParams.dump_request(params)
|
|
26
|
-
@client.request(
|
|
27
|
-
method: :post,
|
|
28
|
-
path: "api/event",
|
|
29
|
-
body: parsed,
|
|
30
|
-
model: Userplex::Models::EventNewResponse,
|
|
31
|
-
options: options
|
|
32
|
-
)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# @api private
|
|
36
|
-
#
|
|
37
|
-
# @param client [Userplex::Client]
|
|
38
|
-
def initialize(client:)
|
|
39
|
-
@client = client
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module Userplex
|
|
4
|
-
module Resources
|
|
5
|
-
class Events
|
|
6
|
-
# Creates or uses an existing event and records an event occurrence for an end
|
|
7
|
-
# user. Requires a valid API key for authentication.
|
|
8
|
-
sig do
|
|
9
|
-
params(
|
|
10
|
-
name: String,
|
|
11
|
-
user_id: String,
|
|
12
|
-
properties: T::Hash[Symbol, T.nilable(T.anything)],
|
|
13
|
-
timestamp: Time,
|
|
14
|
-
request_options: Userplex::RequestOptions::OrHash
|
|
15
|
-
).returns(Userplex::Models::EventNewResponse)
|
|
16
|
-
end
|
|
17
|
-
def new(
|
|
18
|
-
name:,
|
|
19
|
-
# External user ID
|
|
20
|
-
user_id:,
|
|
21
|
-
# Additional event properties
|
|
22
|
-
properties: nil,
|
|
23
|
-
# Event timestamp (ISO 8601)
|
|
24
|
-
timestamp: nil,
|
|
25
|
-
request_options: {}
|
|
26
|
-
)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
# @api private
|
|
30
|
-
sig { params(client: Userplex::Client).returns(T.attached_class) }
|
|
31
|
-
def self.new(client:)
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|