mints 0.0.26 → 0.0.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/lib/client.rb +75 -37
  4. data/lib/contact.rb +61 -62
  5. data/lib/errors.rb +98 -0
  6. data/lib/generators/mints_config.yml.erb +0 -2
  7. data/lib/generators/mints_link.rb +3 -3
  8. data/lib/mints/controllers/admin_base_controller.rb +8 -66
  9. data/lib/mints/controllers/base_api_controller.rb +16 -134
  10. data/lib/mints/controllers/base_controller.rb +20 -106
  11. data/lib/mints/controllers/concerns/mints_clients.rb +74 -0
  12. data/lib/mints/controllers/concerns/read_config_file.rb +28 -0
  13. data/lib/mints/controllers/contact_api_controller.rb +6 -85
  14. data/lib/mints/controllers/public_api_controller.rb +6 -79
  15. data/lib/mints/controllers/user_api_controller.rb +7 -82
  16. data/lib/mints/helpers/contact_auth_helper.rb +67 -0
  17. data/lib/{mints_helper.rb → mints/helpers/mints_helper.rb} +7 -5
  18. data/lib/mints/helpers/proxy_controllers_methods.rb +126 -0
  19. data/lib/mints/helpers/user_auth_helper.rb +53 -0
  20. data/lib/mints.rb +2 -0
  21. data/lib/pub.rb +56 -56
  22. data/lib/user/config/api_keys.rb +7 -7
  23. data/lib/user/config/appointments.rb +16 -16
  24. data/lib/user/config/attribute_groups.rb +10 -10
  25. data/lib/user/config/attributes.rb +10 -10
  26. data/lib/user/config/calendars.rb +9 -9
  27. data/lib/user/config/config.rb +7 -7
  28. data/lib/user/config/importers.rb +15 -15
  29. data/lib/user/config/public_folders.rb +11 -11
  30. data/lib/user/config/relationships.rb +11 -11
  31. data/lib/user/config/roles.rb +9 -9
  32. data/lib/user/config/seeds.rb +5 -5
  33. data/lib/user/config/system_settings.rb +5 -5
  34. data/lib/user/config/tags.rb +5 -5
  35. data/lib/user/config/taxonomies.rb +15 -15
  36. data/lib/user/config/teams.rb +67 -68
  37. data/lib/user/config/users.rb +70 -71
  38. data/lib/user/contacts/contacts.rb +19 -20
  39. data/lib/user/content/assets.rb +273 -278
  40. data/lib/user/content/content.rb +48 -48
  41. data/lib/user/content/content_instances.rb +136 -138
  42. data/lib/user/content/content_templates.rb +103 -103
  43. data/lib/user/content/conversations.rb +193 -193
  44. data/lib/user/content/dam.rb +83 -80
  45. data/lib/user/content/forms.rb +229 -233
  46. data/lib/user/content/message_templates.rb +152 -151
  47. data/lib/user/content/messages.rb +87 -87
  48. data/lib/user/content/pages.rb +82 -82
  49. data/lib/user/content/stories.rb +101 -101
  50. data/lib/user/content/story_templates.rb +88 -88
  51. data/lib/user/content/story_versions.rb +115 -117
  52. data/lib/user/crm/companies.rb +103 -105
  53. data/lib/user/crm/contacts.rb +285 -292
  54. data/lib/user/crm/crm.rb +19 -19
  55. data/lib/user/crm/deals.rb +103 -103
  56. data/lib/user/crm/favorites.rb +14 -13
  57. data/lib/user/crm/segments.rb +121 -123
  58. data/lib/user/crm/users.rb +20 -20
  59. data/lib/user/crm/workflow_step_objects.rb +84 -84
  60. data/lib/user/crm/workflow_steps.rb +45 -45
  61. data/lib/user/crm/workflows.rb +65 -65
  62. data/lib/user/ecommerce/ecommerce.rb +27 -27
  63. data/lib/user/ecommerce/item_prices.rb +82 -81
  64. data/lib/user/ecommerce/locations.rb +160 -160
  65. data/lib/user/ecommerce/order_items_groups.rb +107 -105
  66. data/lib/user/ecommerce/order_statuses.rb +24 -24
  67. data/lib/user/ecommerce/orders.rb +250 -246
  68. data/lib/user/ecommerce/price_lists.rb +68 -68
  69. data/lib/user/ecommerce/product_templates.rb +99 -99
  70. data/lib/user/ecommerce/product_variations.rb +122 -120
  71. data/lib/user/ecommerce/products.rb +160 -159
  72. data/lib/user/ecommerce/skus.rb +85 -85
  73. data/lib/user/ecommerce/taxes.rb +79 -79
  74. data/lib/user/ecommerce/variant_options.rb +66 -66
  75. data/lib/user/ecommerce/variant_values.rb +69 -69
  76. data/lib/user/helpers/helpers.rb +102 -101
  77. data/lib/user/helpers/object_activities.rb +78 -78
  78. data/lib/user/helpers/object_folders.rb +76 -76
  79. data/lib/user/helpers/user_folders.rb +77 -77
  80. data/lib/user/marketing/marketing.rb +114 -113
  81. data/lib/user/profile/profile.rb +94 -103
  82. data/lib/user.rb +4 -4
  83. metadata +41 -35
@@ -1,90 +1,90 @@
1
1
  module Pages
2
- ##
3
- # == Content Pages
4
- #
2
+ ##
3
+ # == Content Pages
4
+ #
5
5
 
6
- ###
7
- # === Get page groups.
8
- # Get content page groups.
9
- #
10
- # ==== Example
11
- # @data = @mints_user.get_page_groups
12
- def get_page_groups
13
- return @client.raw("get", "/content/pages/groups")
14
- end
6
+ ###
7
+ # === Get page groups.
8
+ # Get content page groups.
9
+ #
10
+ # ==== Example
11
+ # @data = @mints_user.get_page_groups
12
+ def get_page_groups
13
+ @client.raw('get', '/content/pages/groups')
14
+ end
15
15
 
16
- # === Get pages.
17
- # Get a collection of content pages.
18
- #
19
- # ==== Example
20
- # @data = @mints_user.get_pages
21
- def get_pages(options = nil)
22
- return @client.raw("get", "/content/pages", options)
23
- end
16
+ # === Get pages.
17
+ # Get a collection of content pages.
18
+ #
19
+ # ==== Example
20
+ # @data = @mints_user.get_pages
21
+ def get_pages(options = nil)
22
+ @client.raw('get', '/content/pages', options)
23
+ end
24
24
 
25
- # === Get bundles.
26
- # Get a collection of content pages.
27
- #
28
- # ==== Example
29
- # @data = @mints_user.get_pages
30
- def get_bundles(options = nil)
31
- return @client.raw("get", "/content/pages", options)
32
- end
25
+ # === Get bundles.
26
+ # Get a collection of content pages.
27
+ #
28
+ # ==== Example
29
+ # @data = @mints_user.get_pages
30
+ def get_bundles(options = nil)
31
+ @client.raw('get', '/content/pages', options)
32
+ end
33
33
 
34
- # === Get page.
35
- # Get a content page.
36
- #
37
- # ==== Parameters
38
- # id:: (Integer) -- Page id.
39
- #
40
- # ==== Example
41
- # @data = @mints_user.get_page(1)
42
- def get_page(id)
43
- return @client.raw("get", "/content/pages/#{id}")
44
- end
34
+ # === Get page.
35
+ # Get a content page.
36
+ #
37
+ # ==== Parameters
38
+ # id:: (Integer) -- Page id.
39
+ #
40
+ # ==== Example
41
+ # @data = @mints_user.get_page(1)
42
+ def get_page(id)
43
+ @client.raw('get', "/content/pages/#{id}")
44
+ end
45
45
 
46
- # === Create page.
47
- # Create a content page with data.
48
- #
49
- # ==== Parameters
50
- # data:: (Hash) -- Data to be submitted.
51
- #
52
- # ==== Example
53
- # data = {
54
- # "title": "New Page",
55
- # "slug": "new-page-slug",
56
- # "description": "New page description"
57
- # }
58
- # @data = @mints_user.create_page(data)
59
- def create_page(data)
60
- return @client.raw("post", "/content/pages", nil, data_transform(data))
61
- end
46
+ # === Create page.
47
+ # Create a content page with data.
48
+ #
49
+ # ==== Parameters
50
+ # data:: (Hash) -- Data to be submitted.
51
+ #
52
+ # ==== Example
53
+ # data = {
54
+ # title: "New Page",
55
+ # slug: "new-page-slug",
56
+ # description: "New page description"
57
+ # }
58
+ # @data = @mints_user.create_page(data)
59
+ def create_page(data)
60
+ @client.raw('post', '/content/pages', nil, data_transform(data))
61
+ end
62
62
 
63
- # === Update page.
64
- # Update a content page info.
65
- #
66
- # ==== Parameters
67
- # id:: (Integer) -- Page id.
68
- # data:: (Hash) -- Data to be submitted.
69
- #
70
- # ==== Example
71
- # data = {
72
- # "title": "New Page Modified"
73
- # }
74
- # @data = @mints_user.update_page(5, data.to_json)
75
- def update_page(id, data)
76
- return @client.raw("put", "/content/pages/#{id}", nil, data)
77
- end
63
+ # === Update page.
64
+ # Update a content page info.
65
+ #
66
+ # ==== Parameters
67
+ # id:: (Integer) -- Page id.
68
+ # data:: (Hash) -- Data to be submitted.
69
+ #
70
+ # ==== Example
71
+ # data = {
72
+ # title: "New Page Modified"
73
+ # }
74
+ # @data = @mints_user.update_page(5, data.to_json)
75
+ def update_page(id, data)
76
+ @client.raw('put', "/content/pages/#{id}", nil, data)
77
+ end
78
78
 
79
- # === Delete page.
80
- # Delete a content page.
81
- #
82
- # ==== Parameters
83
- # id:: (Integer) -- Page id.
84
- #
85
- # ==== Example
86
- # @mints_user.@mints_user.delete_page(3)
87
- def delete_page(id)
88
- return @client.raw("delete", "/content/pages/#{id}")
89
- end
90
- end
79
+ # === Delete page.
80
+ # Delete a content page.
81
+ #
82
+ # ==== Parameters
83
+ # id:: (Integer) -- Page id.
84
+ #
85
+ # ==== Example
86
+ # @mints_user.@mints_user.delete_page(3)
87
+ def delete_page(id)
88
+ @client.raw('delete', "/content/pages/#{id}")
89
+ end
90
+ end
@@ -1,107 +1,107 @@
1
1
  module Stories
2
- # === Duplicate story.
3
- # Duplicate a story.
4
- #
5
- # ==== Parameters
6
- # id:: (Integer) -- Story id.
7
- # data:: (Hash) -- Data to be submitted.
8
- #
9
- # ==== Example
10
- # data = {
11
- # "options": []
12
- # }
13
- # @data = @mints_user.duplicate_story(1, data.to_json)
14
- def duplicate_story(id, data)
15
- return @client.raw("post", "/content/stories/#{id}/duplicate", nil, data)
16
- end
2
+ # === Duplicate story.
3
+ # Duplicate a story.
4
+ #
5
+ # ==== Parameters
6
+ # id:: (Integer) -- Story id.
7
+ # data:: (Hash) -- Data to be submitted.
8
+ #
9
+ # ==== Example
10
+ # data = {
11
+ # options: []
12
+ # }
13
+ # @data = @mints_user.duplicate_story(1, data.to_json)
14
+ def duplicate_story(id, data)
15
+ @client.raw('post', "/content/stories/#{id}/duplicate", nil, data)
16
+ end
17
17
 
18
- # === Get stories.
19
- # Get a collection of stories.
20
- #
21
- # ==== Parameters
22
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
23
- # use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
24
- #
25
- # ==== First Example
26
- # @data = @mints_user.get_stories
27
- #
28
- # ==== Second Example
29
- # options = {
30
- # "fields": "id, slug"
31
- # }
32
- # @data = @mints_user.get_stories(options)
33
- #
34
- # ==== Third Example
35
- # options = {
36
- # "fields": "id, slug"
37
- # }
38
- # @data = @mints_user.get_stories(options, true)
39
- def get_stories(options = nil, use_post = true)
40
- return get_query_results("/content/stories", options, use_post)
41
- end
18
+ # === Get stories.
19
+ # Get a collection of stories.
20
+ #
21
+ # ==== Parameters
22
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
23
+ # use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
24
+ #
25
+ # ==== First Example
26
+ # @data = @mints_user.get_stories
27
+ #
28
+ # ==== Second Example
29
+ # options = {
30
+ # fields: 'id, slug'
31
+ # }
32
+ # @data = @mints_user.get_stories(options)
33
+ #
34
+ # ==== Third Example
35
+ # options = {
36
+ # fields: 'id, slug'
37
+ # }
38
+ # @data = @mints_user.get_stories(options, true)
39
+ def get_stories(options = nil, use_post = true)
40
+ get_query_results('/content/stories', options, use_post)
41
+ end
42
42
 
43
- # === Get story.
44
- # Get a story info.
45
- #
46
- # ==== Parameters
47
- # id:: (Integer) -- Story id.
48
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
49
- #
50
- # ==== First Example
51
- # @data = @mints_user.get_story(1)
52
- #
53
- # ==== Second Example
54
- # options = {
55
- # "fields": "id, slug"
56
- # }
57
- # @data = @mints_user.get_story(1, options)
58
- def get_story(id, options = nil)
59
- return @client.raw("get", "/content/stories/#{id}", options)
60
- end
43
+ # === Get story.
44
+ # Get a story info.
45
+ #
46
+ # ==== Parameters
47
+ # id:: (Integer) -- Story id.
48
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
49
+ #
50
+ # ==== First Example
51
+ # @data = @mints_user.get_story(1)
52
+ #
53
+ # ==== Second Example
54
+ # options = {
55
+ # fields: 'id, slug'
56
+ # }
57
+ # @data = @mints_user.get_story(1, options)
58
+ def get_story(id, options = nil)
59
+ @client.raw('get', "/content/stories/#{id}", options)
60
+ end
61
61
 
62
- # === Create story.
63
- # Create a story with data.
64
- #
65
- # ==== Parameters
66
- # data:: (Hash) -- Data to be submitted.
67
- #
68
- # ==== Example
69
- # data = {
70
- # "user_id": 1,
71
- # "slug": "new-story",
72
- # "story_template_id": 1
73
- # }
74
- # @data = @mints_user.create_story(data)
75
- def create_story(data)
76
- return @client.raw("post", "/content/stories", nil, data_transform(data))
77
- end
62
+ # === Create story.
63
+ # Create a story with data.
64
+ #
65
+ # ==== Parameters
66
+ # data:: (Hash) -- Data to be submitted.
67
+ #
68
+ # ==== Example
69
+ # data = {
70
+ # user_id: 1,
71
+ # slug: "new-story",
72
+ # story_template_id: 1
73
+ # }
74
+ # @data = @mints_user.create_story(data)
75
+ def create_story(data)
76
+ @client.raw('post', '/content/stories', nil, data_transform(data))
77
+ end
78
78
 
79
- # === Update story.
80
- # Update a story info.
81
- #
82
- # ==== Parameters
83
- # id:: (Integer) -- Story id.
84
- # data:: (Hash) -- Data to be submitted.
85
- #
86
- # ==== Example
87
- # data = {
88
- # "user_id": 1,
89
- # "slug": "new-story"
90
- # }
91
- # @data = @mints_user.update_story(5, data)
92
- def update_story(id, data)
93
- return @client.raw("put", "/content/stories/#{id}", nil, data_transform(data))
94
- end
79
+ # === Update story.
80
+ # Update a story info.
81
+ #
82
+ # ==== Parameters
83
+ # id:: (Integer) -- Story id.
84
+ # data:: (Hash) -- Data to be submitted.
85
+ #
86
+ # ==== Example
87
+ # data = {
88
+ # user_id: 1,
89
+ # slug: 'new-story'
90
+ # }
91
+ # @data = @mints_user.update_story(5, data)
92
+ def update_story(id, data)
93
+ @client.raw('put', "/content/stories/#{id}", nil, data_transform(data))
94
+ end
95
95
 
96
- # === Delete story.
97
- # Delete a story.
98
- #
99
- # ==== Parameters
100
- # id:: (Integer) -- Story id.
101
- #
102
- # ==== Example
103
- # @data = @mints_user.delete_story(6)
104
- def delete_story(id)
105
- return @client.raw("delete", "/content/stories/#{id}")
106
- end
107
- end
96
+ # === Delete story.
97
+ # Delete a story.
98
+ #
99
+ # ==== Parameters
100
+ # id:: (Integer) -- Story id.
101
+ #
102
+ # ==== Example
103
+ # @data = @mints_user.delete_story(6)
104
+ def delete_story(id)
105
+ @client.raw('delete', "/content/stories/#{id}")
106
+ end
107
+ end
@@ -1,95 +1,95 @@
1
1
  module StoryTemplates
2
- ##
3
- # == Story Template
4
- #
2
+ ##
3
+ # == Story Template
4
+ #
5
5
 
6
- # === Get support data of story template.
7
- # Get support data used in a story template.
8
- #
9
- # ==== Parameters
10
- # id:: (Integer) -- Story template id.
11
- #
12
- # ==== Example
13
- # @data = @mints_user.get_story_template_support_data(1)
14
- def get_story_template_support_data(id)
15
- return @client.raw("get", "/content/story-templates/support-data/stories/#{id}")
16
- end
6
+ # === Get support data of story template.
7
+ # Get support data used in a story template.
8
+ #
9
+ # ==== Parameters
10
+ # id:: (Integer) -- Story template id.
11
+ #
12
+ # ==== Example
13
+ # @data = @mints_user.get_story_template_support_data(1)
14
+ def get_story_template_support_data(id)
15
+ @client.raw('get', "/content/story-templates/support-data/stories/#{id}")
16
+ end
17
17
 
18
- # === Get support data of story templates.
19
- # Get support data used in story templates.
20
- #
21
- # ==== Example
22
- # @data = @mints_user.get_story_templates_support_data
23
- def get_story_templates_support_data
24
- return @client.raw("get", "/content/story-templates/support-data")
25
- end
18
+ # === Get support data of story templates.
19
+ # Get support data used in story templates.
20
+ #
21
+ # ==== Example
22
+ # @data = @mints_user.get_story_templates_support_data
23
+ def get_story_templates_support_data
24
+ @client.raw('get', "/content/story-templates/support-data")
25
+ end
26
26
 
27
- # === Get story templates.
28
- # Get a collection of story templates.
29
- #
30
- # ==== Parameters
31
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
32
- #
33
- # ==== First Example
34
- # @data = @mints_user.get_story_templates
35
- #
36
- # ==== Second Example
37
- # options = {
38
- # "fields": "id, title"
39
- # }
40
- # @data = @mints_user.get_story_templates(options)
41
- def get_story_templates(options = nil)
42
- return @client.raw("get", "/content/story-templates", options)
43
- end
27
+ # === Get story templates.
28
+ # Get a collection of story templates.
29
+ #
30
+ # ==== Parameters
31
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
32
+ #
33
+ # ==== First Example
34
+ # @data = @mints_user.get_story_templates
35
+ #
36
+ # ==== Second Example
37
+ # options = {
38
+ # fields: 'id, title'
39
+ # }
40
+ # @data = @mints_user.get_story_templates(options)
41
+ def get_story_templates(options = nil)
42
+ @client.raw('get', '/content/story-templates', options)
43
+ end
44
44
 
45
- # === Get story template.
46
- # Get a story template info.
47
- #
48
- # ==== Parameters
49
- # id:: (Integer) -- Story template id.
50
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
51
- #
52
- # ==== First Example
53
- # @data = @mints_user.get_story_template(2)
54
- #
55
- # ==== Second Example
56
- # options = {
57
- # "fields": "title"
58
- # }
59
- # @data = @mints_user.get_story_template(1, options)
60
- def get_story_template(id, options = nil)
61
- return @client.raw("get", "/content/story-templates/#{id}", options)
62
- end
45
+ # === Get story template.
46
+ # Get a story template info.
47
+ #
48
+ # ==== Parameters
49
+ # id:: (Integer) -- Story template id.
50
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
51
+ #
52
+ # ==== First Example
53
+ # @data = @mints_user.get_story_template(2)
54
+ #
55
+ # ==== Second Example
56
+ # options = {
57
+ # fields: "title"
58
+ # }
59
+ # @data = @mints_user.get_story_template(1, options)
60
+ def get_story_template(id, options = nil)
61
+ @client.raw('get', "/content/story-templates/#{id}", options)
62
+ end
63
63
 
64
- # === Create story template.
65
- # Create a story template with data.
66
- #
67
- # ==== Parameters
68
- # data:: (Hash) -- Data to be submitted.
69
- #
70
- # ==== Example
71
- # data = {
72
- # "title": "New Story Template",
73
- # "slug": "new-story-template-slug"
74
- # }
75
- # @data = @mints_user.create_story_template(data)
76
- def create_story_template(data)
77
- return @client.raw("post", "/content/story-templates", nil, data_transform(data))
78
- end
64
+ # === Create story template.
65
+ # Create a story template with data.
66
+ #
67
+ # ==== Parameters
68
+ # data:: (Hash) -- Data to be submitted.
69
+ #
70
+ # ==== Example
71
+ # data = {
72
+ # title: 'New Story Template',
73
+ # slug: 'new-story-template-slug'
74
+ # }
75
+ # @data = @mints_user.create_story_template(data)
76
+ def create_story_template(data)
77
+ @client.raw('post', "/content/story-templates", nil, data_transform(data))
78
+ end
79
79
 
80
- # === Update story template.
81
- # Update a story template info.
82
- #
83
- # ==== Parameters
84
- # id:: (Integer) -- Story template id.
85
- # data:: (Hash) -- Data to be submitted.
86
- #
87
- # ==== Example
88
- # data = {
89
- # "title": "New Story Template Modified"
90
- # }
91
- # @data = @mints_user.update_story_template(3, data)
92
- def update_story_template(id, data)
93
- return @client.raw("put", "/content/story-templates/#{id}", nil, data_transform(data))
94
- end
95
- end
80
+ # === Update story template.
81
+ # Update a story template info.
82
+ #
83
+ # ==== Parameters
84
+ # id:: (Integer) -- Story template id.
85
+ # data:: (Hash) -- Data to be submitted.
86
+ #
87
+ # ==== Example
88
+ # data = {
89
+ # title: 'New Story Template Modified'
90
+ # }
91
+ # @data = @mints_user.update_story_template(3, data)
92
+ def update_story_template(id, data)
93
+ @client.raw('put', "/content/story-templates/#{id}", nil, data_transform(data))
94
+ end
95
+ end