wolf_core 1.0.82 → 1.0.84

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: a5665a38040d9f69d16b0a6ddfa152218e1ca037f2473297d054dc351b7cf58d
4
- data.tar.gz: 8a44a545ca63536ef7f8bf23746e0a7be53da7c74755eeb91041eb63a44d27ff
3
+ metadata.gz: 4d7fa6a31a50c43cce5941f2892e68193eea7903d585332783ac0c88277b30fa
4
+ data.tar.gz: 24c484564b6779998fd59ef8a8d87884a83b90a05737952e20d17a597fd61387
5
5
  SHA512:
6
- metadata.gz: c67e2021f8eeb33f71f086059b71356dfa0e3807a06ea79663deb6131aaa995ecf016f4e7ed317a9c1814e4d5d0368a666c4fd5725413c5dc1ef65f6ff9bb38e
7
- data.tar.gz: 159ec35b46e1caeafbd1217f8df1231aaf516bcaed819d3b8c5e0d89979bbe30cc13d625bc15ce4787e52210aaeb6164856da6832d194b162af01e25516917c8
6
+ metadata.gz: 390850d53daea04127dc5c9786960ffeab9c8dbcd56196d1fcc97f2ec051187dc46ef583df56f8e47ba309347b5c1152bf90874fd4d61cd13e38d8f409b7b626
7
+ data.tar.gz: bddd441d1c619c082096e31f0521019a9801086dc193e25bc17092a0f27681f81d1e1bb9170de132e814f06fe0ec5d46ca79bd61dc8760b03db4076c189dfe16
@@ -4,12 +4,14 @@ module WolfCore
4
4
  include WolfCore::HttpOperations
5
5
  include WolfCore::Integrations::CustomValueApiOperations
6
6
 
7
- def fetch_client!(wolf_token:, client_id:, tenant:, wolf_platform_url:, error_message:)
7
+ def fetch_client!(wolf_token:, client_id:, tenant:, wolf_platform_url:, error_message:, error_data: nil)
8
+ error_data ||= {}
8
9
  response = safe_http_get(
9
10
  headers: { "Authorization" => "Bearer #{wolf_token}" },
10
11
  url: "#{wolf_platform_url}/api/v2/companies/#{client_id}",
11
12
  query: { tenant: tenant },
12
- error_message: error_message
13
+ error_message: error_message,
14
+ error_data: { client_id: client_id }.merge(error_data)
13
15
  )
14
16
  response_body = response.body
15
17
  response_body.dig("data", "table", "company")
@@ -23,13 +25,15 @@ module WolfCore
23
25
  )
24
26
  end
25
27
 
26
- def create_client!(wolf_token:, client:, tenant:, wolf_platform_url:, error_message:)
28
+ def create_client!(wolf_token:, client:, tenant:, wolf_platform_url:, error_message:, error_data: nil)
29
+ error_data ||= {}
27
30
  safe_http_post(
28
31
  headers: { "Authorization" => "Bearer #{wolf_token}" },
29
32
  query: { tenant: tenant },
30
33
  url: "#{wolf_platform_url}/api/v2/companies",
31
34
  body: client,
32
- error_message: error_message
35
+ error_message: error_message,
36
+ error_data: { client: client }.merge(error_data)
33
37
  )
34
38
  end
35
39
 
@@ -42,13 +46,15 @@ module WolfCore
42
46
  )
43
47
  end
44
48
 
45
- def update_client!(wolf_token:, client:, tenant:, wolf_platform_url:, error_message:, client_id:)
49
+ def update_client!(wolf_token:, client:, tenant:, wolf_platform_url:, error_message:, client_id:, error_data: nil)
50
+ error_data ||= {}
46
51
  safe_http_put(
47
52
  headers: { "Authorization" => "Bearer #{wolf_token}" },
48
53
  query: { tenant: tenant },
49
54
  url: "#{wolf_platform_url}/api/v2/companies/#{client_id}",
50
55
  body: client,
51
- error_message: error_message
56
+ error_message: error_message,
57
+ error_data: { client_id: client_id, client: client }.merge(error_data)
52
58
  )
53
59
  end
54
60
 
@@ -18,14 +18,14 @@ module WolfCore
18
18
  end
19
19
  end
20
20
 
21
- def safe_http_get(url:, headers: {}, query: nil, error_message: nil, title: nil, timeout: nil)
21
+ def safe_http_get(url:, headers: {}, query: nil, error_message: nil, title: nil, timeout: nil, error_data: nil)
22
22
  response = http_get(url: url, headers: headers, query: query, timeout: timeout)
23
23
  response = parse_http_response(response)
24
24
 
25
25
  log_object response, title: title if title.present?
26
26
 
27
27
  error_message ||= "Error on safe_http_get"
28
- validate_http_response(response: response, message: error_message)
28
+ validate_http_response(response: response, message: error_message, error_data: error_data)
29
29
 
30
30
  response
31
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.82"
4
+ VERSION = "1.0.84"
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.82
4
+ version: 1.0.84
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-04 00:00:00.000000000 Z
11
+ date: 2025-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty