dina 3.1.0.0 → 3.1.1.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1d097058a7482fdd3790d63a02f789084c7e3738bf4c1ef9087629eb7e51d0b
|
4
|
+
data.tar.gz: 388a7c4a2d078f6cf02b00ae7897c5dd5b7368a5fcd3e87923c00131a77cbfe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 002eee0061dc36f6bd91458e5341eb4e492cae8c75b46eb6b77f8c303902a7c845b20f8b8cbb646390b43ffae9cb9a5a5236dc01a89e50eacc84f72405f9a3c2
|
7
|
+
data.tar.gz: f3becc80ee064e41890976e0937414e381071202dd971aca122b1c1ef5c3b26a82ff75875cd07675e0eb86b9ff3b721c2715e809410aadd175277d66a1049801
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require_rel 'endpoint_connection'
|
2
|
+
|
3
|
+
module Dina
|
4
|
+
|
5
|
+
class Endpoint
|
6
|
+
|
7
|
+
def self.material_sample_summary(id:)
|
8
|
+
connection = EndpointConnection.new
|
9
|
+
#TODO: not sure what the /api/ needs to be included here when already present in Dina.config.endpoint_url
|
10
|
+
connection.run(:get, "/api/collection-api/material-sample-summary/" + id)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.resource_name_identifier(name:, type:, group:)
|
14
|
+
params = {
|
15
|
+
"filter[name][EQ]": name,
|
16
|
+
"filter[type][EQ]": type,
|
17
|
+
"filter[group][EQ]": group
|
18
|
+
}
|
19
|
+
connection = EndpointConnection.new
|
20
|
+
response = connection.run(:get, "/api/collection-api/resource-name-identifier", params: params)
|
21
|
+
response["data"][0]["id"] rescue nil
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Dina
|
2
|
+
|
3
|
+
class EndpointConnection
|
4
|
+
|
5
|
+
attr_reader :faraday
|
6
|
+
|
7
|
+
def initialize(options = {})
|
8
|
+
connection_options = options.slice(:proxy, :ssl, :request, :headers, :params)
|
9
|
+
adapter_options = Array(options.fetch(:adapter, Faraday.default_adapter))
|
10
|
+
|
11
|
+
@faraday = Faraday.new(Dina.config.endpoint_url, connection_options) do |builder|
|
12
|
+
builder.request :json
|
13
|
+
builder.response :json
|
14
|
+
builder.adapter(*adapter_options)
|
15
|
+
end
|
16
|
+
yield(self) if block_given?
|
17
|
+
end
|
18
|
+
|
19
|
+
def custom_headers
|
20
|
+
{ content_type: "application/json", authorization: Dina.header }
|
21
|
+
end
|
22
|
+
|
23
|
+
def run(request_method, path, params: nil, headers: {}, body: nil)
|
24
|
+
response = faraday.run_request(request_method, path, body, headers) do |request|
|
25
|
+
request.params.update(params) if params
|
26
|
+
request.headers = custom_headers
|
27
|
+
end
|
28
|
+
response.body
|
29
|
+
end
|
30
|
+
|
31
|
+
def use(*args); end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -30,6 +30,7 @@ module Dina
|
|
30
30
|
property :restrictionFieldsExtension, type: :hash
|
31
31
|
property :restrictionRemarks, type: :string
|
32
32
|
property :isRestricted, type: :boolean
|
33
|
+
property :isBaseForSplitByType, type: :boolean
|
33
34
|
property :materialSampleChildren, type: :array
|
34
35
|
property :associations, type: :array, default: []
|
35
36
|
property :tags, type: :array, default: []
|
data/lib/dina/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dina
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David P. Shorthouse
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json_api_client
|
@@ -161,6 +161,8 @@ files:
|
|
161
161
|
- lib/dina/components/protocol_data_element.rb
|
162
162
|
- lib/dina/components/scheduled_action.rb
|
163
163
|
- lib/dina/components/shipment.rb
|
164
|
+
- lib/dina/endpoints/endpoint.rb
|
165
|
+
- lib/dina/endpoints/endpoint_connection.rb
|
164
166
|
- lib/dina/exceptions.rb
|
165
167
|
- lib/dina/file_patch.rb
|
166
168
|
- lib/dina/json_api_client_patch.rb
|