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,237 +1,238 @@
1
- require_relative './assets.rb'
2
- require_relative './content_instances.rb'
3
- require_relative './content_templates.rb'
4
- require_relative './conversations.rb'
5
- require_relative './dam.rb'
6
- require_relative './forms.rb'
7
- require_relative './message_templates.rb'
8
- require_relative './messages.rb'
9
- require_relative './pages.rb'
10
- require_relative './stories.rb'
11
- require_relative './story_versions.rb'
12
- require_relative './story_templates.rb'
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
- include Assets
16
- include ContentInstances
17
- include ContentTemplates
18
- include Conversations
19
- include DAM
20
- include Forms
21
- include MessageTemplates
22
- include Messages
23
- include Pages
24
- include Stories
25
- include StoryVersions
26
- include StoryTemplates
27
-
28
- # === Get public images url.
29
- # Get public images url.
30
- #
31
- # ==== Example
32
- # @data = @mints_user.get_public_images_url
33
- def get_public_images_url
34
- @client.raw("get", "/content/public-images-url")
35
- end
36
-
37
- ##
38
- # == Authors
39
- #
40
-
41
- # === Get authors.
42
- # Get authors.
43
- #
44
- # ==== Example
45
- # @data = @mints_user.get_authors
46
- def get_authors
47
- @client.raw("get", "/content/authors")
48
- end
49
-
50
-
51
- # === Get author.
52
- # Get an author.
53
- #
54
- # ==== Parameters
55
- # id:: (Integer) -- Author id.
56
- #
57
- # ==== Example
58
- # @data = @mints_user.get_author(1)
59
- def get_author(id)
60
- @client.raw("get", "/content/authors/#{id}")
61
- end
62
-
63
- # === Create author.
64
- # Create an author with data.
65
- #
66
- # ==== Parameters
67
- # data:: (Hash) -- Data to be submitted.
68
- #
69
- # ==== Example
70
- # data = {
71
- # "title": "Howard Phillips Lovecraft",
72
- # "slug": "howard-phillips-lovecraft"
73
- # }
74
- # @data = @mints_user.create_author(data.to_json)
75
- def create_author(data)
76
- @client.raw("post", "/content/authors", nil, data)
77
- end
78
-
79
- # === Update author.
80
- # Update an author info.
81
- #
82
- # ==== Parameters
83
- # id:: (Integer) -- Author id.
84
- # data:: (Hash) -- Data to be submitted.
85
- #
86
- # ==== Example
87
- #
88
- def update_author(id, data)
89
- #FIXME: Author controller doesnt receive data
90
- @client.raw("put", "/content/authors/#{id}", nil, data)
91
- end
92
-
93
- ##
94
- # == Keywords
95
- #
96
-
97
- # === Get keywords.
98
- # Get a collection of keywords.
99
- #
100
- # ==== Parameters
101
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
102
- #
103
- # ==== First Example
104
- # @data = @mints_user.get_keywords
105
- #
106
- # ==== Second Example
107
- # options = { "fields": "title" }
108
- # @data = @mints_user.get_keywords(options)
109
- def get_keywords(options = nil)
110
- @client.raw("get", "/content/keywords", options)
111
- end
112
-
113
- # === Get keyword.
114
- # Get a keyword.
115
- #
116
- # ==== Parameters
117
- # id:: (Integer) -- Keyword id.
118
- #
119
- def get_keyword(id)
120
- @client.raw("get", "/content/keywords/#{id}")
121
- end
122
-
123
- # === Create keyword.
124
- # Create a keyword with data.
125
- #
126
- # ==== Parameters
127
- # data:: (Hash) -- Data to be submitted.
128
- #
129
- # ==== Example
130
- # data = {
131
- # "title": "New Keyword"
132
- # }
133
- # @data = @mints_user.create_keyword(data.to_json)
134
- def create_keyword(data)
135
- @client.raw("post", "/content/keywords", nil, data)
136
- end
137
-
138
- # === Update keyword.
139
- # Update a keyword info.
140
- #
141
- # ==== Parameters
142
- # id:: (Integer) -- Keyword id.
143
- # data:: (Hash) -- Data to be submitted.
144
- #
145
- # ==== Example
146
- #
147
- def update_keyword(id, data)
148
- #FIXME: Keyword controller doesnt receive data
149
- @client.raw("put", "/content/keywords/#{id}", nil, data)
150
- end
151
-
152
- ##
153
- # == Stages
154
- #
155
-
156
- # === Get stages.
157
- # Get a collection of stages.
158
- #
159
- # ==== Parameters
160
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
161
- #
162
- # ==== First Example
163
- # @data = @mints_user.get_stages
164
- #
165
- # ==== Second Example
166
- # options = { "fields": "title" }
167
- # @data = @mints_user.get_stages(options)
168
- def get_stages(options = nil)
169
- @client.raw("get", "/content/stages", options)
170
- end
171
-
172
- # === Get stage.
173
- # Get a stage.
174
- #
175
- # ==== Parameters
176
- # id:: (Integer) -- Stage id.
177
- #
178
- # ==== Example
179
- # @data = @mints_user.get_stage(1)
180
- def get_stage(id)
181
- @client.raw("get", "/content/stages/#{id}")
182
- end
183
-
184
- # === Create stage.
185
- # Create a stage with data.
186
- #
187
- # ==== Parameters
188
- # data:: (Hash) -- Data to be submitted.
189
- #
190
- # ==== Example
191
- # config_json = {
192
- # "count": 1
193
- # }
194
- # event_json = {
195
- # "rset": "DTSTART:20190214T000000Z",
196
- # "duration": 1
197
- # }
198
- # data = {
199
- # "title": "New Stage",
200
- # "description": "New Stage Description",
201
- # "config_json": config_json.to_json,
202
- # "event_json": event_json.to_json
203
- # }
204
- # @data = @mints_user.create_stage(data.to_json)
205
- def create_stage(data)
206
- @client.raw("post", "/content/stages", nil, data)
207
- end
208
-
209
- # === Update stage.
210
- # Update a stage info.
211
- #
212
- # ==== Parameters
213
- # id:: (Integer) -- Stage id.
214
- # data:: (Hash) -- Data to be submitted.
215
- #
216
- # ==== Example
217
- # config_json = {
218
- # "count": 2
219
- # }
220
- # event_json = {
221
- # "rset": "DTSTART:20190214T000000Z",
222
- # "duration": 2
223
- # }
224
- # data = {
225
- # "stageProps": {
226
- # "title": "New Stage Modified",
227
- # "description": "New Stage Description Modified"
228
- # },
229
- # "config_json": config_json.to_json,
230
- # "event_json": event_json.to_json
231
- # }
232
- # @data = @mints_user.update_stage(3, data.to_json)
233
- def update_stage(id, data)
234
- #TODO: Inform StageController.update method has been modified
235
- @client.raw("put", "/content/stages/#{id}", nil, data)
236
- end
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