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
@@ -0,0 +1,72 @@
|
|
1
|
+
module Isomorfeus
|
2
|
+
module Data
|
3
|
+
module GenericInstanceApi
|
4
|
+
def key
|
5
|
+
@key
|
6
|
+
end
|
7
|
+
|
8
|
+
def key=(k)
|
9
|
+
@key = k.to_s
|
10
|
+
end
|
11
|
+
|
12
|
+
def revision
|
13
|
+
@_revision
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_sid
|
17
|
+
[@class_name, @key]
|
18
|
+
end
|
19
|
+
|
20
|
+
if RUBY_ENGINE == 'opal'
|
21
|
+
def loaded?
|
22
|
+
Redux.fetch_by_path(*@_store_path) ? true : false
|
23
|
+
end
|
24
|
+
|
25
|
+
def destroy
|
26
|
+
promise_destroy
|
27
|
+
nil
|
28
|
+
end
|
29
|
+
|
30
|
+
def promise_destroy
|
31
|
+
self.class.promise_destroy(@key)
|
32
|
+
end
|
33
|
+
|
34
|
+
def reload
|
35
|
+
self.class.promise_load(@key, self)
|
36
|
+
self
|
37
|
+
end
|
38
|
+
|
39
|
+
def promise_reload
|
40
|
+
self.class.promise_load(@key, self)
|
41
|
+
end
|
42
|
+
|
43
|
+
def save
|
44
|
+
promise_save
|
45
|
+
self
|
46
|
+
end
|
47
|
+
alias create save
|
48
|
+
|
49
|
+
def promise_save
|
50
|
+
Isomorfeus::Transport.promise_send_path( 'Isomorfeus::Data::Handler::Generic', self.name, 'save', to_transport).then do |agent|
|
51
|
+
if agent.processed
|
52
|
+
agent.result
|
53
|
+
else
|
54
|
+
agent.processed = true
|
55
|
+
if agent.response.key?(:error)
|
56
|
+
`console.error(#{agent.response[:error].to_n})`
|
57
|
+
raise agent.response[:error]
|
58
|
+
end
|
59
|
+
Isomorfeus.store.dispatch(type: 'DATA_LOAD', data: agent.full_response[:data])
|
60
|
+
agent.result = true
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
alias promise_create promise_save
|
65
|
+
else # RUBY_ENGINE
|
66
|
+
def loaded?
|
67
|
+
true
|
68
|
+
end
|
69
|
+
end # RUBY_ENGINE
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Isomorfeus
|
4
|
+
module Data
|
5
|
+
module Handler
|
6
|
+
class Arango < LucidHandler::Base
|
7
|
+
on_request do |pub_sub_client, current_user, response_agent|
|
8
|
+
# promise_send_path('Isomorfeus::Data::Handler::Generic', action, type, self.to_s, props_hash)
|
9
|
+
response_agent.request.each_key do |action|
|
10
|
+
if action == 'load'
|
11
|
+
response_agent.request[action].each_key do |type|
|
12
|
+
if %w[collection graph document edge].include?(type)
|
13
|
+
response_agent.request.each_key do |type_class_name|
|
14
|
+
if Isomorfeus.send("valid_#{type}_class_name?", type_class_name)
|
15
|
+
type_class = Isomorfeus.send("cached_#{type}_class", type_class_name)
|
16
|
+
if type_class
|
17
|
+
props_json = response_agent.request[type_class_name]
|
18
|
+
begin
|
19
|
+
props = Oj.load(props_json, mode: :strict)
|
20
|
+
props.merge!({pub_sub_client: pub_sub_client, current_user: current_user})
|
21
|
+
if current_user.authorized?(type_class, :load, *props)
|
22
|
+
loaded_type = type_class.load(props)
|
23
|
+
loaded_type.instance_exec do
|
24
|
+
type_class.on_load_block.call(pub_sub_client, current_user) if type_class.on_load_block
|
25
|
+
end
|
26
|
+
response_agent.outer_result = { data: loaded_type.to_transport }
|
27
|
+
if %w[collection graph].include?(type)
|
28
|
+
response_agent.outer_result.deep_merge!(data: loaded_type.included_items_to_transport)
|
29
|
+
end
|
30
|
+
response_agent.agent_result = { success: 'ok' }
|
31
|
+
else
|
32
|
+
response_agent.error = { error: 'Access denied!' }
|
33
|
+
end
|
34
|
+
rescue Exception => e
|
35
|
+
response_agent.error = if Isomorfeus.production?
|
36
|
+
{ error: { type_class_name => 'No such thing!' }}
|
37
|
+
else
|
38
|
+
{ error: { type_class_name => "Isomorfeus::Data::Handler::Generic: #{e.message}" }}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
else
|
42
|
+
response_agent.error = { error: { type_class_name => 'No such thing!' }}
|
43
|
+
end
|
44
|
+
else
|
45
|
+
response_agent.error = { error: { type_class_name => 'No such thing!' }}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
else
|
49
|
+
response_agent.error = { error: { type => 'No such thing!' }}
|
50
|
+
end
|
51
|
+
end
|
52
|
+
elsif action == 'store'
|
53
|
+
else
|
54
|
+
response_agent.error = { error: { action => 'No such thing!' }}
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Isomorfeus
|
4
|
+
module Data
|
5
|
+
module Handler
|
6
|
+
class Generic < LucidHandler::Base
|
7
|
+
# responsible for loading:
|
8
|
+
# LucidArray
|
9
|
+
# LucidHash
|
10
|
+
# LucidData::Edge
|
11
|
+
# LucidData::Document
|
12
|
+
# LucidData::Collection
|
13
|
+
|
14
|
+
def process_request(pub_sub_client, current_user, response_agent)
|
15
|
+
# promise_send_path('Isomorfeus::Data::Handler::Generic', self.to_s, action, props_hash)
|
16
|
+
response_agent.request.each_key do |type_class_name|
|
17
|
+
if Isomorfeus.valid_data_class_name?(type_class_name)
|
18
|
+
type_class = Isomorfeus.cached_data_class(type_class_name)
|
19
|
+
if type_class
|
20
|
+
response_agent.request[type_class_name].each_key do |action|
|
21
|
+
case action
|
22
|
+
when 'load' then process_load(pub_sub_client, current_user, response_agent, type_class, type_class_name, action)
|
23
|
+
when 'store' then process_store(pub_sub_client, current_user, response_agent, type_class, type_class_name, action)
|
24
|
+
else response_agent.error = { error: { action => 'No such thing!' }}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
else response_agent.error = { error: { type_class_name => 'No such thing!' }}
|
28
|
+
end
|
29
|
+
else response_agent.error = { error: { type_class_name => 'No such thing!' }}
|
30
|
+
end
|
31
|
+
end
|
32
|
+
rescue Exception => e
|
33
|
+
response_agent.error = if Isomorfeus.production? then { error: 'No such thing!' }
|
34
|
+
else { error: "Isomorfeus::Data::Handler::Generic: #{e.message}\n#{e.backtrace.join("\n")}" }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def process_load(pub_sub_client, current_user, response_agent, type_class, type_class_name, action)
|
39
|
+
props = response_agent.request[type_class_name][action]
|
40
|
+
# STDERR.puts "PROPS_JSON #{props_json}"
|
41
|
+
# props = Oj.load(props_json, mode: :strict)
|
42
|
+
props.transform_keys!(&:to_sym)
|
43
|
+
props.merge!(pub_sub_client: pub_sub_client, current_user: current_user)
|
44
|
+
if current_user.authorized?(type_class, :load, props)
|
45
|
+
loaded_type = type_class.load(**props)
|
46
|
+
if loaded_type
|
47
|
+
on_load_block = type_class.instance_variable_get(:@_on_load_block)
|
48
|
+
loaded_type.instance_exec(pub_sub_client, current_user, &on_load_block) if on_load_block
|
49
|
+
response_agent.outer_result = { data: loaded_type.to_transport }
|
50
|
+
if loaded_type.respond_to?(:included_items_to_transport)
|
51
|
+
response_agent.outer_result.deep_merge!(data: loaded_type.included_items_to_transport)
|
52
|
+
end
|
53
|
+
response_agent.agent_result = { success: 'ok' }
|
54
|
+
else response_agent.error = { error: { type_class_name => 'No such thing!' }}
|
55
|
+
end
|
56
|
+
else response_agent.error = { error: 'Access denied!' }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def process_store(pub_sub_client, current_user, response_agent, type_class, type_class_name, action)
|
61
|
+
props_json = response_agent.request[type_class_name][action]
|
62
|
+
props = Oj.load(props_json, mode: :strict)
|
63
|
+
props.merge!(pub_sub_client: pub_sub_client, current_user: current_user)
|
64
|
+
if current_user.authorized?(type_class, :store, props)
|
65
|
+
stored_type = type_class.new(**props).store
|
66
|
+
on_store_block = type_class.instance_variable_get(:@_on_store_block)
|
67
|
+
stored_type.instance_exec(pub_sub_client, current_user, &on_store_block) if on_store_block
|
68
|
+
response_agent.outer_result = { data: stored_type.to_transport }
|
69
|
+
response_agent.agent_result = { success: 'ok' }
|
70
|
+
else response_agent.error = { error: 'Access denied!' }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
#def process_destroy(pub_sub_client, current_user, response_agent, type_class, type_class_name, action)
|
75
|
+
# props_json = response_agent.request[type_class_name][action]
|
76
|
+
# props = Oj.load(props_json, mode: :strict)
|
77
|
+
# props.merge!(pub_sub_client: pub_sub_client, current_user: current_user)
|
78
|
+
# if current_user.authorized?(type_class, :store, *props)
|
79
|
+
# # TODO
|
80
|
+
# stored_type.instance_exec do
|
81
|
+
# type_class.on_store_block.call(pub_sub_client, current_user) if type_class.on_store_block
|
82
|
+
# end
|
83
|
+
# destroyed = type_class.destroy(**props)
|
84
|
+
# response_agent.outer_result = { data: stored_type.to_transport }
|
85
|
+
# response_agent.agent_result = { success: 'ok' }
|
86
|
+
# else response_agent.error = { error: 'Access denied!' }
|
87
|
+
# end
|
88
|
+
#end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Isomorfeus
|
4
|
+
module Data
|
5
|
+
module Handler
|
6
|
+
class Object < LucidHandler::Base
|
7
|
+
on_request do |pub_sub_client, current_user, response_agent|
|
8
|
+
# promise_send_path('Isomorfeus::Data::Handler::Object', action, object_hash)
|
9
|
+
response_agent.request.each_key do |array_class_name|
|
10
|
+
if Isomorfeus.valid_array_class_name?(array_class_name)
|
11
|
+
array_class = Isomorfeus.cached_array_class(array_class_name)
|
12
|
+
if array_class
|
13
|
+
props_json = response_agent.request[array_class_name]
|
14
|
+
begin
|
15
|
+
props = Oj.load(props_json, mode: :strict)
|
16
|
+
props.merge!({pub_sub_client: pub_sub_client, current_user: current_user})
|
17
|
+
if current_user.authorized?(array_class, :load, *props)
|
18
|
+
array = array_class.load(props)
|
19
|
+
array.instance_exec do
|
20
|
+
array_class.on_load_block.call(pub_sub_client, current_user) if array_class.on_load_block
|
21
|
+
end
|
22
|
+
response_agent.outer_result = { data: array.to_transport }
|
23
|
+
response_agent.agent_result = { success: 'ok' }
|
24
|
+
else
|
25
|
+
response_agent.error = { error: 'Access denied!' }
|
26
|
+
end
|
27
|
+
rescue Exception => e
|
28
|
+
response_agent.error = if Isomorfeus.production?
|
29
|
+
{ error: { array_class_name => 'No such thing!' }}
|
30
|
+
else
|
31
|
+
{ error: { array_class_name => "Isomorfeus::Data::Handler::ArrayLoadHandler: #{e.message}" }}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
else
|
35
|
+
response_agent.error = { error: { array_class_name => 'No such thing!' }}
|
36
|
+
end
|
37
|
+
else
|
38
|
+
response_agent.error = { error: { array_class_name => 'No such thing!' }}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Isomorfeus
|
4
|
+
module Data
|
5
|
+
module Handler
|
6
|
+
class Object < LucidHandler::Base
|
7
|
+
on_request do |pub_sub_client, current_user, response_agent|
|
8
|
+
# promise_send_path('Isomorfeus::Data::Handler::Object', action, object_hash)
|
9
|
+
response_agent.request.each_key do |array_class_name|
|
10
|
+
if Isomorfeus.valid_array_class_name?(array_class_name)
|
11
|
+
array_class = Isomorfeus.cached_array_class(array_class_name)
|
12
|
+
if array_class
|
13
|
+
props_json = response_agent.request[array_class_name]
|
14
|
+
begin
|
15
|
+
props = Oj.load(props_json, mode: :strict)
|
16
|
+
props.merge!({pub_sub_client: pub_sub_client, current_user: current_user})
|
17
|
+
if current_user.authorized?(array_class, :load, *props)
|
18
|
+
array = array_class.load(props)
|
19
|
+
array.instance_exec do
|
20
|
+
array_class.on_load_block.call(pub_sub_client, current_user) if array_class.on_load_block
|
21
|
+
end
|
22
|
+
response_agent.outer_result = { data: array.to_transport }
|
23
|
+
response_agent.agent_result = { success: 'ok' }
|
24
|
+
else
|
25
|
+
response_agent.error = { error: 'Access denied!' }
|
26
|
+
end
|
27
|
+
rescue Exception => e
|
28
|
+
response_agent.error = if Isomorfeus.production?
|
29
|
+
{ error: { array_class_name => 'No such thing!' }}
|
30
|
+
else
|
31
|
+
{ error: { array_class_name => "Isomorfeus::Data::Handler::ArrayLoadHandler: #{e.message}" }}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
else
|
35
|
+
response_agent.error = { error: { array_class_name => 'No such thing!' }}
|
36
|
+
end
|
37
|
+
else
|
38
|
+
response_agent.error = { error: { array_class_name => 'No such thing!' }}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/isomorfeus-data.rb
CHANGED
@@ -1,47 +1,78 @@
|
|
1
|
-
require 'opal'
|
2
|
-
require 'opal-autoloader'
|
3
|
-
require 'opal-activesupport'
|
4
|
-
require 'isomorfeus-redux'
|
5
|
-
require 'isomorfeus-react'
|
6
1
|
require 'isomorfeus-transport'
|
7
|
-
|
8
2
|
require 'isomorfeus/data/config'
|
9
3
|
require 'isomorfeus/data/props'
|
10
|
-
require '
|
11
|
-
require '
|
12
|
-
require '
|
13
|
-
require '
|
14
|
-
require '
|
15
|
-
require '
|
16
|
-
require '
|
17
|
-
require '
|
18
|
-
require '
|
19
|
-
require '
|
20
|
-
require '
|
21
|
-
require '
|
4
|
+
require 'isomorfeus/data/attribute_support'
|
5
|
+
require 'isomorfeus/data/generic_class_api'
|
6
|
+
require 'isomorfeus/data/generic_instance_api'
|
7
|
+
require 'isomorfeus/data/element_validator'
|
8
|
+
#require 'lucid_arango/node/mixin'
|
9
|
+
#require 'lucid_arango/node/base'
|
10
|
+
#require 'lucid_arango/document/mixin'
|
11
|
+
#require 'lucid_arango/document/base'
|
12
|
+
#require 'lucid_arango/vertex/mixin'
|
13
|
+
#require 'lucid_arango/vertex/base'
|
14
|
+
#require 'lucid_arango/edge/mixin'
|
15
|
+
#require 'lucid_arango/edge/base'
|
16
|
+
#require 'lucid_arango/collection/mixin'
|
17
|
+
#require 'lucid_arango/collection/base'
|
18
|
+
#require 'lucid_arango/edge_collection/mixin'
|
19
|
+
#require 'lucid_arango/edge_collection/base'
|
20
|
+
#require 'lucid_arango/graph/mixin'
|
21
|
+
#require 'lucid_arango/graph/base'
|
22
|
+
|
22
23
|
|
23
24
|
if RUBY_ENGINE == 'opal'
|
24
25
|
require 'isomorfeus/data/reducer'
|
25
26
|
Isomorfeus::Data::Reducer.add_reducer_to_store
|
26
|
-
|
27
|
+
Isomorfeus.zeitwerk.push_dir('isomorfeus_data')
|
28
|
+
require_tree 'isomorfeus_data', :autoload
|
29
|
+
Isomorfeus.zeitwerk.push_dir('data')
|
27
30
|
else
|
28
31
|
require 'oj'
|
29
32
|
require 'active_support'
|
30
33
|
require 'active_support/core_ext/hash'
|
31
|
-
require '
|
32
|
-
require 'isomorfeus/data/handler/
|
33
|
-
require 'isomorfeus/data/handler/graph_load_handler'
|
34
|
-
require 'isomorfeus/data/handler/hash_load_handler'
|
34
|
+
#require 'arango-driver'
|
35
|
+
#require 'isomorfeus/data/handler/arango'
|
35
36
|
|
36
|
-
|
37
|
+
require 'isomorfeus_data/lucid_data/array/mixin'
|
38
|
+
require 'isomorfeus_data/lucid_data/array/base'
|
39
|
+
require 'isomorfeus_data/lucid_data/hash/mixin'
|
40
|
+
require 'isomorfeus_data/lucid_data/hash/base'
|
41
|
+
require 'isomorfeus_data/lucid_data/node/mixin'
|
42
|
+
require 'isomorfeus_data/lucid_data/node/base'
|
43
|
+
require 'isomorfeus_data/lucid_data/document/mixin'
|
44
|
+
require 'isomorfeus_data/lucid_data/document/base'
|
45
|
+
require 'isomorfeus_data/lucid_data/vertex/mixin'
|
46
|
+
require 'isomorfeus_data/lucid_data/vertex/base'
|
47
|
+
require 'isomorfeus_data/lucid_data/edge/mixin'
|
48
|
+
require 'isomorfeus_data/lucid_data/edge/base'
|
49
|
+
require 'isomorfeus_data/lucid_data/link/mixin'
|
50
|
+
require 'isomorfeus_data/lucid_data/link/base'
|
51
|
+
require 'isomorfeus_data/lucid_data/collection/finders'
|
52
|
+
require 'isomorfeus_data/lucid_data/collection/mixin'
|
53
|
+
require 'isomorfeus_data/lucid_data/collection/base'
|
54
|
+
require 'isomorfeus_data/lucid_data/edge_collection/finders'
|
55
|
+
require 'isomorfeus_data/lucid_data/edge_collection/mixin'
|
56
|
+
require 'isomorfeus_data/lucid_data/edge_collection/base'
|
57
|
+
require 'isomorfeus_data/lucid_data/link_collection/mixin'
|
58
|
+
require 'isomorfeus_data/lucid_data/link_collection/base'
|
59
|
+
require 'isomorfeus_data/lucid_data/graph/finders'
|
60
|
+
require 'isomorfeus_data/lucid_data/graph/mixin'
|
61
|
+
require 'isomorfeus_data/lucid_data/graph/base'
|
62
|
+
require 'isomorfeus_data/lucid_data/object/mixin'
|
63
|
+
require 'isomorfeus_data/lucid_data/object/base'
|
64
|
+
require 'isomorfeus_data/lucid_data/remote_object/mixin'
|
65
|
+
require 'isomorfeus_data/lucid_data/remote_object/base'
|
66
|
+
require 'isomorfeus_data/lucid_data/composition/mixin'
|
67
|
+
require 'isomorfeus_data/lucid_data/composition/base'
|
37
68
|
|
38
|
-
require '
|
69
|
+
require 'isomorfeus/data/handler/generic'
|
70
|
+
require 'isomorfeus/data/handler/object_call'
|
71
|
+
require 'isomorfeus/data/handler/object_store'
|
72
|
+
|
73
|
+
Opal.append_path(__dir__.untaint) unless Opal.paths.include?(__dir__.untaint)
|
39
74
|
|
40
75
|
path = File.expand_path(File.join('isomorfeus', 'data'))
|
41
76
|
|
42
|
-
|
43
|
-
# we also need to require them all, so classes are registered accordingly
|
44
|
-
Dir.glob("#{path}/**/*.rb").each do |file|
|
45
|
-
require file
|
46
|
-
end
|
77
|
+
Isomorfeus.zeitwerk.push_dir(path)
|
47
78
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module LucidData
|
2
|
+
module Array
|
3
|
+
class Base
|
4
|
+
include LucidData::Array::Mixin
|
5
|
+
|
6
|
+
if RUBY_ENGINE != 'opal'
|
7
|
+
def self.inherited(base)
|
8
|
+
Isomorfeus.add_valid_data_class(base)
|
9
|
+
base.prop :pub_sub_client, default: nil
|
10
|
+
base.prop :current_user, default: Anonymous.new
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|