wolf_core 0.1.16 → 0.1.18
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 +4 -4
- data/lib/wolf_core/infrastructure/lambda_function_data_source.rb +38 -0
- data/lib/wolf_core/infrastructure/lambda_function_operations.rb +7 -0
- data/lib/wolf_core/version.rb +1 -1
- data/lib/wolf_core.rb +2 -0
- metadata +20 -4
- /data/lib/wolf_core/{application → infrastructure}/fkm_operations.rb +0 -0
- /data/lib/wolf_core/{application → infrastructure}/http_operations.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 403b10401cf9e77b725c3cadcd758fe0797d35ec084675b63b59dff05fdc5f04
|
4
|
+
data.tar.gz: 592c264df6aceffadb8993970fbc3a6077b1d283f5707f24d8a31e9c916ab79a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f75af934fd1838ffe3cceced35be204c940a4bffa1dc78d5b1022ea69f3ad569d0c97d0fb872b24b721b7b2ec4328c5975b8fe115b7b5ba6d00d17c3c678bc5
|
7
|
+
data.tar.gz: 437135b84e51fe271bbffda54f1fb9520b0afade25c09f5d782fb2fad86f5774e66ae42ebac6c31dac3cad34e38955d5b72d170e7b02bd6ffa5e902823a2467d
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module WolfCore
|
2
|
+
module LambdaFunctionDataSource
|
3
|
+
module_function
|
4
|
+
|
5
|
+
def init
|
6
|
+
endpoint = ENV.fetch('AWS_LAMBDA_FUNCTION_ENDPOINT', nil)
|
7
|
+
client_config = {
|
8
|
+
access_key_id: ENV.fetch('AWS_KEY_ID', nil),
|
9
|
+
secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY', nil),
|
10
|
+
}
|
11
|
+
|
12
|
+
if endpoint.present?
|
13
|
+
client_config[:endpoint] = endpoint
|
14
|
+
else
|
15
|
+
client_config[:region] = ENV.fetch('AWS_REGION', nil)
|
16
|
+
end
|
17
|
+
|
18
|
+
client_config = client_config.compact
|
19
|
+
return if client_config.empty?
|
20
|
+
|
21
|
+
@@client = Aws::Lambda::Client.new(client_config)
|
22
|
+
end
|
23
|
+
|
24
|
+
def client
|
25
|
+
@@client
|
26
|
+
end
|
27
|
+
|
28
|
+
def invoke(function_name:, payload:)
|
29
|
+
parsed_payload = JSON.generate(payload)
|
30
|
+
@@client.invoke({
|
31
|
+
function_name: function_name,
|
32
|
+
invocation_type: 'Event',
|
33
|
+
log_type: 'Tail',
|
34
|
+
payload: parsed_payload
|
35
|
+
})
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/wolf_core/version.rb
CHANGED
data/lib/wolf_core.rb
CHANGED
@@ -5,9 +5,11 @@ require 'ostruct'
|
|
5
5
|
require 'httparty'
|
6
6
|
require 'active_support'
|
7
7
|
require 'active_support/core_ext'
|
8
|
+
require 'aws-sdk-lambda'
|
8
9
|
|
9
10
|
module WolfCore; end
|
10
11
|
|
11
12
|
require 'wolf_core/utils/file_utils'
|
12
13
|
|
13
14
|
WolfCore::FileUtils.require_relative_folder(__dir__, 'wolf_core')
|
15
|
+
WolfCore::LambdaFunctionDataSource.init
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wolf_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Roncallo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: aws-sdk-lambda
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: Repository to store shared code among Ruby projects.
|
42
56
|
email:
|
43
57
|
- jroncallo96@gmail.com
|
@@ -49,11 +63,13 @@ files:
|
|
49
63
|
- lib/wolf_core/application/application_service.rb
|
50
64
|
- lib/wolf_core/application/barton/mappings.rb
|
51
65
|
- lib/wolf_core/application/exception_operations.rb
|
52
|
-
- lib/wolf_core/application/fkm_operations.rb
|
53
|
-
- lib/wolf_core/application/http_operations.rb
|
54
66
|
- lib/wolf_core/application/salesforce_oauth_service.rb
|
55
67
|
- lib/wolf_core/application/service_exception.rb
|
68
|
+
- lib/wolf_core/infrastructure/fkm_operations.rb
|
56
69
|
- lib/wolf_core/infrastructure/http_data_source.rb
|
70
|
+
- lib/wolf_core/infrastructure/http_operations.rb
|
71
|
+
- lib/wolf_core/infrastructure/lambda_function_data_source.rb
|
72
|
+
- lib/wolf_core/infrastructure/lambda_function_operations.rb
|
57
73
|
- lib/wolf_core/utils/file_utils.rb
|
58
74
|
- lib/wolf_core/utils/result.rb
|
59
75
|
- lib/wolf_core/version.rb
|
File without changes
|
File without changes
|