altertable 0.1.0 → 0.3.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/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +29 -0
- data/Gemfile.lock +1 -1
- data/Rakefile +1 -0
- data/altertable.gemspec +3 -1
- data/lib/altertable/version.rb +1 -1
- data/sig/altertable/adapters.rbs +48 -0
- data/sig/altertable/client.rbs +32 -0
- data/sig/altertable/errors.rbs +20 -0
- data/sig/altertable/version.rbs +3 -0
- data/sig/altertable.rbs +13 -0
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c8be063d691285f7602a24d6b3a1531423630d7381b458ede9756ada79239c0
|
|
4
|
+
data.tar.gz: 56bcdd6d6fc488b2f611691bf36a483993695580b9e81984529d70bdcea381a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b8c97dc8b98784b68f65bbd3f60eba9079bb2522cdfc81d5ccec6e49bc0b2af0d231a7fe1b3923b8644106625c271d8a723252cbbfbcd13c1d13f774fc60622
|
|
7
|
+
data.tar.gz: a6f4f4d39a09666af08a85317fb64e66065bc1700ad2c47e8be2d1da791d749c623ceb04adbc4bebb5a5c0dcfff94ab4df3042c2cfcc132b2a15fde4036e5eec
|
data/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.3.0](https://github.com/altertable-ai/altertable-ruby/compare/altertable/v0.2.2...altertable/v0.3.0) (2026-03-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* 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))
|
|
9
|
+
|
|
10
|
+
## [0.2.2](https://github.com/altertable-ai/altertable-ruby/compare/altertable/v0.2.1...altertable/v0.2.2) (2026-03-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* add missing bundler/gem_tasks to Rakefile ([#16](https://github.com/altertable-ai/altertable-ruby/issues/16)) ([6d021c9](https://github.com/altertable-ai/altertable-ruby/commit/6d021c9f94d66fe491243d87ae591f0ab9303d4a)), closes [#15](https://github.com/altertable-ai/altertable-ruby/issues/15)
|
|
16
|
+
|
|
17
|
+
## [0.2.1](https://github.com/altertable-ai/altertable-ruby/compare/altertable/v0.2.0...altertable/v0.2.1) (2026-03-08)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* read gem version dynamically from lib/altertable/version.rb ([#12](https://github.com/altertable-ai/altertable-ruby/issues/12)) ([c2720a0](https://github.com/altertable-ai/altertable-ruby/commit/c2720a08eca08534541e2262a82239f7c3f678ec))
|
|
23
|
+
|
|
24
|
+
## [0.2.0](https://github.com/altertable-ai/altertable-ruby/compare/altertable-v0.1.0...altertable/v0.2.0) (2026-03-08)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* optional http client (faraday/httpx/net-http) with adapter pattern ([#5](https://github.com/altertable-ai/altertable-ruby/issues/5)) ([1fb2b79](https://github.com/altertable-ai/altertable-ruby/commit/1fb2b79963977aea1d3c4d19e3fdad23b02a296f))
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
data/altertable.gemspec
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative "lib/altertable/version"
|
|
4
|
+
|
|
3
5
|
Gem::Specification.new do |spec|
|
|
4
6
|
spec.name = "altertable"
|
|
5
|
-
spec.version =
|
|
7
|
+
spec.version = Altertable::VERSION
|
|
6
8
|
spec.authors = ["Altertable"]
|
|
7
9
|
spec.email = ["support@api.altertable.ai"]
|
|
8
10
|
|
data/lib/altertable/version.rb
CHANGED
|
@@ -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
|
data/sig/altertable.rbs
ADDED
|
@@ -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.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Altertable
|
|
@@ -179,6 +179,11 @@ files:
|
|
|
179
179
|
- lib/altertable/errors.rb
|
|
180
180
|
- lib/altertable/version.rb
|
|
181
181
|
- release-please-config.json
|
|
182
|
+
- sig/altertable.rbs
|
|
183
|
+
- sig/altertable/adapters.rbs
|
|
184
|
+
- sig/altertable/client.rbs
|
|
185
|
+
- sig/altertable/errors.rbs
|
|
186
|
+
- sig/altertable/version.rbs
|
|
182
187
|
homepage: https://github.com/altertable-ai/altertable-ruby
|
|
183
188
|
licenses:
|
|
184
189
|
- MIT
|
|
@@ -200,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
200
205
|
- !ruby/object:Gem::Version
|
|
201
206
|
version: '0'
|
|
202
207
|
requirements: []
|
|
203
|
-
rubygems_version: 3.6.
|
|
208
|
+
rubygems_version: 3.6.9
|
|
204
209
|
specification_version: 4
|
|
205
210
|
summary: Altertable Product Analytics Ruby SDK
|
|
206
211
|
test_files: []
|