wolf_core 0.1.95 → 0.1.97

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e19a6b8b85db964078cb573c3c0a9a70d259ac868b7cf13340646be965d74dde
4
- data.tar.gz: 9ed9bf169bfd6e3d1b98ae11d3338f5aaa5f1546338b10e9a8fbe2e1aa5b8f66
3
+ metadata.gz: b4cc996a7b18eea5664773996e709afcce3f5f1645e7f8feb57e659d0a72b063
4
+ data.tar.gz: cdb96b24ac5894141469a7de98122bb80c6addd171c25f85586d3c5a24e5ae4e
5
5
  SHA512:
6
- metadata.gz: 59d2649c23a0471dfcf230d4d4ac71206fee9b389d2e30a75387ae3784bf0b47b48f37cd92c810ce5e41b5c68201c34b8220c243a33494ee579d058a0fc2f849
7
- data.tar.gz: 72f602f75d91972f8ecfcc0d1d21c77f70dcb84a659fddda7f2d2f8f9bc17121fe772e2b659eadb1f35986bd95c2927a134b93fdae48337a0af8368caf5fb573
6
+ metadata.gz: 329e6f0352682c6b2ff6c9bc4d0fd4fcded60341de35a63fc582afd04c27f02e018b07c499ce6784999e712e834007f80ff504b719a9931182e361f9fee9acb3
7
+ data.tar.gz: 0152cd4ccb41678178a65c78ccfcab6b0d2cd08869d8d33469cbda9c41c92bb335ea55b4db9a2984d7d02633c102b33d759791346ce6760bae2f1d1dfdd10deb
@@ -93,6 +93,13 @@ module WolfCore
93
93
  "Wyoming"=>"WY",
94
94
  }
95
95
 
96
+ DISPLAY_PAY_RATE_UNIT_MAP = {
97
+ 'hour' => 'Hourly',
98
+ 'day' => 'Daily',
99
+ 'week' => 'Weekly',
100
+ 'month' => 'Monthly',
101
+ }
102
+
96
103
  def map_provider_type_to_pricing_id(provider_type)
97
104
  pricing_id = PROVIDER_TYPE_MAPPING[provider_type]
98
105
  pricing_id || provider_type
@@ -136,6 +143,14 @@ module WolfCore
136
143
  def revert_map_state_to_abbreviation(value)
137
144
  STATE_ABBREVIATIONS_MAP.invert[value] || value
138
145
  end
146
+
147
+ def map_display_pay_rate_unit(value)
148
+ DISPLAY_PAY_RATE_UNIT_MAP[value] || value
149
+ end
150
+
151
+ def revert_map_display_pay_rate_unit(value)
152
+ DISPLAY_PAY_RATE_UNIT_MAP.invert[value] || value
153
+ end
139
154
  end
140
155
  end
141
156
  end
@@ -1,6 +1,10 @@
1
1
  module WolfCore
2
2
  module Integrations
3
3
  module RoutingOperations
4
+ include WolfCore::HttpOperations
5
+ include WolfCore::LambdaFunctionOperations
6
+ include WolfCore::ExceptionOperations
7
+
4
8
  def route_event_request(path:, body:)
5
9
  environment = ENV['ENVIRONMENT']
6
10
  if environment == 'production'
@@ -16,7 +16,8 @@ module WolfCore
16
16
  message['event_name']
17
17
  end
18
18
 
19
- def validate_user(event_type:, params:)
19
+ def validate_user(params:)
20
+ event_type = get_event_type(params: params)
20
21
  return if event_type == 'SubscriptionConfirmation'
21
22
 
22
23
  user_id = params.dig('invoker', 'user_id').to_s
@@ -33,6 +34,17 @@ module WolfCore
33
34
  response
34
35
  end
35
36
 
37
+ def process_webhook(params:)
38
+ event_type = get_event_type(params: params)
39
+ event_name = get_event_name(params: params)
40
+ # payload = get_payload(event_type: event_type, params: params)
41
+ if event_type == 'SubscriptionConfirmation'
42
+ url = params['SubscribeURL']
43
+ elsif event_type == 'Notification'
44
+ yield(event_name)
45
+ end
46
+ end
47
+
36
48
  def build_body_from_params(params:, id_key:)
37
49
  params.slice(
38
50
  'event_name', 'payload'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "0.1.95"
4
+ VERSION = "0.1.97"
5
5
  end
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.95
4
+ version: 0.1.97
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-10-04 00:00:00.000000000 Z
11
+ date: 2024-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty