mints 0.0.13 → 0.0.14

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: c41c7087845ab6006184ede917cacbd44060204251bf3ca22feba75c3a259833
4
- data.tar.gz: 5e9ad370733cb076c6000d5127d979b9727c7c103e56a79095ff881de0249a7f
3
+ metadata.gz: 3deabf302a32fac1452e45f7ab9753ec0a1ee7973535b0371b9c67a25cb60cc7
4
+ data.tar.gz: 9589dacb58814ad17c5a2826f866b929f862d7ce7ce3fc745dcd3e191c2f19c9
5
5
  SHA512:
6
- metadata.gz: aa5b4e5709e9852e34bf9411cc158d75faf35204bd897625106748ed27d00f7217b16fbb844abc28ec935b83dd6ade6ca7708330280d61de6969ca3a498b7425
7
- data.tar.gz: 265637b717d062e3c0474b3ad5d1275f7c3329568a4fcc6b181f6198cddd5ef325583cdaa3827c6e6ff752b24b458316c9dda6f068946142577101c16ea3bff3
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" => @contact_token
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" => @contact_token
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" => @contact_token
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"] = @contact_token if @contact_token
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"] = @contact_token if @contact_token
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, contact_token = nil, debug = false)
46
- @client = Mints::Client.new(host, api_key, 'public', contact_token, debug)
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.13
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-06-29 00:00:00.000000000 Z
11
+ date: 2021-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json