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
data/lib/user/crm/deals.rb
CHANGED
@@ -1,111 +1,113 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Deals
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Deals
|
6
|
+
#
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
##
|
9
|
+
# === Get deal permits.
|
10
|
+
# Get permits of a deal.
|
11
|
+
#
|
12
|
+
# ==== Parameters
|
13
|
+
# id:: (Integer) -- Deal id.
|
14
|
+
#
|
15
|
+
# ==== Example
|
16
|
+
# @data = @mints_user.get_deal_permits(7)
|
17
|
+
def get_deal_permits(id)
|
18
|
+
@client.raw('get', "/crm/deals/#{id}/permits")
|
19
|
+
end
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
##
|
22
|
+
# === Get deal support data.
|
23
|
+
# Get support data of deals.
|
24
|
+
#
|
25
|
+
# ==== Example
|
26
|
+
# @data = @mints_user.get_deal_support_data
|
27
|
+
def get_deal_support_data
|
28
|
+
@client.raw('get', '/crm/deals/support-data')
|
29
|
+
end
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
##
|
32
|
+
# === Get deal currencies.
|
33
|
+
# Get currencies of deals.
|
34
|
+
#
|
35
|
+
# ==== Example
|
36
|
+
# @data = @mints_user.get_deal_currencies
|
37
|
+
def get_deal_currencies
|
38
|
+
@client.raw('get', '/crm/deal/currencies')
|
39
|
+
end
|
38
40
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
41
|
+
# === Get deals.
|
42
|
+
# Get a collection of deals.
|
43
|
+
#
|
44
|
+
# ==== Parameters
|
45
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
46
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
47
|
+
#
|
48
|
+
# ==== First Example
|
49
|
+
# @data = @mints_user.get_deals
|
50
|
+
#
|
51
|
+
# ==== Second Example
|
52
|
+
# options = { fields: 'id, title' }
|
53
|
+
# @data = @mints_user.get_deals(options)
|
54
|
+
#
|
55
|
+
# ==== Third Example
|
56
|
+
# options = { fields: 'id, title' }
|
57
|
+
# @data = @mints_user.get_deals(options, false)
|
58
|
+
def get_deals(options = nil, use_post = true)
|
59
|
+
get_query_results('/crm/deals', options, use_post)
|
60
|
+
end
|
59
61
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
62
|
+
# === Get deal.
|
63
|
+
# Get a deal info.
|
64
|
+
#
|
65
|
+
# ==== Parameters
|
66
|
+
# id:: (Integer) -- Deal id.
|
67
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
68
|
+
#
|
69
|
+
# ==== First Example
|
70
|
+
# @data = @mints_user.get_deal(1)
|
71
|
+
#
|
72
|
+
# ==== Second Example
|
73
|
+
# options = { fields: 'id, title' }
|
74
|
+
# @data = @mints_user.get_deal(1, options)
|
75
|
+
def get_deal(id, options = nil)
|
76
|
+
@client.raw('get', "/crm/deals/#{id}", options)
|
77
|
+
end
|
76
78
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
79
|
+
# === Create deal.
|
80
|
+
# Create a deal with data.
|
81
|
+
#
|
82
|
+
# ==== Parameters
|
83
|
+
# data:: (Hash) -- Data to be submitted.
|
84
|
+
#
|
85
|
+
# ==== Example
|
86
|
+
# data = {
|
87
|
+
# dealData: {
|
88
|
+
# title: 'New deal',
|
89
|
+
# stepId: 1,
|
90
|
+
# value: 10500
|
91
|
+
# }
|
92
|
+
# }
|
93
|
+
# @data = @mints_user.create_deal(data.to_json)
|
94
|
+
def create_deal(data, options = nil)
|
95
|
+
@client.raw('post', '/crm/deals', options, data)
|
96
|
+
end
|
95
97
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
98
|
+
# === Update deal.
|
99
|
+
# Update a deal data.
|
100
|
+
#
|
101
|
+
# ==== Parameters
|
102
|
+
# id:: (Integer) -- Deal id.
|
103
|
+
# data:: (Hash) -- Data to be submitted.
|
104
|
+
#
|
105
|
+
# ==== Example
|
106
|
+
# data = {
|
107
|
+
# title: 'New Deal Modified'
|
108
|
+
# }
|
109
|
+
# @data = @mints_user.update_deal(102, data.to_json)
|
110
|
+
def update_deal(id, data, options = nil)
|
111
|
+
@client.raw('put', "/crm/deals/#{id}", options, data)
|
112
|
+
end
|
113
|
+
end
|
data/lib/user/crm/favorites.rb
CHANGED
@@ -1,17 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Favorites
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Favorites
|
6
|
+
# TODO: NOT CHECKED, NO DATA IN DB
|
7
|
+
#
|
5
8
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
+
def update_multiple_favorites(data)
|
10
|
+
@client.raw('put', '/crm/favorites', nil, data)
|
11
|
+
end
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
+
def get_favorites(options = nil)
|
14
|
+
@client.raw('get', '/crm/favorites', options)
|
15
|
+
end
|
13
16
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
17
|
+
def update_favorites(id, data)
|
18
|
+
@client.raw('put', "/crm/favorites/#{id}", nil, data)
|
19
|
+
end
|
20
|
+
end
|
data/lib/user/crm/segments.rb
CHANGED
@@ -1,132 +1,132 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Segments
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Segments
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Get segments support data.
|
9
|
+
# Get segments support data.
|
10
|
+
#
|
11
|
+
# ==== Example
|
12
|
+
# @data = @mints_user.get_segments_support_data
|
13
|
+
def get_segments_support_data
|
14
|
+
@client.raw('get', '/crm/segments/support-data')
|
15
|
+
end
|
5
16
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
17
|
+
# === Get segments attributes.
|
18
|
+
# Get segments attributes.
|
19
|
+
#
|
20
|
+
# ==== Parameters
|
21
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
22
|
+
#
|
23
|
+
# ==== Example
|
24
|
+
# options = { object_type: 'contacts' }
|
25
|
+
# @data = @mints_user.get_segments_attributes(options)
|
26
|
+
def get_segments_attributes(options = nil)
|
27
|
+
@client.raw('get', '/crm/segments/attributes', options)
|
28
|
+
end
|
14
29
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|
30
|
+
# === Get segment group.
|
31
|
+
# Get segment group.
|
32
|
+
#
|
33
|
+
# ==== Parameters
|
34
|
+
# group_id:: (String) -- Group's name.
|
35
|
+
#
|
36
|
+
# ==== Example
|
37
|
+
# @data = @mints_user.get_segment_group("users")
|
38
|
+
def get_segment_group(group_id)
|
39
|
+
@client.raw('get', "/crm/segments/groups/#{group_id}")
|
40
|
+
end
|
27
41
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
42
|
+
# === Duplicate segment.
|
43
|
+
# Duplicate a segment.
|
44
|
+
#
|
45
|
+
# ==== Parameters
|
46
|
+
# id:: (Integer) -- Segment id.
|
47
|
+
# data:: (Hash) -- Data to be submitted.
|
48
|
+
#
|
49
|
+
# ==== Example
|
50
|
+
# data = { options: [] }
|
51
|
+
# @data = @mints_user.duplicate_segment(107, data)
|
52
|
+
def duplicate_segment(id, data)
|
53
|
+
@client.raw('post', "/crm/segments/#{id}/duplicate", nil, data)
|
54
|
+
end
|
39
55
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
# === Get segments.
|
57
|
-
# Get a collection of segments.
|
58
|
-
#
|
59
|
-
# ==== Parameters
|
60
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
61
|
-
#
|
62
|
-
# ==== First Example
|
63
|
-
# @data = @mints_user.get_segments
|
64
|
-
#
|
65
|
-
# ==== Second Example
|
66
|
-
# options = { "fields": "id", "sort": "-id" }
|
67
|
-
# @data = @mints_user.get_segments(options)
|
68
|
-
def get_segments(options = nil)
|
69
|
-
@client.raw("get", "/crm/segments", options)
|
70
|
-
end
|
56
|
+
# === Get segments.
|
57
|
+
# Get a collection of segments.
|
58
|
+
#
|
59
|
+
# ==== Parameters
|
60
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
61
|
+
#
|
62
|
+
# ==== First Example
|
63
|
+
# @data = @mints_user.get_segments
|
64
|
+
#
|
65
|
+
# ==== Second Example
|
66
|
+
# options = { fields: 'id', sort: '-id' }
|
67
|
+
# @data = @mints_user.get_segments(options)
|
68
|
+
def get_segments(options = nil)
|
69
|
+
@client.raw('get', '/crm/segments', options)
|
70
|
+
end
|
71
71
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
72
|
+
# === Get segment.
|
73
|
+
# Get a segment info.
|
74
|
+
#
|
75
|
+
# ==== Parameters
|
76
|
+
# id:: (Integer) -- Segment id.
|
77
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
78
|
+
#
|
79
|
+
# ==== First Example
|
80
|
+
# @data = @mints_user.get_segment(1)
|
81
|
+
#
|
82
|
+
# ==== Second Example
|
83
|
+
# options = { fields: 'id, title' }
|
84
|
+
# @data = @mints_user.get_segment(1, options)
|
85
|
+
def get_segment(id, options = nil)
|
86
|
+
@client.raw('get', "/crm/segments/#{id}", options)
|
87
|
+
end
|
88
88
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
89
|
+
# === Create segment.
|
90
|
+
# Create a segment with data.
|
91
|
+
#
|
92
|
+
# ==== Parameters
|
93
|
+
# data:: (Hash) -- Data to be submitted.
|
94
|
+
#
|
95
|
+
# ==== Example
|
96
|
+
# data = {
|
97
|
+
# title: 'New Segment',
|
98
|
+
# object_type: 'deals'
|
99
|
+
# }
|
100
|
+
# @data = @mints_user.create_segment(data)
|
101
|
+
def create_segment(data)
|
102
|
+
@client.raw('post', '/crm/segments', nil, data_transform(data))
|
103
|
+
end
|
104
104
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
105
|
+
# === Update segment.
|
106
|
+
# Update a segment info.
|
107
|
+
#
|
108
|
+
# ==== Parameters
|
109
|
+
# id:: (Integer) -- Segment id.
|
110
|
+
# data:: (Hash) -- Data to be submitted.
|
111
|
+
#
|
112
|
+
# ==== Example
|
113
|
+
# data = {
|
114
|
+
# title: 'New Segment Modified'
|
115
|
+
# }
|
116
|
+
# @data = @mints_user.update_segment(118, data)
|
117
|
+
def update_segment(id, data)
|
118
|
+
@client.raw('put', "/crm/segments/#{id}", nil, data_transform(data))
|
119
|
+
end
|
120
120
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
end
|
121
|
+
# === Delete segment.
|
122
|
+
# Delete a segment.
|
123
|
+
#
|
124
|
+
# ==== Parameters
|
125
|
+
# id:: (Integer) -- Segment id.
|
126
|
+
#
|
127
|
+
# ==== Example
|
128
|
+
# @mints_user.delete_segment(113)
|
129
|
+
def delete_segment(id)
|
130
|
+
@client.raw('delete', "/crm/segments/#{id}")
|
131
|
+
end
|
132
|
+
end
|
data/lib/user/crm/users.rb
CHANGED
@@ -1,22 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Users
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Users
|
6
|
+
#
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
8
|
+
###
|
9
|
+
# === Get crm users.
|
10
|
+
# Get users info in crm.
|
11
|
+
#
|
12
|
+
# ==== Parameters
|
13
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
14
|
+
#
|
15
|
+
# ==== First Example
|
16
|
+
# @data = @mints_user.get_crm_users
|
17
|
+
#
|
18
|
+
# ==== Second Example
|
19
|
+
# options = { sort: 'id', fields: 'id, email' }
|
20
|
+
# @data = @mints_user.get_crm_users(options)
|
21
|
+
def get_crm_users(options = nil)
|
22
|
+
@client.raw('get', '/crm/users', options)
|
23
|
+
end
|
24
|
+
end
|