wolf_core 1.0.39 → 1.0.41

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: 2d6aa87196de034e063a6e71ab133e07c0c4beddce023d22e928f6258d46175a
4
- data.tar.gz: d9170463e261a59d8d6b3f738795d45e39bb6e9df17e2fa084bc17ae4bea96cb
3
+ metadata.gz: 1275a547fe47eabf28d715c089d6391ce976de1d41b61258028fb7e04b5e1912
4
+ data.tar.gz: ce6376eab7393dfd88f3faa3733af20fdd44fe497254399fba94b4f4e97c45f6
5
5
  SHA512:
6
- metadata.gz: b8a81b5f79b5523277dde12b3d82e503fed8128edaf873edd7cb8549e5df67c034319e3ddd6353501e3cd6b4834d4775c2d863a4c537de355051c5a7d02f9708
7
- data.tar.gz: c66b13fef54ae991629058c5b4b1b72fa1aadd8716a4dbf2943738cedea5302196efc87ac9a75e0f67764b4fcd045d48ced33c0fe3ee0c268b974f7c3ba3b50c
6
+ metadata.gz: 92a5d6ab1ed42950eec43b57710d8f1e2aa2e2407f352b39f766847e254035fb1759df64f5c3540836297af11a3798db5fb957db05bf5de58b284182be8d7aae
7
+ data.tar.gz: 7373c33a8d6c6b35c3f92a15348cb149cc1970ba675651dfba3d88b118a1a99bc7c1eadca1fd91b030acdd19fe91eb3a8520b3214000ed4201b89e327a487020
@@ -7,7 +7,7 @@ module WolfCore
7
7
 
8
8
  def route_event_request(path:, body:)
9
9
  environment = ENV['ENVIRONMENT']
10
- deployable_envs = ['production', 'staging']
10
+ deployable_envs = ['production', 'staging', 'testing']
11
11
  if deployable_envs.include?(environment)
12
12
  function_name = PATH_TO_FUNCTION_NAME_MAPPING[path]
13
13
  raise_service_error("Function name not found for path: #{path}") if function_name.blank?
@@ -17,5 +17,11 @@ module WolfCore
17
17
  body = body&.to_json if headers['Content-Type'] == 'application/json'
18
18
  HTTParty.put(url, headers: headers, query: query, body: body)
19
19
  end
20
+
21
+ def http_patch(url:, headers: {}, query: nil, body: nil)
22
+ headers['Content-Type'] ||= 'application/json'
23
+ body = body&.to_json if headers['Content-Type'] == 'application/json'
24
+ HTTParty.patch(url, headers: headers, query: query, body: body)
25
+ end
20
26
  end
21
27
  end
@@ -96,6 +96,36 @@ module WolfCore
96
96
  WolfCore::HttpDataSource.http_put(url: url, headers: headers, query: query, body: body)
97
97
  end
98
98
 
99
+ def parsed_http_patch(url:, headers: {}, query: nil)
100
+ response = http_patch(url: url, headers: headers, query: query)
101
+ parse_http_response(response)
102
+ end
103
+
104
+ def async_http_patch(**args)
105
+ log_object "starting async_http_patch"
106
+ log_object args, title: "async_http_patch args are"
107
+ run_async do
108
+ response = http_patch(**args)
109
+ log_object parse_http_response(response), title: "async_http_patch response is"
110
+ end
111
+ end
112
+
113
+ def safe_http_patch(url:, headers: {}, query: nil, error_message: nil, title: nil)
114
+ response = http_patch(url: url, headers: headers, query: query)
115
+ response = parse_http_response(response)
116
+
117
+ log_object response, title: title if title.present?
118
+
119
+ error_message ||= "Error on safe_http_patch"
120
+ validate_http_response(response: response, message: error_message)
121
+
122
+ response
123
+ end
124
+
125
+ def http_patch(url:, headers: {}, query: nil)
126
+ WolfCore::HttpDataSource.http_patch(url: url, headers: headers, query: query)
127
+ end
128
+
99
129
  def validate_http_response(response:, message:, error_data: nil)
100
130
  return if response.code == 200
101
131
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.39"
4
+ VERSION = "1.0.41"
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: 1.0.39
4
+ version: 1.0.41
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-11-21 00:00:00.000000000 Z
11
+ date: 2024-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty