mints 0.0.26 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/lib/client.rb +75 -37
- data/lib/contact.rb +61 -62
- data/lib/errors.rb +98 -0
- data/lib/generators/mints_config.yml.erb +0 -2
- data/lib/generators/mints_link.rb +3 -3
- data/lib/mints/controllers/admin_base_controller.rb +8 -66
- data/lib/mints/controllers/base_api_controller.rb +16 -134
- data/lib/mints/controllers/base_controller.rb +20 -106
- data/lib/mints/controllers/concerns/mints_clients.rb +74 -0
- data/lib/mints/controllers/concerns/read_config_file.rb +28 -0
- data/lib/mints/controllers/contact_api_controller.rb +6 -85
- data/lib/mints/controllers/public_api_controller.rb +6 -79
- data/lib/mints/controllers/user_api_controller.rb +7 -82
- data/lib/mints/helpers/contact_auth_helper.rb +67 -0
- data/lib/{mints_helper.rb → mints/helpers/mints_helper.rb} +7 -5
- data/lib/mints/helpers/proxy_controllers_methods.rb +126 -0
- data/lib/mints/helpers/user_auth_helper.rb +53 -0
- data/lib/mints.rb +2 -0
- data/lib/pub.rb +56 -56
- data/lib/user/config/api_keys.rb +7 -7
- data/lib/user/config/appointments.rb +16 -16
- data/lib/user/config/attribute_groups.rb +10 -10
- data/lib/user/config/attributes.rb +10 -10
- data/lib/user/config/calendars.rb +9 -9
- data/lib/user/config/config.rb +7 -7
- data/lib/user/config/importers.rb +15 -15
- data/lib/user/config/public_folders.rb +11 -11
- data/lib/user/config/relationships.rb +11 -11
- data/lib/user/config/roles.rb +9 -9
- data/lib/user/config/seeds.rb +5 -5
- data/lib/user/config/system_settings.rb +5 -5
- data/lib/user/config/tags.rb +5 -5
- data/lib/user/config/taxonomies.rb +15 -15
- data/lib/user/config/teams.rb +67 -68
- data/lib/user/config/users.rb +70 -71
- data/lib/user/contacts/contacts.rb +19 -20
- data/lib/user/content/assets.rb +273 -278
- data/lib/user/content/content.rb +48 -48
- data/lib/user/content/content_instances.rb +136 -138
- data/lib/user/content/content_templates.rb +103 -103
- data/lib/user/content/conversations.rb +193 -193
- data/lib/user/content/dam.rb +83 -80
- data/lib/user/content/forms.rb +229 -233
- data/lib/user/content/message_templates.rb +152 -151
- data/lib/user/content/messages.rb +87 -87
- data/lib/user/content/pages.rb +82 -82
- data/lib/user/content/stories.rb +101 -101
- data/lib/user/content/story_templates.rb +88 -88
- data/lib/user/content/story_versions.rb +115 -117
- data/lib/user/crm/companies.rb +103 -105
- data/lib/user/crm/contacts.rb +285 -292
- data/lib/user/crm/crm.rb +19 -19
- data/lib/user/crm/deals.rb +103 -103
- data/lib/user/crm/favorites.rb +14 -13
- data/lib/user/crm/segments.rb +121 -123
- data/lib/user/crm/users.rb +20 -20
- data/lib/user/crm/workflow_step_objects.rb +84 -84
- data/lib/user/crm/workflow_steps.rb +45 -45
- data/lib/user/crm/workflows.rb +65 -65
- data/lib/user/ecommerce/ecommerce.rb +27 -27
- data/lib/user/ecommerce/item_prices.rb +82 -81
- data/lib/user/ecommerce/locations.rb +160 -160
- data/lib/user/ecommerce/order_items_groups.rb +107 -105
- data/lib/user/ecommerce/order_statuses.rb +24 -24
- data/lib/user/ecommerce/orders.rb +250 -246
- data/lib/user/ecommerce/price_lists.rb +68 -68
- data/lib/user/ecommerce/product_templates.rb +99 -99
- data/lib/user/ecommerce/product_variations.rb +122 -120
- data/lib/user/ecommerce/products.rb +160 -159
- data/lib/user/ecommerce/skus.rb +85 -85
- data/lib/user/ecommerce/taxes.rb +79 -79
- data/lib/user/ecommerce/variant_options.rb +66 -66
- data/lib/user/ecommerce/variant_values.rb +69 -69
- data/lib/user/helpers/helpers.rb +102 -101
- data/lib/user/helpers/object_activities.rb +78 -78
- data/lib/user/helpers/object_folders.rb +76 -76
- data/lib/user/helpers/user_folders.rb +77 -77
- data/lib/user/marketing/marketing.rb +114 -113
- data/lib/user/profile/profile.rb +94 -103
- data/lib/user.rb +4 -4
- metadata +41 -35
data/lib/user/content/content.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
require_relative './assets
|
2
|
-
require_relative './content_instances
|
3
|
-
require_relative './content_templates
|
4
|
-
require_relative './conversations
|
5
|
-
require_relative './dam
|
6
|
-
require_relative './forms
|
7
|
-
require_relative './message_templates
|
8
|
-
require_relative './messages
|
9
|
-
require_relative './pages
|
10
|
-
require_relative './stories
|
11
|
-
require_relative './story_versions
|
12
|
-
require_relative './story_templates
|
1
|
+
require_relative './assets'
|
2
|
+
require_relative './content_instances'
|
3
|
+
require_relative './content_templates'
|
4
|
+
require_relative './conversations'
|
5
|
+
require_relative './dam'
|
6
|
+
require_relative './forms'
|
7
|
+
require_relative './message_templates'
|
8
|
+
require_relative './messages'
|
9
|
+
require_relative './pages'
|
10
|
+
require_relative './stories'
|
11
|
+
require_relative './story_versions'
|
12
|
+
require_relative './story_templates'
|
13
13
|
|
14
14
|
module Content
|
15
15
|
include Assets
|
@@ -31,7 +31,7 @@ module Content
|
|
31
31
|
# ==== Example
|
32
32
|
# @data = @mints_user.get_public_images_url
|
33
33
|
def get_public_images_url
|
34
|
-
|
34
|
+
@client.raw('get', '/content/public-images-url')
|
35
35
|
end
|
36
36
|
|
37
37
|
##
|
@@ -44,7 +44,7 @@ module Content
|
|
44
44
|
# ==== Example
|
45
45
|
# @data = @mints_user.get_authors
|
46
46
|
def get_authors
|
47
|
-
|
47
|
+
@client.raw('get', '/content/authors')
|
48
48
|
end
|
49
49
|
|
50
50
|
|
@@ -57,7 +57,7 @@ module Content
|
|
57
57
|
# ==== Example
|
58
58
|
# @data = @mints_user.get_author(1)
|
59
59
|
def get_author(id)
|
60
|
-
|
60
|
+
@client.raw('get', "/content/authors/#{id}")
|
61
61
|
end
|
62
62
|
|
63
63
|
# === Create author.
|
@@ -68,12 +68,12 @@ module Content
|
|
68
68
|
#
|
69
69
|
# ==== Example
|
70
70
|
# data = {
|
71
|
-
#
|
72
|
-
#
|
71
|
+
# title: 'Howard Phillips Lovecraft',
|
72
|
+
# slug: 'howard-phillips-lovecraft'
|
73
73
|
# }
|
74
74
|
# @data = @mints_user.create_author(data.to_json)
|
75
75
|
def create_author(data)
|
76
|
-
|
76
|
+
@client.raw('post', '/content/authors', nil, data)
|
77
77
|
end
|
78
78
|
|
79
79
|
# === Update author.
|
@@ -86,8 +86,8 @@ module Content
|
|
86
86
|
# ==== Example
|
87
87
|
#
|
88
88
|
def update_author(id, data)
|
89
|
-
#FIXME: Author controller doesnt receive data
|
90
|
-
|
89
|
+
# FIXME: Author controller doesnt receive data
|
90
|
+
@client.raw('put', "/content/authors/#{id}", nil, data)
|
91
91
|
end
|
92
92
|
|
93
93
|
##
|
@@ -104,10 +104,10 @@ module Content
|
|
104
104
|
# @data = @mints_user.get_keywords
|
105
105
|
#
|
106
106
|
# ==== Second Example
|
107
|
-
# options = {
|
107
|
+
# options = { fields: 'title' }
|
108
108
|
# @data = @mints_user.get_keywords(options)
|
109
109
|
def get_keywords(options = nil)
|
110
|
-
|
110
|
+
@client.raw('get', '/content/keywords', options)
|
111
111
|
end
|
112
112
|
|
113
113
|
# === Get keyword.
|
@@ -117,7 +117,7 @@ module Content
|
|
117
117
|
# id:: (Integer) -- Keyword id.
|
118
118
|
#
|
119
119
|
def get_keyword(id)
|
120
|
-
|
120
|
+
@client.raw('get', "/content/keywords/#{id}")
|
121
121
|
end
|
122
122
|
|
123
123
|
# === Create keyword.
|
@@ -128,11 +128,11 @@ module Content
|
|
128
128
|
#
|
129
129
|
# ==== Example
|
130
130
|
# data = {
|
131
|
-
#
|
131
|
+
# title: 'New Keyword'
|
132
132
|
# }
|
133
133
|
# @data = @mints_user.create_keyword(data.to_json)
|
134
134
|
def create_keyword(data)
|
135
|
-
|
135
|
+
@client.raw('post', '/content/keywords', nil, data)
|
136
136
|
end
|
137
137
|
|
138
138
|
# === Update keyword.
|
@@ -145,8 +145,8 @@ module Content
|
|
145
145
|
# ==== Example
|
146
146
|
#
|
147
147
|
def update_keyword(id, data)
|
148
|
-
#FIXME: Keyword controller doesnt receive data
|
149
|
-
|
148
|
+
# FIXME: Keyword controller doesnt receive data
|
149
|
+
@client.raw('put', "/content/keywords/#{id}", nil, data)
|
150
150
|
end
|
151
151
|
|
152
152
|
##
|
@@ -163,10 +163,10 @@ module Content
|
|
163
163
|
# @data = @mints_user.get_stages
|
164
164
|
#
|
165
165
|
# ==== Second Example
|
166
|
-
# options = {
|
166
|
+
# options = { fields: 'title' }
|
167
167
|
# @data = @mints_user.get_stages(options)
|
168
168
|
def get_stages(options = nil)
|
169
|
-
|
169
|
+
@client.raw('get', '/content/stages', options)
|
170
170
|
end
|
171
171
|
|
172
172
|
# === Get stage.
|
@@ -178,7 +178,7 @@ module Content
|
|
178
178
|
# ==== Example
|
179
179
|
# @data = @mints_user.get_stage(1)
|
180
180
|
def get_stage(id)
|
181
|
-
|
181
|
+
@client.raw('get', "/content/stages/#{id}")
|
182
182
|
end
|
183
183
|
|
184
184
|
# === Create stage.
|
@@ -189,21 +189,21 @@ module Content
|
|
189
189
|
#
|
190
190
|
# ==== Example
|
191
191
|
# config_json = {
|
192
|
-
#
|
192
|
+
# count: 1
|
193
193
|
# }
|
194
194
|
# event_json = {
|
195
|
-
#
|
196
|
-
#
|
195
|
+
# rset: 'DTSTART:20190214T000000Z',
|
196
|
+
# duration: 1
|
197
197
|
# }
|
198
198
|
# data = {
|
199
|
-
#
|
200
|
-
#
|
201
|
-
#
|
202
|
-
#
|
199
|
+
# title: 'New Stage',
|
200
|
+
# description: 'New Stage Description',
|
201
|
+
# config_json: config_json.to_json,
|
202
|
+
# event_json: event_json.to_json
|
203
203
|
# }
|
204
204
|
# @data = @mints_user.create_stage(data.to_json)
|
205
205
|
def create_stage(data)
|
206
|
-
|
206
|
+
@client.raw('post', '/content/stages', nil, data)
|
207
207
|
end
|
208
208
|
|
209
209
|
# === Update stage.
|
@@ -215,23 +215,23 @@ module Content
|
|
215
215
|
#
|
216
216
|
# ==== Example
|
217
217
|
# config_json = {
|
218
|
-
#
|
218
|
+
# count: 2
|
219
219
|
# }
|
220
220
|
# event_json = {
|
221
|
-
#
|
222
|
-
#
|
221
|
+
# rset: 'DTSTART:20190214T000000Z',
|
222
|
+
# duration: 2
|
223
223
|
# }
|
224
224
|
# data = {
|
225
|
-
#
|
226
|
-
#
|
227
|
-
#
|
225
|
+
# stageProps: {
|
226
|
+
# title: 'New Stage Modified',
|
227
|
+
# description: 'New Stage Description Modified'
|
228
228
|
# },
|
229
|
-
#
|
230
|
-
#
|
229
|
+
# config_json: config_json.to_json,
|
230
|
+
# event_json: event_json.to_json
|
231
231
|
# }
|
232
232
|
# @data = @mints_user.update_stage(3, data.to_json)
|
233
233
|
def update_stage(id, data)
|
234
|
-
#TODO: Inform StageController.update method has been modified
|
235
|
-
|
234
|
+
# TODO: Inform StageController.update method has been modified
|
235
|
+
@client.raw('put', "/content/stages/#{id}", nil, data)
|
236
236
|
end
|
237
237
|
end
|
@@ -1,147 +1,145 @@
|
|
1
1
|
module ContentInstances
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
##
|
3
|
+
# == Content Instances
|
4
|
+
#
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
return @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
|
-
return @client.raw("get", "/content/instances/#{id}", options)
|
53
|
-
end
|
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 = { options: [] }
|
31
|
+
# @data = @mints_user.duplicate_content_instance(1, data.to_json)
|
32
|
+
def duplicate_content_instance(id, data)
|
33
|
+
@client.raw('post', "/content/instances/#{id}/duplicate", nil, data)
|
34
|
+
end
|
54
35
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
end
|
36
|
+
# === Get content instance.
|
37
|
+
# Get a content instance info.
|
38
|
+
#
|
39
|
+
# ==== Parameters
|
40
|
+
# id:: (Integer) -- Content instance id.
|
41
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
42
|
+
#
|
43
|
+
# ==== First Example
|
44
|
+
# @data = @mints_user.get_content_instance(1)
|
45
|
+
#
|
46
|
+
# ==== Second Example
|
47
|
+
# options = { fields: 'id, title' }
|
48
|
+
# @data = @mints_user.get_content_instance(1, options)
|
49
|
+
def get_content_instance(id, options = nil)
|
50
|
+
@client.raw('get', "/content/instances/#{id}", options)
|
51
|
+
end
|
72
52
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
53
|
+
# === Publish content instance.
|
54
|
+
# Publish a content instance.
|
55
|
+
#
|
56
|
+
# ==== Parameters
|
57
|
+
# id:: (Integer) -- Content instance id.
|
58
|
+
# data:: (Hash) -- Data to be submitted.
|
59
|
+
#
|
60
|
+
# ==== Example
|
61
|
+
# data = {
|
62
|
+
# title: 'New publish',
|
63
|
+
# slug: 'new-publish',
|
64
|
+
# content_template_id: 1
|
65
|
+
# }
|
66
|
+
# @data = @mints_user.publish_content_instance(2, data)
|
67
|
+
def publish_content_instance(id, data)
|
68
|
+
@client.raw('put', "/content/instances/#{id}/publish", nil, data_transform(data))
|
69
|
+
end
|
88
70
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
71
|
+
# === Schedule content instance.
|
72
|
+
# Schedule a content instance in a specified date.
|
73
|
+
#
|
74
|
+
# ==== Parameters
|
75
|
+
# id:: (Integer) -- Content instance id.
|
76
|
+
# data:: (Hash) -- Data to be submitted.
|
77
|
+
#
|
78
|
+
# ==== Example
|
79
|
+
# data = {
|
80
|
+
# scheduled_at: '2021-09-06T20:29:16+00:00'
|
81
|
+
# }
|
82
|
+
# @data = @mints_user.schedule_content_instance(1, data)
|
83
|
+
def schedule_content_instance(id, data)
|
84
|
+
@client.raw('put', "/content/instances/#{id}/schedule", nil, data_transform(data))
|
85
|
+
end
|
100
86
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
# }
|
113
|
-
# @data = @mints_user.create_content_instance(data)
|
114
|
-
def create_content_instance(data)
|
115
|
-
return @client.raw("post", "/content/instances", nil, data_transform(data))
|
116
|
-
end
|
87
|
+
# === Revert published content instance.
|
88
|
+
# Revert a published content instance.
|
89
|
+
#
|
90
|
+
# ==== Parameters
|
91
|
+
# id:: (Integer) -- Content instance id.
|
92
|
+
#
|
93
|
+
# ==== Example
|
94
|
+
# @data = @mints_user.revert_published_content_instance(1)
|
95
|
+
def revert_published_content_instance(id)
|
96
|
+
@client.raw('get', "/content/instances/#{id}/revert-published-data")
|
97
|
+
end
|
117
98
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
end
|
99
|
+
# === Create content instance.
|
100
|
+
# Create a content instance with data.
|
101
|
+
#
|
102
|
+
# ==== Parameters
|
103
|
+
# data:: (Hash) -- Data to be submitted.
|
104
|
+
#
|
105
|
+
# ==== Example
|
106
|
+
# data = {
|
107
|
+
# title: 'New Content Instance',
|
108
|
+
# content_template_id: 1,
|
109
|
+
# slug: 'new-content-instance-slug'
|
110
|
+
# }
|
111
|
+
# @data = @mints_user.create_content_instance(data)
|
112
|
+
def create_content_instance(data)
|
113
|
+
@client.raw('post', '/content/instances', nil, data_transform(data))
|
114
|
+
end
|
135
115
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
116
|
+
# === Update content instance.
|
117
|
+
# Update a content instance info.
|
118
|
+
#
|
119
|
+
# ==== Parameters
|
120
|
+
# id:: (Integer) -- Content instance id.
|
121
|
+
# data:: (Hash) -- Data to be submitted.
|
122
|
+
#
|
123
|
+
# ==== Example
|
124
|
+
# data = {
|
125
|
+
# title: "New Content Instance Modified",
|
126
|
+
# content_template_id: 1,
|
127
|
+
# slug: "new-content-instance-slug"
|
128
|
+
# }
|
129
|
+
# @data = @mints_user.update_content_instance(18, data)
|
130
|
+
def update_content_instance(id, data)
|
131
|
+
@client.raw('put', "/content/instances/#{id}", nil, data_transform(data))
|
132
|
+
end
|
133
|
+
|
134
|
+
# === Delete content instance.
|
135
|
+
# Delete a content instance.
|
136
|
+
#
|
137
|
+
# ==== Parameters
|
138
|
+
# id:: (Integer) -- Content instance id.
|
139
|
+
#
|
140
|
+
# ==== Example
|
141
|
+
# @data = @mints_user.delete_content_instance(20)
|
142
|
+
def delete_content_instance(id)
|
143
|
+
@client.raw('delete', "/content/instances/#{id}")
|
144
|
+
end
|
145
|
+
end
|