mints 0.0.27 → 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 +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
@@ -1,104 +1,104 @@
|
|
1
1
|
module ProductTemplates
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
##
|
3
|
+
# == Product Templates
|
4
|
+
#
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
# === Get product templates support data from product.
|
7
|
+
# Get product templates support data from a product.
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# id:: (Integer) -- Product id.
|
11
|
+
#
|
12
|
+
# ==== Example
|
13
|
+
# @data = @mints_user.get_product_templates_support_data_from_product(1)
|
14
|
+
def get_product_templates_support_data_from_product(id)
|
15
|
+
@client.raw('get', "/ecommerce/product-templates/support-data/products/#{id}")
|
16
|
+
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
18
|
+
# === Get product templates support data from order items group.
|
19
|
+
# Get product templates support data from a order items group.
|
20
|
+
#
|
21
|
+
# ==== Parameters
|
22
|
+
# id:: (Integer) -- Order items group id.
|
23
|
+
#
|
24
|
+
# ==== Example
|
25
|
+
# @data = @mints_user.get_product_templates_support_data_from_order_items_group(1)
|
26
|
+
def get_product_templates_support_data_from_order_items_group(id)
|
27
|
+
@client.raw('get', "/ecommerce/product-templates/support-data/order-items-groups/#{id}")
|
28
|
+
end
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
# === Get product templates.
|
40
|
-
# Get a collection of product templates.
|
41
|
-
#
|
42
|
-
# ==== Parameters
|
43
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
44
|
-
#
|
45
|
-
# ==== First Example
|
46
|
-
# @data = @mints_user.get_product_templates
|
47
|
-
#
|
48
|
-
# ==== Second Example
|
49
|
-
# options = { "fields": "title" }
|
50
|
-
# @data = @mints_user.get_product_templates(options)
|
51
|
-
def get_product_templates(options = nil)
|
52
|
-
@client.raw("get", "/ecommerce/product-templates", options)
|
53
|
-
end
|
30
|
+
# === Get product templates support data.
|
31
|
+
# Get support data used in product templates.
|
32
|
+
#
|
33
|
+
# ==== Example
|
34
|
+
# @data = @mints_user.get_product_templates_support_data
|
35
|
+
def get_product_templates_support_data
|
36
|
+
@client.raw('get', "/ecommerce/product-templates/support-data")
|
37
|
+
end
|
54
38
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
39
|
+
# === Get product templates.
|
40
|
+
# Get a collection of product templates.
|
41
|
+
#
|
42
|
+
# ==== Parameters
|
43
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
44
|
+
#
|
45
|
+
# ==== First Example
|
46
|
+
# @data = @mints_user.get_product_templates
|
47
|
+
#
|
48
|
+
# ==== Second Example
|
49
|
+
# options = { fields: 'title' }
|
50
|
+
# @data = @mints_user.get_product_templates(options)
|
51
|
+
def get_product_templates(options = nil)
|
52
|
+
@client.raw('get', '/ecommerce/product-templates', options)
|
53
|
+
end
|
54
|
+
|
55
|
+
# === Get product template.
|
56
|
+
# Get a product template info.
|
57
|
+
#
|
58
|
+
# ==== Parameters
|
59
|
+
# id:: (Integer) -- Product template id.
|
60
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
61
|
+
#
|
62
|
+
# ==== First Example
|
63
|
+
# @data = @mints_user.get_product_template(1)
|
64
|
+
#
|
65
|
+
# ==== Second Example
|
66
|
+
# options = { fields: 'title' }
|
67
|
+
# @data = @mints_user.get_product_template(1, options)
|
68
|
+
def get_product_template(id, options = nil)
|
69
|
+
@client.raw('get', "/ecommerce/product-templates/#{id}", options)
|
70
|
+
end
|
71
|
+
|
72
|
+
# === Create product template.
|
73
|
+
# Create a product template with data.
|
74
|
+
#
|
75
|
+
# ==== Parameters
|
76
|
+
# data:: (Hash) -- Data to be submitted.
|
77
|
+
#
|
78
|
+
# ==== Example
|
79
|
+
# data = {
|
80
|
+
# title: 'New Product Template',
|
81
|
+
# slug: 'new-product-template'
|
82
|
+
# }
|
83
|
+
# @data = @mints_user.create_product_template(data)
|
84
|
+
def create_product_template(data)
|
85
|
+
@client.raw('post', '/ecommerce/product-templates/', nil, data_transform(data))
|
86
|
+
end
|
87
|
+
|
88
|
+
# === Update product template.
|
89
|
+
# Update a product template info.
|
90
|
+
#
|
91
|
+
# ==== Parameters
|
92
|
+
# id:: (Integer) -- Product template id.
|
93
|
+
# data:: (Hash) -- Data to be submitted.
|
94
|
+
#
|
95
|
+
# ==== Example
|
96
|
+
# data = {
|
97
|
+
# title: 'New Product Template Modified',
|
98
|
+
# slug: 'new-product-template'
|
99
|
+
# }
|
100
|
+
# @data = @mints_user.update_product_template(3, data)
|
101
|
+
def update_product_template(id, data)
|
102
|
+
@client.raw('put', "/ecommerce/product-templates/#{id}", nil, data_transform(data))
|
103
|
+
end
|
104
|
+
end
|
@@ -1,129 +1,131 @@
|
|
1
1
|
module ProductVariations
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
##
|
3
|
+
# == Product Variation
|
4
|
+
#
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
# === Generate product variation.
|
7
|
+
# Generate a product variation.
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# product_id:: (Integer) -- Product id.
|
11
|
+
# data:: (Hash) -- Data to be submitted.
|
12
|
+
#
|
13
|
+
def generate_product_variation(product_id, data)
|
14
|
+
# TODO: Research use
|
15
|
+
# TODO: Notify line 247 had a '/' before Exception
|
16
|
+
@client.raw('post', "/ecommerce/product-variations/generate/#{product_id}", nil, data_transform(data))
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
19
|
+
# === Set prices to product variations.
|
20
|
+
# Set prices to product variations.
|
21
|
+
#
|
22
|
+
# ==== Parameters
|
23
|
+
# data:: (Hash) -- Data to be submitted.
|
24
|
+
#
|
25
|
+
# ==== Example
|
26
|
+
# skus = [
|
27
|
+
# { id: 100 }
|
28
|
+
# ]
|
29
|
+
# prices = [
|
30
|
+
# { id: 1, value: 1259 },
|
31
|
+
# { id: 2, value: 1260 }
|
32
|
+
# ]
|
33
|
+
# data = {
|
34
|
+
# skus: skus,
|
35
|
+
# prices: prices
|
36
|
+
# }.to_json
|
37
|
+
#
|
38
|
+
# @data = @mints_user.set_prices_to_product_variations(data)
|
39
|
+
def set_prices_to_product_variations(data)
|
40
|
+
@client.raw('post', '/ecommerce/product-variations/set-prices', nil, data_transform(data))
|
41
|
+
end
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
43
|
+
# === Get product from product variation.
|
44
|
+
# Get a product from a product variation.
|
45
|
+
#
|
46
|
+
# ==== Parameters
|
47
|
+
# product_id:: (Integer) -- Product id.
|
48
|
+
#
|
49
|
+
# ==== Example
|
50
|
+
# @data = @mints_user.get_product_from_product_variation(1)
|
51
|
+
def get_product_from_product_variation(product_id)
|
52
|
+
@client.raw('get', "/ecommerce/product-variations/product/#{product_id}")
|
53
|
+
end
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
55
|
+
# === Get product variations.
|
56
|
+
# Get a collection of product variations.
|
57
|
+
#
|
58
|
+
# ==== Parameters
|
59
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
60
|
+
#
|
61
|
+
# ==== Example
|
62
|
+
# @data = @mints_user.get_product_variations
|
63
|
+
def get_product_variations
|
64
|
+
@client.raw('get', '/ecommerce/product-variations')
|
65
|
+
end
|
64
66
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
67
|
+
# === Get product variation.
|
68
|
+
# Get a product variation info.
|
69
|
+
#
|
70
|
+
# ==== Parameters
|
71
|
+
# id:: (Integer) -- Product variation id.
|
72
|
+
#
|
73
|
+
# ==== Example
|
74
|
+
# @data = @mints_user.get_product_variation(100)
|
75
|
+
def get_product_variation(id)
|
76
|
+
@client.raw('get', "/ecommerce/product-variations/#{id}")
|
77
|
+
end
|
76
78
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
79
|
+
# === Create product variation.
|
80
|
+
# Create a product variation with data.
|
81
|
+
#
|
82
|
+
# ==== Parameters
|
83
|
+
# data:: (Hash) -- Data to be submitted.
|
84
|
+
#
|
85
|
+
# ==== Example
|
86
|
+
# data = {
|
87
|
+
# title: 'New Product Variation',
|
88
|
+
# sku: 'NEW-PRODUCT-VARIATION-SKU',
|
89
|
+
# product_id: 5,
|
90
|
+
# supplier: 36,
|
91
|
+
# prices: [
|
92
|
+
# { id: 1, value: 300 }
|
93
|
+
# ]
|
94
|
+
# }
|
95
|
+
# @data = @mints_user.create_product_variation(data)
|
96
|
+
def create_product_variation(data)
|
97
|
+
@client.raw('post', '/ecommerce/product-variations', nil, data_transform(data))
|
98
|
+
end
|
97
99
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
100
|
+
# === Update product variation.
|
101
|
+
# Update a product variation info.
|
102
|
+
#
|
103
|
+
# ==== Parameters
|
104
|
+
# id:: (Integer) -- Product variation id.
|
105
|
+
# data:: (Hash) -- Data to be submitted.
|
106
|
+
#
|
107
|
+
# ==== Example
|
108
|
+
# data = {
|
109
|
+
# title: 'New Product Variation Modified',
|
110
|
+
# cost: 123,
|
111
|
+
# prices: [
|
112
|
+
# { id: 1, value: 400 }
|
113
|
+
# ]
|
114
|
+
# }
|
115
|
+
# @data = @mints_user.update_product_variation(528, data)
|
116
|
+
def update_product_variation(id, data)
|
117
|
+
@client.raw('put', "/ecommerce/product-variations/#{id}", nil, data_transform(data))
|
118
|
+
end
|
117
119
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
end
|
120
|
+
# === Delete product variation.
|
121
|
+
# Delete a product variation.
|
122
|
+
#
|
123
|
+
# ==== Parameters
|
124
|
+
# id:: (Integer) -- Product variation id.
|
125
|
+
#
|
126
|
+
# ==== Example
|
127
|
+
# @data = @mints_user.delete_product_variation(528)
|
128
|
+
def delete_product_variation(id)
|
129
|
+
@client.raw('delete', "/ecommerce/product-variations/#{id}")
|
130
|
+
end
|
131
|
+
end
|