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