ruby-sfn-local 0.1.29 → 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: be57c78578b7ddee065c2bcd524f3a8a76fbee4c8f55010fcb2ed08c9daae437
4
- data.tar.gz: '072679be3d8981e2831a27ba5e47bb7b8ca588b779e6aab5ba2a38673e72918e'
3
+ metadata.gz: b1963aa6575f9ccf4b9d0f85dc5d0eb0dc322a30b530b0799e5054ed9dfe8f6d
4
+ data.tar.gz: 94e3c5a1f3d67448fa0fac5c3e2577df9bfd49e00cd4c764c4b1ebc7335e31bb
5
5
  SHA512:
6
- metadata.gz: c62f2e9b6c359688ac144d19b2f0816839e95bd3249683f0df2b5abdedea609638c0238e9d90867792340a1ad159fae0397c3b065a38a520ed54f4d958c1e2c7
7
- data.tar.gz: ae4203012bb56dca90fc2a771e9da7988dc0296995d5db402106da4b70a8230a3bb55078bb230598d45fe0e1b468760fc066da57bc4b78beed0c4f1a4e3968a9
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
@@ -7,7 +7,7 @@ module Sfn
7
7
  data = [data] if data.is_a?(Hash)
8
8
  data.map! do |val|
9
9
  if val.key?(:error)
10
- { Throw: { Error: val[:error], Cause: val[:cause] } }
10
+ { Return: { Error: val[:error], Cause: val[:cause], Status: 'FAILED' } }
11
11
  else
12
12
  val[:output] ||= val[:payload]
13
13
  val[:output] ||= val[:response]
@@ -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,15 +56,7 @@ 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
- end
43
-
44
- def self.secrets_manager_response(data)
45
- SecretsManager.response(data)
46
- end
59
+ end
47
60
 
48
61
  def self.gateway_payload(data)
49
62
  warn '[DEPRECATION] `gateway_payload` is deprecated. Please use `gateway_response` instead.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-sfn-local
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.29
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gianni Mazza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-02 00:00:00.000000000 Z
11
+ date: 2023-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-release
@@ -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