hubspot-api-client 4.0.0 → 7.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -1
  3. data/lib/hubspot-api-client.rb +8 -0
  4. data/lib/hubspot/codegen/cms/audit-logs/api/default_api.rb +1 -1
  5. data/lib/hubspot/codegen/cms/performance/configuration.rb +0 -7
  6. data/lib/hubspot/codegen/cms/site-search/models/search_hit_field.rb +4 -2
  7. data/lib/hubspot/codegen/crm/companies/api/associations_api.rb +2 -2
  8. data/lib/hubspot/codegen/crm/companies/api/basic_api.rb +20 -12
  9. data/lib/hubspot/codegen/crm/companies/api/batch_api.rb +40 -24
  10. data/lib/hubspot/codegen/crm/companies/api/search_api.rb +10 -6
  11. data/lib/hubspot/codegen/crm/companies/models/batch_read_input_simple_public_object_id.rb +20 -20
  12. data/lib/hubspot/codegen/crm/companies/models/batch_response_simple_public_object.rb +29 -38
  13. data/lib/hubspot/codegen/crm/companies/models/batch_response_simple_public_object_with_errors.rb +333 -0
  14. data/lib/hubspot/codegen/crm/companies/models/filter.rb +15 -15
  15. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_batch_input.rb +18 -18
  16. data/lib/hubspot/codegen/crm/contacts/api/associations_api.rb +2 -2
  17. data/lib/hubspot/codegen/crm/contacts/api/basic_api.rb +20 -12
  18. data/lib/hubspot/codegen/crm/contacts/api/batch_api.rb +40 -24
  19. data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +10 -6
  20. data/lib/hubspot/codegen/crm/contacts/models/batch_read_input_simple_public_object_id.rb +20 -20
  21. data/lib/hubspot/codegen/crm/contacts/models/batch_response_simple_public_object.rb +29 -38
  22. data/lib/hubspot/codegen/crm/contacts/models/batch_response_simple_public_object_with_errors.rb +333 -0
  23. data/lib/hubspot/codegen/crm/contacts/models/filter.rb +15 -15
  24. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_batch_input.rb +18 -18
  25. data/lib/hubspot/codegen/crm/deals/api/associations_api.rb +2 -2
  26. data/lib/hubspot/codegen/crm/deals/api/basic_api.rb +20 -12
  27. data/lib/hubspot/codegen/crm/deals/api/batch_api.rb +40 -24
  28. data/lib/hubspot/codegen/crm/deals/api/search_api.rb +10 -6
  29. data/lib/hubspot/codegen/crm/deals/models/batch_read_input_simple_public_object_id.rb +20 -20
  30. data/lib/hubspot/codegen/crm/deals/models/batch_response_simple_public_object.rb +29 -38
  31. data/lib/hubspot/codegen/crm/deals/models/batch_response_simple_public_object_with_errors.rb +333 -0
  32. data/lib/hubspot/codegen/crm/deals/models/filter.rb +15 -15
  33. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_batch_input.rb +18 -18
  34. data/lib/hubspot/codegen/crm/extensions/cards/configuration.rb +0 -7
  35. data/lib/hubspot/codegen/crm/line_items/api/associations_api.rb +2 -2
  36. data/lib/hubspot/codegen/crm/line_items/api/basic_api.rb +20 -12
  37. data/lib/hubspot/codegen/crm/line_items/api/batch_api.rb +40 -24
  38. data/lib/hubspot/codegen/crm/line_items/api/search_api.rb +10 -6
  39. data/lib/hubspot/codegen/crm/line_items/models/batch_read_input_simple_public_object_id.rb +20 -20
  40. data/lib/hubspot/codegen/crm/line_items/models/batch_response_simple_public_object.rb +29 -38
  41. data/lib/hubspot/codegen/crm/line_items/models/batch_response_simple_public_object_with_errors.rb +333 -0
  42. data/lib/hubspot/codegen/crm/line_items/models/filter.rb +15 -15
  43. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_batch_input.rb +18 -18
  44. data/lib/hubspot/codegen/crm/owners/api/default_api.rb +0 -2
  45. data/lib/hubspot/codegen/crm/products/api/associations_api.rb +2 -2
  46. data/lib/hubspot/codegen/crm/products/api/basic_api.rb +20 -12
  47. data/lib/hubspot/codegen/crm/products/api/batch_api.rb +40 -24
  48. data/lib/hubspot/codegen/crm/products/api/search_api.rb +10 -6
  49. data/lib/hubspot/codegen/crm/products/models/batch_read_input_simple_public_object_id.rb +20 -20
  50. data/lib/hubspot/codegen/crm/products/models/batch_response_simple_public_object.rb +29 -38
  51. data/lib/hubspot/codegen/crm/products/models/batch_response_simple_public_object_with_errors.rb +333 -0
  52. data/lib/hubspot/codegen/crm/products/models/filter.rb +15 -15
  53. data/lib/hubspot/codegen/crm/products/models/simple_public_object_batch_input.rb +18 -18
  54. data/lib/hubspot/codegen/crm/properties/api/batch_api.rb +30 -18
  55. data/lib/hubspot/codegen/crm/properties/api/core_api.rb +20 -12
  56. data/lib/hubspot/codegen/crm/properties/api/groups_api.rb +20 -12
  57. data/lib/hubspot/codegen/crm/properties/models/batch_read_input_property_name.rb +18 -18
  58. data/lib/hubspot/codegen/crm/properties/models/batch_response_property.rb +29 -23
  59. data/lib/hubspot/codegen/crm/properties/models/property_create.rb +14 -4
  60. data/lib/hubspot/codegen/crm/properties/models/property_update.rb +14 -4
  61. data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +1 -157
  62. data/lib/hubspot/codegen/crm/quotes/api/basic_api.rb +2 -190
  63. data/lib/hubspot/codegen/crm/quotes/api/batch_api.rb +11 -187
  64. data/lib/hubspot/codegen/crm/quotes/api/default_api.rb +426 -0
  65. data/lib/hubspot/codegen/crm/quotes/api/search_api.rb +11 -7
  66. data/lib/hubspot/codegen/crm/quotes/models/batch_read_input_simple_public_object_id.rb +20 -20
  67. data/lib/hubspot/codegen/crm/quotes/models/batch_response_simple_public_object.rb +29 -38
  68. data/lib/hubspot/codegen/crm/quotes/models/batch_response_simple_public_object_with_errors.rb +333 -0
  69. data/lib/hubspot/codegen/crm/quotes/models/filter.rb +15 -15
  70. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_batch_input.rb +18 -18
  71. data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +2 -2
  72. data/lib/hubspot/codegen/crm/tickets/api/basic_api.rb +20 -12
  73. data/lib/hubspot/codegen/crm/tickets/api/batch_api.rb +40 -24
  74. data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +10 -6
  75. data/lib/hubspot/codegen/crm/tickets/models/batch_read_input_simple_public_object_id.rb +20 -20
  76. data/lib/hubspot/codegen/crm/tickets/models/batch_response_simple_public_object.rb +29 -38
  77. data/lib/hubspot/codegen/crm/tickets/models/batch_response_simple_public_object_with_errors.rb +333 -0
  78. data/lib/hubspot/codegen/crm/tickets/models/filter.rb +15 -15
  79. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_batch_input.rb +18 -18
  80. data/lib/hubspot/codegen/oauth/configuration.rb +0 -14
  81. data/lib/hubspot/codegen/webhooks/api/subscriptions_api.rb +16 -12
  82. data/lib/hubspot/codegen/webhooks/configuration.rb +0 -7
  83. data/lib/hubspot/codegen/webhooks/models/batch_response_subscription_response.rb +1 -21
  84. data/lib/hubspot/codegen/webhooks/models/batch_response_subscription_response_with_errors.rb +331 -0
  85. data/lib/hubspot/codegen/webhooks/models/settings_response.rb +28 -28
  86. data/lib/hubspot/codegen/webhooks/models/subscription_create_request.rb +16 -13
  87. data/lib/hubspot/codegen/webhooks/models/subscription_patch_request.rb +7 -7
  88. data/lib/hubspot/codegen/webhooks/models/subscription_response.rb +45 -39
  89. data/lib/hubspot/version.rb +1 -1
  90. data/sample-apps/companies-app/Gemfile.lock +2 -2
  91. data/sample-apps/companies-app/app/lib/services/hubspot/associations/create.rb +1 -1
  92. data/sample-apps/companies-app/app/lib/services/hubspot/associations/delete.rb +1 -1
  93. data/sample-apps/companies-app/app/lib/services/hubspot/associations/get_by_id.rb +2 -2
  94. data/sample-apps/companies-app/app/lib/services/hubspot/companies/create.rb +1 -1
  95. data/sample-apps/companies-app/app/lib/services/hubspot/companies/search.rb +1 -1
  96. data/sample-apps/companies-app/app/lib/services/hubspot/companies/update.rb +1 -2
  97. data/sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb +1 -1
  98. data/sample-apps/contacts-app/Gemfile.lock +2 -2
  99. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/create.rb +1 -1
  100. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/search.rb +1 -1
  101. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/update.rb +1 -2
  102. data/sample-apps/contacts-app/app/lib/services/hubspot/properties/create.rb +1 -2
  103. data/sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb +1 -2
  104. data/sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/archive_batch.rb +1 -1
  105. data/sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/create_batch.rb +1 -1
  106. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/create.rb +1 -1
  107. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/search.rb +1 -1
  108. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/update.rb +1 -2
  109. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/archive_batch.rb +1 -1
  110. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/create_batch.rb +1 -1
  111. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/contacts/search.rb +1 -1
  112. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/properties/create.rb +1 -2
  113. data/sample-apps/trello-integration-app/.env.template +7 -0
  114. data/sample-apps/trello-integration-app/.gitignore +35 -0
  115. data/sample-apps/trello-integration-app/.rspec +1 -0
  116. data/sample-apps/trello-integration-app/.ruby-version +1 -0
  117. data/sample-apps/trello-integration-app/Dockerfile +22 -0
  118. data/sample-apps/trello-integration-app/Gemfile +38 -0
  119. data/sample-apps/trello-integration-app/Gemfile.lock +314 -0
  120. data/sample-apps/trello-integration-app/README.md +31 -0
  121. data/sample-apps/trello-integration-app/Rakefile +6 -0
  122. data/sample-apps/trello-integration-app/app/assets/config/manifest.js +3 -0
  123. data/sample-apps/trello-integration-app/app/assets/images/.keep +0 -0
  124. data/sample-apps/trello-integration-app/app/assets/images/right-arrow.png +0 -0
  125. data/sample-apps/trello-integration-app/app/assets/javascripts/application.js +22 -0
  126. data/sample-apps/trello-integration-app/app/assets/javascripts/cable.js +13 -0
  127. data/sample-apps/trello-integration-app/app/assets/javascripts/channels/.keep +0 -0
  128. data/sample-apps/trello-integration-app/app/assets/javascripts/jquery-spinner.min.js +11071 -0
  129. data/sample-apps/trello-integration-app/app/assets/javascripts/lodash.js +15972 -0
  130. data/sample-apps/trello-integration-app/app/assets/javascripts/mappings.js +78 -0
  131. data/sample-apps/trello-integration-app/app/assets/javascripts/typeahead.bundle.min.js +8 -0
  132. data/sample-apps/trello-integration-app/app/assets/stylesheets/application.css +46 -0
  133. data/sample-apps/trello-integration-app/app/assets/stylesheets/authorization.scss +34 -0
  134. data/sample-apps/trello-integration-app/app/assets/stylesheets/jquery-spinner.css +33 -0
  135. data/sample-apps/trello-integration-app/app/assets/stylesheets/mappings.scss +55 -0
  136. data/sample-apps/trello-integration-app/app/assets/stylesheets/navigation.scss +43 -0
  137. data/sample-apps/trello-integration-app/app/assets/stylesheets/search_frame.scss +81 -0
  138. data/sample-apps/trello-integration-app/app/controllers/application_controller.rb +38 -0
  139. data/sample-apps/trello-integration-app/app/controllers/concerns/.keep +0 -0
  140. data/sample-apps/trello-integration-app/app/controllers/concerns/exception_handler.rb +12 -0
  141. data/sample-apps/trello-integration-app/app/controllers/home_controller.rb +20 -0
  142. data/sample-apps/trello-integration-app/app/controllers/mappings_controller.rb +64 -0
  143. data/sample-apps/trello-integration-app/app/controllers/oauth/authorization_controller.rb +28 -0
  144. data/sample-apps/trello-integration-app/app/controllers/trello/cards_controller.rb +94 -0
  145. data/sample-apps/trello-integration-app/app/controllers/trello/webhooks_controller.rb +30 -0
  146. data/sample-apps/trello-integration-app/app/helpers/application_helper.rb +2 -0
  147. data/sample-apps/trello-integration-app/app/helpers/oauth/authorization_helper.rb +11 -0
  148. data/sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/authorize.rb +17 -0
  149. data/sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/get_authorization_uri.rb +35 -0
  150. data/sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/base.rb +21 -0
  151. data/sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/generate.rb +28 -0
  152. data/sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/refresh.rb +35 -0
  153. data/sample-apps/trello-integration-app/app/lib/services/hubspot/deals/get_by_id.rb +15 -0
  154. data/sample-apps/trello-integration-app/app/lib/services/hubspot/deals/update.rb +17 -0
  155. data/sample-apps/trello-integration-app/app/lib/services/hubspot/extensions_cards/create.rb +82 -0
  156. data/sample-apps/trello-integration-app/app/lib/services/hubspot/pipelines/get_all.rb +11 -0
  157. data/sample-apps/trello-integration-app/app/lib/services/hubspot/pipelines/get_by_id.rb +15 -0
  158. data/sample-apps/trello-integration-app/app/lib/services/trello/authorization/authorize.rb +20 -0
  159. data/sample-apps/trello-integration-app/app/lib/services/trello/boards/get_all.rb +11 -0
  160. data/sample-apps/trello-integration-app/app/lib/services/trello/boards/get_by_id.rb +19 -0
  161. data/sample-apps/trello-integration-app/app/lib/services/trello/cards/format.rb +78 -0
  162. data/sample-apps/trello-integration-app/app/lib/services/trello/cards/get_by_id.rb +15 -0
  163. data/sample-apps/trello-integration-app/app/lib/services/trello/cards/search.rb +15 -0
  164. data/sample-apps/trello-integration-app/app/lib/services/trello/webhooks/create.rb +31 -0
  165. data/sample-apps/trello-integration-app/app/lib/services/trello/webhooks/delete.rb +17 -0
  166. data/sample-apps/trello-integration-app/app/lib/services/trello/webhooks/update.rb +19 -0
  167. data/sample-apps/trello-integration-app/app/models/application_record.rb +3 -0
  168. data/sample-apps/trello-integration-app/app/models/concerns/.keep +0 -0
  169. data/sample-apps/trello-integration-app/app/models/deal_association.rb +2 -0
  170. data/sample-apps/trello-integration-app/app/models/extension_card.rb +4 -0
  171. data/sample-apps/trello-integration-app/app/models/hubspot_token.rb +19 -0
  172. data/sample-apps/trello-integration-app/app/models/mapping.rb +2 -0
  173. data/sample-apps/trello-integration-app/app/models/trello_token.rb +19 -0
  174. data/sample-apps/trello-integration-app/app/models/webhook.rb +2 -0
  175. data/sample-apps/trello-integration-app/app/views/home/index.html.erb +23 -0
  176. data/sample-apps/trello-integration-app/app/views/home/success.html.erb +11 -0
  177. data/sample-apps/trello-integration-app/app/views/layouts/application.html.erb +23 -0
  178. data/sample-apps/trello-integration-app/app/views/mappings/_mapping.html.erb +13 -0
  179. data/sample-apps/trello-integration-app/app/views/mappings/index.html.erb +44 -0
  180. data/sample-apps/trello-integration-app/app/views/oauth/authorization/login.html.erb +42 -0
  181. data/sample-apps/trello-integration-app/app/views/shared/_header.html.erb +15 -0
  182. data/sample-apps/trello-integration-app/app/views/trello/cards/search_frame.html.erb +69 -0
  183. data/sample-apps/trello-integration-app/app/views/trello/cards/search_frame_success.html.erb +7 -0
  184. data/sample-apps/trello-integration-app/bin/bundle +3 -0
  185. data/sample-apps/trello-integration-app/bin/rails +9 -0
  186. data/sample-apps/trello-integration-app/bin/rake +9 -0
  187. data/sample-apps/trello-integration-app/bin/setup +36 -0
  188. data/sample-apps/trello-integration-app/bin/spring +17 -0
  189. data/sample-apps/trello-integration-app/bin/update +31 -0
  190. data/sample-apps/trello-integration-app/bin/yarn +11 -0
  191. data/sample-apps/trello-integration-app/config.ru +5 -0
  192. data/sample-apps/trello-integration-app/config/application.rb +20 -0
  193. data/sample-apps/trello-integration-app/config/boot.rb +3 -0
  194. data/sample-apps/trello-integration-app/config/cable.yml +10 -0
  195. data/sample-apps/trello-integration-app/config/database.yml +16 -0
  196. data/sample-apps/trello-integration-app/config/environment.rb +5 -0
  197. data/sample-apps/trello-integration-app/config/environments/development.rb +61 -0
  198. data/sample-apps/trello-integration-app/config/environments/production.rb +94 -0
  199. data/sample-apps/trello-integration-app/config/environments/test.rb +46 -0
  200. data/sample-apps/trello-integration-app/config/initializers/assets.rb +14 -0
  201. data/sample-apps/trello-integration-app/config/initializers/filter_parameter_logging.rb +4 -0
  202. data/sample-apps/trello-integration-app/config/initializers/hubspot-api-client.rb +3 -0
  203. data/sample-apps/trello-integration-app/config/initializers/mime_types.rb +1 -0
  204. data/sample-apps/trello-integration-app/config/initializers/omniauth.rb +11 -0
  205. data/sample-apps/trello-integration-app/config/initializers/trello.rb +1 -0
  206. data/sample-apps/trello-integration-app/config/initializers/wrap_parameters.rb +14 -0
  207. data/sample-apps/trello-integration-app/config/locales/en.yml +33 -0
  208. data/sample-apps/trello-integration-app/config/puma.rb +34 -0
  209. data/sample-apps/trello-integration-app/config/routes.rb +29 -0
  210. data/sample-apps/trello-integration-app/config/spring.rb +6 -0
  211. data/sample-apps/trello-integration-app/config/storage.yml +34 -0
  212. data/sample-apps/trello-integration-app/db/migrate/20200624132327_create_hubspot_tokens.rb +10 -0
  213. data/sample-apps/trello-integration-app/db/migrate/20200624132336_create_trello_tokens.rb +8 -0
  214. data/sample-apps/trello-integration-app/db/migrate/20200624132337_create_deal_associations.rb +8 -0
  215. data/sample-apps/trello-integration-app/db/migrate/20200702130530_create_extension_cards.rb +8 -0
  216. data/sample-apps/trello-integration-app/db/migrate/20200715143913_create_mappings.rb +12 -0
  217. data/sample-apps/trello-integration-app/db/migrate/20200727083656_create_webhooks.rb +9 -0
  218. data/sample-apps/trello-integration-app/db/schema.rb +52 -0
  219. data/sample-apps/trello-integration-app/db/seeds.rb +7 -0
  220. data/sample-apps/trello-integration-app/docker-compose.yml +41 -0
  221. data/sample-apps/trello-integration-app/docker-entrypoint.sh +8 -0
  222. data/sample-apps/trello-integration-app/lib/assets/.keep +0 -0
  223. data/sample-apps/trello-integration-app/lib/middlewares/trello_payload_params_handler.rb +18 -0
  224. data/sample-apps/trello-integration-app/lib/tasks/.keep +0 -0
  225. data/sample-apps/trello-integration-app/log/.keep +0 -0
  226. data/sample-apps/trello-integration-app/package.json +5 -0
  227. data/sample-apps/trello-integration-app/public/404.html +67 -0
  228. data/sample-apps/trello-integration-app/public/422.html +67 -0
  229. data/sample-apps/trello-integration-app/public/500.html +66 -0
  230. data/sample-apps/trello-integration-app/public/favicon.ico +0 -0
  231. data/sample-apps/trello-integration-app/public/robots.txt +1 -0
  232. data/sample-apps/trello-integration-app/tmp/.keep +0 -0
  233. data/sample-apps/webhooks-contacts-app/app/lib/services/hubspot/contacts/get_batch.rb +1 -4
  234. metadata +277 -2
@@ -0,0 +1,46 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure public file server for tests with Cache-Control for performance.
16
+ config.public_file_server.enabled = true
17
+ config.public_file_server.headers = {
18
+ 'Cache-Control' => "public, max-age=#{1.hour.to_i}"
19
+ }
20
+
21
+ # Show full error reports and disable caching.
22
+ config.consider_all_requests_local = true
23
+ config.action_controller.perform_caching = false
24
+
25
+ # Raise exceptions instead of rendering exception templates.
26
+ config.action_dispatch.show_exceptions = false
27
+
28
+ # Disable request forgery protection in test environment.
29
+ config.action_controller.allow_forgery_protection = false
30
+
31
+ # Store uploaded files on the local file system in a temporary directory
32
+ config.active_storage.service = :test
33
+
34
+ config.action_mailer.perform_caching = false
35
+
36
+ # Tell Action Mailer not to deliver emails to the real world.
37
+ # The :test delivery method accumulates sent emails in the
38
+ # ActionMailer::Base.deliveries array.
39
+ config.action_mailer.delivery_method = :test
40
+
41
+ # Print deprecation notices to the stderr.
42
+ config.active_support.deprecation = :stderr
43
+
44
+ # Raises error for missing translations
45
+ # config.action_view.raise_on_missing_translations = true
46
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path.
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+ # Add Yarn node_modules folder to the asset load path.
9
+ Rails.application.config.assets.paths << Rails.root.join('node_modules')
10
+
11
+ # Precompile additional assets.
12
+ # application.js, application.css, and all non-JS/CSS in the app/assets
13
+ # folder are already added.
14
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,3 @@
1
+ ::Hubspot.configure do |config|
2
+ config.api_key = { 'hapikey' => ENV['HUBSPOT_DEVELOPER_API_KEY'] }
3
+ end
@@ -0,0 +1 @@
1
+ Mime::Type.register "text/csv", :csv
@@ -0,0 +1,11 @@
1
+ Rails.application.config.middleware.use OmniAuth::Builder do
2
+ provider(
3
+ :trello,
4
+ ENV['TRELLO_KEY'],
5
+ ENV['TRELLO_SECRET'],
6
+ app_name: "test",
7
+ scope: 'read,write,account',
8
+ expiration: 'never',
9
+ callback_path: '/oauth/trello_callback'
10
+ )
11
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,33 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # 'true': 'foo'
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at http://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -0,0 +1,34 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ threads threads_count, threads_count
9
+
10
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
11
+ #
12
+ port ENV.fetch("PORT") { 3000 }
13
+
14
+ # Specifies the `environment` that Puma will run in.
15
+ #
16
+ environment ENV.fetch("RAILS_ENV") { "development" }
17
+
18
+ # Specifies the number of `workers` to boot in clustered mode.
19
+ # Workers are forked webserver processes. If using threads and workers together
20
+ # the concurrency of the application would be max `threads` * `workers`.
21
+ # Workers do not work on JRuby or Windows (both of which do not support
22
+ # processes).
23
+ #
24
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
25
+
26
+ # Use the `preload_app!` method when specifying a `workers` number.
27
+ # This directive tells Puma to first boot the application and load code
28
+ # before forking the application. This takes advantage of Copy On Write
29
+ # process behavior so workers use less memory.
30
+ #
31
+ # preload_app!
32
+
33
+ # Allow puma to be restarted by `rails restart` command.
34
+ plugin :tmp_restart
@@ -0,0 +1,29 @@
1
+ Rails.application.routes.draw do
2
+ namespace :trello do
3
+ resources :cards, only: %i(index) do
4
+ collection do
5
+ get 'search'
6
+ get 'search_frame'
7
+ get 'search_frame_success'
8
+ delete 'delete_association'
9
+ end
10
+ end
11
+ post 'cards/search_frame', to: 'cards#create_association'
12
+ get 'cards', to: 'cards#index'
13
+
14
+ post '/webhooks', to: 'webhooks#receive'
15
+ get '/webhooks', to: 'webhooks#complete'
16
+ end
17
+
18
+ resources :mappings
19
+
20
+ get '/oauth/hubspot', to: 'oauth/authorization#authorize_hubspot'
21
+ get '/oauth/hubspot_callback', to: 'oauth/authorization#hubspot_callback'
22
+ get '/auth/:provider/callback', to: 'oauth/authorization#trello_callback'
23
+ get '/oauth/trello_callback', to: 'oauth/authorization#trello_callback'
24
+ get '/login', to: 'oauth/authorization#login'
25
+
26
+ post '/create_card', to: 'home#create_card'
27
+ get '/success', to: 'home#success'
28
+ root to: 'home#index'
29
+ end
@@ -0,0 +1,6 @@
1
+ %w[
2
+ .ruby-version
3
+ .rbenv-vars
4
+ tmp/restart.txt
5
+ tmp/caching-dev.txt
6
+ ].each { |path| Spring.watch(path) }
@@ -0,0 +1,34 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+ # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+ # amazon:
11
+ # service: S3
12
+ # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+ # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+ # region: us-east-1
15
+ # bucket: your_own_bucket
16
+
17
+ # Remember not to checkin your GCS keyfile to a repository
18
+ # google:
19
+ # service: GCS
20
+ # project: your_project
21
+ # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+ # bucket: your_own_bucket
23
+
24
+ # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25
+ # microsoft:
26
+ # service: AzureStorage
27
+ # storage_account_name: your_account_name
28
+ # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29
+ # container: your_container_name
30
+
31
+ # mirror:
32
+ # service: Mirror
33
+ # primary: local
34
+ # mirrors: [ amazon, google, microsoft ]
@@ -0,0 +1,10 @@
1
+ class CreateHubspotTokens < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :hubspot_tokens do |t|
4
+ t.string :refresh_token
5
+ t.string :access_token
6
+ t.datetime :expires_in
7
+ t.datetime :expires_at
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ class CreateTrelloTokens < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :trello_tokens do |t|
4
+ t.string :token
5
+ t.string :secret
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class CreateDealAssociations < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :deal_associations do |t|
4
+ t.string :deal_id
5
+ t.string :card_id
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class CreateExtensionCards < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :extension_cards do |t|
4
+ t.string :card_id_key
5
+ t.string :card_id
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,12 @@
1
+ class CreateMappings < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :mappings do |t|
4
+ t.string :board_id
5
+ t.string :board_list_id
6
+ t.string :pipeline_id
7
+ t.string :pipeline_stage_id
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ class CreateWebhooks < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :webhooks do |t|
4
+ t.string :webhook_id
5
+ t.string :card_id
6
+ t.string :url
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,52 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(version: 2020_07_27_083656) do
14
+
15
+ create_table "deal_associations", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
16
+ t.string "deal_id"
17
+ t.string "card_id"
18
+ end
19
+
20
+ create_table "extension_cards", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
21
+ t.string "card_id_key"
22
+ t.string "card_id"
23
+ end
24
+
25
+ create_table "hubspot_tokens", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
26
+ t.string "refresh_token"
27
+ t.string "access_token"
28
+ t.datetime "expires_in"
29
+ t.datetime "expires_at"
30
+ end
31
+
32
+ create_table "mappings", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
33
+ t.string "board_id"
34
+ t.string "board_list_id"
35
+ t.string "pipeline_id"
36
+ t.string "pipeline_stage_id"
37
+ t.datetime "created_at", null: false
38
+ t.datetime "updated_at", null: false
39
+ end
40
+
41
+ create_table "trello_tokens", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
42
+ t.string "token"
43
+ t.string "secret"
44
+ end
45
+
46
+ create_table "webhooks", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
47
+ t.string "webhook_id"
48
+ t.string "card_id"
49
+ t.string "url"
50
+ end
51
+
52
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7
+ # Character.create(name: 'Luke', movie: movies.first)
@@ -0,0 +1,41 @@
1
+ version: '3.5'
2
+
3
+ services:
4
+ web:
5
+ env_file:
6
+ - .env
7
+ environment:
8
+ DB_HOST: db
9
+ DB_NAME: trello_integration
10
+ DB_USERNAME: trello_integration
11
+ DB_PASSWORD: trello_integration
12
+ build:
13
+ dockerfile: ./sample-apps/trello-integration-app/Dockerfile
14
+ context: ../../
15
+ depends_on:
16
+ - db
17
+ ports:
18
+ - 3000:3000
19
+ db:
20
+ image: mysql:8.0
21
+ command: mysqld --default-authentication-plugin=mysql_native_password
22
+ volumes:
23
+ - ./db/mysql:/var/lib/mysql
24
+ ports:
25
+ - 3306:3306
26
+ logging:
27
+ driver: none
28
+ environment:
29
+ MYSQL_ROOT_PASSWORD: root
30
+ MYSQL_DATABASE: trello_integration_development
31
+ MYSQL_USER: trello_integration
32
+ MYSQL_PASSWORD: trello_integration
33
+ ngrok:
34
+ image: gtriggiano/ngrok-tunnel
35
+ ports:
36
+ - 4040:4040
37
+ environment:
38
+ TARGET_HOST: web
39
+ TARGET_PORT: 3000
40
+ depends_on:
41
+ - web
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Remove a potentially pre-existing server.pid for Rails.
5
+ rm -f /myapp/tmp/pids/server.pid
6
+
7
+ # Then exec the container's main process (what's set as CMD in the Dockerfile).
8
+ exec "$@"
@@ -0,0 +1,18 @@
1
+ class TrelloPayloadParamsHandler
2
+ def initialize(app)
3
+ @app = app
4
+ end
5
+
6
+ def call(env)
7
+ params = env['rack.input'].gets
8
+ if params && params['action']
9
+ result = JSON.parse(params)
10
+ if result['action']
11
+ result['event'] = result['action']
12
+ result.delete('action')
13
+ env['action_dispatch.request.request_parameters'] = result
14
+ end
15
+ end
16
+ @app.call(env)
17
+ end
18
+ end