navi_email_sync 0.0.6 → 0.0.7

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: 73a6170c584718315933debb969c5f0cf0dfa53d77f404e4f267f3e5f7bb9194
4
- data.tar.gz: a31dc1bb440ea5c54f3f6a27e7e0c194914ee732075e8eeaaf34fa315ac84db0
3
+ metadata.gz: 41f423b28b30e17d80e50291a6d8acf869bdeba029926f7ceb879e78843d80c5
4
+ data.tar.gz: c546ea58ae70d0a8742a75cd7a001ed4854d253fef3b82a1d85fae2e162e0ed7
5
5
  SHA512:
6
- metadata.gz: 81fc5e13abcede2147893eda5e0582ca4f1d6eeb7049d7a83e7a30cfc0fd9856c5f269fd1fcbceb204207a99ff9aafde474862dcaf4f44319b1703fc50c7e43c
7
- data.tar.gz: f42529daa8534fdf0876755eb9c5948eaca49f539ab453f9462645f9c59672dc53225ac9d956f09f61f29653cf81e4de7e2df0bf049c2560e998b6617f923d23
6
+ metadata.gz: c6588ebd5c9a08b34c731826cc9d7a00df4f95fcaef1c58c94adc0038e220eb83f8cc5041260faf667cdf9f4fb527d6a8f64f7fc1adc5877181eda4c5ed0dd4f
7
+ data.tar.gz: cd9bdc5e0034a94f5a47168b4acd2d3c5a1a591becd976c9b4a393daf50ccd5821970f0076ec060eab8a8306ade9d3de3b978a805340e2197e082c79be3e41d8
@@ -0,0 +1,6 @@
1
+ development:
2
+ api_url: http://localhost:3020/
3
+ parser_url: http://localhost:9090
4
+
5
+ production:
6
+ parser_url: http://34.214.134.104:9090
@@ -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
 
@@ -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, body: { client_id: client_id, client_type: client_type, list_meta_path: filepath, token: token, email: email, is_last: is_last, email_count: email_count, total_emails: total_emails }.to_json, timeout: 400)
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
@@ -1,3 +1,3 @@
1
1
  module NaviEmailSync
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
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.6
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-06-29 00:00:00.000000000 Z
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