mints 0.0.29 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +290 -32
- data/lib/contact/config/appointments.rb +1 -1
- data/lib/contact/config/config.rb +2 -2
- data/lib/contact/content/content.rb +2 -2
- data/lib/contact/content/conversations.rb +2 -2
- data/lib/contact/ecommerce/ecommerce.rb +6 -4
- data/lib/contact/ecommerce/order_items.rb +1 -1
- data/lib/contact/ecommerce/order_items_groups.rb +1 -1
- data/lib/contact/ecommerce/orders.rb +1 -2
- data/lib/contact/ecommerce/vouchers.rb +18 -0
- data/lib/contact.rb +9 -3
- data/lib/errors.rb +1 -1
- data/lib/mints/controllers/concerns/mints_clients.rb +3 -1
- data/lib/mints/helpers/contact_auth_helper.rb +2 -2
- data/lib/mints/helpers/proxy_controllers_methods.rb +1 -1
- data/lib/pub/config/attributes.rb +13 -0
- data/lib/pub/config/config.rb +15 -0
- data/lib/pub/config/public_folders.rb +51 -0
- data/lib/pub/config/tags.rb +42 -0
- data/lib/pub/config/taxonomies.rb +49 -0
- data/lib/pub/content/assets.rb +16 -0
- data/lib/pub/content/content.rb +22 -0
- data/lib/pub/content/content_bundles.rb +40 -0
- data/lib/pub/content/content_instance_versions.rb +56 -0
- data/lib/pub/content/content_instances.rb +37 -0
- data/lib/pub/content/forms.rb +47 -0
- data/lib/pub/content/stories.rb +44 -0
- data/lib/pub/content/story_versions.rb +46 -0
- data/lib/pub/ecommerce/ecommerce.rb +14 -0
- data/lib/pub/ecommerce/locations.rb +25 -0
- data/lib/pub/ecommerce/orders.rb +31 -0
- data/lib/pub/ecommerce/products.rb +45 -0
- data/lib/pub.rb +6 -427
- data/lib/user/config/config.rb +1 -1
- data/lib/user/config/public_folders.rb +1 -1
- data/lib/user/config/users.rb +4 -4
- data/lib/user/content/content.rb +0 -55
- data/lib/user/content/forms.rb +4 -4
- data/lib/user/content/messages.rb +4 -4
- data/lib/user/content/stories.rb +8 -5
- data/lib/user/content/story_templates.rb +2 -2
- data/lib/user/crm/contacts.rb +0 -13
- data/lib/user/crm/workflow_steps.rb +4 -4
- data/lib/user/crm/workflows.rb +4 -4
- data/lib/user/ecommerce/ecommerce.rb +2 -0
- data/lib/user/ecommerce/locations.rb +2 -2
- data/lib/user/ecommerce/order_items_groups.rb +2 -2
- data/lib/user/ecommerce/skus.rb +2 -2
- data/lib/user/ecommerce/vouchers.rb +90 -0
- metadata +21 -2
data/lib/pub.rb
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
require 'yaml'
|
4
4
|
require_relative './client'
|
5
5
|
require_relative './mints/helpers/mints_helper'
|
6
|
+
require_relative './pub/content/content'
|
7
|
+
require_relative './pub/ecommerce/ecommerce'
|
8
|
+
require_relative './pub/config/config'
|
6
9
|
|
7
10
|
module Mints
|
8
11
|
##
|
@@ -61,6 +64,9 @@ module Mints
|
|
61
64
|
attr_reader :client
|
62
65
|
|
63
66
|
include MintsHelper
|
67
|
+
include PublicContent
|
68
|
+
include PublicEcommerce
|
69
|
+
include PublicConfig
|
64
70
|
|
65
71
|
##
|
66
72
|
# === Initialize.
|
@@ -118,433 +124,6 @@ module Mints
|
|
118
124
|
@client.raw('get', "/register-visit-timer?visit=#{visit}&time=#{time}")
|
119
125
|
end
|
120
126
|
|
121
|
-
### V1/CONTENT ###
|
122
|
-
|
123
|
-
##
|
124
|
-
# === Get Asset Info.
|
125
|
-
# Get a description of an Asset.
|
126
|
-
#
|
127
|
-
# ==== Parameters
|
128
|
-
# slug:: (String) -- It's the string identifier of the asset.
|
129
|
-
#
|
130
|
-
# ==== Example
|
131
|
-
# @data = @mints_pub.get_asset_info("asset_slug")
|
132
|
-
def get_asset_info(slug)
|
133
|
-
@client.raw('get', "/content/asset-info/#{slug}")
|
134
|
-
end
|
135
|
-
|
136
|
-
##
|
137
|
-
# === Get Stories.
|
138
|
-
# Get a collection of stories.
|
139
|
-
#
|
140
|
-
# ==== Parameters
|
141
|
-
# options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
|
142
|
-
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
143
|
-
#
|
144
|
-
# ==== First Example
|
145
|
-
# @data = @mints_pub.get_stories
|
146
|
-
#
|
147
|
-
# ==== Second Example
|
148
|
-
# options = { fields: 'id, slug' }
|
149
|
-
# @data = @mints_pub.get_stories(options)
|
150
|
-
#
|
151
|
-
# ==== Third Example
|
152
|
-
# options = {
|
153
|
-
# fields: 'id, slug'
|
154
|
-
# }
|
155
|
-
# @data = @mints_pub.get_stories(options, false)
|
156
|
-
def get_stories(options = nil, use_post = true)
|
157
|
-
get_query_results('/content/stories', options, use_post)
|
158
|
-
end
|
159
|
-
|
160
|
-
##
|
161
|
-
# === Get Story.
|
162
|
-
# Get a single story.
|
163
|
-
#
|
164
|
-
# ==== Parameters
|
165
|
-
# slug:: (String) -- It's the string identifier generated by Mints.
|
166
|
-
# options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
|
167
|
-
#
|
168
|
-
# ==== First Example
|
169
|
-
# @data = @mints_pub.get_story("story_slug")
|
170
|
-
#
|
171
|
-
# ==== Second Example
|
172
|
-
# @data = @mints_pub.get_story("story_slug", options.to_json)
|
173
|
-
def get_story(slug, options = nil)
|
174
|
-
@client.raw('get', "/content/stories/#{slug}", options)
|
175
|
-
end
|
176
|
-
|
177
|
-
##
|
178
|
-
# === Get Story Versions.
|
179
|
-
# Get a collection of story version.
|
180
|
-
#
|
181
|
-
# ==== Parameters
|
182
|
-
# options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
|
183
|
-
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
184
|
-
#
|
185
|
-
# ==== First Example
|
186
|
-
# @data = @mints_pub.get_story_versions
|
187
|
-
#
|
188
|
-
# ==== Second Example
|
189
|
-
# options = {
|
190
|
-
# fields: 'id, title'
|
191
|
-
# }
|
192
|
-
# @data = @mints_pub.get_story_versions(options)
|
193
|
-
#
|
194
|
-
# ==== Third Example
|
195
|
-
# options = {
|
196
|
-
# fields: 'id, title'
|
197
|
-
# }
|
198
|
-
# @data = @mints_pub.get_story_versions(options, false)
|
199
|
-
def get_story_versions(options = nil, use_post = true)
|
200
|
-
get_query_results('/content/story-versions', options, use_post)
|
201
|
-
end
|
202
|
-
|
203
|
-
##
|
204
|
-
# === Get Story Version.
|
205
|
-
# Get a single story version.
|
206
|
-
#
|
207
|
-
# ==== Parameters
|
208
|
-
# slug:: (String) -- It's the string identifier generated by Mints.
|
209
|
-
# options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
|
210
|
-
#
|
211
|
-
# ==== First Example
|
212
|
-
# @data = @mints_pub.get_story_version("story_slug")
|
213
|
-
#
|
214
|
-
# ==== Second Example
|
215
|
-
# @data = @mints_pub.get_story_version("story_slug", options.to_json)
|
216
|
-
def get_story_version(slug, options = nil)
|
217
|
-
@client.raw('get', "/content/story-versions/#{slug}", options)
|
218
|
-
end
|
219
|
-
|
220
|
-
##
|
221
|
-
# === Get Forms.
|
222
|
-
# Get a collection of forms.
|
223
|
-
#
|
224
|
-
# ==== Example
|
225
|
-
# @data = @mints_pub.get_forms
|
226
|
-
def get_forms(options = nil)
|
227
|
-
@client.raw('get', '/content/forms', options)
|
228
|
-
end
|
229
|
-
|
230
|
-
##
|
231
|
-
# === Get Form.
|
232
|
-
# Get a single form.
|
233
|
-
#
|
234
|
-
# ==== Parameters
|
235
|
-
# slug:: (String) -- It's the string identifier generated by Mints.
|
236
|
-
#
|
237
|
-
# ==== Example
|
238
|
-
# @data = @mints_pub.get_form("form_slug")
|
239
|
-
def get_form(slug, options = nil)
|
240
|
-
@client.raw('get', "/content/forms/#{slug}", options)
|
241
|
-
end
|
242
|
-
|
243
|
-
##
|
244
|
-
# === Submit Form.
|
245
|
-
# Submit a form with data.
|
246
|
-
#
|
247
|
-
# ==== Parameters
|
248
|
-
# data:: (Hash) -- Data to be submitted.
|
249
|
-
#
|
250
|
-
# ==== Example
|
251
|
-
# data = {
|
252
|
-
# 'form_slug': 'form_slug',
|
253
|
-
# 'email': 'email@example.com',
|
254
|
-
# 'given_name': 'given_name',
|
255
|
-
# 'f1': 'Field 1 answer',
|
256
|
-
# 'f2': 'Field 2 answer',
|
257
|
-
# 'f3': 'Field 3 answer'
|
258
|
-
# }
|
259
|
-
# @data = @mints_pub.submit_form(data)
|
260
|
-
def submit_form(data)
|
261
|
-
@client.raw('post', '/content/forms/submit', nil, data_transform(data))
|
262
|
-
end
|
263
|
-
|
264
|
-
##
|
265
|
-
# === Get Content Instances.
|
266
|
-
# Get a collection of content instances. _Note:_ Options must be specified.
|
267
|
-
#
|
268
|
-
# ==== Parameters
|
269
|
-
# options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
|
270
|
-
#
|
271
|
-
# ==== First Example
|
272
|
-
# options = {
|
273
|
-
# "template": "content_instance_template_slug"
|
274
|
-
# }
|
275
|
-
# @data = @mints_pub.get_content_instances(options)
|
276
|
-
#
|
277
|
-
# ==== Second Example
|
278
|
-
# options = {
|
279
|
-
# "template": "content_instance_template_slug",
|
280
|
-
# sort: "-id"
|
281
|
-
# }
|
282
|
-
# @data = @mints_pub.get_content_instances(options)
|
283
|
-
def get_content_instances(options = nil)
|
284
|
-
@client.raw('get', '/content/content-instances', options)
|
285
|
-
end
|
286
|
-
|
287
|
-
##
|
288
|
-
# === Get Content Instance.
|
289
|
-
# Get a single content instance.
|
290
|
-
#
|
291
|
-
# ==== Parameters
|
292
|
-
# slug:: (String) -- It's the string identifier generated by Mints.
|
293
|
-
#
|
294
|
-
# ==== Example
|
295
|
-
# @data = @mints_pub.get_content_instance("content_instance_slug")
|
296
|
-
def get_content_instance(slug)
|
297
|
-
@client.raw('get', "/content/content-instances/#{slug}")
|
298
|
-
end
|
299
|
-
|
300
|
-
##
|
301
|
-
# === Get Content Pages.
|
302
|
-
# Get all content pages.
|
303
|
-
#
|
304
|
-
# ==== Parameters
|
305
|
-
# options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
|
306
|
-
def get_content_bundles(options = nil)
|
307
|
-
@client.raw('get', '/content/content-bundles', options)
|
308
|
-
end
|
309
|
-
|
310
|
-
##
|
311
|
-
# === Get Content Page.
|
312
|
-
# Get a single content page.
|
313
|
-
#
|
314
|
-
# ==== Parameters
|
315
|
-
# slug:: (String) -- It's the string identifier generated by Mints.
|
316
|
-
#
|
317
|
-
# ==== Example
|
318
|
-
# @data = @mints_pub.get_content_page("test-page")
|
319
|
-
def get_content_page(slug, options = nil)
|
320
|
-
warn '[DEPRECATED] The get_content_page method is deprecated and will be removed in the future, use get_content_bundle instead'
|
321
|
-
@client.raw('get', "/content/content-pages/#{slug}", options)
|
322
|
-
end
|
323
|
-
|
324
|
-
##
|
325
|
-
# === Get Content Bundle.
|
326
|
-
# Get a single content bundle.
|
327
|
-
#
|
328
|
-
# ==== Parameters
|
329
|
-
# slug:: (String) -- It's the string identifier generated by Mints.
|
330
|
-
#
|
331
|
-
# ==== Example
|
332
|
-
# @data = @mints_pub.get_content_bundle("test-page")
|
333
|
-
def get_content_bundle(slug, options = nil)
|
334
|
-
@client.raw('get', "/content/content-bundles/#{slug}", options)
|
335
|
-
end
|
336
|
-
|
337
|
-
### V1/ECOMMERCE ###
|
338
|
-
|
339
|
-
##
|
340
|
-
# === Get Locations.
|
341
|
-
# Get all locations.
|
342
|
-
#
|
343
|
-
# ==== Parameters
|
344
|
-
# options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
|
345
|
-
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
346
|
-
#
|
347
|
-
# ==== First Example
|
348
|
-
# @data = @mints_pub.get_locations
|
349
|
-
#
|
350
|
-
# ==== Second Example
|
351
|
-
# options = { fields: "title" }
|
352
|
-
# @data = @mints_pub.get_locations(options)
|
353
|
-
#
|
354
|
-
# ==== Third Example
|
355
|
-
# options = { fields: "title" }
|
356
|
-
# @data = @mints_pub.get_locations(options, false)
|
357
|
-
def get_locations(options = nil, use_post = true)
|
358
|
-
get_query_results('/ecommerce/locations', options, use_post)
|
359
|
-
end
|
360
|
-
|
361
|
-
##
|
362
|
-
# === Get Products.
|
363
|
-
# Get a collection of products.
|
364
|
-
#
|
365
|
-
# ==== Parameters
|
366
|
-
# options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
|
367
|
-
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
368
|
-
#
|
369
|
-
# ==== First Example
|
370
|
-
# @data = @mints_pub.get_products
|
371
|
-
#
|
372
|
-
# ==== Second Example
|
373
|
-
# options = { fields: "title" }
|
374
|
-
# @data = @mints_pub.get_products(options)
|
375
|
-
#
|
376
|
-
# ==== Third Example
|
377
|
-
# options = { fields: "title" }
|
378
|
-
# @data = @mints_pub.get_products(options, false)
|
379
|
-
def get_products(options = nil, use_post = true)
|
380
|
-
get_query_results('/ecommerce/products', options, use_post)
|
381
|
-
end
|
382
|
-
|
383
|
-
##
|
384
|
-
# === Get Product.
|
385
|
-
# Get a single product.
|
386
|
-
#
|
387
|
-
# ==== Parameters
|
388
|
-
# slug:: (String) -- It's the string identifier generated by Mints.
|
389
|
-
# options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
|
390
|
-
#
|
391
|
-
# ==== First Example
|
392
|
-
# @data = @mints_pub.get_product("product_slug")
|
393
|
-
#
|
394
|
-
# ==== Second Example
|
395
|
-
# options = {
|
396
|
-
# fields: 'id, slug'
|
397
|
-
# }
|
398
|
-
# @data = @mints_pub.get_product("lego-set", options)
|
399
|
-
def get_product(slug, options = nil)
|
400
|
-
@client.raw('get', "/ecommerce/products/#{slug}", options)
|
401
|
-
end
|
402
|
-
|
403
|
-
### V1/CONFIG ###
|
404
|
-
|
405
|
-
##
|
406
|
-
# === Get Public Folders.
|
407
|
-
# Get a collection of public folders.
|
408
|
-
#
|
409
|
-
# ==== Parameters
|
410
|
-
# options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
|
411
|
-
#
|
412
|
-
# ==== First Example
|
413
|
-
# options = {
|
414
|
-
# object_type: "products"
|
415
|
-
# }
|
416
|
-
# @data = @mints_pub.get_public_folders(options)
|
417
|
-
#
|
418
|
-
# ==== Second Example
|
419
|
-
# options = {
|
420
|
-
# object_type: "products",
|
421
|
-
# fields: "id",
|
422
|
-
# sort: "-id"
|
423
|
-
# }
|
424
|
-
# @data = @mints_pub.get_public_folders(options)
|
425
|
-
def get_public_folders(options = nil)
|
426
|
-
@client.raw('get', '/config/public-folders', options)
|
427
|
-
end
|
428
|
-
|
429
|
-
##
|
430
|
-
# === Get Public Folder.
|
431
|
-
# Get a public folder info.
|
432
|
-
#
|
433
|
-
# ==== Parameters
|
434
|
-
# slug:: (String) -- It's the string identifier generated by Mints.
|
435
|
-
# options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
|
436
|
-
#
|
437
|
-
# ==== First Example
|
438
|
-
# options = {
|
439
|
-
# object_type: "products"
|
440
|
-
# }
|
441
|
-
# @data = @mints_pub.get_public_folder('yellow', options)
|
442
|
-
#
|
443
|
-
# ==== Second Example
|
444
|
-
# options = {
|
445
|
-
# object_type: "products",
|
446
|
-
# fields: 'id, title'
|
447
|
-
# }
|
448
|
-
# @data = @mints_pub.get_public_folder('yellow', options)
|
449
|
-
def get_public_folder(slug, options)
|
450
|
-
@client.raw('get', "/config/public-folders/#{slug}", options)
|
451
|
-
end
|
452
|
-
|
453
|
-
##
|
454
|
-
# === Get Tags.
|
455
|
-
# Get a collection of tags.
|
456
|
-
#
|
457
|
-
# ==== Parameters
|
458
|
-
# options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
|
459
|
-
#
|
460
|
-
# ==== First Example
|
461
|
-
# @data = @mints_pub.get_tags
|
462
|
-
#
|
463
|
-
# ==== Second Example
|
464
|
-
# options = {
|
465
|
-
# fields: "id, tag"
|
466
|
-
# }
|
467
|
-
# @data = @mints_pub.get_tags(options)
|
468
|
-
def get_tags(options = nil)
|
469
|
-
@client.raw('get', '/config/tags', options)
|
470
|
-
end
|
471
|
-
|
472
|
-
##
|
473
|
-
# === Get Tag.
|
474
|
-
# Get a single tag.
|
475
|
-
#
|
476
|
-
# ==== Parameters
|
477
|
-
# slug:: (String) -- It's the string identifier generated by Mints.
|
478
|
-
# options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
|
479
|
-
#
|
480
|
-
# ==== First Example
|
481
|
-
# @data = @mints_pub.get_tag("tag_slug")
|
482
|
-
#
|
483
|
-
# ==== Second Example
|
484
|
-
# options = {
|
485
|
-
# fields: "id, tag"
|
486
|
-
# }
|
487
|
-
# @data = @mints_pub.get_tag("tag-example", options)
|
488
|
-
def get_tag(slug, options = nil)
|
489
|
-
@client.raw('get', "/config/tags/#{slug}", options)
|
490
|
-
end
|
491
|
-
|
492
|
-
##
|
493
|
-
# === Get Taxonomies.
|
494
|
-
# Get a collection of taxonomies.
|
495
|
-
#
|
496
|
-
# ==== Parameters
|
497
|
-
# options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
|
498
|
-
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
499
|
-
#
|
500
|
-
# ==== First Example
|
501
|
-
# @data = @mints_pub.get_taxonomies
|
502
|
-
#
|
503
|
-
# ==== Second Example
|
504
|
-
# options = {
|
505
|
-
# fields: 'id, title'
|
506
|
-
# }
|
507
|
-
# @data = @mints_pub.get_taxonomies(options)
|
508
|
-
#
|
509
|
-
# ==== Third Example
|
510
|
-
# options = {
|
511
|
-
# fields: 'id, title'
|
512
|
-
# }
|
513
|
-
# @data = @mints_pub.get_taxonomies(options, false)
|
514
|
-
def get_taxonomies(options = nil, use_post = true)
|
515
|
-
get_query_results('/config/taxonomies', options, use_post)
|
516
|
-
end
|
517
|
-
|
518
|
-
##
|
519
|
-
# === Get Taxonomy.
|
520
|
-
# Get a single taxonomy.
|
521
|
-
#
|
522
|
-
# ==== Parameters
|
523
|
-
# slug:: (String) -- It's the string identifier generated by Mints.
|
524
|
-
# options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
|
525
|
-
#
|
526
|
-
# ==== First Example
|
527
|
-
# @data = @mints_pub.get_taxonomy('taxonomy_slug')
|
528
|
-
#
|
529
|
-
# ==== Second Example
|
530
|
-
# options = {
|
531
|
-
# fields: 'title'
|
532
|
-
# }
|
533
|
-
# @data = @mints_pub.get_taxonomy('taxonomy_slug', options)
|
534
|
-
def get_taxonomy(slug, options = nil)
|
535
|
-
@client.raw('get', "/config/taxonomies/#{slug}", options)
|
536
|
-
end
|
537
|
-
|
538
|
-
##
|
539
|
-
# === Get Attributes.
|
540
|
-
# Get a collection of attributes.
|
541
|
-
#
|
542
|
-
# ==== Example
|
543
|
-
# @data = @mints_pub.get_attributes
|
544
|
-
def get_attributes
|
545
|
-
@client.raw('get', '/config/attributes')
|
546
|
-
end
|
547
|
-
|
548
127
|
def send_user_magic_link(email_or_phone, template_slug, redirect_url = '', life_time = 1440, max_visits = nil, driver = 'email')
|
549
128
|
data = {
|
550
129
|
driver: driver,
|
data/lib/user/config/config.rb
CHANGED
data/lib/user/config/users.rb
CHANGED
@@ -51,8 +51,8 @@ module Users
|
|
51
51
|
# is_coach: false
|
52
52
|
# }
|
53
53
|
# @data = @mints_user.create_user(data)
|
54
|
-
def create_user(data)
|
55
|
-
@client.raw('post', '/config/users',
|
54
|
+
def create_user(data, options = nil)
|
55
|
+
@client.raw('post', '/config/users', options, data_transform(data))
|
56
56
|
end
|
57
57
|
|
58
58
|
# === Update user.
|
@@ -71,7 +71,7 @@ module Users
|
|
71
71
|
# roles: ''
|
72
72
|
# }
|
73
73
|
# @data = @mints_user.update_user(14, data)
|
74
|
-
def update_user(id, data)
|
75
|
-
@client.raw('put', "/config/users/#{id}",
|
74
|
+
def update_user(id, data, options = nil)
|
75
|
+
@client.raw('put', "/config/users/#{id}", options, data_transform(data))
|
76
76
|
end
|
77
77
|
end
|
data/lib/user/content/content.rb
CHANGED
@@ -36,61 +36,6 @@ module Content
|
|
36
36
|
@client.raw('get', '/content/public-images-url')
|
37
37
|
end
|
38
38
|
|
39
|
-
##
|
40
|
-
# == Authors
|
41
|
-
#
|
42
|
-
|
43
|
-
# === Get authors.
|
44
|
-
# Get authors.
|
45
|
-
#
|
46
|
-
# ==== Example
|
47
|
-
# @data = @mints_user.get_authors
|
48
|
-
def get_authors
|
49
|
-
@client.raw('get', '/content/authors')
|
50
|
-
end
|
51
|
-
|
52
|
-
# === Get author.
|
53
|
-
# Get an author.
|
54
|
-
#
|
55
|
-
# ==== Parameters
|
56
|
-
# id:: (Integer) -- Author id.
|
57
|
-
#
|
58
|
-
# ==== Example
|
59
|
-
# @data = @mints_user.get_author(1)
|
60
|
-
def get_author(id)
|
61
|
-
@client.raw('get', "/content/authors/#{id}")
|
62
|
-
end
|
63
|
-
|
64
|
-
# === Create author.
|
65
|
-
# Create an author with data.
|
66
|
-
#
|
67
|
-
# ==== Parameters
|
68
|
-
# data:: (Hash) -- Data to be submitted.
|
69
|
-
#
|
70
|
-
# ==== Example
|
71
|
-
# data = {
|
72
|
-
# title: 'Howard Phillips Lovecraft',
|
73
|
-
# slug: 'howard-phillips-lovecraft'
|
74
|
-
# }
|
75
|
-
# @data = @mints_user.create_author(data.to_json)
|
76
|
-
def create_author(data)
|
77
|
-
@client.raw('post', '/content/authors', nil, data)
|
78
|
-
end
|
79
|
-
|
80
|
-
# === Update author.
|
81
|
-
# Update an author info.
|
82
|
-
#
|
83
|
-
# ==== Parameters
|
84
|
-
# id:: (Integer) -- Author id.
|
85
|
-
# data:: (Hash) -- Data to be submitted.
|
86
|
-
#
|
87
|
-
# ==== Example
|
88
|
-
#
|
89
|
-
def update_author(id, data)
|
90
|
-
# FIXME: Author controller doesnt receive data
|
91
|
-
@client.raw('put', "/content/authors/#{id}", nil, data)
|
92
|
-
end
|
93
|
-
|
94
39
|
##
|
95
40
|
# == Keywords
|
96
41
|
#
|
data/lib/user/content/forms.rb
CHANGED
@@ -173,8 +173,8 @@ module Forms
|
|
173
173
|
# slug: 'new-form-slug'
|
174
174
|
# }
|
175
175
|
# @data = @mints_user.create_form(data)
|
176
|
-
def create_form(data)
|
177
|
-
@client.raw('post', '/content/forms',
|
176
|
+
def create_form(data, options = nil)
|
177
|
+
@client.raw('post', '/content/forms', options, data_transform(data))
|
178
178
|
end
|
179
179
|
|
180
180
|
# === Update form.
|
@@ -190,8 +190,8 @@ module Forms
|
|
190
190
|
# slug: 'new-form-slug'
|
191
191
|
# }
|
192
192
|
# @data = @mints_user.update_form(3, data)
|
193
|
-
def update_form(id, data)
|
194
|
-
@client.raw('put', "/content/forms/#{id}",
|
193
|
+
def update_form(id, data, options = nil)
|
194
|
+
@client.raw('put', "/content/forms/#{id}", options, data_transform(data))
|
195
195
|
end
|
196
196
|
|
197
197
|
# === Delete form.
|
@@ -56,8 +56,8 @@ module Messages
|
|
56
56
|
# }
|
57
57
|
# }
|
58
58
|
# @data = @mints_user.create_message(data)
|
59
|
-
def create_message(data)
|
60
|
-
@client.raw('post', '/content/messages',
|
59
|
+
def create_message(data, options = nil)
|
60
|
+
@client.raw('post', '/content/messages', options, data_transform(data))
|
61
61
|
end
|
62
62
|
|
63
63
|
# === Update message.
|
@@ -74,8 +74,8 @@ module Messages
|
|
74
74
|
# }
|
75
75
|
# }
|
76
76
|
# @data = @mints_user.update_message(102, data)
|
77
|
-
def update_message(id, data)
|
78
|
-
@client.raw('put', "/content/messages/#{id}",
|
77
|
+
def update_message(id, data, options = nil)
|
78
|
+
@client.raw('put', "/content/messages/#{id}", options, data_transform(data))
|
79
79
|
end
|
80
80
|
|
81
81
|
# === Delete message.
|
data/lib/user/content/stories.rb
CHANGED
@@ -71,9 +71,12 @@ module Stories
|
|
71
71
|
# slug: "new-story",
|
72
72
|
# story_template_id: 1
|
73
73
|
# }
|
74
|
-
#
|
75
|
-
|
76
|
-
|
74
|
+
#
|
75
|
+
# options = { fields: 'id,slug' }
|
76
|
+
#
|
77
|
+
# @data = @mints_user.create_story(data, options)
|
78
|
+
def create_story(data, options = nil)
|
79
|
+
@client.raw('post', '/content/stories', options, data_transform(data))
|
77
80
|
end
|
78
81
|
|
79
82
|
# === Update story.
|
@@ -89,8 +92,8 @@ module Stories
|
|
89
92
|
# slug: 'new-story'
|
90
93
|
# }
|
91
94
|
# @data = @mints_user.update_story(5, data)
|
92
|
-
def update_story(id, data)
|
93
|
-
@client.raw('put', "/content/stories/#{id}",
|
95
|
+
def update_story(id, data, options = nil)
|
96
|
+
@client.raw('put', "/content/stories/#{id}", options, data_transform(data))
|
94
97
|
end
|
95
98
|
|
96
99
|
# === Delete story.
|
@@ -75,8 +75,8 @@ module StoryTemplates
|
|
75
75
|
# slug: 'new-story-template-slug'
|
76
76
|
# }
|
77
77
|
# @data = @mints_user.create_story_template(data)
|
78
|
-
def create_story_template(data)
|
79
|
-
@client.raw('post', '/content/story-templates',
|
78
|
+
def create_story_template(data, options = nil)
|
79
|
+
@client.raw('post', '/content/story-templates', options, data_transform(data))
|
80
80
|
end
|
81
81
|
|
82
82
|
# === Update story template.
|
data/lib/user/crm/contacts.rb
CHANGED
@@ -238,19 +238,6 @@ module Contacts
|
|
238
238
|
@client.raw('get', "/crm/contacts/#{contact_id}/tags")
|
239
239
|
end
|
240
240
|
|
241
|
-
##
|
242
|
-
# === Get contact magic links.
|
243
|
-
# Get magic links of a contact.
|
244
|
-
#
|
245
|
-
# ==== Parameters
|
246
|
-
# contact_id:: (Integer) -- Contact id.
|
247
|
-
#
|
248
|
-
# ==== Example
|
249
|
-
# @data = @mints_user.get_contact_magic_links(150)
|
250
|
-
def get_contact_magic_links(contact_id)
|
251
|
-
@client.raw('get', "/crm/contacts/#{contact_id}/magic-links")
|
252
|
-
end
|
253
|
-
|
254
241
|
##
|
255
242
|
# === Create contact merge.
|
256
243
|
# Merge contacts.
|
@@ -17,8 +17,8 @@ module WorkFlowSteps
|
|
17
17
|
# workflowId: 1
|
18
18
|
# }
|
19
19
|
# @data = @mints_user.create_workflow_step(data.to_json)
|
20
|
-
def create_workflow_step(data)
|
21
|
-
@client.raw('post', '/crm/steps',
|
20
|
+
def create_workflow_step(data, options = nil)
|
21
|
+
@client.raw('post', '/crm/steps', options, data)
|
22
22
|
end
|
23
23
|
|
24
24
|
# === Update workflow step.
|
@@ -33,8 +33,8 @@ module WorkFlowSteps
|
|
33
33
|
# stepTitle: 'Step Title Modified'
|
34
34
|
# }
|
35
35
|
# @data = @mints_user.update_workflow_step(23, data)
|
36
|
-
def update_workflow_step(id, data)
|
37
|
-
@client.raw('put', "/crm/steps/#{id}",
|
36
|
+
def update_workflow_step(id, data, options = nil)
|
37
|
+
@client.raw('put', "/crm/steps/#{id}", options, data)
|
38
38
|
end
|
39
39
|
|
40
40
|
# === Delete workflow step.
|