wolf_core 0.1.11 → 0.1.14
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 +4 -4
- data/lib/wolf_core/application/application_service.rb +4 -3
- data/lib/wolf_core/application/barton/{operations.rb → mappings.rb} +1 -1
- data/lib/wolf_core/application/http_operations.rb +4 -0
- data/lib/wolf_core/infrastructure/http_data_source.rb +6 -0
- data/lib/wolf_core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68ed3dd626a603688fd801d10e0dcf0c6c067cbcc289638d1f7f386ac5761d7d
|
4
|
+
data.tar.gz: 1357c28bb27a238d96daaac2646cfd22b459aa3a1bc6402a14d922a44ea41e48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dfbe5d5103289cf47f8887bf7bca40db000d623ccb987982383578b79a207560320cc4fa0ec0b580265ef17540f560f738420932db5a53a4be2835ab895dcdd
|
7
|
+
data.tar.gz: 78048e2938d41102dce5ff3c19fd9ba9d1ea43d0644cbbb73c722a86a13a800de5f4193677425caf1b3d92d8d64311fde8e362e270c5cc0439b2b13d13831eb9
|
@@ -55,8 +55,9 @@ module WolfCore
|
|
55
55
|
result.data.access_token
|
56
56
|
end
|
57
57
|
|
58
|
-
def get_salesforce_foreign_object(record_id:)
|
58
|
+
def get_salesforce_foreign_object(salesforce_access_token:, record_id:)
|
59
59
|
foreign_object = salesforce_http_get(
|
60
|
+
salesforce_access_token: salesforce_access_token,
|
60
61
|
query: { calltype: 'getRecord', RecordId: record_id }
|
61
62
|
)
|
62
63
|
puts "foreign object is"
|
@@ -64,10 +65,10 @@ module WolfCore
|
|
64
65
|
foreign_object
|
65
66
|
end
|
66
67
|
|
67
|
-
def salesforce_http_get(query: nil)
|
68
|
+
def salesforce_http_get(salesforce_access_token:, query: nil)
|
68
69
|
response = http_get(
|
69
70
|
url: ENV['SALESFORCE_URL'],
|
70
|
-
headers: { 'Authorization' => "Bearer #{
|
71
|
+
headers: { 'Authorization' => "Bearer #{salesforce_access_token}" },
|
71
72
|
query: query
|
72
73
|
)
|
73
74
|
validate_salesforce_response(response)
|
@@ -10,6 +10,10 @@ module WolfCore
|
|
10
10
|
WolfCore::HttpDataSource.http_post(url: url, headers: headers, query: query, body: body)
|
11
11
|
end
|
12
12
|
|
13
|
+
def http_put(url:, headers: {}, body: nil, query: nil)
|
14
|
+
WolfCore::HttpDataSource.http_put(url: url, headers: headers, query: query, body: body)
|
15
|
+
end
|
16
|
+
|
13
17
|
def validate_http_response(response:, message:, error_data: nil)
|
14
18
|
unless response.code == 200
|
15
19
|
error_data = {
|
@@ -11,5 +11,11 @@ module WolfCore
|
|
11
11
|
body = body&.to_json if headers['Content-Type'] == 'application/json'
|
12
12
|
HTTParty.post(url, headers: headers, query: query, body: body)
|
13
13
|
end
|
14
|
+
|
15
|
+
def http_put(url:, headers: {}, query: nil, body: nil)
|
16
|
+
headers['Content-Type'] ||= 'application/json'
|
17
|
+
body = body&.to_json if headers['Content-Type'] == 'application/json'
|
18
|
+
HTTParty.put(url, headers: headers, query: query, body: body)
|
19
|
+
end
|
14
20
|
end
|
15
21
|
end
|
data/lib/wolf_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wolf_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Roncallo
|
@@ -47,7 +47,7 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- lib/wolf_core.rb
|
49
49
|
- lib/wolf_core/application/application_service.rb
|
50
|
-
- lib/wolf_core/application/barton/
|
50
|
+
- lib/wolf_core/application/barton/mappings.rb
|
51
51
|
- lib/wolf_core/application/exception_operations.rb
|
52
52
|
- lib/wolf_core/application/fkm_operations.rb
|
53
53
|
- lib/wolf_core/application/http_operations.rb
|