dina 0.4.1.0 → 0.4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dina/json_api_client_patch.rb +11 -0
  3. data/lib/dina/models/{identifier.rb → agent/identifier.rb} +3 -1
  4. data/lib/dina/models/{organization.rb → agent/organization.rb} +1 -1
  5. data/lib/dina/models/{person.rb → agent/person.rb} +1 -1
  6. data/lib/dina/models/{collecting_event.rb → material_sample/collecting_event.rb} +1 -1
  7. data/lib/dina/models/{collecting_method.rb → material_sample/collecting_method.rb} +1 -1
  8. data/lib/dina/models/{collection.rb → material_sample/collection.rb} +1 -1
  9. data/lib/dina/models/{collection_sequence_generator.rb → material_sample/collection_sequence_generator.rb} +1 -1
  10. data/lib/dina/models/{material_sample.rb → material_sample/material_sample.rb} +1 -1
  11. data/lib/dina/models/{organism.rb → material_sample/organism.rb} +1 -1
  12. data/lib/dina/models/{preparation_method.rb → material_sample/preparation_method.rb} +1 -1
  13. data/lib/dina/models/{preparation_type.rb → material_sample/preparation_type.rb} +1 -1
  14. data/lib/dina/models/{project.rb → material_sample/project.rb} +1 -1
  15. data/lib/dina/models/{protocol.rb → material_sample/protocol.rb} +1 -1
  16. data/lib/dina/models/{derivative.rb → object_store/derivative.rb} +1 -1
  17. data/lib/dina/models/{file.rb → object_store/file.rb} +0 -0
  18. data/lib/dina/models/{object_store.rb → object_store/object_store.rb} +1 -1
  19. data/lib/dina/models/{object_store_managed_attribute.rb → object_store/object_store_managed_attribute.rb} +1 -1
  20. data/lib/dina/models/{object_subtype.rb → object_store/object_subtype.rb} +1 -1
  21. data/lib/dina/models/sequence/index_set.rb +19 -0
  22. data/lib/dina/models/sequence/molecular_sample.rb +19 -0
  23. data/lib/dina/models/sequence/ngs_workflow.rb +19 -0
  24. data/lib/dina/models/sequence/pcr_batch.rb +19 -0
  25. data/lib/dina/models/sequence/pcr_primer.rb +19 -0
  26. data/lib/dina/models/sequence/product.rb +19 -0
  27. data/lib/dina/models/sequence/region.rb +19 -0
  28. data/lib/dina/models/sequence/thermocycler_profile.rb +19 -0
  29. data/lib/dina/models/{storage_unit.rb → storage/storage_unit.rb} +1 -1
  30. data/lib/dina/models/{storage_unit_type.rb → storage/storage_unit_type.rb} +1 -1
  31. data/lib/dina/models/{transaction.rb → transaction/transaction.rb} +1 -1
  32. data/lib/dina/version.rb +1 -1
  33. metadata +32 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22dfd46dbbd51273c78e8b7375019e89cc503b13af20cf9abd17961c68809a56
4
- data.tar.gz: f757ac80f3722120a738c40eae3bef2826ec8e3aac48af0645a94e34c091e1b7
3
+ metadata.gz: 868b096ec196f62ae6cf4507cadf08c277b26f462957873140abc93ecf88a1a6
4
+ data.tar.gz: 26c127ec2bf4e6e9c990b4361aff69d1ce9f6a5e578ae01065472e8ede524bf5
5
5
  SHA512:
6
- metadata.gz: 9a72ed340fed58472d60fe7b6c47e7e3fe339378d076c4636f53cb0d32d402b0e8a408c5123bcb79683824bcb6d3d9e55ca9f308d6bbaf820fd88769b8bf4db1
7
- data.tar.gz: 98c98900dcfeeeb17ac1bad224c99ff80d56a060cf9096af16b4eb48e44584617eeaa82d2b4d7e29817256698ee36272c37d3cc65652b4e6b275e9caf91f7c65
6
+ metadata.gz: 9fcd3ceca0594b95caaea14870a0ff6ebc9284fab58eac5e98bd236c04e8235b4fb542c720cba9c394b63b719a4883642f82e0871b347a9a18c5225c8e42e5b6
7
+ data.tar.gz: 95d262c72d8955a9eb944886efcd0784af500f4f8235846bc062a69d5128652e0af0260d85f7243bd608e8d2bd3f895a309cc752baac6b742282f84db658f88e
@@ -0,0 +1,11 @@
1
+ # Monkeypatch the data method because the relations urls in the DINA JSON:API spec are incorrectly formed through its frontend proxy
2
+ module JsonApiClient
3
+ module Associations
4
+ class BaseAssociation
5
+ def data(url)
6
+ url.sub!("/api/v1/", "/api/#{association_class.requestor.instance_variable_get(:@klass).endpoint_path}")
7
+ from_result_set(association_class.requestor.linked(url))
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class Identifier < BaseModel
@@ -8,6 +8,8 @@ module Dina
8
8
  property :createdBy, type: :string
9
9
  property :createdOn, type: :time
10
10
 
11
+ belongs_to :person, shallow_path: true, class_name: "Person"
12
+
11
13
  def self.endpoint_path
12
14
  "agent-api/"
13
15
  end
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class Organization < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class Person < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class CollectingEvent < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class CollectingMethod < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class Collection < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class CollectionSequenceGenerator < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class MaterialSample < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class Organism < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class PreparationMethod < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class PreparationType < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class Project < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class Protocol < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class Derivative < BaseModel
File without changes
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class ObjectStore < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class ObjectStoreManagedAttribute < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class ObjectSubtype < BaseModel
@@ -0,0 +1,19 @@
1
+ require_rel '../base_model'
2
+
3
+ module Dina
4
+ class IndexSet < BaseModel
5
+ property :id, type: :string, default: SecureRandom.uuid
6
+ property :group, type: :string
7
+
8
+ validates_presence_of :group, message: "group is required"
9
+
10
+ def self.endpoint_path
11
+ "seqdb-api/"
12
+ end
13
+
14
+ def self.table_name
15
+ "index-set"
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require_rel '../base_model'
2
+
3
+ module Dina
4
+ class MolecularSample < BaseModel
5
+ property :id, type: :string, default: SecureRandom.uuid
6
+ property :group, type: :string
7
+
8
+ validates_presence_of :group, message: "group is required"
9
+
10
+ def self.endpoint_path
11
+ "seqdb-api/"
12
+ end
13
+
14
+ def self.table_name
15
+ "molecular-sample"
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require_rel '../base_model'
2
+
3
+ module Dina
4
+ class NgsWorkflow < BaseModel
5
+ property :id, type: :string, default: SecureRandom.uuid
6
+ property :group, type: :string
7
+
8
+ validates_presence_of :group, message: "group is required"
9
+
10
+ def self.endpoint_path
11
+ "seqdb-api/"
12
+ end
13
+
14
+ def self.table_name
15
+ "chain"
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require_rel '../base_model'
2
+
3
+ module Dina
4
+ class PcrBatch < BaseModel
5
+ property :id, type: :string, default: SecureRandom.uuid
6
+ property :group, type: :string
7
+
8
+ validates_presence_of :group, message: "group is required"
9
+
10
+ def self.endpoint_path
11
+ "seqdb-api/"
12
+ end
13
+
14
+ def self.table_name
15
+ "pcr-batch"
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require_rel '../base_model'
2
+
3
+ module Dina
4
+ class PcrPrimer < BaseModel
5
+ property :id, type: :string, default: SecureRandom.uuid
6
+ property :group, type: :string
7
+
8
+ validates_presence_of :group, message: "group is required"
9
+
10
+ def self.endpoint_path
11
+ "seqdb-api/"
12
+ end
13
+
14
+ def self.table_name
15
+ "pcr-primer"
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require_rel '../base_model'
2
+
3
+ module Dina
4
+ class Product < BaseModel
5
+ property :id, type: :string, default: SecureRandom.uuid
6
+ property :group, type: :string
7
+
8
+ validates_presence_of :group, message: "group is required"
9
+
10
+ def self.endpoint_path
11
+ "seqdb-api/"
12
+ end
13
+
14
+ def self.table_name
15
+ "product"
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require_rel '../base_model'
2
+
3
+ module Dina
4
+ class Region < BaseModel
5
+ property :id, type: :string, default: SecureRandom.uuid
6
+ property :group, type: :string
7
+
8
+ validates_presence_of :group, message: "group is required"
9
+
10
+ def self.endpoint_path
11
+ "seqdb-api/"
12
+ end
13
+
14
+ def self.table_name
15
+ "region"
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require_rel '../base_model'
2
+
3
+ module Dina
4
+ class ThermocyclerProfile < BaseModel
5
+ property :id, type: :string, default: SecureRandom.uuid
6
+ property :group, type: :string
7
+
8
+ validates_presence_of :group, message: "group is required"
9
+
10
+ def self.endpoint_path
11
+ "seqdb-api/"
12
+ end
13
+
14
+ def self.table_name
15
+ "thermocycler-profile"
16
+ end
17
+
18
+ end
19
+ end
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class StorageUnit < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class StorageUnitType < BaseModel
@@ -1,4 +1,4 @@
1
- require_rel 'base_model'
1
+ require_rel '../base_model'
2
2
 
3
3
  module Dina
4
4
  class Transaction < BaseModel
data/lib/dina/version.rb CHANGED
@@ -3,7 +3,7 @@ module Dina
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 4
6
- PATCH = 1
6
+ PATCH = 2
7
7
  BUILD = 0
8
8
 
9
9
  def self.version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1.0
4
+ version: 0.4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David P. Shorthouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-02 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_api_client
@@ -155,33 +155,42 @@ files:
155
155
  - lib/dina/components/georeference_assertion.rb
156
156
  - lib/dina/components/shipment.rb
157
157
  - lib/dina/exceptions.rb
158
+ - lib/dina/json_api_client_patch.rb
158
159
  - lib/dina/models/acquisition_event.rb
160
+ - lib/dina/models/agent/identifier.rb
161
+ - lib/dina/models/agent/organization.rb
162
+ - lib/dina/models/agent/person.rb
159
163
  - lib/dina/models/assemblage.rb
160
164
  - lib/dina/models/attachment.rb
161
165
  - lib/dina/models/base_model.rb
162
- - lib/dina/models/collecting_event.rb
163
- - lib/dina/models/collecting_method.rb
164
- - lib/dina/models/collection.rb
165
- - lib/dina/models/collection_sequence_generator.rb
166
- - lib/dina/models/derivative.rb
167
- - lib/dina/models/file.rb
168
- - lib/dina/models/identifier.rb
169
166
  - lib/dina/models/institution.rb
170
167
  - lib/dina/models/managed_attribute.rb
171
- - lib/dina/models/material_sample.rb
172
- - lib/dina/models/object_store.rb
173
- - lib/dina/models/object_store_managed_attribute.rb
174
- - lib/dina/models/object_subtype.rb
175
- - lib/dina/models/organism.rb
176
- - lib/dina/models/organization.rb
177
- - lib/dina/models/person.rb
178
- - lib/dina/models/preparation_method.rb
179
- - lib/dina/models/preparation_type.rb
180
- - lib/dina/models/project.rb
181
- - lib/dina/models/protocol.rb
182
- - lib/dina/models/storage_unit.rb
183
- - lib/dina/models/storage_unit_type.rb
184
- - lib/dina/models/transaction.rb
168
+ - lib/dina/models/material_sample/collecting_event.rb
169
+ - lib/dina/models/material_sample/collecting_method.rb
170
+ - lib/dina/models/material_sample/collection.rb
171
+ - lib/dina/models/material_sample/collection_sequence_generator.rb
172
+ - lib/dina/models/material_sample/material_sample.rb
173
+ - lib/dina/models/material_sample/organism.rb
174
+ - lib/dina/models/material_sample/preparation_method.rb
175
+ - lib/dina/models/material_sample/preparation_type.rb
176
+ - lib/dina/models/material_sample/project.rb
177
+ - lib/dina/models/material_sample/protocol.rb
178
+ - lib/dina/models/object_store/derivative.rb
179
+ - lib/dina/models/object_store/file.rb
180
+ - lib/dina/models/object_store/object_store.rb
181
+ - lib/dina/models/object_store/object_store_managed_attribute.rb
182
+ - lib/dina/models/object_store/object_subtype.rb
183
+ - lib/dina/models/sequence/index_set.rb
184
+ - lib/dina/models/sequence/molecular_sample.rb
185
+ - lib/dina/models/sequence/ngs_workflow.rb
186
+ - lib/dina/models/sequence/pcr_batch.rb
187
+ - lib/dina/models/sequence/pcr_primer.rb
188
+ - lib/dina/models/sequence/product.rb
189
+ - lib/dina/models/sequence/region.rb
190
+ - lib/dina/models/sequence/thermocycler_profile.rb
191
+ - lib/dina/models/storage/storage_unit.rb
192
+ - lib/dina/models/storage/storage_unit_type.rb
193
+ - lib/dina/models/transaction/transaction.rb
185
194
  - lib/dina/models/user.rb
186
195
  - lib/dina/search/base_search.rb
187
196
  - lib/dina/search/search.rb