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/content/pages.rb
CHANGED
@@ -1,90 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Pages
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Content Pages
|
6
|
+
#
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
###
|
9
|
+
# === Get page groups.
|
10
|
+
# Get content page groups.
|
11
|
+
#
|
12
|
+
# ==== Example
|
13
|
+
# @data = @mints_user.get_page_groups
|
14
|
+
def get_page_groups
|
15
|
+
@client.raw('get', '/content/pages/groups')
|
16
|
+
end
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
# === Get pages.
|
19
|
+
# Get a collection of content pages.
|
20
|
+
#
|
21
|
+
# ==== Example
|
22
|
+
# @data = @mints_user.get_pages
|
23
|
+
def get_pages(options = nil)
|
24
|
+
@client.raw('get', '/content/pages', options)
|
25
|
+
end
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
# === Get bundles.
|
28
|
+
# Get a collection of content pages.
|
29
|
+
#
|
30
|
+
# ==== Example
|
31
|
+
# @data = @mints_user.get_pages
|
32
|
+
def get_bundles(options = nil)
|
33
|
+
@client.raw('get', '/content/pages', options)
|
34
|
+
end
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
# === Get page.
|
37
|
+
# Get a content page.
|
38
|
+
#
|
39
|
+
# ==== Parameters
|
40
|
+
# id:: (Integer) -- Page id.
|
41
|
+
#
|
42
|
+
# ==== Example
|
43
|
+
# @data = @mints_user.get_page(1)
|
44
|
+
def get_page(id)
|
45
|
+
@client.raw('get', "/content/pages/#{id}")
|
46
|
+
end
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
48
|
+
# === Create page.
|
49
|
+
# Create a content page with data.
|
50
|
+
#
|
51
|
+
# ==== Parameters
|
52
|
+
# data:: (Hash) -- Data to be submitted.
|
53
|
+
#
|
54
|
+
# ==== Example
|
55
|
+
# data = {
|
56
|
+
# title: "New Page",
|
57
|
+
# slug: "new-page-slug",
|
58
|
+
# description: "New page description"
|
59
|
+
# }
|
60
|
+
# @data = @mints_user.create_page(data)
|
61
|
+
def create_page(data)
|
62
|
+
@client.raw('post', '/content/pages', nil, data_transform(data))
|
63
|
+
end
|
62
64
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
65
|
+
# === Update page.
|
66
|
+
# Update a content page info.
|
67
|
+
#
|
68
|
+
# ==== Parameters
|
69
|
+
# id:: (Integer) -- Page id.
|
70
|
+
# data:: (Hash) -- Data to be submitted.
|
71
|
+
#
|
72
|
+
# ==== Example
|
73
|
+
# data = {
|
74
|
+
# title: "New Page Modified"
|
75
|
+
# }
|
76
|
+
# @data = @mints_user.update_page(5, data.to_json)
|
77
|
+
def update_page(id, data)
|
78
|
+
@client.raw('put', "/content/pages/#{id}", nil, data)
|
79
|
+
end
|
78
80
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
end
|
81
|
+
# === Delete page.
|
82
|
+
# Delete a content page.
|
83
|
+
#
|
84
|
+
# ==== Parameters
|
85
|
+
# id:: (Integer) -- Page id.
|
86
|
+
#
|
87
|
+
# ==== Example
|
88
|
+
# @mints_user.@mints_user.delete_page(3)
|
89
|
+
def delete_page(id)
|
90
|
+
@client.raw('delete', "/content/pages/#{id}")
|
91
|
+
end
|
92
|
+
end
|
data/lib/user/content/stories.rb
CHANGED
@@ -1,107 +1,107 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Stories
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
@client.raw("post", "/content/stories/#{id}/duplicate", nil, data)
|
16
|
-
end
|
4
|
+
# === Duplicate story.
|
5
|
+
# Duplicate a story.
|
6
|
+
#
|
7
|
+
# ==== Parameters
|
8
|
+
# id:: (Integer) -- Story id.
|
9
|
+
# data:: (Hash) -- Data to be submitted.
|
10
|
+
#
|
11
|
+
# ==== Example
|
12
|
+
# data = { options: [] }
|
13
|
+
# @data = @mints_user.duplicate_story(1, data.to_json)
|
14
|
+
def duplicate_story(id, data)
|
15
|
+
@client.raw('post', "/content/stories/#{id}/duplicate", nil, data)
|
16
|
+
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
18
|
+
# === Get stories.
|
19
|
+
# Get a collection of stories.
|
20
|
+
#
|
21
|
+
# ==== Parameters
|
22
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
23
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
24
|
+
#
|
25
|
+
# ==== First Example
|
26
|
+
# @data = @mints_user.get_stories
|
27
|
+
#
|
28
|
+
# ==== Second Example
|
29
|
+
# options = {
|
30
|
+
# fields: 'id, slug'
|
31
|
+
# }
|
32
|
+
# @data = @mints_user.get_stories(options)
|
33
|
+
#
|
34
|
+
# ==== Third Example
|
35
|
+
# options = {
|
36
|
+
# fields: 'id, slug'
|
37
|
+
# }
|
38
|
+
# @data = @mints_user.get_stories(options, true)
|
39
|
+
def get_stories(options = nil, use_post = true)
|
40
|
+
get_query_results('/content/stories', options, use_post)
|
41
|
+
end
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
43
|
+
# === Get story.
|
44
|
+
# Get a story info.
|
45
|
+
#
|
46
|
+
# ==== Parameters
|
47
|
+
# id:: (Integer) -- Story id.
|
48
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
49
|
+
#
|
50
|
+
# ==== First Example
|
51
|
+
# @data = @mints_user.get_story(1)
|
52
|
+
#
|
53
|
+
# ==== Second Example
|
54
|
+
# options = {
|
55
|
+
# fields: 'id, slug'
|
56
|
+
# }
|
57
|
+
# @data = @mints_user.get_story(1, options)
|
58
|
+
def get_story(id, options = nil)
|
59
|
+
@client.raw('get', "/content/stories/#{id}", options)
|
60
|
+
end
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
62
|
+
# === Create story.
|
63
|
+
# Create a story with data.
|
64
|
+
#
|
65
|
+
# ==== Parameters
|
66
|
+
# data:: (Hash) -- Data to be submitted.
|
67
|
+
#
|
68
|
+
# ==== Example
|
69
|
+
# data = {
|
70
|
+
# user_id: 1,
|
71
|
+
# slug: "new-story",
|
72
|
+
# story_template_id: 1
|
73
|
+
# }
|
74
|
+
# @data = @mints_user.create_story(data)
|
75
|
+
def create_story(data)
|
76
|
+
@client.raw('post', '/content/stories', nil, data_transform(data))
|
77
|
+
end
|
78
78
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
79
|
+
# === Update story.
|
80
|
+
# Update a story info.
|
81
|
+
#
|
82
|
+
# ==== Parameters
|
83
|
+
# id:: (Integer) -- Story id.
|
84
|
+
# data:: (Hash) -- Data to be submitted.
|
85
|
+
#
|
86
|
+
# ==== Example
|
87
|
+
# data = {
|
88
|
+
# user_id: 1,
|
89
|
+
# slug: 'new-story'
|
90
|
+
# }
|
91
|
+
# @data = @mints_user.update_story(5, data)
|
92
|
+
def update_story(id, data)
|
93
|
+
@client.raw('put', "/content/stories/#{id}", nil, data_transform(data))
|
94
|
+
end
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
end
|
96
|
+
# === Delete story.
|
97
|
+
# Delete a story.
|
98
|
+
#
|
99
|
+
# ==== Parameters
|
100
|
+
# id:: (Integer) -- Story id.
|
101
|
+
#
|
102
|
+
# ==== Example
|
103
|
+
# @data = @mints_user.delete_story(6)
|
104
|
+
def delete_story(id)
|
105
|
+
@client.raw('delete', "/content/stories/#{id}")
|
106
|
+
end
|
107
|
+
end
|
@@ -1,95 +1,97 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module StoryTemplates
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Story Template
|
6
|
+
#
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
# === Get support data of story template.
|
9
|
+
# Get support data used in a story template.
|
10
|
+
#
|
11
|
+
# ==== Parameters
|
12
|
+
# id:: (Integer) -- Story template id.
|
13
|
+
#
|
14
|
+
# ==== Example
|
15
|
+
# @data = @mints_user.get_story_template_support_data(1)
|
16
|
+
def get_story_template_support_data(id)
|
17
|
+
@client.raw('get', "/content/story-templates/support-data/stories/#{id}")
|
18
|
+
end
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
# === Get support data of story templates.
|
21
|
+
# Get support data used in story templates.
|
22
|
+
#
|
23
|
+
# ==== Example
|
24
|
+
# @data = @mints_user.get_story_templates_support_data
|
25
|
+
def get_story_templates_support_data
|
26
|
+
@client.raw('get', '/content/story-templates/support-data')
|
27
|
+
end
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
29
|
+
# === Get story templates.
|
30
|
+
# Get a collection of story templates.
|
31
|
+
#
|
32
|
+
# ==== Parameters
|
33
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
34
|
+
#
|
35
|
+
# ==== First Example
|
36
|
+
# @data = @mints_user.get_story_templates
|
37
|
+
#
|
38
|
+
# ==== Second Example
|
39
|
+
# options = {
|
40
|
+
# fields: 'id, title'
|
41
|
+
# }
|
42
|
+
# @data = @mints_user.get_story_templates(options)
|
43
|
+
def get_story_templates(options = nil)
|
44
|
+
@client.raw('get', '/content/story-templates', options)
|
45
|
+
end
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
47
|
+
# === Get story template.
|
48
|
+
# Get a story template info.
|
49
|
+
#
|
50
|
+
# ==== Parameters
|
51
|
+
# id:: (Integer) -- Story template id.
|
52
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
53
|
+
#
|
54
|
+
# ==== First Example
|
55
|
+
# @data = @mints_user.get_story_template(2)
|
56
|
+
#
|
57
|
+
# ==== Second Example
|
58
|
+
# options = {
|
59
|
+
# fields: 'title'
|
60
|
+
# }
|
61
|
+
# @data = @mints_user.get_story_template(1, options)
|
62
|
+
def get_story_template(id, options = nil)
|
63
|
+
@client.raw('get', "/content/story-templates/#{id}", options)
|
64
|
+
end
|
63
65
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
66
|
+
# === Create story template.
|
67
|
+
# Create a story template with data.
|
68
|
+
#
|
69
|
+
# ==== Parameters
|
70
|
+
# data:: (Hash) -- Data to be submitted.
|
71
|
+
#
|
72
|
+
# ==== Example
|
73
|
+
# data = {
|
74
|
+
# title: 'New Story Template',
|
75
|
+
# slug: 'new-story-template-slug'
|
76
|
+
# }
|
77
|
+
# @data = @mints_user.create_story_template(data)
|
78
|
+
def create_story_template(data)
|
79
|
+
@client.raw('post', '/content/story-templates', nil, data_transform(data))
|
80
|
+
end
|
79
81
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
end
|
82
|
+
# === Update story template.
|
83
|
+
# Update a story template info.
|
84
|
+
#
|
85
|
+
# ==== Parameters
|
86
|
+
# id:: (Integer) -- Story template id.
|
87
|
+
# data:: (Hash) -- Data to be submitted.
|
88
|
+
#
|
89
|
+
# ==== Example
|
90
|
+
# data = {
|
91
|
+
# title: 'New Story Template Modified'
|
92
|
+
# }
|
93
|
+
# @data = @mints_user.update_story_template(3, data)
|
94
|
+
def update_story_template(id, data)
|
95
|
+
@client.raw('put', "/content/story-templates/#{id}", nil, data_transform(data))
|
96
|
+
end
|
97
|
+
end
|