mints 0.0.27 → 0.0.29

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 (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,147 +1,147 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ContentInstances
2
- ##
3
- # == Content Instances
4
- #
4
+ ##
5
+ # == Content Instances
6
+ #
7
+
8
+ # === Get content instances.
9
+ # Get a collection of content instances.
10
+ #
11
+ # ==== Parameters
12
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
13
+ #
14
+ # ==== First Example
15
+ # @data = @mints_user.get_content_instances
16
+ #
17
+ # ==== Second Example
18
+ # options = { fields: 'id' }
19
+ # @data = @mints_user.get_content_instances(options)
20
+ def get_content_instances(options = nil)
21
+ @client.raw('get', '/content/instances', options)
22
+ end
5
23
 
6
- # === Get content instances.
7
- # Get a collection of content instances.
8
- #
9
- # ==== Parameters
10
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
11
- #
12
- # ==== First Example
13
- # @data = @mints_user.get_content_instances
14
- #
15
- # ==== Second Example
16
- # options = { "fields": "id" }
17
- # @data = @mints_user.get_content_instances(options)
18
- def get_content_instances(options = nil)
19
- @client.raw("get", "/content/instances", options)
20
- end
24
+ # === Duplicate content instance.
25
+ # Duplicate a content instance.
26
+ #
27
+ # ==== Parameters
28
+ # id:: (Integer) -- Content instance id.
29
+ # data:: (Hash) -- Data to be submitted.
30
+ #
31
+ # ==== Example
32
+ # data = { options: [] }
33
+ # @data = @mints_user.duplicate_content_instance(1, data.to_json)
34
+ def duplicate_content_instance(id, data)
35
+ @client.raw('post', "/content/instances/#{id}/duplicate", nil, data)
36
+ end
21
37
 
22
- # === Duplicate content instance.
23
- # Duplicate a content instance.
24
- #
25
- # ==== Parameters
26
- # id:: (Integer) -- Content instance id.
27
- # data:: (Hash) -- Data to be submitted.
28
- #
29
- # ==== Example
30
- # data = {
31
- # "options": []
32
- # }
33
- # @data = @mints_user.duplicate_content_instance(1, data.to_json)
34
- def duplicate_content_instance(id, data)
35
- @client.raw("post", "/content/instances/#{id}/duplicate", nil, data)
36
- end
37
-
38
- # === Get content instance.
39
- # Get a content instance info.
40
- #
41
- # ==== Parameters
42
- # id:: (Integer) -- Content instance id.
43
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
44
- #
45
- # ==== First Example
46
- # @data = @mints_user.get_content_instance(1)
47
- #
48
- # ==== Second Example
49
- # options = { "fields": "id, title" }
50
- # @data = @mints_user.get_content_instance(1, options)
51
- def get_content_instance(id, options = nil)
52
- @client.raw("get", "/content/instances/#{id}", options)
53
- end
38
+ # === Get content instance.
39
+ # Get a content instance info.
40
+ #
41
+ # ==== Parameters
42
+ # id:: (Integer) -- Content instance id.
43
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
44
+ #
45
+ # ==== First Example
46
+ # @data = @mints_user.get_content_instance(1)
47
+ #
48
+ # ==== Second Example
49
+ # options = { fields: 'id, title' }
50
+ # @data = @mints_user.get_content_instance(1, options)
51
+ def get_content_instance(id, options = nil)
52
+ @client.raw('get', "/content/instances/#{id}", options)
53
+ end
54
54
 
55
- # === Publish content instance.
56
- # Publish a content instance.
57
- #
58
- # ==== Parameters
59
- # id:: (Integer) -- Content instance id.
60
- # data:: (Hash) -- Data to be submitted.
61
- #
62
- # ==== Example
63
- # data = {
64
- # "title": "New publish",
65
- # "slug": "new-publish",
66
- # "content_template_id": 1
67
- # }
68
- # @data = @mints_user.publish_content_instance(2, data)
69
- def publish_content_instance(id, data)
70
- @client.raw("put", "/content/instances/#{id}/publish", nil, data_transform(data))
71
- end
55
+ # === Publish content instance.
56
+ # Publish a content instance.
57
+ #
58
+ # ==== Parameters
59
+ # id:: (Integer) -- Content instance id.
60
+ # data:: (Hash) -- Data to be submitted.
61
+ #
62
+ # ==== Example
63
+ # data = {
64
+ # title: 'New publish',
65
+ # slug: 'new-publish',
66
+ # content_template_id: 1
67
+ # }
68
+ # @data = @mints_user.publish_content_instance(2, data)
69
+ def publish_content_instance(id, data)
70
+ @client.raw('put', "/content/instances/#{id}/publish", nil, data_transform(data))
71
+ end
72
72
 
73
- # === Schedule content instance.
74
- # Schedule a content instance in a specified date.
75
- #
76
- # ==== Parameters
77
- # id:: (Integer) -- Content instance id.
78
- # data:: (Hash) -- Data to be submitted.
79
- #
80
- # ==== Example
81
- # data = {
82
- # "scheduled_at": "2021-09-06T20:29:16+00:00"
83
- # }
84
- # @data = @mints_user.schedule_content_instance(1, data)
85
- def schedule_content_instance(id, data)
86
- @client.raw("put", "/content/instances/#{id}/schedule", nil, data_transform(data))
87
- end
73
+ # === Schedule content instance.
74
+ # Schedule a content instance in a specified date.
75
+ #
76
+ # ==== Parameters
77
+ # id:: (Integer) -- Content instance id.
78
+ # data:: (Hash) -- Data to be submitted.
79
+ #
80
+ # ==== Example
81
+ # data = {
82
+ # scheduled_at: '2021-09-06T20:29:16+00:00'
83
+ # }
84
+ # @data = @mints_user.schedule_content_instance(1, data)
85
+ def schedule_content_instance(id, data)
86
+ @client.raw('put', "/content/instances/#{id}/schedule", nil, data_transform(data))
87
+ end
88
88
 
89
- # === Revert published content instance.
90
- # Revert a published content instance.
91
- #
92
- # ==== Parameters
93
- # id:: (Integer) -- Content instance id.
94
- #
95
- # ==== Example
96
- # @data = @mints_user.revert_published_content_instance(1)
97
- def revert_published_content_instance(id)
98
- @client.raw("get", "/content/instances/#{id}/revert-published-data")
99
- end
89
+ # === Revert published content instance.
90
+ # Revert a published content instance.
91
+ #
92
+ # ==== Parameters
93
+ # id:: (Integer) -- Content instance id.
94
+ #
95
+ # ==== Example
96
+ # @data = @mints_user.revert_published_content_instance(1)
97
+ def revert_published_content_instance(id)
98
+ @client.raw('get', "/content/instances/#{id}/revert-published-data")
99
+ end
100
100
 
101
- # === Create content instance.
102
- # Create a content instance with data.
103
- #
104
- # ==== Parameters
105
- # data:: (Hash) -- Data to be submitted.
106
- #
107
- # ==== Example
108
- # data = {
109
- # "title": "New Content Instance",
110
- # "content_template_id": 1,
111
- # "slug": "new-content-instance-slug"
112
- # }
113
- # @data = @mints_user.create_content_instance(data)
114
- def create_content_instance(data)
115
- @client.raw("post", "/content/instances", nil, data_transform(data))
116
- end
101
+ # === Create content instance.
102
+ # Create a content instance with data.
103
+ #
104
+ # ==== Parameters
105
+ # data:: (Hash) -- Data to be submitted.
106
+ #
107
+ # ==== Example
108
+ # data = {
109
+ # title: 'New Content Instance',
110
+ # content_template_id: 1,
111
+ # slug: 'new-content-instance-slug'
112
+ # }
113
+ # @data = @mints_user.create_content_instance(data)
114
+ def create_content_instance(data)
115
+ @client.raw('post', '/content/instances', nil, data_transform(data))
116
+ end
117
117
 
118
- # === Update content instance.
119
- # Update a content instance info.
120
- #
121
- # ==== Parameters
122
- # id:: (Integer) -- Content instance id.
123
- # data:: (Hash) -- Data to be submitted.
124
- #
125
- # ==== Example
126
- # data = {
127
- # "title": "New Content Instance Modified",
128
- # "content_template_id": 1,
129
- # "slug": "new-content-instance-slug"
130
- # }
131
- # @data = @mints_user.update_content_instance(18, data)
132
- def update_content_instance(id, data)
133
- @client.raw("put", "/content/instances/#{id}", nil, data_transform(data))
134
- end
118
+ # === Update content instance.
119
+ # Update a content instance info.
120
+ #
121
+ # ==== Parameters
122
+ # id:: (Integer) -- Content instance id.
123
+ # data:: (Hash) -- Data to be submitted.
124
+ #
125
+ # ==== Example
126
+ # data = {
127
+ # title: "New Content Instance Modified",
128
+ # content_template_id: 1,
129
+ # slug: "new-content-instance-slug"
130
+ # }
131
+ # @data = @mints_user.update_content_instance(18, data)
132
+ def update_content_instance(id, data)
133
+ @client.raw('put', "/content/instances/#{id}", nil, data_transform(data))
134
+ end
135
135
 
136
- # === Delete content instance.
137
- # Delete a content instance.
138
- #
139
- # ==== Parameters
140
- # id:: (Integer) -- Content instance id.
141
- #
142
- # ==== Example
143
- # @data = @mints_user.delete_content_instance(20)
144
- def delete_content_instance(id)
145
- @client.raw("delete", "/content/instances/#{id}")
146
- end
147
- end
136
+ # === Delete content instance.
137
+ # Delete a content instance.
138
+ #
139
+ # ==== Parameters
140
+ # id:: (Integer) -- Content instance id.
141
+ #
142
+ # ==== Example
143
+ # @data = @mints_user.delete_content_instance(20)
144
+ def delete_content_instance(id)
145
+ @client.raw('delete', "/content/instances/#{id}")
146
+ end
147
+ end
@@ -1,111 +1,113 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ContentTemplates
2
- ##
3
- # == Content templates
4
- #
4
+ ##
5
+ # == Content templates
6
+ #
5
7
 
6
- # === Get content template instances.
7
- # Get instances of a content template.
8
- #
9
- # ==== Parameters
10
- # templateId:: (Integer) -- Template id.
11
- #
12
- # ==== Example
13
- # @data = @mints_user.get_content_template_instances(1)
14
- def get_content_template_instances(templateId)
15
- @client.raw("get", "/content/templates/#{templateId}/instances")
16
- end
8
+ # === Get content template instances.
9
+ # Get instances of a content template.
10
+ #
11
+ # ==== Parameters
12
+ # templateId:: (Integer) -- Template id.
13
+ #
14
+ # ==== Example
15
+ # @data = @mints_user.get_content_template_instances(1)
16
+ def get_content_template_instances(template_id)
17
+ @client.raw('get', "/content/templates/#{template_id}/instances")
18
+ end
17
19
 
18
- # === Duplicate content template.
19
- # Duplicate a content template.
20
- #
21
- # ==== Parameters
22
- # id:: (Integer) -- Content template id.
23
- #
24
- # ==== Example
25
- # @data = @mints_user.get_content_template(1)
26
- def duplicate_content_template(id)
27
- @client.raw("post", "/content/templates/#{id}/duplicate/")
28
- end
20
+ # === Duplicate content template.
21
+ # Duplicate a content template.
22
+ #
23
+ # ==== Parameters
24
+ # id:: (Integer) -- Content template id.
25
+ #
26
+ # ==== Example
27
+ # @data = @mints_user.get_content_template(1)
28
+ def duplicate_content_template(id)
29
+ @client.raw('post', "/content/templates/#{id}/duplicate/")
30
+ end
29
31
 
30
- # === Get content templates.
31
- # Get a collection of content templates.
32
- #
33
- # ==== Parameters
34
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
35
- #
36
- # ==== First Example
37
- # @data = @mints_user.get_content_templates
38
- #
39
- # ==== Second Example
40
- # options = { "sort": "title" }
41
- # @data = @mints_user.get_content_templates(options)
42
- def get_content_templates(options = nil)
43
- @client.raw("get", "/content/templates", options)
44
- end
32
+ # === Get content templates.
33
+ # Get a collection of content templates.
34
+ #
35
+ # ==== Parameters
36
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
37
+ #
38
+ # ==== First Example
39
+ # @data = @mints_user.get_content_templates
40
+ #
41
+ # ==== Second Example
42
+ # options = { sort: "title" }
43
+ # @data = @mints_user.get_content_templates(options)
44
+ def get_content_templates(options = nil)
45
+ @client.raw('get', '/content/templates', options)
46
+ end
45
47
 
46
- # === Get content template.
47
- # Get a content template.
48
- #
49
- # ==== Parameters
50
- # id:: (Integer) -- Content template id.
51
- #
52
- # ==== Example
53
- # @data = @mints_user.get_content_template(1)
54
- def get_content_template(id)
55
- @client.raw("get", "/content/templates/#{id}")
56
- end
48
+ # === Get content template.
49
+ # Get a content template.
50
+ #
51
+ # ==== Parameters
52
+ # id:: (Integer) -- Content template id.
53
+ #
54
+ # ==== Example
55
+ # @data = @mints_user.get_content_template(1)
56
+ def get_content_template(id)
57
+ @client.raw('get', "/content/templates/#{id}")
58
+ end
57
59
 
58
- # === Create content template.
59
- # Create a content template with data.
60
- #
61
- # ==== Parameters
62
- # data:: (Hash) -- Data to be submitted.
63
- #
64
- # ==== Example
65
- # data = {
66
- # "template": {
67
- # "title": "New Content Template",
68
- # "slug": "new-content-template-slug",
69
- # "description": "New Content Template Description"
70
- # }
71
- # }
72
- # @data = @mints_user.create_content_template(data.to_json)
73
- def create_content_template(data)
74
- #TODO: Inform ContentTemplateController.store method has been modified
75
- @client.raw("post", "/content/templates", nil, data)
76
- end
60
+ # === Create content template.
61
+ # Create a content template with data.
62
+ #
63
+ # ==== Parameters
64
+ # data:: (Hash) -- Data to be submitted.
65
+ #
66
+ # ==== Example
67
+ # data = {
68
+ # template: {
69
+ # title: 'New Content Template',
70
+ # slug: 'new-content-template-slug',
71
+ # description: 'New Content Template Description'
72
+ # }
73
+ # }
74
+ # @data = @mints_user.create_content_template(data.to_json)
75
+ def create_content_template(data)
76
+ # TODO: Inform ContentTemplateController.store method has been modified
77
+ @client.raw('post', '/content/templates', nil, data)
78
+ end
77
79
 
78
- # === Update content template.
79
- # Update a content template info.
80
- #
81
- # ==== Parameters
82
- # id:: (Integer) -- Content template id.
83
- # data:: (Hash) -- Data to be submitted.
84
- #
85
- # ==== Example
86
- # data = {
87
- # "template": {
88
- # "title": "New Content Template Modified",
89
- # "slug": "new-content-template-slug",
90
- # "description": "New Content Template Description"
91
- # }
92
- # }
93
- # @data = @mints_user.update_content_template(7, data.to_json)
94
- def update_content_template(id, data)
95
- #TODO: Inform ContentTemplateController.update method has been modified
96
- @client.raw("put", "/content/templates/#{id}", nil, data)
97
- end
80
+ # === Update content template.
81
+ # Update a content template info.
82
+ #
83
+ # ==== Parameters
84
+ # id:: (Integer) -- Content template id.
85
+ # data:: (Hash) -- Data to be submitted.
86
+ #
87
+ # ==== Example
88
+ # data = {
89
+ # template: {
90
+ # title: 'New Content Template Modified',
91
+ # slug: 'new-content-template-slug',
92
+ # description: 'New Content Template Description'
93
+ # }
94
+ # }
95
+ # @data = @mints_user.update_content_template(7, data.to_json)
96
+ def update_content_template(id, data)
97
+ # TODO: Inform ContentTemplateController.update method has been modified
98
+ @client.raw('put', "/content/templates/#{id}", nil, data)
99
+ end
98
100
 
99
- # === Delete content template.
100
- # Delete a content template.
101
- #
102
- # ==== Parameters
103
- # id:: (Integer) -- Content template id.
104
- #
105
- # ==== Example
106
- # @data = @mints_user.delete_content_template(1)
107
- def delete_content_template(id)
108
- #TODO: Inform ContentTemplateController.destroy method has been modified
109
- @client.raw("delete", "/content/templates/#{id}")
110
- end
111
- end
101
+ # === Delete content template.
102
+ # Delete a content template.
103
+ #
104
+ # ==== Parameters
105
+ # id:: (Integer) -- Content template id.
106
+ #
107
+ # ==== Example
108
+ # @data = @mints_user.delete_content_template(1)
109
+ def delete_content_template(id)
110
+ # TODO: Inform ContentTemplateController.destroy method has been modified
111
+ @client.raw('delete', "/content/templates/#{id}")
112
+ end
113
+ end