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,124 +1,124 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module StoryVersions
2
- # === Get story versions.
3
- # Get a collection of story versions.
4
- #
5
- # ==== Parameters
6
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
7
- # use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
8
- #
9
- # ==== First Example
10
- # @data = @mints_user.get_story_versions
11
- #
12
- # ==== Second Example
13
- # options = {
14
- # "fields": "id, title"
15
- # }
16
- # @data = @mints_user.get_story_versions(options)
17
- #
18
- # ==== Third Example
19
- # options = {
20
- # "fields": "id, title"
21
- # }
22
- # @data = @mints_user.get_story_versions(options, true)
23
- def get_story_versions(options = nil, use_post = true)
24
- return get_query_results("/content/story-versions", options, use_post)
25
- end
4
+ # === Get story versions.
5
+ # Get a collection of story versions.
6
+ #
7
+ # ==== Parameters
8
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
9
+ # use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
10
+ #
11
+ # ==== First Example
12
+ # @data = @mints_user.get_story_versions
13
+ #
14
+ # ==== Second Example
15
+ # options = {
16
+ # fields: 'id, title'
17
+ # }
18
+ # @data = @mints_user.get_story_versions(options)
19
+ #
20
+ # ==== Third Example
21
+ # options = {
22
+ # fields: 'id, title'
23
+ # }
24
+ # @data = @mints_user.get_story_versions(options, true)
25
+ def get_story_versions(options = nil, use_post = true)
26
+ get_query_results('/content/story-versions', options, use_post)
27
+ end
26
28
 
27
- # === Get story version.
28
- # Get a story version info.
29
- #
30
- # ==== Parameters
31
- # id:: (Integer) -- Story version id.
32
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
33
- #
34
- # ==== First Example
35
- # @data = @mints_user.get_story_version(1)
36
- #
37
- # ==== Second Example
38
- # options = {
39
- # "fields": "id, title"
40
- # }
41
- # @data = @mints_user.get_story_version(1, options)
42
- def get_story_version(id, options = nil)
43
- @client.raw("get", "/content/story-versions/#{id}", options)
44
- end
29
+ # === Get story version.
30
+ # Get a story version info.
31
+ #
32
+ # ==== Parameters
33
+ # id:: (Integer) -- Story version id.
34
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
35
+ #
36
+ # ==== First Example
37
+ # @data = @mints_user.get_story_version(1)
38
+ #
39
+ # ==== Second Example
40
+ # options = {
41
+ # fields: 'id, title'
42
+ # }
43
+ # @data = @mints_user.get_story_version(1, options)
44
+ def get_story_version(id, options = nil)
45
+ @client.raw('get', "/content/story-versions/#{id}", options)
46
+ end
45
47
 
46
- # === Create story version.
47
- # Create a story version with data.
48
- #
49
- # ==== Parameters
50
- # data:: (Hash) -- Data to be submitted.
51
- #
52
- # ==== Example
53
- # data = {
54
- # "title": "New Story",
55
- # "slug": "new-story",
56
- # "social_metadata": "social metadata"
57
- # }
58
- # @data = @mints_user.create_story_version(data)
59
- def create_story_version(data, options = nil)
60
- @client.raw("post", "/content/story-versions", options, data_transform(data))
61
- end
48
+ # === Create story version.
49
+ # Create a story version with data.
50
+ #
51
+ # ==== Parameters
52
+ # data:: (Hash) -- Data to be submitted.
53
+ #
54
+ # ==== Example
55
+ # data = {
56
+ # title: 'New Story',
57
+ # slug: 'new-story',
58
+ # social_metadata: 'social metadata'
59
+ # }
60
+ # @data = @mints_user.create_story_version(data)
61
+ def create_story_version(data, options = nil)
62
+ @client.raw('post', '/content/story-versions', options, data_transform(data))
63
+ end
62
64
 
63
- # === Update story version.
64
- # Update a story version info.
65
- #
66
- # ==== Parameters
67
- # id:: (Integer) -- Story version id.
68
- # data:: (Hash) -- Data to be submitted.
69
- #
70
- # ==== Example
71
- # data = {
72
- # "title": "New Story Modified",
73
- # "slug": "new-story"
74
- # }
75
- # @data = @mints_user.update_story_version(5, data)
76
- def update_story_version(id, data, options = nil)
77
- @client.raw("put", "/content/story-versions/#{id}", options, data_transform(data))
78
- end
65
+ # === Update story version.
66
+ # Update a story version info.
67
+ #
68
+ # ==== Parameters
69
+ # id:: (Integer) -- Story version id.
70
+ # data:: (Hash) -- Data to be submitted.
71
+ #
72
+ # ==== Example
73
+ # data = {
74
+ # title: 'New Story Modified',
75
+ # slug: 'new-story'
76
+ # }
77
+ # @data = @mints_user.update_story_version(5, data)
78
+ def update_story_version(id, data, options = nil)
79
+ @client.raw('put', "/content/story-versions/#{id}", options, data_transform(data))
80
+ end
79
81
 
80
- # === Delete story version.
81
- # Delete a story version.
82
- #
83
- # ==== Parameters
84
- # id:: (Integer) -- Story version id.
85
- #
86
- # ==== Example
87
- # @data = @mints_user.delete_story_version(6)
88
- def delete_story_version(id)
89
- @client.raw("delete", "/content/story-versions/#{id}")
90
- end
82
+ # === Delete story version.
83
+ # Delete a story version.
84
+ #
85
+ # ==== Parameters
86
+ # id:: (Integer) -- Story version id.
87
+ #
88
+ # ==== Example
89
+ # @data = @mints_user.delete_story_version(6)
90
+ def delete_story_version(id)
91
+ @client.raw('delete', "/content/story-versions/#{id}")
92
+ end
91
93
 
92
- # === Duplicate story version.
93
- # Duplicate a story version.
94
- #
95
- # ==== Parameters
96
- # id:: (Integer) -- Story version id.
97
- # data:: (Hash) -- Data to be submitted.
98
- #
99
- # ==== Example
100
- # data = {
101
- # "options": []
102
- # }
103
- # @data = @mints_user.duplicate_story_version(1, data.to_json)
104
- def duplicate_story_version(id, data)
105
- @client.raw("post", "/content/story-versions/#{id}/duplicate", nil, data)
106
- end
94
+ # === Duplicate story version.
95
+ # Duplicate a story version.
96
+ #
97
+ # ==== Parameters
98
+ # id:: (Integer) -- Story version id.
99
+ # data:: (Hash) -- Data to be submitted.
100
+ #
101
+ # ==== Example
102
+ # data = { options: [] }
103
+ # @data = @mints_user.duplicate_story_version(1, data.to_json)
104
+ def duplicate_story_version(id, data)
105
+ @client.raw('post', "/content/story-versions/#{id}/duplicate", nil, data)
106
+ end
107
107
 
108
- # === Publish story version.
109
- # Publish a story version.
110
- #
111
- # ==== Parameters
112
- # id:: (Integer) -- Story version id.
113
- # data:: (Hash) -- Data to be submitted.
114
- #
115
- # ==== Example
116
- # data = {
117
- # "title": "New Story Modified",
118
- # "slug": "new-story"
119
- # }
120
- # @data = @mints_user.publish_story_version(1, data.to_json)
121
- def publish_story_version(id, data)
122
- @client.raw("put", "/content/story-versions/#{id}/publish", nil, data)
123
- end
124
- end
108
+ # === Publish story version.
109
+ # Publish a story version.
110
+ #
111
+ # ==== Parameters
112
+ # id:: (Integer) -- Story version id.
113
+ # data:: (Hash) -- Data to be submitted.
114
+ #
115
+ # ==== Example
116
+ # data = {
117
+ # title: 'New Story Modified',
118
+ # slug: 'new-story'
119
+ # }
120
+ # @data = @mints_user.publish_story_version(1, data.to_json)
121
+ def publish_story_version(id, data)
122
+ @client.raw('put', "/content/story-versions/#{id}/publish", nil, data)
123
+ end
124
+ end
@@ -1,111 +1,111 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Companies
2
- ##
3
- # == Companies
4
- #
4
+ ##
5
+ # == Companies
6
+ #
7
+
8
+ ##
9
+ # === Get companies support data.
10
+ # Get support data of companies.
11
+ #
12
+ # ==== Example
13
+ # @data = @mints_user.get_companies_support_data
14
+ def get_companies_support_data
15
+ @client.raw('get', '/crm/companies/support-data')
16
+ end
17
+
18
+ # === Get companies.
19
+ # Get a collection of companies.
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_companies
27
+ #
28
+ # ==== Second Example
29
+ # options = { fields: 'id, title', sort: '-id' }
30
+ # @data = @mints_user.get_companies(options)
31
+ #
32
+ # ==== Third Example
33
+ # options = { fields: 'id, title', sort: '-id' }
34
+ # @data = @mints_user.get_companies(options, false)
35
+ def get_companies(options = nil, use_post = true)
36
+ get_query_results('/crm/companies', options, use_post)
37
+ end
38
+
39
+ # === Get company.
40
+ # Get a company info.
41
+ #
42
+ # ==== Parameters
43
+ # id:: (Integer) -- Company id.
44
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
45
+ #
46
+ # ==== First Example
47
+ # @data = @mints_user.get_company(21)
48
+ #
49
+ # ==== Second Example
50
+ # options = { fields: 'id, title' }
51
+ # @data = @mints_user.get_company(21, options)
52
+ def get_company(id, options = nil)
53
+ @client.raw('get', "/crm/companies/#{id}", options)
54
+ end
5
55
 
6
- ##
7
- # === Get companies support data.
8
- # Get support data of companies.
9
- #
10
- # ==== Example
11
- # @data = @mints_user.get_companies_support_data
12
- def get_companies_support_data
13
- @client.raw("get", "/crm/companies/support-data")
14
- end
15
-
16
- # === Get companies.
17
- # Get a collection of companies.
18
- #
19
- # ==== Parameters
20
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
21
- # use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
22
- #
23
- # ==== First Example
24
- # @data = @mints_user.get_companies
25
- #
26
- # ==== Second Example
27
- # options = { "fields": "id, title", "sort": "-id" }
28
- # @data = @mints_user.get_companies(options)
29
- #
30
- # ==== Third Example
31
- # options = { "fields": "id, title", "sort": "-id" }
32
- # @data = @mints_user.get_companies(options, false)
33
- def get_companies(options = nil, use_post = true)
34
- return get_query_results("/crm/companies", options, use_post)
35
- end
36
-
37
- # === Get company.
38
- # Get a company info.
39
- #
40
- # ==== Parameters
41
- # id:: (Integer) -- Company id.
42
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
43
- #
44
- # ==== First Example
45
- # @data = @mints_user.get_company(21)
46
- #
47
- # ==== Second Example
48
- # options = { "fields": "id, title" }
49
- # @data = @mints_user.get_company(21, options)
50
- def get_company(id, options = nil)
51
- @client.raw("get", "/crm/companies/#{id}", options)
52
- end
53
-
54
- # === Create company.
55
- # Create a company with data.
56
- #
57
- # ==== Parameters
58
- # data:: (Hash) -- Data to be submitted.
59
- #
60
- # ==== Example
61
- # data = {
62
- # "title": "Company Title",
63
- # "alias": "Alias",
64
- # "website": "www.company.example.com",
65
- # "street1": "Company St",
66
- # "city": "Company City",
67
- # "region": "Company Region",
68
- # "postal_code": "12345",
69
- # "country_id": 144,
70
- # "tax_identifier": nil
71
- # }
72
- # @data = @mints_user.create_company(data)
73
- def create_company(data, options = nil)
74
- @client.raw("post", "/crm/companies/", options, data_transform(data))
75
- end
56
+ # === Create company.
57
+ # Create a company with data.
58
+ #
59
+ # ==== Parameters
60
+ # data:: (Hash) -- Data to be submitted.
61
+ #
62
+ # ==== Example
63
+ # data = {
64
+ # title: 'Company Title',
65
+ # alias: 'Alias',
66
+ # website: 'www.company.example.com',
67
+ # street1: 'Company St',
68
+ # city: 'Company City',
69
+ # region: 'Company Region',
70
+ # postal_code: '12345',
71
+ # country_id: 144,
72
+ # tax_identifier: nil
73
+ # }
74
+ # @data = @mints_user.create_company(data)
75
+ def create_company(data, options = nil)
76
+ @client.raw('post', '/crm/companies/', options, data_transform(data))
77
+ end
76
78
 
77
- # === Update company.
78
- # Update a company info.
79
- #
80
- # ==== Parameters
81
- # id:: (Integer) -- Company id.
82
- # data:: (Hash) -- Data to be submitted.
83
- #
84
- # ==== Example
85
- # data = {
86
- # "title": "Company Title Modified"
87
- # }
88
- # @data = @mints_user.update_company(23, data)
89
- def update_company(id, data, options = nil)
90
- @client.raw("put", "/crm/companies/#{id}", options, data_transform(data))
91
- end
79
+ # === Update company.
80
+ # Update a company info.
81
+ #
82
+ # ==== Parameters
83
+ # id:: (Integer) -- Company id.
84
+ # data:: (Hash) -- Data to be submitted.
85
+ #
86
+ # ==== Example
87
+ # data = {
88
+ # title: 'Company Title Modified'
89
+ # }
90
+ # @data = @mints_user.update_company(23, data)
91
+ def update_company(id, data, options = nil)
92
+ @client.raw('put', "/crm/companies/#{id}", options, data_transform(data))
93
+ end
92
94
 
93
- ##
94
- # == Companies Bulk Actions
95
- #
95
+ ##
96
+ # == Companies Bulk Actions
97
+ #
96
98
 
97
- # === Delete Companies.
98
- # Delete a group of companies.
99
- #
100
- # ==== Parameters
101
- # data:: (Hash) -- Data to be submitted.
102
- #
103
- # ==== Example
104
- # data = {
105
- # "ids": [ 21, 22 ]
106
- # }
107
- # @data = @mints_user.delete_companies(data)
108
- def delete_companies(data)
109
- @client.raw("delete", "/crm/companies/delete", nil, data_transform(data))
110
- end
111
- end
99
+ # === Delete Companies.
100
+ # Delete a group of companies.
101
+ #
102
+ # ==== Parameters
103
+ # data:: (Hash) -- Data to be submitted.
104
+ #
105
+ # ==== Example
106
+ # data = { ids: %w[21 22] }
107
+ # @data = @mints_user.delete_companies(data)
108
+ def delete_companies(data)
109
+ @client.raw('delete', '/crm/companies/delete', nil, data_transform(data))
110
+ end
111
+ end