isomorfeus-data 1.0.0.zeta5 → 1.0.0.zeta6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +37 -1
- data/lib/isomorfeus/data/attribute_support.rb +122 -0
- data/lib/isomorfeus/data/config.rb +79 -89
- data/lib/isomorfeus/data/element_validator.rb +133 -0
- data/lib/isomorfeus/data/generic_class_api.rb +155 -0
- data/lib/isomorfeus/data/generic_instance_api.rb +72 -0
- data/lib/isomorfeus/data/handler/arango.rb +61 -0
- data/lib/isomorfeus/data/handler/generic.rb +92 -0
- data/lib/isomorfeus/data/handler/object_call.rb +45 -0
- data/lib/isomorfeus/data/handler/object_store.rb +45 -0
- data/lib/isomorfeus/data/version.rb +1 -1
- data/lib/isomorfeus-data.rb +61 -30
- data/lib/isomorfeus_data/lucid_data/array/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/array/mixin.rb +570 -0
- data/lib/isomorfeus_data/lucid_data/collection/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/collection/finders.rb +83 -0
- data/lib/isomorfeus_data/lucid_data/collection/mixin.rb +710 -0
- data/lib/isomorfeus_data/lucid_data/composition/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/composition/mixin.rb +185 -0
- data/lib/isomorfeus_data/lucid_data/document/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/document/mixin.rb +9 -0
- data/lib/isomorfeus_data/lucid_data/edge/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/edge/mixin.rb +281 -0
- data/lib/isomorfeus_data/lucid_data/edge_collection/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/edge_collection/finders.rb +134 -0
- data/lib/isomorfeus_data/lucid_data/edge_collection/mixin.rb +705 -0
- data/lib/isomorfeus_data/lucid_data/graph/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/graph/finders.rb +141 -0
- data/lib/isomorfeus_data/lucid_data/graph/mixin.rb +401 -0
- data/lib/isomorfeus_data/lucid_data/hash/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/hash/mixin.rb +413 -0
- data/lib/isomorfeus_data/lucid_data/link/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/link/mixin.rb +9 -0
- data/lib/isomorfeus_data/lucid_data/link_collection/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/link_collection/mixin.rb +9 -0
- data/lib/isomorfeus_data/lucid_data/node/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/node/mixin.rb +192 -0
- data/lib/isomorfeus_data/lucid_data/object/base.rb +13 -0
- data/lib/{lucid_array → isomorfeus_data/lucid_data/object}/mixin.rb +15 -16
- data/lib/isomorfeus_data/lucid_data/remote_object/base.rb +13 -0
- data/lib/isomorfeus_data/lucid_data/remote_object/mixin.rb +19 -0
- data/lib/isomorfeus_data/lucid_data/vertex/base.rb +15 -0
- data/lib/isomorfeus_data/lucid_data/vertex/mixin.rb +9 -0
- data/lib/lucid_arango/collection/base.rb +15 -0
- data/lib/lucid_arango/collection/mixin.rb +20 -0
- data/lib/lucid_arango/document/base.rb +15 -0
- data/lib/lucid_arango/document/mixin.rb +9 -0
- data/lib/lucid_arango/edge/base.rb +16 -0
- data/lib/lucid_arango/edge/mixin.rb +20 -0
- data/lib/lucid_arango/edge_collection/base.rb +15 -0
- data/lib/lucid_arango/edge_collection/mixin.rb +20 -0
- data/lib/lucid_arango/graph/base.rb +15 -0
- data/lib/lucid_arango/graph/mixin.rb +20 -0
- data/lib/lucid_arango/node/base.rb +16 -0
- data/lib/lucid_arango/node/mixin.rb +81 -0
- data/lib/lucid_arango/vertex/base.rb +15 -0
- data/lib/lucid_arango/vertex/mixin.rb +9 -0
- metadata +84 -47
- data/lib/isomorfeus/data/handler/array_load_handler.rb +0 -47
- data/lib/isomorfeus/data/handler/collection_load_handler.rb +0 -48
- data/lib/isomorfeus/data/handler/graph_load_handler.rb +0 -48
- data/lib/isomorfeus/data/handler/hash_load_handler.rb +0 -47
- data/lib/lucid_array/base.rb +0 -14
- data/lib/lucid_collection/base.rb +0 -14
- data/lib/lucid_collection/mixin.rb +0 -241
- data/lib/lucid_edge/base.rb +0 -5
- data/lib/lucid_edge/mixin.rb +0 -238
- data/lib/lucid_graph/base.rb +0 -14
- data/lib/lucid_graph/mixin.rb +0 -670
- data/lib/lucid_hash/base.rb +0 -14
- data/lib/lucid_hash/mixin.rb +0 -168
- data/lib/lucid_node/base.rb +0 -5
- data/lib/lucid_node/mixin.rb +0 -198
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.zeta6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,140 +16,140 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '6.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: arango-driver
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
33
|
+
version: 3.5.0.alpha1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.
|
40
|
+
version: 3.5.0.alpha1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: oj
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 3.10.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 3.10.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: opal
|
56
|
+
name: opal
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 1.0.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 1.0.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: opal-
|
70
|
+
name: opal-activesupport
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.3.3
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.3.3
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: isomorfeus-react
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 16.
|
89
|
+
version: 16.12.1
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 16.
|
96
|
+
version: 16.12.1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: isomorfeus-redux
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 4.0.
|
103
|
+
version: 4.0.16
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 4.0.
|
110
|
+
version: 4.0.16
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: isomorfeus-transport
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.0.0.
|
117
|
+
version: 1.0.0.zeta6
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.0.0.
|
124
|
+
version: 1.0.0.zeta6
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name: isomorfeus
|
126
|
+
name: isomorfeus
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.0.0.
|
131
|
+
version: 1.0.0.zeta6
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.0.0.
|
138
|
+
version: 1.0.0.zeta6
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: opal-webpack-loader
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.9.
|
145
|
+
version: 0.9.9
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.9.
|
152
|
+
version: 0.9.9
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rake
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,26 +188,63 @@ files:
|
|
188
188
|
- LICENSE
|
189
189
|
- README.md
|
190
190
|
- lib/isomorfeus-data.rb
|
191
|
+
- lib/isomorfeus/data/attribute_support.rb
|
191
192
|
- lib/isomorfeus/data/config.rb
|
192
|
-
- lib/isomorfeus/data/
|
193
|
-
- lib/isomorfeus/data/
|
194
|
-
- lib/isomorfeus/data/
|
195
|
-
- lib/isomorfeus/data/handler/
|
193
|
+
- lib/isomorfeus/data/element_validator.rb
|
194
|
+
- lib/isomorfeus/data/generic_class_api.rb
|
195
|
+
- lib/isomorfeus/data/generic_instance_api.rb
|
196
|
+
- lib/isomorfeus/data/handler/arango.rb
|
197
|
+
- lib/isomorfeus/data/handler/generic.rb
|
198
|
+
- lib/isomorfeus/data/handler/object_call.rb
|
199
|
+
- lib/isomorfeus/data/handler/object_store.rb
|
196
200
|
- lib/isomorfeus/data/props.rb
|
197
201
|
- lib/isomorfeus/data/reducer.rb
|
198
202
|
- lib/isomorfeus/data/version.rb
|
199
|
-
- lib/
|
200
|
-
- lib/
|
201
|
-
- lib/
|
202
|
-
- lib/
|
203
|
-
- lib/
|
204
|
-
- lib/
|
205
|
-
- lib/
|
206
|
-
- lib/
|
207
|
-
- lib/
|
208
|
-
- lib/
|
209
|
-
- lib/
|
210
|
-
- lib/
|
203
|
+
- lib/isomorfeus_data/lucid_data/array/base.rb
|
204
|
+
- lib/isomorfeus_data/lucid_data/array/mixin.rb
|
205
|
+
- lib/isomorfeus_data/lucid_data/collection/base.rb
|
206
|
+
- lib/isomorfeus_data/lucid_data/collection/finders.rb
|
207
|
+
- lib/isomorfeus_data/lucid_data/collection/mixin.rb
|
208
|
+
- lib/isomorfeus_data/lucid_data/composition/base.rb
|
209
|
+
- lib/isomorfeus_data/lucid_data/composition/mixin.rb
|
210
|
+
- lib/isomorfeus_data/lucid_data/document/base.rb
|
211
|
+
- lib/isomorfeus_data/lucid_data/document/mixin.rb
|
212
|
+
- lib/isomorfeus_data/lucid_data/edge/base.rb
|
213
|
+
- lib/isomorfeus_data/lucid_data/edge/mixin.rb
|
214
|
+
- lib/isomorfeus_data/lucid_data/edge_collection/base.rb
|
215
|
+
- lib/isomorfeus_data/lucid_data/edge_collection/finders.rb
|
216
|
+
- lib/isomorfeus_data/lucid_data/edge_collection/mixin.rb
|
217
|
+
- lib/isomorfeus_data/lucid_data/graph/base.rb
|
218
|
+
- lib/isomorfeus_data/lucid_data/graph/finders.rb
|
219
|
+
- lib/isomorfeus_data/lucid_data/graph/mixin.rb
|
220
|
+
- lib/isomorfeus_data/lucid_data/hash/base.rb
|
221
|
+
- lib/isomorfeus_data/lucid_data/hash/mixin.rb
|
222
|
+
- lib/isomorfeus_data/lucid_data/link/base.rb
|
223
|
+
- lib/isomorfeus_data/lucid_data/link/mixin.rb
|
224
|
+
- lib/isomorfeus_data/lucid_data/link_collection/base.rb
|
225
|
+
- lib/isomorfeus_data/lucid_data/link_collection/mixin.rb
|
226
|
+
- lib/isomorfeus_data/lucid_data/node/base.rb
|
227
|
+
- lib/isomorfeus_data/lucid_data/node/mixin.rb
|
228
|
+
- lib/isomorfeus_data/lucid_data/object/base.rb
|
229
|
+
- lib/isomorfeus_data/lucid_data/object/mixin.rb
|
230
|
+
- lib/isomorfeus_data/lucid_data/remote_object/base.rb
|
231
|
+
- lib/isomorfeus_data/lucid_data/remote_object/mixin.rb
|
232
|
+
- lib/isomorfeus_data/lucid_data/vertex/base.rb
|
233
|
+
- lib/isomorfeus_data/lucid_data/vertex/mixin.rb
|
234
|
+
- lib/lucid_arango/collection/base.rb
|
235
|
+
- lib/lucid_arango/collection/mixin.rb
|
236
|
+
- lib/lucid_arango/document/base.rb
|
237
|
+
- lib/lucid_arango/document/mixin.rb
|
238
|
+
- lib/lucid_arango/edge/base.rb
|
239
|
+
- lib/lucid_arango/edge/mixin.rb
|
240
|
+
- lib/lucid_arango/edge_collection/base.rb
|
241
|
+
- lib/lucid_arango/edge_collection/mixin.rb
|
242
|
+
- lib/lucid_arango/graph/base.rb
|
243
|
+
- lib/lucid_arango/graph/mixin.rb
|
244
|
+
- lib/lucid_arango/node/base.rb
|
245
|
+
- lib/lucid_arango/node/mixin.rb
|
246
|
+
- lib/lucid_arango/vertex/base.rb
|
247
|
+
- lib/lucid_arango/vertex/mixin.rb
|
211
248
|
homepage: http://isomorfeus.com
|
212
249
|
licenses:
|
213
250
|
- MIT
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Isomorfeus
|
4
|
-
module Data
|
5
|
-
module Handler
|
6
|
-
class ArrayLoadHandler < LucidHandler::Base
|
7
|
-
on_request do |pub_sub_client, current_user, request, response|
|
8
|
-
result = { error: 'No such thing' }
|
9
|
-
# promise_send_path('Isomorfeus::Data::Handler::CollectionLoadHandler', self.to_s, props_hash)
|
10
|
-
request.each_key do |array_class_name|
|
11
|
-
if Isomorfeus.valid_array_class_name?(array_class_name)
|
12
|
-
array_class = Isomorfeus.cached_array_class(array_class_name)
|
13
|
-
if array_class
|
14
|
-
props_json = request[array_class_name]
|
15
|
-
begin
|
16
|
-
props = Oj.load(props_json, mode: :strict)
|
17
|
-
props.merge!({pub_sub_client: pub_sub_client, current_user: current_user})
|
18
|
-
if current_user.authorized?(array_class, :load, *props)
|
19
|
-
array = array_class.load(props)
|
20
|
-
array.instance_exec do
|
21
|
-
array_class.on_load_block.call(pub_sub_client, current_user) if array_class.on_load_block
|
22
|
-
end
|
23
|
-
response.deep_merge!(data: array.to_transport)
|
24
|
-
result = { success: 'ok' }
|
25
|
-
else
|
26
|
-
result = { error: 'Access denied!' }
|
27
|
-
end
|
28
|
-
rescue Exception => e
|
29
|
-
result = if Isomorfeus.production?
|
30
|
-
{ error: { array_class_name => 'No such thing!' }}
|
31
|
-
else
|
32
|
-
{ error: { array_class_name => "Isomorfeus::Data::Handler::ArrayLoadHandler: #{e.message}" }}
|
33
|
-
end
|
34
|
-
end
|
35
|
-
else
|
36
|
-
result = { error: { array_class_name => 'No such thing!' }}
|
37
|
-
end
|
38
|
-
else
|
39
|
-
result = { error: { array_class_name => 'No such thing!' }}
|
40
|
-
end
|
41
|
-
end
|
42
|
-
result
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Isomorfeus
|
4
|
-
module Data
|
5
|
-
module Handler
|
6
|
-
class CollectionLoadHandler < LucidHandler::Base
|
7
|
-
on_request do |pub_sub_client, current_user, request, response|
|
8
|
-
result = { error: 'No such thing' }
|
9
|
-
# promise_send_path('Isomorfeus::Data::Handler::CollectionLoadHandler', self.to_s, props_hash)
|
10
|
-
request.each_key do |collection_class_name|
|
11
|
-
if Isomorfeus.valid_collection_class_name?(collection_class_name)
|
12
|
-
collection_class = Isomorfeus.cached_collection_class(collection_class_name)
|
13
|
-
if collection_class
|
14
|
-
props_json = request[collection_class_name]
|
15
|
-
begin
|
16
|
-
props = Oj.load(props_json, mode: :strict)
|
17
|
-
props.merge!({pub_sub_client: pub_sub_client, current_user: current_user})
|
18
|
-
if current_user.authorized?(collection_class, :load, *props)
|
19
|
-
collection = collection_class.load(props)
|
20
|
-
collection.instance_exec do
|
21
|
-
collection_class.on_load_block.call(pub_sub_client, current_user) if collection_class.on_load_block
|
22
|
-
end
|
23
|
-
response.deep_merge!(data: collection.to_transport)
|
24
|
-
response.deep_merge!(data: collection.included_items_to_transport)
|
25
|
-
result = { success: 'ok' }
|
26
|
-
else
|
27
|
-
result = { error: 'Access denied!' }
|
28
|
-
end
|
29
|
-
rescue Exception => e
|
30
|
-
result = if Isomorfeus.production?
|
31
|
-
{ error: { collection_class_name => 'No such thing!' }}
|
32
|
-
else
|
33
|
-
{ error: { collection_class_name => "Isomorfeus::Data::Handler::CollectionLoadHandler: #{e.message}" }}
|
34
|
-
end
|
35
|
-
end
|
36
|
-
else
|
37
|
-
result = { error: { collection_class_name => 'No such thing!' }}
|
38
|
-
end
|
39
|
-
else
|
40
|
-
result = { error: { collection_class_name => 'No such thing!' }}
|
41
|
-
end
|
42
|
-
end
|
43
|
-
result
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Isomorfeus
|
4
|
-
module Data
|
5
|
-
module Handler
|
6
|
-
class GraphLoadHandler < LucidHandler::Base
|
7
|
-
on_request do |pub_sub_client, current_user, request, response|
|
8
|
-
result = { error: 'No such thing' }
|
9
|
-
# promise_send_path('Isomorfeus::Data::Handler::GraphLoadHandler', self.to_s, props_hash)
|
10
|
-
request.each_key do |graph_class_name|
|
11
|
-
if Isomorfeus.valid_graph_class_name?(graph_class_name)
|
12
|
-
graph_class = Isomorfeus.cached_graph_class(graph_class_name)
|
13
|
-
if graph_class
|
14
|
-
props_json = request[graph_class_name]
|
15
|
-
begin
|
16
|
-
props = Oj.load(props_json, mode: :strict)
|
17
|
-
props.merge!({pub_sub_client: pub_sub_client, current_user: current_user})
|
18
|
-
if current_user.authorized?(graph_class, :load, *props)
|
19
|
-
graph = graph_class.load(props)
|
20
|
-
graph.instance_exec do
|
21
|
-
graph_class.on_load_block.call(pub_sub_client, current_user) if graph_class.on_load_block
|
22
|
-
end
|
23
|
-
response.deep_merge!(data: graph.to_transport)
|
24
|
-
response.deep_merge!(data: graph.included_items_to_transport)
|
25
|
-
result = { success: 'ok' }
|
26
|
-
else
|
27
|
-
result = { error: 'Access denied!' }
|
28
|
-
end
|
29
|
-
rescue Exception => e
|
30
|
-
result = if Isomorfeus.production?
|
31
|
-
{ error: { graph_class_name => 'No such thing!' }}
|
32
|
-
else
|
33
|
-
{ error: { graph_class_name => "Isomorfeus::Data::Handler::GraphLoadHandler: #{e.message}" }}
|
34
|
-
end
|
35
|
-
end
|
36
|
-
else
|
37
|
-
result = { error: { graph_class_name => 'No such thing!' }}
|
38
|
-
end
|
39
|
-
else
|
40
|
-
result = { error: { graph_class_name => 'No such thing!' }}
|
41
|
-
end
|
42
|
-
end
|
43
|
-
result
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Isomorfeus
|
4
|
-
module Data
|
5
|
-
module Handler
|
6
|
-
class HashLoadHandler < LucidHandler::Base
|
7
|
-
on_request do |pub_sub_client, current_user, request, response|
|
8
|
-
result = { error: 'No such thing' }
|
9
|
-
# promise_send_path('Isomorfeus::Data::Handler::HashLoadHandler', self.to_s, props_hash)
|
10
|
-
request.each_key do |hash_class_name|
|
11
|
-
if Isomorfeus.valid_hash_class_name?(hash_class_name)
|
12
|
-
hash_class = Isomorfeus.cached_hash_class(hash_class_name)
|
13
|
-
if hash_class
|
14
|
-
props_json = request[hash_class_name]
|
15
|
-
begin
|
16
|
-
props = Oj.load(props_json, mode: :strict)
|
17
|
-
props.merge!({pub_sub_client: pub_sub_client, current_user: current_user})
|
18
|
-
if current_user.authorized?(hash_class, :load, *props)
|
19
|
-
hash = hash_class.load(props)
|
20
|
-
hash.instance_exec do
|
21
|
-
hash_class.on_load_block.call(pub_sub_client, current_user) if hash_class.on_load_block
|
22
|
-
end
|
23
|
-
response.deep_merge!(data: hash.to_transport)
|
24
|
-
result = { success: 'ok' }
|
25
|
-
else
|
26
|
-
result = { error: 'Access denied!' }
|
27
|
-
end
|
28
|
-
rescue Exception => e
|
29
|
-
result = if Isomorfeus.production?
|
30
|
-
{ error: { hash_class_name => 'No such thing!' }}
|
31
|
-
else
|
32
|
-
{ error: { hash_class_name => "Isomorfeus::Data::Handler::HashLoadHandler: #{e.message}" }}
|
33
|
-
end
|
34
|
-
end
|
35
|
-
else
|
36
|
-
result = { error: { hash_class_name => 'No such thing!' }}
|
37
|
-
end
|
38
|
-
else
|
39
|
-
result = { error: { hash_class_name => 'No such thing!' }}
|
40
|
-
end
|
41
|
-
end
|
42
|
-
result
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
data/lib/lucid_array/base.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
module LucidArray
|
2
|
-
class Base
|
3
|
-
include LucidArray::Mixin
|
4
|
-
|
5
|
-
if RUBY_ENGINE != 'opal'
|
6
|
-
def self.inherited(base)
|
7
|
-
Isomorfeus.add_valid_array_class(base)
|
8
|
-
|
9
|
-
base.prop :pub_sub_client, default: nil
|
10
|
-
base.prop :current_user, default: nil
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module LucidCollection
|
2
|
-
class Base
|
3
|
-
include LucidCollection::Mixin
|
4
|
-
|
5
|
-
if RUBY_ENGINE != 'opal'
|
6
|
-
def self.inherited(base)
|
7
|
-
Isomorfeus.add_valid_collection_class(base)
|
8
|
-
|
9
|
-
base.prop :pub_sub_client, default: nil
|
10
|
-
base.prop :current_user, default: nil
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|