wolf_core 1.0.10 → 1.0.12

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: 1fc74c77d74d46328ceaeaa05d8f0bfe2339c5eb8f9c37f781d8a88b4547d5d9
4
- data.tar.gz: 991c1049dd50452777267fdee8edef2c5491c80883c3901bd0313399456838ac
3
+ metadata.gz: 74b0bfee7a6d6e88da4f300634006e48155fe904137816fdc76e377761e32170
4
+ data.tar.gz: 6e5bf56c5bb117e763b0c275bdb2c10bce489f664dabdc33be9d3b87170702b1
5
5
  SHA512:
6
- metadata.gz: e0fdea166f2c88f7294dde457d39194990cdc8750df848ece6056e0830a0020c68e908eb31d91fa5e5b6dc60d8f45caecf0bde0665ef3be58201b66d92e16a2f
7
- data.tar.gz: a0fcaf4480c92f1d0553e88cbfd65372957ed0e47450fa49c73c9f73ecfdd65b2a824cacb205552faf78c95adbf8bec97beef47a8595520c175c5db48ce1c64c
6
+ metadata.gz: ff9b9f4a6795020f54ed3acee822e620e311f9f6e5dec6c07e13e4f3b0adf7cd774341107e2a45726c7de86b267e11c96edc9c51a2cb5c65f7cbd0153ce3ef8d
7
+ data.tar.gz: 36fe8490133a9cb127b7cd14628b27d0797479fcd1c369c2d291ed3c432bdd2982698995f105f8d951dafc9260b3a315a282db4568ce6970e688214bc8db9f11
@@ -0,0 +1,68 @@
1
+ module WolfCore
2
+ module Integrations
3
+ module ClientApiOperations
4
+ include WolfCore::HttpOperations
5
+
6
+ def fetch_client!(wolf_token:, client_id:, tenant:, wolf_platform_url:, error_message:)
7
+ response = safe_http_get(
8
+ headers: { "Authorization" => "Bearer #{wolf_token}" },
9
+ url: "#{wolf_platform_url}/api/v2/clients/#{client_id}",
10
+ query: { tenant: tenant },
11
+ error_message: error_message
12
+ )
13
+ response_body = response.body
14
+ response_body.dig("data", "table", "client")
15
+ end
16
+
17
+ def fetch_client(wolf_token:, client_id:, tenant:, wolf_platform_url:)
18
+ response = parsed_http_get(
19
+ headers: { "Authorization" => "Bearer #{wolf_token}" },
20
+ url: "#{wolf_platform_url}/api/v2/clients/#{client_id}",
21
+ query: { tenant: tenant }
22
+ )
23
+ response_body = response.body
24
+ return unless response_body.instance_of?(Hash)
25
+
26
+ response_body.dig("data", "table", "client")
27
+ end
28
+
29
+ def create_client!(wolf_token:, client:, tenant:, wolf_platform_url:, error_message:)
30
+ safe_http_post(
31
+ headers: { "Authorization" => "Bearer #{wolf_token}" },
32
+ query: { tenant: tenant },
33
+ url: "#{wolf_platform_url}/api/v2/clients",
34
+ body: client,
35
+ error_message: error_message
36
+ )
37
+ end
38
+
39
+ def create_client(wolf_token:, client:, tenant:, wolf_platform_url:)
40
+ parsed_http_post(
41
+ headers: { "Authorization" => "Bearer #{wolf_token}" },
42
+ query: { tenant: tenant },
43
+ url: "#{wolf_platform_url}/api/v2/clients",
44
+ body: client
45
+ )
46
+ end
47
+
48
+ def update_client!(wolf_token:, client:, tenant:, wolf_platform_url:, error_message:, client_id:)
49
+ safe_http_put(
50
+ headers: { "Authorization" => "Bearer #{wolf_token}" },
51
+ query: { tenant: tenant },
52
+ url: "#{wolf_platform_url}/api/v2/clients/#{client_id}",
53
+ body: client,
54
+ error_message: error_message
55
+ )
56
+ end
57
+
58
+ def update_client(wolf_token:, client:, tenant:, wolf_platform_url:, client_id:)
59
+ parsed_http_put(
60
+ headers: { "Authorization" => "Bearer #{wolf_token}" },
61
+ query: { tenant: tenant },
62
+ url: "#{wolf_platform_url}/api/v2/clients/#{client_id}",
63
+ body: client
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.10"
4
+ VERSION = "1.0.12"
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.10
4
+ version: 1.0.12
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-28 00:00:00.000000000 Z
11
+ date: 2024-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -98,6 +98,7 @@ files:
98
98
  - lib/wolf_core/application/burnett/positions_operations/positions_operations.rb
99
99
  - lib/wolf_core/application/exception_operations.rb
100
100
  - lib/wolf_core/application/integrations/change_detection.rb
101
+ - lib/wolf_core/application/integrations/client_api_operations.rb
101
102
  - lib/wolf_core/application/integrations/jobseeker_api_operations.rb
102
103
  - lib/wolf_core/application/integrations/orders_api_operations.rb
103
104
  - lib/wolf_core/application/integrations/routing_operations.rb