mints 0.0.27 → 0.0.29
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 +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
@@ -1,147 +1,147 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ContentInstances
|
2
|
-
|
3
|
-
|
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
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
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
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
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
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
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
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
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
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
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
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
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Content templates
|
6
|
+
#
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
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
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
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
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
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
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
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
|