forest_admin_rpc_agent 1.15.2 → 1.16.1
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/lib/forest_admin_rpc_agent/routes/action_execute.rb +1 -1
- data/lib/forest_admin_rpc_agent/routes/action_form.rb +1 -1
- data/lib/forest_admin_rpc_agent/routes/aggregate.rb +1 -1
- data/lib/forest_admin_rpc_agent/routes/base_route.rb +10 -0
- data/lib/forest_admin_rpc_agent/routes/chart.rb +1 -1
- data/lib/forest_admin_rpc_agent/routes/create.rb +1 -1
- data/lib/forest_admin_rpc_agent/routes/delete.rb +1 -1
- data/lib/forest_admin_rpc_agent/routes/list.rb +1 -1
- data/lib/forest_admin_rpc_agent/routes/update.rb +1 -1
- data/lib/forest_admin_rpc_agent/version.rb +1 -1
- 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: df3244dd5c21cca95f5d9b58b849c0860859927829fc36529131762904e9f1ed
|
|
4
|
+
data.tar.gz: 729564217792b1a376fa8cf72ef0a8cc539dde666677d84c57b8ab219031d555
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4669d57b1d4dbea9d8f2b0ae7dfd15750442753873373decb9d41c4b57ba3a746873348052315961439bcb1a6020830d528974af16c1130f4096866612e7621
|
|
7
|
+
data.tar.gz: 51c7303e8a879912c0f8620185f603c49e72d7a29bd287658bd2342e8ec96c9236fadc8e244c2e238db10ccc3e6ae63c6be72ca312c1d081478a7f82036c7a38
|
|
@@ -15,7 +15,7 @@ module ForestAdminRpcAgent
|
|
|
15
15
|
return {} unless args[:params]['collection_name']
|
|
16
16
|
|
|
17
17
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
18
|
-
collection = datasource
|
|
18
|
+
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
19
19
|
filter = FilterFactory.from_plain_object(args[:params]['filter'])
|
|
20
20
|
data = args[:params]['data']
|
|
21
21
|
action = args[:params]['action']
|
|
@@ -15,7 +15,7 @@ module ForestAdminRpcAgent
|
|
|
15
15
|
return {} unless args[:params]['collection_name']
|
|
16
16
|
|
|
17
17
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
18
|
-
collection = datasource
|
|
18
|
+
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
19
19
|
filter = FilterFactory.from_plain_object(args[:params]['filter'])
|
|
20
20
|
metas = args[:params]['metas'] || {}
|
|
21
21
|
data = args[:params]['data']
|
|
@@ -15,7 +15,7 @@ module ForestAdminRpcAgent
|
|
|
15
15
|
return {} unless args[:params]['collection_name']
|
|
16
16
|
|
|
17
17
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
18
|
-
collection = datasource
|
|
18
|
+
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
19
19
|
|
|
20
20
|
aggregation = Aggregation.new(
|
|
21
21
|
operation: args[:params]['aggregation']['operation'],
|
|
@@ -62,6 +62,16 @@ module ForestAdminRpcAgent
|
|
|
62
62
|
route_alias: @name
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
+
protected
|
|
66
|
+
|
|
67
|
+
def get_collection_safe(datasource, collection_name)
|
|
68
|
+
datasource.get_collection(collection_name)
|
|
69
|
+
rescue ForestAdminDatasourceToolkit::Exceptions::ForestException => e
|
|
70
|
+
raise ForestAdminAgent::Http::Exceptions::NotFoundError, e.message if e.message.include?('not found')
|
|
71
|
+
|
|
72
|
+
raise
|
|
73
|
+
end
|
|
74
|
+
|
|
65
75
|
private
|
|
66
76
|
|
|
67
77
|
def serialize_response(result)
|
|
@@ -14,7 +14,7 @@ module ForestAdminRpcAgent
|
|
|
14
14
|
|
|
15
15
|
chart_name = args[:params]['chart']
|
|
16
16
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
17
|
-
collection = datasource
|
|
17
|
+
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
18
18
|
|
|
19
19
|
collection.render_chart(caller, chart_name, args[:params]['record_id'])
|
|
20
20
|
end
|
|
@@ -11,7 +11,7 @@ module ForestAdminRpcAgent
|
|
|
11
11
|
return {} unless args[:params]['collection_name']
|
|
12
12
|
|
|
13
13
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
14
|
-
collection = datasource
|
|
14
|
+
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
15
15
|
|
|
16
16
|
[collection.create(args[:caller], args[:params]['data'].first)]
|
|
17
17
|
end
|
|
@@ -15,7 +15,7 @@ module ForestAdminRpcAgent
|
|
|
15
15
|
return {} unless args[:params]['collection_name']
|
|
16
16
|
|
|
17
17
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
18
|
-
collection = datasource
|
|
18
|
+
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
19
19
|
filter = FilterFactory.from_plain_object(args[:params]['filter'])
|
|
20
20
|
|
|
21
21
|
collection.delete(args[:caller], filter)
|
|
@@ -15,7 +15,7 @@ module ForestAdminRpcAgent
|
|
|
15
15
|
return {} unless args[:params]['collection_name']
|
|
16
16
|
|
|
17
17
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
18
|
-
collection = datasource
|
|
18
|
+
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
19
19
|
projection = Projection.new(args[:params]['projection'])
|
|
20
20
|
filter = FilterFactory.from_plain_object(args[:params]['filter'])
|
|
21
21
|
|
|
@@ -13,7 +13,7 @@ module ForestAdminRpcAgent
|
|
|
13
13
|
return {} unless args[:params]['collection_name']
|
|
14
14
|
|
|
15
15
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
16
|
-
collection = datasource
|
|
16
|
+
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
17
17
|
filter = FilterFactory.from_plain_object(args[:params]['filter'])
|
|
18
18
|
|
|
19
19
|
collection.update(args[:caller], filter, args[:params]['patch'])
|
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.
|
|
4
|
+
version: 1.16.1
|
|
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: 2025-
|
|
12
|
+
date: 2025-12-03 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: base64
|