itly-sdk 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/sig/aliases.rbs ADDED
@@ -0,0 +1,3 @@
1
+ type untypedHash = Hash[untyped, untyped]
2
+ type propertiesHash = Hash[String | Symbol, untyped]
3
+ type callOptions = Hash[String, Itly::PluginCallOptions]
data/sig/event.rbs ADDED
@@ -0,0 +1,16 @@
1
+ class Itly
2
+ class Event
3
+ attr_accessor name: String
4
+ attr_accessor properties: propertiesHash
5
+ attr_accessor id: String?
6
+ attr_accessor version: String?
7
+ attr_accessor plugins: Hash[String, bool]
8
+
9
+ def to_s: () -> String
10
+ def ==: (untyped other) -> untyped
11
+
12
+ private
13
+
14
+ def initialize: (name: String name, ?properties: propertiesHash properties, ?id: String? id, ?version: String? version, ?plugins: Hash[String | Symbol, bool] plugins) -> void
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ # Itly main class
2
+ class Itly
3
+ class InitializationError < StandardError
4
+ end
5
+
6
+ class ValidationError < StandardError
7
+ end
8
+
9
+ class RemoteError < StandardError
10
+ end
11
+ end
data/sig/itly.rbs ADDED
@@ -0,0 +1,32 @@
1
+ class Itly
2
+ include Itly::Plugins
3
+
4
+ VERSION: String
5
+
6
+ attr_reader options: Itly::Options
7
+
8
+ def load: (?context: propertiesHash? context) ?{ (Itly::Options) -> void } -> void
9
+ def identify: (user_id: String user_id, ?properties: propertiesHash properties, ?options: callOptions options) -> void
10
+ def group: (user_id: String user_id, group_id: String group_id, ?properties: propertiesHash properties, ?options: callOptions options) -> void
11
+ def page: (user_id: String user_id, ?category: String? category, ?name: String? name, ?properties: propertiesHash? properties, ?options: callOptions options) -> void
12
+ def track: (user_id: String user_id, event: Itly::Event event, ?options: callOptions options) -> void
13
+ def alias: (user_id: String user_id, previous_id: String previous_id, ?options: callOptions options) -> void
14
+ def flush: () -> void
15
+ def shutdown: () -> void
16
+ def reset: () -> void
17
+ def validate: (event: Itly::Event event) -> Array[Itly::ValidationResponse]?
18
+
19
+ private
20
+
21
+ def initialize: () -> void
22
+ def was_initialized?: () -> bool
23
+ def validate_and_send_to_plugins: (action: ^(Itly::Plugin plugin, Itly::Event combined_event) -> void, post_action: ^(Itly::Plugin plugin, Itly::Event combined_event, Array[Itly::ValidationResponse] validation_results) -> void post_action, event: Itly::Event event, ?context: Itly::Event? context) -> void
24
+ def validate_context_and_event: (Itly::Event? context, Itly::Event event) -> [Array[Itly::ValidationResponse], Array[Itly::ValidationResponse], bool]
25
+ def log_validation_errors: (Array[Itly::ValidationResponse] validations, Itly::Event event) -> void
26
+ def raise_validation_errors: (bool is_valid, Array[Itly::ValidationResponse] validations, Itly::Event event) -> void
27
+ def enabled?: () -> bool
28
+ def validation_enabled?: () -> bool
29
+ def logger: () -> Logger?
30
+ def instantiate_plugins: () -> void
31
+ def run_on_plugins: () { (Itly::Plugin) -> untyped } -> Array[untyped]
32
+ end
@@ -0,0 +1,3 @@
1
+ # Part of the gems
2
+ class MonitorMixin
3
+ end
data/sig/loggers.rbs ADDED
@@ -0,0 +1,8 @@
1
+ class Itly
2
+ class Loggers
3
+ def self.itly_dot_log: () -> Logger
4
+ def self.std_out: () -> Logger
5
+ def self.nil_logger?: () -> nil
6
+ def self.vars_to_log: (Hash[Symbol, untyped]) -> String
7
+ end
8
+ end
data/sig/options.rbs ADDED
@@ -0,0 +1,18 @@
1
+ class Itly
2
+ class Options
3
+ attr_accessor disabled: bool
4
+ attr_accessor environment: Symbol
5
+ attr_accessor logger: Logger?
6
+ attr_accessor plugins: Array[Itly::Plugin]
7
+ attr_writer validation: Integer
8
+
9
+ def for_plugin: () -> Itly::PluginOptions
10
+ def validation: () -> Integer
11
+ def development?: () -> bool
12
+ def production?: () -> bool
13
+
14
+ private
15
+
16
+ def initialize: () -> void
17
+ end
18
+ end
@@ -0,0 +1,8 @@
1
+ class Itly
2
+ class Options
3
+ module Environment
4
+ DEVELOPMENT: Symbol
5
+ PRODUCTION: Symbol
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ class Itly
2
+ class Options
3
+ module Validation
4
+ DEFAULT: Integer
5
+ DISABLED: Integer
6
+ TRACK_INVALID: Integer
7
+ ERROR_ON_INVALID: Integer
8
+ end
9
+ end
10
+ end
data/sig/plugin.rbs ADDED
@@ -0,0 +1,21 @@
1
+ class Itly
2
+ class Plugin
3
+ def load: (options: Itly::PluginOptions options) -> void
4
+ def identify: (user_id: String user_id, ?properties: propertiesHash? properties, ?options: Itly::PluginCallOptions? options) -> void
5
+ def post_identify: (user_id: String user_id, properties: propertiesHash? properties, validation_results: Array[Itly::ValidationResponse] validation_results) -> void
6
+ def group: (user_id: String user_id, group_id: String group_id, ?properties: propertiesHash? properties, ?options: Itly::PluginCallOptions? options) -> void
7
+ def post_group: (user_id: String user_id, group_id: String group_id, properties: propertiesHash? properties, validation_results: Array[Itly::ValidationResponse] validation_results) -> void
8
+ def page: (user_id: String user_id, ?category: String? category, ?name: String? name, ?properties: propertiesHash? properties, ?options: Itly::PluginCallOptions? options) -> void
9
+ def post_page: (user_id: String user_id, category: String? category, name: String? name, properties: propertiesHash? properties, validation_results: Array[Itly::ValidationResponse] validation_results) -> void
10
+ def track: (user_id: String user_id, event: Itly::Event event, ?options: Itly::PluginCallOptions? options) -> void
11
+ def post_track: (user_id: String user_id, event: Itly::Event event, validation_results: Array[Itly::ValidationResponse] validation_results) -> void
12
+ def alias: (user_id: String user_id, previous_id: String previous_id, ?options: Itly::PluginCallOptions? options) -> void
13
+ def post_alias: (user_id: String user_id, previous_id: String previous_id) -> void
14
+ def flush: () -> void
15
+ def shutdown: () -> void
16
+ def reset: () -> void
17
+ def validate: (event: Itly::Event event) -> Itly::ValidationResponse?
18
+ def get_plugin_options: (Itly::Options options) -> propertiesHash
19
+ def id: () -> String
20
+ end
21
+ end
@@ -0,0 +1,4 @@
1
+ class Itly
2
+ class PluginCallOptions
3
+ end
4
+ end
@@ -0,0 +1,10 @@
1
+ class Itly
2
+ class PluginOptions
3
+ attr_reader environment: Symbol
4
+ attr_reader logger: Logger?
5
+
6
+ private
7
+
8
+ def initialize: (environment: Symbol environment, logger: Logger? logger) -> void
9
+ end
10
+ end
data/sig/plugins.rbs ADDED
@@ -0,0 +1,4 @@
1
+ class Itly
2
+ class Plugins
3
+ end
4
+ end
@@ -0,0 +1,13 @@
1
+ class Itly
2
+ class ValidationResponse
3
+ attr_reader valid: bool
4
+ attr_reader plugin_id: String
5
+ attr_reader message: String
6
+
7
+ def to_s: () -> String
8
+
9
+ private
10
+
11
+ def initialize: (valid: bool valid, plugin_id: String plugin_id, ?message: String message) -> void
12
+ end
13
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itly-sdk
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Iteratively
8
+ - Benjamin Bouchet
9
+ - Justin Fiedler
10
+ - Andrey Sokolov
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+ date: 2021-06-15 00:00:00.000000000 Z
15
+ dependencies: []
16
+ description: Track and validate analytics with a unified, extensible interface that
17
+ works with all your 3rd party analytics providers.
18
+ email:
19
+ - support@iterative.ly
20
+ executables: []
21
+ extensions: []
22
+ extra_rdoc_files: []
23
+ files:
24
+ - ".rspec"
25
+ - Gemfile
26
+ - Steepfile
27
+ - bin/console
28
+ - bin/rspec
29
+ - bin/setup
30
+ - itly-sdk.gemspec
31
+ - lib/itly-sdk.rb
32
+ - lib/itly/event.rb
33
+ - lib/itly/exceptions.rb
34
+ - lib/itly/itly.rb
35
+ - lib/itly/loggers.rb
36
+ - lib/itly/options.rb
37
+ - lib/itly/options/environment.rb
38
+ - lib/itly/options/validation.rb
39
+ - lib/itly/plugin.rb
40
+ - lib/itly/plugin_call_options.rb
41
+ - lib/itly/plugin_options.rb
42
+ - lib/itly/plugins.rb
43
+ - lib/itly/validation_response.rb
44
+ - lib/itly/version.rb
45
+ - sig/aliases.rbs
46
+ - sig/event.rbs
47
+ - sig/exceptions.rbs
48
+ - sig/itly.rbs
49
+ - sig/lib/monitor_mixin.rbs
50
+ - sig/loggers.rbs
51
+ - sig/options.rbs
52
+ - sig/options/environment.rbs
53
+ - sig/options/validation.rbs
54
+ - sig/plugin.rbs
55
+ - sig/plugin_call_options.rbs
56
+ - sig/plugin_options.rbs
57
+ - sig/plugins.rbs
58
+ - sig/validation_response.rbs
59
+ homepage: https://github.com/iterativelyhq/itly-sdk-ruby
60
+ licenses:
61
+ - MIT
62
+ metadata:
63
+ allowed_push_host: https://rubygems.org/
64
+ homepage_uri: https://github.com/iterativelyhq/itly-sdk-ruby
65
+ source_code_uri: https://github.com/iterativelyhq/itly-sdk-ruby/sdk
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 2.6.0
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubygems_version: 3.0.3.1
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: Iteratively SDK for Ruby
85
+ test_files: []