wolf_core 0.1.19 → 0.1.21

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8d785615c5fa7343c041f85cd0bec684b52b244437e7671aafabe23b69bf2e7
4
- data.tar.gz: 25eb82ff8cd06ec0b3f7c3790c001ce729947f331b0efbd2875d6d061ff06c55
3
+ metadata.gz: '0274981540a1811180820e729b5b52de812a589c293ab969414930075d247214'
4
+ data.tar.gz: 504afbef81bf4632d7362189fcb53491256c90fa1f89f1608b4ff661d78a3c8a
5
5
  SHA512:
6
- metadata.gz: 9065f29a4dab595510a105c8f3685d929a7698069594d197341b311c980c98abba12d2b9adc8b2f54f0b779ebe591ec12ae0bf72552d558b41ae99ac1981525e
7
- data.tar.gz: 43147cb03ed97383467f552f0dfb0a7331495c26891405c499ea2c2dec8bc75e98b5c63d188149834c0957d61272199bc14dec6da8f4088119b3b78b85fe5078
6
+ metadata.gz: 93bc4c4b9e40f81364df19cabed16d0c979d07336278fb4041ab78fc78fdcfb31ae1fd744d022de9b410092f9212b62c3cf04db4a8fbd41c578ea6066c088de5
7
+ data.tar.gz: bb59ecc1975e2e21fbbba4babb98aa91159bbdbe407e8a76f1d9351d4022a66b1dfa5d0c4c30737d11b80ab657ceca765ff7780dcc3b92abd5411a4c67524951
@@ -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,15 +1,28 @@
1
1
  module WolfCore
2
2
  module HttpOperations
3
3
  include WolfCore::ExceptionOperations
4
+ include WolfCore::AsyncUtils
5
+
6
+ def async_http_get(**args)
7
+ run_async { http_get(**args) }
8
+ end
4
9
 
5
10
  def http_get(url:, headers: {}, query: nil)
6
11
  WolfCore::HttpDataSource.http_get(url: url, headers: headers, query: query)
7
12
  end
8
13
 
14
+ def async_http_post(**args)
15
+ run_async { http_post(**args) }
16
+ end
17
+
9
18
  def http_post(url:, headers: {}, body: nil, query: nil)
10
19
  WolfCore::HttpDataSource.http_post(url: url, headers: headers, query: query, body: body)
11
20
  end
12
21
 
22
+ def async_http_put(**args)
23
+ run_async { http_put(**args) }
24
+ end
25
+
13
26
  def http_put(url:, headers: {}, body: nil, query: nil)
14
27
  WolfCore::HttpDataSource.http_put(url: url, headers: headers, query: query, body: body)
15
28
  end
@@ -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.19"
4
+ VERSION = "0.1.21"
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.19
4
+ version: 0.1.21
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