ree_lib 1.0.93 → 1.0.95
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +41 -36
- data/lib/ree_lib/packages/ree_dao/package/ree_dao/wrappers/pg_array.rb +34 -26
- data/lib/ree_lib/packages/ree_dao/package/ree_dao/wrappers/pg_jsonb.rb +35 -25
- data/lib/ree_lib/packages/ree_enum/package/ree_enum/base_enum_mapper.rb +6 -18
- data/lib/ree_lib/packages/ree_enum/package/ree_enum/integer_value_enum_mapper.rb +6 -18
- data/lib/ree_lib/packages/ree_enum/package/ree_enum/string_value_enum_mapper.rb +6 -18
- data/lib/ree_lib/packages/ree_errors/Package.schema.json +10 -7
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/auth_error.rb +8 -8
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/build_error.rb +4 -2
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/conflict_error.rb +8 -8
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/error.rb +89 -6
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/invalid_param_error.rb +9 -9
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/not_found_error.rb +8 -8
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/payment_required_error.rb +8 -8
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/permission_error.rb +8 -8
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/validation_error.rb +8 -8
- data/lib/ree_lib/packages/ree_errors/package/ree_errors.rb +1 -0
- data/lib/ree_lib/packages/ree_errors/schemas/ree_errors/auth_error.schema.json +24 -1
- data/lib/ree_lib/packages/ree_errors/schemas/ree_errors/build_error.schema.json +10 -0
- data/lib/ree_lib/packages/ree_errors/schemas/ree_errors/conflict_error.schema.json +24 -1
- data/lib/ree_lib/packages/ree_errors/schemas/ree_errors/invalid_param_error.schema.json +24 -1
- data/lib/ree_lib/packages/ree_errors/schemas/ree_errors/not_found_error.schema.json +24 -1
- data/lib/ree_lib/packages/ree_errors/schemas/ree_errors/payment_required_error.schema.json +24 -1
- data/lib/ree_lib/packages/ree_errors/schemas/ree_errors/permission_error.schema.json +24 -1
- data/lib/ree_lib/packages/ree_errors/schemas/ree_errors/validation_error.schema.json +24 -1
- data/lib/ree_lib/packages/ree_errors/spec/ree_errors/auth_error_spec.rb +22 -8
- data/lib/ree_lib/packages/ree_errors/spec/ree_errors/invalid_param_error_spec.rb +3 -1
- data/lib/ree_lib/packages/ree_errors/spec/ree_errors/locales/en.yml +6 -1
- data/lib/ree_lib/packages/ree_errors/spec/ree_errors/not_found_error_spec.rb +3 -1
- data/lib/ree_lib/packages/ree_errors/spec/ree_errors/payment_required_error_spec.rb +3 -1
- data/lib/ree_lib/packages/ree_errors/spec/ree_errors/permission_error_spec.rb +3 -1
- data/lib/ree_lib/packages/ree_errors/spec/ree_errors/validation_error_spec.rb +3 -1
- data/lib/ree_lib/packages/ree_i18n/Package.schema.json +7 -0
- data/lib/ree_lib/packages/ree_i18n/package/ree_i18n/functions/check_locale_exists.rb +12 -0
- data/lib/ree_lib/packages/ree_i18n/schemas/ree_i18n/functions/check_locale_exists.schema.json +33 -0
- data/lib/ree_lib/packages/ree_i18n/spec/ree_i18n/functions/check_locale_exists.rb +16 -0
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/errors/error_with_location.rb +47 -14
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/field.rb +1 -1
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/fields_filter.rb +11 -20
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/mapper.rb +36 -48
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/abstract_type.rb +2 -2
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/any.rb +8 -8
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/bool.rb +12 -12
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/date.rb +14 -14
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/date_time.rb +13 -13
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/float.rb +14 -14
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/integer.rb +13 -13
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/rational.rb +14 -14
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/string.rb +12 -12
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/time.rb +13 -13
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/wrappers/array.rb +88 -80
- data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/benchmarks/mapper_benchmark_spec.rb +41 -1
- data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/mapper_factory_spec.rb +17 -6
- data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/hash_spec.rb +1 -1
- data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/type_options_spec.rb +7 -26
- data/lib/ree_lib/packages/ree_roda/spec/ree_roda/services/build_swagger_from_routes_spec.rb +7 -4
- data/lib/ree_lib/packages/ree_roda/spec/ree_roda/services/locales/en.yml +3 -1
- data/lib/ree_lib/packages/ree_string/package/ree_string/functions/deconstantize.rb +1 -1
- data/lib/ree_lib/packages/ree_swagger/Package.schema.json +3 -0
- data/lib/ree_lib/packages/ree_swagger/package/ree_swagger/functions/build_parameters.rb +2 -1
- data/lib/ree_lib/packages/ree_swagger/package/ree_swagger/functions/build_request_body_schema.rb +12 -5
- data/lib/ree_lib/packages/ree_swagger/package/ree_swagger/functions/build_serializer_schema.rb +12 -5
- data/lib/ree_lib/packages/ree_swagger/package/ree_swagger.rb +1 -0
- data/lib/ree_lib/packages/ree_swagger/schemas/ree_swagger/functions/build_parameters.schema.json +8 -0
- data/lib/ree_lib/packages/ree_swagger/schemas/ree_swagger/functions/build_request_body_schema.schema.json +1 -1
- data/lib/ree_lib/packages/ree_swagger/schemas/ree_swagger/functions/build_serializer_schema.schema.json +1 -1
- data/lib/ree_lib/version.rb +1 -1
- metadata +5 -3
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/error_factory.rb +0 -15
data/lib/ree_lib/packages/ree_swagger/package/ree_swagger/functions/build_serializer_schema.rb
CHANGED
@@ -7,14 +7,14 @@ class ReeSwagger::BuildSerializerSchema
|
|
7
7
|
link :get_serializer_definition
|
8
8
|
end
|
9
9
|
|
10
|
-
contract(ReeMapper::Mapper, ArrayOf[ReeMapper::FieldsFilter] => Nilor[Hash])
|
11
|
-
def call(mapper, fields_filters =
|
10
|
+
contract(ReeMapper::Mapper, Nilor[ArrayOf[ReeMapper::FieldsFilter]] => Nilor[Hash])
|
11
|
+
def call(mapper, fields_filters = nil)
|
12
12
|
if mapper.type
|
13
13
|
return get_serializer_definition(mapper.type, method(:call).to_proc)
|
14
14
|
end
|
15
15
|
|
16
16
|
properties = mapper.fields.each_with_object({}) do |(_name, field), acc|
|
17
|
-
next unless fields_filters.all? { _1.allow?(field.name) }
|
17
|
+
next unless fields_filters.nil? || fields_filters.all? { _1.allow?(field.name) }
|
18
18
|
|
19
19
|
if field.type == mapper
|
20
20
|
acc[field.name] = {}
|
@@ -25,8 +25,15 @@ class ReeSwagger::BuildSerializerSchema
|
|
25
25
|
|
26
26
|
field_mapper = field.type
|
27
27
|
|
28
|
-
nested_fields_filters = fields_filters
|
29
|
-
|
28
|
+
nested_fields_filters = fields_filters&.filter_map { _1.filter_for(field.name) }
|
29
|
+
|
30
|
+
if field.fields_filter
|
31
|
+
nested_fields_filters = if nested_fields_filters
|
32
|
+
nested_fields_filters + [field.fields_filter]
|
33
|
+
else
|
34
|
+
[field.fields_filter]
|
35
|
+
end
|
36
|
+
end
|
30
37
|
|
31
38
|
swagger_type = call(field_mapper, nested_fields_filters)
|
32
39
|
|
data/lib/ree_lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ree_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.95
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruslan Gatiyatov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ree
|
@@ -836,7 +836,6 @@ files:
|
|
836
836
|
- lib/ree_lib/packages/ree_errors/package/ree_errors/build_error.rb
|
837
837
|
- lib/ree_lib/packages/ree_errors/package/ree_errors/conflict_error.rb
|
838
838
|
- lib/ree_lib/packages/ree_errors/package/ree_errors/error.rb
|
839
|
-
- lib/ree_lib/packages/ree_errors/package/ree_errors/error_factory.rb
|
840
839
|
- lib/ree_lib/packages/ree_errors/package/ree_errors/invalid_param_error.rb
|
841
840
|
- lib/ree_lib/packages/ree_errors/package/ree_errors/not_found_error.rb
|
842
841
|
- lib/ree_lib/packages/ree_errors/package/ree_errors/payment_required_error.rb
|
@@ -933,6 +932,7 @@ files:
|
|
933
932
|
- lib/ree_lib/packages/ree_i18n/bin/console
|
934
933
|
- lib/ree_lib/packages/ree_i18n/package/ree_i18n.rb
|
935
934
|
- lib/ree_lib/packages/ree_i18n/package/ree_i18n/functions/add_load_path.rb
|
935
|
+
- lib/ree_lib/packages/ree_i18n/package/ree_i18n/functions/check_locale_exists.rb
|
936
936
|
- lib/ree_lib/packages/ree_i18n/package/ree_i18n/functions/get_default_locale.rb
|
937
937
|
- lib/ree_lib/packages/ree_i18n/package/ree_i18n/functions/get_locale.rb
|
938
938
|
- lib/ree_lib/packages/ree_i18n/package/ree_i18n/functions/set_default_locale.rb
|
@@ -940,6 +940,7 @@ files:
|
|
940
940
|
- lib/ree_lib/packages/ree_i18n/package/ree_i18n/functions/t.rb
|
941
941
|
- lib/ree_lib/packages/ree_i18n/package/ree_i18n/functions/with_locale.rb
|
942
942
|
- lib/ree_lib/packages/ree_i18n/schemas/ree_i18n/functions/add_load_path.schema.json
|
943
|
+
- lib/ree_lib/packages/ree_i18n/schemas/ree_i18n/functions/check_locale_exists.schema.json
|
943
944
|
- lib/ree_lib/packages/ree_i18n/schemas/ree_i18n/functions/get_default_locale.schema.json
|
944
945
|
- lib/ree_lib/packages/ree_i18n/schemas/ree_i18n/functions/get_locale.schema.json
|
945
946
|
- lib/ree_lib/packages/ree_i18n/schemas/ree_i18n/functions/set_default_locale.schema.json
|
@@ -947,6 +948,7 @@ files:
|
|
947
948
|
- lib/ree_lib/packages/ree_i18n/schemas/ree_i18n/functions/t.schema.json
|
948
949
|
- lib/ree_lib/packages/ree_i18n/schemas/ree_i18n/functions/with_locale.schema.json
|
949
950
|
- lib/ree_lib/packages/ree_i18n/spec/package_schema_spec.rb
|
951
|
+
- lib/ree_lib/packages/ree_i18n/spec/ree_i18n/functions/check_locale_exists.rb
|
950
952
|
- lib/ree_lib/packages/ree_i18n/spec/ree_i18n/functions/locales/en.yml
|
951
953
|
- lib/ree_lib/packages/ree_i18n/spec/ree_i18n/functions/locales/ru.yml
|
952
954
|
- lib/ree_lib/packages/ree_i18n/spec/ree_i18n/functions/set_locale_spec.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative 'error'
|
2
|
-
|
3
|
-
class ReeErrors::ErrorFactory
|
4
|
-
class << self
|
5
|
-
contract Symbol, String => SubclassOf[ReeErrors::Error]
|
6
|
-
def build(code, locale = nil)
|
7
|
-
self.new.build(code, locale)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
contract Symbol, String => SubclassOf[ReeErrors::Error]
|
12
|
-
def build(code, locale = nil)
|
13
|
-
raise NotImplementedError, "should be implemented in derived class"
|
14
|
-
end
|
15
|
-
end
|