mints 0.0.26 → 0.0.28
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 +75 -37
- data/lib/contact.rb +61 -62
- data/lib/errors.rb +98 -0
- data/lib/generators/mints_config.yml.erb +0 -2
- data/lib/generators/mints_link.rb +3 -3
- data/lib/mints/controllers/admin_base_controller.rb +8 -66
- data/lib/mints/controllers/base_api_controller.rb +16 -134
- data/lib/mints/controllers/base_controller.rb +20 -106
- data/lib/mints/controllers/concerns/mints_clients.rb +74 -0
- data/lib/mints/controllers/concerns/read_config_file.rb +28 -0
- data/lib/mints/controllers/contact_api_controller.rb +6 -85
- data/lib/mints/controllers/public_api_controller.rb +6 -79
- data/lib/mints/controllers/user_api_controller.rb +7 -82
- data/lib/mints/helpers/contact_auth_helper.rb +67 -0
- data/lib/{mints_helper.rb → mints/helpers/mints_helper.rb} +7 -5
- data/lib/mints/helpers/proxy_controllers_methods.rb +126 -0
- data/lib/mints/helpers/user_auth_helper.rb +53 -0
- data/lib/mints.rb +2 -0
- data/lib/pub.rb +56 -56
- 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 -105
- 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 +4 -4
- metadata +41 -35
@@ -9,7 +9,7 @@ module Attributes
|
|
9
9
|
# ==== Example
|
10
10
|
# @data = @mints_user.get_attributes_data_types
|
11
11
|
def get_attributes_data_types
|
12
|
-
|
12
|
+
@client.raw('get', "/config/attributes/data-types")
|
13
13
|
end
|
14
14
|
|
15
15
|
# === Get sub attributes.
|
@@ -21,7 +21,7 @@ module Attributes
|
|
21
21
|
# ==== Example
|
22
22
|
#
|
23
23
|
def get_sub_attributes(options) #TODO: Test, this method has been added recently
|
24
|
-
|
24
|
+
@client.raw('get', "/config/attributes/sub-attributes", options)
|
25
25
|
end
|
26
26
|
|
27
27
|
# === Get attributes.
|
@@ -30,7 +30,7 @@ module Attributes
|
|
30
30
|
# ==== Example
|
31
31
|
# @data = @mints_user.get_attributes
|
32
32
|
def get_attributes
|
33
|
-
|
33
|
+
@client.raw('get', "/config/attributes")
|
34
34
|
end
|
35
35
|
|
36
36
|
# === Get attribute.
|
@@ -42,7 +42,7 @@ module Attributes
|
|
42
42
|
# ==== Example
|
43
43
|
# @data = @mints_user.get_attribute(1)
|
44
44
|
def get_attribute(id)
|
45
|
-
|
45
|
+
@client.raw('get', "/config/attributes/#{id}")
|
46
46
|
end
|
47
47
|
|
48
48
|
# === Create attribute.
|
@@ -53,15 +53,15 @@ module Attributes
|
|
53
53
|
#
|
54
54
|
# ==== Example
|
55
55
|
# data = {
|
56
|
-
#
|
56
|
+
# title: "New Attribute",
|
57
57
|
# "object_type": "orders",
|
58
|
-
#
|
58
|
+
# slug: "new_attribute",
|
59
59
|
# "attribute_group_id": 1,
|
60
60
|
# "data_type_enum": 10
|
61
61
|
# }
|
62
62
|
# @data = @mints_user.create_attribute(data)
|
63
63
|
def create_attribute(data)
|
64
|
-
|
64
|
+
@client.raw('post', "/config/attributes", nil, data_transform(data))
|
65
65
|
end
|
66
66
|
|
67
67
|
# === Update attribute.
|
@@ -73,14 +73,14 @@ module Attributes
|
|
73
73
|
#
|
74
74
|
# ==== Example
|
75
75
|
# data = {
|
76
|
-
#
|
76
|
+
# title: "New Attribute Modified",
|
77
77
|
# "object_type": "orders",
|
78
|
-
#
|
78
|
+
# slug: "new_attribute",
|
79
79
|
# "attribute_group_id": 1,
|
80
80
|
# "data_type_enum": 10
|
81
81
|
# }
|
82
82
|
# @data = @mints_user.update_attribute(292, data)
|
83
83
|
def update_attribute(id, data)
|
84
|
-
|
84
|
+
@client.raw('put', "/config/attributes/#{id}", nil, data_transform(data))
|
85
85
|
end
|
86
86
|
end
|
@@ -14,11 +14,11 @@ module Calendars
|
|
14
14
|
#
|
15
15
|
# ==== Second Example
|
16
16
|
# options = {
|
17
|
-
#
|
17
|
+
# fields: "title"
|
18
18
|
# }
|
19
19
|
# @data = @mints_user.get_calendars(options)
|
20
20
|
def get_calendars(options = nil)
|
21
|
-
|
21
|
+
@client.raw('get', "/config/calendars", options)
|
22
22
|
end
|
23
23
|
|
24
24
|
# === Get calendar.
|
@@ -33,11 +33,11 @@ module Calendars
|
|
33
33
|
#
|
34
34
|
# ==== Second Example
|
35
35
|
# options = {
|
36
|
-
#
|
36
|
+
# fields: "title"
|
37
37
|
# }
|
38
38
|
# @data = @mints_user.get_calendar(1, options)
|
39
39
|
def get_calendar(id, options = nil)
|
40
|
-
|
40
|
+
@client.raw('get', "/config/calendars/#{id}", options)
|
41
41
|
end
|
42
42
|
|
43
43
|
# === Create calendar.
|
@@ -48,13 +48,13 @@ module Calendars
|
|
48
48
|
#
|
49
49
|
# ==== Example
|
50
50
|
# data = {
|
51
|
-
#
|
51
|
+
# title: "New Calendar",
|
52
52
|
# "object_type": "contacts",
|
53
53
|
# "object_id": 1
|
54
54
|
# }
|
55
55
|
# @data = @mints_user.create_calendar(data)
|
56
56
|
def create_calendar(data)
|
57
|
-
|
57
|
+
@client.raw('post', "/config/calendars", nil, data_transform(data))
|
58
58
|
end
|
59
59
|
|
60
60
|
# === Update calendar.
|
@@ -66,13 +66,13 @@ module Calendars
|
|
66
66
|
#
|
67
67
|
# ==== Example
|
68
68
|
# data = {
|
69
|
-
#
|
69
|
+
# title: "New Calendar Modified",
|
70
70
|
# "object_type": "contacts",
|
71
71
|
# "object_id": 1
|
72
72
|
# }
|
73
73
|
# @data = @mints_user.update_calendar(4, data)
|
74
74
|
def update_calendar(id, data)
|
75
|
-
|
75
|
+
@client.raw('put', "/config/calendars/#{id}", nil, data_transform(data))
|
76
76
|
end
|
77
77
|
|
78
78
|
# === Delete calendar.
|
@@ -84,6 +84,6 @@ module Calendars
|
|
84
84
|
# ==== Example
|
85
85
|
# @data = @mints_user.delete_calendar(4)
|
86
86
|
def delete_calendar(id)
|
87
|
-
|
87
|
+
@client.raw('delete', "/config/calendars/#{id}")
|
88
88
|
end
|
89
89
|
end
|
data/lib/user/config/config.rb
CHANGED
@@ -36,30 +36,30 @@ module Config
|
|
36
36
|
#
|
37
37
|
|
38
38
|
# def sync_categories_for_object(data)
|
39
|
-
#
|
39
|
+
# @client.raw('put', "/config/categories/sync_categories_for_object", nil, data)
|
40
40
|
#end
|
41
41
|
|
42
42
|
# def get_categories_for_object(options)
|
43
|
-
#
|
43
|
+
# @client.raw('get', "/config/categories/get_categories_for_object", options)
|
44
44
|
#end
|
45
45
|
|
46
46
|
# def get_categories
|
47
|
-
#
|
47
|
+
# @client.raw('get', "/config/categories")
|
48
48
|
#end
|
49
49
|
|
50
50
|
# def create_category(data) #TODO: Research if 'visible' is a boolean or int. It accepts smallint
|
51
|
-
#
|
51
|
+
# @client.raw('post', "/config/categories", nil, data)
|
52
52
|
#end
|
53
53
|
|
54
54
|
# def update_category(id, data)
|
55
|
-
#
|
55
|
+
# @client.raw('put', "/config/categories/#{id}", nil, data)
|
56
56
|
#end
|
57
57
|
|
58
58
|
# def get_category_support_data(id)
|
59
|
-
#
|
59
|
+
# @client.raw('get', "/config/categories/support-data/#{id}")
|
60
60
|
#end
|
61
61
|
|
62
62
|
# def get_category(id)
|
63
|
-
#
|
63
|
+
# @client.raw('get', "/config/categories/#{id}")
|
64
64
|
#end
|
65
65
|
end
|
@@ -13,7 +13,7 @@ module Importers
|
|
13
13
|
# options = { "ip_id": 1 }
|
14
14
|
# @data = @mints_user.get_importers_results(options)
|
15
15
|
def get_importers_results(options) #FIXME: Query doesnt get results. Maybe no data in db.
|
16
|
-
|
16
|
+
@client.raw('get', "/config/importers/results", options)
|
17
17
|
end
|
18
18
|
|
19
19
|
# === Get importers configuration.
|
@@ -22,7 +22,7 @@ module Importers
|
|
22
22
|
# ==== Example
|
23
23
|
# @data = @mints_user.get_importers_configuration
|
24
24
|
def get_importers_configuration
|
25
|
-
|
25
|
+
@client.raw('get', "/config/importers/configuration")
|
26
26
|
end
|
27
27
|
|
28
28
|
# === Get importing process status.
|
@@ -37,7 +37,7 @@ module Importers
|
|
37
37
|
# }
|
38
38
|
# @data = @mints_user.get_importing_process_status(options)
|
39
39
|
def get_importing_process_status(options = nil)
|
40
|
-
|
40
|
+
@client.raw('get', "/config/importers/importing_process_status", options)
|
41
41
|
end
|
42
42
|
|
43
43
|
# === Get importers attributes.
|
@@ -53,7 +53,7 @@ module Importers
|
|
53
53
|
# }
|
54
54
|
# @data = @mints_user.get_importers_attributes(options)
|
55
55
|
def get_importers_attributes(options = nil)
|
56
|
-
|
56
|
+
@client.raw('get', "/config/importers/attributes", options)
|
57
57
|
end
|
58
58
|
|
59
59
|
# === Upload importer.
|
@@ -69,7 +69,7 @@ module Importers
|
|
69
69
|
# }
|
70
70
|
# @data = @mints_user.upload_importer(1, data.to_json)
|
71
71
|
def upload_importer(id, data) #TODO: Search for csv archives
|
72
|
-
|
72
|
+
@client.raw('post', "/config/importers/#{id}/upload", nil, data)
|
73
73
|
end
|
74
74
|
|
75
75
|
# === Import row.
|
@@ -81,7 +81,7 @@ module Importers
|
|
81
81
|
# ==== Example
|
82
82
|
#
|
83
83
|
def import_row(data) #TODO: Research use
|
84
|
-
|
84
|
+
@client.raw('post', "/config/importers/import_row", nil, data)
|
85
85
|
end
|
86
86
|
|
87
87
|
# === Remove importers active process.
|
@@ -93,7 +93,7 @@ module Importers
|
|
93
93
|
# ==== Example
|
94
94
|
#
|
95
95
|
def remove_importers_active_process(data) #FIXME: Cannot get property 'active_importing_process' of non-object.
|
96
|
-
|
96
|
+
@client.raw('post', "/config/importers/removeActiveProcess", nil, data_transform(data))
|
97
97
|
end
|
98
98
|
|
99
99
|
# === Get importers.
|
@@ -106,10 +106,10 @@ module Importers
|
|
106
106
|
# @data = @mints_user.get_importers
|
107
107
|
#
|
108
108
|
# ==== Second Example
|
109
|
-
# options = {
|
109
|
+
# options = { fields: "name" }
|
110
110
|
# @data = @mints_user.get_importers(options)
|
111
111
|
def get_importers(options = nil)
|
112
|
-
|
112
|
+
@client.raw('get', "/config/importers", options)
|
113
113
|
end
|
114
114
|
|
115
115
|
# === Get importer.
|
@@ -123,10 +123,10 @@ module Importers
|
|
123
123
|
# @data = @mints_user.get_importer(1)
|
124
124
|
#
|
125
125
|
# ==== Second Example
|
126
|
-
# options = {
|
126
|
+
# options = { fields: "name" }
|
127
127
|
# @data = @mints_user.get_importer(1, options)
|
128
128
|
def get_importer(id, options = nil)
|
129
|
-
|
129
|
+
@client.raw('get', "/config/importers/#{id}", options)
|
130
130
|
end
|
131
131
|
|
132
132
|
# === Create importer.
|
@@ -142,7 +142,7 @@ module Importers
|
|
142
142
|
# }
|
143
143
|
# @data = @mints_user.create_importer(data)
|
144
144
|
def create_importer(data)
|
145
|
-
|
145
|
+
@client.raw('post', "/config/importers", nil, data_transform(data))
|
146
146
|
end
|
147
147
|
|
148
148
|
# === Update importer.
|
@@ -158,7 +158,7 @@ module Importers
|
|
158
158
|
# }
|
159
159
|
# @data = @mints_user.update_importer(4, data)
|
160
160
|
def update_importer(id, data)
|
161
|
-
|
161
|
+
@client.raw('put', "/config/importers/#{id}", nil, data_transform(data))
|
162
162
|
end
|
163
163
|
|
164
164
|
# === Delete importer.
|
@@ -170,7 +170,7 @@ module Importers
|
|
170
170
|
# ==== Example
|
171
171
|
# @data = @mints_user.delete_importer(4)
|
172
172
|
def delete_importer(id)
|
173
|
-
|
173
|
+
@client.raw('delete', "/config/importers/#{id}")
|
174
174
|
end
|
175
175
|
|
176
176
|
# === Get importers pusher key.
|
@@ -179,6 +179,6 @@ module Importers
|
|
179
179
|
# ==== Example
|
180
180
|
# @data = @mints_user.get_importers_pusher_key
|
181
181
|
def get_importers_pusher_key
|
182
|
-
|
182
|
+
@client.raw('get', "/config/pusher_key")
|
183
183
|
end
|
184
184
|
end
|
@@ -16,7 +16,7 @@ module PublicFolders
|
|
16
16
|
# }
|
17
17
|
# @data = @mints_user.sync_public_folders_for_object(data.to_json)
|
18
18
|
def sync_public_folders_for_object(data)
|
19
|
-
|
19
|
+
@client.raw('put', "/config/public-folders/sync_public-folders_for_object", nil, data)
|
20
20
|
end
|
21
21
|
|
22
22
|
# === Get public folders for object.
|
@@ -32,7 +32,7 @@ module PublicFolders
|
|
32
32
|
# }
|
33
33
|
# @data = @mints_user.get_public_folders_for_object(options)
|
34
34
|
def get_public_folders_for_object(options)
|
35
|
-
|
35
|
+
@client.raw('get', "/config/public-folders/get_public-folders_for_object", options)
|
36
36
|
end
|
37
37
|
|
38
38
|
# === Get public folders.
|
@@ -41,7 +41,7 @@ module PublicFolders
|
|
41
41
|
# ==== Example
|
42
42
|
# @data = @mints_user.get_public_folders
|
43
43
|
def get_public_folders(options = nil)
|
44
|
-
|
44
|
+
@client.raw('get', "/config/public-folders", options)
|
45
45
|
end
|
46
46
|
|
47
47
|
# === Create public folder.
|
@@ -52,14 +52,14 @@ module PublicFolders
|
|
52
52
|
#
|
53
53
|
# ==== Example
|
54
54
|
# data = {
|
55
|
-
#
|
56
|
-
#
|
55
|
+
# title: "New Public Folder",
|
56
|
+
# slug: "new-public-folder",
|
57
57
|
# "object_type": "contacts",
|
58
58
|
# "visible": true
|
59
59
|
# }
|
60
60
|
# @data = @mints_user.create_public_folder(data.to_json)
|
61
61
|
def create_public_folder(data)
|
62
|
-
|
62
|
+
@client.raw('post', "/config/public-folders", nil, data)
|
63
63
|
end
|
64
64
|
|
65
65
|
# === Update public folder.
|
@@ -71,14 +71,14 @@ module PublicFolders
|
|
71
71
|
#
|
72
72
|
# ==== Example
|
73
73
|
# data = {
|
74
|
-
#
|
75
|
-
#
|
74
|
+
# title: "New Public Folder Modified",
|
75
|
+
# slug: "new-public-folder",
|
76
76
|
# "object_type": "contacts",
|
77
77
|
# "visible": true
|
78
78
|
# }
|
79
79
|
# @data = @mints_user.update_public_folder(20, data.to_json)
|
80
80
|
def update_public_folder(id, data)
|
81
|
-
|
81
|
+
@client.raw('put', "/config/public-folders/#{id}", nil, data)
|
82
82
|
end
|
83
83
|
|
84
84
|
# === Get public folder support data.
|
@@ -90,7 +90,7 @@ module PublicFolders
|
|
90
90
|
# ==== Example
|
91
91
|
# @data = @mints_user.get_public_folder_support_data(1)
|
92
92
|
def get_public_folder_support_data(id)
|
93
|
-
|
93
|
+
@client.raw('get', "/config/public-folders/support-data/#{id}")
|
94
94
|
end
|
95
95
|
|
96
96
|
# === Get public folder.
|
@@ -103,6 +103,6 @@ module PublicFolders
|
|
103
103
|
# ==== Example
|
104
104
|
# @data = @mints_user.get_public_folder(3)
|
105
105
|
def get_public_folder(id)
|
106
|
-
|
106
|
+
@client.raw('get', "/config/public-folders/#{id}")
|
107
107
|
end
|
108
108
|
end
|
@@ -15,7 +15,7 @@ module Relationships
|
|
15
15
|
# }
|
16
16
|
# @data = @mints_user.get_relationships_available_for(options)
|
17
17
|
def get_relationships_available_for(options)
|
18
|
-
|
18
|
+
@client.raw('get', "/config/relationships/available-for", options)
|
19
19
|
end
|
20
20
|
|
21
21
|
# === Attach relationship.
|
@@ -27,7 +27,7 @@ module Relationships
|
|
27
27
|
# ==== Example
|
28
28
|
#
|
29
29
|
def attach_relationship(data) #FIXME: Method doesn't work, RelationshipManager cannot access to id attribute.
|
30
|
-
|
30
|
+
@client.raw('post', "/config/relationships/attach", nil, data_transform(data))
|
31
31
|
end
|
32
32
|
|
33
33
|
# === Detach relationship.
|
@@ -39,7 +39,7 @@ module Relationships
|
|
39
39
|
# ==== Example
|
40
40
|
#
|
41
41
|
def detach_relationship(data) #FIXME: Method doesn't work, RelationshipManager cannot access to id attribute.
|
42
|
-
|
42
|
+
@client.raw('post', "/config/relationships/detach", nil, data_transform(data))
|
43
43
|
end
|
44
44
|
|
45
45
|
# === Relationship has objects.
|
@@ -51,7 +51,7 @@ module Relationships
|
|
51
51
|
# ==== Example
|
52
52
|
# @data = @mints_user.relationship_has_objects(1)
|
53
53
|
def relationship_has_objects(id)
|
54
|
-
|
54
|
+
@client.raw('get', "/config/relationships/#{id}/hasObjects")
|
55
55
|
end
|
56
56
|
|
57
57
|
# === Get relationships.
|
@@ -64,10 +64,10 @@ module Relationships
|
|
64
64
|
# @data = @mints_user.get_relationships
|
65
65
|
#
|
66
66
|
# ==== Second Example
|
67
|
-
# options = {
|
67
|
+
# options = { fields: "id" }
|
68
68
|
# @data = @mints_user.get_relationships(options)
|
69
69
|
def get_relationships(options = nil)
|
70
|
-
|
70
|
+
@client.raw('get', "/config/relationships", options)
|
71
71
|
end
|
72
72
|
|
73
73
|
# === Get relationship.
|
@@ -81,10 +81,10 @@ module Relationships
|
|
81
81
|
# @data = @mints_user.get_relationship(1)
|
82
82
|
#
|
83
83
|
# ==== Second Example
|
84
|
-
# options = {
|
84
|
+
# options = { fields: "id" }
|
85
85
|
# @data = @mints_user.get_relationship(1, options)
|
86
86
|
def get_relationship(id, options = nil)
|
87
|
-
|
87
|
+
@client.raw('get', "/config/relationships/#{id}", options)
|
88
88
|
end
|
89
89
|
|
90
90
|
# === Create relationship.
|
@@ -102,7 +102,7 @@ module Relationships
|
|
102
102
|
# }
|
103
103
|
# @data = @mints_user.create_relationship(data)
|
104
104
|
def create_relationship(data)
|
105
|
-
|
105
|
+
@client.raw('post', "/config/relationships", nil, data_transform(data))
|
106
106
|
end
|
107
107
|
|
108
108
|
# === Update relationship.
|
@@ -121,7 +121,7 @@ module Relationships
|
|
121
121
|
# }
|
122
122
|
# @data = @mints_user.update_relationship(5, data)
|
123
123
|
def update_relationship(id, data)
|
124
|
-
|
124
|
+
@client.raw('put', "/config/relationships/#{id}", nil, data_transform(data))
|
125
125
|
end
|
126
126
|
|
127
127
|
# === Delete relationship.
|
@@ -133,6 +133,6 @@ module Relationships
|
|
133
133
|
# ==== Example
|
134
134
|
# @data = @mints_user.delete_relationship(5)
|
135
135
|
def delete_relationship(id)
|
136
|
-
|
136
|
+
@client.raw('delete', "/config/relationships/#{id}")
|
137
137
|
end
|
138
138
|
end
|
data/lib/user/config/roles.rb
CHANGED
@@ -4,7 +4,7 @@ module Roles
|
|
4
4
|
#
|
5
5
|
|
6
6
|
#def get_roles_permissions #FIXME: RoleController doesnt have getPermissions method
|
7
|
-
#
|
7
|
+
# @client.raw('get', "/config/roles/get-permissions")
|
8
8
|
#end
|
9
9
|
|
10
10
|
# === Duplicate role.
|
@@ -16,11 +16,11 @@ module Roles
|
|
16
16
|
#
|
17
17
|
# ==== Example
|
18
18
|
# data = {
|
19
|
-
#
|
19
|
+
# options: []
|
20
20
|
# }
|
21
21
|
# @data = @mints_user.duplicate_role(1, data.to_json)
|
22
22
|
def duplicate_role(id, data)
|
23
|
-
|
23
|
+
@client.raw('post', "/config/roles/#{id}/duplicate", nil, data)
|
24
24
|
end
|
25
25
|
|
26
26
|
# === Get roles.
|
@@ -29,7 +29,7 @@ module Roles
|
|
29
29
|
# ==== Example
|
30
30
|
# @data = @mints_user.get_roles
|
31
31
|
def get_roles
|
32
|
-
|
32
|
+
@client.raw('get', "/config/roles")
|
33
33
|
end
|
34
34
|
|
35
35
|
# === Get role.
|
@@ -42,7 +42,7 @@ module Roles
|
|
42
42
|
# ==== Example
|
43
43
|
# @data = @mints_user.get_role(1)
|
44
44
|
def get_role(id)
|
45
|
-
|
45
|
+
@client.raw('get', "/config/roles/#{id}")
|
46
46
|
end
|
47
47
|
|
48
48
|
# === Create role.
|
@@ -55,11 +55,11 @@ module Roles
|
|
55
55
|
# data = {
|
56
56
|
# "name": "new-role",
|
57
57
|
# "display_name": "New Role",
|
58
|
-
#
|
58
|
+
# description: "Role description"
|
59
59
|
# }
|
60
60
|
# @data = @mints_user.create_role(data)
|
61
61
|
def create_role(data)
|
62
|
-
|
62
|
+
@client.raw('post', "/config/roles", nil, data_transform(data))
|
63
63
|
end
|
64
64
|
|
65
65
|
# === Update role.
|
@@ -73,12 +73,12 @@ module Roles
|
|
73
73
|
# data = {
|
74
74
|
# "name": "new-role",
|
75
75
|
# "display_name": "New Role Display Name Modified",
|
76
|
-
#
|
76
|
+
# description: "Role description",
|
77
77
|
# "permissions": 1
|
78
78
|
# }
|
79
79
|
# @data = @mints_user.update_role(8, data)
|
80
80
|
def update_role(id, data) #FIXME: This action is unauthorized
|
81
81
|
#TODO: Research permissions variable type. This would be the error's solution.
|
82
|
-
|
82
|
+
@client.raw('put', "/config/roles/#{id}", nil, data_transform(data))
|
83
83
|
end
|
84
84
|
end
|
data/lib/user/config/seeds.rb
CHANGED
@@ -11,7 +11,7 @@ module Seeds
|
|
11
11
|
def apply_seeds(data, async = false)
|
12
12
|
url = "/config/seeds"
|
13
13
|
url = "#{url}?async" if async
|
14
|
-
|
14
|
+
@client.raw('post', url, nil, data)
|
15
15
|
end
|
16
16
|
|
17
17
|
# === Get seed processes.
|
@@ -26,11 +26,11 @@ module Seeds
|
|
26
26
|
#
|
27
27
|
# ==== Second Example
|
28
28
|
# options = {
|
29
|
-
#
|
29
|
+
# fields: "id"
|
30
30
|
# }
|
31
31
|
# @data = @mints_user.get_seed_processes(options)
|
32
32
|
def get_seed_processes(options = nil)
|
33
|
-
|
33
|
+
@client.raw('post', "/config/seed-processes", options)
|
34
34
|
end
|
35
35
|
|
36
36
|
# === Get seed process.
|
@@ -45,10 +45,10 @@ module Seeds
|
|
45
45
|
#
|
46
46
|
# ==== Second Example
|
47
47
|
# options = {
|
48
|
-
#
|
48
|
+
# fields: 'id, title'
|
49
49
|
# }
|
50
50
|
# @data = @mints_user.get_seed_process(1, options)
|
51
51
|
def get_seed_process(id, options = nil)
|
52
|
-
|
52
|
+
@client.raw('get', "/config/seed-processes/#{id}", options)
|
53
53
|
end
|
54
54
|
end
|
@@ -12,7 +12,7 @@ module SystemSettings
|
|
12
12
|
# }
|
13
13
|
# @data = @mints_user.get_settings_by_keys(options)
|
14
14
|
def get_settings_by_keys(options)
|
15
|
-
|
15
|
+
@client.raw('get', "/config/settings/by-keys", options)
|
16
16
|
end
|
17
17
|
|
18
18
|
# === Get settings.
|
@@ -21,7 +21,7 @@ module SystemSettings
|
|
21
21
|
# ==== Example
|
22
22
|
# @data = @mints_user.get_settings
|
23
23
|
def get_settings
|
24
|
-
|
24
|
+
@client.raw('get', "/config/settings")
|
25
25
|
end
|
26
26
|
|
27
27
|
# === Create setting.
|
@@ -32,11 +32,11 @@ module SystemSettings
|
|
32
32
|
#
|
33
33
|
# ==== Example
|
34
34
|
# data = {
|
35
|
-
#
|
35
|
+
# title: "new_settings"
|
36
36
|
# }
|
37
37
|
# @data = @mints_user.create_setting(data)
|
38
38
|
def create_setting(data)
|
39
|
-
|
39
|
+
@client.raw('post', "/config/settings", nil, data_transform(data))
|
40
40
|
end
|
41
41
|
|
42
42
|
# === Clear tag.
|
@@ -48,6 +48,6 @@ module SystemSettings
|
|
48
48
|
# ==== Example
|
49
49
|
# @data = @mints_user.clear_tag(1)
|
50
50
|
def clear_tag(tag)
|
51
|
-
|
51
|
+
@client.raw('get', "/config/settings/tags/#{tag}/clear")
|
52
52
|
end
|
53
53
|
end
|
data/lib/user/config/tags.rb
CHANGED
@@ -9,7 +9,7 @@ module Tags
|
|
9
9
|
# ==== Example
|
10
10
|
# @data = @mints_user.get_tags
|
11
11
|
def get_tags
|
12
|
-
|
12
|
+
@client.raw('get', "/config/tags")
|
13
13
|
end
|
14
14
|
|
15
15
|
# === Get tag.
|
@@ -21,7 +21,7 @@ module Tags
|
|
21
21
|
# ==== Example
|
22
22
|
# @data = @mints_user.get_tag(1)
|
23
23
|
def get_tag(id)
|
24
|
-
|
24
|
+
@client.raw('get', "/config/tags/#{id}")
|
25
25
|
end
|
26
26
|
|
27
27
|
# === Create tag.
|
@@ -37,7 +37,7 @@ module Tags
|
|
37
37
|
# }
|
38
38
|
# @data = @mints_user.create_tag(data.to_json)
|
39
39
|
def create_tag(data)
|
40
|
-
|
40
|
+
@client.raw('post', "/config/tags", nil, data)
|
41
41
|
end
|
42
42
|
|
43
43
|
# === Update tag.
|
@@ -51,13 +51,13 @@ module Tags
|
|
51
51
|
# data = {
|
52
52
|
# "tag": {
|
53
53
|
# "tag": "new-tag",
|
54
|
-
#
|
54
|
+
# slug: "new-tag",
|
55
55
|
# "is_visible": false
|
56
56
|
# }
|
57
57
|
# }
|
58
58
|
# @data = @mints_user.update_tag(54, data.to_json)
|
59
59
|
def update_tag(id, data)
|
60
60
|
#TODO: Inform TagController.update method has been modified
|
61
|
-
|
61
|
+
@client.raw('put', "/config/tags/#{id}", nil, data)
|
62
62
|
end
|
63
63
|
end
|