mints 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/client.rb +9 -7
- data/lib/contact.rb +2 -2
- data/lib/generators/mints_files_generator.rb +3 -2
- data/lib/pub.rb +2 -2
- data/lib/user.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3deabf302a32fac1452e45f7ab9753ec0a1ee7973535b0371b9c67a25cb60cc7
|
4
|
+
data.tar.gz: 9589dacb58814ad17c5a2826f866b929f862d7ce7ce3fc745dcd3e191c2f19c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1bc7c183bc20b9dbe25f4f5d7770ee0492d0f2e773cdfb6934af7afe0056bf8f38f7277440a821e71f22a4abda51c11f7b8c2dd5f6279e22b9c68c7fe703d82
|
7
|
+
data.tar.gz: 2f7ebc2b2f8977f5009bafc4e42348cc4a7494729fb1aa15ccf69a8e7937c9872120a2bc81711fcd22153fa5cb05e71c462dc0c67645f350c5e5021f1e7a71f9
|
data/lib/client.rb
CHANGED
@@ -8,12 +8,14 @@ module Mints
|
|
8
8
|
attr_reader :api_key
|
9
9
|
attr_reader :scope
|
10
10
|
attr_reader :base_url
|
11
|
-
attr_accessor :session_token
|
11
|
+
attr_accessor :session_token
|
12
|
+
attr_accessor :contact_token_id
|
12
13
|
|
13
|
-
def initialize(host, api_key, scope = nil, session_token = nil, debug = false)
|
14
|
+
def initialize(host, api_key, scope = nil, session_token = nil, contact_token_id = nil, debug = false)
|
14
15
|
@host = host
|
15
16
|
@api_key = api_key
|
16
17
|
@session_token = session_token
|
18
|
+
@contact_token_id = contact_token_id
|
17
19
|
@debug = debug
|
18
20
|
self.set_scope(scope)
|
19
21
|
end
|
@@ -218,7 +220,7 @@ module Mints
|
|
218
220
|
headers = {
|
219
221
|
"ApiKey" => @api_key,
|
220
222
|
"Accept" => "application/json",
|
221
|
-
"ContactToken" => @
|
223
|
+
"ContactToken" => @contact_token_id
|
222
224
|
}
|
223
225
|
headers["Authorization"] = "Bearer #{@session_token}" if @session_token
|
224
226
|
return self.http_get(url, headers)
|
@@ -228,7 +230,7 @@ module Mints
|
|
228
230
|
headers = {
|
229
231
|
"ApiKey" => @api_key,
|
230
232
|
"Accept" => "application/json",
|
231
|
-
"ContactToken" => @
|
233
|
+
"ContactToken" => @contact_token_id
|
232
234
|
}
|
233
235
|
headers["Authorization"] = "Bearer #{@session_token}" if @session_token
|
234
236
|
return self.http_post(url, headers, data)
|
@@ -238,7 +240,7 @@ module Mints
|
|
238
240
|
headers = {
|
239
241
|
"ApiKey" => @api_key,
|
240
242
|
"Accept" => "application/json",
|
241
|
-
"ContactToken" => @
|
243
|
+
"ContactToken" => @contact_token_id
|
242
244
|
}
|
243
245
|
headers["Authorization"] = "Bearer #{@session_token}" if @session_token
|
244
246
|
return self.http_post(url, headers, data)
|
@@ -280,7 +282,7 @@ module Mints
|
|
280
282
|
"Content-Type" => "application/json",
|
281
283
|
"ApiKey" => @api_key
|
282
284
|
}
|
283
|
-
h["ContactToken"] = @
|
285
|
+
h["ContactToken"] = @contact_token_id if @contact_token_id
|
284
286
|
if headers
|
285
287
|
headers.each do |k,v|
|
286
288
|
h[k] = v
|
@@ -310,7 +312,7 @@ module Mints
|
|
310
312
|
"Content-Type" => "application/json",
|
311
313
|
"ApiKey" => @api_key
|
312
314
|
}
|
313
|
-
h["ContactToken"] = @
|
315
|
+
h["ContactToken"] = @contact_token_id if @contact_token_id
|
314
316
|
if headers
|
315
317
|
headers.each do |k,v|
|
316
318
|
h[k] = v
|
data/lib/contact.rb
CHANGED
@@ -7,8 +7,8 @@ module Mints
|
|
7
7
|
# === Initialize.
|
8
8
|
# Class constructor
|
9
9
|
#
|
10
|
-
def initialize(host, api_key, session_token = nil, debug = false)
|
11
|
-
@client = Mints::Client.new(host, api_key, "contact", session_token, debug)
|
10
|
+
def initialize(host, api_key, session_token = nil, contact_token_id = nil, debug = false)
|
11
|
+
@client = Mints::Client.new(host, api_key, "contact", session_token, contact_token_id, debug)
|
12
12
|
end
|
13
13
|
|
14
14
|
##
|
@@ -9,9 +9,10 @@ class MintsFilesGenerator < Rails::Generators::Base
|
|
9
9
|
route <<-eos
|
10
10
|
# Mints auto-generated routes (proxy to send request to mints.cloud)
|
11
11
|
namespace :api, defaults: { format: :json } do
|
12
|
-
match '/user/v1/*path' => 'mints_user#index', via: [:get, :post, :put, :patch, :delete]
|
12
|
+
match '/user/v1/*path' => 'mints_user#index', via: [:get, :post, :put, :patch, :delete]
|
13
|
+
match '/contact/v1/*path' => 'mints_contact#index', via: [:get, :post, :put, :patch, :delete]
|
13
14
|
namespace :v1 do
|
14
|
-
match '/contacts/*path' => 'mints_contact#index', via: [:get, :post, :put, :patch, :delete]
|
15
|
+
match '/contacts/*path' => 'mints_contact#index', via: [:get, :post, :put, :patch, :delete]
|
15
16
|
match '/*path' => 'mints_public#index', via: [:get, :post, :put, :patch, :delete]
|
16
17
|
end
|
17
18
|
end
|
data/lib/pub.rb
CHANGED
@@ -42,8 +42,8 @@ module Mints
|
|
42
42
|
# * +contact_token+ - [String] Cookie 'mints_contact_id' value (mints_contact_token)
|
43
43
|
# ==== Return
|
44
44
|
# Returns a Client object
|
45
|
-
def initialize(host, api_key,
|
46
|
-
@client = Mints::Client.new(host, api_key, 'public',
|
45
|
+
def initialize(host, api_key, contact_token_id = nil, debug = false)
|
46
|
+
@client = Mints::Client.new(host, api_key, 'public', nil, contact_token_id, debug)
|
47
47
|
end
|
48
48
|
|
49
49
|
##
|
data/lib/user.rb
CHANGED
@@ -29,7 +29,7 @@ module Mints
|
|
29
29
|
class User
|
30
30
|
attr_reader :client
|
31
31
|
def initialize(host, api_key, session_token = nil, debug = false)
|
32
|
-
@client = Mints::Client.new(host, api_key, 'user', session_token, debug)
|
32
|
+
@client = Mints::Client.new(host, api_key, 'user', session_token, nil, debug)
|
33
33
|
end
|
34
34
|
|
35
35
|
def login(email, password)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mints
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruben Gomez Garcia, Omar Mora, Luis Payan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|