eco-helpers 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b298bca88b1ee202218bf3e0ab5727db52d8893a4ea969deda1179198b02ddf
4
- data.tar.gz: dd183eb58a6481851fde1fe257217541a175b4524f61ed1c61c9dff131d484b5
3
+ metadata.gz: 65d5ec6baab743f216afd4ca77a4d36f9a43a52e841f0c2ca9ef73f63e3423b1
4
+ data.tar.gz: 5906de7dd2f2765c6222ac707b42b6b270914b40c964e7ba579966652a418e72
5
5
  SHA512:
6
- metadata.gz: 4d73a73a2dba773d09b83d0713e71f333f44e83acb51c5e6fbde83fbff60350c468ae5a79d60eaf4a9fd446b7416e5bd38ed181769e221df893b20b1a84afc50
7
- data.tar.gz: 7a157045ebf97b9d0b10dadc5f1951a4eed311cd03335ac9f9b85288ef4fe3aa71bb7939e2266f124a9ee6687076bc5fc0afbaecff213ed2af45f11988b6543f
6
+ metadata.gz: e0494e227d268046a78fb6bf2df120506056bf96bf09464816ebc3a2fb2e6907e89729ed9c9ab848d93bfb9b53bdcf7f3c220c60847ffb403e54f663eca4c3c6
7
+ data.tar.gz: 26b09ee8c9eb63b9cd91772d55f1c52bdc941bff59e83da809d80272978eb8f62d687caf4417404a32d494e2853644b2e3532a151b81f001bc6b9b87f3263067
data/CHANGELOG.md CHANGED
@@ -1,13 +1,28 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [2.1.2] - 2022-09-xx
4
+ ## [2.1.3] - 2022-09-xx
5
5
 
6
6
  ### Added
7
7
  ### Changed
8
8
  ### Fixed
9
9
 
10
- ## [2.1.1] - 2022-09-xx
10
+ ## [2.1.2] - 2022-09-29
11
+
12
+ ### Added
13
+ - `Ecoportal::API::Session::Config#live_tree` to retrieve the tagtree of the back-end
14
+ - Requires `graphql` connection parameters
15
+ - `Ecoportal::API::Session#live_tree` see above
16
+
17
+ ### Changed
18
+ - `Ecoportal::API::Session::Config#tagtree` to use `#live_tree` if there isn't a `tagtree.json` file
19
+ - upgraded **dependency** to `ecoportal-api-graphql` **gem**
20
+ - upgraded **dependency** to `ecoportal-api-v2` **gem**
21
+
22
+ ### Fixed
23
+ - `Ecoportal::API::Session::Config::API#version_available?` **typo**
24
+
25
+ ## [2.1.1] - 2022-09-26
11
26
 
12
27
  ### Added
13
28
  - `Eco::API::Session::Config::Api#version_available?` to know if a version is available for use
data/eco-helpers.gemspec CHANGED
@@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency "redcarpet", ">= 3.5.1", "< 3.6"
32
32
 
33
33
  spec.add_dependency 'ecoportal-api', '>= 0.8.5', '< 0.9'
34
- spec.add_dependency 'ecoportal-api-v2', '>= 0.9.1', '< 0.10'
35
- spec.add_dependency 'ecoportal-api-graphql', '>= 0.1.9', '< 0.2'
34
+ spec.add_dependency 'ecoportal-api-v2', '>= 0.9.2', '< 0.10'
35
+ spec.add_dependency 'ecoportal-api-graphql', '>= 0.1.10', '< 0.2'
36
36
  spec.add_dependency 'aws-sdk-s3', '>= 1.83.0', '< 2'
37
37
  spec.add_dependency 'aws-sdk-ses', '>= 1.36.0', '< 2'
38
38
  spec.add_dependency 'dotenv', '>= 2.7.6', '< 2.8'
@@ -145,7 +145,7 @@ module Eco
145
145
 
146
146
  # @return [Boolean] whether or not `version` is available
147
147
  def version_available?(version)
148
- api_paramms?(version)
148
+ api_params?(version)
149
149
  end
150
150
 
151
151
  def version(value = nil)
@@ -228,6 +228,7 @@ module Eco
228
228
  org["tagtree"] = file
229
229
  end
230
230
 
231
+ # It uses the `tagtree.json` file and in its absence, if `graphql` enabled, the `life_tagtree`
231
232
  # @return [Eco::API::Organization::TagTree]
232
233
  def tagtree(enviro: nil)
233
234
  return @tagtree if instance_variable_defined?(:@tagtree) && @tagtree.enviro == enviro
@@ -235,6 +236,23 @@ module Eco
235
236
  tree = []
236
237
  tree = file_manager.load_json(tree_file) unless !tree_file
237
238
  @tagtree = Eco::API::Organization::TagTree.new(tree, enviro: enviro)
239
+ else
240
+ @tagtree = live_tree(enviro: enviro)
241
+ end
242
+ end
243
+
244
+ # It obtains the first of the live tagtree in the org
245
+ # @note it requires graphql connection configuration parameters
246
+ # @return [Eco::API::Organization::TagTree]
247
+ def live_tree(enviro: nil)
248
+ return @live_tree if instance_variable_defined?(:@live_tree) && @live_tree.enviro == enviro
249
+ if apis.active_api.version_available?(:graphql)
250
+ graphql = apis.api(version: :graphql)
251
+ if tree = graphql.currentOrganization.tagTrees.to_a.first.treeify
252
+ @live_tree = Eco::API::Organization::TagTree.new(tree, enviro: enviro)
253
+ else
254
+ @live_tree = nil
255
+ end
238
256
  end
239
257
  end
240
258
 
@@ -44,6 +44,11 @@ module Eco
44
44
  config.tagtree(enviro: enviro)
45
45
  end
46
46
 
47
+ # @see Eco::API::Session::Config#live_tree
48
+ def live_tree
49
+ config.live_tree
50
+ end
51
+
47
52
  # @see Eco::API::Session::Config#schemas
48
53
  def schemas
49
54
  config.schemas
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
@@ -136,7 +136,7 @@ dependencies:
136
136
  requirements:
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
- version: 0.9.1
139
+ version: 0.9.2
140
140
  - - "<"
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0.10'
@@ -146,7 +146,7 @@ dependencies:
146
146
  requirements:
147
147
  - - ">="
148
148
  - !ruby/object:Gem::Version
149
- version: 0.9.1
149
+ version: 0.9.2
150
150
  - - "<"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0.10'
@@ -156,7 +156,7 @@ dependencies:
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 0.1.9
159
+ version: 0.1.10
160
160
  - - "<"
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0.2'
@@ -166,7 +166,7 @@ dependencies:
166
166
  requirements:
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
- version: 0.1.9
169
+ version: 0.1.10
170
170
  - - "<"
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0.2'