trophonius 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trophonius_single.rb +32 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cf39904e7500cbacbd16e8f3a78a1df4efa2ded1d64b4c6703c2a1a28c62c9c
|
4
|
+
data.tar.gz: d14b38291d4f6a49b3cd825fabdc82ce676c14d27afc738c80c42c6f61ee7144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9508bca471f2602c71c1d8be927ed848e19d5d937f66a90bb2b71eb8d34bb59f904d3dbc1ffabaa1053c244e29d89ec25e333d83a01c9b6716f91871fee86732
|
7
|
+
data.tar.gz: 2a98ea6373a6c7ac63ba72b0f13a3852ebbaffbbfca9bab5f8e6c4aabd40e534bbc4ac05249bdd5f0c183674444977c5a2e8853e4d8bfd2ec6dd8bcb5d27afac
|
data/lib/trophonius_single.rb
CHANGED
@@ -48,6 +48,38 @@ module Trophonius
|
|
48
48
|
return ret_val
|
49
49
|
end
|
50
50
|
|
51
|
+
def first
|
52
|
+
url =
|
53
|
+
URI(
|
54
|
+
URI.escape(
|
55
|
+
"http#{@config[:ssl] == true ? 's' : ''}://#{@config[:host]}/fmi/data/v1/databases/#{@config[:database]}/layouts/#{
|
56
|
+
@config[:layout_name]
|
57
|
+
}/records?_limit=1"
|
58
|
+
)
|
59
|
+
)
|
60
|
+
|
61
|
+
token = setup_connection
|
62
|
+
response = make_request(url, token, 'get', @query.to_json)
|
63
|
+
|
64
|
+
r_results = response['response']['data']
|
65
|
+
if response['messages'][0]['code'] != '0' && response['messages'][0]['code'] != '401'
|
66
|
+
close_connection(token)
|
67
|
+
Error.throw_error(response['messages'][0]['code'])
|
68
|
+
elsif response['messages'][0]['code'] == '401'
|
69
|
+
close_connection(token)
|
70
|
+
return RecordSet.new(@config[:layout_name], @config[:non_modifiable_fields])
|
71
|
+
else
|
72
|
+
ret_val = RecordSet.new(@config[:layout_name], @config[:non_modifiable_fields])
|
73
|
+
r_results.each do |r|
|
74
|
+
hash = build_result(r)
|
75
|
+
ret_val << hash
|
76
|
+
end
|
77
|
+
end
|
78
|
+
close_connection(token)
|
79
|
+
|
80
|
+
return ret_val
|
81
|
+
end
|
82
|
+
|
51
83
|
def run_script(script:, scriptparameter:)
|
52
84
|
url =
|
53
85
|
URI(
|