mints 0.0.27 → 0.0.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/lib/client.rb +287 -385
  4. data/lib/contact/config/appointments.rb +201 -0
  5. data/lib/contact/config/config.rb +7 -0
  6. data/lib/contact/content/content.rb +7 -0
  7. data/lib/contact/content/conversations.rb +121 -0
  8. data/lib/contact/ecommerce/ecommerce.rb +12 -0
  9. data/lib/contact/ecommerce/order_items.rb +19 -0
  10. data/lib/contact/ecommerce/order_items_groups.rb +95 -0
  11. data/lib/contact/ecommerce/orders.rb +133 -0
  12. data/lib/contact.rb +57 -607
  13. data/lib/errors.rb +4 -2
  14. data/lib/generators/mints_assets_controller.rb +4 -1
  15. data/lib/generators/mints_config.yml.erb +0 -2
  16. data/lib/generators/mints_contact_controller.rb +4 -1
  17. data/lib/generators/mints_files_generator.rb +16 -13
  18. data/lib/generators/mints_link.rb +9 -6
  19. data/lib/generators/mints_public_controller.rb +4 -1
  20. data/lib/generators/mints_user_controller.rb +3 -0
  21. data/lib/generators/short_link_controller.rb +4 -1
  22. data/lib/mints/controllers/admin_base_controller.rb +5 -3
  23. data/lib/mints/controllers/base_api_controller.rb +6 -4
  24. data/lib/mints/controllers/base_controller.rb +5 -3
  25. data/lib/mints/controllers/concerns/mints_clients.rb +4 -2
  26. data/lib/mints/controllers/concerns/read_config_file.rb +3 -1
  27. data/lib/mints/controllers/contact_api_controller.rb +12 -10
  28. data/lib/mints/controllers/public_api_controller.rb +10 -8
  29. data/lib/mints/controllers/user_api_controller.rb +11 -9
  30. data/lib/mints/helpers/contact_auth_helper.rb +3 -1
  31. data/lib/mints/helpers/mints_helper.rb +39 -38
  32. data/lib/mints/helpers/proxy_controllers_methods.rb +24 -24
  33. data/lib/mints/helpers/user_auth_helper.rb +5 -3
  34. data/lib/mints.rb +12 -10
  35. data/lib/pub.rb +75 -93
  36. data/lib/user/config/api_keys.rb +63 -61
  37. data/lib/user/config/appointments.rb +217 -215
  38. data/lib/user/config/attribute_groups.rb +74 -72
  39. data/lib/user/config/attributes.rb +83 -81
  40. data/lib/user/config/calendars.rb +88 -86
  41. data/lib/user/config/config.rb +31 -63
  42. data/lib/user/config/public_folders.rb +105 -104
  43. data/lib/user/config/relationships.rb +135 -132
  44. data/lib/user/config/roles.rb +76 -79
  45. data/lib/user/config/seeds.rb +52 -51
  46. data/lib/user/config/system_settings.rb +50 -49
  47. data/lib/user/config/tags.rb +57 -59
  48. data/lib/user/config/taxonomies.rb +115 -119
  49. data/lib/user/config/teams.rb +69 -68
  50. data/lib/user/config/users.rb +72 -71
  51. data/lib/user/contacts/contacts.rb +21 -20
  52. data/lib/user/content/assets.rb +275 -280
  53. data/lib/user/content/content.rb +236 -235
  54. data/lib/user/content/content_instances.rb +138 -138
  55. data/lib/user/content/content_templates.rb +105 -103
  56. data/lib/user/content/conversations.rb +195 -193
  57. data/lib/user/content/dam.rb +85 -80
  58. data/lib/user/content/forms.rb +231 -233
  59. data/lib/user/content/message_templates.rb +154 -151
  60. data/lib/user/content/messages.rb +89 -87
  61. data/lib/user/content/pages.rb +84 -82
  62. data/lib/user/content/stories.rb +101 -101
  63. data/lib/user/content/story_templates.rb +90 -88
  64. data/lib/user/content/story_versions.rb +117 -117
  65. data/lib/user/crm/companies.rb +106 -106
  66. data/lib/user/crm/contacts.rb +287 -292
  67. data/lib/user/crm/crm.rb +21 -19
  68. data/lib/user/crm/deals.rb +105 -103
  69. data/lib/user/crm/favorites.rb +16 -13
  70. data/lib/user/crm/segments.rb +123 -123
  71. data/lib/user/crm/users.rb +22 -20
  72. data/lib/user/crm/workflow_step_objects.rb +86 -84
  73. data/lib/user/crm/workflow_steps.rb +47 -45
  74. data/lib/user/crm/workflows.rb +67 -65
  75. data/lib/user/ecommerce/ecommerce.rb +29 -27
  76. data/lib/user/ecommerce/item_prices.rb +84 -81
  77. data/lib/user/ecommerce/locations.rb +162 -160
  78. data/lib/user/ecommerce/order_items_groups.rb +110 -106
  79. data/lib/user/ecommerce/order_statuses.rb +26 -24
  80. data/lib/user/ecommerce/orders.rb +253 -246
  81. data/lib/user/ecommerce/price_lists.rb +70 -68
  82. data/lib/user/ecommerce/product_templates.rb +101 -99
  83. data/lib/user/ecommerce/product_variations.rb +124 -120
  84. data/lib/user/ecommerce/products.rb +162 -159
  85. data/lib/user/ecommerce/skus.rb +87 -85
  86. data/lib/user/ecommerce/taxes.rb +81 -79
  87. data/lib/user/ecommerce/variant_options.rb +68 -66
  88. data/lib/user/ecommerce/variant_values.rb +71 -69
  89. data/lib/user/helpers/helpers.rb +104 -101
  90. data/lib/user/helpers/object_activities.rb +80 -78
  91. data/lib/user/helpers/object_folders.rb +78 -76
  92. data/lib/user/helpers/user_folders.rb +79 -77
  93. data/lib/user/marketing/marketing.rb +116 -113
  94. data/lib/user/profile/profile.rb +96 -103
  95. data/lib/user.rb +32 -41
  96. metadata +50 -43
  97. data/lib/user/config/importers.rb +0 -184
@@ -1,104 +1,106 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ProductTemplates
2
- ##
3
- # == Product Templates
4
- #
4
+ ##
5
+ # == Product Templates
6
+ #
7
+
8
+ # === Get product templates support data from product.
9
+ # Get product templates support data from a product.
10
+ #
11
+ # ==== Parameters
12
+ # id:: (Integer) -- Product id.
13
+ #
14
+ # ==== Example
15
+ # @data = @mints_user.get_product_templates_support_data_from_product(1)
16
+ def get_product_templates_support_data_from_product(id)
17
+ @client.raw('get', "/ecommerce/product-templates/support-data/products/#{id}")
18
+ end
19
+
20
+ # === Get product templates support data from order items group.
21
+ # Get product templates support data from a order items group.
22
+ #
23
+ # ==== Parameters
24
+ # id:: (Integer) -- Order items group id.
25
+ #
26
+ # ==== Example
27
+ # @data = @mints_user.get_product_templates_support_data_from_order_items_group(1)
28
+ def get_product_templates_support_data_from_order_items_group(id)
29
+ @client.raw('get', "/ecommerce/product-templates/support-data/order-items-groups/#{id}")
30
+ end
31
+
32
+ # === Get product templates support data.
33
+ # Get support data used in product templates.
34
+ #
35
+ # ==== Example
36
+ # @data = @mints_user.get_product_templates_support_data
37
+ def get_product_templates_support_data
38
+ @client.raw('get', '/ecommerce/product-templates/support-data')
39
+ end
5
40
 
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
41
+ # === Get product templates.
42
+ # Get a collection of product templates.
43
+ #
44
+ # ==== Parameters
45
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
46
+ #
47
+ # ==== First Example
48
+ # @data = @mints_user.get_product_templates
49
+ #
50
+ # ==== Second Example
51
+ # options = { fields: 'title' }
52
+ # @data = @mints_user.get_product_templates(options)
53
+ def get_product_templates(options = nil)
54
+ @client.raw('get', '/ecommerce/product-templates', options)
55
+ end
17
56
 
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
57
+ # === Get product template.
58
+ # Get a product template info.
59
+ #
60
+ # ==== Parameters
61
+ # id:: (Integer) -- Product template id.
62
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
63
+ #
64
+ # ==== First Example
65
+ # @data = @mints_user.get_product_template(1)
66
+ #
67
+ # ==== Second Example
68
+ # options = { fields: 'title' }
69
+ # @data = @mints_user.get_product_template(1, options)
70
+ def get_product_template(id, options = nil)
71
+ @client.raw('get', "/ecommerce/product-templates/#{id}", options)
72
+ end
29
73
 
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
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
74
+ # === Create product template.
75
+ # Create a product template with data.
76
+ #
77
+ # ==== Parameters
78
+ # data:: (Hash) -- Data to be submitted.
79
+ #
80
+ # ==== Example
81
+ # data = {
82
+ # title: 'New Product Template',
83
+ # slug: 'new-product-template'
84
+ # }
85
+ # @data = @mints_user.create_product_template(data)
86
+ def create_product_template(data)
87
+ @client.raw('post', '/ecommerce/product-templates/', nil, data_transform(data))
88
+ end
54
89
 
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
90
+ # === Update product template.
91
+ # Update a product template info.
92
+ #
93
+ # ==== Parameters
94
+ # id:: (Integer) -- Product template id.
95
+ # data:: (Hash) -- Data to be submitted.
96
+ #
97
+ # ==== Example
98
+ # data = {
99
+ # title: 'New Product Template Modified',
100
+ # slug: 'new-product-template'
101
+ # }
102
+ # @data = @mints_user.update_product_template(3, data)
103
+ def update_product_template(id, data)
104
+ @client.raw('put', "/ecommerce/product-templates/#{id}", nil, data_transform(data))
105
+ end
106
+ end
@@ -1,129 +1,133 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ProductVariations
2
- ##
3
- # == Product Variation
4
- #
4
+ ##
5
+ # == Product Variation
6
+ #
5
7
 
6
- # === Generate product variation.
7
- # Generate a product variation.
8
- #
9
- # ==== Parameters
10
- # productId:: (Integer) -- Product id.
11
- # data:: (Hash) -- Data to be submitted.
12
- #
13
- def generate_product_variation(productId, data) #TODO: Research use
14
- #TODO: Notify line 247 had a '/' before Exception
15
- @client.raw("post", "/ecommerce/product-variations/generate/#{productId}", nil, data_transform(data))
16
- end
8
+ # === Generate product variation.
9
+ # Generate a product variation.
10
+ #
11
+ # ==== Parameters
12
+ # product_id:: (Integer) -- Product id.
13
+ # data:: (Hash) -- Data to be submitted.
14
+ #
15
+ def generate_product_variation(product_id, data)
16
+ # TODO: Research use
17
+ # TODO: Notify line 247 had a '/' before Exception
18
+ @client.raw('post', "/ecommerce/product-variations/generate/#{product_id}", nil, data_transform(data))
19
+ end
17
20
 
18
- # === Set prices to product variations.
19
- # Set prices to product variations.
20
- #
21
- # ==== Parameters
22
- # data:: (Hash) -- Data to be submitted.
23
- #
24
- # ==== Example
25
- # skus = [
26
- # { "id": 100 }
27
- # ]
28
- # prices = [
29
- # { "id": 1, "value": 1259 },
30
- # { "id": 2, "value": 1260 }
31
- # ]
32
- # data = {
33
- # "skus": skus.to_json,
34
- # "prices": prices.to_json
35
- # }
36
- # @data = @mints_user.set_prices_to_product_variations(data)
37
- def set_prices_to_product_variations(data)
38
- @client.raw("post", "/ecommerce/product-variations/set-prices", nil, data_transform(data))
39
- end
21
+ # === Set prices to product variations.
22
+ # Set prices to product variations.
23
+ #
24
+ # ==== Parameters
25
+ # data:: (Hash) -- Data to be submitted.
26
+ #
27
+ # ==== Example
28
+ # skus = [
29
+ # { id: 100 }
30
+ # ]
31
+ # prices = [
32
+ # { id: 1, value: 1259 },
33
+ # { id: 2, value: 1260 }
34
+ # ]
35
+ # data = {
36
+ # skus: skus,
37
+ # prices: prices
38
+ # }.to_json
39
+ #
40
+ # @data = @mints_user.set_prices_to_product_variations(data)
41
+ def set_prices_to_product_variations(data)
42
+ @client.raw('post', '/ecommerce/product-variations/set-prices', nil, data_transform(data))
43
+ end
40
44
 
41
- # === Get product from product variation.
42
- # Get a product from a product variation.
43
- #
44
- # ==== Parameters
45
- # productId:: (Integer) -- Product id.
46
- #
47
- # ==== Example
48
- # @data = @mints_user.get_product_from_product_variation(1)
49
- def get_product_from_product_variation(productId)
50
- @client.raw("get", "/ecommerce/product-variations/product/#{productId}")
51
- end
45
+ # === Get product from product variation.
46
+ # Get a product from a product variation.
47
+ #
48
+ # ==== Parameters
49
+ # product_id:: (Integer) -- Product id.
50
+ #
51
+ # ==== Example
52
+ # @data = @mints_user.get_product_from_product_variation(1)
53
+ def get_product_from_product_variation(product_id)
54
+ @client.raw('get', "/ecommerce/product-variations/product/#{product_id}")
55
+ end
52
56
 
53
- # === Get product variations.
54
- # Get a collection of product variations.
55
- #
56
- # ==== Parameters
57
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
58
- #
59
- # ==== Example
60
- # @data = @mints_user.get_product_variations
61
- def get_product_variations
62
- @client.raw("get", "/ecommerce/product-variations")
63
- end
57
+ # === Get product variations.
58
+ # Get a collection of product variations.
59
+ #
60
+ # ==== Parameters
61
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
62
+ #
63
+ # ==== Example
64
+ # @data = @mints_user.get_product_variations
65
+ def get_product_variations
66
+ @client.raw('get', '/ecommerce/product-variations')
67
+ end
64
68
 
65
- # === Get product variation.
66
- # Get a product variation info.
67
- #
68
- # ==== Parameters
69
- # id:: (Integer) -- Product variation id.
70
- #
71
- # ==== Example
72
- # @data = @mints_user.get_product_variation(100)
73
- def get_product_variation(id)
74
- @client.raw("get", "/ecommerce/product-variations/#{id}")
75
- end
69
+ # === Get product variation.
70
+ # Get a product variation info.
71
+ #
72
+ # ==== Parameters
73
+ # id:: (Integer) -- Product variation id.
74
+ #
75
+ # ==== Example
76
+ # @data = @mints_user.get_product_variation(100)
77
+ def get_product_variation(id)
78
+ @client.raw('get', "/ecommerce/product-variations/#{id}")
79
+ end
76
80
 
77
- # === Create product variation.
78
- # Create a product variation with data.
79
- #
80
- # ==== Parameters
81
- # data:: (Hash) -- Data to be submitted.
82
- #
83
- # ==== Example
84
- # data = {
85
- # "title": "New Product Variation",
86
- # "sku": "NEW-PRODUCT-VARIATION-SKU",
87
- # "product_id": 5,
88
- # "supplier": 36,
89
- # "prices": [
90
- # { "id": 1, "value": 300 }
91
- # ]
92
- # }
93
- # @data = @mints_user.create_product_variation(data)
94
- def create_product_variation(data)
95
- @client.raw("post", "/ecommerce/product-variations", nil, data_transform(data))
96
- end
81
+ # === Create product variation.
82
+ # Create a product variation with data.
83
+ #
84
+ # ==== Parameters
85
+ # data:: (Hash) -- Data to be submitted.
86
+ #
87
+ # ==== Example
88
+ # data = {
89
+ # title: 'New Product Variation',
90
+ # sku: 'NEW-PRODUCT-VARIATION-SKU',
91
+ # product_id: 5,
92
+ # supplier: 36,
93
+ # prices: [
94
+ # { id: 1, value: 300 }
95
+ # ]
96
+ # }
97
+ # @data = @mints_user.create_product_variation(data)
98
+ def create_product_variation(data)
99
+ @client.raw('post', '/ecommerce/product-variations', nil, data_transform(data))
100
+ end
97
101
 
98
- # === Update product variation.
99
- # Update a product variation info.
100
- #
101
- # ==== Parameters
102
- # id:: (Integer) -- Product variation id.
103
- # data:: (Hash) -- Data to be submitted.
104
- #
105
- # ==== Example
106
- # data = {
107
- # "title": "New Product Variation Modified",
108
- # "cost": 123,
109
- # "prices": [
110
- # { "id": 1, "value": 400 }
111
- # ]
112
- # }
113
- # @data = @mints_user.update_product_variation(528, data)
114
- def update_product_variation(id, data)
115
- @client.raw("put", "/ecommerce/product-variations/#{id}", nil, data_transform(data))
116
- end
102
+ # === Update product variation.
103
+ # Update a product variation info.
104
+ #
105
+ # ==== Parameters
106
+ # id:: (Integer) -- Product variation id.
107
+ # data:: (Hash) -- Data to be submitted.
108
+ #
109
+ # ==== Example
110
+ # data = {
111
+ # title: 'New Product Variation Modified',
112
+ # cost: 123,
113
+ # prices: [
114
+ # { id: 1, value: 400 }
115
+ # ]
116
+ # }
117
+ # @data = @mints_user.update_product_variation(528, data)
118
+ def update_product_variation(id, data)
119
+ @client.raw('put', "/ecommerce/product-variations/#{id}", nil, data_transform(data))
120
+ end
117
121
 
118
- # === Delete product variation.
119
- # Delete a product variation.
120
- #
121
- # ==== Parameters
122
- # id:: (Integer) -- Product variation id.
123
- #
124
- # ==== Example
125
- # @data = @mints_user.delete_product_variation(528)
126
- def delete_product_variation(id)
127
- @client.raw("delete", "/ecommerce/product-variations/#{id}")
128
- end
129
- end
122
+ # === Delete product variation.
123
+ # Delete a product variation.
124
+ #
125
+ # ==== Parameters
126
+ # id:: (Integer) -- Product variation id.
127
+ #
128
+ # ==== Example
129
+ # @data = @mints_user.delete_product_variation(528)
130
+ def delete_product_variation(id)
131
+ @client.raw('delete', "/ecommerce/product-variations/#{id}")
132
+ end
133
+ end