ecoportal-api-graphql 0.3.14 → 0.3.15
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/CHANGELOG.md +11 -1
- data/ecoportal-api-graphql.gemspec +1 -1
- data/lib/ecoportal/api/graphql/base/location_classification_type.rb +2 -0
- data/lib/ecoportal/api/graphql/base/location_node.rb +1 -1
- data/lib/ecoportal/api/graphql/builder/location_structure.rb +5 -0
- data/lib/ecoportal/api/graphql/input/location_structure/apply_commands.rb +1 -1
- data/lib/ecoportal/api/graphql/input/location_structure/command_interface.rb +1 -1
- data/lib/ecoportal/api/graphql/logic/base_query.rb +9 -1
- data/lib/ecoportal/api/graphql/model/organization.rb +1 -1
- data/lib/ecoportal/api/graphql/query/location_classifications.rb +39 -0
- data/lib/ecoportal/api/graphql/query.rb +1 -0
- data/lib/ecoportal/api/graphql_version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c155d6c7fa282ad8cf9ccae9682cec2ce1560b1716802cf6dabfbdd20d84587
|
4
|
+
data.tar.gz: 39d410c6e6082e3cb36e86739bcd3c04e45c3d8e56b0905a97ecb6839160cde7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c48ec8bbe4f40597e59fa6463a9244e350e6bbe4a7558dcb8cad79e35c8fab0bcde02c0e09a8a4e66ac7bc7f504a0bad0ac1a260edda8775565014cfa080cf6
|
7
|
+
data.tar.gz: 40f80dd98b63c3a8c83073d30037bf080e3fa282096c9f435b84dabe663ad578d0dd92acafeaed4856531dc64abbd75fc9b4cb434b7adad9536bd5f5ef632024
|
data/CHANGELOG.md
CHANGED
@@ -8,8 +8,18 @@ All notable changes to this project will be documented in this file.
|
|
8
8
|
- Analyse how to "DSL" currentOrganization.action.activities
|
9
9
|
- review `path` tracking
|
10
10
|
|
11
|
+
## [0.3.15] - 2024-04-xx
|
11
12
|
|
12
|
-
|
13
|
+
### Added
|
14
|
+
- `Ecoportal::API::GraphQL::Logic::BaseQuery`
|
15
|
+
- `::base_path` class instance var.
|
16
|
+
- query to retrieve `currentOrganization.classifications`
|
17
|
+
|
18
|
+
### Changed
|
19
|
+
### Fixed
|
20
|
+
- upgraded `ecoportal-api-v2` gem
|
21
|
+
|
22
|
+
## [0.3.14] - 2024-03-13
|
13
23
|
|
14
24
|
### Added
|
15
25
|
- some benchmarking on
|
@@ -29,6 +29,6 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency "redcarpet", ">= 3.6.0", "< 4"
|
30
30
|
spec.add_development_dependency "pry" , ">= 0.14"
|
31
31
|
|
32
|
-
spec.add_dependency 'ecoportal-api-v2', '>= 1.1.
|
32
|
+
spec.add_dependency 'ecoportal-api-v2', '>= 1.1.8', '< 1.2'
|
33
33
|
spec.add_dependency 'graphlient', '>= 0.8.0', '< 0.9'
|
34
34
|
end
|
@@ -9,7 +9,7 @@ module Ecoportal
|
|
9
9
|
embeds_one :parent, klass: Base::LocationNode, nullable: true
|
10
10
|
passboolean :archived
|
11
11
|
passthrough :archivedToken
|
12
|
-
embeds_many :classifications, klass: Base::LocationClassificationType
|
12
|
+
embeds_many :classifications, klass: Base::LocationClassificationType
|
13
13
|
|
14
14
|
def parentId
|
15
15
|
parent&.id
|
@@ -9,6 +9,11 @@ module Ecoportal
|
|
9
9
|
@client = client
|
10
10
|
end
|
11
11
|
|
12
|
+
def nodeClassifications(**kargs, &block)
|
13
|
+
query_model = Ecoportal::API::GraphQL::Query::LocationClassifications.new(client)
|
14
|
+
query_model.query(**kargs, &block)
|
15
|
+
end
|
16
|
+
|
12
17
|
def applyCommandsInput
|
13
18
|
Ecoportal::API::GraphQL::Input::LocationStructure::ApplyCommands.new
|
14
19
|
end
|
@@ -39,6 +39,14 @@ module Ecoportal
|
|
39
39
|
@field_name = nil
|
40
40
|
@field_name = str.to_s if str
|
41
41
|
end
|
42
|
+
|
43
|
+
def base_path(path = :unused)
|
44
|
+
return @base_path if path == :unused
|
45
|
+
path ||= []
|
46
|
+
path = path.to_s.split('.') if path.is_a?(String)
|
47
|
+
path = path.map(&:to_s).compact
|
48
|
+
@base_path = path
|
49
|
+
end
|
42
50
|
end
|
43
51
|
|
44
52
|
include Ecoportal::API::Common::Concerns::Benchmarkable
|
@@ -46,7 +54,7 @@ module Ecoportal
|
|
46
54
|
attr_reader :client
|
47
55
|
attr_reader :base_path
|
48
56
|
|
49
|
-
def initialize(client, path: nil, base_path:
|
57
|
+
def initialize(client, path: nil, base_path: self.class.base_path)
|
50
58
|
@path = path
|
51
59
|
@base_path = base_path
|
52
60
|
@client = client
|
@@ -3,7 +3,7 @@ module Ecoportal
|
|
3
3
|
class GraphQL
|
4
4
|
module Model
|
5
5
|
class Organization < Ecoportal::API::GraphQL::Base::Organization
|
6
|
-
DEFAULT_PATH = ["currentOrganization"]
|
6
|
+
DEFAULT_PATH = ["currentOrganization"].freeze
|
7
7
|
|
8
8
|
class << self
|
9
9
|
extend Ecoportal::API::Common::GraphQL::QueryIntegration
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Ecoportal
|
2
|
+
module API
|
3
|
+
class GraphQL
|
4
|
+
module Query
|
5
|
+
class LocationClassifications < Ecoportal::API::GraphQL::Logic::QueryArray
|
6
|
+
accepted_params :active, default: true
|
7
|
+
|
8
|
+
base_path 'currentOrganization.locations'
|
9
|
+
field_name :classifications
|
10
|
+
|
11
|
+
class_resolver :item_class, Ecoportal::API::GraphQL::Base::LocationClassificationType
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def basic_block(&block)
|
16
|
+
final_block = block || default_query_block
|
17
|
+
proc {
|
18
|
+
query(active: :boolean) {
|
19
|
+
currentOrganization {
|
20
|
+
locations {
|
21
|
+
classifications(active: :active, &final_block)
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
def default_query_block
|
29
|
+
proc {
|
30
|
+
id
|
31
|
+
name
|
32
|
+
active
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecoportal-api-graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ">="
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 1.1.
|
133
|
+
version: 1.1.8
|
134
134
|
- - "<"
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '1.2'
|
@@ -140,7 +140,7 @@ dependencies:
|
|
140
140
|
requirements:
|
141
141
|
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version: 1.1.
|
143
|
+
version: 1.1.8
|
144
144
|
- - "<"
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '1.2'
|
@@ -301,6 +301,7 @@ files:
|
|
301
301
|
- lib/ecoportal/api/graphql/query/action.rb
|
302
302
|
- lib/ecoportal/api/graphql/query/actions.rb
|
303
303
|
- lib/ecoportal/api/graphql/query/contractor_entities.rb
|
304
|
+
- lib/ecoportal/api/graphql/query/location_classifications.rb
|
304
305
|
- lib/ecoportal/api/graphql/query/location_structure.rb
|
305
306
|
- lib/ecoportal/api/graphql/query/location_structures.rb
|
306
307
|
- lib/ecoportal/api/graphql_version.rb
|