navi_email_sync 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/navi_client.yml +6 -0
- data/lib/cloud/navi_cloud_client.rb +3 -2
- data/lib/http_service/naviai.rb +14 -2
- data/lib/local/navi_local_client.rb +1 -2
- data/lib/navi_client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41f423b28b30e17d80e50291a6d8acf869bdeba029926f7ceb879e78843d80c5
|
4
|
+
data.tar.gz: c546ea58ae70d0a8742a75cd7a001ed4854d253fef3b82a1d85fae2e162e0ed7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6588ebd5c9a08b34c731826cc9d7a00df4f95fcaef1c58c94adc0038e220eb83f8cc5041260faf667cdf9f4fb527d6a8f64f7fc1adc5877181eda4c5ed0dd4f
|
7
|
+
data.tar.gz: cd9bdc5e0034a94f5a47168b4acd2d3c5a1a591becd976c9b4a393daf50ccd5821970f0076ec060eab8a8306ade9d3de3b978a805340e2197e082c79be3e41d8
|
@@ -54,8 +54,9 @@ module NaviEmailSync
|
|
54
54
|
#
|
55
55
|
# login to the navi-cloud and get the authentication token
|
56
56
|
#
|
57
|
-
def login(session_token)
|
57
|
+
def login(session_token, client)
|
58
58
|
@token = session_token
|
59
|
+
@client = client
|
59
60
|
end
|
60
61
|
|
61
62
|
def set_current_user_email(email)
|
@@ -76,7 +77,7 @@ module NaviEmailSync
|
|
76
77
|
filepath = @download_path + "inputs/" + (Time.now.to_f * 1000).to_s
|
77
78
|
filename = upload_to_s3(filepath, in_filenames.join("\n"))
|
78
79
|
|
79
|
-
HTTPService::NaviAI.start(filepath: filename, client_id: @id, client_type: @client_type, token: @token, email: @current_user_email, is_last: is_last, email_count: email_count, total_emails: @total_emails)
|
80
|
+
HTTPService::NaviAI.start(filepath: filename, client_id: @id, client_type: @client_type, token: @token, client: @client, email: @current_user_email, is_last: is_last, email_count: email_count, total_emails: @total_emails)
|
80
81
|
end
|
81
82
|
end
|
82
83
|
|
data/lib/http_service/naviai.rb
CHANGED
@@ -3,9 +3,21 @@ require "httparty"
|
|
3
3
|
module HTTPService
|
4
4
|
class NaviAI
|
5
5
|
|
6
|
-
def self.start(filepath:, client_id: nil, client_type:, token:, email:, is_last: false, email_count: 0, total_emails:)
|
6
|
+
def self.start(filepath:, client_id: nil, client_type:, token:, client:, email:, is_last: false, email_count: 0, total_emails:)
|
7
7
|
go_url = "#{ENV['parser_url']}/v2/metas"
|
8
|
-
HTTParty.post(go_url,
|
8
|
+
HTTParty.post(go_url,
|
9
|
+
body:
|
10
|
+
{
|
11
|
+
client_id: client_id,
|
12
|
+
client_type: client_type,
|
13
|
+
list_meta_path: filepath,
|
14
|
+
token: token,
|
15
|
+
client: client,
|
16
|
+
email: email,
|
17
|
+
is_last: is_last,
|
18
|
+
email_count: email_count,
|
19
|
+
total_emails: total_emails
|
20
|
+
}.to_json, timeout: 400)
|
9
21
|
end
|
10
22
|
|
11
23
|
def self.generate_csv(url, token)
|
@@ -119,8 +119,7 @@ module NaviEmailSync
|
|
119
119
|
File.open(filename, 'w') do |f|
|
120
120
|
in_filenames.each { |element| f.puts(element) }
|
121
121
|
end
|
122
|
-
|
123
|
-
response = HTTPService::NaviAI.start(filepath: filename, client_type: @client_type, token: @token, email: config['username'], is_last: is_last, email_count: email_count, total_emails: @total_emails)
|
122
|
+
response = HTTPService::NaviAI.start(filepath: filename, client_type: @client_type, token: @token, client: @client,email: config['username'], is_last: is_last, email_count: email_count, total_emails: @total_emails)
|
124
123
|
return response
|
125
124
|
end
|
126
125
|
end
|
data/lib/navi_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: navi_email_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sanjib
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -127,6 +127,7 @@ files:
|
|
127
127
|
- bin/console
|
128
128
|
- bin/setup
|
129
129
|
- config/navi_client.sample.yml
|
130
|
+
- config/navi_client.yml
|
130
131
|
- lib/client.rb
|
131
132
|
- lib/cloud/navi_cloud_client.rb
|
132
133
|
- lib/gmail_client.rb
|