ecoportal-api-graphql 1.3.13 → 1.3.16
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 +87 -0
- data/lib/ecoportal/api/common/graphql/client.rb +0 -2
- data/lib/ecoportal/api/common/graphql/http_client.rb +6 -0
- data/lib/ecoportal/api/graphql/base/ai_summary_version.rb +17 -17
- data/lib/ecoportal/api/graphql/base/file_container.rb +14 -14
- data/lib/ecoportal/api/graphql/base/location_classification_type.rb +15 -15
- data/lib/ecoportal/api/graphql/base/location_structure.rb +27 -27
- data/lib/ecoportal/api/graphql/base/organization.rb +15 -15
- data/lib/ecoportal/api/graphql/base/page/task.rb +24 -0
- data/lib/ecoportal/api/graphql/base/page.rb +17 -16
- data/lib/ecoportal/api/graphql/base/template.rb +35 -0
- data/lib/ecoportal/api/graphql/base.rb +37 -35
- data/lib/ecoportal/api/graphql/builder/contractor_entity.rb +41 -41
- data/lib/ecoportal/api/graphql/compat/response.rb +35 -35
- data/lib/ecoportal/api/graphql/connection/action.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/action_category.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/contractor_entity.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/page.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/person_member.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/preview_page.rb +11 -11
- data/lib/ecoportal/api/graphql/connection.rb +17 -17
- data/lib/ecoportal/api/graphql/file_upload/client.rb +21 -10
- data/lib/ecoportal/api/graphql/fragment/field_configuration.rb +38 -0
- data/lib/ecoportal/api/graphql/fragment/force.rb +14 -10
- data/lib/ecoportal/api/graphql/fragment/location_node.rb +26 -26
- data/lib/ecoportal/api/graphql/fragment/page_task.rb +39 -0
- data/lib/ecoportal/api/graphql/fragment/template.rb +51 -0
- data/lib/ecoportal/api/graphql/fragment.rb +3 -0
- data/lib/ecoportal/api/graphql/input/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/input/preset_view/update.rb +16 -16
- data/lib/ecoportal/api/graphql/input/workflow_command/add_stage.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_field_configuration.rb +21 -21
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_page.rb +28 -28
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_page_creator_permissions.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/cross_reference.rb +23 -23
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/date.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/image_gallery.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/people.rb +24 -24
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/plain_text.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/rich_text.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/select.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/move_field.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/reorder_forces.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/reorder_section.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command.rb +251 -251
- data/lib/ecoportal/api/graphql/input.rb +24 -24
- data/lib/ecoportal/api/graphql/logic/connection.rb +34 -34
- data/lib/ecoportal/api/graphql/model/page/task.rb +16 -0
- data/lib/ecoportal/api/graphql/model/page.rb +16 -15
- data/lib/ecoportal/api/graphql/model/person_member.rb +15 -15
- data/lib/ecoportal/api/graphql/model/template.rb +15 -0
- data/lib/ecoportal/api/graphql/model.rb +32 -30
- data/lib/ecoportal/api/graphql/mutation/ai_summary/generate.rb +45 -45
- data/lib/ecoportal/api/graphql/mutation/ai_summary/submit_feedback.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/mutation/page/approve_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/page/batch_update_review_task.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/create_draft.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/delete_draft.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/execute_force_commands.rb +7 -7
- data/lib/ecoportal/api/graphql/mutation/page/execute_workflow_commands.rb +8 -7
- data/lib/ecoportal/api/graphql/mutation/page/publish_draft.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/reject_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/page/restart_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/page/undo_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/preset_view/destroy.rb +34 -35
- data/lib/ecoportal/api/graphql/mutation/register/destroy.rb +35 -35
- data/lib/ecoportal/api/graphql/mutation/smart_fill/generate.rb +36 -36
- data/lib/ecoportal/api/graphql/mutation/smart_fill/submit_feedback.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/smart_fill.rb +13 -13
- data/lib/ecoportal/api/graphql/mutation/template/create_related_page.rb +46 -46
- data/lib/ecoportal/api/graphql/mutation/template/destroy_related_page.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation/template/update_information.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation.rb +20 -20
- data/lib/ecoportal/api/graphql/payload/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/payload/ok_payload.rb +36 -21
- data/lib/ecoportal/api/graphql/payload/page/draft.rb +26 -13
- data/lib/ecoportal/api/graphql/payload/page/review_task.rb +13 -13
- data/lib/ecoportal/api/graphql/payload/page/review_task_batch.rb +23 -0
- data/lib/ecoportal/api/graphql/payload/page.rb +20 -19
- data/lib/ecoportal/api/graphql/payload/preset_view.rb +15 -11
- data/lib/ecoportal/api/graphql/payload/register.rb +15 -11
- data/lib/ecoportal/api/graphql/payload/template/create_related_page.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/template/destroy_related_page.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/template/update_information.rb +1 -1
- data/lib/ecoportal/api/graphql/payload.rb +23 -23
- data/lib/ecoportal/api/graphql/query/location_structures.rb +57 -57
- data/lib/ecoportal/api/graphql/query/page.rb +45 -45
- data/lib/ecoportal/api/graphql/query/page_with_forces.rb +9 -3
- data/lib/ecoportal/api/graphql/query/pages_workflow_commands.rb +9 -3
- data/lib/ecoportal/api/graphql/query/register_preset_views.rb +78 -78
- data/lib/ecoportal/api/graphql/query.rb +27 -27
- data/lib/ecoportal/api/graphql.rb +9 -5
- data/lib/ecoportal/api/graphql_version.rb +1 -1
- metadata +9 -180
- data/.ai-assistance/bridge/CLAUDE.md +0 -338
- data/.ai-assistance/bridge/archive/.gitkeep +0 -0
- data/.ai-assistance/bridge/archive/oscar-a1b2c3d-gitlab-mcp-doc-update.inbox.md +0 -29
- data/.ai-assistance/bridge/archive/oscar-a1b2c3d-gitlab-mcp-doc-update.outbox.md +0 -18
- data/.ai-assistance/bridge/archive/oscar-c912c25-gemini-design-review.inbox.md +0 -42
- data/.ai-assistance/bridge/archive/oscar-c912c25-gemini-design-review.outbox.md +0 -115
- data/.ai-assistance/bridge/context/gemini-review-prompt.txt +0 -48
- data/.ai-assistance/bridge/context/gemini-review-response.md +0 -104
- data/.ai-assistance/bridge/context/project.md +0 -42
- data/.ai-assistance/bridge/inbox/.gitkeep +0 -0
- data/.ai-assistance/bridge/outbox/.gitkeep +0 -0
- data/.ai-assistance/bridge/outbox/request-for-standards-discovery.md +0 -48
- data/.ai-assistance/bridge/queue/.gitkeep +0 -1
- data/.ai-assistance/capabilities/CLAUDE.md +0 -27
- data/.ai-assistance/capabilities/assumptions-log.md +0 -80
- data/.ai-assistance/capabilities/code.md +0 -47
- data/.ai-assistance/capabilities/connectors.md +0 -37
- data/.ai-assistance/capabilities/cowork.md +0 -55
- data/.ai-assistance/code/OVERVIEW.md +0 -155
- data/.ai-assistance/code/data_fields.md +0 -242
- data/.ai-assistance/code/dependencies.md +0 -151
- data/.ai-assistance/code/diff_as_input.md +0 -234
- data/.ai-assistance/code/diff_pairing_engine.md +0 -243
- data/.ai-assistance/code/diff_service_deep_dive.md +0 -192
- data/.ai-assistance/code/ecoPortal_architecture/00_overview_and_index.md +0 -55
- data/.ai-assistance/code/ecoPortal_architecture/01_terminology_dictionary.md +0 -181
- data/.ai-assistance/code/ecoPortal_architecture/02_data_model.md +0 -192
- data/.ai-assistance/code/ecoPortal_architecture/03_api_layers.md +0 -147
- data/.ai-assistance/code/ecoPortal_architecture/04_graphql_queries_mutations.md +0 -277
- data/.ai-assistance/code/ecoPortal_architecture/05_page_workflows.md +0 -200
- data/.ai-assistance/code/ecoPortal_architecture/06_search_and_filters.md +0 -228
- data/.ai-assistance/code/ecoPortal_architecture/07_data_fields.md +0 -197
- data/.ai-assistance/code/ecoPortal_architecture/08_stages_sections.md +0 -243
- data/.ai-assistance/code/ecoPortal_architecture/09_people_contractors_locations.md +0 -196
- data/.ai-assistance/code/ecoPortal_architecture/10_forces_workflow_builder.md +0 -132
- data/.ai-assistance/code/ecoPortal_architecture/11_integration_gems.md +0 -187
- data/.ai-assistance/code/ecoPortal_architecture/12_ai_documentation_sources_gaps.md +0 -236
- data/.ai-assistance/code/ecoPortal_architecture/13_ai_infrastructure.md +0 -183
- data/.ai-assistance/code/ecoportal_schema_reference.md +0 -240
- data/.ai-assistance/code/filter_contract_matrix.md +0 -177
- data/.ai-assistance/code/graphql_domain_knowledge.md +0 -240
- data/.ai-assistance/code/refactoring/datafield-readwrite-shape-asymmetry.md +0 -71
- data/.ai-assistance/code/refactoring/opportunities.md +0 -251
- data/.ai-assistance/code/schema_analysis.md +0 -321
- data/.ai-assistance/code/search_filters.md +0 -868
- data/.ai-assistance/code/spec_coverage.md +0 -73
- data/.ai-assistance/code/template_diff_pairing_domain.md +0 -175
- data/.ai-assistance/code/workflow-command-guide.md +0 -466
- data/.ai-assistance/code/workflow-space.md +0 -353
- data/.ai-assistance/conventions/CLAUDE.md +0 -30
- data/.ai-assistance/conventions/code-working-tree-protocol.md +0 -199
- data/.ai-assistance/conventions/gitignore-rules.md +0 -42
- data/.ai-assistance/conventions/permission-guidance.md +0 -120
- data/.ai-assistance/integrations/README.md +0 -70
- data/.ai-assistance/integrations/gitkraken-mcp.md +0 -107
- data/.ai-assistance/integrations/gitlab-mcp.md +0 -123
- data/.ai-assistance/integrations/local-git.md +0 -60
- data/.ai-assistance/local_paths.example.md +0 -17
- data/.ai-assistance/projects/TODO.md +0 -118
- data/.ai-assistance/projects/api-v2-to-graphql-migration/DECISIONS.md +0 -168
- data/.ai-assistance/projects/api-v2-to-graphql-migration/INTENT.md +0 -60
- data/.ai-assistance/projects/api-v2-to-graphql-migration/TODO.md +0 -267
- data/.ai-assistance/projects/api-v2-to-graphql-migration/UPSTREAM.md +0 -53
- data/.ai-assistance/projects/api-v2-to-graphql-migration/notes/csv-template-pipeline-design.md +0 -102
- data/.ai-assistance/projects/api-v2-to-graphql-migration/notes/cutover-usecase-gap-audit.md +0 -139
- data/.ai-assistance/projects/compat-layer-audit/COMPAT_AUDIT.md +0 -244
- data/.ai-assistance/projects/dynamic-model-generation/INTENT.md +0 -93
- data/.ai-assistance/projects/eco-helpers-compat/INTENT.md +0 -244
- data/.ai-assistance/projects/eco-helpers-compat/MIGRATION_GUIDE.md +0 -266
- data/.ai-assistance/projects/eco-helpers-compat/TODO.md +0 -86
- data/.ai-assistance/projects/ecoportal-api-v2-doublemodel-review/INTENT.md +0 -101
- data/.ai-assistance/projects/graphql-agent/GAP_ANALYSIS.md +0 -177
- data/.ai-assistance/projects/ooze-graphql-native-migration/DECISIONS.md +0 -161
- data/.ai-assistance/projects/ooze-graphql-native-migration/INTENT.md +0 -125
- data/.ai-assistance/projects/ooze-graphql-native-migration/INVENTORY.md +0 -136
- data/.ai-assistance/projects/ooze-graphql-native-migration/RISKS.md +0 -126
- data/.ai-assistance/projects/ooze-graphql-native-migration/TODO.md +0 -261
- data/.ai-assistance/projects/ooze-graphql-native-migration/analysis/2026-06-30-cutover-workflow-deep-review.md +0 -122
- data/.ai-assistance/projects/ooze-graphql-native-migration/analysis/2026-07-01-forces-via-workflow-commands-miss-rca.md +0 -148
- data/.ai-assistance/projects/page-model/DECISIONS.md +0 -245
- data/.ai-assistance/projects/page-model/TODO.md +0 -190
- data/.ai-assistance/projects/qa-services-delivery/DECISIONS.md +0 -93
- data/.ai-assistance/projects/qa-services-delivery/INTENT.md +0 -76
- data/.ai-assistance/projects/qa-services-delivery/PHASE3-SCOPE.md +0 -115
- data/.ai-assistance/projects/qa-services-delivery/ROADMAP.md +0 -99
- data/.ai-assistance/projects/qa-services-delivery/TODO.md +0 -81
- data/.ai-assistance/projects/search-filter-builder/INTENT.md +0 -107
- data/.ai-assistance/projects/search-filter-builder/TODO.md +0 -131
- data/.ai-assistance/projects/template-automatic-build-maintenance/INTENT.md +0 -87
- data/.ai-assistance/projects/template-automatic-build-maintenance/TODO.md +0 -108
- data/.ai-assistance/projects/template-diff-deploy/INTENT.md +0 -12
- data/.ai-assistance/projects/template-diff-deploy/TODO.md +0 -9
- data/.ai-assistance/projects/template-maintenance/DESIGN.md +0 -134
- data/.ai-assistance/projects/template-maintenance/PHASE0-FINDINGS.md +0 -93
- data/.ai-assistance/projects/template-maintenance/README.md +0 -14
- data/.ai-assistance/projects/template-model-logic/CATEGORY_CATALOG.md +0 -236
- data/.ai-assistance/projects/template-model-logic/CLASSIFICATION_SPIKE.md +0 -243
- data/.ai-assistance/projects/template-model-logic/DESIGN_NOTE.md +0 -154
- data/.ai-assistance/projects/workflow-space/TODO.md +0 -213
- data/.ai-assistance/reinstall-claude-desktop-windows.md +0 -136
- data/.ai-assistance/scripts/CLAUDE.md +0 -150
- data/.ai-assistance/scripts/bridge-inbox-check.sh +0 -75
- data/.ai-assistance/scripts/bridge-init.sh +0 -86
- data/.ai-assistance/scripts/bridge-status.sh +0 -44
- data/.ai-assistance/scripts/capabilities-check.ts +0 -104
- data/.ai-assistance/scripts/check-outbox.sh +0 -43
- data/.ai-assistance/scripts/dep_graph.rb +0 -91
- data/.ai-assistance/scripts/lock-acquire.sh +0 -103
- data/.ai-assistance/scripts/lock-multi.sh +0 -124
- data/.ai-assistance/scripts/lock-queue.sh +0 -94
- data/.ai-assistance/scripts/setup-mcps.test.ts +0 -188
- data/.ai-assistance/scripts/setup-mcps.ts +0 -234
- data/.ai-assistance/scripts/task-complete.ts +0 -74
- data/.ai-assistance/scripts/task-create.ts +0 -75
- data/.ai-assistance/scripts/task-read.ts +0 -125
- data/.ai-assistance/scripts/token-logger.js +0 -220
- data/.ai-assistance/scripts/token-report.ts +0 -158
- data/.ai-assistance/scripts/token-session-start.js +0 -66
- data/.ai-assistance/skills/ai-instructions/SKILL.md +0 -48
- data/.ai-assistance/skills/code-specs/SKILL.md +0 -69
- data/.ai-assistance/skills/corporate-policies/SKILL.md +0 -201
- data/.ai-assistance/skills/dep-graph/SKILL.md +0 -139
- data/.ai-assistance/skills/ep-ai-manager/SKILL.md +0 -417
- data/.ai-assistance/skills/gemini-assist/SKILL.md +0 -63
- data/.ai-assistance/skills/gemini-assist/gemini-mcp-server.js +0 -205
- data/.ai-assistance/skills/gemini-assist/gemini_ask.py +0 -1
- data/.ai-assistance/skills/gemini-assist/gemini_ask.rb +0 -240
- data/.ai-assistance/skills/gemini-assist/prompts/cycle_end_review.txt +0 -25
- data/.ai-assistance/skills/graphql-schema-analysis/SKILL.md +0 -261
- data/.ai-assistance/skills/procedural-memory/SKILL.md +0 -319
- data/.ai-assistance/skills/project-cycle/SKILL.md +0 -177
- data/.ai-assistance/skills/project-self-docs/SKILL.md +0 -181
- data/.ai-assistance/skills/project-self-docs/scripts/self_docs_scan.py +0 -378
- data/.ai-assistance/skills/refactor/SKILL.md +0 -62
- data/.ai-assistance/skills/rubocop/SKILL.md +0 -93
- data/.ai-assistance/skills/ruby-scripting/SKILL.md +0 -215
- data/.ai-assistance/skills/spec-generation/SKILL.md +0 -72
- data/.ai-assistance/standards-version.json +0 -22
- data/.ai-assistance/token-budget.json +0 -32
- data/.ai-assistance/version.json +0 -39
- data/.claude/settings.json +0 -150
- data/.env.example +0 -18
- data/.gitattributes +0 -15
- data/.gitignore +0 -37
- data/.gitlab-ci.yml +0 -45
- data/.markdownlint.json +0 -4
- data/.rspec +0 -3
- data/.rubocop.yml +0 -121
- data/.ruby-version +0 -1
- data/.yardopts +0 -10
- data/CLAUDE.md +0 -243
- data/Gemfile +0 -30
- data/Rakefile +0 -90
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/bin/setup.ps1 +0 -6
- data/docs/self-docs/ARCHITECTURE.md +0 -88
- data/docs/self-docs/CHANGES.jsonl +0 -12
- data/docs/self-docs/COMPLIANCE.md +0 -79
- data/docs/self-docs/CONVENTIONS.md +0 -74
- data/docs/self-docs/INTEGRATIONS.md +0 -65
- data/docs/self-docs/OPERATIONS.md +0 -76
- data/docs/self-docs/OVERVIEW.md +0 -64
- data/docs/self-docs/STATUS.md +0 -73
- data/docs/self-docs/self-docs-index.json +0 -51
- data/docs/worklog.md +0 -977
- data/ecoportal-api-graphql.gemspec +0 -40
- data/scripts/auto-worker-scheduler.sh +0 -386
- data/tests/actions_get.rb +0 -7
- data/tests/contractor_entities_get.rb +0 -20
- data/tests/contractor_entity_create.rb +0 -19
- data/tests/contractor_entity_udpate.rb +0 -20
- data/tests/dump_page_model.rb +0 -74
- data/tests/dump_template_model.rb +0 -90
- data/tests/loc_structure_get.rb +0 -10
- data/tests/loc_structure_update.rb +0 -51
- data/tests/loc_structures_get.rb +0 -15
- data/tests/local_libs.rb +0 -20
- data/tests/validate_queries.rb +0 -127
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
module Ecoportal
|
|
2
|
-
module API
|
|
3
|
-
class GraphQL
|
|
4
|
-
module Query
|
|
5
|
-
class LocationStructures < Logic::QueryArray
|
|
6
|
-
accepted_params :includeArchived, :includeUnpublished, default: false
|
|
7
|
-
accepted_params :includeArchivedNodes, default: true
|
|
8
|
-
|
|
9
|
-
field_name :structures
|
|
10
|
-
|
|
11
|
-
class_resolver :item_class, Model::LocationStructure
|
|
12
|
-
|
|
13
|
-
private
|
|
14
|
-
|
|
15
|
-
def basic_block(&block)
|
|
16
|
-
final_block = block || default_query_block
|
|
17
|
-
proc {
|
|
18
|
-
query(
|
|
19
|
-
includeArchived: :boolean,
|
|
20
|
-
includeUnpublished: :boolean,
|
|
21
|
-
includeArchivedNodes: :boolean
|
|
22
|
-
) {
|
|
23
|
-
currentOrganization {
|
|
24
|
-
locations {
|
|
25
|
-
structures(
|
|
26
|
-
includeArchived: :includeArchived,
|
|
27
|
-
includeUnpublished: :includeUnpublished,
|
|
28
|
-
&final_block
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# At the moment it always retrieves archived nodes!!
|
|
37
|
-
# @note this is on purpose, as via API
|
|
38
|
-
# there isn't much sense in not including archived nodes.
|
|
39
|
-
def default_query_block
|
|
40
|
-
proc {
|
|
41
|
-
id
|
|
42
|
-
name
|
|
43
|
-
archived
|
|
44
|
-
weight
|
|
45
|
-
visitorManagementEnabled
|
|
46
|
-
nodes(
|
|
47
|
-
includeArchived: :includeArchivedNodes
|
|
48
|
-
) {
|
|
49
|
-
spread :LocationNode
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Query
|
|
5
|
+
class LocationStructures < Logic::QueryArray
|
|
6
|
+
accepted_params :includeArchived, :includeUnpublished, default: false
|
|
7
|
+
accepted_params :includeArchivedNodes, default: true
|
|
8
|
+
|
|
9
|
+
field_name :structures
|
|
10
|
+
|
|
11
|
+
class_resolver :item_class, Model::LocationStructure
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def basic_block(&block)
|
|
16
|
+
final_block = block || default_query_block
|
|
17
|
+
proc {
|
|
18
|
+
query(
|
|
19
|
+
includeArchived: :boolean,
|
|
20
|
+
includeUnpublished: :boolean,
|
|
21
|
+
includeArchivedNodes: :boolean
|
|
22
|
+
) {
|
|
23
|
+
currentOrganization {
|
|
24
|
+
locations {
|
|
25
|
+
structures(
|
|
26
|
+
includeArchived: :includeArchived,
|
|
27
|
+
includeUnpublished: :includeUnpublished,
|
|
28
|
+
&final_block
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# At the moment it always retrieves archived nodes!!
|
|
37
|
+
# @note this is on purpose, as via API
|
|
38
|
+
# there isn't much sense in not including archived nodes.
|
|
39
|
+
def default_query_block
|
|
40
|
+
proc {
|
|
41
|
+
id
|
|
42
|
+
name
|
|
43
|
+
archived
|
|
44
|
+
weight
|
|
45
|
+
visitorManagementEnabled
|
|
46
|
+
nodes(
|
|
47
|
+
includeArchived: :includeArchivedNodes
|
|
48
|
+
) {
|
|
49
|
+
spread :LocationNode
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
module Ecoportal
|
|
2
|
-
module API
|
|
3
|
-
class GraphQL
|
|
4
|
-
module Query
|
|
5
|
-
class Page < Logic::Query
|
|
6
|
-
field_name :page
|
|
7
|
-
# Response nests under currentOrganization.page; needed when instantiated
|
|
8
|
-
# directly (e.g. Compat::Pages#get) rather than via the currentOrganization proxy.
|
|
9
|
-
base_path 'currentOrganization'
|
|
10
|
-
|
|
11
|
-
accepted_params :id
|
|
12
|
-
class_resolver :item_class, 'Ecoportal::API::GraphQL::Model::PageUnion'
|
|
13
|
-
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
-
def basic_block(&block)
|
|
17
|
-
page_block = block || default_block
|
|
18
|
-
# CommonPageUnion's directives ($content/$only_content/$fields) are declared
|
|
19
|
-
# here with the defaults for a single-page read (content + field definitions).
|
|
20
|
-
# showHiddenData defaults true so reads include hidden/deindexed fields — v2
|
|
21
|
-
# parity (scripts see every field) and matches the front-end edit load. The
|
|
22
|
-
# server omits hidden fields from `page(id:)` when this is false/absent.
|
|
23
|
-
proc {
|
|
24
|
-
query(
|
|
25
|
-
id: :id!,
|
|
26
|
-
showHiddenData: 'Boolean = true',
|
|
27
|
-
content: 'Boolean = true',
|
|
28
|
-
only_content: 'Boolean = false',
|
|
29
|
-
fields: 'Boolean = true'
|
|
30
|
-
) {
|
|
31
|
-
currentOrganization {
|
|
32
|
-
page(id: :id, showHiddenData: :showHiddenData, &page_block)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def default_block
|
|
39
|
-
proc { spread :CommonPageUnion }
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Query
|
|
5
|
+
class Page < Logic::Query
|
|
6
|
+
field_name :page
|
|
7
|
+
# Response nests under currentOrganization.page; needed when instantiated
|
|
8
|
+
# directly (e.g. Compat::Pages#get) rather than via the currentOrganization proxy.
|
|
9
|
+
base_path 'currentOrganization'
|
|
10
|
+
|
|
11
|
+
accepted_params :id
|
|
12
|
+
class_resolver :item_class, 'Ecoportal::API::GraphQL::Model::PageUnion'
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def basic_block(&block)
|
|
17
|
+
page_block = block || default_block
|
|
18
|
+
# CommonPageUnion's directives ($content/$only_content/$fields) are declared
|
|
19
|
+
# here with the defaults for a single-page read (content + field definitions).
|
|
20
|
+
# showHiddenData defaults true so reads include hidden/deindexed fields — v2
|
|
21
|
+
# parity (scripts see every field) and matches the front-end edit load. The
|
|
22
|
+
# server omits hidden fields from `page(id:)` when this is false/absent.
|
|
23
|
+
proc {
|
|
24
|
+
query(
|
|
25
|
+
id: :id!,
|
|
26
|
+
showHiddenData: 'Boolean = true',
|
|
27
|
+
content: 'Boolean = true',
|
|
28
|
+
only_content: 'Boolean = false',
|
|
29
|
+
fields: 'Boolean = true'
|
|
30
|
+
) {
|
|
31
|
+
currentOrganization {
|
|
32
|
+
page(id: :id, showHiddenData: :showHiddenData, &page_block)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def default_block
|
|
39
|
+
proc { spread :CommonPageUnion }
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -28,12 +28,18 @@ module Ecoportal
|
|
|
28
28
|
}
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
# `currentOrganization.page(id:)` returns a PageUnion — selecting `forces` on it
|
|
32
|
+
# directly is invalid GraphQL ("Selections can't be made directly on unions").
|
|
33
|
+
# `forces` lives on BasePageInterface (which every union member implements), so it
|
|
34
|
+
# goes through an inline type condition, same as `PageFields` does.
|
|
31
35
|
def default_block
|
|
32
36
|
proc {
|
|
33
37
|
spread :PageFields
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
spread on: :BasePageInterface do
|
|
39
|
+
forces {
|
|
40
|
+
spread :ForceFields
|
|
41
|
+
}
|
|
42
|
+
end
|
|
37
43
|
}
|
|
38
44
|
end
|
|
39
45
|
end
|
|
@@ -25,15 +25,21 @@ module Ecoportal
|
|
|
25
25
|
|
|
26
26
|
private
|
|
27
27
|
|
|
28
|
+
# `page(id:)` returns a PageUnion — selecting `workflow` on it directly is invalid
|
|
29
|
+
# GraphQL ("Selections can't be made directly on unions"). `workflow` lives on
|
|
30
|
+
# BasePageInterface, so it goes through an inline type condition. The response shape
|
|
31
|
+
# is unchanged by the type condition, so `#path` still resolves the connection.
|
|
28
32
|
def basic_block(&block)
|
|
29
33
|
connection_block = block || default_connection_block
|
|
30
34
|
proc {
|
|
31
35
|
query(id: :id!, after: :string, before: :string, first: :int, last: :int) {
|
|
32
36
|
currentOrganization {
|
|
33
37
|
page(id: :id) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
spread on: :BasePageInterface do
|
|
39
|
+
workflow {
|
|
40
|
+
commands(after: :after, before: :before, first: :first, last: :last, &connection_block)
|
|
41
|
+
}
|
|
42
|
+
end
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
45
|
}
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
module Ecoportal
|
|
2
|
-
module API
|
|
3
|
-
class GraphQL
|
|
4
|
-
module Query
|
|
5
|
-
# Lists preset views for a register.
|
|
6
|
-
# Returns an array of PresetView objects — not paginated (server returns all at once).
|
|
7
|
-
# Use the returned IDs as `presetViewId` in RegisterPreviewPages queries.
|
|
8
|
-
#
|
|
9
|
-
# Usage:
|
|
10
|
-
# views = Query::RegisterPresetViews.new(client).query(registerId: 'REG_ID')
|
|
11
|
-
# views.map { |v| { id: v.id, name: v.name, global: v.global? } }
|
|
12
|
-
class RegisterPresetViews < Logic::Query
|
|
13
|
-
field_name :presetViews
|
|
14
|
-
|
|
15
|
-
accepted_params :registerId, :searchConf
|
|
16
|
-
|
|
17
|
-
class_resolver :item_class, 'Ecoportal::API::GraphQL::Model::PresetView'
|
|
18
|
-
|
|
19
|
-
def path
|
|
20
|
-
%w[currentOrganization register presetViews]
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def response_class
|
|
24
|
-
# presetViews returns an array — wrap in a simple array-like response
|
|
25
|
-
ArrayResponse
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Minimal array wrapper so callers can iterate results with .each / .map
|
|
29
|
-
class ArrayResponse
|
|
30
|
-
include Enumerable
|
|
31
|
-
|
|
32
|
-
def initialize(raw)
|
|
33
|
-
klass = Ecoportal::API::GraphQL::Model::PresetView
|
|
34
|
-
@items = Array(raw).map { |d| klass.new(d) }
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def each(&block)
|
|
38
|
-
@items.each(&block)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def nodes
|
|
42
|
-
@items
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
private
|
|
47
|
-
|
|
48
|
-
def basic_block(&block)
|
|
49
|
-
view_block = block || default_block
|
|
50
|
-
proc {
|
|
51
|
-
query(
|
|
52
|
-
registerId: :id!,
|
|
53
|
-
searchConf: :Search
|
|
54
|
-
) {
|
|
55
|
-
currentOrganization {
|
|
56
|
-
register(id: :registerId) {
|
|
57
|
-
presetViews(searchConf: :searchConf, &view_block)
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def default_block
|
|
65
|
-
proc {
|
|
66
|
-
id
|
|
67
|
-
name
|
|
68
|
-
global
|
|
69
|
-
registerId
|
|
70
|
-
sorter { key direction missing }
|
|
71
|
-
fieldConfigurations {
|
|
72
|
-
}
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
end
|
|
78
|
-
end
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Query
|
|
5
|
+
# Lists preset views for a register.
|
|
6
|
+
# Returns an array of PresetView objects — not paginated (server returns all at once).
|
|
7
|
+
# Use the returned IDs as `presetViewId` in RegisterPreviewPages queries.
|
|
8
|
+
#
|
|
9
|
+
# Usage:
|
|
10
|
+
# views = Query::RegisterPresetViews.new(client).query(registerId: 'REG_ID')
|
|
11
|
+
# views.map { |v| { id: v.id, name: v.name, global: v.global? } }
|
|
12
|
+
class RegisterPresetViews < Logic::Query
|
|
13
|
+
field_name :presetViews
|
|
14
|
+
|
|
15
|
+
accepted_params :registerId, :searchConf
|
|
16
|
+
|
|
17
|
+
class_resolver :item_class, 'Ecoportal::API::GraphQL::Model::PresetView'
|
|
18
|
+
|
|
19
|
+
def path
|
|
20
|
+
%w[currentOrganization register presetViews]
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def response_class
|
|
24
|
+
# presetViews returns an array — wrap in a simple array-like response
|
|
25
|
+
ArrayResponse
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Minimal array wrapper so callers can iterate results with .each / .map
|
|
29
|
+
class ArrayResponse
|
|
30
|
+
include Enumerable
|
|
31
|
+
|
|
32
|
+
def initialize(raw)
|
|
33
|
+
klass = Ecoportal::API::GraphQL::Model::PresetView
|
|
34
|
+
@items = Array(raw).map { |d| klass.new(d) }
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def each(&block)
|
|
38
|
+
@items.each(&block)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def nodes
|
|
42
|
+
@items
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
def basic_block(&block)
|
|
49
|
+
view_block = block || default_block
|
|
50
|
+
proc {
|
|
51
|
+
query(
|
|
52
|
+
registerId: :id!,
|
|
53
|
+
searchConf: :Search
|
|
54
|
+
) {
|
|
55
|
+
currentOrganization {
|
|
56
|
+
register(id: :registerId) {
|
|
57
|
+
presetViews(searchConf: :searchConf, &view_block)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def default_block
|
|
65
|
+
proc {
|
|
66
|
+
id
|
|
67
|
+
name
|
|
68
|
+
global
|
|
69
|
+
registerId
|
|
70
|
+
sorter { key direction missing }
|
|
71
|
+
fieldConfigurations { spread :FieldConfiguration }
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
module Ecoportal
|
|
2
|
-
module API
|
|
3
|
-
class GraphQL
|
|
4
|
-
module Query
|
|
5
|
-
end
|
|
6
|
-
end
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
require_relative 'query/location_classifications'
|
|
11
|
-
require_relative 'query/location_structure'
|
|
12
|
-
require_relative 'query/location_structures'
|
|
13
|
-
require_relative 'query/action_categories'
|
|
14
|
-
require_relative 'query/action'
|
|
15
|
-
require_relative 'query/actions'
|
|
16
|
-
require_relative 'query/contractor_entities'
|
|
17
|
-
require_relative 'query/page'
|
|
18
|
-
require_relative 'query/pages'
|
|
19
|
-
require_relative 'query/templates'
|
|
20
|
-
require_relative 'query/register_preview_pages'
|
|
21
|
-
require_relative 'query/page_delta'
|
|
22
|
-
require_relative 'query/register_preset_views'
|
|
23
|
-
|
|
24
|
-
require_relative 'query/file_upload_signature'
|
|
25
|
-
|
|
26
|
-
require_relative 'query/page_with_forces'
|
|
27
|
-
require_relative 'query/pages_workflow_commands'
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Query
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
require_relative 'query/location_classifications'
|
|
11
|
+
require_relative 'query/location_structure'
|
|
12
|
+
require_relative 'query/location_structures'
|
|
13
|
+
require_relative 'query/action_categories'
|
|
14
|
+
require_relative 'query/action'
|
|
15
|
+
require_relative 'query/actions'
|
|
16
|
+
require_relative 'query/contractor_entities'
|
|
17
|
+
require_relative 'query/page'
|
|
18
|
+
require_relative 'query/pages'
|
|
19
|
+
require_relative 'query/templates'
|
|
20
|
+
require_relative 'query/register_preview_pages'
|
|
21
|
+
require_relative 'query/page_delta'
|
|
22
|
+
require_relative 'query/register_preset_views'
|
|
23
|
+
|
|
24
|
+
require_relative 'query/file_upload_signature'
|
|
25
|
+
|
|
26
|
+
require_relative 'query/page_with_forces'
|
|
27
|
+
require_relative 'query/pages_workflow_commands'
|
|
@@ -13,7 +13,10 @@ module Ecoportal
|
|
|
13
13
|
# @param org_id [String] the id of the target organization.
|
|
14
14
|
# It defaults to the environmental variable `ORGANIZATION_ID`, if defined
|
|
15
15
|
# @param logger [Logger] an object with `Logger` interface to generate logs.
|
|
16
|
-
|
|
16
|
+
# @param api_key [String] optional `X-ECOPORTAL-API-KEY`, required only for the v2 REST
|
|
17
|
+
# endpoints `FileUpload::Client` calls to register/poll an uploaded file — the GraphQL
|
|
18
|
+
# endpoint itself always authenticates via the email/pass OAuth bearer token.
|
|
19
|
+
def initialize(email: nil, pass: nil, org_id: nil, host: "live.ecoportal.com", api_key: nil)
|
|
17
20
|
kargs = {
|
|
18
21
|
email: email,
|
|
19
22
|
pass: pass,
|
|
@@ -24,10 +27,11 @@ module Ecoportal
|
|
|
24
27
|
|
|
25
28
|
@client = client_class.new(**kargs)
|
|
26
29
|
@client.http_client = Ecoportal::API::Common::GraphQL::HttpClient.new(
|
|
27
|
-
email:
|
|
28
|
-
pass:
|
|
29
|
-
org_id:
|
|
30
|
-
host:
|
|
30
|
+
email: email,
|
|
31
|
+
pass: pass,
|
|
32
|
+
org_id: org_id,
|
|
33
|
+
host: host,
|
|
34
|
+
api_key: api_key
|
|
31
35
|
)
|
|
32
36
|
@fragments = Ecoportal::API::GraphQL::Fragment.new(client)
|
|
33
37
|
end
|