mints 0.0.27 → 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.
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,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