mints 0.0.28 → 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.
- checksums.yaml +4 -4
- 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 +54 -603
- data/lib/errors.rb +3 -1
- data/lib/generators/mints_assets_controller.rb +4 -1
- data/lib/generators/mints_contact_controller.rb +4 -1
- data/lib/generators/mints_files_generator.rb +16 -13
- data/lib/generators/mints_link.rb +7 -4
- 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 +35 -53
- 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 +2 -0
- data/lib/user/config/users.rb +2 -0
- data/lib/user/contacts/contacts.rb +2 -0
- data/lib/user/content/assets.rb +3 -3
- data/lib/user/content/content.rb +224 -223
- data/lib/user/content/content_instances.rb +4 -2
- data/lib/user/content/content_templates.rb +2 -0
- data/lib/user/content/conversations.rb +2 -0
- data/lib/user/content/dam.rb +2 -0
- data/lib/user/content/forms.rb +2 -0
- data/lib/user/content/message_templates.rb +2 -0
- data/lib/user/content/messages.rb +2 -0
- data/lib/user/content/pages.rb +4 -2
- data/lib/user/content/stories.rb +3 -3
- data/lib/user/content/story_templates.rb +5 -3
- data/lib/user/content/story_versions.rb +2 -0
- data/lib/user/crm/companies.rb +3 -1
- data/lib/user/crm/contacts.rb +2 -0
- data/lib/user/crm/crm.rb +2 -0
- data/lib/user/crm/deals.rb +2 -0
- data/lib/user/crm/favorites.rb +2 -0
- data/lib/user/crm/segments.rb +2 -0
- data/lib/user/crm/users.rb +2 -0
- data/lib/user/crm/workflow_step_objects.rb +2 -0
- data/lib/user/crm/workflow_steps.rb +2 -0
- data/lib/user/crm/workflows.rb +2 -0
- data/lib/user/ecommerce/ecommerce.rb +2 -0
- data/lib/user/ecommerce/item_prices.rb +2 -0
- data/lib/user/ecommerce/locations.rb +2 -0
- data/lib/user/ecommerce/order_items_groups.rb +5 -2
- data/lib/user/ecommerce/order_statuses.rb +2 -0
- data/lib/user/ecommerce/orders.rb +4 -1
- data/lib/user/ecommerce/price_lists.rb +2 -0
- data/lib/user/ecommerce/product_templates.rb +3 -1
- data/lib/user/ecommerce/product_variations.rb +2 -0
- data/lib/user/ecommerce/products.rb +3 -1
- data/lib/user/ecommerce/skus.rb +2 -0
- data/lib/user/ecommerce/taxes.rb +2 -0
- data/lib/user/ecommerce/variant_options.rb +2 -0
- data/lib/user/ecommerce/variant_values.rb +2 -0
- data/lib/user/helpers/helpers.rb +2 -0
- data/lib/user/helpers/object_activities.rb +2 -0
- data/lib/user/helpers/object_folders.rb +2 -0
- data/lib/user/helpers/user_folders.rb +2 -0
- data/lib/user/marketing/marketing.rb +2 -0
- data/lib/user/profile/profile.rb +2 -0
- data/lib/user.rb +32 -41
- metadata +23 -16
- data/lib/user/config/importers.rb +0 -184
data/lib/user/crm/workflows.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module OrderItemsGroups
|
|
2
4
|
##
|
|
3
5
|
# == Order Items Groups
|
|
@@ -13,7 +15,8 @@ module OrderItemsGroups
|
|
|
13
15
|
# ==== Example
|
|
14
16
|
# @data = @mints_user.get_pending_order_template_from_order_item_group(1, 1)
|
|
15
17
|
def get_pending_order_template_from_order_item_group(parent_order_id, order_template_id)
|
|
16
|
-
|
|
18
|
+
url = "/ecommerce/order-items-groups/#{parent_order_id}/pending-items/order-template/#{order_template_id}"
|
|
19
|
+
@client.raw('get', url)
|
|
17
20
|
end
|
|
18
21
|
|
|
19
22
|
# === Get order item group support data by order id.
|
|
@@ -77,7 +80,7 @@ module OrderItemsGroups
|
|
|
77
80
|
# }
|
|
78
81
|
# options = { include: 'orderItems' }
|
|
79
82
|
# @data = @mints_user.create_order_item_group(data, options)
|
|
80
|
-
def create_order_item_group(data,
|
|
83
|
+
def create_order_item_group(data, options = nil)
|
|
81
84
|
@client.raw('post', '/ecommerce/order-items-groups', options, data_transform(data))
|
|
82
85
|
end
|
|
83
86
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Orders
|
|
2
4
|
##
|
|
3
5
|
# == Orders
|
|
@@ -208,7 +210,8 @@ module Orders
|
|
|
208
210
|
#
|
|
209
211
|
def update_order_item_from_order_item_group(order_item_id, group_id, data)
|
|
210
212
|
# TODO: Research use
|
|
211
|
-
|
|
213
|
+
url = "/ecommerce/order-items/update/#{order_item_id}/order-items-groups/#{group_id}"
|
|
214
|
+
@client.raw('put', url, nil, data_transform(data))
|
|
212
215
|
end
|
|
213
216
|
|
|
214
217
|
# === Get order items.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module ProductTemplates
|
|
2
4
|
##
|
|
3
5
|
# == Product Templates
|
|
@@ -33,7 +35,7 @@ module ProductTemplates
|
|
|
33
35
|
# ==== Example
|
|
34
36
|
# @data = @mints_user.get_product_templates_support_data
|
|
35
37
|
def get_product_templates_support_data
|
|
36
|
-
@client.raw('get',
|
|
38
|
+
@client.raw('get', '/ecommerce/product-templates/support-data')
|
|
37
39
|
end
|
|
38
40
|
|
|
39
41
|
# === Get product templates.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Products
|
|
2
4
|
##
|
|
3
5
|
# == Product
|
|
@@ -112,7 +114,7 @@ module Products
|
|
|
112
114
|
# }
|
|
113
115
|
# @data = @mints_user.get_products(options, false)
|
|
114
116
|
def get_products(options = nil, use_post = true)
|
|
115
|
-
get_query_results(
|
|
117
|
+
get_query_results('/ecommerce/products', options, use_post)
|
|
116
118
|
end
|
|
117
119
|
|
|
118
120
|
# === Get product.
|
data/lib/user/ecommerce/skus.rb
CHANGED
data/lib/user/ecommerce/taxes.rb
CHANGED
data/lib/user/helpers/helpers.rb
CHANGED
data/lib/user/profile/profile.rb
CHANGED
data/lib/user.rb
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require_relative './
|
|
4
|
-
require_relative './
|
|
5
|
-
require_relative './user/
|
|
6
|
-
require_relative './user/
|
|
7
|
-
require_relative './user/
|
|
8
|
-
require_relative './user/
|
|
9
|
-
require_relative './user/
|
|
10
|
-
require_relative './user/
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative './client'
|
|
4
|
+
require_relative './mints/helpers/mints_helper'
|
|
5
|
+
require_relative './user/crm/crm'
|
|
6
|
+
require_relative './user/content/content'
|
|
7
|
+
require_relative './user/marketing/marketing'
|
|
8
|
+
require_relative './user/ecommerce/ecommerce'
|
|
9
|
+
require_relative './user/config/config'
|
|
10
|
+
require_relative './user/profile/profile'
|
|
11
|
+
require_relative './user/helpers/helpers'
|
|
12
|
+
require_relative './user/contacts/contacts'
|
|
11
13
|
|
|
12
14
|
module Mints
|
|
13
15
|
##
|
|
@@ -21,21 +23,19 @@ module Mints
|
|
|
21
23
|
# == Single resource options
|
|
22
24
|
# * +include+ - [String] include a relationship
|
|
23
25
|
# * +attributes+ - [Boolean] attach attributes to response
|
|
24
|
-
# * +categories+ - [Boolean] attach categories to response
|
|
25
26
|
# * +tags+ - [Boolean] attach tags to response
|
|
26
|
-
#
|
|
27
|
+
# * +taxonomies+ - [Boolean] attach categories to response
|
|
28
|
+
# == Resource collections options
|
|
27
29
|
# * +search+ - [String] filter by a search word
|
|
28
30
|
# * +scopes+ - [String] filter by a scope
|
|
29
31
|
# * +filters+ - [String] filter by where clauses
|
|
30
|
-
# * +jfilters+ - [String] filter using complex condition objects
|
|
31
|
-
# * +
|
|
32
|
+
# * +jfilters+ - [String] filter using complex condition objects (this filter use mongo queries)
|
|
33
|
+
# * +afilters+ - [String] filter using complex condition objects (this filter use postgresql queries)
|
|
34
|
+
# * +rfilters+ - [String] filter using complex condition objects from relationships
|
|
35
|
+
# * +dfilters+ - [String] filter using conditions based on dates
|
|
32
36
|
# * +fields+ - [String] indicates the columns that will be selected
|
|
33
37
|
# * +sort+ - [String] indicates the columns that will be selected
|
|
34
|
-
|
|
35
|
-
# * +attributes+ - [Boolean] attach attributes to response
|
|
36
|
-
# * +categories+ - [Boolean] attach categories to response
|
|
37
|
-
# * +taxonomies+ - [Boolean] attach categories to response
|
|
38
|
-
# * +tags+ - [Boolean] attach tags to response
|
|
38
|
+
|
|
39
39
|
class User
|
|
40
40
|
include CRM
|
|
41
41
|
include Content
|
|
@@ -45,44 +45,35 @@ module Mints
|
|
|
45
45
|
include Profile
|
|
46
46
|
include Helpers
|
|
47
47
|
include Contacts
|
|
48
|
+
include MintsHelper
|
|
48
49
|
|
|
49
50
|
attr_reader :client
|
|
51
|
+
|
|
50
52
|
def initialize(host, api_key, session_token = nil, debug = false)
|
|
51
53
|
@client = Mints::Client.new(host, api_key, 'user', session_token, nil, nil, debug)
|
|
52
54
|
end
|
|
53
55
|
|
|
54
56
|
def login(email, password)
|
|
55
|
-
data = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
response
|
|
60
|
-
if response.key? "api_token"
|
|
61
|
-
@client.session_token = response["api_token"]
|
|
62
|
-
end
|
|
63
|
-
return response
|
|
57
|
+
data = { email: email, password: password }
|
|
58
|
+
response = @client.raw('post', '/users/login', nil, data.to_json, '/api/v1', { no_content_type: true })
|
|
59
|
+
@client.session_token = response['api_token'] if response.key? 'api_token'
|
|
60
|
+
|
|
61
|
+
response
|
|
64
62
|
end
|
|
65
63
|
|
|
66
64
|
def magic_link_login(token)
|
|
67
|
-
|
|
68
|
-
return response
|
|
65
|
+
@client.raw('get', "/users/magic-link-login/#{token}", nil, nil, '/api/v1')
|
|
69
66
|
end
|
|
70
67
|
|
|
71
68
|
##
|
|
72
69
|
# === Send magic link to user
|
|
73
|
-
def send_magic_link(email,
|
|
70
|
+
def send_magic_link(email, redirect_url = '', life_time = 24)
|
|
74
71
|
data = {
|
|
75
72
|
email: email,
|
|
76
|
-
redirectUrl:
|
|
77
|
-
lifeTime:
|
|
73
|
+
redirectUrl: redirect_url,
|
|
74
|
+
lifeTime: life_time
|
|
78
75
|
}
|
|
79
|
-
|
|
80
|
-
return response
|
|
76
|
+
@client.raw('post', '/users/magic-link', nil, { data: data }, '/api/v1')
|
|
81
77
|
end
|
|
82
|
-
|
|
83
|
-
private
|
|
84
|
-
|
|
85
|
-
include MintsHelper
|
|
86
|
-
|
|
87
|
-
end
|
|
78
|
+
end
|
|
88
79
|
end
|
metadata
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mints
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.29
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ruben Gomez Garcia, Omar Mora, Luis Payan, Oscar Castillo, Fabian Garcia
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-03-
|
|
11
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: addressable
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: 2.7.0
|
|
20
|
-
- - "
|
|
20
|
+
- - "~>"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
22
|
version: 2.7.0
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
|
-
- - "
|
|
27
|
+
- - ">="
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
29
|
version: 2.7.0
|
|
30
|
-
- - "
|
|
30
|
+
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
32
|
version: 2.7.0
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
@@ -68,40 +68,40 @@ dependencies:
|
|
|
68
68
|
name: rails-reverse-proxy
|
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
|
70
70
|
requirements:
|
|
71
|
-
- - "
|
|
71
|
+
- - ">="
|
|
72
72
|
- !ruby/object:Gem::Version
|
|
73
73
|
version: 0.9.1
|
|
74
|
-
- - "
|
|
74
|
+
- - "~>"
|
|
75
75
|
- !ruby/object:Gem::Version
|
|
76
76
|
version: 0.9.1
|
|
77
77
|
type: :runtime
|
|
78
78
|
prerelease: false
|
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
|
80
80
|
requirements:
|
|
81
|
-
- - "
|
|
81
|
+
- - ">="
|
|
82
82
|
- !ruby/object:Gem::Version
|
|
83
83
|
version: 0.9.1
|
|
84
|
-
- - "
|
|
84
|
+
- - "~>"
|
|
85
85
|
- !ruby/object:Gem::Version
|
|
86
86
|
version: 0.9.1
|
|
87
87
|
- !ruby/object:Gem::Dependency
|
|
88
88
|
name: redis
|
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
|
90
90
|
requirements:
|
|
91
|
-
- - "
|
|
91
|
+
- - ">="
|
|
92
92
|
- !ruby/object:Gem::Version
|
|
93
93
|
version: 4.2.2
|
|
94
|
-
- - "
|
|
94
|
+
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: 4.2.2
|
|
97
97
|
type: :runtime
|
|
98
98
|
prerelease: false
|
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- - "
|
|
101
|
+
- - ">="
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
103
|
version: 4.2.2
|
|
104
|
-
- - "
|
|
104
|
+
- - "~>"
|
|
105
105
|
- !ruby/object:Gem::Version
|
|
106
106
|
version: 4.2.2
|
|
107
107
|
description:
|
|
@@ -114,6 +114,14 @@ files:
|
|
|
114
114
|
- README.md
|
|
115
115
|
- lib/client.rb
|
|
116
116
|
- lib/contact.rb
|
|
117
|
+
- lib/contact/config/appointments.rb
|
|
118
|
+
- lib/contact/config/config.rb
|
|
119
|
+
- lib/contact/content/content.rb
|
|
120
|
+
- lib/contact/content/conversations.rb
|
|
121
|
+
- lib/contact/ecommerce/ecommerce.rb
|
|
122
|
+
- lib/contact/ecommerce/order_items.rb
|
|
123
|
+
- lib/contact/ecommerce/order_items_groups.rb
|
|
124
|
+
- lib/contact/ecommerce/orders.rb
|
|
117
125
|
- lib/errors.rb
|
|
118
126
|
- lib/generators/mints_assets_controller.rb
|
|
119
127
|
- lib/generators/mints_config.yml.erb
|
|
@@ -144,7 +152,6 @@ files:
|
|
|
144
152
|
- lib/user/config/attributes.rb
|
|
145
153
|
- lib/user/config/calendars.rb
|
|
146
154
|
- lib/user/config/config.rb
|
|
147
|
-
- lib/user/config/importers.rb
|
|
148
155
|
- lib/user/config/public_folders.rb
|
|
149
156
|
- lib/user/config/relationships.rb
|
|
150
157
|
- lib/user/config/roles.rb
|
|
@@ -217,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
217
224
|
- !ruby/object:Gem::Version
|
|
218
225
|
version: '0'
|
|
219
226
|
requirements: []
|
|
220
|
-
rubygems_version: 3.1
|
|
227
|
+
rubygems_version: 3.0.3.1
|
|
221
228
|
signing_key:
|
|
222
229
|
specification_version: 4
|
|
223
230
|
summary: MINTS gem allows to connect your Rails App to MINTS.CLOUD
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
module Importers
|
|
2
|
-
##
|
|
3
|
-
# == Importers
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
# === Get importers results.
|
|
7
|
-
# Get a results of importers.
|
|
8
|
-
#
|
|
9
|
-
# ==== Parameters
|
|
10
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
11
|
-
#
|
|
12
|
-
# ==== Example
|
|
13
|
-
# options = { "ip_id": 1 }
|
|
14
|
-
# @data = @mints_user.get_importers_results(options)
|
|
15
|
-
def get_importers_results(options) #FIXME: Query doesnt get results. Maybe no data in db.
|
|
16
|
-
@client.raw('get', "/config/importers/results", options)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# === Get importers configuration.
|
|
20
|
-
# Get configurations of importers.
|
|
21
|
-
#
|
|
22
|
-
# ==== Example
|
|
23
|
-
# @data = @mints_user.get_importers_configuration
|
|
24
|
-
def get_importers_configuration
|
|
25
|
-
@client.raw('get', "/config/importers/configuration")
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# === Get importing process status.
|
|
29
|
-
# Get importing process status by importer ids.
|
|
30
|
-
#
|
|
31
|
-
# ==== Parameters
|
|
32
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
33
|
-
#
|
|
34
|
-
# ==== Example
|
|
35
|
-
# options = {
|
|
36
|
-
# "ids": "1,2,3"
|
|
37
|
-
# }
|
|
38
|
-
# @data = @mints_user.get_importing_process_status(options)
|
|
39
|
-
def get_importing_process_status(options = nil)
|
|
40
|
-
@client.raw('get', "/config/importers/importing_process_status", options)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# === Get importers attributes.
|
|
44
|
-
# Get import attributes of modules in a table.
|
|
45
|
-
#
|
|
46
|
-
# ==== Parameters
|
|
47
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
48
|
-
#
|
|
49
|
-
# ==== Example
|
|
50
|
-
# options = {
|
|
51
|
-
# "table": "contacts",
|
|
52
|
-
# "module": "crm"
|
|
53
|
-
# }
|
|
54
|
-
# @data = @mints_user.get_importers_attributes(options)
|
|
55
|
-
def get_importers_attributes(options = nil)
|
|
56
|
-
@client.raw('get', "/config/importers/attributes", options)
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
# === Upload importer.
|
|
60
|
-
# Upload to an importer.
|
|
61
|
-
#
|
|
62
|
-
# ==== Parameters
|
|
63
|
-
# id:: (Integer) -- Importer id.
|
|
64
|
-
# data:: (Hash) -- Data to be submitted.
|
|
65
|
-
#
|
|
66
|
-
# ==== Example
|
|
67
|
-
# data = {
|
|
68
|
-
# "csv": "archive.csv"
|
|
69
|
-
# }
|
|
70
|
-
# @data = @mints_user.upload_importer(1, data.to_json)
|
|
71
|
-
def upload_importer(id, data) #TODO: Search for csv archives
|
|
72
|
-
@client.raw('post', "/config/importers/#{id}/upload", nil, data)
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
# === Import row.
|
|
76
|
-
# Import a row.
|
|
77
|
-
#
|
|
78
|
-
# ==== Parameters
|
|
79
|
-
# data:: (Hash) -- Data to be submitted.
|
|
80
|
-
#
|
|
81
|
-
# ==== Example
|
|
82
|
-
#
|
|
83
|
-
def import_row(data) #TODO: Research use
|
|
84
|
-
@client.raw('post', "/config/importers/import_row", nil, data)
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
# === Remove importers active process.
|
|
88
|
-
# Remove an active process in an importer.
|
|
89
|
-
#
|
|
90
|
-
# ==== Parameters
|
|
91
|
-
# data:: (Hash) -- Data to be submitted.
|
|
92
|
-
#
|
|
93
|
-
# ==== Example
|
|
94
|
-
#
|
|
95
|
-
def remove_importers_active_process(data) #FIXME: Cannot get property 'active_importing_process' of non-object.
|
|
96
|
-
@client.raw('post', "/config/importers/removeActiveProcess", nil, data_transform(data))
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
# === Get importers.
|
|
100
|
-
# Get a collection of importers.
|
|
101
|
-
#
|
|
102
|
-
# ==== Parameters
|
|
103
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
104
|
-
#
|
|
105
|
-
# ==== First Example
|
|
106
|
-
# @data = @mints_user.get_importers
|
|
107
|
-
#
|
|
108
|
-
# ==== Second Example
|
|
109
|
-
# options = { fields: "name" }
|
|
110
|
-
# @data = @mints_user.get_importers(options)
|
|
111
|
-
def get_importers(options = nil)
|
|
112
|
-
@client.raw('get', "/config/importers", options)
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
# === Get importer.
|
|
116
|
-
# Get an importer info.
|
|
117
|
-
#
|
|
118
|
-
# ==== Parameters
|
|
119
|
-
# id:: (Integer) -- Importer id.
|
|
120
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
121
|
-
#
|
|
122
|
-
# ==== First Example
|
|
123
|
-
# @data = @mints_user.get_importer(1)
|
|
124
|
-
#
|
|
125
|
-
# ==== Second Example
|
|
126
|
-
# options = { fields: "name" }
|
|
127
|
-
# @data = @mints_user.get_importer(1, options)
|
|
128
|
-
def get_importer(id, options = nil)
|
|
129
|
-
@client.raw('get', "/config/importers/#{id}", options)
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
# === Create importer.
|
|
133
|
-
# Create an importer with data.
|
|
134
|
-
#
|
|
135
|
-
# ==== Parameters
|
|
136
|
-
# data:: (Hash) -- Data to be submitted.
|
|
137
|
-
#
|
|
138
|
-
# ==== Example
|
|
139
|
-
# data = {
|
|
140
|
-
# "name": "New Importer",
|
|
141
|
-
# "module": "crm"
|
|
142
|
-
# }
|
|
143
|
-
# @data = @mints_user.create_importer(data)
|
|
144
|
-
def create_importer(data)
|
|
145
|
-
@client.raw('post', "/config/importers", nil, data_transform(data))
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
# === Update importer.
|
|
149
|
-
# Update an importer info.
|
|
150
|
-
#
|
|
151
|
-
# ==== Parameters
|
|
152
|
-
# id:: (Integer) -- Importer id.
|
|
153
|
-
# data:: (Hash) -- Data to be submitted.
|
|
154
|
-
#
|
|
155
|
-
# ==== Example
|
|
156
|
-
# data = {
|
|
157
|
-
# "name": "New Importer Modified"
|
|
158
|
-
# }
|
|
159
|
-
# @data = @mints_user.update_importer(4, data)
|
|
160
|
-
def update_importer(id, data)
|
|
161
|
-
@client.raw('put', "/config/importers/#{id}", nil, data_transform(data))
|
|
162
|
-
end
|
|
163
|
-
|
|
164
|
-
# === Delete importer.
|
|
165
|
-
# Delete a importer.
|
|
166
|
-
#
|
|
167
|
-
# ==== Parameters
|
|
168
|
-
# id:: (Integer) -- Importer id.
|
|
169
|
-
#
|
|
170
|
-
# ==== Example
|
|
171
|
-
# @data = @mints_user.delete_importer(4)
|
|
172
|
-
def delete_importer(id)
|
|
173
|
-
@client.raw('delete', "/config/importers/#{id}")
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
# === Get importers pusher key.
|
|
177
|
-
# Get the pusher key of importers.
|
|
178
|
-
#
|
|
179
|
-
# ==== Example
|
|
180
|
-
# @data = @mints_user.get_importers_pusher_key
|
|
181
|
-
def get_importers_pusher_key
|
|
182
|
-
@client.raw('get', "/config/pusher_key")
|
|
183
|
-
end
|
|
184
|
-
end
|