bmx-event_hook_client_server 1.0.14 → 1.1.1

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
- SHA1:
3
- metadata.gz: f94818f045fc39ccfa040260d12e48ec2c9e6a62
4
- data.tar.gz: 4b8eab2970ef138fa742a2f3be228a3fe4320c72
2
+ SHA256:
3
+ metadata.gz: 63a2c9b7d294adc003637890075284e79795cf9622ece24e9d2016680a3c9e73
4
+ data.tar.gz: 313d800a4cfc2030511b1c1209d73bc7578844f943133f56c496560f18584279
5
5
  SHA512:
6
- metadata.gz: a72784c0984e1e06c35fa49fb6d6e42b69d2ca092e357bda760564981165ec59232ed579ab436d317b7b4f6a2a43ac554bf2988f215477c360f79cfac2d7b536
7
- data.tar.gz: 4921ecc47b6eefbc10a4120f17e3573d2d3f98f021b5dbc49c92add14484bf9b8b357de90c39c1ee6d320ac080772426619c21faaef12951be1f656a183bba97
6
+ metadata.gz: e12ace1b7f12d12482ae2201c558d9c02897f02f797dfb9442df58c7e1f176c057ebbb87a02126b726ac98648e8c8af73d9ac08ddf598f171c9c1e5a19d74237
7
+ data.tar.gz: 7c83b0702aec04828459c4a8fc3dd67f9757a0ca1979484cd98c8042b59870ae3ededd808ae065a6fd4b112321b4d39057574ac799d91fc5b76ef9ceb26c6f66
@@ -1,50 +1,48 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bmx-event_hook_client_server (1.0.13)
4
+ bmx-event_hook_client_server (1.1.1)
5
5
  dry-struct (~> 1.0)
6
- google-protobuf (~> 3.11.4)
7
- grpc (~> 1.27.0)
6
+ google-protobuf (~> 3.14)
7
+ grpc (~> 1.34)
8
8
  retriable (~> 3.1.2)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
13
  coderay (1.1.2)
14
- concurrent-ruby (1.1.6)
14
+ concurrent-ruby (1.1.7)
15
15
  diff-lcs (1.3)
16
- dry-configurable (0.11.2)
16
+ dry-configurable (0.12.0)
17
17
  concurrent-ruby (~> 1.0)
18
- dry-core (~> 0.4, >= 0.4.7)
19
- dry-equalizer (~> 0.2)
18
+ dry-core (~> 0.5, >= 0.5.0)
20
19
  dry-container (0.7.2)
21
20
  concurrent-ruby (~> 1.0)
22
21
  dry-configurable (~> 0.1, >= 0.1.3)
23
- dry-core (0.4.9)
22
+ dry-core (0.5.0)
24
23
  concurrent-ruby (~> 1.0)
25
24
  dry-equalizer (0.3.0)
26
25
  dry-inflector (0.2.0)
27
- dry-logic (1.0.6)
26
+ dry-logic (1.1.0)
28
27
  concurrent-ruby (~> 1.0)
29
- dry-core (~> 0.2)
30
- dry-equalizer (~> 0.2)
28
+ dry-core (~> 0.5, >= 0.5)
31
29
  dry-struct (1.3.0)
32
30
  dry-core (~> 0.4, >= 0.4.4)
33
31
  dry-equalizer (~> 0.3)
34
32
  dry-types (~> 1.3)
35
33
  ice_nine (~> 0.11)
36
- dry-types (1.3.1)
34
+ dry-types (1.4.0)
37
35
  concurrent-ruby (~> 1.0)
38
36
  dry-container (~> 0.3)
39
37
  dry-core (~> 0.4, >= 0.4.4)
40
38
  dry-equalizer (~> 0.3)
41
39
  dry-inflector (~> 0.1, >= 0.1.2)
42
40
  dry-logic (~> 1.0, >= 1.0.2)
43
- google-protobuf (3.11.4)
44
- googleapis-common-protos-types (1.0.4)
45
- google-protobuf (~> 3.0)
46
- grpc (1.27.0)
41
+ google-protobuf (3.14.0)
42
+ googleapis-common-protos-types (1.0.5)
47
43
  google-protobuf (~> 3.11)
44
+ grpc (1.34.0)
45
+ google-protobuf (~> 3.13)
48
46
  googleapis-common-protos-types (~> 1.0)
49
47
  grpc-tools (1.27.0)
50
48
  ice_nine (0.11.2)
@@ -57,9 +57,10 @@ Gem::Specification.new do |spec|
57
57
  spec.require_paths = ['lib']
58
58
 
59
59
  spec.add_dependency 'dry-struct', '~> 1.0'
60
- spec.add_dependency 'google-protobuf', '~> 3.11.4'
61
- spec.add_dependency 'grpc', '~> 1.27.0'
60
+ spec.add_dependency 'google-protobuf', '~> 3.14'
61
+ spec.add_dependency 'grpc', '~> 1.34'
62
62
  spec.add_dependency 'retriable', '~> 3.1.2'
63
+ # spec.add_dependency 'zeitwerk'
63
64
 
64
65
  spec.add_development_dependency 'bundler', '~> 2.0'
65
66
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -40,10 +40,14 @@ module EventHookClientServer
40
40
  'grpc.http2.max_ping_strikes': 0,
41
41
  'grpc.http2.min_time_between_pings_ms': 75 * 100,
42
42
  'grpc.http2.min_ping_interval_without_data_ms': 75 * 100
43
- }
43
+ },
44
+ interceptors: []
44
45
  }.freeze
45
46
  private_constant :DEFAULT_CONFIG
46
47
 
48
+ NON_STUB_OPTIONS = %i[host channel_mode].freeze
49
+ private_constant :NON_STUB_OPTIONS
50
+
47
51
  RETRIABLE_ERRORS = [
48
52
  GRPC::DeadlineExceeded, GRPC::Unavailable, GRPC::ResourceExhausted,
49
53
  GRPC::Unknown
@@ -58,7 +62,11 @@ module EventHookClientServer
58
62
  end
59
63
 
60
64
  def self.default_config
61
- @default_config ||= DEFAULT_CONFIG.dup
65
+ @default_config ||= DEFAULT_CONFIG.dup.tap do |config|
66
+ if defined?(ElasticAPM::GRPC::ClientInterceptor)
67
+ config[:interceptors] << ElasticAPM::GRPC::ClientInterceptor.new
68
+ end
69
+ end
62
70
  end
63
71
 
64
72
  attr_reader :hosts
@@ -91,11 +99,12 @@ module EventHookClientServer
91
99
  end
92
100
 
93
101
  def recreate_grpc_client!
102
+ grpc_options = options.reject { |k, _| NON_STUB_OPTIONS.include?(k) }
103
+
94
104
  @grpc_client = GRPC_CLIENT_CLASS.new(
95
105
  hosts.next,
96
106
  options[:channel_mode],
97
- timeout: options[:timeout],
98
- channel_args: options[:channel_args]
107
+ grpc_options
99
108
  )
100
109
  end
101
110
 
@@ -211,7 +220,7 @@ module EventHookClientServer
211
220
 
212
221
  def retry_on_failure(&block)
213
222
  Retriable
214
- .retriable(on: RETRIABLE_ERRORS, on_retry: method(:rotate_host!)) do
223
+ .retriable(on: RETRIABLE_ERRORS, on_retry: proc { rotate_host! }) do
215
224
  block.call
216
225
  end
217
226
  end
@@ -17,6 +17,7 @@ module EventHookClientServer
17
17
  attribute :building_id, Types::Strict::String.optional
18
18
  attribute :tenant_id, Types::Strict::String.optional
19
19
  attribute :company_id, Types::Strict::String.optional
20
+ attribute :unit_id, Types::Strict::String.optional
20
21
  attribute :integrator, Types::Strict::Symbol
21
22
  attribute :config, Types::Strict::Hash
22
23
  attribute :bindings, Types::Array.of(Binding)
@@ -8,6 +8,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
8
8
  add_enum "event_hook_client_server.v1.enums.Integrator" do
9
9
  value :WEBHOOK, 0
10
10
  value :PDK, 9
11
+ value :AIRBNB, 1
11
12
  end
12
13
  end
13
14
  end
@@ -18,6 +18,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
18
18
  optional :building_id, :message, 10, "google.protobuf.StringValue"
19
19
  optional :tenant_id, :message, 11, "google.protobuf.StringValue"
20
20
  optional :company_id, :message, 12, "google.protobuf.StringValue"
21
+ optional :unit_id, :message, 13, "google.protobuf.StringValue"
21
22
  end
22
23
  add_message "event_hook_client_server.v1.messages.IntegrationConfiguration" do
23
24
  optional :type, :enum, 1, "event_hook_client_server.v1.enums.Integrator"
@@ -34,6 +35,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
34
35
  optional :building_id, :message, 10, "google.protobuf.StringValue"
35
36
  optional :tenant_id, :message, 11, "google.protobuf.StringValue"
36
37
  optional :company_id, :message, 12, "google.protobuf.StringValue"
38
+ optional :unit_id, :message, 13, "google.protobuf.StringValue"
37
39
  end
38
40
  add_message "event_hook_client_server.v1.messages.IntegrationInputConfiguration" do
39
41
  optional :type, :enum, 1, "event_hook_client_server.v1.enums.Integrator"
@@ -80,6 +82,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
80
82
  optional :building_id, :message, 10, "google.protobuf.StringValue"
81
83
  optional :tenant_id, :message, 11, "google.protobuf.StringValue"
82
84
  optional :company_id, :message, 12, "google.protobuf.StringValue"
85
+ optional :unit_id, :message, 13, "google.protobuf.StringValue"
83
86
  end
84
87
  end
85
88
  end
@@ -28,12 +28,17 @@ module EventHookClientServer
28
28
  'grpc.http2.max_ping_strikes': 0,
29
29
  'grpc.http2.min_time_between_pings_ms': 75 * 100,
30
30
  'grpc.http2.min_ping_interval_without_data_ms': 75 * 100
31
- }
31
+ },
32
+ interceptors: []
32
33
  }.freeze
33
34
  private_constant :DEFAULT_CONFIG
34
35
 
35
36
  def self.default_config
36
- @default_config ||= DEFAULT_CONFIG.dup
37
+ @default_config ||= DEFAULT_CONFIG.dup.tap do |config|
38
+ if defined?(ElasticAPM::GRPC::ClientInterceptor)
39
+ config[:interceptors] << ElasticAPM::GRPC::ClientInterceptor.new
40
+ end
41
+ end
37
42
  end
38
43
 
39
44
  attr_writer :logger
@@ -71,6 +76,8 @@ module EventHookClientServer
71
76
  # Defines SHOW, INDEX, CREATE, UPDATE and DELETE methods
72
77
  generic_rpc :integration
73
78
 
79
+ attr_accessor :find_integration_from_headers_handler
80
+
74
81
  def find_integration_from_headers(input, request)
75
82
  process_request(__method__, input, request)
76
83
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module EventHookClientServer
4
4
  MAJOR = 1
5
- MINOR = 0
6
- PATCH = 14
5
+ MINOR = 1
6
+ PATCH = 1
7
7
  VERSION = [MAJOR, MINOR, PATCH].join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmx-event_hook_client_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanko K.R.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-24 00:00:00.000000000 Z
11
+ date: 2021-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.11.4
33
+ version: '3.14'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.11.4
40
+ version: '3.14'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: grpc
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.27.0
47
+ version: '1.34'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.27.0
54
+ version: '1.34'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: retriable
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -165,8 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  requirements: []
168
- rubyforge_project:
169
- rubygems_version: 2.6.14.3
168
+ rubygems_version: 3.1.4
170
169
  signing_key:
171
170
  specification_version: 4
172
171
  summary: Client and server implementation for the Webhook Configurator service.