eco-helpers 2.7.9 → 2.7.10

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: 41e63439f7a3d89c5e3c9e10be328b9487ecffe4dde6a83a6fd6f9a561d924a8
4
- data.tar.gz: bafc6c443ce57b2611c177b00eca9aca0fd06718712511eb2b93762ff957179b
3
+ metadata.gz: 1e9c00a0ecc4c1fb42d808e2df03a8618c7017be7a27e6319859bd7974b3638a
4
+ data.tar.gz: f9e2452935fcfc3712e53b5e5731151f1ddf6a4f946f2e1c6f8c629f48e09e9e
5
5
  SHA512:
6
- metadata.gz: '0094ce51df0b47838a44b679fe82a4acacfc64953edeea38ef2c51b6efeb08f0629f019751b319542dddcac5e77838786cdd1b7333b16babb0bf02ad4e197fb3'
7
- data.tar.gz: ee5243547b98cdeabba4cf1fdbbd8759b0f24d1e5ea4f4e42b998569ebe0c00bf3d5139ef2c28886bfa96efe6cd7e65344245b4eb6d7c9bb0a08964d075ddd12
6
+ metadata.gz: 4e4595657f37f057269bbd38671858700bdcc22e2755e3b365bbe69e48e017e11974a8583b5e93c09c1abf90cd4f09c0ed8ac4a853be8d471c51719fa1500e71
7
+ data.tar.gz: 0e3af7794e45e62fdbb2ba06340cc7b23ea88466670eb8b597c4e279556bb5cc59dfa5f8ff0f294f77d15dfd159819590cd2228d05fa19af8a2421d4b665fa72
data/CHANGELOG.md CHANGED
@@ -1,12 +1,25 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [2.7.10] - 2024-05-xx
4
+ ## [2.7.12] - 2024-05-xx
5
5
 
6
6
  ### Added
7
7
  ### Changed
8
8
  ### Fixed
9
9
 
10
+ ## [2.7.11] - 2024-05-20
11
+
12
+ ### Changed
13
+ - Upgrade SFTP access
14
+
15
+ ## [2.7.10] - 2024-05-16
16
+
17
+ ### Changed
18
+ - Temporarily silent warnings on tracking id changes (apparently the tracking locations tree is not up to date with latest version and gives false warnings)
19
+
20
+ ### Fixed
21
+ - Remove enviro from tagtree download
22
+
10
23
  ## [2.7.9] - 2024-05-16
11
24
 
12
25
  ### Fixed
data/eco-helpers.gemspec CHANGED
@@ -33,6 +33,8 @@ Gem::Specification.new do |spec|
33
33
  spec.add_dependency 'ecoportal-api', '>= 0.9.8', '< 0.10'
34
34
  spec.add_dependency 'ecoportal-api-v2', '>= 1.1.8', '< 1.2'
35
35
  spec.add_dependency 'ecoportal-api-graphql', '>= 0.3.18', '< 0.4'
36
+ spec.add_dependency 'ed25519', '>= 1.2'
37
+ spec.add_dependency 'bcrypt_pbkdf', '>= 1.0'
36
38
  spec.add_dependency 'aws-sdk-s3', '>= 1.142.0', '< 2'
37
39
  spec.add_dependency 'aws-sdk-ses', '>= 1.58.0', '< 2'
38
40
  spec.add_dependency 'dotenv', '>= 2.8.1', '< 3'
@@ -40,11 +40,13 @@ module Eco
40
40
  # @param tagtree [String] representation of the tagtree in json.
41
41
  def initialize(
42
42
  tagtree = [],
43
- name: nil, id: nil,
44
- depth: -1, path: [],
45
- parent: nil, _weight: nil # rubocop:disable Lint/UnderscorePrefixedVariableName
43
+ name: nil,
44
+ id: nil,
45
+ depth: -1,
46
+ path: [],
47
+ parent: nil,
48
+ _weight: nil # rubocop:disable Lint/UnderscorePrefixedVariableName
46
49
  )
47
-
48
50
  @source = parse_source_input(tagtree)
49
51
 
50
52
  msg = "You are trying to initialize a TagTree with a null tagtree"
@@ -21,12 +21,16 @@ module Eco
21
21
  # 1. If there's a file tagtree.json file, it uses it
22
22
  # 2. If no file, retrieves `structure_id` (config)
23
23
  # @param include_archived [Boolean] whether or not it should include archived nodes.
24
+ # @param [recache] used for re-caching
24
25
  # @return [Eco::API::Organization::TagTree]
25
- def scope_tree(enviro: nil, include_archived: true, raise_on_missing: true) # rubocop:disable Lint/UnusedMethodArgument
26
- return @tagtree if instance_variable_defined?(:@tagtree) && @tagtree.enviro == enviro
26
+ def scope_tree(
27
+ include_archived: true,
28
+ recache: false,
29
+ raise_on_missing: true # rubocop:disable Lint/UnusedMethodArgument
30
+ )
31
+ return @tagtree if instance_variable_defined?(:@tagtree) && !recache
27
32
 
28
33
  kargs = {
29
- enviro: enviro,
30
34
  includeArchivedNodes: include_archived
31
35
  }
32
36
 
@@ -48,16 +52,16 @@ module Eco
48
52
 
49
53
  # Among all the locations structures it selects the one with more location nodes
50
54
  # If `id` is provided, it only retrieves this locations structure.
51
- # @param [enviro] used for re-caching
52
- def live_tree(id: nil, enviro: nil, include_archived: false, **kargs, &block) # rubocop:disable Metrics/AbcSize
55
+ # @param [recache] used for re-caching
56
+ def live_tree( # rubocop:disable Metrics/AbcSize
57
+ id: nil,
58
+ include_archived: false,
59
+ **kargs,
60
+ &block
61
+ )
53
62
  existing_cache = !@live_tree.nil?
54
63
  first_load = !existing_cache
55
-
56
- target_change = existing_cache && id && @live_tree.id != id
57
- enviro_change = existing_cache && enviro && @live_tree.enviro != enviro
58
-
59
- switching_target = existing_cache && (target_change || enviro_change)
60
- _refresh_cache = existing_cache && !switching_target
64
+ switching_target = existing_cache && id && @live_tree.id != id
61
65
 
62
66
  kargs = {
63
67
  includeArchivedNodes: include_archived
@@ -248,10 +248,17 @@ module Eco
248
248
  # @note it does NOT include archived nodes by default.
249
249
  # - This is for legacy (most usecases don't)
250
250
  # @param include_archived [Boolean] whether or not it should include archived nodes.
251
+ # @param [recache] used for re-caching
251
252
  # @return [Eco::API::Organization::TagTree]
252
- def tagtree(enviro: nil, include_archived: false, raise_on_missing: true)
253
+ def tagtree(
254
+ include_archived: false,
255
+ recache: false,
256
+ raise_on_missing: true
257
+ )
253
258
  kargs = {
254
- enviro: enviro, include_archived: include_archived, raise_on_missing: raise_on_missing
259
+ recache: recache,
260
+ include_archived: include_archived,
261
+ raise_on_missing: raise_on_missing
255
262
  }
256
263
  @tagtree ||= tagtree_config.scope_tree(**kargs)
257
264
  end
@@ -259,8 +266,8 @@ module Eco
259
266
  # It obtains the first of the live tagtree in the org
260
267
  # @note it requires graphql connection configuration parameters
261
268
  # @return [Eco::API::Organization::TagTree]
262
- def live_tree(id: nil, enviro: nil, **kargs, &block)
263
- tagtree_config.live_tree(id: id, enviro: enviro, **kargs, &block)
269
+ def live_tree(id: nil, **kargs, &block)
270
+ tagtree_config.live_tree(id: id, **kargs, &block)
264
271
  end
265
272
 
266
273
  # Retrieves all the location structures of the organisation
@@ -58,19 +58,26 @@ module Eco
58
58
  # @see Eco::API::Session::Config#tagtree
59
59
  # @see Eco::API::Session#live_trees
60
60
  # @return [Eco::API::Organization::TagTree]
61
- def tagtree(live: false, merge: false, include_archived: false, **kargs, &block)
61
+ def tagtree(
62
+ live: false,
63
+ merge: false,
64
+ include_archived: false,
65
+ recache: false,
66
+ **kargs,
67
+ &block
68
+ )
62
69
  if live && api?(version: :graphql)
63
70
  return live_tree(include_archived: include_archived, **kargs, &block) unless merge
64
71
  live_trees(include_archived: include_archived, **kargs, &block).inject(&:merge)
65
72
  else
66
- config.tagtree(enviro: enviro)
73
+ config.tagtree(recache: recache)
67
74
  end
68
75
  end
69
76
 
70
77
  # @see Eco::API::Session::Config#live_tree
71
78
  # @return [Eco::API::Organization::TagTree]
72
79
  def live_tree(id: nil, include_archived: false, **kargs, &block)
73
- config.live_tree(id: id, include_archived: include_archived, enviro: enviro, **kargs, &block)
80
+ config.live_tree(id: id, include_archived: include_archived, **kargs, &block)
74
81
  end
75
82
 
76
83
  # @see Eco::API::Session::Config#live_tree
@@ -57,12 +57,12 @@ class Eco::API::UseCases::GraphQL::Samples::Location
57
57
 
58
58
  tags_remap_table << [[prev_id], [new_id]]
59
59
 
60
- next unless ref_tree.is_a?(Eco::API::Organization::TagTree)
61
- next unless ref_tree.tag?(new_id)
60
+ # next unless ref_tree.is_a?(Eco::API::Organization::TagTree)
61
+ # next unless ref_tree.tag?(new_id)
62
62
 
63
- msg = "Node '#{prev_id}' was updated to '#{new_id}', "
64
- msg << "but in current structure '#{new_id}' is not present"
65
- log(:warn) { msg }
63
+ # msg = "Node '#{prev_id}' was updated to '#{new_id}', "
64
+ # msg << "but in current structure '#{new_id}' is not present"
65
+ # log(:warn) { msg }
66
66
  end
67
67
  end
68
68
 
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = '2.7.9'.freeze
2
+ VERSION = '2.7.10'.freeze
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.7.9
4
+ version: 2.7.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
@@ -170,6 +170,34 @@ dependencies:
170
170
  - - "<"
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0.4'
173
+ - !ruby/object:Gem::Dependency
174
+ name: ed25519
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '1.2'
180
+ type: :runtime
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '1.2'
187
+ - !ruby/object:Gem::Dependency
188
+ name: bcrypt_pbkdf
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '1.0'
194
+ type: :runtime
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: '1.0'
173
201
  - !ruby/object:Gem::Dependency
174
202
  name: aws-sdk-s3
175
203
  requirement: !ruby/object:Gem::Requirement