inferno_core 0.4.29 → 0.4.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inferno/apps/cli/new.rb +42 -18
- data/lib/inferno/db/migrations/010_add_validator_sessions.rb +14 -0
- data/lib/inferno/db/schema.rb +14 -0
- data/lib/inferno/dsl/fhir_client_builder.rb +1 -1
- data/lib/inferno/dsl/fhir_resource_validation.rb +21 -7
- data/lib/inferno/dsl/http_client_builder.rb +1 -1
- data/lib/inferno/entities/validator_session.rb +22 -0
- data/lib/inferno/entities.rb +1 -0
- data/lib/inferno/jobs/invoke_validator_session.rb +3 -3
- data/lib/inferno/public/175.bundle.js +1 -0
- data/lib/inferno/public/assets.json +1 -1
- data/lib/inferno/public/bundle.js +21 -21
- data/lib/inferno/public/bundle.js.LICENSE.txt +17 -5
- data/lib/inferno/repositories/validator_sessions.rb +58 -0
- data/lib/inferno/repositories.rb +1 -0
- data/lib/inferno/utils/ig_downloader.rb +57 -0
- data/lib/inferno/version.rb +1 -1
- metadata +7 -2
@@ -60,15 +60,27 @@
|
|
60
60
|
*/
|
61
61
|
|
62
62
|
/**
|
63
|
-
* @
|
63
|
+
* @license React
|
64
|
+
* use-sync-external-store-shim.production.min.js
|
65
|
+
*
|
66
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
67
|
+
*
|
68
|
+
* This source code is licensed under the MIT license found in the
|
69
|
+
* LICENSE file in the root directory of this source tree.
|
70
|
+
*/
|
71
|
+
|
72
|
+
/**
|
73
|
+
* @license React
|
74
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
75
|
+
*
|
76
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
64
77
|
*
|
65
|
-
* @license MIT
|
66
78
|
* This source code is licensed under the MIT license found in the
|
67
79
|
* LICENSE file in the root directory of this source tree.
|
68
80
|
*/
|
69
81
|
|
70
82
|
/**
|
71
|
-
* @remix-run/router v1.
|
83
|
+
* @remix-run/router v1.15.2
|
72
84
|
*
|
73
85
|
* Copyright (c) Remix Software Inc.
|
74
86
|
*
|
@@ -79,7 +91,7 @@
|
|
79
91
|
*/
|
80
92
|
|
81
93
|
/**
|
82
|
-
* React Router DOM v6.
|
94
|
+
* React Router DOM v6.22.2
|
83
95
|
*
|
84
96
|
* Copyright (c) Remix Software Inc.
|
85
97
|
*
|
@@ -90,7 +102,7 @@
|
|
90
102
|
*/
|
91
103
|
|
92
104
|
/**
|
93
|
-
* React Router v6.
|
105
|
+
* React Router v6.22.2
|
94
106
|
*
|
95
107
|
* Copyright (c) Remix Software Inc.
|
96
108
|
*
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'base62-rb'
|
2
|
+
require_relative 'repository'
|
3
|
+
|
4
|
+
module Inferno
|
5
|
+
module Repositories
|
6
|
+
class ValidatorSessions < Repository
|
7
|
+
def save(params)
|
8
|
+
validator_session_id = params[:validator_session_id]
|
9
|
+
validator_name = params[:validator_name]
|
10
|
+
test_suite_id = params[:test_suite_id]
|
11
|
+
raw_suite_options = params[:suite_options]
|
12
|
+
time = Time.now
|
13
|
+
|
14
|
+
suite_options =
|
15
|
+
if raw_suite_options.blank?
|
16
|
+
'[]'
|
17
|
+
else
|
18
|
+
raw_suite_options.sort.to_s
|
19
|
+
end
|
20
|
+
|
21
|
+
db.insert_conflict(
|
22
|
+
target: [:test_suite_id,
|
23
|
+
:suite_options,
|
24
|
+
:validator_name],
|
25
|
+
update: { validator_session_id:,
|
26
|
+
test_suite_id:,
|
27
|
+
suite_options:,
|
28
|
+
validator_name: }
|
29
|
+
).insert(
|
30
|
+
id: "#{validator_session_id}_#{validator_name}",
|
31
|
+
validator_session_id:,
|
32
|
+
test_suite_id:,
|
33
|
+
validator_name:,
|
34
|
+
suite_options:,
|
35
|
+
last_accessed: time
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
def find_validator_session_id(test_suite_id, validator_name, suite_options)
|
40
|
+
suite_options = suite_options.nil? ? '[]' : suite_options.sort.to_s
|
41
|
+
session = self.class::Model
|
42
|
+
.find(test_suite_id:, validator_name:, suite_options:)
|
43
|
+
return nil if session.nil?
|
44
|
+
|
45
|
+
time = Time.now
|
46
|
+
session.update(last_accessed: time)
|
47
|
+
session[:validator_session_id]
|
48
|
+
end
|
49
|
+
|
50
|
+
class Model < Sequel::Model(db)
|
51
|
+
def before_save
|
52
|
+
time = Time.now
|
53
|
+
self.last_accessed ||= time
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/inferno/repositories.rb
CHANGED
@@ -0,0 +1,57 @@
|
|
1
|
+
module Inferno
|
2
|
+
module Utils
|
3
|
+
module IgDownloader
|
4
|
+
FHIR_PACKAGE_NAME_REG_EX = /^[a-z][a-zA-Z0-9-]*\.([a-z][a-zA-Z0-9-]*\.?)*/
|
5
|
+
HTTP_URI_REG_EX = %r{^https?://[^/?#]+[^?#]*}
|
6
|
+
FILE_URI_REG_EX = %r{^file://(.+)}
|
7
|
+
HTTP_URI_END_REG_EX = %r{[^/]*\.x?html?$}
|
8
|
+
|
9
|
+
def ig_path
|
10
|
+
File.join('lib', library_name, 'igs')
|
11
|
+
end
|
12
|
+
|
13
|
+
def ig_file(suffix = nil)
|
14
|
+
File.join(ig_path, suffix ? "package_#{suffix}.tgz" : 'package.tgz')
|
15
|
+
end
|
16
|
+
|
17
|
+
def load_ig(ig_input, idx = nil, thor_config = { verbose: true })
|
18
|
+
case ig_input
|
19
|
+
when FHIR_PACKAGE_NAME_REG_EX
|
20
|
+
uri = ig_registry_url(ig_input)
|
21
|
+
when HTTP_URI_REG_EX
|
22
|
+
uri = ig_http_url(ig_input)
|
23
|
+
when FILE_URI_REG_EX
|
24
|
+
uri = ig_input[7..]
|
25
|
+
else
|
26
|
+
raise StandardError, <<~FAILED_TO_LOAD
|
27
|
+
Could not find implementation guide: #{ig_input}
|
28
|
+
Put its package.tgz file directly in #{ig_path}
|
29
|
+
FAILED_TO_LOAD
|
30
|
+
end
|
31
|
+
|
32
|
+
# use Thor's get to support CLI options config
|
33
|
+
get(uri, ig_file(idx), thor_config)
|
34
|
+
uri
|
35
|
+
end
|
36
|
+
|
37
|
+
def ig_registry_url(ig_npm_style)
|
38
|
+
unless ig_npm_style.include? '@'
|
39
|
+
raise StandardError, <<~NO_VERSION
|
40
|
+
No IG version specified for #{ig_npm_style}; you must specify one with '@'. I.e: hl7.fhir.us.core@6.1.0
|
41
|
+
NO_VERSION
|
42
|
+
end
|
43
|
+
|
44
|
+
package_name, version = ig_npm_style.split('@')
|
45
|
+
"https://packages.fhir.org/#{package_name}/-/#{package_name}-#{version}.tgz"
|
46
|
+
end
|
47
|
+
|
48
|
+
def ig_http_url(ig_page_url)
|
49
|
+
return ig_page_url if ig_page_url.end_with? 'package.tgz'
|
50
|
+
|
51
|
+
return "#{ig_page_url}package.tgz" if ig_page_url.end_with? '/'
|
52
|
+
|
53
|
+
ig_page_url.gsub(HTTP_URI_END_REG_EX, 'package.tgz')
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/inferno/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inferno_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen MacVicar
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-
|
13
|
+
date: 2024-03-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -603,6 +603,7 @@ files:
|
|
603
603
|
- lib/inferno/db/migrations/007_add_suite_options.rb
|
604
604
|
- lib/inferno/db/migrations/008_remove_timestamps.rb
|
605
605
|
- lib/inferno/db/migrations/009_add_request_tags.rb
|
606
|
+
- lib/inferno/db/migrations/010_add_validator_sessions.rb
|
606
607
|
- lib/inferno/db/schema.rb
|
607
608
|
- lib/inferno/dsl.rb
|
608
609
|
- lib/inferno/dsl/assertions.rb
|
@@ -637,6 +638,7 @@ files:
|
|
637
638
|
- lib/inferno/entities/test_run.rb
|
638
639
|
- lib/inferno/entities/test_session.rb
|
639
640
|
- lib/inferno/entities/test_suite.rb
|
641
|
+
- lib/inferno/entities/validator_session.rb
|
640
642
|
- lib/inferno/exceptions.rb
|
641
643
|
- lib/inferno/ext/fhir_client.rb
|
642
644
|
- lib/inferno/ext/fhir_models.rb
|
@@ -645,6 +647,7 @@ files:
|
|
645
647
|
- lib/inferno/jobs/invoke_validator_session.rb
|
646
648
|
- lib/inferno/jobs/resume_test_run.rb
|
647
649
|
- lib/inferno/public/0e0b993fd6ff351f435ff1c2938daf2d.png
|
650
|
+
- lib/inferno/public/175.bundle.js
|
648
651
|
- lib/inferno/public/217.bundle.js
|
649
652
|
- lib/inferno/public/a5cd39450ab0336db73c5e57228b649d.png
|
650
653
|
- lib/inferno/public/assets.json
|
@@ -668,9 +671,11 @@ files:
|
|
668
671
|
- lib/inferno/repositories/test_suites.rb
|
669
672
|
- lib/inferno/repositories/tests.rb
|
670
673
|
- lib/inferno/repositories/validate_runnable_reference.rb
|
674
|
+
- lib/inferno/repositories/validator_sessions.rb
|
671
675
|
- lib/inferno/result_summarizer.rb
|
672
676
|
- lib/inferno/spec_support.rb
|
673
677
|
- lib/inferno/test_runner.rb
|
678
|
+
- lib/inferno/utils/ig_downloader.rb
|
674
679
|
- lib/inferno/utils/markdown_formatter.rb
|
675
680
|
- lib/inferno/utils/middleware/request_logger.rb
|
676
681
|
- lib/inferno/utils/migration.rb
|