elasticgraph-schema_artifacts 0.18.0.4 → 0.18.0.5

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: 761f484e79b51dc0768d704c264660df55c75f71f41b576795a4efcbd66ef02c
4
- data.tar.gz: 056541ad942396bedf1f7543986cbcb0d03d60ce204a10fcd10ab6fc6afcabf7
3
+ metadata.gz: ef89f890e8a00f8735d5c060506a90377f3a0adf8fa3791de234d08f6799baf0
4
+ data.tar.gz: c3a24275c571eec23967e1710608bbbf45860d2eb14905117a3fbad7a4e8f78d
5
5
  SHA512:
6
- metadata.gz: 35dcc13853e2d5a00fdcbe198513ce4e9e274badee64712fabc3a5632ada4af7abf213947e0af42caaa48e8b49fa979e6adb705d27a0ba862aec69098d4f6469
7
- data.tar.gz: d8aad5e252ca573367b7ca08c70a99e3139339794ea46a289b401bb15816a8b9c1824df0137ea4e0531d0b6eb38adbdb380a4a0daf853cead840b4c07516cb38
6
+ metadata.gz: 6429564ec33e519bdeabf07413fab00b9677134532508af44238e2f4568b5abacc1a9834304c6751c89aa3d0a5dd212ccc3add6744d4393aa0b336b2ee0503d7
7
+ data.tar.gz: 563a2cf7438ca0fb9c7c37301a009e508ed237fd9341690316145a8dec62f25388d46064dc0f0a498e8dccc9198921f20da38a11bf5419b4d5e3b525779a34e6
@@ -7,7 +7,7 @@
7
7
  # frozen_string_literal: true
8
8
 
9
9
  require "elastic_graph/constants"
10
- require "elastic_graph/error"
10
+ require "elastic_graph/errors"
11
11
  require "elastic_graph/schema_artifacts/artifacts_helper_methods"
12
12
  require "elastic_graph/schema_artifacts/runtime_metadata/schema"
13
13
  require "elastic_graph/support/hash_util"
@@ -19,15 +19,15 @@ module ElasticGraph
19
19
  # Builds a `SchemaArtifacts::FromDisk` instance using the provided YAML settings.
20
20
  def self.from_parsed_yaml(parsed_yaml, for_context:)
21
21
  schema_artifacts = parsed_yaml.fetch("schema_artifacts") do
22
- raise ConfigError, "Config is missing required key `schema_artifacts`."
22
+ raise Errors::ConfigError, "Config is missing required key `schema_artifacts`."
23
23
  end
24
24
 
25
25
  if (extra_keys = schema_artifacts.keys - ["directory"]).any?
26
- raise ConfigError, "Config has extra `schema_artifacts` keys: #{extra_keys}"
26
+ raise Errors::ConfigError, "Config has extra `schema_artifacts` keys: #{extra_keys}"
27
27
  end
28
28
 
29
29
  directory = schema_artifacts.fetch("directory") do
30
- raise ConfigError, "Config is missing required key `schema_artifacts.directory`."
30
+ raise Errors::ConfigError, "Config is missing required key `schema_artifacts.directory`."
31
31
  end
32
32
 
33
33
  FromDisk.new(directory, for_context)
@@ -43,7 +43,7 @@ module ElasticGraph
43
43
 
44
44
  def json_schemas_for(version)
45
45
  unless available_json_schema_versions.include?(version)
46
- raise MissingSchemaArtifactError, "The requested json schema version (#{version}) is not available. " \
46
+ raise Errors::MissingSchemaArtifactError, "The requested json schema version (#{version}) is not available. " \
47
47
  "Available versions: #{available_json_schema_versions.sort.join(", ")}."
48
48
  end
49
49
 
@@ -63,7 +63,7 @@ module ElasticGraph
63
63
 
64
64
  def latest_json_schema_version
65
65
  @latest_json_schema_version ||= available_json_schema_versions.max || raise(
66
- MissingSchemaArtifactError,
66
+ Errors::MissingSchemaArtifactError,
67
67
  "The directory for versioned JSON schemas (#{::File.join(artifacts_dir, JSON_SCHEMAS_BY_VERSION_DIRECTORY)}) could not be found. " \
68
68
  "Either the schema artifacts haven't been dumped yet or the schema artifacts directory (#{artifacts_dir}) is misconfigured."
69
69
  )
@@ -88,7 +88,7 @@ module ElasticGraph
88
88
  if ::File.exist?(file_name)
89
89
  ::File.read(file_name)
90
90
  else
91
- raise MissingSchemaArtifactError, "Schema artifact `#{artifact_name}` could not be found. " \
91
+ raise Errors::MissingSchemaArtifactError, "Schema artifact `#{artifact_name}` could not be found. " \
92
92
  "Either the schema artifacts haven't been dumped yet or the schema artifacts directory (#{artifacts_dir}) is misconfigured."
93
93
  end
94
94
  end
@@ -6,7 +6,7 @@
6
6
  #
7
7
  # frozen_string_literal: true
8
8
 
9
- require "elastic_graph/error"
9
+ require "elastic_graph/errors"
10
10
  require "elastic_graph/schema_artifacts/runtime_metadata/extension"
11
11
 
12
12
  module ElasticGraph
@@ -32,7 +32,7 @@ module ElasticGraph
32
32
  def load(constant_name, from:, config:)
33
33
  (@loaded_by_name[constant_name] ||= load_extension(constant_name, from)).tap do |extension|
34
34
  if extension.require_path != from
35
- raise InvalidExtensionError, "Extension `#{constant_name}` cannot be loaded from `#{from}`, " \
35
+ raise Errors::InvalidExtensionError, "Extension `#{constant_name}` cannot be loaded from `#{from}`, " \
36
36
  "since it has already been loaded from `#{extension.require_path}`."
37
37
  end
38
38
  end.with(extension_config: config)
@@ -64,7 +64,7 @@ module ElasticGraph
64
64
  end
65
65
 
66
66
  if problems.any?
67
- raise InvalidExtensionError,
67
+ raise Errors::InvalidExtensionError,
68
68
  "Extension `#{constant_name}` does not implement the expected interface correctly. Problems:\n\n" \
69
69
  "#{problems.join("\n")}"
70
70
  end
@@ -7,7 +7,7 @@
7
7
  # frozen_string_literal: true
8
8
 
9
9
  require "elastic_graph/constants"
10
- require "elastic_graph/error"
10
+ require "elastic_graph/errors"
11
11
 
12
12
  module ElasticGraph
13
13
  module SchemaArtifacts
@@ -20,14 +20,14 @@ module ElasticGraph
20
20
 
21
21
  define_method :initialize do |form:, overrides: {}|
22
22
  extend(CONVERTERS.fetch(form.to_s) do
23
- raise SchemaError,
23
+ raise Errors::SchemaError,
24
24
  "Invalid schema element name form: #{form.inspect}. " \
25
25
  "Only valid values are: #{CONVERTERS.keys.inspect}."
26
26
  end)
27
27
 
28
28
  unused_keys = overrides.keys.map(&:to_s) - element_names.map(&:to_s)
29
29
  if unused_keys.any?
30
- raise SchemaError,
30
+ raise Errors::SchemaError,
31
31
  "`overrides` contains entries that do not match any schema " \
32
32
  "elements: #{unused_keys.to_a.inspect}. Are any misspelled?"
33
33
  end
@@ -98,7 +98,7 @@ module ElasticGraph
98
98
  "#{canonical_names.inspect} all map to the same exposed name: #{duplicate_exposed_name}"
99
99
  end.join(" and ")
100
100
 
101
- raise SchemaError, collisions
101
+ raise Errors::SchemaError, collisions
102
102
  end
103
103
  # standard:enable Lint/NestedMethodDefinition
104
104
  end
@@ -6,7 +6,7 @@
6
6
  #
7
7
  # frozen_string_literal: true
8
8
 
9
- require "elastic_graph/error"
9
+ require "elastic_graph/errors"
10
10
 
11
11
  module ElasticGraph
12
12
  module SchemaArtifacts
@@ -14,7 +14,7 @@ module ElasticGraph
14
14
  class SortField < ::Data.define(:field_path, :direction)
15
15
  def initialize(field_path:, direction:)
16
16
  unless direction == :asc || direction == :desc
17
- raise SchemaError, "Sort direction `#{direction.inspect}` is invalid; it must be `:asc` or `:desc`"
17
+ raise Errors::SchemaError, "Sort direction `#{direction.inspect}` is invalid; it must be `:asc` or `:desc`"
18
18
  end
19
19
 
20
20
  super(field_path: field_path, direction: direction)
metadata CHANGED
@@ -1,14 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticgraph-schema_artifacts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0.4
4
+ version: 0.18.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Myron Marston
8
+ - Ben VandenBos
9
+ - Square Engineering
8
10
  autorequire:
9
11
  bindir: exe
10
12
  cert_chain: []
11
- date: 2024-09-06 00:00:00.000000000 Z
13
+ date: 2024-09-20 00:00:00.000000000 Z
12
14
  dependencies:
13
15
  - !ruby/object:Gem::Dependency
14
16
  name: rubocop-factory_bot
@@ -176,42 +178,42 @@ dependencies:
176
178
  requirements:
177
179
  - - '='
178
180
  - !ruby/object:Gem::Version
179
- version: 0.18.0.4
181
+ version: 0.18.0.5
180
182
  type: :runtime
181
183
  prerelease: false
182
184
  version_requirements: !ruby/object:Gem::Requirement
183
185
  requirements:
184
186
  - - '='
185
187
  - !ruby/object:Gem::Version
186
- version: 0.18.0.4
188
+ version: 0.18.0.5
187
189
  - !ruby/object:Gem::Dependency
188
190
  name: elasticgraph-graphql
189
191
  requirement: !ruby/object:Gem::Requirement
190
192
  requirements:
191
193
  - - '='
192
194
  - !ruby/object:Gem::Version
193
- version: 0.18.0.4
195
+ version: 0.18.0.5
194
196
  type: :development
195
197
  prerelease: false
196
198
  version_requirements: !ruby/object:Gem::Requirement
197
199
  requirements:
198
200
  - - '='
199
201
  - !ruby/object:Gem::Version
200
- version: 0.18.0.4
202
+ version: 0.18.0.5
201
203
  - !ruby/object:Gem::Dependency
202
204
  name: elasticgraph-indexer
203
205
  requirement: !ruby/object:Gem::Requirement
204
206
  requirements:
205
207
  - - '='
206
208
  - !ruby/object:Gem::Version
207
- version: 0.18.0.4
209
+ version: 0.18.0.5
208
210
  type: :development
209
211
  prerelease: false
210
212
  version_requirements: !ruby/object:Gem::Requirement
211
213
  requirements:
212
214
  - - '='
213
215
  - !ruby/object:Gem::Version
214
- version: 0.18.0.4
216
+ version: 0.18.0.5
215
217
  description:
216
218
  email:
217
219
  - myron@squareup.com