ruby-sfn-local 0.1.30 → 0.1.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sfn/mock_macros/native_integration.rb +23 -0
- data/lib/sfn/mock_macros/sdk_integration.rb +19 -0
- data/lib/sfn/mock_macros.rb +25 -12
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1963aa6575f9ccf4b9d0f85dc5d0eb0dc322a30b530b0799e5054ed9dfe8f6d
|
4
|
+
data.tar.gz: 94e3c5a1f3d67448fa0fac5c3e2577df9bfd49e00cd4c764c4b1ebc7335e31bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d89503a3a5c85660c9d24e241c1935b8b0892ad691b1b55a43c262a4e296c30f64274d82a60da1915f41af00f5644502fc26a0154fa86059c25ebb2b96c64f4
|
7
|
+
data.tar.gz: 83eeeab810e932884757cf8efa799a6858ac820528be23bfb35414d6439fcdbe35c0717950a035b8ce3257369b04878f0f9d8c6efa01828842641c4ef28aa738
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sfn
|
4
|
+
module MockMacros
|
5
|
+
module NativeIntegration
|
6
|
+
def self.response(data)
|
7
|
+
data = [data] if data.is_a?(Hash)
|
8
|
+
data.map! do |val|
|
9
|
+
if val.key?(:error)
|
10
|
+
{ Throw: { Error: val[:error], Cause: val[:cause] } }
|
11
|
+
else
|
12
|
+
{ Return: val }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
out = {}
|
16
|
+
data.each_with_index do |val, idx|
|
17
|
+
out[idx.to_s] = val
|
18
|
+
end
|
19
|
+
out
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sfn
|
4
|
+
module MockMacros
|
5
|
+
module SdkIntegration
|
6
|
+
def self.response(data)
|
7
|
+
data = [data] if data.is_a?(Hash)
|
8
|
+
data.map! do |val|
|
9
|
+
{ Return: val.to_json }
|
10
|
+
end
|
11
|
+
out = {}
|
12
|
+
data.each_with_index do |val, idx|
|
13
|
+
out[idx.to_s] = val
|
14
|
+
end
|
15
|
+
out
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/sfn/mock_macros.rb
CHANGED
@@ -1,21 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'sfn/mock_macros/api_gateway'
|
3
4
|
require 'sfn/mock_macros/lambda'
|
5
|
+
require 'sfn/mock_macros/native_integration'
|
4
6
|
require 'sfn/mock_macros/optimised_step_function'
|
7
|
+
require 'sfn/mock_macros/sdk_integration'
|
8
|
+
require 'sfn/mock_macros/secrets_manager'
|
5
9
|
require 'sfn/mock_macros/step_function'
|
6
|
-
require 'sfn/mock_macros/api_gateway'
|
7
10
|
require 'sfn/mock_macros/sns'
|
8
11
|
require 'sfn/mock_macros/sqs'
|
9
|
-
require 'sfn/mock_macros/secrets_manager'
|
10
12
|
|
11
13
|
module Sfn
|
12
14
|
module MockMacros
|
15
|
+
include ApiGateway
|
13
16
|
include Lambda
|
17
|
+
include NativeIntegration
|
14
18
|
include OptimisedStepFunction
|
15
|
-
include
|
16
|
-
include
|
19
|
+
include SdkIntegration
|
20
|
+
include SecretsManager
|
17
21
|
include Sns
|
18
22
|
include Sqs
|
23
|
+
include StepFunction
|
19
24
|
|
20
25
|
def self.gateway_response(data)
|
21
26
|
ApiGateway.response(data)
|
@@ -25,6 +30,22 @@ module Sfn
|
|
25
30
|
Lambda.response(data)
|
26
31
|
end
|
27
32
|
|
33
|
+
def self.native_integration_response(data)
|
34
|
+
NativeIntegration.response(data)
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.optimised_step_function_response(data)
|
38
|
+
OptimisedStepFunction.response(data)
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.sdk_integration_response(data)
|
42
|
+
SdkIntegration.response(data)
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.secrets_manager_response(data)
|
46
|
+
SecretsManager.response(data)
|
47
|
+
end
|
48
|
+
|
28
49
|
def self.sns_response(data)
|
29
50
|
Sns.response(data)
|
30
51
|
end
|
@@ -35,16 +56,8 @@ module Sfn
|
|
35
56
|
|
36
57
|
def self.step_function_response(data, _optimised = false)
|
37
58
|
StepFunction.response(data)
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.optimised_step_function_response(data)
|
41
|
-
OptimisedStepFunction.response(data)
|
42
59
|
end
|
43
60
|
|
44
|
-
def self.secrets_manager_response(data)
|
45
|
-
SecretsManager.response(data)
|
46
|
-
end
|
47
|
-
|
48
61
|
def self.gateway_payload(data)
|
49
62
|
warn '[DEPRECATION] `gateway_payload` is deprecated. Please use `gateway_response` instead.'
|
50
63
|
ApiGateway.response(data)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-sfn-local
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gianni Mazza
|
@@ -69,7 +69,9 @@ files:
|
|
69
69
|
- lib/sfn/mock_macros.rb
|
70
70
|
- lib/sfn/mock_macros/api_gateway.rb
|
71
71
|
- lib/sfn/mock_macros/lambda.rb
|
72
|
+
- lib/sfn/mock_macros/native_integration.rb
|
72
73
|
- lib/sfn/mock_macros/optimised_step_function.rb
|
74
|
+
- lib/sfn/mock_macros/sdk_integration.rb
|
73
75
|
- lib/sfn/mock_macros/secrets_manager.rb
|
74
76
|
- lib/sfn/mock_macros/sns.rb
|
75
77
|
- lib/sfn/mock_macros/sqs.rb
|