forest_admin_rpc_agent 1.22.3 → 1.23.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f894b881efb3778128a19b44f96982d8e805e934ec83c269c78987b223e8bdc9
4
- data.tar.gz: 30bfd791c848af51e3581d76414d098fb08d887cb8a71cfffdd5160841789096
3
+ metadata.gz: 281746bde0e28c1eeedba1e49b856eea8c708e08c1eb6c7f6e4ae3525b064798
4
+ data.tar.gz: 7b0b539680aca45fd32e5e3b9ec2238fa46d074cb4f85eb13b10fdd36cc1440e
5
5
  SHA512:
6
- metadata.gz: 26ba7b64d4f41b412fdb73bed05204cf273bee61fafc45c627d7b6c19ec8da6a7c1f608b4c9fd64a0bc150ad7bf382772b2cc77ff9916c58cfb222aa918eaa13
7
- data.tar.gz: d386628ca181fd8952662ab920b90e7a1971f5a79e257d3e177ade0ba589c926d1488120471e7f7ad02ba9ee5d73724158e221e2d8e5c26cc162574188b66ef1
6
+ metadata.gz: 1bc9659f90752406775d2cb4501be57c5ec24b134d9dcbad1386d0ac3c07435a3e332f37ef1213ba4060dd3af85b2754d8bd8e57b9cd00dcdd9748162753e762
7
+ data.tar.gz: ba50623fff5d14f03c4a4d43ff10def285eb9a73cabd4d1424f8495677bf5d6566a291aac3c124e4559d71013a7b88a801a66c56645018727dd51ab7f5a5c322
@@ -12,6 +12,15 @@ module ForestAdminRpcAgent
12
12
  @rpc_collections = []
13
13
  @cached_schema = nil
14
14
  @cached_schema_hash = nil
15
+ @customizer = ForestAdminRpcAgent::DatasourceCustomizer.new
16
+ end
17
+
18
+ def add_datasource(datasource, options = {})
19
+ if options[:mark_collections_as_rpc]
20
+ options[:mark_collections_callback] = ->(ds) { mark_collections_as_rpc(*ds.collections.keys) }
21
+ end
22
+
23
+ super
15
24
  end
16
25
 
17
26
  def send_schema(force: false)
@@ -0,0 +1,27 @@
1
+ module ForestAdminRpcAgent
2
+ class DatasourceCustomizer < ForestAdminDatasourceCustomizer::DatasourceCustomizer
3
+ def add_datasource(datasource, options)
4
+ @stack.queue_customization(lambda {
5
+ if options[:include] || options[:exclude]
6
+ publication_decorator = Decorators::Publication::PublicationDatasourceDecorator.new(datasource)
7
+ publication_decorator.keep_collections_matching(options[:include], options[:exclude])
8
+ datasource = publication_decorator
9
+ end
10
+
11
+ if options[:rename]
12
+ rename_collection_decorator = Decorators::RenameCollection::RenameCollectionDatasourceDecorator.new(
13
+ datasource
14
+ )
15
+ rename_collection_decorator.rename_collections(options[:rename])
16
+ datasource = rename_collection_decorator
17
+ end
18
+
19
+ options[:mark_collections_callback]&.call(datasource)
20
+
21
+ @composite_datasource.add_data_source(datasource)
22
+ })
23
+
24
+ self
25
+ end
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module ForestAdminRpcAgent
2
- VERSION = "1.22.3"
2
+ VERSION = "1.23.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_rpc_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.22.3
4
+ version: 1.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-01-23 00:00:00.000000000 Z
12
+ date: 2026-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: base64
@@ -200,6 +200,7 @@ files:
200
200
  - forest_admin_rpc_agent.gemspec
201
201
  - lib/forest_admin_rpc_agent.rb
202
202
  - lib/forest_admin_rpc_agent/agent.rb
203
+ - lib/forest_admin_rpc_agent/datasource_customizer.rb
203
204
  - lib/forest_admin_rpc_agent/engine.rb
204
205
  - lib/forest_admin_rpc_agent/extensions/config_loader.rb
205
206
  - lib/forest_admin_rpc_agent/extensions/sinatra_extension.rb