altertable 0.3.0 → 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: 2c8be063d691285f7602a24d6b3a1531423630d7381b458ede9756ada79239c0
4
- data.tar.gz: 56bcdd6d6fc488b2f611691bf36a483993695580b9e81984529d70bdcea381a9
3
+ metadata.gz: e0d8bbcf3d0a16093a6dd081bebe5d26d36abd91abeee71d8f11bac2ccfbac2c
4
+ data.tar.gz: 23ed4a849df8c765bc6bf383bf0b58b368d6b6c63be1105b27acc2589a2ad7c7
5
5
  SHA512:
6
- metadata.gz: 4b8c97dc8b98784b68f65bbd3f60eba9079bb2522cdfc81d5ccec6e49bc0b2af0d231a7fe1b3923b8644106625c271d8a723252cbbfbcd13c1d13f774fc60622
7
- data.tar.gz: a6f4f4d39a09666af08a85317fb64e66065bc1700ad2c47e8be2d1da791d749c623ceb04adbc4bebb5a5c0dcfff94ab4df3042c2cfcc132b2a15fde4036e5eec
6
+ metadata.gz: 40b209ff5eb900a7ffbad8a0bac3abb67b11a0e5191eb4fdcd8c2d4db1acb3e5135bef6345c54c3846cb2452dada718796059e9462787086d14c9659e37ad532
7
+ data.tar.gz: 073c87ac9409ed80d4c03d7762493dc5e9126811736385b313db3fa590dd55d6144fdea582ca85a1c1837bfa60b7a83374d174f051199ca82f6334c3bc317497
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.3.0"
2
+ ".": "0.4.0"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
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
+
3
10
  ## [0.3.0](https://github.com/altertable-ai/altertable-ruby/compare/altertable/v0.2.2...altertable/v0.3.0) (2026-03-09)
4
11
 
5
12
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- altertable (0.3.0)
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.3.0"
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
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.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Altertable
@@ -178,6 +178,7 @@ 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
182
183
  - sig/altertable.rbs
183
184
  - sig/altertable/adapters.rbs