ecoportal-api-graphql 1.3.1 → 1.3.2
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/.rubocop.yml +1 -1
- data/CHANGELOG.md +36 -7
- data/ecoportal-api-graphql.gemspec +1 -1
- data/lib/ecoportal/api/common/graphql/client.rb +2 -1
- data/lib/ecoportal/api/common/graphql/query_integration.rb +5 -5
- data/lib/ecoportal/api/common.graphql.rb +1 -1
- data/lib/ecoportal/api/graphql/base/action.rb +1 -1
- data/lib/ecoportal/api/graphql/base/action_category.rb +1 -1
- data/lib/ecoportal/api/graphql/base/contractor_entity.rb +1 -1
- data/lib/ecoportal/api/graphql/base/date_time.rb +1 -1
- data/lib/ecoportal/api/graphql/base/field.rb +1 -1
- data/lib/ecoportal/api/graphql/base/file_attachment.rb +1 -1
- data/lib/ecoportal/api/graphql/base/file_container.rb +1 -1
- data/lib/ecoportal/api/graphql/base/location_classification_type.rb +1 -1
- data/lib/ecoportal/api/graphql/base/location_node.rb +3 -5
- data/lib/ecoportal/api/graphql/base/location_structure/draft/structure.rb +37 -0
- data/lib/ecoportal/api/graphql/base/location_structure/draft.rb +88 -0
- data/lib/ecoportal/api/graphql/base/location_structure.rb +9 -5
- data/lib/ecoportal/api/graphql/base/organization.rb +1 -1
- data/lib/ecoportal/api/graphql/base/page.rb +1 -1
- data/lib/ecoportal/api/graphql/base/page_info.rb +1 -1
- data/lib/ecoportal/api/graphql/base/person_member.rb +1 -1
- data/lib/ecoportal/api/graphql/base/resource.rb +1 -1
- data/lib/ecoportal/api/graphql/builder/action.rb +3 -3
- data/lib/ecoportal/api/graphql/builder/contractor_entity.rb +3 -3
- data/lib/ecoportal/api/graphql/builder/location_structure/draft.rb +64 -0
- data/lib/ecoportal/api/graphql/builder/location_structure.rb +9 -3
- data/lib/ecoportal/api/graphql/connection/action.rb +2 -2
- data/lib/ecoportal/api/graphql/connection/action_category.rb +2 -2
- data/lib/ecoportal/api/graphql/connection/contractor_entity.rb +2 -2
- data/lib/ecoportal/api/graphql/connection/person_member.rb +2 -2
- data/lib/ecoportal/api/graphql/error/locations_error/fetch_nested.rb +49 -0
- data/lib/ecoportal/api/graphql/error/locations_error.rb +15 -4
- data/lib/ecoportal/api/graphql/error/locations_validation_error.rb +5 -1
- data/lib/ecoportal/api/graphql/error/validation_errors.rb +5 -1
- data/lib/ecoportal/api/graphql/fragment/location_draft.rb +39 -0
- data/lib/ecoportal/api/graphql/fragment/locations_error.rb +18 -0
- data/lib/ecoportal/api/graphql/fragment.rb +4 -2
- data/lib/ecoportal/api/graphql/input/action/archive.rb +1 -2
- data/lib/ecoportal/api/graphql/input/action/create.rb +1 -1
- data/lib/ecoportal/api/graphql/input/contractor_entity/create.rb +1 -1
- data/lib/ecoportal/api/graphql/input/contractor_entity/destroy.rb +1 -2
- data/lib/ecoportal/api/graphql/input/contractor_entity/update.rb +1 -1
- data/lib/ecoportal/api/graphql/input/id_diff.rb +1 -1
- data/lib/ecoportal/api/graphql/input/location_structure/apply_commands.rb +2 -3
- data/lib/ecoportal/api/graphql/input/location_structure/archive_command.rb +1 -1
- data/lib/ecoportal/api/graphql/input/location_structure/delete_command.rb +1 -1
- data/lib/ecoportal/api/graphql/input/location_structure/draft/add_commands.rb +49 -0
- data/lib/ecoportal/api/graphql/input/location_structure/draft/create.rb +15 -0
- data/lib/ecoportal/api/graphql/input/location_structure/draft/delete.rb +15 -0
- data/lib/ecoportal/api/graphql/input/location_structure/draft/drop_bad_commands.rb +16 -0
- data/lib/ecoportal/api/graphql/input/location_structure/draft/publish.rb +16 -0
- data/lib/ecoportal/api/graphql/input/location_structure/draft.rb +19 -0
- data/lib/ecoportal/api/graphql/input/location_structure/insert_command.rb +1 -1
- data/lib/ecoportal/api/graphql/input/location_structure/move_command.rb +1 -1
- data/lib/ecoportal/api/graphql/input/location_structure/reorder_command.rb +1 -1
- data/lib/ecoportal/api/graphql/input/location_structure/unarchive_command.rb +1 -1
- data/lib/ecoportal/api/graphql/input/location_structure/update_command.rb +1 -1
- data/lib/ecoportal/api/graphql/input/location_structure.rb +1 -1
- data/lib/ecoportal/api/graphql/input/search.rb +1 -1
- data/lib/ecoportal/api/graphql/input/search_filter.rb +1 -1
- data/lib/ecoportal/api/graphql/input/search_sorter.rb +1 -1
- data/lib/ecoportal/api/graphql/interface/base_page.rb +2 -2
- data/lib/ecoportal/api/graphql/{input/location_structure/command_interface.rb → interface/location_structure/command.rb} +9 -5
- data/lib/ecoportal/api/graphql/interface/location_structure/node.rb +43 -0
- data/lib/ecoportal/api/graphql/interface/location_structure/nodes.rb +28 -0
- data/lib/ecoportal/api/graphql/interface/location_structure.rb +14 -0
- data/lib/ecoportal/api/graphql/interface.rb +1 -1
- data/lib/ecoportal/api/graphql/logic/base_model.rb +13 -0
- data/lib/ecoportal/api/graphql/logic/base_query.rb +23 -9
- data/lib/ecoportal/api/graphql/logic/connection.rb +2 -2
- data/lib/ecoportal/api/graphql/logic/input.rb +11 -0
- data/lib/ecoportal/api/graphql/logic/mutation.rb +6 -11
- data/lib/ecoportal/api/graphql/logic/payload.rb +16 -3
- data/lib/ecoportal/api/graphql/logic/query.rb +1 -1
- data/lib/ecoportal/api/graphql/logic/query_array.rb +1 -1
- data/lib/ecoportal/api/graphql/logic/query_connection.rb +6 -6
- data/lib/ecoportal/api/graphql/logic.rb +2 -0
- data/lib/ecoportal/api/graphql/model/account.rb +1 -1
- data/lib/ecoportal/api/graphql/model/action.rb +1 -1
- data/lib/ecoportal/api/graphql/model/contractor_entity.rb +1 -1
- data/lib/ecoportal/api/graphql/model/field.rb +1 -1
- data/lib/ecoportal/api/graphql/model/file_attachment.rb +1 -1
- data/lib/ecoportal/api/graphql/model/file_container.rb +2 -2
- data/lib/ecoportal/api/graphql/model/location_node.rb +3 -5
- data/lib/ecoportal/api/graphql/model/location_structure/draft/structure.rb +15 -0
- data/lib/ecoportal/api/graphql/model/location_structure/draft.rb +15 -0
- data/lib/ecoportal/api/graphql/model/location_structure.rb +5 -1
- data/lib/ecoportal/api/graphql/model/organization.rb +26 -9
- data/lib/ecoportal/api/graphql/model/page.rb +1 -1
- data/lib/ecoportal/api/graphql/model/person_member.rb +2 -2
- data/lib/ecoportal/api/graphql/model/resource.rb +1 -1
- data/lib/ecoportal/api/graphql/model/user.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation/action/archive.rb +3 -3
- data/lib/ecoportal/api/graphql/mutation/action/create.rb +3 -3
- data/lib/ecoportal/api/graphql/mutation/action/update.rb +3 -3
- data/lib/ecoportal/api/graphql/mutation/contractor_entity/create.rb +3 -3
- data/lib/ecoportal/api/graphql/mutation/contractor_entity/destroy.rb +3 -3
- data/lib/ecoportal/api/graphql/mutation/location_structure/apply_commands.rb +9 -16
- data/lib/ecoportal/api/graphql/mutation/location_structure/draft/add_commands.rb +57 -0
- data/lib/ecoportal/api/graphql/mutation/location_structure/draft/create.rb +57 -0
- data/lib/ecoportal/api/graphql/mutation/location_structure/draft/delete.rb +43 -0
- data/lib/ecoportal/api/graphql/mutation/location_structure/draft/drop_bad_commands.rb +59 -0
- data/lib/ecoportal/api/graphql/mutation/location_structure/draft/publish.rb +69 -0
- data/lib/ecoportal/api/graphql/mutation/location_structure/draft.rb +18 -0
- data/lib/ecoportal/api/graphql/mutation/location_structure.rb +1 -0
- data/lib/ecoportal/api/graphql/payload/action/archive.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/action/create.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/action/update.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/contractor_entity/create.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/contractor_entity/destroy.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/contractor_entity/update.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb +32 -9
- data/lib/ecoportal/api/graphql/payload/location_structure/command_execution_result.rb +26 -3
- data/lib/ecoportal/api/graphql/payload/location_structure/draft/add_commands.rb +27 -0
- data/lib/ecoportal/api/graphql/payload/location_structure/draft/create.rb +34 -0
- data/lib/ecoportal/api/graphql/payload/location_structure/draft/delete.rb +27 -0
- data/lib/ecoportal/api/graphql/payload/location_structure/draft/drop_bad_commands.rb +41 -0
- data/lib/ecoportal/api/graphql/payload/location_structure/draft/publish.rb +56 -0
- data/lib/ecoportal/api/graphql/payload/location_structure/draft.rb +18 -0
- data/lib/ecoportal/api/graphql/payload/location_structure.rb +1 -1
- data/lib/ecoportal/api/graphql/query/action.rb +2 -2
- data/lib/ecoportal/api/graphql/query/action_categories.rb +3 -3
- data/lib/ecoportal/api/graphql/query/actions.rb +3 -3
- data/lib/ecoportal/api/graphql/query/contractor_entities.rb +3 -3
- data/lib/ecoportal/api/graphql/query/location_classifications.rb +2 -2
- data/lib/ecoportal/api/graphql/query/location_structure/draft.rb +62 -0
- data/lib/ecoportal/api/graphql/query/location_structure.rb +17 -4
- data/lib/ecoportal/api/graphql/query/location_structures.rb +5 -3
- data/lib/ecoportal/api/graphql.rb +14 -14
- data/lib/ecoportal/api/graphql_version.rb +1 -1
- metadata +37 -8
- data/lib/ecoportal/api/graphql/base_model.rb +0 -11
- data/lib/ecoportal/api/graphql/interface/location_node.rb +0 -39
- data/lib/ecoportal/api/graphql/payload/location_structure/command_interface.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3423fe59a4d52c23bc291894e4afa864eefa963033a5236f286fc214faf2309a
|
4
|
+
data.tar.gz: d6a5362bf375f50772bbc98c06fe37d3242a7d10596d8e067817a5ffeedb5933
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d31e6419bc84e0a3cd5b2c89c0a3d51c791ac3ee8a498cb11b7adecd7681c2b8dcbc502cbe48ae51a221b5d9bc822d7e41cc9778baa4498a42f244374322fa3a
|
7
|
+
data.tar.gz: 59ec3bd222d85393e6238de88fe801acc323ed0fdc89f250b609da702602b3b5c00856c4d844013d85d23248e60190cfd67fcfa1a845a3eba4da64cc507b5ab2
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,22 +2,51 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
##
|
5
|
+
## [1.4.1] - 2025-08-xx
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
### Added
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
### Fixed
|
11
12
|
|
12
|
-
## [1.
|
13
|
+
## [1.3.2] - 2025-08-19
|
13
14
|
|
14
15
|
### Added
|
15
16
|
|
17
|
+
- `Mutation`: allow parameters other than **input**.
|
18
|
+
- Location Structure `Draft` models
|
19
|
+
- `Interface::LocationStructure::Nodes` for `LocationStructure` and `Draft::Structure`
|
20
|
+
- `raw_response` as optional query parameter (for debugging)
|
21
|
+
- `Logic::Input` (out of consistency)
|
22
|
+
- Fragments:
|
23
|
+
- `LocationDraft`
|
24
|
+
- `LocationsError`
|
25
|
+
- Query to include `draft` list when fetching an **RS**.
|
26
|
+
- Location `Draft` queries:
|
27
|
+
- `Draft#byId`
|
28
|
+
- `Draft#create`
|
29
|
+
- `Draft#delete`
|
30
|
+
- `Draft#addCommands`
|
31
|
+
- `Draft#publish`
|
32
|
+
- `Draft#dropBadCommands`
|
33
|
+
- Error tracking througout the payload models of location mutations
|
34
|
+
|
16
35
|
### Changed
|
17
36
|
|
37
|
+
- Upgrade dependency (`ecoportal-api` **gem**).
|
38
|
+
- Moved rescue on fragment definition to `#define` itself.
|
39
|
+
- `NodeInterface` moved to `Interface::LocationStructure::Node`
|
40
|
+
- Code: Shorten namespace referral.
|
41
|
+
- Swap to `Logic::BaseModel`
|
42
|
+
- `Mutation` to introduce `:input` required parameter by using parent class.
|
43
|
+
|
18
44
|
### Fixed
|
19
45
|
|
20
|
-
|
46
|
+
- `QueryConnection`: bad code.
|
47
|
+
- `conflictingIds` should be array.
|
48
|
+
|
49
|
+
## [1.3.1] - 2025-06-11
|
21
50
|
|
22
51
|
### Changed
|
23
52
|
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency 'rubocop-rake', '~> 0'
|
33
33
|
spec.add_development_dependency 'yard', '>= 0.9.34', '< 1'
|
34
34
|
|
35
|
-
spec.add_dependency 'ecoportal-api', '~> 0.10', '>= 0.10.
|
35
|
+
spec.add_dependency 'ecoportal-api', '~> 0.10', '>= 0.10.14'
|
36
36
|
spec.add_dependency 'ecoportal-api-v2', '~> 3.3', '>= 3.3.1'
|
37
37
|
spec.add_dependency 'graphlient', '>= 0.8.0', '< 0.9'
|
38
38
|
end
|
@@ -29,11 +29,11 @@ module Ecoportal
|
|
29
29
|
final_path = path + [subpath].flatten.compact
|
30
30
|
|
31
31
|
resolve_class(query_klass).tap do |klass|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
next if klass <= Ecoportal::API::GraphQL::Logic::BaseQuery
|
33
|
+
|
34
|
+
msg = "Expected query_klass to be of type Ecoportal::API::GraphQL::Logic::BaseQuery. "
|
35
|
+
msg << "Given: #{klass}"
|
36
|
+
raise msg
|
37
37
|
end.new(client, base_path: final_path)
|
38
38
|
end
|
39
39
|
private class_method
|
@@ -2,7 +2,7 @@ module Ecoportal
|
|
2
2
|
module API
|
3
3
|
class GraphQL
|
4
4
|
module Base
|
5
|
-
class FileAttachment <
|
5
|
+
class FileAttachment < Logic::BaseModel
|
6
6
|
passkey :id
|
7
7
|
passthrough :attachmentFileSize, :attachmentFileName, :attachmentContentType
|
8
8
|
passthrough :urlType, :activeName
|
@@ -3,12 +3,10 @@ module Ecoportal
|
|
3
3
|
class GraphQL
|
4
4
|
module Base
|
5
5
|
# LocationNodeType
|
6
|
-
class LocationNode <
|
7
|
-
|
6
|
+
class LocationNode < Interface::LocationStructure::Node
|
7
|
+
class_resolver :location_node_class, self
|
8
8
|
|
9
|
-
|
10
|
-
embeds_many :ancestors, klass: self, read_only: true
|
11
|
-
embeds_many :children, klass: self, read_only: true
|
9
|
+
passthrough :highlights
|
12
10
|
end
|
13
11
|
end
|
14
12
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Ecoportal
|
2
|
+
module API
|
3
|
+
class GraphQL
|
4
|
+
module Base
|
5
|
+
class LocationStructure
|
6
|
+
class Draft
|
7
|
+
class Structure < Interface::LocationStructure::Nodes
|
8
|
+
class_resolver :location_node_class, Base::LocationNode
|
9
|
+
|
10
|
+
def draft?
|
11
|
+
true
|
12
|
+
end
|
13
|
+
|
14
|
+
def id
|
15
|
+
draft&.id
|
16
|
+
end
|
17
|
+
|
18
|
+
def name
|
19
|
+
draft&.name
|
20
|
+
end
|
21
|
+
|
22
|
+
def parent_structure
|
23
|
+
draft&.parent_structure
|
24
|
+
end
|
25
|
+
|
26
|
+
def draft
|
27
|
+
return if _parent == self
|
28
|
+
|
29
|
+
_parent
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module Ecoportal
|
2
|
+
module API
|
3
|
+
class GraphQL
|
4
|
+
module Base
|
5
|
+
class LocationStructure
|
6
|
+
class Draft < Logic::BaseModel
|
7
|
+
read_only!
|
8
|
+
|
9
|
+
class_resolver :structure_class, "Base::LocationStructure::Draft::Structure"
|
10
|
+
|
11
|
+
passkey :id
|
12
|
+
|
13
|
+
passthrough :name, :notes
|
14
|
+
passboolean :commited, :ok
|
15
|
+
alias_method :commited?, :commited
|
16
|
+
alias_method :ok?, :ok
|
17
|
+
|
18
|
+
embeds_one :createdAt, klass: Base::DateTime
|
19
|
+
|
20
|
+
passarray :conflictingIds
|
21
|
+
embeds_many :commands, klass: Interface::LocationStructure::Command
|
22
|
+
embeds_many :results, read_only: true, klass: "Ecoportal::API::GraphQL::Payload::LocationStructure::CommandExecutionResult"
|
23
|
+
|
24
|
+
embeds_one :structure, klass: :structure_class
|
25
|
+
|
26
|
+
include Error::LocationsError::FetchNested
|
27
|
+
|
28
|
+
def error?
|
29
|
+
!ok? ||
|
30
|
+
result_errors? ||
|
31
|
+
conflictingIds?
|
32
|
+
end
|
33
|
+
|
34
|
+
def error_doc
|
35
|
+
if result_errors?
|
36
|
+
{
|
37
|
+
results: [result_errors.first&.error_doc]
|
38
|
+
}
|
39
|
+
elsif conflictingIds?
|
40
|
+
{
|
41
|
+
conflictingIds: conflictingIds.doc
|
42
|
+
}
|
43
|
+
elsif !ok?
|
44
|
+
{
|
45
|
+
ok: false
|
46
|
+
}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def success?
|
51
|
+
!error?
|
52
|
+
end
|
53
|
+
|
54
|
+
def structure_id
|
55
|
+
parent_structure&.id
|
56
|
+
end
|
57
|
+
|
58
|
+
def structure_name
|
59
|
+
parent_structure&.name
|
60
|
+
end
|
61
|
+
|
62
|
+
# @note draft is in a collection of drafts
|
63
|
+
def parent_structure
|
64
|
+
return unless _parent != self
|
65
|
+
return unless _parent._parent != _parent
|
66
|
+
|
67
|
+
_parent._parent
|
68
|
+
end
|
69
|
+
|
70
|
+
def result_errors?
|
71
|
+
result_errors.any?
|
72
|
+
end
|
73
|
+
|
74
|
+
def result_errors
|
75
|
+
results.select(&:error?)
|
76
|
+
end
|
77
|
+
|
78
|
+
def conflictingIds?
|
79
|
+
(conflictingIds || []).any?
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end # GraphQL
|
84
|
+
end # API
|
85
|
+
end # Ecoportal
|
86
|
+
end
|
87
|
+
|
88
|
+
require_relative 'draft/structure'
|
@@ -2,22 +2,26 @@ module Ecoportal
|
|
2
2
|
module API
|
3
3
|
class GraphQL
|
4
4
|
module Base
|
5
|
-
class LocationStructure <
|
5
|
+
class LocationStructure < Interface::LocationStructure::Nodes
|
6
6
|
read_only!
|
7
7
|
|
8
|
-
|
8
|
+
class_resolver :location_node_class, Base::LocationNode
|
9
|
+
class_resolver :draft_class, "Base::LocationStructure::Draft"
|
9
10
|
|
10
11
|
passkey :id
|
11
12
|
passthrough :name, :weight
|
12
13
|
passboolean :archived, :published, :visitorManagementEnabled
|
13
14
|
embeds_one :updatedAt, klass: Base::DateTime
|
14
|
-
embeds_many :nodes, klass: Base::LocationNode, order_key: :weight
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
embeds_many :drafts, klass: :draft_class, order_key: :createdAt
|
17
|
+
|
18
|
+
def draft?
|
19
|
+
false
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
26
|
+
|
27
|
+
require_relative 'location_structure/draft'
|
@@ -24,15 +24,15 @@ module Ecoportal
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def archiveMutation
|
27
|
-
|
27
|
+
Mutation::Action::Archive.new(client)
|
28
28
|
end
|
29
29
|
|
30
30
|
def updateMutation
|
31
|
-
|
31
|
+
Mutation::Action::Update.new(client)
|
32
32
|
end
|
33
33
|
|
34
34
|
def createMutation
|
35
|
-
|
35
|
+
Mutation::Action::Create.new(client)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -24,15 +24,15 @@ module Ecoportal
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def createMutation
|
27
|
-
|
27
|
+
Mutation::ContractorEntity::Create.new(client)
|
28
28
|
end
|
29
29
|
|
30
30
|
def updateMutation
|
31
|
-
|
31
|
+
Mutation::ContractorEntity::Update.new(client)
|
32
32
|
end
|
33
33
|
|
34
34
|
def destroyMutation
|
35
|
-
|
35
|
+
Mutation::ContractorEntity::Destroy.new(client)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module Ecoportal
|
2
|
+
module API
|
3
|
+
class GraphQL
|
4
|
+
module Builder
|
5
|
+
class LocationStructure
|
6
|
+
class Draft
|
7
|
+
attr_reader :client, :parent
|
8
|
+
|
9
|
+
def initialize(client, parent:)
|
10
|
+
@client = client
|
11
|
+
@parent = parent
|
12
|
+
end
|
13
|
+
|
14
|
+
def nodeClassifications(**kargs, &block)
|
15
|
+
parent.nodeClassifications(**kargs, &block)
|
16
|
+
end
|
17
|
+
|
18
|
+
def create(**kargs, &block)
|
19
|
+
createMutation.query(**kargs, &block)
|
20
|
+
end
|
21
|
+
|
22
|
+
def addCommands(**kargs, &block)
|
23
|
+
addCommandsMutation.query(**kargs, &block)
|
24
|
+
end
|
25
|
+
|
26
|
+
def delete(**kargs, &block)
|
27
|
+
deleteMutation.query(**kargs, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def publish(**kargs, &block)
|
31
|
+
publishMutation.query(**kargs, &block)
|
32
|
+
end
|
33
|
+
|
34
|
+
def DropBadCommands(**kargs, &block)
|
35
|
+
dropBadCommandsMutation.query(**kargs, &block)
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def createMutation
|
41
|
+
Mutation::LocationStructure::Draft::Create.new(client)
|
42
|
+
end
|
43
|
+
|
44
|
+
def addCommandsMutation
|
45
|
+
Mutation::LocationStructure::Draft::AddCommands.new(client)
|
46
|
+
end
|
47
|
+
|
48
|
+
def deleteMutation
|
49
|
+
Mutation::LocationStructure::Draft::Delete.new(client)
|
50
|
+
end
|
51
|
+
|
52
|
+
def publishMutation
|
53
|
+
Mutation::LocationStructure::Draft::Publish.new(client)
|
54
|
+
end
|
55
|
+
|
56
|
+
def dropBadCommandsMutation
|
57
|
+
Mutation::LocationStructure::Draft::DropBadCommands.new(client)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -10,25 +10,31 @@ module Ecoportal
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def nodeClassifications(**kargs, &block)
|
13
|
-
query_model =
|
13
|
+
query_model = Query::LocationClassifications.new(client)
|
14
14
|
query_model.query(**kargs, &block)
|
15
15
|
end
|
16
16
|
|
17
17
|
def applyCommandsInput
|
18
|
-
|
18
|
+
Input::LocationStructure::ApplyCommands.new
|
19
19
|
end
|
20
20
|
|
21
21
|
def applyCommands(**kargs, &block)
|
22
22
|
applyCommandsMutation.query(**kargs, &block)
|
23
23
|
end
|
24
24
|
|
25
|
+
def draft
|
26
|
+
LocationStructure::Draft.new(client, parent: self)
|
27
|
+
end
|
28
|
+
|
25
29
|
private
|
26
30
|
|
27
31
|
def applyCommandsMutation
|
28
|
-
|
32
|
+
Mutation::LocationStructure::ApplyCommands.new(client)
|
29
33
|
end
|
30
34
|
end
|
31
35
|
end
|
32
36
|
end
|
33
37
|
end
|
34
38
|
end
|
39
|
+
|
40
|
+
require_relative 'location_structure/draft'
|
@@ -2,8 +2,8 @@ module Ecoportal
|
|
2
2
|
module API
|
3
3
|
class GraphQL
|
4
4
|
module Connection
|
5
|
-
class Action <
|
6
|
-
class_resolver :node_class,
|
5
|
+
class Action < Logic::Connection
|
6
|
+
class_resolver :node_class, Model::Action
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -2,8 +2,8 @@ module Ecoportal
|
|
2
2
|
module API
|
3
3
|
class GraphQL
|
4
4
|
module Connection
|
5
|
-
class ActionCategory <
|
6
|
-
class_resolver :node_class,
|
5
|
+
class ActionCategory < Logic::Connection
|
6
|
+
class_resolver :node_class, Base::ActionCategory
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -2,8 +2,8 @@ module Ecoportal
|
|
2
2
|
module API
|
3
3
|
class GraphQL
|
4
4
|
module Connection
|
5
|
-
class ContractorEntity <
|
6
|
-
class_resolver :node_class,
|
5
|
+
class ContractorEntity < Logic::Connection
|
6
|
+
class_resolver :node_class, Model::ContractorEntity
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -2,8 +2,8 @@ module Ecoportal
|
|
2
2
|
module API
|
3
3
|
class GraphQL
|
4
4
|
module Connection
|
5
|
-
class PersonMemberConnection <
|
6
|
-
class_resolver :node_class,
|
5
|
+
class PersonMemberConnection < Logic::Connection
|
6
|
+
class_resolver :node_class, Model::PersonMember
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|