eco-helpers 3.2.16 → 3.2.22

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +190 -0
  3. data/lib/eco/api/usecases/graphql/compat/parity/comparison.rb +70 -0
  4. data/lib/eco/api/usecases/graphql/compat/parity/harness.rb +102 -0
  5. data/lib/eco/api/usecases/graphql/compat/parity/run_result.rb +96 -0
  6. data/lib/eco/api/usecases/graphql/compat.rb +5 -0
  7. data/lib/eco/api/usecases/graphql/helpers/location/command/end_points/optimizations.rb +4 -4
  8. data/lib/eco/api/usecases/graphql/helpers/pages/copying.rb +71 -0
  9. data/lib/eco/api/usecases/graphql/helpers/pages/creatable.rb +78 -0
  10. data/lib/eco/api/usecases/graphql/helpers/pages/filters.rb +114 -0
  11. data/lib/eco/api/usecases/graphql/helpers/pages/ooze_handlers.rb +112 -0
  12. data/lib/eco/api/usecases/graphql/helpers/pages/rescuable.rb +52 -0
  13. data/lib/eco/api/usecases/graphql/helpers/pages/shortcuts.rb +186 -0
  14. data/lib/eco/api/usecases/graphql/helpers/pages/typed_fields_pairing.rb +303 -0
  15. data/lib/eco/api/usecases/graphql/helpers/pages.rb +21 -0
  16. data/lib/eco/api/usecases/graphql/helpers.rb +1 -0
  17. data/lib/eco/api/usecases/graphql/samples/location/command/service/tree_update.rb +1 -1
  18. data/lib/eco/api/usecases/graphql/samples/pages/register/base.rb +181 -0
  19. data/lib/eco/api/usecases/graphql/samples/pages/register/migration_case.rb +132 -0
  20. data/lib/eco/api/usecases/graphql/samples/pages/register/target_oozes_update_case.rb +163 -0
  21. data/lib/eco/api/usecases/graphql/samples/pages/register.rb +8 -0
  22. data/lib/eco/api/usecases/graphql/samples/pages/template/base.rb +70 -0
  23. data/lib/eco/api/usecases/graphql/samples/pages/template/command_emitter.rb +139 -0
  24. data/lib/eco/api/usecases/graphql/samples/pages/template/csv_build/builder.rb +126 -0
  25. data/lib/eco/api/usecases/graphql/samples/pages/template/csv_build/format_map.rb +108 -0
  26. data/lib/eco/api/usecases/graphql/samples/pages/template/csv_build/parser.rb +98 -0
  27. data/lib/eco/api/usecases/graphql/samples/pages/template/csv_build.rb +17 -0
  28. data/lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb +141 -0
  29. data/lib/eco/api/usecases/graphql/samples/pages/template/deploy/drift_report.rb +104 -0
  30. data/lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb +155 -0
  31. data/lib/eco/api/usecases/graphql/samples/pages/template/deploy/recording_executor.rb +58 -0
  32. data/lib/eco/api/usecases/graphql/samples/pages/template/deploy/sync_readiness.rb +178 -0
  33. data/lib/eco/api/usecases/graphql/samples/pages/template/deploy/verifier.rb +141 -0
  34. data/lib/eco/api/usecases/graphql/samples/pages/template/deploy.rb +21 -0
  35. data/lib/eco/api/usecases/graphql/samples/pages/template.rb +11 -0
  36. data/lib/eco/api/usecases/graphql/samples/pages.rb +2 -0
  37. data/lib/eco/api/usecases/ooze_samples/register_update_case.rb +6 -2
  38. data/lib/eco/version.rb +1 -1
  39. metadata +34 -25
  40. data/.ai-assistance/conventions/code-working-tree-protocol.md +0 -176
  41. data/.ai-assistance/scripts/token-logger.js +0 -220
  42. data/.ai-assistance/scripts/token-report.ts +0 -158
  43. data/.ai-assistance/scripts/token-session-start.js +0 -66
  44. data/.ai-assistance/skills/ep-ai-manager/SKILL.md +0 -417
  45. data/.ai-assistance/skills/ruby-scripting/SKILL.md +0 -215
  46. data/.ai-assistance/standards-version.json +0 -10
  47. data/.ai-assistance/token-budget.json +0 -39
  48. data/.claude/settings.json +0 -103
  49. data/.gitignore +0 -25
  50. data/.idea/.gitignore +0 -10
  51. data/.markdownlint.json +0 -4
  52. data/.rspec +0 -3
  53. data/.rubocop.yml +0 -103
  54. data/.ruby-version +0 -1
  55. data/.yardopts +0 -10
  56. data/CLAUDE.md +0 -83
  57. data/Gemfile +0 -8
  58. data/Rakefile +0 -38
  59. data/eco-helpers.gemspec +0 -63
@@ -1,103 +0,0 @@
1
- {
2
- "permissions": {
3
- "defaultMode": "auto",
4
- "allowedTools": [
5
- "Read"
6
- ],
7
- "permissionRules": [
8
- {
9
- "tool": "Write",
10
- "pattern": "/**",
11
- "action": "allow"
12
- },
13
- {
14
- "tool": "StrReplace",
15
- "pattern": "/**",
16
- "action": "allow"
17
- }
18
- ],
19
- "allow": [
20
- "WebFetch(domain:anthropic.com)",
21
- "WebFetch(domain:npmjs.com)",
22
- "Write(.glaudeignore)",
23
- "Update(.glaudeignore)",
24
- "Bash(rm .ai-assistance/bridge/LOCK)",
25
- "Read(.git/**)",
26
- "Read(**/rubygems/**)",
27
- "Write(*.md)",
28
- "Edit(.ai-assistance/**)",
29
- "Update(.ai-assistance/**)",
30
- "Write(.ai-assistance/**)",
31
- "Write(lib/**)",
32
- "Write(spec/**)",
33
- "Bash(git status)",
34
- "Bash(git diff *)",
35
- "Bash(git log *)",
36
- "Bash(git add *)",
37
- "Bash(git commit *)",
38
- "PowerShell(git status)",
39
- "PowerShell(git diff *)",
40
- "PowerShell(git log *)",
41
- "PowerShell(git add *)",
42
- "PowerShell(git commit *)",
43
- "Bash(npm test)",
44
- "Bash(npm run lint)",
45
- "Bash(npm run build)",
46
- "Bash(vitest *)",
47
- "Bash(jest *)",
48
- "PowerShell(npm test)",
49
- "PowerShell(npm run lint)",
50
- "PowerShell(npm run build)",
51
- "Bash(black .)",
52
- "Bash(pytest)",
53
- "Bash(python -m unittest)",
54
- "Bash(ruff check *)",
55
- "Bash(bundle exec rspec *)",
56
- "Bash(bundle exec rubocop *)",
57
- "PowerShell(pytest)",
58
- "PowerShell(python -m unittest)",
59
- "PowerShell(ruff check *)",
60
- "PowerShell(bundle exec rspec *)",
61
- "PowerShell(bundle exec rubocop *)",
62
- "Bash(node .ai-assistance/scripts/token-logger.js)",
63
- "Bash(node .ai-assistance/scripts/token-session-start.js)"
64
- ],
65
- "deny": [
66
- "Read(*.env)",
67
- "Read(./.env*)",
68
- "Read(./secrets/**)",
69
- "Bash(*cat *.env*)",
70
- "Bash(*grep *.env*)",
71
- "Bash(printenv*)",
72
- "Bash(env)",
73
- "Write(.git/*)",
74
- "Edit(.git/*)",
75
- "Bash(git push *)",
76
- "Bash(rm -rf *)"
77
- ]
78
- },
79
- "hooks": {
80
- "SessionStart": [
81
- {
82
- "matcher": "",
83
- "hooks": [
84
- {
85
- "type": "command",
86
- "command": "node .ai-assistance/scripts/token-session-start.js 2>/dev/null || true"
87
- }
88
- ]
89
- }
90
- ],
91
- "Stop": [
92
- {
93
- "matcher": "",
94
- "hooks": [
95
- {
96
- "type": "command",
97
- "command": "node .ai-assistance/scripts/token-logger.js 2>/dev/null || true"
98
- }
99
- ]
100
- }
101
- ]
102
- }
103
- }
data/.gitignore DELETED
@@ -1,25 +0,0 @@
1
- # it's a gem, ignore the lockfile
2
- Gemfile.lock
3
-
4
- # build artifacts
5
- *.gem
6
- /.bundle
7
- /.vscode
8
- .solargraph.yml
9
- /vendor/bundle
10
- /spec/reports/
11
- /tmp/
12
- /pkg/
13
-
14
- # docs
15
- /.yardoc
16
- /_yardoc/
17
- /coverage/
18
- /doc/
19
-
20
- # rspec failure tracking
21
- .rspec_status
22
- scratch.rb
23
- .byebug_history
24
-
25
- .ai-assistance/local/
data/.idea/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- # Default ignored files
2
- /shelf/
3
- /workspace.xml
4
- # Editor-based HTTP Client requests
5
- /httpRequests/
6
- # Datasource local storage ignored files
7
- /dataSources/
8
- /dataSources.local.xml
9
- # jetbrains IDE
10
- .idea
data/.markdownlint.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "MD013": false,
3
- "MD024": false
4
- }
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,103 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 3.2
3
- Exclude:
4
- - 'config/routes.rb'
5
- NewCops: enable
6
-
7
- Metrics/ClassLength:
8
- Max: 500
9
- Metrics/ModuleLength:
10
- Max: 300
11
- Metrics/MethodLength:
12
- Max: 50
13
- Metrics/AbcSize:
14
- Max: 30
15
- Metrics/ParameterLists:
16
- Max: 5
17
- CountKeywordArgs: false
18
- Metrics/BlockLength:
19
- CountAsOne: ['array', 'heredoc', 'method_call']
20
- Max: 50
21
- Metrics/CyclomaticComplexity:
22
- Max: 30
23
- Metrics/PerceivedComplexity:
24
- Max: 30
25
-
26
- Style/AccessorGrouping:
27
- Enabled: false
28
- Style/ConditionalAssignment:
29
- Enabled: false
30
- Style/BlockDelimiters:
31
- BracesRequiredMethods: ['log']
32
- AllowedPatterns: ['proc', 'new']
33
- Style/HashSyntax:
34
- EnforcedShorthandSyntax: either
35
- EnforcedStyle: no_mixed_keys
36
-
37
- Style/ArgumentsForwarding:
38
- UseAnonymousForwarding: false
39
- Style/ClassAndModuleChildren:
40
- Enabled: false
41
- Style/FrozenStringLiteralComment:
42
- Enabled: false
43
- Style/StringLiterals:
44
- Enabled: false
45
- Style/StringLiteralsInInterpolation:
46
- Enabled: false
47
- Style/Documentation:
48
- Enabled: false
49
- Style/CommentedKeyword:
50
- Enabled: false
51
- Style/MultilineBlockChain:
52
- Enabled: false
53
- Style/AndOr:
54
- Enabled: false
55
- Style/Alias:
56
- EnforcedStyle: prefer_alias_method
57
- Style/FetchEnvVar:
58
- Enabled: false
59
- Style/RegexpLiteral:
60
- EnforcedStyle: mixed
61
- AllowInnerSlashes: true
62
-
63
- Layout/HashAlignment:
64
- EnforcedColonStyle: table
65
- EnforcedHashRocketStyle: table
66
- Layout/LeadingCommentSpace:
67
- Enabled: false
68
- AllowGemfileRubyComment: true
69
- Layout/ParameterAlignment:
70
- Enabled: false
71
- Layout/MultilineMethodDefinitionBraceLayout:
72
- EnforcedStyle: symmetrical
73
- Layout/LineLength:
74
- Enabled: true
75
- Layout/SpaceInsideHashLiteralBraces:
76
- Enabled: false
77
- Layout/SpaceInsideBlockBraces:
78
- Enabled: false
79
- Layout/SpaceAroundOperators:
80
- Enabled: false
81
- Layout/ExtraSpacing:
82
- AllowForAlignment: true
83
- AllowBeforeTrailingComments: true
84
- Layout/AccessModifierIndentation:
85
- EnforcedStyle: indent
86
- Layout/DotPosition:
87
- EnforcedStyle: trailing
88
- Layout/MultilineMethodCallIndentation:
89
- EnforcedStyle: indented
90
- Layout/FirstHashElementIndentation:
91
- Enabled: false
92
- Layout/EmptyLineAfterGuardClause:
93
- Enabled: false
94
-
95
- Naming/VariableNumber:
96
- EnforcedStyle: snake_case
97
- CheckSymbols: false
98
- Naming/MethodParameterName:
99
- AllowedNames: ['x', 'y', 'i', 'j', 'id', 'io', 'to']
100
- Naming/RescuedExceptionsVariableName:
101
- Enabled: false
102
- Naming/BlockForwarding:
103
- Enabled: false
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.2.2
data/.yardopts DELETED
@@ -1,10 +0,0 @@
1
- --readme README.md
2
- --charset utf-8
3
- --markup-provider=redcarpet
4
- --markup=markdown
5
- --no-private
6
- --output-dir ./doc
7
- 'lib/**/*.rb'
8
- CHANGELOG.md
9
- -
10
- LICENSE
data/CLAUDE.md DELETED
@@ -1,83 +0,0 @@
1
- # CLAUDE.md — eco-helpers
2
-
3
- AI agent instructions for this repository.
4
-
5
- **Cross-cutting architecture context lives in `ecoportal-api-graphql` — see its `CLAUDE.md` and `.claude/` folder for the full dependency map, project history, and shared skills.**
6
-
7
- ---
8
-
9
- ## Repository Role
10
-
11
- `eco-helpers` is the **primary downstream consumer** of the EcoPortal API gem stack. It provides a scripting and automation framework for interacting with EcoPortal — CLI tooling, use-case orchestration, data transformation, and batch operations.
12
-
13
- **Position in chain:**
14
- ```
15
- ecoportal-api
16
- ecoportal-api-v2
17
- ecoportal-api-graphql
18
- ↓
19
- eco-helpers ← THIS REPO
20
- ```
21
-
22
- **Remote:** https://gitlab.ecoportal.co.nz/oscar/script_api_helpers.git
23
-
24
- **Gem dependencies on the stack:**
25
- - `ecoportal-api ~> 0.10, >= 0.10.14`
26
- - `ecoportal-api-v2 ~> 3.3, >= 3.3.1`
27
- - `ecoportal-api-graphql ~> 1.3, >= 1.3.4`
28
-
29
- ---
30
-
31
- ## Key Folder Layout
32
-
33
- ```
34
- lib/eco/
35
- api/ API integration layer
36
- common/ Shared helpers
37
- microcases/ Fine-grained reusable operations
38
- organization/ Org-level resources
39
- session.rb Session management (entry point for scripting)
40
- usecases.rb Use-case registry
41
- policies.rb Access policies
42
- cli/ CLI framework
43
- cli_default/ Default CLI options, filters, people workflows
44
- common/ Cross-cutting utilities
45
- csv/ CSV reading, streaming, splitting
46
- data/ Data utilities (fuzzy match, hashes, locations, strings, files)
47
- language/ Logging, curry, auxiliar utilities
48
- assets/ Static assets (language files etc.)
49
- ```
50
-
51
- ---
52
-
53
- ## Namespace
54
-
55
- `Eco::` — entirely separate namespace from `Ecoportal::`. Does not reopen upstream gem namespaces.
56
-
57
- ---
58
-
59
- ## Key Concerns
60
-
61
- - This gem is the **backwards-compatibility target** for all upstream gems. When `ecoportal-api-graphql` changes its public interface, check usage here first.
62
- - `Eco::API::Session` is the main consumer of `Ecoportal::API::GraphQL` — it's the first place to look when checking how GraphQL features are used downstream.
63
- - The CLI layer (`Eco::CLI`) uses Thor-style commands — changes to API interfaces may silently break CLI workflows if not tested end-to-end.
64
- - Many operations are batch-oriented with progress logging — error handling and partial-failure behaviour matters.
65
-
66
- ---
67
-
68
- ## How to Find GraphQL Usage
69
-
70
- ```bash
71
- grep -r "GraphQL\|graphql\|ecoportal-api-graphql" lib/ --include="*.rb" -l
72
- ```
73
-
74
- This shows which files directly use the GraphQL gem — useful when assessing impact of upstream changes.
75
-
76
- ---
77
-
78
- ## Running Tests
79
-
80
- ```bash
81
- bundle install
82
- bundle exec rspec
83
- ```
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in eco-helpers.gemspec
6
- gemspec
7
-
8
- # gem 'rubocop-rake', require: false
data/Rakefile DELETED
@@ -1,38 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
- require 'rubocop/rake_task'
4
- require 'yard'
5
- require 'redcarpet'
6
-
7
- desc "run the specs"
8
- RSpec::Core::RakeTask.new(:spec)
9
-
10
- desc "run rspec showing backtrace"
11
- RSpec::Core::RakeTask.new(:spec_trace) do |task|
12
- task.rspec_opts = ['--backtrace']
13
- end
14
- task(rspec_trace: :spec_trace)
15
-
16
- desc "run rspec stopping on first fail, and show backtrace"
17
- RSpec::Core::RakeTask.new(:spec_fast) do |task|
18
- task.rspec_opts = ['--fail-fast', '--backtrace']
19
- end
20
- task(rspec_fast: :spec_fast)
21
-
22
- desc "run rubocop diaplying cop names"
23
- RuboCop::RakeTask.new(:rubocop) do |t|
24
- t.options = ['--display-cop-names']
25
- end
26
-
27
- # default task name is yard
28
- desc "Yard: generate all the documentation"
29
- YARD::Rake::YardocTask.new(:doc) do |t|
30
- #t.files = ['lib/**/*.rb']
31
- end
32
-
33
- desc "default task: runs rubocop and rspec"
34
- task :default do
35
- Rake::Task[:rubocop].invoke
36
- ensure
37
- Rake::Task[:spec].invoke
38
- end
data/eco-helpers.gemspec DELETED
@@ -1,63 +0,0 @@
1
- # rubocop:disable Gemspec/DevelopmentDependencies
2
- lib = File.expand_path('lib', __dir__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
-
5
- require './lib/eco/version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = 'eco-helpers'
9
- spec.version = Eco::VERSION
10
- spec.platform = Gem::Platform::RUBY
11
- spec.authors = ['Oscar Segura']
12
- spec.email = ['oscar@ecoportal.co.nz']
13
-
14
- spec.summary = "eco-helpers to manage people api cases"
15
- spec.homepage = "https://www.ecoportal.com"
16
- spec.licenses = %w[MIT]
17
-
18
- spec.metadata['rubygems_mfa_required'] = 'true'
19
-
20
- spec.required_ruby_version = '>= 3.2.2'
21
-
22
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
23
- f.match(/^(test|spec|features)\//)
24
- end
25
-
26
- #spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
27
- #spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
28
- spec.require_paths = ['lib']
29
-
30
- spec.add_development_dependency 'byebug'
31
- spec.add_development_dependency 'rake', '>= 13.0.3', '< 14'
32
- spec.add_development_dependency 'redcarpet', '>= 3.6.0', '< 4'
33
- spec.add_development_dependency 'rspec', '>= 3.12.0', '< 4'
34
- spec.add_development_dependency 'rubocop', '~> 1'
35
- spec.add_development_dependency 'rubocop-rake', '~> 0'
36
- spec.add_development_dependency 'yard', '~> 0.9'
37
-
38
- spec.add_dependency 'amatch', '>= 0.4.1', '< 0.5'
39
- spec.add_dependency 'aws-sdk-s3', '>= 1.142.0', '< 2'
40
- spec.add_dependency 'aws-sdk-ses', '>= 1.58.0', '< 2'
41
- spec.add_dependency 'bcrypt_pbkdf', '~> 1.0'
42
- spec.add_dependency 'docx', '>= 0.8.0', '< 0.9'
43
- spec.add_dependency 'dotenv', '~> 3'
44
- spec.add_dependency 'ecoportal-api', '~> 0.10', '>= 0.10.14'
45
- spec.add_dependency 'ecoportal-api-graphql', '~> 1.3', '>= 1.3.9'
46
- spec.add_dependency 'ecoportal-api-v2', '~> 3.3', '>= 3.3.1'
47
- spec.add_dependency 'ed25519', '~> 1.2'
48
- spec.add_dependency 'fast_excel', '>= 0.5.0', '< 0.6'
49
- spec.add_dependency 'fuzzy_match', '>= 2.1.0', '< 2.2'
50
- spec.add_dependency 'hashdiff', '>= 1.1.0', '< 1.2'
51
- spec.add_dependency 'jaro_winkler', '>= 1.5.6', '< 1.6'
52
- spec.add_dependency 'net-http', '~> 0.6.0'
53
- spec.add_dependency 'net-sftp', '>= 4.0.0', '< 5'
54
- spec.add_dependency 'net-ssh', '>= 7.2.1', '< 8'
55
- spec.add_dependency 'nokogiri', '>= 1.13', '< 1.17'
56
- spec.add_dependency 'roo', '>= 2.10.1', '< 2.11'
57
- spec.add_dependency 'roo-xls', '>= 1.2.0', '< 1.3'
58
- spec.add_dependency 'rubyzip', '>= 2.3.2', '< 2.4'
59
- spec.add_dependency 'sendgrid-ruby', '~> 6.7.0'
60
- # spec.add_dependency 'uri', '~> 1.0', '>= 1.0.3'
61
- end
62
-
63
- # rubocop:enable Gemspec/DevelopmentDependencies