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.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/lib/client.rb +287 -385
- data/lib/contact/config/appointments.rb +201 -0
- data/lib/contact/config/config.rb +7 -0
- data/lib/contact/content/content.rb +7 -0
- data/lib/contact/content/conversations.rb +121 -0
- data/lib/contact/ecommerce/ecommerce.rb +12 -0
- data/lib/contact/ecommerce/order_items.rb +19 -0
- data/lib/contact/ecommerce/order_items_groups.rb +95 -0
- data/lib/contact/ecommerce/orders.rb +133 -0
- data/lib/contact.rb +57 -607
- data/lib/errors.rb +4 -2
- data/lib/generators/mints_assets_controller.rb +4 -1
- data/lib/generators/mints_config.yml.erb +0 -2
- data/lib/generators/mints_contact_controller.rb +4 -1
- data/lib/generators/mints_files_generator.rb +16 -13
- data/lib/generators/mints_link.rb +9 -6
- data/lib/generators/mints_public_controller.rb +4 -1
- data/lib/generators/mints_user_controller.rb +3 -0
- data/lib/generators/short_link_controller.rb +4 -1
- data/lib/mints/controllers/admin_base_controller.rb +5 -3
- data/lib/mints/controllers/base_api_controller.rb +6 -4
- data/lib/mints/controllers/base_controller.rb +5 -3
- data/lib/mints/controllers/concerns/mints_clients.rb +4 -2
- data/lib/mints/controllers/concerns/read_config_file.rb +3 -1
- data/lib/mints/controllers/contact_api_controller.rb +12 -10
- data/lib/mints/controllers/public_api_controller.rb +10 -8
- data/lib/mints/controllers/user_api_controller.rb +11 -9
- data/lib/mints/helpers/contact_auth_helper.rb +3 -1
- data/lib/mints/helpers/mints_helper.rb +39 -38
- data/lib/mints/helpers/proxy_controllers_methods.rb +24 -24
- data/lib/mints/helpers/user_auth_helper.rb +5 -3
- data/lib/mints.rb +12 -10
- data/lib/pub.rb +75 -93
- data/lib/user/config/api_keys.rb +63 -61
- data/lib/user/config/appointments.rb +217 -215
- data/lib/user/config/attribute_groups.rb +74 -72
- data/lib/user/config/attributes.rb +83 -81
- data/lib/user/config/calendars.rb +88 -86
- data/lib/user/config/config.rb +31 -63
- data/lib/user/config/public_folders.rb +105 -104
- data/lib/user/config/relationships.rb +135 -132
- data/lib/user/config/roles.rb +76 -79
- data/lib/user/config/seeds.rb +52 -51
- data/lib/user/config/system_settings.rb +50 -49
- data/lib/user/config/tags.rb +57 -59
- data/lib/user/config/taxonomies.rb +115 -119
- data/lib/user/config/teams.rb +69 -68
- data/lib/user/config/users.rb +72 -71
- data/lib/user/contacts/contacts.rb +21 -20
- data/lib/user/content/assets.rb +275 -280
- data/lib/user/content/content.rb +236 -235
- data/lib/user/content/content_instances.rb +138 -138
- data/lib/user/content/content_templates.rb +105 -103
- data/lib/user/content/conversations.rb +195 -193
- data/lib/user/content/dam.rb +85 -80
- data/lib/user/content/forms.rb +231 -233
- data/lib/user/content/message_templates.rb +154 -151
- data/lib/user/content/messages.rb +89 -87
- data/lib/user/content/pages.rb +84 -82
- data/lib/user/content/stories.rb +101 -101
- data/lib/user/content/story_templates.rb +90 -88
- data/lib/user/content/story_versions.rb +117 -117
- data/lib/user/crm/companies.rb +106 -106
- data/lib/user/crm/contacts.rb +287 -292
- data/lib/user/crm/crm.rb +21 -19
- data/lib/user/crm/deals.rb +105 -103
- data/lib/user/crm/favorites.rb +16 -13
- data/lib/user/crm/segments.rb +123 -123
- data/lib/user/crm/users.rb +22 -20
- data/lib/user/crm/workflow_step_objects.rb +86 -84
- data/lib/user/crm/workflow_steps.rb +47 -45
- data/lib/user/crm/workflows.rb +67 -65
- data/lib/user/ecommerce/ecommerce.rb +29 -27
- data/lib/user/ecommerce/item_prices.rb +84 -81
- data/lib/user/ecommerce/locations.rb +162 -160
- data/lib/user/ecommerce/order_items_groups.rb +110 -106
- data/lib/user/ecommerce/order_statuses.rb +26 -24
- data/lib/user/ecommerce/orders.rb +253 -246
- data/lib/user/ecommerce/price_lists.rb +70 -68
- data/lib/user/ecommerce/product_templates.rb +101 -99
- data/lib/user/ecommerce/product_variations.rb +124 -120
- data/lib/user/ecommerce/products.rb +162 -159
- data/lib/user/ecommerce/skus.rb +87 -85
- data/lib/user/ecommerce/taxes.rb +81 -79
- data/lib/user/ecommerce/variant_options.rb +68 -66
- data/lib/user/ecommerce/variant_values.rb +71 -69
- data/lib/user/helpers/helpers.rb +104 -101
- data/lib/user/helpers/object_activities.rb +80 -78
- data/lib/user/helpers/object_folders.rb +78 -76
- data/lib/user/helpers/user_folders.rb +79 -77
- data/lib/user/marketing/marketing.rb +116 -113
- data/lib/user/profile/profile.rb +96 -103
- data/lib/user.rb +32 -41
- metadata +50 -43
- data/lib/user/config/importers.rb +0 -184
data/lib/user/content/content.rb
CHANGED
|
@@ -1,237 +1,238 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require_relative './
|
|
4
|
-
require_relative './
|
|
5
|
-
require_relative './
|
|
6
|
-
require_relative './
|
|
7
|
-
require_relative './
|
|
8
|
-
require_relative './
|
|
9
|
-
require_relative './
|
|
10
|
-
require_relative './
|
|
11
|
-
require_relative './
|
|
12
|
-
require_relative './
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative './assets'
|
|
4
|
+
require_relative './content_instances'
|
|
5
|
+
require_relative './content_templates'
|
|
6
|
+
require_relative './conversations'
|
|
7
|
+
require_relative './dam'
|
|
8
|
+
require_relative './forms'
|
|
9
|
+
require_relative './message_templates'
|
|
10
|
+
require_relative './messages'
|
|
11
|
+
require_relative './pages'
|
|
12
|
+
require_relative './stories'
|
|
13
|
+
require_relative './story_versions'
|
|
14
|
+
require_relative './story_templates'
|
|
13
15
|
|
|
14
16
|
module Content
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
end
|
|
17
|
+
include Assets
|
|
18
|
+
include ContentInstances
|
|
19
|
+
include ContentTemplates
|
|
20
|
+
include Conversations
|
|
21
|
+
include DAM
|
|
22
|
+
include Forms
|
|
23
|
+
include MessageTemplates
|
|
24
|
+
include Messages
|
|
25
|
+
include Pages
|
|
26
|
+
include Stories
|
|
27
|
+
include StoryVersions
|
|
28
|
+
include StoryTemplates
|
|
29
|
+
|
|
30
|
+
# === Get public images url.
|
|
31
|
+
# Get public images url.
|
|
32
|
+
#
|
|
33
|
+
# ==== Example
|
|
34
|
+
# @data = @mints_user.get_public_images_url
|
|
35
|
+
def get_public_images_url
|
|
36
|
+
@client.raw('get', '/content/public-images-url')
|
|
37
|
+
end
|
|
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
|
+
##
|
|
95
|
+
# == Keywords
|
|
96
|
+
#
|
|
97
|
+
|
|
98
|
+
# === Get keywords.
|
|
99
|
+
# Get a collection of keywords.
|
|
100
|
+
#
|
|
101
|
+
# ==== Parameters
|
|
102
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
103
|
+
#
|
|
104
|
+
# ==== First Example
|
|
105
|
+
# @data = @mints_user.get_keywords
|
|
106
|
+
#
|
|
107
|
+
# ==== Second Example
|
|
108
|
+
# options = { fields: 'title' }
|
|
109
|
+
# @data = @mints_user.get_keywords(options)
|
|
110
|
+
def get_keywords(options = nil)
|
|
111
|
+
@client.raw('get', '/content/keywords', options)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# === Get keyword.
|
|
115
|
+
# Get a keyword.
|
|
116
|
+
#
|
|
117
|
+
# ==== Parameters
|
|
118
|
+
# id:: (Integer) -- Keyword id.
|
|
119
|
+
#
|
|
120
|
+
def get_keyword(id)
|
|
121
|
+
@client.raw('get', "/content/keywords/#{id}")
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# === Create keyword.
|
|
125
|
+
# Create a keyword with data.
|
|
126
|
+
#
|
|
127
|
+
# ==== Parameters
|
|
128
|
+
# data:: (Hash) -- Data to be submitted.
|
|
129
|
+
#
|
|
130
|
+
# ==== Example
|
|
131
|
+
# data = {
|
|
132
|
+
# title: 'New Keyword'
|
|
133
|
+
# }
|
|
134
|
+
# @data = @mints_user.create_keyword(data.to_json)
|
|
135
|
+
def create_keyword(data)
|
|
136
|
+
@client.raw('post', '/content/keywords', nil, data)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# === Update keyword.
|
|
140
|
+
# Update a keyword info.
|
|
141
|
+
#
|
|
142
|
+
# ==== Parameters
|
|
143
|
+
# id:: (Integer) -- Keyword id.
|
|
144
|
+
# data:: (Hash) -- Data to be submitted.
|
|
145
|
+
#
|
|
146
|
+
# ==== Example
|
|
147
|
+
#
|
|
148
|
+
def update_keyword(id, data)
|
|
149
|
+
# FIXME: Keyword controller doesnt receive data
|
|
150
|
+
@client.raw('put', "/content/keywords/#{id}", nil, data)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
##
|
|
154
|
+
# == Stages
|
|
155
|
+
#
|
|
156
|
+
|
|
157
|
+
# === Get stages.
|
|
158
|
+
# Get a collection of stages.
|
|
159
|
+
#
|
|
160
|
+
# ==== Parameters
|
|
161
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
162
|
+
#
|
|
163
|
+
# ==== First Example
|
|
164
|
+
# @data = @mints_user.get_stages
|
|
165
|
+
#
|
|
166
|
+
# ==== Second Example
|
|
167
|
+
# options = { fields: 'title' }
|
|
168
|
+
# @data = @mints_user.get_stages(options)
|
|
169
|
+
def get_stages(options = nil)
|
|
170
|
+
@client.raw('get', '/content/stages', options)
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# === Get stage.
|
|
174
|
+
# Get a stage.
|
|
175
|
+
#
|
|
176
|
+
# ==== Parameters
|
|
177
|
+
# id:: (Integer) -- Stage id.
|
|
178
|
+
#
|
|
179
|
+
# ==== Example
|
|
180
|
+
# @data = @mints_user.get_stage(1)
|
|
181
|
+
def get_stage(id)
|
|
182
|
+
@client.raw('get', "/content/stages/#{id}")
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# === Create stage.
|
|
186
|
+
# Create a stage with data.
|
|
187
|
+
#
|
|
188
|
+
# ==== Parameters
|
|
189
|
+
# data:: (Hash) -- Data to be submitted.
|
|
190
|
+
#
|
|
191
|
+
# ==== Example
|
|
192
|
+
# config_json = {
|
|
193
|
+
# count: 1
|
|
194
|
+
# }
|
|
195
|
+
# event_json = {
|
|
196
|
+
# rset: 'DTSTART:20190214T000000Z',
|
|
197
|
+
# duration: 1
|
|
198
|
+
# }
|
|
199
|
+
# data = {
|
|
200
|
+
# title: 'New Stage',
|
|
201
|
+
# description: 'New Stage Description',
|
|
202
|
+
# config_json: config_json.to_json,
|
|
203
|
+
# event_json: event_json.to_json
|
|
204
|
+
# }
|
|
205
|
+
# @data = @mints_user.create_stage(data.to_json)
|
|
206
|
+
def create_stage(data)
|
|
207
|
+
@client.raw('post', '/content/stages', nil, data)
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# === Update stage.
|
|
211
|
+
# Update a stage info.
|
|
212
|
+
#
|
|
213
|
+
# ==== Parameters
|
|
214
|
+
# id:: (Integer) -- Stage id.
|
|
215
|
+
# data:: (Hash) -- Data to be submitted.
|
|
216
|
+
#
|
|
217
|
+
# ==== Example
|
|
218
|
+
# config_json = {
|
|
219
|
+
# count: 2
|
|
220
|
+
# }
|
|
221
|
+
# event_json = {
|
|
222
|
+
# rset: 'DTSTART:20190214T000000Z',
|
|
223
|
+
# duration: 2
|
|
224
|
+
# }
|
|
225
|
+
# data = {
|
|
226
|
+
# stageProps: {
|
|
227
|
+
# title: 'New Stage Modified',
|
|
228
|
+
# description: 'New Stage Description Modified'
|
|
229
|
+
# },
|
|
230
|
+
# config_json: config_json.to_json,
|
|
231
|
+
# event_json: event_json.to_json
|
|
232
|
+
# }
|
|
233
|
+
# @data = @mints_user.update_stage(3, data.to_json)
|
|
234
|
+
def update_stage(id, data)
|
|
235
|
+
# TODO: Inform StageController.update method has been modified
|
|
236
|
+
@client.raw('put', "/content/stages/#{id}", nil, data)
|
|
237
|
+
end
|
|
238
|
+
end
|