foobara 0.0.108 → 0.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/projects/command/src/transformed_command.rb +2 -1
- data/projects/command_connectors/src/authenticator.rb +4 -4
- data/projects/command_connectors/src/command_connector.rb +2 -1
- data/projects/command_connectors/src/command_registry/exposed_command.rb +16 -0
- data/projects/model/src/concerns/types.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71a254889aa452b7a219cb8d9b4c7d1c2eb2c21ea452ae783e62d601720c387b
|
4
|
+
data.tar.gz: 451cf0735d2c75026c92b92381e0e8a3766ed69a8a08eed739e6866e88f5b134
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d758bae9e990d477c7775966b69dd1a51ae1878b938fec278a76ebbb8dd88a417e6c68f3a11174929cb86f858294bf1207206704bba70c458035e3798b12597
|
7
|
+
data.tar.gz: 9f7c770b990f942884aaa79f45f7ce344aaabaa8a939536d869802c25ccc2ada3b7ddb476119a543d5546019874ae44929af29d5437d0574e447a4f8acc398ed
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# [0.0.110] - 2025-04-23
|
2
|
+
|
3
|
+
- Automatically load associations needed for delegated attributes for
|
4
|
+
result of commands exposed via command connectors
|
5
|
+
|
6
|
+
# [0.0.109] - 2025-04-22
|
7
|
+
|
8
|
+
- Support CommandConnector transformers that don't take declaration_data
|
9
|
+
|
1
10
|
# [0.0.108] - 2025-04-22
|
2
11
|
|
3
12
|
- Fix bug in CommandConnector::NotFoundError constructor
|
@@ -424,7 +424,8 @@ module Foobara
|
|
424
424
|
target_type = new_type if new_type
|
425
425
|
end
|
426
426
|
else
|
427
|
-
|
427
|
+
# TODO: perhaps pass in the command connector as the parent declaration data?
|
428
|
+
transformer.new_with_agnostic_args(declaration_data:)
|
428
429
|
end
|
429
430
|
elsif transformer.is_a?(Value::Processor)
|
430
431
|
transformer
|
@@ -1,14 +1,14 @@
|
|
1
1
|
module Foobara
|
2
2
|
class CommandConnector
|
3
3
|
class Authenticator
|
4
|
-
|
4
|
+
attr_reader :block, :explanation, :symbol
|
5
5
|
|
6
6
|
def initialize(symbol: nil, explanation: nil, &block)
|
7
7
|
symbol ||= Util.non_full_name_underscore(self.class).to_sym
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
@symbol = symbol
|
10
|
+
@block = block
|
11
|
+
@explanation = explanation || symbol
|
12
12
|
end
|
13
13
|
|
14
14
|
def to_proc
|
@@ -36,13 +36,14 @@ module Foobara
|
|
36
36
|
|
37
37
|
unless authenticator.symbol
|
38
38
|
# :nocov:
|
39
|
-
raise ArgumentError, "Expected
|
39
|
+
raise ArgumentError, "Expected authenticator to have a symbol"
|
40
40
|
# :nocov:
|
41
41
|
end
|
42
42
|
|
43
43
|
authenticator_registry[authenticator.symbol] = authenticator
|
44
44
|
end
|
45
45
|
|
46
|
+
# TODO: relocate to Authenticator
|
46
47
|
def to_authenticator(*args)
|
47
48
|
symbol, object = case args.size
|
48
49
|
when 1
|
@@ -90,6 +90,22 @@ module Foobara
|
|
90
90
|
self.allowed_rule = allowed_rule
|
91
91
|
self.requires_authentication = requires_authentication
|
92
92
|
self.authenticator = authenticator
|
93
|
+
|
94
|
+
# A bit hacky... we should check if we need to shim in a LoadDelegatedAttributesEntitiesPreCommitTransformer
|
95
|
+
unless aggregate_entities
|
96
|
+
# It's possible delegates have been added or removed via the result transformers...
|
97
|
+
# We should figure out a way to check the transformed result type instead.
|
98
|
+
if _has_delegated_attributes?(command_class.result_type)
|
99
|
+
self.pre_commit_transformers = [
|
100
|
+
*self.pre_commit_transformers,
|
101
|
+
CommandConnectors::Transformers::LoadDelegatedAttributesEntitiesPreCommitTransformer
|
102
|
+
].uniq
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def _has_delegated_attributes?(type)
|
108
|
+
type&.extends?(BuiltinTypes[:model]) && type.target_class&.has_delegated_attributes?
|
93
109
|
end
|
94
110
|
|
95
111
|
def full_command_name
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.110
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
@@ -508,7 +508,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
508
508
|
- !ruby/object:Gem::Version
|
509
509
|
version: '0'
|
510
510
|
requirements: []
|
511
|
-
rubygems_version: 3.6.
|
511
|
+
rubygems_version: 3.6.8
|
512
512
|
specification_version: 4
|
513
513
|
summary: A command-centric and discoverable software framework with a focus on domain
|
514
514
|
concepts and abstracting away integration code
|