growing-ruby-sdk 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/growing/ruby/sdk.rb +1 -46
- data/lib/growing/ruby/sdk/client.rb +75 -0
- data/lib/growing/ruby/sdk/pb/v1/dto/context_pb.rb +92 -0
- data/lib/growing/ruby/sdk/pb/v1/dto/event_pb.rb +51 -0
- data/lib/growing/ruby/sdk/pb/{messages_pb.rb → v1/dto/event_raw_pb.rb} +15 -11
- data/lib/growing/ruby/sdk/pb/v1/dto/item_pb.rb +30 -0
- data/lib/growing/ruby/sdk/pb/v1/dto/user_pb.rb +37 -0
- data/lib/growing/ruby/sdk/pb/v1/dto/user_profile_pb.rb +75 -0
- data/lib/growing/ruby/sdk/version.rb +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8653274457355c18253007bd74a1b61f2bcd50c471ac3ae40f66cf35d319d31
|
4
|
+
data.tar.gz: 7e7ec59e08797388b2d0241c91a4e8d23bebe4988e491e0dee9f94123def2566
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d76917f01baac10afe2016f0af08bda0993355767067f0cde8cca258bc28bec873fbd28ad583e5817abe91befc780e313724674b83efeb96d8838aee454c194
|
7
|
+
data.tar.gz: 69644310553e561a5af9a6cc261ef3d41da28c493a58590e6897ffc852af3c330cea6aa43fa45d3b8403d0f58ea9dcc8be484991ea99b4f2e34d7dadbcf1f3f8
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
growing-ruby-sdk (0.
|
4
|
+
growing-ruby-sdk (0.2.0)
|
5
5
|
faraday
|
6
6
|
google-protobuf
|
7
7
|
|
@@ -12,7 +12,7 @@ GEM
|
|
12
12
|
diff-lcs (1.4.4)
|
13
13
|
faraday (1.0.1)
|
14
14
|
multipart-post (>= 1.2, < 3)
|
15
|
-
google-protobuf (3.12.2)
|
15
|
+
google-protobuf (3.12.2-universal-darwin)
|
16
16
|
method_source (1.0.0)
|
17
17
|
multipart-post (2.1.1)
|
18
18
|
pry (0.13.1)
|
data/lib/growing/ruby/sdk.rb
CHANGED
@@ -1,55 +1,10 @@
|
|
1
1
|
require "growing/ruby/sdk/version"
|
2
|
-
require "growing/ruby/sdk/
|
3
|
-
require 'google/protobuf'
|
4
|
-
require 'faraday'
|
5
|
-
require 'date'
|
2
|
+
require "growing/ruby/sdk/client"
|
6
3
|
|
7
4
|
module Growing
|
8
5
|
module Ruby
|
9
6
|
module Sdk
|
10
7
|
class Error < StandardError; end
|
11
|
-
class Client
|
12
|
-
attr_reader :account_id
|
13
|
-
|
14
|
-
@instance_mutex = Mutex.new
|
15
|
-
|
16
|
-
private_class_method :new
|
17
|
-
|
18
|
-
def initialize(account_id)
|
19
|
-
@account_id = account_id
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.instance(account_id)
|
23
|
-
raise Error if account_id.length != 16 && account_id.length != 32
|
24
|
-
return @instance if @instance
|
25
|
-
@instance_mutex.synchronize do
|
26
|
-
@instance ||= new(account_id)
|
27
|
-
end
|
28
|
-
@instance
|
29
|
-
end
|
30
|
-
|
31
|
-
def track(login_user_id, event_key, event_props = {})
|
32
|
-
event = ::Io::Growing::Vds::Event.new(t: "cstm", cs1: login_user_id, n: event_key, var: event_props, tm: current_timestamp)
|
33
|
-
send(::Io::Growing::Vds::Event.encode_json(event))
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
def send(message)
|
38
|
-
resp = ::Faraday.post(url, "[#{message}]", "Content-Type" => "application/json")
|
39
|
-
unless resp.success?
|
40
|
-
raise Error
|
41
|
-
end
|
42
|
-
resp.success?
|
43
|
-
end
|
44
|
-
|
45
|
-
def url
|
46
|
-
"https://api.growingio.com/v3/#{@account_id}/s2s/cstm?stm=#{current_timestamp}"
|
47
|
-
end
|
48
|
-
|
49
|
-
def current_timestamp
|
50
|
-
::DateTime.now.strftime('%Q').to_i
|
51
|
-
end
|
52
|
-
end
|
53
8
|
end
|
54
9
|
end
|
55
10
|
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'faraday'
|
3
|
+
require 'google/protobuf'
|
4
|
+
require "growing/ruby/sdk/pb/v1/dto/event_pb"
|
5
|
+
require "growing/ruby/sdk/pb/v1/dto/user_pb"
|
6
|
+
|
7
|
+
::Protocol = ::Io::Growing::Tunnel::Protocol
|
8
|
+
|
9
|
+
module Growing
|
10
|
+
module Ruby
|
11
|
+
module Sdk
|
12
|
+
class Client
|
13
|
+
attr_reader :account_id, :data_source_id, :api_host
|
14
|
+
|
15
|
+
@instance_mutex = Mutex.new
|
16
|
+
|
17
|
+
private_class_method :new
|
18
|
+
|
19
|
+
def initialize(account_id, data_source_id, api_host)
|
20
|
+
@account_id = account_id
|
21
|
+
@data_source_id = data_source_id
|
22
|
+
@api_host = api_host
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.instance(account_id, data_source_id, api_host)
|
26
|
+
return @instance if @instance
|
27
|
+
@instance_mutex.synchronize do
|
28
|
+
@instance ||= new(account_id, data_source_id, api_host)
|
29
|
+
end
|
30
|
+
@instance
|
31
|
+
end
|
32
|
+
|
33
|
+
def collect_user(login_user_id, props = {})
|
34
|
+
user = ::Protocol::UserDto.new(
|
35
|
+
project_key: @account_id,
|
36
|
+
data_source_id: @data_source_id,
|
37
|
+
user_id: login_user_id,
|
38
|
+
gio_id: login_user_id,
|
39
|
+
attributes: props,
|
40
|
+
timestamp: current_timestamp)
|
41
|
+
send("collect_user", ::Protocol::UserDto.encode_json(user))
|
42
|
+
end
|
43
|
+
|
44
|
+
def collect_cstm(login_user_id, event_key, props = {})
|
45
|
+
event = ::Protocol::EventDto.new(
|
46
|
+
project_key: @account_id,
|
47
|
+
data_source_id: @data_source_id,
|
48
|
+
user_id: login_user_id,
|
49
|
+
gio_id: login_user_id,
|
50
|
+
event_key: event_key,
|
51
|
+
attributes: props,
|
52
|
+
timestamp: current_timestamp)
|
53
|
+
send("collect_cstm", ::Protocol::EventDto.encode_json(event))
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
def send(action, data)
|
58
|
+
resp = ::Faraday.post(url(action), "[#{data}]", "Content-Type" => "application/json")
|
59
|
+
unless resp.success?
|
60
|
+
raise Error
|
61
|
+
end
|
62
|
+
resp.success?
|
63
|
+
end
|
64
|
+
|
65
|
+
def url(action)
|
66
|
+
"#{@api_host}/projects/#{@account_id}/#{action.gsub('_', '/')}"
|
67
|
+
end
|
68
|
+
|
69
|
+
def current_timestamp
|
70
|
+
::DateTime.now.strftime('%Q').to_i
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: v1/dto/context.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/protobuf/wrappers_pb'
|
7
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
+
add_file("v1/dto/context.proto", :syntax => :proto3) do
|
9
|
+
add_message "io.growing.tunnel.protocol.ContextDto" do
|
10
|
+
optional :app, :message, 1, "io.growing.tunnel.protocol.AppDto"
|
11
|
+
optional :device, :message, 2, "io.growing.tunnel.protocol.DeviceDto"
|
12
|
+
optional :screen, :message, 3, "io.growing.tunnel.protocol.ScreenDto"
|
13
|
+
optional :operationSystem, :message, 4, "io.growing.tunnel.protocol.OperationSystemDto"
|
14
|
+
optional :page, :message, 5, "io.growing.tunnel.protocol.PageDto"
|
15
|
+
optional :referrer, :message, 6, "io.growing.tunnel.protocol.ReferrerDto"
|
16
|
+
optional :location, :message, 7, "io.growing.tunnel.protocol.LocationDto"
|
17
|
+
optional :network, :message, 8, "io.growing.tunnel.protocol.NetworkDto"
|
18
|
+
optional :locale, :message, 9, "io.growing.tunnel.protocol.LocaleDto"
|
19
|
+
end
|
20
|
+
add_message "io.growing.tunnel.protocol.AppDto" do
|
21
|
+
optional :id, :string, 1
|
22
|
+
optional :name, :string, 2
|
23
|
+
optional :package, :string, 3
|
24
|
+
optional :version, :string, 4
|
25
|
+
optional :url_schema, :string, 5
|
26
|
+
optional :user_agent, :string, 6
|
27
|
+
optional :channel, :string, 7
|
28
|
+
end
|
29
|
+
add_message "io.growing.tunnel.protocol.DeviceDto" do
|
30
|
+
optional :brand, :string, 1
|
31
|
+
optional :model, :string, 2
|
32
|
+
optional :platform, :string, 3
|
33
|
+
optional :type, :message, 4, "google.protobuf.Int32Value"
|
34
|
+
end
|
35
|
+
add_message "io.growing.tunnel.protocol.ScreenDto" do
|
36
|
+
optional :width, :int32, 1
|
37
|
+
optional :height, :int32, 2
|
38
|
+
optional :density, :int32, 3
|
39
|
+
optional :orientation, :enum, 4, "io.growing.tunnel.protocol.ScreenDto.Orientation"
|
40
|
+
end
|
41
|
+
add_enum "io.growing.tunnel.protocol.ScreenDto.Orientation" do
|
42
|
+
value :PORTRAIT, 0
|
43
|
+
value :LANDSCAPE, 1
|
44
|
+
end
|
45
|
+
add_message "io.growing.tunnel.protocol.OperationSystemDto" do
|
46
|
+
optional :name, :string, 1
|
47
|
+
optional :version, :string, 2
|
48
|
+
end
|
49
|
+
add_message "io.growing.tunnel.protocol.PageDto" do
|
50
|
+
optional :domain, :string, 1
|
51
|
+
optional :path, :string, 2
|
52
|
+
optional :query, :string, 3
|
53
|
+
optional :title, :string, 4
|
54
|
+
end
|
55
|
+
add_message "io.growing.tunnel.protocol.ReferrerDto" do
|
56
|
+
optional :from, :string, 1
|
57
|
+
optional :page, :string, 2
|
58
|
+
end
|
59
|
+
add_message "io.growing.tunnel.protocol.LocationDto" do
|
60
|
+
optional :longitude, :double, 1
|
61
|
+
optional :latitude, :double, 2
|
62
|
+
end
|
63
|
+
add_message "io.growing.tunnel.protocol.NetworkDto" do
|
64
|
+
optional :type, :string, 1
|
65
|
+
optional :carrier, :string, 2
|
66
|
+
end
|
67
|
+
add_message "io.growing.tunnel.protocol.LocaleDto" do
|
68
|
+
optional :language, :string, 1
|
69
|
+
optional :timezone, :string, 2
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
module Io
|
75
|
+
module Growing
|
76
|
+
module Tunnel
|
77
|
+
module Protocol
|
78
|
+
ContextDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.ContextDto").msgclass
|
79
|
+
AppDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.AppDto").msgclass
|
80
|
+
DeviceDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.DeviceDto").msgclass
|
81
|
+
ScreenDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.ScreenDto").msgclass
|
82
|
+
ScreenDto::Orientation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.ScreenDto.Orientation").enummodule
|
83
|
+
OperationSystemDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.OperationSystemDto").msgclass
|
84
|
+
PageDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.PageDto").msgclass
|
85
|
+
ReferrerDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.ReferrerDto").msgclass
|
86
|
+
LocationDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.LocationDto").msgclass
|
87
|
+
NetworkDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.NetworkDto").msgclass
|
88
|
+
LocaleDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.LocaleDto").msgclass
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: v1/dto/event.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'growing/ruby/sdk/pb/v1/dto/context_pb'
|
7
|
+
require 'growing/ruby/sdk/pb/v1/dto/item_pb'
|
8
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
|
+
add_file("v1/dto/event.proto", :syntax => :proto3) do
|
10
|
+
add_message "io.growing.tunnel.protocol.EventDto" do
|
11
|
+
optional :anonymous_id, :string, 1
|
12
|
+
optional :project_key, :string, 2
|
13
|
+
optional :user_id, :string, 3
|
14
|
+
optional :gio_id, :string, 4
|
15
|
+
optional :timestamp, :int64, 5
|
16
|
+
optional :esid, :int32, 6
|
17
|
+
optional :session, :string, 7
|
18
|
+
optional :event_key, :string, 8
|
19
|
+
optional :type, :enum, 9, "io.growing.tunnel.protocol.EventDto.EventType"
|
20
|
+
optional :version, :string, 10
|
21
|
+
optional :ip, :string, 11
|
22
|
+
optional :context, :message, 12, "io.growing.tunnel.protocol.ContextDto"
|
23
|
+
map :attributes, :string, :string, 13
|
24
|
+
optional :send_time, :int64, 14
|
25
|
+
optional :event_num, :double, 15
|
26
|
+
optional :data_source_id, :string, 16
|
27
|
+
optional :item, :message, 17, "io.growing.tunnel.protocol.ItemDto"
|
28
|
+
end
|
29
|
+
add_enum "io.growing.tunnel.protocol.EventDto.EventType" do
|
30
|
+
value :VISIT, 0
|
31
|
+
value :CUSTOM_EVENT, 1
|
32
|
+
value :PAGE, 2
|
33
|
+
value :VISIT_CLOSE, 3
|
34
|
+
end
|
35
|
+
add_message "io.growing.tunnel.protocol.EventList" do
|
36
|
+
repeated :values, :message, 1, "io.growing.tunnel.protocol.EventDto"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
module Io
|
42
|
+
module Growing
|
43
|
+
module Tunnel
|
44
|
+
module Protocol
|
45
|
+
EventDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.EventDto").msgclass
|
46
|
+
EventDto::EventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.EventDto.EventType").enummodule
|
47
|
+
EventList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.EventList").msgclass
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source:
|
2
|
+
# source: v1/dto/event_raw.proto
|
3
3
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
-
add_file("
|
8
|
-
add_message "io.growing.
|
7
|
+
add_file("v1/dto/event_raw.proto", :syntax => :proto3) do
|
8
|
+
add_message "io.growing.collector.tunnel.protocol.Event" do
|
9
9
|
optional :ai, :string, 1
|
10
10
|
optional :appid, :string, 2
|
11
11
|
optional :uid, :int64, 3
|
@@ -28,7 +28,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
28
28
|
optional :rp, :string, 20
|
29
29
|
optional :tl, :string, 21
|
30
30
|
optional :n, :string, 22
|
31
|
-
repeated :e, :message, 23, "io.growing.
|
31
|
+
repeated :e, :message, 23, "io.growing.collector.tunnel.protocol.Element"
|
32
32
|
optional :db, :string, 24
|
33
33
|
optional :dm, :string, 25
|
34
34
|
optional :sh, :int32, 26
|
@@ -52,7 +52,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
52
52
|
optional :iv, :string, 44
|
53
53
|
optional :ui, :string, 45
|
54
54
|
end
|
55
|
-
add_message "io.growing.
|
55
|
+
add_message "io.growing.collector.tunnel.protocol.Element" do
|
56
56
|
optional :x, :string, 1
|
57
57
|
optional :v, :string, 2
|
58
58
|
optional :h, :string, 3
|
@@ -62,18 +62,22 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
62
62
|
optional :gesid, :int32, 7
|
63
63
|
optional :esid, :int32, 8
|
64
64
|
end
|
65
|
-
add_message "io.growing.
|
66
|
-
repeated :values, :message, 1, "io.growing.
|
65
|
+
add_message "io.growing.collector.tunnel.protocol.EventList" do
|
66
|
+
repeated :values, :message, 1, "io.growing.collector.tunnel.protocol.Event"
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
71
|
module Io
|
72
72
|
module Growing
|
73
|
-
module
|
74
|
-
|
75
|
-
|
76
|
-
|
73
|
+
module Collector
|
74
|
+
module Tunnel
|
75
|
+
module Protocol
|
76
|
+
Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.collector.tunnel.protocol.Event").msgclass
|
77
|
+
Element = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.collector.tunnel.protocol.Element").msgclass
|
78
|
+
EventList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.collector.tunnel.protocol.EventList").msgclass
|
79
|
+
end
|
80
|
+
end
|
77
81
|
end
|
78
82
|
end
|
79
83
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: v1/dto/item.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_file("v1/dto/item.proto", :syntax => :proto3) do
|
8
|
+
add_message "io.growing.tunnel.protocol.ItemDto" do
|
9
|
+
optional :id, :string, 1
|
10
|
+
optional :key, :string, 2
|
11
|
+
map :attributes, :string, :string, 3
|
12
|
+
optional :data_source_id, :string, 4
|
13
|
+
optional :project_key, :string, 5
|
14
|
+
end
|
15
|
+
add_message "io.growing.tunnel.protocol.ItemDtoList" do
|
16
|
+
repeated :values, :message, 2, "io.growing.tunnel.protocol.ItemDto"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
module Io
|
22
|
+
module Growing
|
23
|
+
module Tunnel
|
24
|
+
module Protocol
|
25
|
+
ItemDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.ItemDto").msgclass
|
26
|
+
ItemDtoList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.ItemDtoList").msgclass
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: v1/dto/user.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'growing/ruby/sdk/pb/v1/dto/user_profile_pb'
|
7
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
+
add_file("v1/dto/user.proto", :syntax => :proto3) do
|
9
|
+
add_message "io.growing.tunnel.protocol.UserDto" do
|
10
|
+
optional :anonymous_id, :string, 1
|
11
|
+
optional :project_key, :string, 2
|
12
|
+
optional :user_id, :string, 3
|
13
|
+
optional :gio_id, :string, 4
|
14
|
+
optional :timestamp, :int64, 5
|
15
|
+
optional :esid, :int32, 6
|
16
|
+
optional :session, :string, 7
|
17
|
+
optional :profile, :message, 8, "io.growing.tunnel.protocol.UserProfileDto"
|
18
|
+
map :attributes, :string, :string, 9
|
19
|
+
optional :send_time, :int64, 10
|
20
|
+
optional :data_source_id, :string, 11
|
21
|
+
end
|
22
|
+
add_message "io.growing.tunnel.protocol.UserList" do
|
23
|
+
repeated :values, :message, 1, "io.growing.tunnel.protocol.UserDto"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
module Io
|
29
|
+
module Growing
|
30
|
+
module Tunnel
|
31
|
+
module Protocol
|
32
|
+
UserDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.UserDto").msgclass
|
33
|
+
UserList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.UserList").msgclass
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: v1/dto/user_profile.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/protobuf/timestamp_pb'
|
7
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
+
add_file("v1/dto/user_profile.proto", :syntax => :proto3) do
|
9
|
+
add_message "io.growing.tunnel.protocol.UserProfileDto" do
|
10
|
+
optional :basic, :message, 1, "io.growing.tunnel.protocol.BasicProfileDto"
|
11
|
+
optional :device, :message, 2, "io.growing.tunnel.protocol.DeviceProfileDto"
|
12
|
+
optional :wechat, :message, 3, "io.growing.tunnel.protocol.WechatProfileDto"
|
13
|
+
optional :alipay, :message, 4, "io.growing.tunnel.protocol.AliPayProfileDto"
|
14
|
+
end
|
15
|
+
add_message "io.growing.tunnel.protocol.BasicProfileDto" do
|
16
|
+
optional :name, :string, 1
|
17
|
+
optional :createdAt, :message, 2, "google.protobuf.Timestamp"
|
18
|
+
optional :birthday, :message, 3, "google.protobuf.Timestamp"
|
19
|
+
optional :mobile, :string, 4
|
20
|
+
optional :email, :string, 5
|
21
|
+
optional :gender, :enum, 6, "io.growing.tunnel.protocol.BasicProfileDto.Gender"
|
22
|
+
repeated :addresses, :string, 7
|
23
|
+
end
|
24
|
+
add_enum "io.growing.tunnel.protocol.BasicProfileDto.Gender" do
|
25
|
+
value :UNKNOWN, 0
|
26
|
+
value :FEMALE, 1
|
27
|
+
value :MALE, 2
|
28
|
+
end
|
29
|
+
add_message "io.growing.tunnel.protocol.DeviceProfileDto" do
|
30
|
+
optional :android_id, :string, 1
|
31
|
+
optional :idfa, :string, 2
|
32
|
+
optional :idfv, :string, 3
|
33
|
+
optional :imei, :string, 4
|
34
|
+
end
|
35
|
+
add_message "io.growing.tunnel.protocol.WechatProfileDto" do
|
36
|
+
optional :open_id, :string, 1
|
37
|
+
optional :union_id, :string, 2
|
38
|
+
optional :nick_name, :string, 3
|
39
|
+
optional :avatar_url, :string, 4
|
40
|
+
optional :gender, :string, 5
|
41
|
+
optional :country, :string, 6
|
42
|
+
optional :province, :string, 7
|
43
|
+
optional :city, :string, 8
|
44
|
+
optional :language, :string, 9
|
45
|
+
repeated :subscribe_list, :string, 10
|
46
|
+
end
|
47
|
+
add_message "io.growing.tunnel.protocol.AliPayProfileDto" do
|
48
|
+
optional :user_id, :string, 1
|
49
|
+
optional :avatar, :string, 2
|
50
|
+
optional :province, :string, 3
|
51
|
+
optional :city, :string, 4
|
52
|
+
optional :nick_name, :string, 5
|
53
|
+
optional :is_student_certified, :bool, 6
|
54
|
+
optional :user_type, :string, 7
|
55
|
+
optional :user_status, :string, 8
|
56
|
+
optional :is_certified, :bool, 9
|
57
|
+
optional :gender, :string, 10
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
module Io
|
63
|
+
module Growing
|
64
|
+
module Tunnel
|
65
|
+
module Protocol
|
66
|
+
UserProfileDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.UserProfileDto").msgclass
|
67
|
+
BasicProfileDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.BasicProfileDto").msgclass
|
68
|
+
BasicProfileDto::Gender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.BasicProfileDto.Gender").enummodule
|
69
|
+
DeviceProfileDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.DeviceProfileDto").msgclass
|
70
|
+
WechatProfileDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.WechatProfileDto").msgclass
|
71
|
+
AliPayProfileDto = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("io.growing.tunnel.protocol.AliPayProfileDto").msgclass
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: growing-ruby-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ZhenyuanLau
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -86,7 +86,13 @@ files:
|
|
86
86
|
- bin/setup
|
87
87
|
- growing-ruby-sdk.gemspec
|
88
88
|
- lib/growing/ruby/sdk.rb
|
89
|
-
- lib/growing/ruby/sdk/
|
89
|
+
- lib/growing/ruby/sdk/client.rb
|
90
|
+
- lib/growing/ruby/sdk/pb/v1/dto/context_pb.rb
|
91
|
+
- lib/growing/ruby/sdk/pb/v1/dto/event_pb.rb
|
92
|
+
- lib/growing/ruby/sdk/pb/v1/dto/event_raw_pb.rb
|
93
|
+
- lib/growing/ruby/sdk/pb/v1/dto/item_pb.rb
|
94
|
+
- lib/growing/ruby/sdk/pb/v1/dto/user_pb.rb
|
95
|
+
- lib/growing/ruby/sdk/pb/v1/dto/user_profile_pb.rb
|
90
96
|
- lib/growing/ruby/sdk/version.rb
|
91
97
|
homepage: https://github.com/zhenyuanlau/growing-ruby-sdk
|
92
98
|
licenses:
|