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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f39a29fcb4267d151c127c9cb1bb087225f8bfcec17fcbd86fae7e728509472
4
- data.tar.gz: 96cf6b8922ef7b7bdb6a77fef72f985bd8212f6386f13a214fa8955fd5f62ccb
3
+ metadata.gz: b1963aa6575f9ccf4b9d0f85dc5d0eb0dc322a30b530b0799e5054ed9dfe8f6d
4
+ data.tar.gz: 94e3c5a1f3d67448fa0fac5c3e2577df9bfd49e00cd4c764c4b1ebc7335e31bb
5
5
  SHA512:
6
- metadata.gz: 02cd2a8099569ab7e0cbf86f38b5b95ac325b8ae3912b406709d93bdf09f70d24f82e63da8c7ace09204d4354d47ab5838c9163034548f8c52cab59f9fa73130
7
- data.tar.gz: d40f6ee1da4a101fe4e8e226b450518f24784dcda34e93c5de918b5231a05c71da280fb25df51e12a17c0d5b61b54510cb5550d066ac9ff86e4c0ef6a9d2f028
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
@@ -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 StepFunction
16
- include ApiGateway
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.30
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