altertable 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42523b8dd9072dbe3eb2756a5a496de2c9e3db0db518b6ae2620c4c383bb7547
4
- data.tar.gz: 4fc356b335e47bab34332d4ca42e5d4994381bd388da5079106e96b6c28d6c28
3
+ metadata.gz: e0d8bbcf3d0a16093a6dd081bebe5d26d36abd91abeee71d8f11bac2ccfbac2c
4
+ data.tar.gz: 23ed4a849df8c765bc6bf383bf0b58b368d6b6c63be1105b27acc2589a2ad7c7
5
5
  SHA512:
6
- metadata.gz: 597516dc39dfca5c441174e83dfc519ddc73a81c9a9b88eaeb666262ed255dac382b87870c183ac1c154c382d141c255eef15e0059c3bd5f25c42445f0ae71b9
7
- data.tar.gz: 5146fdc9c3b3693ba18196ec27fa5870e6ea690647632ead38f7c1424f343a42aa76396d5cae5ce42f1471a2088da5d926e5928761c60485dc0c8037bbcbca42
6
+ metadata.gz: 40b209ff5eb900a7ffbad8a0bac3abb67b11a0e5191eb4fdcd8c2d4db1acb3e5135bef6345c54c3846cb2452dada718796059e9462787086d14c9659e37ad532
7
+ data.tar.gz: 073c87ac9409ed80d4c03d7762493dc5e9126811736385b313db3fa590dd55d6144fdea582ca85a1c1837bfa60b7a83374d174f051199ca82f6334c3bc317497
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.2.2"
2
+ ".": "0.4.0"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.0](https://github.com/altertable-ai/altertable-ruby/compare/altertable/v0.3.0...altertable/v0.4.0) (2026-03-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * Add Sorbet typings (RBI) ([#21](https://github.com/altertable-ai/altertable-ruby/issues/21)) ([507b41c](https://github.com/altertable-ai/altertable-ruby/commit/507b41c755d76758ed0de777acb8eeadea420758))
9
+
10
+ ## [0.3.0](https://github.com/altertable-ai/altertable-ruby/compare/altertable/v0.2.2...altertable/v0.3.0) (2026-03-09)
11
+
12
+
13
+ ### Features
14
+
15
+ * add RBS typings for the SDK ([#19](https://github.com/altertable-ai/altertable-ruby/issues/19)) ([38cb619](https://github.com/altertable-ai/altertable-ruby/commit/38cb619f20a7e2c1a1090fb67f7253e122e936c4))
16
+
3
17
  ## [0.2.2](https://github.com/altertable-ai/altertable-ruby/compare/altertable/v0.2.1...altertable/v0.2.2) (2026-03-08)
4
18
 
5
19
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- altertable (0.2.2)
4
+ altertable (0.4.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Altertable
4
- VERSION = "0.2.2"
4
+ VERSION = "0.4.0"
5
5
  end
@@ -0,0 +1,133 @@
1
+ # typed: true
2
+
3
+ module Altertable
4
+ VERSION = T.let(T.unsafe(nil), String)
5
+
6
+ class AltertableError < StandardError
7
+ sig { returns(T.nilable(Exception)) }
8
+ attr_reader :cause
9
+
10
+ sig { params(message: String, cause: T.nilable(Exception)).void }
11
+ def initialize(message, cause = nil); end
12
+ end
13
+
14
+ class ConfigurationError < AltertableError; end
15
+
16
+ class ApiError < AltertableError
17
+ sig { returns(Integer) }
18
+ attr_reader :status
19
+
20
+ sig { returns(T::Hash[String, T.untyped]) }
21
+ attr_reader :details
22
+
23
+ sig { params(message: String, status: Integer, details: T::Hash[String, T.untyped]).void }
24
+ def initialize(message, status, details = {}); end
25
+ end
26
+
27
+ class NetworkError < AltertableError; end
28
+
29
+ class Client
30
+ DEFAULT_BASE_URL = T.let(T.unsafe(nil), String)
31
+ DEFAULT_TIMEOUT = T.let(T.unsafe(nil), Integer)
32
+ DEFAULT_ENVIRONMENT = T.let(T.unsafe(nil), String)
33
+
34
+ sig { params(api_key: String, options: T::Hash[Symbol, T.untyped]).void }
35
+ def initialize(api_key, options = {}); end
36
+
37
+ sig { params(event: String, distinct_id: String, properties: T::Hash[T.any(Symbol, String), T.untyped]).returns(T.untyped) }
38
+ def track(event, distinct_id, properties = {}); end
39
+
40
+ sig { params(user_id: String, traits: T::Hash[T.any(Symbol, String), T.untyped]).returns(T.untyped) }
41
+ def identify(user_id, traits = {}); end
42
+
43
+ sig { params(new_user_id: String, previous_id: String).returns(T.untyped) }
44
+ def alias(new_user_id, previous_id); end
45
+
46
+ private
47
+
48
+ sig { params(name: T.nilable(Symbol), options: T::Hash[Symbol, T.untyped]).returns(T.untyped) }
49
+ def select_adapter(name, options); end
50
+
51
+ sig { params(gem_name: String).returns(T::Boolean) }
52
+ def try_require(gem_name); end
53
+
54
+ sig { params(path: String, payload: T::Hash[T.any(Symbol, String), T.untyped]).returns(T.untyped) }
55
+ def post(path, payload); end
56
+
57
+ sig { params(res: T.untyped).returns(T.untyped) }
58
+ def handle_response(res); end
59
+
60
+ sig { params(error: Exception).returns(T.untyped) }
61
+ def handle_error(error); end
62
+ end
63
+
64
+ module Adapters
65
+ class Response
66
+ sig { returns(Integer) }
67
+ attr_reader :status
68
+
69
+ sig { returns(String) }
70
+ attr_reader :body
71
+
72
+ sig { params(status: Integer, body: String).void }
73
+ def initialize(status, body); end
74
+ end
75
+
76
+ class Base
77
+ sig { params(base_url: String, timeout: T.any(Integer, Float), headers: T.nilable(T::Hash[String, String])).void }
78
+ def initialize(base_url:, timeout:, headers: nil); end
79
+
80
+ sig { params(path: String, body: T.nilable(String), params: T.nilable(T::Hash[T.any(Symbol, String), T.untyped])).returns(Response) }
81
+ def post(path, body: nil, params: nil); end
82
+ end
83
+
84
+ class FaradayAdapter < Base
85
+ sig { params(base_url: String, timeout: T.any(Integer, Float), headers: T.nilable(T::Hash[String, String])).void }
86
+ def initialize(base_url:, timeout:, headers: nil); end
87
+
88
+ sig { params(path: String, body: T.nilable(String), params: T.nilable(T::Hash[T.any(Symbol, String), T.untyped])).returns(Response) }
89
+ def post(path, body: nil, params: nil); end
90
+
91
+ private
92
+
93
+ sig { params(resp: T.untyped).returns(Response) }
94
+ def wrap_response(resp); end
95
+ end
96
+
97
+ class HttpxAdapter < Base
98
+ sig { params(base_url: String, timeout: T.any(Integer, Float), headers: T.nilable(T::Hash[String, String])).void }
99
+ def initialize(base_url:, timeout:, headers: nil); end
100
+
101
+ sig { params(path: String, body: T.nilable(String), params: T.nilable(T::Hash[T.any(Symbol, String), T.untyped])).returns(Response) }
102
+ def post(path, body: nil, params: nil); end
103
+
104
+ private
105
+
106
+ sig { params(resp: T.untyped).returns(Response) }
107
+ def wrap_response(resp); end
108
+ end
109
+
110
+ class NetHttpAdapter < Base
111
+ sig { params(base_url: String, timeout: T.any(Integer, Float), headers: T.nilable(T::Hash[String, String])).void }
112
+ def initialize(base_url:, timeout:, headers: nil); end
113
+
114
+ sig { params(path: String, body: T.nilable(String), params: T.nilable(T::Hash[T.any(Symbol, String), T.untyped])).returns(Response) }
115
+ def post(path, body: nil, params: nil); end
116
+ end
117
+ end
118
+
119
+ sig { params(api_key: String, options: T::Hash[Symbol, T.untyped]).returns(Client) }
120
+ def self.init(api_key, options = {}); end
121
+
122
+ sig { params(event: String, user_id: String, properties: T::Hash[T.any(Symbol, String), T.untyped]).returns(T.untyped) }
123
+ def self.track(event, user_id, properties = {}); end
124
+
125
+ sig { params(user_id: String, traits: T::Hash[T.any(Symbol, String), T.untyped]).returns(T.untyped) }
126
+ def self.identify(user_id, traits = {}); end
127
+
128
+ sig { params(new_user_id: String, previous_id: String).returns(T.untyped) }
129
+ def self.alias(new_user_id, previous_id); end
130
+
131
+ sig { returns(Client) }
132
+ def self.client; end
133
+ end
@@ -0,0 +1,48 @@
1
+ module Altertable
2
+ module Adapters
3
+ class Response
4
+ attr_reader status: Integer
5
+ attr_reader body: String
6
+
7
+ def initialize: (Integer status, String body) -> void
8
+ end
9
+
10
+ class Base
11
+ @base_url: String
12
+ @timeout: Integer | Float
13
+ @headers: ::Hash[String, String]
14
+
15
+ def initialize: (base_url: String, timeout: Integer | Float, ?headers: ::Hash[String, String]) -> void
16
+ def post: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped]) -> Response
17
+ end
18
+
19
+ class FaradayAdapter < Base
20
+ @conn: untyped
21
+
22
+ def initialize: (base_url: String, timeout: Integer | Float, ?headers: ::Hash[String, String]) -> void
23
+ def post: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped]) -> Response
24
+
25
+ private
26
+
27
+ def wrap_response: (untyped resp) -> Response
28
+ end
29
+
30
+ class HttpxAdapter < Base
31
+ @client: untyped
32
+
33
+ def initialize: (base_url: String, timeout: Integer | Float, ?headers: ::Hash[String, String]) -> void
34
+ def post: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped]) -> Response
35
+
36
+ private
37
+
38
+ def wrap_response: (untyped resp) -> Response
39
+ end
40
+
41
+ class NetHttpAdapter < Base
42
+ @uri: URI::HTTP | URI::HTTPS
43
+
44
+ def initialize: (base_url: String, timeout: Integer | Float, ?headers: ::Hash[String, String]) -> void
45
+ def post: (String path, ?body: String?, ?params: ::Hash[Symbol | String, untyped]) -> Response
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,32 @@
1
+ module Altertable
2
+ class Client
3
+ @api_key: String
4
+ @base_url: String
5
+ @environment: String
6
+ @timeout: Integer | Float
7
+ @release: String?
8
+ @debug: bool
9
+ @on_error: Proc?
10
+ @adapter: untyped
11
+
12
+ DEFAULT_BASE_URL: String
13
+ DEFAULT_TIMEOUT: Integer
14
+ DEFAULT_ENVIRONMENT: String
15
+
16
+ def initialize: (String api_key, ?::Hash[Symbol, untyped] options) -> void
17
+
18
+ def track: (String event, String distinct_id, ?::Hash[Symbol | String, untyped] properties) -> untyped
19
+
20
+ def identify: (String user_id, ?::Hash[Symbol | String, untyped] traits) -> untyped
21
+
22
+ def alias: (String new_user_id, String previous_id) -> untyped
23
+
24
+ private
25
+
26
+ def select_adapter: (Symbol? name, ::Hash[Symbol, untyped] options) -> untyped
27
+ def try_require: (String gem_name) -> bool
28
+ def post: (String path, ::Hash[Symbol | String, untyped] payload) -> untyped
29
+ def handle_response: (untyped res) -> untyped
30
+ def handle_error: (Exception error) -> untyped
31
+ end
32
+ end
@@ -0,0 +1,20 @@
1
+ module Altertable
2
+ class AltertableError < StandardError
3
+ attr_reader cause: Exception?
4
+
5
+ def initialize: (String message, ?Exception? cause) -> void
6
+ end
7
+
8
+ class ConfigurationError < AltertableError
9
+ end
10
+
11
+ class ApiError < AltertableError
12
+ attr_reader status: Integer
13
+ attr_reader details: ::Hash[String, untyped]
14
+
15
+ def initialize: (String message, Integer status, ?::Hash[String, untyped] details) -> void
16
+ end
17
+
18
+ class NetworkError < AltertableError
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ module Altertable
2
+ VERSION: String
3
+ end
@@ -0,0 +1,13 @@
1
+ module Altertable
2
+ @client: Client?
3
+
4
+ def self.init: (String api_key, ?::Hash[Symbol, untyped] options) -> Client
5
+
6
+ def self.track: (String event, String user_id, ?::Hash[Symbol | String, untyped] properties) -> untyped
7
+
8
+ def self.identify: (String user_id, ?::Hash[Symbol | String, untyped] traits) -> untyped
9
+
10
+ def self.alias: (String new_user_id, String previous_id) -> untyped
11
+
12
+ def self.client: () -> Client
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: altertable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Altertable
@@ -178,7 +178,13 @@ files:
178
178
  - lib/altertable/client.rb
179
179
  - lib/altertable/errors.rb
180
180
  - lib/altertable/version.rb
181
+ - rbi/altertable.rbi
181
182
  - release-please-config.json
183
+ - sig/altertable.rbs
184
+ - sig/altertable/adapters.rbs
185
+ - sig/altertable/client.rbs
186
+ - sig/altertable/errors.rbs
187
+ - sig/altertable/version.rbs
182
188
  homepage: https://github.com/altertable-ai/altertable-ruby
183
189
  licenses:
184
190
  - MIT