wolf_core 0.1.20 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acd792d3dc73de1d8eabdf890a23180731ed688350000fc03dec3ec7ca26c2b2
4
- data.tar.gz: 27805804ca2cf78917d463d36003a837b9456b8248e6e774c064234ee122bd36
3
+ metadata.gz: 0f6bdbeba6d322c35f29ee01853adee5b179569d399b57b0a0754c4f579c8c23
4
+ data.tar.gz: 739e754a7bacff197204f917cf10411119a392059e3c07512cd71f5a7af7a96d
5
5
  SHA512:
6
- metadata.gz: 23439fb5b879807ffd2d3409fc7d03cd7b1dbb8f9214515201118a92bdad2a66e2df9c04b9b4eb0bdda5e465e920144915a4bc5c2bd8ade9e66a654e3ee7cf98
7
- data.tar.gz: c023e26ce8cbada2460d470a1886b2cfa5641dc373f70d833a101a4a03dfc2897ef7270b4f1377d0bc404acfcdb6f076203b3e6808ff9fd9577438ed5c801ce8
6
+ metadata.gz: 5955672c359bb1bd1ccd924011d299a8eefde3b75bd1e9a0441fa8d32ee401176d59bbfc4c70557246c37140facbf36fe793932dcbb26ffffea4713d3e6e3109
7
+ data.tar.gz: 4ead3918813ba28b737a03a829f100d4b945b96c05f4d9f158543e926f85ed96d4052a2488b461ae1f8a971f194f1912edde4ca71175394c4a691d29ce240f63
@@ -40,13 +40,9 @@ module WolfCore
40
40
  return permitted
41
41
  end
42
42
 
43
- def barton_integration_http_post(path:, body:, error_message:)
43
+ def route_event_request(path:, body:)
44
44
  domain_url = ENV['CURRENT_SAM_URL']
45
- response = http_post(url: "#{domain_url}/#{path}", body: body)
46
- validate_http_response(
47
- response: response, message: error_message, error_data: { url: path }
48
- )
49
- response
45
+ async_http_post(url: "#{domain_url}/#{path}", body: body)
50
46
  end
51
47
 
52
48
  def get_salesforce_access_token
@@ -1,6 +1,7 @@
1
1
  module WolfCore
2
2
  module ExceptionOperations
3
3
  def raise_service_error(error_data)
4
+ error_data = { message: error_data } if error_data.is_a?(String)
4
5
  raise WolfCore::ServiceException, error_data
5
6
  end
6
7
  end
@@ -1,9 +1,10 @@
1
1
  module WolfCore
2
2
  module HttpOperations
3
3
  include WolfCore::ExceptionOperations
4
+ include WolfCore::AsyncUtils
4
5
 
5
6
  def async_http_get(**args)
6
- fork { http_get(**args) }
7
+ run_async { http_get(**args) }
7
8
  end
8
9
 
9
10
  def http_get(url:, headers: {}, query: nil)
@@ -11,7 +12,7 @@ module WolfCore
11
12
  end
12
13
 
13
14
  def async_http_post(**args)
14
- fork { http_post(**args) }
15
+ run_async { http_post(**args) }
15
16
  end
16
17
 
17
18
  def http_post(url:, headers: {}, body: nil, query: nil)
@@ -19,7 +20,7 @@ module WolfCore
19
20
  end
20
21
 
21
22
  def async_http_put(**args)
22
- fork { http_put(**args) }
23
+ run_async { http_put(**args) }
23
24
  end
24
25
 
25
26
  def http_put(url:, headers: {}, body: nil, query: nil)
@@ -0,0 +1,9 @@
1
+ module WolfCore
2
+ module AsyncUtils
3
+ def run_async(&block)
4
+ fork do
5
+ block.call
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "0.1.20"
4
+ VERSION = "0.1.22"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo
@@ -70,6 +70,7 @@ files:
70
70
  - lib/wolf_core/infrastructure/http_operations.rb
71
71
  - lib/wolf_core/infrastructure/lambda_function_data_source.rb
72
72
  - lib/wolf_core/infrastructure/lambda_function_operations.rb
73
+ - lib/wolf_core/utils/async_utils.rb
73
74
  - lib/wolf_core/utils/file_utils.rb
74
75
  - lib/wolf_core/utils/result.rb
75
76
  - lib/wolf_core/version.rb