userplex 0.7.0 → 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 +8 -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/log_new_params.rb +53 -0
- data/lib/userplex/models/log_new_response.rb +17 -0
- data/lib/userplex/models.rb +4 -0
- data/lib/userplex/resources/logs.rb +68 -0
- data/lib/userplex/version.rb +1 -1
- data/lib/userplex.rb +5 -1
- 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/log_new_params.rbi +82 -0
- data/rbi/userplex/models/log_new_response.rbi +27 -0
- data/rbi/userplex/models.rbi +4 -0
- 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/log_new_params.rbs +52 -0
- data/sig/userplex/models/log_new_response.rbs +13 -0
- data/sig/userplex/models.rbs +4 -0
- data/sig/userplex/resources/logs.rbs +21 -0
- metadata +16 -4
- data/lib/userplex/resources/events.rb +0 -14
- data/rbi/userplex/resources/events.rbi +0 -12
- data/sig/userplex/resources/events.rbs +0 -7
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,13 @@
|
|
|
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
|
+
|
|
3
11
|
## 0.7.0 (2025-12-19)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.6.2...v0.7.0](https://github.com/dqnamo/userplex-ruby/compare/v0.6.2...v0.7.0)
|
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
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Userplex
|
|
4
|
+
module Models
|
|
5
|
+
# @see Userplex::Resources::Logs#new
|
|
6
|
+
class LogNewParams < Userplex::Internal::Type::BaseModel
|
|
7
|
+
extend Userplex::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Userplex::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute name
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :name, String
|
|
14
|
+
|
|
15
|
+
# @!attribute user_id
|
|
16
|
+
# External user ID
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :user_id, String
|
|
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
|
+
|
|
27
|
+
# @!attribute properties
|
|
28
|
+
# Alias for data, for compatibility
|
|
29
|
+
#
|
|
30
|
+
# @return [Hash{Symbol=>Object, nil}, nil]
|
|
31
|
+
optional :properties, Userplex::Internal::Type::HashOf[Userplex::Internal::Type::Unknown, nil?: true]
|
|
32
|
+
|
|
33
|
+
# @!attribute timestamp
|
|
34
|
+
# Log timestamp (ISO 8601)
|
|
35
|
+
#
|
|
36
|
+
# @return [Time, nil]
|
|
37
|
+
optional :timestamp, Time
|
|
38
|
+
|
|
39
|
+
# @!method initialize(name:, user_id:, data: nil, properties: nil, timestamp: nil, request_options: {})
|
|
40
|
+
# @param name [String]
|
|
41
|
+
#
|
|
42
|
+
# @param user_id [String] External user ID
|
|
43
|
+
#
|
|
44
|
+
# @param data [Hash{Symbol=>Object, nil}] Additional log data
|
|
45
|
+
#
|
|
46
|
+
# @param properties [Hash{Symbol=>Object, nil}] Alias for data, for compatibility
|
|
47
|
+
#
|
|
48
|
+
# @param timestamp [Time] Log timestamp (ISO 8601)
|
|
49
|
+
#
|
|
50
|
+
# @param request_options [Userplex::RequestOptions, Hash{Symbol=>Object}]
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
# Operation success status
|
|
9
|
+
#
|
|
10
|
+
# @return [Boolean]
|
|
11
|
+
required :success, Userplex::Internal::Type::Boolean
|
|
12
|
+
|
|
13
|
+
# @!method initialize(success:)
|
|
14
|
+
# @param success [Boolean] Operation success status
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/lib/userplex/models.rb
CHANGED
|
@@ -39,5 +39,9 @@ module Userplex
|
|
|
39
39
|
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
LogBatchParams = Userplex::Models::LogBatchParams
|
|
43
|
+
|
|
44
|
+
LogNewParams = Userplex::Models::LogNewParams
|
|
45
|
+
|
|
42
46
|
UserIdentifyParams = Userplex::Models::UserIdentifyParams
|
|
43
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,8 +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/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"
|
|
55
59
|
require_relative "userplex/models/user_identify_params"
|
|
56
60
|
require_relative "userplex/models/user_identify_response"
|
|
57
61
|
require_relative "userplex/models"
|
|
58
|
-
require_relative "userplex/resources/
|
|
62
|
+
require_relative "userplex/resources/logs"
|
|
59
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
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Userplex
|
|
4
|
+
module Models
|
|
5
|
+
class LogNewParams < 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::LogNewParams, Userplex::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :name
|
|
16
|
+
|
|
17
|
+
# External user ID
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :user_id
|
|
20
|
+
|
|
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
|
|
29
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
|
|
30
|
+
attr_reader :properties
|
|
31
|
+
|
|
32
|
+
sig { params(properties: T::Hash[Symbol, T.nilable(T.anything)]).void }
|
|
33
|
+
attr_writer :properties
|
|
34
|
+
|
|
35
|
+
# Log timestamp (ISO 8601)
|
|
36
|
+
sig { returns(T.nilable(Time)) }
|
|
37
|
+
attr_reader :timestamp
|
|
38
|
+
|
|
39
|
+
sig { params(timestamp: Time).void }
|
|
40
|
+
attr_writer :timestamp
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
name: String,
|
|
45
|
+
user_id: String,
|
|
46
|
+
data: T::Hash[Symbol, T.nilable(T.anything)],
|
|
47
|
+
properties: T::Hash[Symbol, T.nilable(T.anything)],
|
|
48
|
+
timestamp: Time,
|
|
49
|
+
request_options: Userplex::RequestOptions::OrHash
|
|
50
|
+
).returns(T.attached_class)
|
|
51
|
+
end
|
|
52
|
+
def self.new(
|
|
53
|
+
name:,
|
|
54
|
+
# External user ID
|
|
55
|
+
user_id:,
|
|
56
|
+
# Additional log data
|
|
57
|
+
data: nil,
|
|
58
|
+
# Alias for data, for compatibility
|
|
59
|
+
properties: nil,
|
|
60
|
+
# Log timestamp (ISO 8601)
|
|
61
|
+
timestamp: nil,
|
|
62
|
+
request_options: {}
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
sig do
|
|
67
|
+
override.returns(
|
|
68
|
+
{
|
|
69
|
+
name: String,
|
|
70
|
+
user_id: String,
|
|
71
|
+
data: T::Hash[Symbol, T.nilable(T.anything)],
|
|
72
|
+
properties: T::Hash[Symbol, T.nilable(T.anything)],
|
|
73
|
+
timestamp: Time,
|
|
74
|
+
request_options: Userplex::RequestOptions
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
def to_hash
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
# Operation success status
|
|
12
|
+
sig { returns(T::Boolean) }
|
|
13
|
+
attr_accessor :success
|
|
14
|
+
|
|
15
|
+
sig { params(success: T::Boolean).returns(T.attached_class) }
|
|
16
|
+
def self.new(
|
|
17
|
+
# Operation success status
|
|
18
|
+
success:
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
sig { override.returns({ success: T::Boolean }) }
|
|
23
|
+
def to_hash
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
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
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module Userplex
|
|
2
|
+
module Models
|
|
3
|
+
type log_new_params =
|
|
4
|
+
{
|
|
5
|
+
name: String,
|
|
6
|
+
user_id: String,
|
|
7
|
+
data: ::Hash[Symbol, top?],
|
|
8
|
+
properties: ::Hash[Symbol, top?],
|
|
9
|
+
timestamp: Time
|
|
10
|
+
}
|
|
11
|
+
& Userplex::Internal::Type::request_parameters
|
|
12
|
+
|
|
13
|
+
class LogNewParams < Userplex::Internal::Type::BaseModel
|
|
14
|
+
extend Userplex::Internal::Type::RequestParameters::Converter
|
|
15
|
+
include Userplex::Internal::Type::RequestParameters
|
|
16
|
+
|
|
17
|
+
attr_accessor name: String
|
|
18
|
+
|
|
19
|
+
attr_accessor user_id: String
|
|
20
|
+
|
|
21
|
+
attr_reader data: ::Hash[Symbol, top?]?
|
|
22
|
+
|
|
23
|
+
def data=: (::Hash[Symbol, top?]) -> ::Hash[Symbol, top?]
|
|
24
|
+
|
|
25
|
+
attr_reader properties: ::Hash[Symbol, top?]?
|
|
26
|
+
|
|
27
|
+
def properties=: (::Hash[Symbol, top?]) -> ::Hash[Symbol, top?]
|
|
28
|
+
|
|
29
|
+
attr_reader timestamp: Time?
|
|
30
|
+
|
|
31
|
+
def timestamp=: (Time) -> Time
|
|
32
|
+
|
|
33
|
+
def initialize: (
|
|
34
|
+
name: String,
|
|
35
|
+
user_id: String,
|
|
36
|
+
?data: ::Hash[Symbol, top?],
|
|
37
|
+
?properties: ::Hash[Symbol, top?],
|
|
38
|
+
?timestamp: Time,
|
|
39
|
+
?request_options: Userplex::request_opts
|
|
40
|
+
) -> void
|
|
41
|
+
|
|
42
|
+
def to_hash: -> {
|
|
43
|
+
name: String,
|
|
44
|
+
user_id: String,
|
|
45
|
+
data: ::Hash[Symbol, top?],
|
|
46
|
+
properties: ::Hash[Symbol, top?],
|
|
47
|
+
timestamp: Time,
|
|
48
|
+
request_options: Userplex::RequestOptions
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
data/sig/userplex/models.rbs
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Userplex
|
|
2
|
+
module Resources
|
|
3
|
+
class Logs
|
|
4
|
+
def batch: (
|
|
5
|
+
logs: ::Array[Userplex::LogBatchParams::Log],
|
|
6
|
+
?request_options: Userplex::request_opts
|
|
7
|
+
) -> Userplex::Models::LogBatchResponse
|
|
8
|
+
|
|
9
|
+
def new: (
|
|
10
|
+
name: String,
|
|
11
|
+
user_id: String,
|
|
12
|
+
?data: ::Hash[Symbol, top?],
|
|
13
|
+
?properties: ::Hash[Symbol, top?],
|
|
14
|
+
?timestamp: Time,
|
|
15
|
+
?request_options: Userplex::request_opts
|
|
16
|
+
) -> Userplex::Models::LogNewResponse
|
|
17
|
+
|
|
18
|
+
def initialize: (client: Userplex::Client) -> void
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
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,10 +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/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
|
|
58
62
|
- lib/userplex/models/user_identify_params.rb
|
|
59
63
|
- lib/userplex/models/user_identify_response.rb
|
|
60
64
|
- lib/userplex/request_options.rb
|
|
61
|
-
- lib/userplex/resources/
|
|
65
|
+
- lib/userplex/resources/logs.rb
|
|
62
66
|
- lib/userplex/resources/users.rb
|
|
63
67
|
- lib/userplex/version.rb
|
|
64
68
|
- manifest.yaml
|
|
@@ -81,10 +85,14 @@ files:
|
|
|
81
85
|
- rbi/userplex/internal/type/unknown.rbi
|
|
82
86
|
- rbi/userplex/internal/util.rbi
|
|
83
87
|
- rbi/userplex/models.rbi
|
|
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
|
|
84
92
|
- rbi/userplex/models/user_identify_params.rbi
|
|
85
93
|
- rbi/userplex/models/user_identify_response.rbi
|
|
86
94
|
- rbi/userplex/request_options.rbi
|
|
87
|
-
- rbi/userplex/resources/
|
|
95
|
+
- rbi/userplex/resources/logs.rbi
|
|
88
96
|
- rbi/userplex/resources/users.rbi
|
|
89
97
|
- rbi/userplex/version.rbi
|
|
90
98
|
- sig/userplex/client.rbs
|
|
@@ -106,10 +114,14 @@ files:
|
|
|
106
114
|
- sig/userplex/internal/type/unknown.rbs
|
|
107
115
|
- sig/userplex/internal/util.rbs
|
|
108
116
|
- sig/userplex/models.rbs
|
|
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
|
|
109
121
|
- sig/userplex/models/user_identify_params.rbs
|
|
110
122
|
- sig/userplex/models/user_identify_response.rbs
|
|
111
123
|
- sig/userplex/request_options.rbs
|
|
112
|
-
- sig/userplex/resources/
|
|
124
|
+
- sig/userplex/resources/logs.rbs
|
|
113
125
|
- sig/userplex/resources/users.rbs
|
|
114
126
|
- sig/userplex/version.rbs
|
|
115
127
|
homepage: https://gemdocs.org/gems/userplex
|