mints 0.0.27 → 0.0.28

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/lib/client.rb +4 -4
  4. data/lib/contact.rb +60 -61
  5. data/lib/errors.rb +1 -1
  6. data/lib/generators/mints_config.yml.erb +0 -2
  7. data/lib/generators/mints_link.rb +3 -3
  8. data/lib/mints/helpers/mints_helper.rb +2 -2
  9. data/lib/pub.rb +55 -55
  10. data/lib/user/config/api_keys.rb +7 -7
  11. data/lib/user/config/appointments.rb +16 -16
  12. data/lib/user/config/attribute_groups.rb +10 -10
  13. data/lib/user/config/attributes.rb +10 -10
  14. data/lib/user/config/calendars.rb +9 -9
  15. data/lib/user/config/config.rb +7 -7
  16. data/lib/user/config/importers.rb +15 -15
  17. data/lib/user/config/public_folders.rb +11 -11
  18. data/lib/user/config/relationships.rb +11 -11
  19. data/lib/user/config/roles.rb +9 -9
  20. data/lib/user/config/seeds.rb +5 -5
  21. data/lib/user/config/system_settings.rb +5 -5
  22. data/lib/user/config/tags.rb +5 -5
  23. data/lib/user/config/taxonomies.rb +15 -15
  24. data/lib/user/config/teams.rb +67 -68
  25. data/lib/user/config/users.rb +70 -71
  26. data/lib/user/contacts/contacts.rb +19 -20
  27. data/lib/user/content/assets.rb +273 -278
  28. data/lib/user/content/content.rb +48 -48
  29. data/lib/user/content/content_instances.rb +136 -138
  30. data/lib/user/content/content_templates.rb +103 -103
  31. data/lib/user/content/conversations.rb +193 -193
  32. data/lib/user/content/dam.rb +83 -80
  33. data/lib/user/content/forms.rb +229 -233
  34. data/lib/user/content/message_templates.rb +152 -151
  35. data/lib/user/content/messages.rb +87 -87
  36. data/lib/user/content/pages.rb +82 -82
  37. data/lib/user/content/stories.rb +101 -101
  38. data/lib/user/content/story_templates.rb +88 -88
  39. data/lib/user/content/story_versions.rb +115 -117
  40. data/lib/user/crm/companies.rb +103 -105
  41. data/lib/user/crm/contacts.rb +285 -292
  42. data/lib/user/crm/crm.rb +19 -19
  43. data/lib/user/crm/deals.rb +103 -103
  44. data/lib/user/crm/favorites.rb +14 -13
  45. data/lib/user/crm/segments.rb +121 -123
  46. data/lib/user/crm/users.rb +20 -20
  47. data/lib/user/crm/workflow_step_objects.rb +84 -84
  48. data/lib/user/crm/workflow_steps.rb +45 -45
  49. data/lib/user/crm/workflows.rb +65 -65
  50. data/lib/user/ecommerce/ecommerce.rb +27 -27
  51. data/lib/user/ecommerce/item_prices.rb +82 -81
  52. data/lib/user/ecommerce/locations.rb +160 -160
  53. data/lib/user/ecommerce/order_items_groups.rb +107 -106
  54. data/lib/user/ecommerce/order_statuses.rb +24 -24
  55. data/lib/user/ecommerce/orders.rb +250 -246
  56. data/lib/user/ecommerce/price_lists.rb +68 -68
  57. data/lib/user/ecommerce/product_templates.rb +99 -99
  58. data/lib/user/ecommerce/product_variations.rb +122 -120
  59. data/lib/user/ecommerce/products.rb +160 -159
  60. data/lib/user/ecommerce/skus.rb +85 -85
  61. data/lib/user/ecommerce/taxes.rb +79 -79
  62. data/lib/user/ecommerce/variant_options.rb +66 -66
  63. data/lib/user/ecommerce/variant_values.rb +69 -69
  64. data/lib/user/helpers/helpers.rb +102 -101
  65. data/lib/user/helpers/object_activities.rb +78 -78
  66. data/lib/user/helpers/object_folders.rb +76 -76
  67. data/lib/user/helpers/user_folders.rb +77 -77
  68. data/lib/user/marketing/marketing.rb +114 -113
  69. data/lib/user/profile/profile.rb +94 -103
  70. data/lib/user.rb +3 -3
  71. metadata +33 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b16560bcbef38099113cdc45c5d892ef203d277bd47e43aa94854abfbbfd33b
4
- data.tar.gz: d0d996931c6067787e310d42f157bea4c5f8fed63a52697cb48ba3f08aa1b05f
3
+ metadata.gz: c247c54117a9cc63173173bb4c5ba9277109b96f7801557eec9a5a2cb333ba88
4
+ data.tar.gz: 4d467715b34ea8919e3cbb2c7fee2b92a5840cef2ab09db55bf28376ad11236a
5
5
  SHA512:
6
- metadata.gz: 8246a30d4b83cc010f756992430a1530b861038f41fa31da9a463d49e1d3e6b8f598bad77e0ad0fdd31c18a9d13ecdf9fa46253408dd72d5bc4d9ba8ec9883fa
7
- data.tar.gz: f574abc3608cc79b1b063ab49dfa60577bb64fb70a96398527270969c6b09ccb0965ef39fbcfb64a25429af5f5dccd09d72f7edd94374762d72d03db9d81f8f0
6
+ metadata.gz: bc6602d5a072942ac14d7d4575911d828ccc5a7a95cdfad6021ecd38a6ad69e318ff3dd6d97b202e5d736a09069d238713fa4e9b9800901a13cd789d27a6a5ab
7
+ data.tar.gz: f86e5bfe64f7372bfc1ee21af5a62e3d58a063f3a4c978e6b3f8595d855ba8b7c0cfa34d1c4a421a7c318010e689234c47104e967b17fe93cf2168b4d807220e
data/Gemfile CHANGED
@@ -5,4 +5,5 @@ gem 'httparty'
5
5
  gem 'addressable'
6
6
  gem 'rails-reverse-proxy', '~> 0.9.1'
7
7
  gem 'redis'
8
- gem "mongo", "~> 2"
8
+ gem "mongo", "~> 2"
9
+ gem 'rubocop', require: false
data/lib/client.rb CHANGED
@@ -29,7 +29,7 @@ module Mints
29
29
 
30
30
  if options&.class == Hash
31
31
  need_encoding = %w[ jfilters afilters rfilters ]
32
- found_options_with_encoding = options.keys.select {|key| need_encoding.include? key.to_s.downcase}
32
+ found_options_with_encoding = options.keys.select {|key| need_encoding.include?(key.to_s.downcase) and options[key]&.class == Hash}
33
33
 
34
34
  found_options_with_encoding.each do |key|
35
35
  options[key] = CGI::escape(Base64.encode64(options[key].to_json))
@@ -146,7 +146,7 @@ module Mints
146
146
 
147
147
  slug = nil
148
148
  uri = Addressable::URI.new
149
- if action == "get"
149
+ if action == 'get'
150
150
  if args.first.class == Hash
151
151
  uri.query_values = args.first
152
152
  elsif args.first.class == String or Integer
@@ -155,7 +155,7 @@ module Mints
155
155
  end
156
156
  url = self.get_url(route, object, uri, slug)
157
157
  response = self.send("#{@scope}_#{action}", url, nil, compatibility_options)
158
- elsif action == "post" or action == "create"
158
+ elsif action == 'post' or action == "create"
159
159
  if args[1].class == Hash
160
160
  uri.query_values = args[1]
161
161
  end
@@ -163,7 +163,7 @@ module Mints
163
163
  action = 'post'
164
164
  data = args[0]
165
165
  response = self.send("#{@scope}_#{action}", url, {data: data}, compatibility_options)
166
- elsif action == "put" or action == "update"
166
+ elsif action == 'put' or action == "update"
167
167
  if args.first.class == String or Integer
168
168
  slug = args.first
169
169
  uri.query_values = args[2]
data/lib/contact.rb CHANGED
@@ -38,7 +38,7 @@ module Mints
38
38
  # }
39
39
  # @mints_contact.register(data);
40
40
  def register(data)
41
- @client.raw("post", "/contacts/register", nil, data_transform(data))
41
+ @client.raw('post', "/contacts/register", nil, data_transform(data))
42
42
  end
43
43
 
44
44
  ##
@@ -56,11 +56,10 @@ module Mints
56
56
  email: email,
57
57
  password: password
58
58
  }
59
- response = @client.raw("post", "/contacts/login", nil, {data: data}.to_json)
60
- if response.key? "session_token"
61
- @client.session_token = response["session_token"]
62
- end
63
- return response
59
+ response = @client.raw('post', "/contacts/login", nil, data_transform(data))
60
+ @client.session_token = response["session_token"] if response.key? "session_token"
61
+
62
+ response
64
63
  end
65
64
 
66
65
  ##
@@ -74,7 +73,7 @@ module Mints
74
73
  # data = { "email": "email@example.com" }
75
74
  # @mints_contact.recover_password(data)
76
75
  def recover_password(data)
77
- @client.raw("post", "/contacts/recover-password", nil, data_transform(data))
76
+ @client.raw('post', "/contacts/recover-password", nil, data_transform(data))
78
77
  end
79
78
 
80
79
  ##
@@ -93,14 +92,14 @@ module Mints
93
92
  # }
94
93
  # @mints_contact.reset_password(data)
95
94
  def reset_password(data)
96
- @client.raw("post", "/contacts/reset-password", nil, data_transform(data))
95
+ @client.raw('post', "/contacts/reset-password", nil, data_transform(data))
97
96
  end
98
97
 
99
98
  ##
100
99
  # === OAuth Login.
101
100
  # Login a contact using oauth.
102
101
  def oauth_login(data)
103
- @client.raw("post", "/contacts/oauth-login", nil, data)
102
+ @client.raw('post', "/contacts/oauth-login", nil, data)
104
103
  end
105
104
 
106
105
  ##
@@ -115,7 +114,7 @@ module Mints
115
114
  # "d8618c6d-a165-41cb-b3ec-d053cbf30059:zm54HtRdfHED8dpILZpjyqjPIceiaXNLfOklqM92fveBS0nDtyPYBlI4CPlPe3zq"
116
115
  # )
117
116
  def magic_link_login(token)
118
- response = @client.raw("get", "/contacts/magic-link-login/#{token}", nil, '/api/v1')
117
+ response = @client.raw('get', "/contacts/magic-link-login/#{token}", nil, '/api/v1')
119
118
  if response.key? "session_token"
120
119
  @client.session_token = response["session_token"]
121
120
  end
@@ -151,7 +150,7 @@ module Mints
151
150
  else
152
151
  data['email'] = email_or_phone
153
152
  end
154
- @client.raw("post", "/contacts/magic-link", nil, { data: data }.to_json, '/api/v1')
153
+ @client.raw('post', "/contacts/magic-link", nil, data_transform(data), '/api/v1')
155
154
  end
156
155
 
157
156
  ### CONTACT/V1 ###
@@ -173,7 +172,7 @@ module Mints
173
172
  # }
174
173
  # @data = @mints_contact.me(options)
175
174
  def me(options = nil)
176
- @client.raw("get", "/me", options, nil, @contact_v1_url)
175
+ @client.raw('get', "/me", options, nil, @contact_v1_url)
177
176
  end
178
177
 
179
178
  ##
@@ -183,7 +182,7 @@ module Mints
183
182
  # ==== Example
184
183
  # @data = @mints_contact.status
185
184
  def status
186
- @client.raw("get", "/status", nil, nil, @contact_v1_url)
185
+ @client.raw('get', "/status", nil, nil, @contact_v1_url)
187
186
  end
188
187
 
189
188
  ##
@@ -200,7 +199,7 @@ module Mints
200
199
  # }
201
200
  # @data = @mints_contact.update(data)
202
201
  def update(data)
203
- @client.raw("put", "/update", nil, data_transform(data), @contact_v1_url)
202
+ @client.raw('put', "/update", nil, data_transform(data), @contact_v1_url)
204
203
  end
205
204
 
206
205
  ##
@@ -210,7 +209,7 @@ module Mints
210
209
  # ==== Example
211
210
  # @data = @mints_contact.logout
212
211
  def logout
213
- response = @client.raw("post", "/logout", nil, nil, @contact_v1_url) if session_token?
212
+ response = @client.raw('post', "/logout", nil, nil, @contact_v1_url) if session_token?
214
213
  if response["success"]
215
214
  @client.session_token = nil
216
215
  end
@@ -228,7 +227,7 @@ module Mints
228
227
  # data = { "password": "new_password" }
229
228
  # @data = @mints_contact.change_password(data)
230
229
  def change_password(data)
231
- @client.raw("post", "/change-password", nil, data_transform(data), @contact_v1_url)
230
+ @client.raw('post', "/change-password", nil, data_transform(data), @contact_v1_url)
232
231
  end
233
232
 
234
233
  # Conversations
@@ -241,7 +240,7 @@ module Mints
241
240
  # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
242
241
  # FIXME: This method doesn't return data.
243
242
  def get_conversations(options = nil)
244
- @client.raw("get", "/content/conversations", options, nil, @contact_v1_url)
243
+ @client.raw('get', "/content/conversations", options, nil, @contact_v1_url)
245
244
  end
246
245
 
247
246
  ##
@@ -253,7 +252,7 @@ module Mints
253
252
  # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
254
253
  # FIXME: This method doesn't return data.
255
254
  def get_conversation(id, options = nil)
256
- @client.raw("get", "/content/conversations/#{id}", options, nil, @contact_v1_url)
255
+ @client.raw('get', "/content/conversations/#{id}", options, nil, @contact_v1_url)
257
256
  end
258
257
 
259
258
  ##
@@ -265,11 +264,11 @@ module Mints
265
264
  #
266
265
  # ==== Example
267
266
  # data = {
268
- # "title": "New Conversation To Test"
267
+ # title: "New Conversation To Test"
269
268
  # }
270
269
  # @data = @mints_contact.create_conversation(data)
271
270
  def create_conversation(data)
272
- @client.raw("post", "/content/conversations", nil, data_transform(data), @contact_v1_url)
271
+ @client.raw('post', "/content/conversations", nil, data_transform(data), @contact_v1_url)
273
272
  end
274
273
 
275
274
  ##
@@ -281,7 +280,7 @@ module Mints
281
280
  # data:: (Hash) -- Data to be submitted.
282
281
  # FIXME: This method doesn't locate conversation id to be updated.
283
282
  def update_conversation(id, data)
284
- @client.raw("put", "/content/conversations/#{id}", nil, data_transform(data), @contact_v1_url)
283
+ @client.raw('put', "/content/conversations/#{id}", nil, data_transform(data), @contact_v1_url)
285
284
  end
286
285
 
287
286
  ##
@@ -293,7 +292,7 @@ module Mints
293
292
  # data:: (Hash) -- Data to be submitted.
294
293
  # FIXME: This method doesn't locate conversation id to be updated.
295
294
  def update_conversation_status(id, data)
296
- @client.raw("put", "/content/conversations/#{id}/status", nil, data_transform(data), @contact_v1_url)
295
+ @client.raw('put', "/content/conversations/#{id}/status", nil, data_transform(data), @contact_v1_url)
297
296
  end
298
297
 
299
298
  ##
@@ -305,7 +304,7 @@ module Mints
305
304
  # FIXME: This method doesn't locate conversation id to be updated.
306
305
  def get_conversation_participants(id)
307
306
  #TODO: Test if this method needs data in options.
308
- @client.raw("get", "/content/conversations/#{id}/participants", nil, nil, @contact_v1_url)
307
+ @client.raw('get', "/content/conversations/#{id}/participants", nil, nil, @contact_v1_url)
309
308
  end
310
309
 
311
310
  ##
@@ -316,7 +315,7 @@ module Mints
316
315
  # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
317
316
  # FIXME: This method doesn't return data.
318
317
  def get_messages(options = nil)
319
- @client.raw("get", "/content/messages", options, nil, @contact_v1_url)
318
+ @client.raw('get', '/content/messages', options, nil, @contact_v1_url)
320
319
  end
321
320
 
322
321
  ##
@@ -328,7 +327,7 @@ module Mints
328
327
  # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
329
328
  # FIXME: This method doesn't return data.
330
329
  def get_message(id, options = nil)
331
- @client.raw("get", "/content/messages/#{id}", options, nil, @contact_v1_url)
330
+ @client.raw('get', "/content/messages/#{id}", options, nil, @contact_v1_url)
332
331
  end
333
332
 
334
333
  ##
@@ -348,7 +347,7 @@ module Mints
348
347
  # }
349
348
  # @data = @mints_contact.create_message(data)
350
349
  def create_message(data)
351
- @client.raw("post", "/content/messages", nil, data_transform(data), @contact_v1_url)
350
+ @client.raw('post', '/content/messages', nil, data_transform(data), @contact_v1_url)
352
351
  end
353
352
 
354
353
  # Appointments
@@ -365,11 +364,11 @@ module Mints
365
364
  #
366
365
  # ==== Second Example
367
366
  # options = {
368
- # "fields": "id, created_at"
367
+ # fields: "id, created_at"
369
368
  # }
370
369
  # @data = @mints_contact.get_appointments(options)
371
370
  def get_appointments(options = nil)
372
- @client.raw("get", "/contacts/appointments", options)
371
+ @client.raw('get', "/contacts/appointments", options)
373
372
  end
374
373
 
375
374
  ##
@@ -384,11 +383,11 @@ module Mints
384
383
  #
385
384
  # ==== Second Example
386
385
  # options = {
387
- # "fields": "id, created_at"
386
+ # fields: "id, created_at"
388
387
  # }
389
388
  # @data = @mints_contact.get_appointment(1, options)
390
389
  def get_appointment(id, options = nil)
391
- @client.raw("get", "/contacts/appointments/#{id}", options)
390
+ @client.raw('get', "/contacts/appointments/#{id}", options)
392
391
  end
393
392
 
394
393
  ##
@@ -402,13 +401,13 @@ module Mints
402
401
  # data = {
403
402
  # "object_model": "products",
404
403
  # "object_id": 1,
405
- # "title": "New Appointment",
404
+ # title: "New Appointment",
406
405
  # "start": "2021-11-25T14:15:00+00:00",
407
406
  # "end": "2022-01-01T13:00:00+00:00"
408
407
  # }
409
408
  # @data = @mints_contact.create_appointment(data)
410
409
  def create_appointment(data)
411
- @client.raw("post", "/contacts/appointments", nil, data_transform(data))
410
+ @client.raw('post', "/contacts/appointments", nil, data_transform(data))
412
411
  end
413
412
 
414
413
  ##
@@ -425,7 +424,7 @@ module Mints
425
424
  # }
426
425
  # @data = @mints_contact.update_appointment(1, data)
427
426
  def update_appointment(id, data)
428
- @client.raw("put", "/contacts/appointments/#{id}", nil, data_transform(data))
427
+ @client.raw('put', "/contacts/appointments/#{id}", nil, data_transform(data))
429
428
  end
430
429
 
431
430
  ##
@@ -444,7 +443,7 @@ module Mints
444
443
  # }
445
444
  # @data = @mints_contact.scheduled_appointments(data)
446
445
  def scheduled_appointments(data)
447
- @client.raw("post", "/contacts/appointments/scheduled-appointments", nil, data_transform(data))
446
+ @client.raw('post', "/contacts/appointments/scheduled-appointments", nil, data_transform(data))
448
447
  end
449
448
 
450
449
  ##
@@ -461,7 +460,7 @@ module Mints
461
460
  # }
462
461
  # @data = @mints_contact.attach_invitee(data)
463
462
  def attach_invitee(data)
464
- @client.raw("post", "/contacts/appointments/attach-invitee", nil, data_transform(data))
463
+ @client.raw('post', "/contacts/appointments/attach-invitee", nil, data_transform(data))
465
464
  end
466
465
 
467
466
  ##
@@ -478,7 +477,7 @@ module Mints
478
477
  # }
479
478
  # @data = @mints_contact.attach_follower(data)
480
479
  def attach_follower(data)
481
- @client.raw("post", "/contacts/appointments/attach-follower", nil, data_transform(data))
480
+ @client.raw('post', "/contacts/appointments/attach-follower", nil, data_transform(data))
482
481
  end
483
482
 
484
483
  ##
@@ -495,7 +494,7 @@ module Mints
495
494
  # }
496
495
  # @data = @mints_contact.detach_invitee(data)
497
496
  def detach_invitee(data)
498
- @client.raw("post", "/contacts/appointments/detach-invitee", nil, data_transform(data))
497
+ @client.raw('post', "/contacts/appointments/detach-invitee", nil, data_transform(data))
499
498
  end
500
499
 
501
500
  ##
@@ -512,7 +511,7 @@ module Mints
512
511
  # }
513
512
  # @data = @mints_contact.detach_follower(data)
514
513
  def detach_follower(data)
515
- @client.raw("post", "/contacts/appointments/detach-follower", nil, data_transform(data))
514
+ @client.raw('post', "/contacts/appointments/detach-follower", nil, data_transform(data))
516
515
  end
517
516
 
518
517
  ##
@@ -529,7 +528,7 @@ module Mints
529
528
  # }
530
529
  # @data = @mints_contact.sync_invitee(data)
531
530
  def sync_invitee(data)
532
- @client.raw("post", "/contacts/appointments/sync-invitee", nil, data_transform(data))
531
+ @client.raw('post', "/contacts/appointments/sync-invitee", nil, data_transform(data))
533
532
  end
534
533
 
535
534
  ##
@@ -546,7 +545,7 @@ module Mints
546
545
  # }
547
546
  # @data = @mints_contact.sync_follower(data)
548
547
  def sync_follower(data)
549
- @client.raw("post", "/contacts/appointments/sync-follower", nil, data_transform(data))
548
+ @client.raw('post', "/contacts/appointments/sync-follower", nil, data_transform(data))
550
549
  end
551
550
 
552
551
  ##
@@ -561,17 +560,17 @@ module Mints
561
560
  # @data = @mints_pub.get_orders
562
561
  #
563
562
  # ==== Second Example
564
- # options = { "fields": "title" }
563
+ # options = { fields: "title" }
565
564
  # @data = @mints_pub.get_orders(options)
566
565
  #
567
566
  # ==== Third Example
568
- # options = { "fields": "title" }
567
+ # options = { fields: "title" }
569
568
  # @data = @mints_pub.get_orders(options, false)
570
569
  def get_orders(options = nil, use_post = true)
571
570
  if use_post
572
- @client.raw("post", "/ecommerce/orders/query", options, nil, @contact_v1_url)
571
+ @client.raw('post', "/ecommerce/orders/query", options, nil, @contact_v1_url)
573
572
  else
574
- @client.raw("get", "/ecommerce/orders", options, nil, @contact_v1_url)
573
+ @client.raw('get', "/ecommerce/orders", options, nil, @contact_v1_url)
575
574
  end
576
575
  end
577
576
 
@@ -588,11 +587,11 @@ module Mints
588
587
  #
589
588
  # ==== Second Example
590
589
  # options = {
591
- # "fields": "title"
590
+ # fields: "title"
592
591
  # }
593
592
  # @data = @mints_pub.get_product(25, options)
594
593
  def get_order(id, options = nil)
595
- @client.raw("get", "/ecommerce/orders/#{id}", options, nil, @contact_v1_url)
594
+ @client.raw('get', "/ecommerce/orders/#{id}", options, nil, @contact_v1_url)
596
595
  end
597
596
 
598
597
  ##
@@ -610,7 +609,7 @@ module Mints
610
609
  # }
611
610
  # @data = @mints_pub.create_order(data)
612
611
  def create_order(data)
613
- @client.raw("post", "/ecommerce/orders", nil, data_transform(data), @contact_v1_url)
612
+ @client.raw('post', "/ecommerce/orders", nil, data_transform(data), @contact_v1_url)
614
613
  end
615
614
 
616
615
  ##
@@ -622,7 +621,7 @@ module Mints
622
621
  # data:: (Hash) -- Data to be submitted.
623
622
  # FIXME: This method doesnt update an order.
624
623
  def update_order(id, data)
625
- @client.raw("put", "/ecommerce/orders/#{id}", nil, data_transform(data), @contact_v1_url)
624
+ @client.raw('put', "/ecommerce/orders/#{id}", nil, data_transform(data), @contact_v1_url)
626
625
  end
627
626
 
628
627
  #TODO: No tested
@@ -634,7 +633,7 @@ module Mints
634
633
  # groupId:: (Integer) -- Order items group id.
635
634
  #
636
635
  def detach_order_item_from_order_item_group(orderItemId, groupId)
637
- @client.raw("put", "/ecommerce/order-items/detach/#{orderItemId}/order-items-groups/#{groupId}", nil, nil, @contact_v1_url)
636
+ @client.raw('put', "/ecommerce/order-items/detach/#{orderItemId}/order-items-groups/#{groupId}", nil, nil, @contact_v1_url)
638
637
  end
639
638
 
640
639
  #TODO: No tested
@@ -646,7 +645,7 @@ module Mints
646
645
  # groupId:: (Integer) -- Order items group id.
647
646
  #
648
647
  def update_order_item_from_order_item_group(orderItemId, groupId, data)
649
- @client.raw("put", "/ecommerce/order-items/update/#{orderItemId}/order-items-groups/#{groupId}", nil, data_transform(data), @contact_v1_url)
648
+ @client.raw('put', "/ecommerce/order-items/update/#{orderItemId}/order-items-groups/#{groupId}", nil, data_transform(data), @contact_v1_url)
650
649
  end
651
650
 
652
651
  ##
@@ -657,7 +656,7 @@ module Mints
657
656
  # @data = @mints_contact.get_my_shopping_cart
658
657
  # FIXME: This method returns a nil data.
659
658
  def get_my_shopping_cart(options = nil)
660
- @client.raw("get", "/ecommerce/my-shopping-cart", options, nil, @contact_v1_url)
659
+ @client.raw('get', "/ecommerce/my-shopping-cart", options, nil, @contact_v1_url)
661
660
  end
662
661
 
663
662
  ##
@@ -675,7 +674,7 @@ module Mints
675
674
  # }
676
675
  # @data = @mints_contact.add_item_to_shopping_cart(data)
677
676
  def add_item_to_shopping_cart(data, options = nil)
678
- @client.raw("post", "/ecommerce/shopping-cart", options, data_transform(data), @contact_v1_url)
677
+ @client.raw('post', "/ecommerce/shopping-cart", options, data_transform(data), @contact_v1_url)
679
678
  end
680
679
 
681
680
  ##
@@ -683,7 +682,7 @@ module Mints
683
682
  # Get a collection of order items.
684
683
  #TODO: Find a way to show order items.
685
684
  def get_order_items(options = nil)
686
- @client.raw("get", "/ecommerce/order-items", options, nil, @contact_v1_url)
685
+ @client.raw('get', "/ecommerce/order-items", options, nil, @contact_v1_url)
687
686
  end
688
687
 
689
688
  ##
@@ -691,7 +690,7 @@ module Mints
691
690
  # Get an order item info.
692
691
  #TODO: Find a way to show order items.
693
692
  def get_order_item(id, options = nil)
694
- @client.raw("get", "/ecommerce/order-items/#{id}", options, nil, @contact_v1_url)
693
+ @client.raw('get', "/ecommerce/order-items/#{id}", options, nil, @contact_v1_url)
695
694
  end
696
695
 
697
696
  ##
@@ -706,11 +705,11 @@ module Mints
706
705
  #
707
706
  # ==== Second Example
708
707
  # options = {
709
- # "fields": "id"
708
+ # fields: "id"
710
709
  # }
711
710
  # @data = @mints_contact.get_order_item_groups(options)
712
711
  def get_order_item_groups(options = nil)
713
- @client.raw("get", "/ecommerce/order-items-groups", options, nil, @contact_v1_url)
712
+ @client.raw('get', "/ecommerce/order-items-groups", options, nil, @contact_v1_url)
714
713
  end
715
714
 
716
715
  ##
@@ -726,11 +725,11 @@ module Mints
726
725
  #
727
726
  # ==== Second Example
728
727
  # options = {
729
- # "fields": "id"
728
+ # fields: "id"
730
729
  # }
731
730
  # @data = @mints_contact.get_order_item_group(130, options)
732
731
  def get_order_item_group(id, options = nil)
733
- @client.raw("get", "/ecommerce/order-items-groups/#{id}", options, nil, @contact_v1_url)
732
+ @client.raw('get', "/ecommerce/order-items-groups/#{id}", options, nil, @contact_v1_url)
734
733
  end
735
734
 
736
735
  ##
@@ -758,7 +757,7 @@ module Mints
758
757
  # }
759
758
  # @data = @mints_contact.create_order_item_group(data)
760
759
  def create_order_item_group(data)
761
- @client.raw("post", "/ecommerce/order-items-groups", nil, data_transform(data), @contact_v1_url)
760
+ @client.raw('post', "/ecommerce/order-items-groups", nil, data_transform(data), @contact_v1_url)
762
761
  end
763
762
 
764
763
  ##
@@ -775,7 +774,7 @@ module Mints
775
774
  # }
776
775
  # @data = @mints_contact.update_order_item_group(130, data)
777
776
  def update_order_item_group(id, data)
778
- @client.raw("put", "/ecommerce/order-items-groups/#{id}", nil, data_transform(data), @contact_v1_url)
777
+ @client.raw('put', "/ecommerce/order-items-groups/#{id}", nil, data_transform(data), @contact_v1_url)
779
778
  end
780
779
 
781
780
  ##
@@ -783,7 +782,7 @@ module Mints
783
782
  # Delete an order item group.
784
783
  # FIXME: This method doesn't work. Throw no action error.
785
784
  def delete_order_item_group(id)
786
- @client.raw("delete", "/ecommerce/order-items-groups/#{id}", nil, nil, @contact_v1_url)
785
+ @client.raw('delete', "/ecommerce/order-items-groups/#{id}", nil, nil, @contact_v1_url)
787
786
  end
788
787
 
789
788
  private
data/lib/errors.rb CHANGED
@@ -75,7 +75,7 @@ module Mints
75
75
 
76
76
  class ResourceNotFoundException < ServiceError; end
77
77
 
78
- class MethodNotAllowed < ServiceError; end
78
+ class MethodNotAllowedException < ServiceError; end
79
79
 
80
80
  class ValidationException < ServiceError
81
81
 
@@ -3,8 +3,6 @@ mints:
3
3
  host: http://your_host_goes_here.com
4
4
  api_key: your_mints_api_key_goes_here
5
5
  mints_slug: slug_id #save id and token in redis
6
- user_email: mints_user_email
7
- user_password: mints_user_password
8
6
  redis_cache:
9
7
  use_cache: boolean_value_to_enable_and_disable_cache
10
8
  redis_host: your_redis_server_host
@@ -44,14 +44,14 @@ class MintsLink
44
44
  result.n === 1
45
45
  end
46
46
 
47
- def get_visits(filter, page = 1, pageSize = 1000)
47
+ def get_visits(filter, page = 1, page_size = 1000)
48
48
  collection = @sl_visits
49
- collection.find(filter).sort( {_id: 1}).skip(page * pageSize - pageSize).limit(pageSize)
49
+ collection.find(filter).sort( {_id: 1}).skip(page * page_size - page_size).limit(page_size)
50
50
  end
51
51
 
52
52
  private
53
53
  def random_string(length = 6)
54
- rand(32**length).to_s(32)
54
+ rand((32 ** length).to_i).to_s(32)
55
55
  end
56
56
 
57
57
  def generate_indexes
@@ -10,9 +10,9 @@ module MintsHelper
10
10
  #
11
11
  def get_query_results(url, options = nil, use_post = true)
12
12
  if use_post
13
- @client.raw("post", "#{url}/query", options)
13
+ @client.raw('post', "#{url}/query", options)
14
14
  else
15
- @client.raw("get", url, options)
15
+ @client.raw('get', url, options)
16
16
  end
17
17
  end
18
18