mihari 5.7.0 → 5.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/lib/mihari/actor.rb +10 -4
  4. data/lib/mihari/commands/alert.rb +6 -4
  5. data/lib/mihari/commands/search.rb +10 -29
  6. data/lib/mihari/enrichers/ipinfo.rb +1 -1
  7. data/lib/mihari/entities/tag.rb +1 -0
  8. data/lib/mihari/rule.rb +14 -0
  9. data/lib/mihari/service.rb +12 -2
  10. data/lib/mihari/services/alert_builder.rb +81 -8
  11. data/lib/mihari/services/alert_runner.rb +3 -10
  12. data/lib/mihari/services/rule_builder.rb +8 -10
  13. data/lib/mihari/services/rule_runner.rb +2 -25
  14. data/lib/mihari/structs/binaryedge.rb +9 -0
  15. data/lib/mihari/structs/censys.rb +0 -14
  16. data/lib/mihari/structs/fofa.rb +3 -0
  17. data/lib/mihari/structs/google_public_dns.rb +0 -4
  18. data/lib/mihari/structs/greynoise.rb +0 -6
  19. data/lib/mihari/structs/hunterhow.rb +0 -6
  20. data/lib/mihari/structs/ipinfo.rb +0 -2
  21. data/lib/mihari/structs/onyphe.rb +0 -4
  22. data/lib/mihari/structs/shodan.rb +0 -2
  23. data/lib/mihari/structs/urlscan.rb +0 -6
  24. data/lib/mihari/structs/virustotal_intelligence.rb +0 -8
  25. data/lib/mihari/version.rb +1 -1
  26. data/lib/mihari/web/app.rb +20 -17
  27. data/lib/mihari/web/endpoints/alerts.rb +75 -38
  28. data/lib/mihari/web/endpoints/artifacts.rb +60 -53
  29. data/lib/mihari/web/endpoints/ip_addresses.rb +19 -4
  30. data/lib/mihari/web/endpoints/rules.rb +132 -88
  31. data/lib/mihari/web/endpoints/tags.rb +15 -13
  32. data/lib/mihari/web/public/assets/{index-821134e2.js → index-07fafab5.js} +4 -3
  33. data/lib/mihari/web/public/index.html +1 -1
  34. data/lib/mihari.rb +0 -1
  35. data/mihari.gemspec +1 -1
  36. data/mkdocs.yml +1 -0
  37. metadata +3 -130
  38. data/docs/alternatives.md +0 -5
  39. data/docs/analyzers/binaryedge.md +0 -26
  40. data/docs/analyzers/censys.md +0 -31
  41. data/docs/analyzers/circl.md +0 -37
  42. data/docs/analyzers/crtsh.md +0 -26
  43. data/docs/analyzers/dnstwister.md +0 -25
  44. data/docs/analyzers/feed.md +0 -73
  45. data/docs/analyzers/fofa.md +0 -31
  46. data/docs/analyzers/greynoise.md +0 -26
  47. data/docs/analyzers/hunterhow.md +0 -33
  48. data/docs/analyzers/index.md +0 -104
  49. data/docs/analyzers/onyphe.md +0 -26
  50. data/docs/analyzers/otx.md +0 -28
  51. data/docs/analyzers/passivetotal.md +0 -52
  52. data/docs/analyzers/pulsedive.md +0 -28
  53. data/docs/analyzers/securitytrails.md +0 -41
  54. data/docs/analyzers/shodan.md +0 -26
  55. data/docs/analyzers/urlscan.md +0 -28
  56. data/docs/analyzers/virustotal.md +0 -43
  57. data/docs/analyzers/virustotal_intelligence.md +0 -33
  58. data/docs/analyzers/zoomeye.md +0 -38
  59. data/docs/configuration.md +0 -35
  60. data/docs/emitters/database.md +0 -22
  61. data/docs/emitters/hive.md +0 -26
  62. data/docs/emitters/index.md +0 -36
  63. data/docs/emitters/misp.md +0 -21
  64. data/docs/emitters/slack.md +0 -21
  65. data/docs/emitters/webhook.md +0 -63
  66. data/docs/enrichers/google_public_dns.md +0 -19
  67. data/docs/enrichers/index.md +0 -35
  68. data/docs/enrichers/ipinfo.md +0 -26
  69. data/docs/enrichers/shodan.md +0 -22
  70. data/docs/enrichers/whois.md +0 -17
  71. data/docs/github_actions.md +0 -43
  72. data/docs/index.md +0 -11
  73. data/docs/installation.md +0 -31
  74. data/docs/requirements.md +0 -13
  75. data/docs/rule.md +0 -168
  76. data/docs/tags.md +0 -3
  77. data/docs/usage.md +0 -103
  78. data/frontend/.eslintrc.cjs +0 -22
  79. data/frontend/.gitignore +0 -31
  80. data/frontend/.prettierrc.json +0 -8
  81. data/frontend/README.md +0 -3
  82. data/frontend/env.d.ts +0 -5
  83. data/frontend/index.html +0 -21
  84. data/frontend/package-lock.json +0 -7219
  85. data/frontend/package.json +0 -67
  86. data/frontend/public/favicon.ico +0 -0
  87. data/frontend/scripts/swagger_doc_to_yaml.rb +0 -23
  88. data/frontend/src/App.vue +0 -27
  89. data/frontend/src/ace-config.ts +0 -6
  90. data/frontend/src/api-helper.ts +0 -111
  91. data/frontend/src/api.ts +0 -105
  92. data/frontend/src/components/ErrorMessage.vue +0 -31
  93. data/frontend/src/components/Loading.vue +0 -15
  94. data/frontend/src/components/Navbar.vue +0 -42
  95. data/frontend/src/components/Pagination.vue +0 -119
  96. data/frontend/src/components/alert/Alert.vue +0 -87
  97. data/frontend/src/components/alert/Alerts.vue +0 -63
  98. data/frontend/src/components/alert/AlertsWithPagination.vue +0 -90
  99. data/frontend/src/components/alert/AlertsWrapper.vue +0 -128
  100. data/frontend/src/components/alert/Form.vue +0 -169
  101. data/frontend/src/components/artifact/AS.vue +0 -23
  102. data/frontend/src/components/artifact/Artifact.vue +0 -287
  103. data/frontend/src/components/artifact/ArtifactTag.vue +0 -64
  104. data/frontend/src/components/artifact/ArtifactTags.vue +0 -29
  105. data/frontend/src/components/artifact/ArtifactWrapper.vue +0 -57
  106. data/frontend/src/components/artifact/CPEs.vue +0 -23
  107. data/frontend/src/components/artifact/DnsRecords.vue +0 -32
  108. data/frontend/src/components/artifact/Ports.vue +0 -23
  109. data/frontend/src/components/artifact/ReverseDnsNames.vue +0 -23
  110. data/frontend/src/components/artifact/Tags.vue +0 -29
  111. data/frontend/src/components/artifact/WhoisRecord.vue +0 -44
  112. data/frontend/src/components/config/Configs.vue +0 -65
  113. data/frontend/src/components/config/ConfigsWrapper.vue +0 -32
  114. data/frontend/src/components/link/Link.vue +0 -32
  115. data/frontend/src/components/link/Links.vue +0 -42
  116. data/frontend/src/components/rule/EditRule.vue +0 -72
  117. data/frontend/src/components/rule/EditRuleWrapper.vue +0 -48
  118. data/frontend/src/components/rule/Form.vue +0 -158
  119. data/frontend/src/components/rule/InputForm.vue +0 -45
  120. data/frontend/src/components/rule/NewRule.vue +0 -57
  121. data/frontend/src/components/rule/Rule.vue +0 -100
  122. data/frontend/src/components/rule/RuleWrapper.vue +0 -53
  123. data/frontend/src/components/rule/Rules.vue +0 -84
  124. data/frontend/src/components/rule/RulesWrapper.vue +0 -121
  125. data/frontend/src/components/rule/YAML.vue +0 -37
  126. data/frontend/src/components/tag/Tag.vue +0 -65
  127. data/frontend/src/components/tag/Tags.vue +0 -37
  128. data/frontend/src/countries.ts +0 -350
  129. data/frontend/src/index.ts +0 -20
  130. data/frontend/src/links/anyrun.ts +0 -19
  131. data/frontend/src/links/base.ts +0 -14
  132. data/frontend/src/links/censys.ts +0 -20
  133. data/frontend/src/links/crtsh.ts +0 -20
  134. data/frontend/src/links/dnslytics.ts +0 -38
  135. data/frontend/src/links/greynoise.ts +0 -20
  136. data/frontend/src/links/index.ts +0 -40
  137. data/frontend/src/links/intezer.ts +0 -20
  138. data/frontend/src/links/otx.ts +0 -33
  139. data/frontend/src/links/securitytrails.ts +0 -38
  140. data/frontend/src/links/shodan.ts +0 -20
  141. data/frontend/src/links/urlscan.ts +0 -50
  142. data/frontend/src/links/virustotal.ts +0 -72
  143. data/frontend/src/main.ts +0 -41
  144. data/frontend/src/router/index.ts +0 -57
  145. data/frontend/src/rule.ts +0 -14
  146. data/frontend/src/shims-vue.d.ts +0 -6
  147. data/frontend/src/swagger.yaml +0 -771
  148. data/frontend/src/types.ts +0 -188
  149. data/frontend/src/utils.ts +0 -54
  150. data/frontend/src/views/Alerts.vue +0 -20
  151. data/frontend/src/views/Artifact.vue +0 -39
  152. data/frontend/src/views/Configs.vue +0 -20
  153. data/frontend/src/views/EditRule.vue +0 -39
  154. data/frontend/src/views/NewRule.vue +0 -26
  155. data/frontend/src/views/Rule.vue +0 -39
  156. data/frontend/src/views/Rules.vue +0 -20
  157. data/frontend/tests/utils.spec.ts +0 -9
  158. data/frontend/tsconfig.app.json +0 -21
  159. data/frontend/tsconfig.json +0 -14
  160. data/frontend/tsconfig.node.json +0 -13
  161. data/frontend/tsconfig.vitest.json +0 -12
  162. data/frontend/vite.config.ts +0 -24
  163. data/frontend/vitest.config.ts +0 -21
  164. data/lib/mihari/services/alert_proxy.rb +0 -97
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f226f30917400448aecfc83808609ff3eb180228c2d10d797d3409cc3ecdb9c0
4
- data.tar.gz: 5ce20637fed160cdecb7d8c22726b44670834843f2e77f5ef235f943a6321701
3
+ metadata.gz: 2d27340b82929d2a9dba6cab93c9e429112eed2f254f18595b765bd65852cdfa
4
+ data.tar.gz: 137141dad2d1b3c4f5b33a2ed38824a9e19c965c7d13e99d20358c2d546dd24c
5
5
  SHA512:
6
- metadata.gz: 3900c2cc6a8ac2010b4579f574be0ce4d620a180dcfadf00c97b7597a7bccd79de9efdfdce402b40f06d7afeaaec0062210796391123e3a145f54d3be4270261
7
- data.tar.gz: 7655638dd621bf03f0d9178eb2e0ca6bf4d161b6563c266380d3cc8bf37bef692bc06765ef3050aaf7683a0f1be2ca51d8a9d7e7c3f34a9e184389fcd31b2885
6
+ metadata.gz: 84825a14e57d1e740d7ee1e312ac23454017665b92dbdbe9fd2fe0cb55eb900addda0d9563049cf493094b67e9f1e5888d09fe37e7a102db5732f09837558fec
7
+ data.tar.gz: 393031f2550d7943271dd4b662c65b1da2df322661cdf1228808848e93f7bb7f65acaf8d1861599036bd951b464b5248f615e2abd738b171699eaf396b64f7c4
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ Style/HashSyntax:
3
3
  Style/StringLiterals:
4
4
  EnforcedStyle: double_quotes
5
5
  Metrics/BlockLength:
6
- Max: 100
6
+ Max: 150
7
7
  Exclude:
8
8
  - "spec/**/*"
9
9
  - "*.gemspec"
data/lib/mihari/actor.rb CHANGED
@@ -2,9 +2,11 @@
2
2
 
3
3
  module Mihari
4
4
  #
5
- # Base class for Analyzer, Emitter and Enricher
5
+ # Yet another base service class for Analyzer, Emitter and Enricher
6
6
  #
7
- class Actor < Service
7
+ class Actor
8
+ include Dry::Monads[:result, :try]
9
+
8
10
  include Mixins::Configurable
9
11
  include Mixins::Retriable
10
12
 
@@ -57,13 +59,17 @@ module Mihari
57
59
  raise ConfigurationError, message
58
60
  end
59
61
 
60
- def result
62
+ def call(*args, **kwargs)
63
+ raise NotImplementedError, "You must implement #{self.class}##{__method__}"
64
+ end
65
+
66
+ def result(...)
61
67
  Try[StandardError] do
62
68
  retry_on_error(
63
69
  times: retry_times,
64
70
  interval: retry_interval,
65
71
  exponential_backoff: retry_exponential_backoff
66
- ) { call }
72
+ ) { call(...) }
67
73
  end.to_result
68
74
  end
69
75
 
@@ -17,11 +17,13 @@ module Mihari
17
17
  #
18
18
  def add(path)
19
19
  Mihari::Database.with_db_connection do
20
- builder = Services::AlertBuilder.new(path)
21
-
22
- runner_result_l = ->(proxy) { Services::AlertRunner.new(proxy).result }
23
- result = builder.result.bind(runner_result_l)
20
+ result = Dry::Monads::Try[StandardError] do
21
+ # @type [Mihari::Services::AlertProxy]
22
+ proxy = Mihari::Services::AlertBuilder.call(path)
23
+ Mihari::Services::AlertRunner.call(proxy)
24
+ end.to_result
24
25
 
26
+ # @type [Mihari::Models::Alert]
25
27
  alert = result.value!
26
28
  data = Entities::Alert.represent(alert)
27
29
  puts JSON.pretty_generate(data.as_json)
@@ -20,43 +20,24 @@ module Mihari
20
20
  #
21
21
  def search(path_or_id)
22
22
  Mihari::Database.with_db_connection do
23
- builder = Services::RuleBuilder.new(path_or_id)
23
+ result = Dry::Monads::Try[StandardError] do
24
+ # @type [Mihari::Rule]
25
+ rule = Services::RuleBuilder.call(path_or_id)
24
26
 
25
- check_diff_l = ->(rule) { check_diff rule }
26
- update_and_call_l = ->(runner) { update_and_call runner }
27
+ force_overwrite = options["force_overwrite"] || false
28
+ message = "There is a diff in the rule. Are you sure you want to overwrite the rule? (y/n)"
29
+ exit 0 if rule.diff? && !force_overwrite && !yes?(message)
27
30
 
28
- result = builder.result.bind(check_diff_l).bind(update_and_call_l)
31
+ rule.update_or_create
32
+ rule.call
33
+ end.to_result
29
34
 
35
+ # @type [Mihari::Models::Alert]
30
36
  alert = result.value!
31
37
  data = Entities::Alert.represent(alert)
32
38
  puts JSON.pretty_generate(data.as_json)
33
39
  end
34
40
  end
35
-
36
- no_commands do
37
- #
38
- # @param [Mihari::RuleRunner] rule
39
- #
40
- def check_diff(rule)
41
- force_overwrite = options["force_overwrite"] || false
42
- message = "There is a diff in the rule. Are you sure you want to overwrite the rule? (y/n)"
43
- runner = Services::RuleRunner.new(rule)
44
-
45
- exit 0 if runner.diff? && !force_overwrite && !yes?(message)
46
-
47
- Success runner
48
- end
49
-
50
- #
51
- # @param [Mihari::RuleRunner] runner
52
- #
53
- def update_and_call(runner)
54
- Dry::Monads::Try[StandardError] do
55
- runner.update_or_create
56
- runner.call
57
- end.to_result
58
- end
59
- end
60
41
  end
61
42
  end
62
43
  end
@@ -28,7 +28,7 @@ module Mihari
28
28
  #
29
29
  # @param [String] ip
30
30
  #
31
- # @return [Mihari::Structs::IPInfo::Response, nil]
31
+ # @return [Mihari::Structs::IPInfo::Response]
32
32
  #
33
33
  def call(ip)
34
34
  url = "https://ipinfo.io/#{ip}/json"
@@ -3,6 +3,7 @@
3
3
  module Mihari
4
4
  module Entities
5
5
  class Tag < Grape::Entity
6
+ expose :id, documentation: { type: Integer, required: true }
6
7
  expose :name, documentation: { type: String, required: true }
7
8
  end
8
9
 
data/lib/mihari/rule.rb CHANGED
@@ -218,6 +218,20 @@ module Mihari
218
218
  )
219
219
  end
220
220
 
221
+ #
222
+ # @return [Boolean]
223
+ #
224
+ def diff?
225
+ model = Mihari::Models::Rule.find(id)
226
+ model.data != data.deep_stringify_keys
227
+ rescue ActiveRecord::RecordNotFound
228
+ false
229
+ end
230
+
231
+ def update_or_create
232
+ model.save
233
+ end
234
+
221
235
  class << self
222
236
  #
223
237
  # Load rule from YAML string
@@ -9,8 +9,18 @@ module Mihari
9
9
  raise NotImplementedError, "You must implement #{self.class}##{__method__}"
10
10
  end
11
11
 
12
- def result
13
- Try[StandardError] { call }.to_result
12
+ def result(...)
13
+ Try[StandardError] { call(...) }.to_result
14
+ end
15
+
16
+ class << self
17
+ def call(...)
18
+ new.call(...)
19
+ end
20
+
21
+ def result(...)
22
+ new.result(...)
23
+ end
14
24
  end
15
25
  end
16
26
  end
@@ -9,23 +9,90 @@ require "yaml"
9
9
  module Mihari
10
10
  module Services
11
11
  #
12
- # Alert builder
12
+ # Alert proxy
13
13
  #
14
- class AlertBuilder < Service
15
- # @return [String]
16
- attr_reader :path
14
+ class AlertProxy
15
+ # @return [Hash]
16
+ attr_reader :data
17
+
18
+ # @return [Array, nil]
19
+ attr_reader :errors
17
20
 
18
21
  #
19
22
  # Initialize
20
23
  #
21
- # @param [String] path
24
+ # @param [Hash] data
22
25
  #
23
- def initialize(path)
26
+ def initialize(**data)
24
27
  super()
25
28
 
26
- @path = path
29
+ @data = data.deep_symbolize_keys
30
+ @errors = nil
31
+
32
+ validate!
33
+ end
34
+
35
+ #
36
+ # @return [Boolean]
37
+ #
38
+ def errors?
39
+ return false if @errors.nil?
40
+
41
+ !@errors.empty?
42
+ end
43
+
44
+ def validate!
45
+ contract = Schemas::AlertContract.new
46
+ result = contract.call(data)
47
+
48
+ @data = result.to_h
49
+ @errors = result.errors
50
+
51
+ raise ValidationError.new("Validation failed", errors) if errors?
52
+ end
53
+
54
+ def [](key)
55
+ data key.to_sym
56
+ end
57
+
58
+ #
59
+ # @return [String]
60
+ #
61
+ def rule_id
62
+ @rule_id ||= data[:rule_id]
63
+ end
64
+
65
+ #
66
+ # @return [Array<Mihari::Models::Artifact>]
67
+ #
68
+ def artifacts
69
+ @artifacts ||= data[:artifacts].map do |data|
70
+ artifact = Models::Artifact.new(data: data)
71
+ artifact.rule_id = rule_id
72
+ artifact
73
+ end.uniq(&:data).select(&:valid?)
74
+ end
75
+
76
+ #
77
+ # @return [Mihari::Rule]
78
+ #
79
+ def rule
80
+ @rule ||= [].tap do |out|
81
+ data = Mihari::Models::Rule.find(rule_id).data
82
+ out << Rule.new(**data)
83
+ end.first
27
84
  end
85
+ end
86
+
87
+ #
88
+ # Alert builder
89
+ #
90
+ class AlertBuilder < Service
91
+ # @return [String]
92
+ attr_reader :path
28
93
 
94
+ #
95
+ # @param [String] path
29
96
  #
30
97
  # @return [Hash]
31
98
  #
@@ -38,7 +105,13 @@ module Mihari
38
105
  )
39
106
  end
40
107
 
41
- def call
108
+ #
109
+ # @param [String] path
110
+ #
111
+ # @return [Mihari::AlertProxy]
112
+ #
113
+ def call(path)
114
+ @path = path
42
115
  AlertProxy.new(**data)
43
116
  end
44
117
  end
@@ -6,19 +6,12 @@ module Mihari
6
6
  # Alert runner
7
7
  #
8
8
  class AlertRunner < Service
9
- # @return [Mihari::Services::AlertProxy]
10
- attr_reader :alert
11
-
12
- def initialize(alert)
13
- super()
14
-
15
- @alert = alert
16
- end
17
-
9
+ #
10
+ # @param [Mihari::Services::AlertProxy] alert
18
11
  #
19
12
  # @return [Mihari::Models::Alert]
20
13
  #
21
- def call
14
+ def call(alert)
22
15
  emitter = Emitters::Database.new(rule: alert.rule)
23
16
  emitter.call alert.artifacts
24
17
  end
@@ -14,17 +14,8 @@ module Mihari
14
14
  # @return [String]
15
15
  attr_reader :path_or_id
16
16
 
17
- #
18
- # Initialize
19
17
  #
20
18
  # @param [String] path_or_id
21
- #
22
- def initialize(path_or_id)
23
- super()
24
-
25
- @path_or_id = path_or_id
26
- end
27
-
28
19
  #
29
20
  # @return [Hash]
30
21
  #
@@ -42,7 +33,14 @@ module Mihari
42
33
  )
43
34
  end
44
35
 
45
- def call
36
+ #
37
+ # @param [String] path_or_id
38
+ #
39
+ # @return [Mihari::Rule]
40
+ #
41
+ def call(path_or_id)
42
+ @path_or_id = path_or_id
43
+
46
44
  Rule.new(**data)
47
45
  end
48
46
  end
@@ -6,35 +6,12 @@ module Mihari
6
6
  # Rule runner
7
7
  #
8
8
  class RuleRunner < Service
9
- include Dry::Monads[:result, :try]
10
-
11
- # @return [Mihari::Rule]
12
- attr_reader :rule
13
-
14
- def initialize(rule)
15
- super()
16
-
17
- @rule = rule
18
- end
19
-
20
9
  #
21
- # @return [Boolean]
22
- #
23
- def diff?
24
- model = Mihari::Models::Rule.find(rule.id)
25
- model.data != rule.data.deep_stringify_keys
26
- rescue ActiveRecord::RecordNotFound
27
- false
28
- end
29
-
30
- def update_or_create
31
- rule.model.save
32
- end
33
-
10
+ # @params [Mihari::Rule]
34
11
  #
35
12
  # @return [Mihari::Models::Alert, nil]
36
13
  #
37
- def call
14
+ def call(rule)
38
15
  rule.call
39
16
  end
40
17
  end
@@ -9,6 +9,9 @@ module Mihari
9
9
  attribute :ip, Types::String
10
10
 
11
11
  class << self
12
+ #
13
+ # @param [Hash] d
14
+ #
12
15
  def from_dynamic!(d)
13
16
  d = Types::Hash[d]
14
17
  new(
@@ -24,6 +27,9 @@ module Mihari
24
27
  attribute :target, Target
25
28
 
26
29
  class << self
30
+ #
31
+ # @param [Hash] d
32
+ #
27
33
  def from_dynamic!(d)
28
34
  d = Types::Hash[d]
29
35
  new(
@@ -58,6 +64,9 @@ module Mihari
58
64
  end
59
65
 
60
66
  class << self
67
+ #
68
+ # @param [Hash] d
69
+ #
61
70
  def from_dynamic!(d)
62
71
  d = Types::Hash[d]
63
72
  new(
@@ -21,8 +21,6 @@ module Mihari
21
21
  #
22
22
  # @param [Hash] d
23
23
  #
24
- # @return [AutonomousSystem]
25
- #
26
24
  def from_dynamic!(d)
27
25
  d = Types::Hash[d]
28
26
  new(
@@ -59,8 +57,6 @@ module Mihari
59
57
  #
60
58
  # @param [Hash] d
61
59
  #
62
- # @return [Location]
63
- #
64
60
  def from_dynamic!(d)
65
61
  d = Types::Hash[d]
66
62
  new(
@@ -87,8 +83,6 @@ module Mihari
87
83
  #
88
84
  # @param [Hash] d
89
85
  #
90
- # @return [Service]
91
- #
92
86
  def from_dynamic!(d)
93
87
  d = Types::Hash[d]
94
88
  new(
@@ -143,8 +137,6 @@ module Mihari
143
137
  #
144
138
  # @param [Hash] d
145
139
  #
146
- # @return [Hit]
147
- #
148
140
  def from_dynamic!(d)
149
141
  d = Types::Hash[d]
150
142
  new(
@@ -171,8 +163,6 @@ module Mihari
171
163
  #
172
164
  # @param [Hash] d
173
165
  #
174
- # @return [Links]
175
- #
176
166
  def from_dynamic!(d)
177
167
  d = Types::Hash[d]
178
168
  new(
@@ -211,8 +201,6 @@ module Mihari
211
201
  #
212
202
  # @param [Hash] d
213
203
  #
214
- # @return [Result]
215
- #
216
204
  def from_dynamic!(d)
217
205
  d = Types::Hash[d]
218
206
  new(
@@ -242,8 +230,6 @@ module Mihari
242
230
  #
243
231
  # @param [Hash] d
244
232
  #
245
- # @return [Response]
246
- #
247
233
  def from_dynamic!(d)
248
234
  d = Types::Hash[d]
249
235
  new(
@@ -27,6 +27,9 @@ module Mihari
27
27
  attribute? :results, Types.Array(Types.Array(Types::String)).optional
28
28
 
29
29
  class << self
30
+ #
31
+ # @param [Hash] d
32
+ #
30
33
  def from_dynamic!(d)
31
34
  new(
32
35
  error: d.fetch("error"),
@@ -28,8 +28,6 @@ module Mihari
28
28
  #
29
29
  # @param [Hash] d
30
30
  #
31
- # @return [Answer]
32
- #
33
31
  def from_dynamic!(d)
34
32
  d = Types::Hash[d]
35
33
  resource_type = INT_TYPE_TO_TYPE[d.fetch("type")]
@@ -51,8 +49,6 @@ module Mihari
51
49
  #
52
50
  # @param [Hash] d
53
51
  #
54
- # @return [Response]
55
- #
56
52
  def from_dynamic!(d)
57
53
  d = Types::Hash[d]
58
54
  new(
@@ -39,8 +39,6 @@ module Mihari
39
39
  #
40
40
  # @param [Hash] d
41
41
  #
42
- # @return [Metadata]
43
- #
44
42
  def from_dynamic!(d)
45
43
  d = Types::Hash[d]
46
44
  new(
@@ -81,8 +79,6 @@ module Mihari
81
79
  #
82
80
  # @param [Hash] d
83
81
  #
84
- # @return [Datum]
85
- #
86
82
  def from_dynamic!(d)
87
83
  d = Types::Hash[d]
88
84
  new(
@@ -130,8 +126,6 @@ module Mihari
130
126
  #
131
127
  # @param [Hash] d
132
128
  #
133
- # @return [Response]
134
- #
135
129
  def from_dynamic!(d)
136
130
  d = Types::Hash[d]
137
131
  new(
@@ -27,8 +27,6 @@ module Mihari
27
27
  #
28
28
  # @param [Hash] d
29
29
  #
30
- # @return [ListItem]
31
- #
32
30
  def from_dynamic!(d)
33
31
  d = Types::Hash[d]
34
32
  new(
@@ -60,8 +58,6 @@ module Mihari
60
58
  #
61
59
  # @param [Hash] d
62
60
  #
63
- # @return [DataClass]
64
- #
65
61
  def from_dynamic!(d)
66
62
  d = Types::Hash[d]
67
63
  new(
@@ -89,8 +85,6 @@ module Mihari
89
85
  #
90
86
  # @param [Hash] d
91
87
  #
92
- # @return [Response]
93
- #
94
88
  def from_dynamic!(d)
95
89
  d = Types::Hash[d]
96
90
  new(
@@ -30,8 +30,6 @@ module Mihari
30
30
  #
31
31
  # @param [Hash] d
32
32
  #
33
- # @return [Response]
34
- #
35
33
  def from_dynamic!(d)
36
34
  d = d.deep_stringify_keys
37
35
  d = Types::Hash[d]
@@ -58,8 +58,6 @@ module Mihari
58
58
  #
59
59
  # @param [Hash] d
60
60
  #
61
- # @return [Result]
62
- #
63
61
  def from_dynamic!(d)
64
62
  d = Types::Hash[d]
65
63
  new(
@@ -113,8 +111,6 @@ module Mihari
113
111
  #
114
112
  # @param [Hash] d
115
113
  #
116
- # @return [Response]
117
- #
118
114
  def from_dynamic!(d)
119
115
  d = Types::Hash[d]
120
116
  new(
@@ -221,8 +221,6 @@ module Mihari
221
221
  #
222
222
  # @param [Hash] d
223
223
  #
224
- # @return [InternetDBResponse]
225
- #
226
224
  def from_dynamic!(d)
227
225
  d = Types::Hash[d]
228
226
  new(
@@ -20,8 +20,6 @@ module Mihari
20
20
  #
21
21
  # @param [Hash] d
22
22
  #
23
- # @return [Page]
24
- #
25
23
  def from_dynamic!(d)
26
24
  d = Types::Hash[d]
27
25
  new(
@@ -62,8 +60,6 @@ module Mihari
62
60
  #
63
61
  # @param [Hash] d
64
62
  #
65
- # @return [Result]
66
- #
67
63
  def from_dynamic!(d)
68
64
  d = Types::Hash[d]
69
65
  new(
@@ -96,8 +92,6 @@ module Mihari
96
92
  #
97
93
  # @param [Hash] d
98
94
  #
99
- # @return [Response]
100
- #
101
95
  def from_dynamic!(d)
102
96
  d = Types::Hash[d]
103
97
  new(
@@ -12,8 +12,6 @@ module Mihari
12
12
  #
13
13
  # @param [Hash] d
14
14
  #
15
- # @return [ContextAttributes]
16
- #
17
15
  def from_dynamic!(d)
18
16
  d = Types::Hash[d]
19
17
  new(url: d["url"])
@@ -65,8 +63,6 @@ module Mihari
65
63
  #
66
64
  # @param [Hash] d
67
65
  #
68
- # @return [Datum]
69
- #
70
66
  def from_dynamic!(d)
71
67
  d = Types::Hash[d]
72
68
 
@@ -94,8 +90,6 @@ module Mihari
94
90
  #
95
91
  # @param [Hash] d
96
92
  #
97
- # @return [Meta]
98
- #
99
93
  def from_dynamic!(d)
100
94
  d = Types::Hash[d]
101
95
  new(
@@ -125,8 +119,6 @@ module Mihari
125
119
  #
126
120
  # @param [Hash] d
127
121
  #
128
- # @return [Response]
129
- #
130
122
  def from_dynamic!(d)
131
123
  d = Types::Hash[d]
132
124
  new(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "5.7.0"
4
+ VERSION = "5.7.1"
5
5
  end