mints 0.0.27 → 0.0.29

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