mints 0.0.29 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +290 -32
- data/lib/contact/config/appointments.rb +1 -1
- data/lib/contact/config/config.rb +2 -2
- data/lib/contact/content/content.rb +2 -2
- data/lib/contact/content/conversations.rb +2 -2
- data/lib/contact/ecommerce/ecommerce.rb +6 -4
- data/lib/contact/ecommerce/order_items.rb +1 -1
- data/lib/contact/ecommerce/order_items_groups.rb +1 -1
- data/lib/contact/ecommerce/orders.rb +1 -2
- data/lib/contact/ecommerce/vouchers.rb +18 -0
- data/lib/contact.rb +9 -3
- data/lib/errors.rb +1 -1
- data/lib/mints/controllers/concerns/mints_clients.rb +3 -1
- data/lib/mints/helpers/contact_auth_helper.rb +2 -2
- data/lib/mints/helpers/proxy_controllers_methods.rb +1 -1
- data/lib/pub/config/attributes.rb +13 -0
- data/lib/pub/config/config.rb +15 -0
- data/lib/pub/config/public_folders.rb +51 -0
- data/lib/pub/config/tags.rb +42 -0
- data/lib/pub/config/taxonomies.rb +49 -0
- data/lib/pub/content/assets.rb +16 -0
- data/lib/pub/content/content.rb +22 -0
- data/lib/pub/content/content_bundles.rb +40 -0
- data/lib/pub/content/content_instance_versions.rb +56 -0
- data/lib/pub/content/content_instances.rb +37 -0
- data/lib/pub/content/forms.rb +47 -0
- data/lib/pub/content/stories.rb +44 -0
- data/lib/pub/content/story_versions.rb +46 -0
- data/lib/pub/ecommerce/ecommerce.rb +14 -0
- data/lib/pub/ecommerce/locations.rb +25 -0
- data/lib/pub/ecommerce/orders.rb +31 -0
- data/lib/pub/ecommerce/products.rb +45 -0
- data/lib/pub.rb +6 -427
- data/lib/user/config/config.rb +1 -1
- data/lib/user/config/public_folders.rb +1 -1
- data/lib/user/config/users.rb +4 -4
- data/lib/user/content/content.rb +0 -55
- data/lib/user/content/forms.rb +4 -4
- data/lib/user/content/messages.rb +4 -4
- data/lib/user/content/stories.rb +8 -5
- data/lib/user/content/story_templates.rb +2 -2
- data/lib/user/crm/contacts.rb +0 -13
- data/lib/user/crm/workflow_steps.rb +4 -4
- data/lib/user/crm/workflows.rb +4 -4
- data/lib/user/ecommerce/ecommerce.rb +2 -0
- data/lib/user/ecommerce/locations.rb +2 -2
- data/lib/user/ecommerce/order_items_groups.rb +2 -2
- data/lib/user/ecommerce/skus.rb +2 -2
- data/lib/user/ecommerce/vouchers.rb +90 -0
- metadata +21 -2
data/lib/user/crm/workflows.rb
CHANGED
@@ -50,8 +50,8 @@ module Workflows
|
|
50
50
|
# object_type: 'deals'
|
51
51
|
# }
|
52
52
|
# @data = @mints_user.create_workflow(data.to_json)
|
53
|
-
def create_workflow(data)
|
54
|
-
@client.raw('post', '/crm/workflows/',
|
53
|
+
def create_workflow(data, options = nil)
|
54
|
+
@client.raw('post', '/crm/workflows/', options, data)
|
55
55
|
end
|
56
56
|
|
57
57
|
# === Update workflow.
|
@@ -66,7 +66,7 @@ module Workflows
|
|
66
66
|
# title: 'New Workflow Modified'
|
67
67
|
# }
|
68
68
|
# @data = @mints_user.update_workflow(7, data)
|
69
|
-
def update_workflow(id, data)
|
70
|
-
@client.raw('put', "/crm/workflows/#{id}",
|
69
|
+
def update_workflow(id, data, options = nil)
|
70
|
+
@client.raw('put', "/crm/workflows/#{id}", options, correct_json(data))
|
71
71
|
end
|
72
72
|
end
|
@@ -13,6 +13,7 @@ require_relative './skus'
|
|
13
13
|
require_relative './taxes'
|
14
14
|
require_relative './variant_options'
|
15
15
|
require_relative './variant_values'
|
16
|
+
require_relative './vouchers'
|
16
17
|
|
17
18
|
module Ecommerce
|
18
19
|
include ItemPrices
|
@@ -28,4 +29,5 @@ module Ecommerce
|
|
28
29
|
include Taxes
|
29
30
|
include VariantOptions
|
30
31
|
include VariantValues
|
32
|
+
include Vouchers
|
31
33
|
end
|
@@ -31,8 +31,8 @@ module Locations
|
|
31
31
|
#
|
32
32
|
# ==== Example
|
33
33
|
# @data = @mints_user.get_location(2)
|
34
|
-
def get_location(id)
|
35
|
-
@client.raw('get', "/ecommerce/locations/#{id}")
|
34
|
+
def get_location(id, options = nil)
|
35
|
+
@client.raw('get', "/ecommerce/locations/#{id}", options)
|
36
36
|
end
|
37
37
|
|
38
38
|
# === Create location.
|
@@ -96,8 +96,8 @@ module OrderItemsGroups
|
|
96
96
|
# name: 'New Order Item Group Modified'
|
97
97
|
# }
|
98
98
|
# @data = @mints_user.update_order_item_group(147, data)
|
99
|
-
def update_order_item_group(id, data)
|
100
|
-
@client.raw('put', "/ecommerce/order-items-groups/#{id}",
|
99
|
+
def update_order_item_group(id, data, options = nil)
|
100
|
+
@client.raw('put', "/ecommerce/order-items-groups/#{id}", options, data_transform(data))
|
101
101
|
end
|
102
102
|
|
103
103
|
# === Delete order item group.
|
data/lib/user/ecommerce/skus.rb
CHANGED
@@ -56,8 +56,8 @@ module Skus
|
|
56
56
|
# product_id: 1
|
57
57
|
# }
|
58
58
|
# @data = @mints_user.create_sku(data)
|
59
|
-
def create_sku(data)
|
60
|
-
@client.raw('post', '/ecommerce/skus',
|
59
|
+
def create_sku(data, options = nil)
|
60
|
+
@client.raw('post', '/ecommerce/skus', options, data_transform(data))
|
61
61
|
end
|
62
62
|
|
63
63
|
# === Update sku.
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Vouchers
|
4
|
+
##
|
5
|
+
# === Get vouchers.
|
6
|
+
# Get a collection of vouchers.
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
10
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
11
|
+
#
|
12
|
+
# ==== First Example
|
13
|
+
#
|
14
|
+
# @data = @mints_user.get_vouchers
|
15
|
+
# ==== Second Example
|
16
|
+
#
|
17
|
+
# options = { fields: 'id,title' }
|
18
|
+
# @data = @mints_user.get_vouchers(options)
|
19
|
+
# ==== Third Example
|
20
|
+
#
|
21
|
+
# options = { fields: 'id,title' }
|
22
|
+
# @data = @mints_user.get_vouchers(options, true)
|
23
|
+
#
|
24
|
+
def get_vouchers(options = nil, use_post = true)
|
25
|
+
get_query_results('/ecommerce/vouchers', options, use_post)
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# === Get vouchers.
|
30
|
+
# Get a specific voucher.
|
31
|
+
#
|
32
|
+
# ==== Parameters
|
33
|
+
# id:: (Integer) -- Voucher id.
|
34
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
35
|
+
#
|
36
|
+
# ==== First Example
|
37
|
+
#
|
38
|
+
# @data = @mints_user.get_voucher(1)
|
39
|
+
# ==== Second Example
|
40
|
+
#
|
41
|
+
# options = { fields: 'id,title' }
|
42
|
+
# @data = @mints_user.get_voucher(1, options)
|
43
|
+
def get_voucher(id, options = nil)
|
44
|
+
@client.raw('get', "/ecommerce/vouchers/#{id}", options)
|
45
|
+
end
|
46
|
+
|
47
|
+
##
|
48
|
+
# === Create voucher.
|
49
|
+
# Create voucher code.
|
50
|
+
#
|
51
|
+
# ==== Parameters
|
52
|
+
# data:: (Hash) -- Data to be submitted.
|
53
|
+
#
|
54
|
+
# ==== Example
|
55
|
+
# data = {
|
56
|
+
# title: 'Voucher title',
|
57
|
+
# voucher_code: 'XAZWQ12MP',
|
58
|
+
# amount: 100,
|
59
|
+
# start_date: '2023-03-28T10:20:00-06:00',
|
60
|
+
# end_date: '2023-03-31T10:20:00-06:00',
|
61
|
+
# is_redeemed: false
|
62
|
+
# }
|
63
|
+
#
|
64
|
+
# @data = @mints_user.create_voucher(data)
|
65
|
+
def create_voucher(data)
|
66
|
+
@client.raw('post', '/ecommerce/vouchers', nil, data_transform(data))
|
67
|
+
end
|
68
|
+
|
69
|
+
##
|
70
|
+
# === Update voucher.
|
71
|
+
# Update voucher code.
|
72
|
+
#
|
73
|
+
# ==== Parameters
|
74
|
+
# id:: (Integer) -- Voucher id.
|
75
|
+
# data:: (Hash) -- Data to be submitted.
|
76
|
+
#
|
77
|
+
# ==== Example
|
78
|
+
# data = {
|
79
|
+
# title: 'New voucher title',
|
80
|
+
# voucher_code: 'XAZWQ12MP2',
|
81
|
+
# amount: 250,
|
82
|
+
# start_date: '2023-03-27T10:20:00-06:00',
|
83
|
+
# end_date: '2023-03-30T10:20:00-06:00'
|
84
|
+
# }
|
85
|
+
#
|
86
|
+
# @data = @mints_user.update_voucher(1, data)
|
87
|
+
def update_voucher(id, data)
|
88
|
+
@client.raw('put', "/ecommerce/vouchers/#{id}", nil, data_transform(data))
|
89
|
+
end
|
90
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.31
|
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-
|
11
|
+
date: 2023-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/contact/ecommerce/order_items.rb
|
123
123
|
- lib/contact/ecommerce/order_items_groups.rb
|
124
124
|
- lib/contact/ecommerce/orders.rb
|
125
|
+
- lib/contact/ecommerce/vouchers.rb
|
125
126
|
- lib/errors.rb
|
126
127
|
- lib/generators/mints_assets_controller.rb
|
127
128
|
- lib/generators/mints_config.yml.erb
|
@@ -145,6 +146,23 @@ files:
|
|
145
146
|
- lib/mints/helpers/proxy_controllers_methods.rb
|
146
147
|
- lib/mints/helpers/user_auth_helper.rb
|
147
148
|
- lib/pub.rb
|
149
|
+
- lib/pub/config/attributes.rb
|
150
|
+
- lib/pub/config/config.rb
|
151
|
+
- lib/pub/config/public_folders.rb
|
152
|
+
- lib/pub/config/tags.rb
|
153
|
+
- lib/pub/config/taxonomies.rb
|
154
|
+
- lib/pub/content/assets.rb
|
155
|
+
- lib/pub/content/content.rb
|
156
|
+
- lib/pub/content/content_bundles.rb
|
157
|
+
- lib/pub/content/content_instance_versions.rb
|
158
|
+
- lib/pub/content/content_instances.rb
|
159
|
+
- lib/pub/content/forms.rb
|
160
|
+
- lib/pub/content/stories.rb
|
161
|
+
- lib/pub/content/story_versions.rb
|
162
|
+
- lib/pub/ecommerce/ecommerce.rb
|
163
|
+
- lib/pub/ecommerce/locations.rb
|
164
|
+
- lib/pub/ecommerce/orders.rb
|
165
|
+
- lib/pub/ecommerce/products.rb
|
148
166
|
- lib/user.rb
|
149
167
|
- lib/user/config/api_keys.rb
|
150
168
|
- lib/user/config/appointments.rb
|
@@ -199,6 +217,7 @@ files:
|
|
199
217
|
- lib/user/ecommerce/taxes.rb
|
200
218
|
- lib/user/ecommerce/variant_options.rb
|
201
219
|
- lib/user/ecommerce/variant_values.rb
|
220
|
+
- lib/user/ecommerce/vouchers.rb
|
202
221
|
- lib/user/helpers/helpers.rb
|
203
222
|
- lib/user/helpers/object_activities.rb
|
204
223
|
- lib/user/helpers/object_folders.rb
|