ecoportal-api-graphql 1.3.5 → 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 +934 -477
- data/lib/ecoportal/api/common/graphql/CLAUDE.md +36 -0
- data/lib/ecoportal/api/common/graphql/client.rb +1 -1
- data/lib/ecoportal/api/common/graphql/http_client.rb +195 -145
- data/lib/ecoportal/api/common/graphql/model/CLAUDE.md +28 -0
- data/lib/ecoportal/api/common/graphql/model/as_input.rb +8 -5
- data/lib/ecoportal/api/common/graphql/model/diffable/classic_diff_service.rb +3 -1
- data/lib/ecoportal/api/common/graphql/model/diffable/diff_service.rb +31 -23
- data/lib/ecoportal/api/common/graphql/model/diffable/hash_diff_nesting.rb +54 -1
- data/lib/ecoportal/api/common/graphql/model/diffable.rb +54 -54
- data/lib/ecoportal/api/graphql/CLAUDE.md +37 -0
- data/lib/ecoportal/api/graphql/base/CLAUDE.md +50 -0
- data/lib/ecoportal/api/graphql/base/action.rb +43 -43
- data/lib/ecoportal/api/graphql/base/ai_summary_version.rb +17 -0
- data/lib/ecoportal/api/graphql/base/contractor_entity/member_changes.rb +67 -67
- data/lib/ecoportal/api/graphql/base/delta_result.rb +16 -0
- data/lib/ecoportal/api/graphql/base/file_container.rb +14 -14
- data/lib/ecoportal/api/graphql/base/force/binding.rb +19 -0
- data/lib/ecoportal/api/graphql/base/force/binding_collection.rb +62 -0
- data/lib/ecoportal/api/graphql/base/force/collection.rb +47 -0
- data/lib/ecoportal/api/graphql/base/force.rb +65 -0
- data/lib/ecoportal/api/graphql/base/kickstand/job.rb +17 -0
- data/lib/ecoportal/api/graphql/base/kickstand/workflow.rb +18 -0
- data/lib/ecoportal/api/graphql/base/kickstand.rb +13 -0
- 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/basic.rb +38 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/actions_list.rb +9 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/ai_summary.rb +18 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/checklist.rb +29 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/collection.rb +119 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/contractor_entities.rb +28 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/cross_reference.rb +54 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/date_field.rb +23 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/file_field.rb +25 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/gauge.rb +19 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/geo.rb +24 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/image_gallery.rb +24 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/law.rb +8 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/mailbox.rb +9 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/number.rb +20 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/people.rb +35 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/plain_text.rb +17 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/rich_text.rb +26 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/select.rb +41 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/signature.rb +9 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/smart_fill.rb +17 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/table.rb +9 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/tag_field.rb +21 -0
- data/lib/ecoportal/api/graphql/base/page/data_field.rb +137 -12
- data/lib/ecoportal/api/graphql/base/page/phased/stage.rb +68 -14
- data/lib/ecoportal/api/graphql/base/page/phased.rb +1 -0
- data/lib/ecoportal/api/graphql/base/page/section.rb +36 -0
- data/lib/ecoportal/api/graphql/base/page/section_collection.rb +85 -0
- data/lib/ecoportal/api/graphql/base/page/task.rb +24 -0
- data/lib/ecoportal/api/graphql/base/page.rb +17 -14
- data/lib/ecoportal/api/graphql/base/pages_workflow/action_type_selection.rb +17 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/callback_type.rb +28 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/command_change.rb +17 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/command_change_message.rb +15 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/command_es_change.rb +17 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/command_interface.rb +36 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/email_config.rb +18 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/escalation_level.rb +19 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/in_system_config.rb +16 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/mailbox_field_selection.rb +17 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/operation_interface.rb +39 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/operations/assign_to.rb +27 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/operations/create_page.rb +21 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/operations/send_notification.rb +30 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/people_field_selection.rb +17 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/recipient_config.rb +34 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/register_field.rb +17 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/task_config_selection.rb +17 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/time_delay_config.rb +16 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/trigger_interface.rb +26 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/triggers/conditional_logic.rb +17 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow/user_selection.rb +16 -0
- data/lib/ecoportal/api/graphql/base/pages_workflow.rb +35 -0
- data/lib/ecoportal/api/graphql/base/preset_view.rb +17 -0
- data/lib/ecoportal/api/graphql/base/preview_page.rb +23 -0
- data/lib/ecoportal/api/graphql/base/register.rb +18 -0
- data/lib/ecoportal/api/graphql/base/template.rb +35 -0
- data/lib/ecoportal/api/graphql/base.rb +37 -24
- data/lib/ecoportal/api/graphql/builder/CLAUDE.md +65 -0
- data/lib/ecoportal/api/graphql/builder/contractor_entity.rb +41 -41
- data/lib/ecoportal/api/graphql/builder/kickstand.rb +73 -0
- data/lib/ecoportal/api/graphql/builder/page.rb +210 -41
- data/lib/ecoportal/api/graphql/builder/register/preset_view.rb +84 -0
- data/lib/ecoportal/api/graphql/builder/register.rb +27 -19
- data/lib/ecoportal/api/graphql/builder/template.rb +80 -0
- data/lib/ecoportal/api/graphql/builder/template_builder.rb +174 -0
- data/lib/ecoportal/api/graphql/builder.rb +17 -14
- data/lib/ecoportal/api/graphql/compat/filter_translator.rb +142 -0
- data/lib/ecoportal/api/graphql/compat/page_reference.rb +23 -0
- data/lib/ecoportal/api/graphql/compat/pages.rb +212 -0
- data/lib/ecoportal/api/graphql/compat/registers.rb +84 -0
- data/lib/ecoportal/api/graphql/compat/response.rb +35 -0
- data/lib/ecoportal/api/graphql/compat/search_results.rb +33 -0
- data/lib/ecoportal/api/graphql/compat/stage_collection.rb +70 -0
- data/lib/ecoportal/api/graphql/compat/stage_view.rb +76 -0
- data/lib/ecoportal/api/graphql/compat.rb +17 -0
- data/lib/ecoportal/api/graphql/concerns/data_field_access.rb +71 -0
- data/lib/ecoportal/api/graphql/concerns/deprecation.rb +20 -0
- data/lib/ecoportal/api/graphql/concerns/fragment_definitions.rb +21 -28
- data/lib/ecoportal/api/graphql/concerns/page_compat.rb +51 -0
- data/lib/ecoportal/api/graphql/concerns/snake_camel_access.rb +60 -0
- data/lib/ecoportal/api/graphql/concerns.rb +14 -10
- 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 -0
- data/lib/ecoportal/api/graphql/connection/pages_workflow_command.rb +13 -0
- data/lib/ecoportal/api/graphql/connection/person_member.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/preset_view.rb +11 -0
- data/lib/ecoportal/api/graphql/connection/preview_page.rb +11 -0
- data/lib/ecoportal/api/graphql/connection.rb +17 -13
- data/lib/ecoportal/api/graphql/diff/change.rb +59 -0
- data/lib/ecoportal/api/graphql/diff/command_synthesizer.rb +329 -0
- data/lib/ecoportal/api/graphql/diff/cross_object_diff.rb +165 -0
- data/lib/ecoportal/api/graphql/diff/deploy.rb +121 -0
- data/lib/ecoportal/api/graphql/diff/id_resolver.rb +64 -0
- data/lib/ecoportal/api/graphql/diff/pairing/candidate.rb +32 -0
- data/lib/ecoportal/api/graphql/diff/pairing/engine.rb +173 -0
- data/lib/ecoportal/api/graphql/diff/pairing/ledger.rb +119 -0
- data/lib/ecoportal/api/graphql/diff/pairing/signals.rb +104 -0
- data/lib/ecoportal/api/graphql/diff/strategy.rb +113 -0
- data/lib/ecoportal/api/graphql/diff/version_diff.rb +332 -0
- data/lib/ecoportal/api/graphql/diff.rb +34 -0
- data/lib/ecoportal/api/graphql/file_upload/client.rb +192 -0
- data/lib/ecoportal/api/graphql/file_upload.rb +10 -0
- data/lib/ecoportal/api/graphql/fragment/action.rb +1 -1
- data/lib/ecoportal/api/graphql/fragment/action_category.rb +1 -1
- data/lib/ecoportal/api/graphql/fragment/contractor_entity.rb +1 -1
- data/lib/ecoportal/api/graphql/fragment/field_configuration.rb +38 -0
- data/lib/ecoportal/api/graphql/fragment/force.rb +34 -0
- data/lib/ecoportal/api/graphql/fragment/location_draft.rb +53 -53
- data/lib/ecoportal/api/graphql/fragment/location_node.rb +26 -26
- data/lib/ecoportal/api/graphql/fragment/locations_error.rb +1 -1
- data/lib/ecoportal/api/graphql/fragment/page.rb +85 -0
- data/lib/ecoportal/api/graphql/fragment/page_task.rb +39 -0
- data/lib/ecoportal/api/graphql/fragment/pages/common_page_union.rb +396 -0
- data/lib/ecoportal/api/graphql/fragment/pages.rb +15 -0
- data/lib/ecoportal/api/graphql/fragment/pages_workflow.rb +172 -0
- data/lib/ecoportal/api/graphql/fragment/pagination.rb +1 -1
- data/lib/ecoportal/api/graphql/fragment/template.rb +51 -0
- data/lib/ecoportal/api/graphql/fragment.rb +40 -27
- data/lib/ecoportal/api/graphql/input/action/update.rb +14 -14
- data/lib/ecoportal/api/graphql/input/contractor_entity/update.rb +41 -16
- data/lib/ecoportal/api/graphql/input/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/input/delta_input.rb +16 -0
- data/lib/ecoportal/api/graphql/input/location_structure/apply_commands.rb +47 -47
- data/lib/ecoportal/api/graphql/input/location_structure/draft/add_commands.rb +49 -49
- data/lib/ecoportal/api/graphql/input/location_structure/update_command.rb +27 -27
- data/lib/ecoportal/api/graphql/input/page/archive.rb +14 -0
- data/lib/ecoportal/api/graphql/input/page/build_from_template.rb +13 -0
- data/lib/ecoportal/api/graphql/input/page/create_draft.rb +13 -0
- data/lib/ecoportal/api/graphql/input/page/create_from_template.rb +18 -0
- data/lib/ecoportal/api/graphql/input/page/delete_draft.rb +13 -0
- data/lib/ecoportal/api/graphql/input/page/publish_draft.rb +13 -0
- data/lib/ecoportal/api/graphql/input/page/review_task.rb +14 -0
- data/lib/ecoportal/api/graphql/input/page/unarchive.rb +14 -0
- data/lib/ecoportal/api/graphql/input/page/update.rb +140 -0
- data/lib/ecoportal/api/graphql/input/page.rb +26 -0
- data/lib/ecoportal/api/graphql/input/preset_view/create.rb +18 -0
- data/lib/ecoportal/api/graphql/input/preset_view/permission.rb +16 -0
- data/lib/ecoportal/api/graphql/input/preset_view/update.rb +16 -0
- data/lib/ecoportal/api/graphql/input/preset_view.rb +14 -0
- data/lib/ecoportal/api/graphql/input/register/create.rb +18 -0
- data/lib/ecoportal/api/graphql/input/register/update.rb +15 -0
- data/lib/ecoportal/api/graphql/input/register.rb +13 -0
- data/lib/ecoportal/api/graphql/input/search_conf/ai_generator.rb +234 -0
- data/lib/ecoportal/api/graphql/input/search_conf.rb +436 -0
- data/lib/ecoportal/api/graphql/input/variable_binding.rb +20 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_action_tag.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_binding.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_comment_tagging_user_group.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_default_direct_strategy_user.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_default_strategy.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_direct_strategy_user.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_field.rb +27 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_force.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_gauge_field_stop.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_linked_field_config.rb +23 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_linked_helper.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_operation.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_operation_direct_strategy_user.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_operation_strategy.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_recipient_action_type.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_recipient_filter.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_recipient_people_field.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_recipient_task_config.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_recipient_user.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_scheduled_callback.rb +23 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_scheduled_callback_action.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_section.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_select_field_option.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_stage.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_stage_section.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_stage_tag.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_strategy.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_task.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_task_assignment_user_group.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_workflow_callback.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/collapse_section.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_binding.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_creator_permissions.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_default_strategy.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_field_configuration.rb +21 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_force.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_gauge_field_stop.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_linked_field_config.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_linked_helper.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_operation.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_operation_strategy.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_page.rb +28 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_page_creator_permissions.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_reminder.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_required_sign_offs.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_restrict_comment_tagging.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_restrict_task_assignment.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_scheduled_callback.rb +22 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_section_header.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_select_field_option.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_stage.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_strategy.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_task_due.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_trigger.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/expand_section.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/contractor_entities.rb +24 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/cross_reference.rb +23 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/date.rb +20 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/gauge.rb +20 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/image_gallery.rb +20 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/location_field.rb +24 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/people.rb +24 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/plain_text.rb +20 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/rich_text.rb +20 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/select.rb +20 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/signature.rb +20 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/table.rb +25 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/move_field.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/move_stage.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_action_tag.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_binding.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_callback.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_comment_tagging_user_group.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_default_direct_strategy_user.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_default_strategy.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_direct_strategy_user.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_field.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_force.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_gauge_field_stop.rb +17 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_linked_field_config.rb +17 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_linked_helper.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_operation.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_operation_direct_strategy_user.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_operation_strategy.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_recipient_action_type.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_recipient_filter.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_recipient_people_field.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_recipient_task_config.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_recipient_user.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_scheduled_callback.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_section.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_select_field_option.rb +17 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_stage.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_stage_section.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_stage_tag.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_strategy.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_task.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_task_assignment_user_group.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_task_due.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_task_priority_level.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/reorder_forces.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/reorder_section.rb +18 -0
- data/lib/ecoportal/api/graphql/input/workflow_command.rb +251 -0
- data/lib/ecoportal/api/graphql/input.rb +24 -16
- data/lib/ecoportal/api/graphql/interface/base_page.rb +100 -58
- data/lib/ecoportal/api/graphql/interface/location_structure/command.rb +30 -30
- data/lib/ecoportal/api/graphql/interface/location_structure/nodes.rb +27 -28
- data/lib/ecoportal/api/graphql/logic/base_model.rb +2 -0
- data/lib/ecoportal/api/graphql/logic/base_query.rb +45 -2
- data/lib/ecoportal/api/graphql/logic/connection.rb +34 -34
- data/lib/ecoportal/api/graphql/logic/input.rb +26 -11
- data/lib/ecoportal/api/graphql/model/ai_summary_version.rb +10 -0
- data/lib/ecoportal/api/graphql/model/organization.rb +65 -55
- data/lib/ecoportal/api/graphql/model/page/basic.rb +14 -0
- data/lib/ecoportal/api/graphql/model/page/phased.rb +82 -20
- data/lib/ecoportal/api/graphql/model/page/task.rb +16 -0
- data/lib/ecoportal/api/graphql/model/page.rb +16 -14
- data/lib/ecoportal/api/graphql/model/page_union.rb +21 -0
- data/lib/ecoportal/api/graphql/model/pages_workflow.rb +20 -0
- data/lib/ecoportal/api/graphql/model/person_member.rb +15 -15
- data/lib/ecoportal/api/graphql/model/preset_view.rb +10 -0
- data/lib/ecoportal/api/graphql/model/preview_page.rb +10 -0
- data/lib/ecoportal/api/graphql/model/register.rb +10 -0
- data/lib/ecoportal/api/graphql/model/template.rb +15 -0
- data/lib/ecoportal/api/graphql/model.rb +32 -22
- data/lib/ecoportal/api/graphql/mutation/action/archive.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation/action/create.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation/action/update.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation/ai_summary/generate.rb +45 -0
- data/lib/ecoportal/api/graphql/mutation/ai_summary/submit_feedback.rb +40 -0
- data/lib/ecoportal/api/graphql/mutation/ai_summary.rb +13 -0
- data/lib/ecoportal/api/graphql/mutation/contractor_entity/create.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation/contractor_entity/destroy.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation/contractor_entity/update.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/mutation/kickstand/bulk_update_jobs.rb +43 -0
- data/lib/ecoportal/api/graphql/mutation/kickstand/bulk_update_workflows.rb +43 -0
- data/lib/ecoportal/api/graphql/mutation/kickstand/fail_job.rb +39 -0
- data/lib/ecoportal/api/graphql/mutation/kickstand/fail_workflow.rb +39 -0
- data/lib/ecoportal/api/graphql/mutation/kickstand/start_job.rb +39 -0
- data/lib/ecoportal/api/graphql/mutation/kickstand/start_workflow.rb +39 -0
- data/lib/ecoportal/api/graphql/mutation/kickstand/stop_workflow.rb +39 -0
- data/lib/ecoportal/api/graphql/mutation/kickstand.rb +18 -0
- data/lib/ecoportal/api/graphql/mutation/location_structure/apply_commands.rb +3 -3
- data/lib/ecoportal/api/graphql/mutation/location_structure/draft/add_commands.rb +2 -2
- data/lib/ecoportal/api/graphql/mutation/location_structure/draft/create.rb +2 -2
- data/lib/ecoportal/api/graphql/mutation/location_structure/draft/drop_bad_commands.rb +3 -3
- data/lib/ecoportal/api/graphql/mutation/location_structure/draft/publish.rb +3 -3
- data/lib/ecoportal/api/graphql/mutation/page/approve_review_task.rb +40 -0
- data/lib/ecoportal/api/graphql/mutation/page/archive.rb +40 -0
- data/lib/ecoportal/api/graphql/mutation/page/batch_update_review_task.rb +38 -0
- data/lib/ecoportal/api/graphql/mutation/page/build_from_template.rb +50 -0
- data/lib/ecoportal/api/graphql/mutation/page/create_draft.rb +38 -0
- data/lib/ecoportal/api/graphql/mutation/page/create_from_template.rb +43 -0
- data/lib/ecoportal/api/graphql/mutation/page/delete_draft.rb +38 -0
- data/lib/ecoportal/api/graphql/mutation/page/execute_force_commands.rb +69 -0
- data/lib/ecoportal/api/graphql/mutation/page/execute_workflow_commands.rb +52 -0
- data/lib/ecoportal/api/graphql/mutation/page/publish_draft.rb +38 -0
- data/lib/ecoportal/api/graphql/mutation/page/reject_review_task.rb +40 -0
- data/lib/ecoportal/api/graphql/mutation/page/restart_review_task.rb +40 -0
- data/lib/ecoportal/api/graphql/mutation/page/unarchive.rb +40 -0
- data/lib/ecoportal/api/graphql/mutation/page/undo_review_task.rb +40 -0
- data/lib/ecoportal/api/graphql/mutation/page/update.rb +40 -0
- data/lib/ecoportal/api/graphql/mutation/page/update_variable_bindings.rb +44 -0
- data/lib/ecoportal/api/graphql/mutation/page.rb +28 -0
- data/lib/ecoportal/api/graphql/mutation/preset_view/create.rb +35 -0
- data/lib/ecoportal/api/graphql/mutation/preset_view/destroy.rb +34 -0
- data/lib/ecoportal/api/graphql/mutation/preset_view/permission.rb +37 -0
- data/lib/ecoportal/api/graphql/mutation/preset_view/update.rb +35 -0
- data/lib/ecoportal/api/graphql/mutation/preset_view.rb +15 -0
- data/lib/ecoportal/api/graphql/mutation/register/create.rb +35 -0
- data/lib/ecoportal/api/graphql/mutation/register/destroy.rb +35 -0
- data/lib/ecoportal/api/graphql/mutation/register/update.rb +35 -0
- data/lib/ecoportal/api/graphql/mutation/register.rb +14 -0
- data/lib/ecoportal/api/graphql/mutation/smart_fill/generate.rb +36 -0
- data/lib/ecoportal/api/graphql/mutation/smart_fill/submit_feedback.rb +40 -0
- data/lib/ecoportal/api/graphql/mutation/smart_fill.rb +13 -0
- data/lib/ecoportal/api/graphql/mutation/template/create.rb +39 -0
- data/lib/ecoportal/api/graphql/mutation/template/create_related_page.rb +46 -0
- data/lib/ecoportal/api/graphql/mutation/template/destroy_related_page.rb +43 -0
- data/lib/ecoportal/api/graphql/mutation/template/publish.rb +39 -0
- data/lib/ecoportal/api/graphql/mutation/template/unpublish.rb +39 -0
- data/lib/ecoportal/api/graphql/mutation/template/update.rb +43 -0
- data/lib/ecoportal/api/graphql/mutation/template/update_information.rb +43 -0
- data/lib/ecoportal/api/graphql/mutation/template.rb +18 -0
- data/lib/ecoportal/api/graphql/mutation.rb +20 -12
- data/lib/ecoportal/api/graphql/payload/ai_summary_generate.rb +12 -0
- data/lib/ecoportal/api/graphql/payload/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/payload/execute_workflow_commands.rb +36 -0
- data/lib/ecoportal/api/graphql/payload/force_commands.rb +31 -0
- data/lib/ecoportal/api/graphql/payload/kickstand/bulk_update_jobs.rb +36 -0
- data/lib/ecoportal/api/graphql/payload/kickstand/bulk_update_workflows.rb +36 -0
- data/lib/ecoportal/api/graphql/payload/kickstand/job.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/kickstand/workflow.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/kickstand.rb +15 -0
- data/lib/ecoportal/api/graphql/payload/location_structure/draft/create.rb +33 -34
- data/lib/ecoportal/api/graphql/payload/ok_payload.rb +36 -0
- data/lib/ecoportal/api/graphql/payload/page/archive.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/page/build_from_template.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/page/create_from_template.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/page/draft.rb +26 -0
- data/lib/ecoportal/api/graphql/payload/page/review_task.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/page/review_task_batch.rb +23 -0
- data/lib/ecoportal/api/graphql/payload/page/unarchive.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/page/update.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/page/update_variable_bindings.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/page.rb +20 -0
- data/lib/ecoportal/api/graphql/payload/preset_view.rb +15 -0
- data/lib/ecoportal/api/graphql/payload/register.rb +15 -0
- data/lib/ecoportal/api/graphql/payload/template/create.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/template/create_related_page.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/template/destroy_related_page.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/template/publish.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/template/unpublish.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/template/update.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/template/update_information.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/template.rb +18 -0
- data/lib/ecoportal/api/graphql/payload.rb +23 -12
- data/lib/ecoportal/api/graphql/query/action.rb +1 -1
- data/lib/ecoportal/api/graphql/query/action_categories.rb +1 -1
- data/lib/ecoportal/api/graphql/query/actions.rb +2 -2
- data/lib/ecoportal/api/graphql/query/contractor_entities.rb +1 -1
- data/lib/ecoportal/api/graphql/query/file_upload_signature.rb +76 -0
- data/lib/ecoportal/api/graphql/query/location_structure/draft.rb +62 -62
- data/lib/ecoportal/api/graphql/query/location_structure.rb +61 -61
- data/lib/ecoportal/api/graphql/query/location_structures.rb +57 -57
- data/lib/ecoportal/api/graphql/query/page.rb +45 -0
- data/lib/ecoportal/api/graphql/query/page_delta.rb +47 -0
- data/lib/ecoportal/api/graphql/query/page_with_forces.rb +49 -0
- data/lib/ecoportal/api/graphql/query/pages.rb +59 -0
- data/lib/ecoportal/api/graphql/query/pages_workflow_commands.rb +65 -0
- data/lib/ecoportal/api/graphql/query/register_preset_views.rb +78 -0
- data/lib/ecoportal/api/graphql/query/register_preview_pages.rb +83 -0
- data/lib/ecoportal/api/graphql/query/templates.rb +53 -0
- data/lib/ecoportal/api/graphql/query.rb +27 -16
- data/lib/ecoportal/api/graphql.rb +143 -80
- data/lib/ecoportal/api/graphql_version.rb +5 -5
- metadata +333 -25
- data/.gitignore +0 -24
- data/.markdownlint.json +0 -4
- data/.rspec +0 -3
- data/.rubocop.yml +0 -97
- data/.ruby-version +0 -1
- data/.yardopts +0 -10
- data/Gemfile +0 -6
- data/Rakefile +0 -38
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/bin/setup.ps1 +0 -6
- data/ecoportal-api-graphql.gemspec +0 -40
- 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/loc_structure_get.rb +0 -11
- data/tests/loc_structure_update.rb +0 -51
- data/tests/loc_structures_get.rb +0 -15
- data/tests/local_libs.rb +0 -20
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Compat
|
|
5
|
+
# v2-compatible registers API backed by GraphQL register search.
|
|
6
|
+
# Scripts call: apiv2.registers.search(register_id, options) { |result| ... }
|
|
7
|
+
#
|
|
8
|
+
# With a block: yields each PreviewPage result (cursor-paginated).
|
|
9
|
+
# Without a block (or only_first: true): returns a SearchResults object
|
|
10
|
+
# with .total and .total_before_filtering.
|
|
11
|
+
#
|
|
12
|
+
# Filter translation:
|
|
13
|
+
# v2 date_filter { lbound:, ubound: } → GraphQL date_filter { gte:, lte: }
|
|
14
|
+
# v2 tag_filter { tags:, mode: } → passed through (same ES backend)
|
|
15
|
+
# SearchConf filter objects → passed through directly
|
|
16
|
+
class Registers
|
|
17
|
+
def initialize(client)
|
|
18
|
+
@client = client
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Options:
|
|
22
|
+
# sort: 'created_at' | 'updated_at'
|
|
23
|
+
# dir: 'asc' | 'desc'
|
|
24
|
+
# query: String (full-text search)
|
|
25
|
+
# filters: Array of filter objects or v2 filter hashes
|
|
26
|
+
# batch_size: Integer (results per request, default 20)
|
|
27
|
+
# include_archived: Boolean (default false)
|
|
28
|
+
# only_first: Boolean — return after first page (no block needed)
|
|
29
|
+
def search(register_id, options = {}, &block)
|
|
30
|
+
conf = build_search_conf(options)
|
|
31
|
+
first = options.fetch(:batch_size, 20)
|
|
32
|
+
query = Query::RegisterPreviewPages.new(@client)
|
|
33
|
+
|
|
34
|
+
args = {
|
|
35
|
+
registerId: register_id,
|
|
36
|
+
searchConf: conf.to_h,
|
|
37
|
+
includeArchived: options.fetch(:include_archived, false),
|
|
38
|
+
first: first
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if block || !options[:only_first]
|
|
42
|
+
# Block mode: yield each result, stop if only_first
|
|
43
|
+
query.each(**args) do |result|
|
|
44
|
+
block&.call(result)
|
|
45
|
+
break if options[:only_first]
|
|
46
|
+
end
|
|
47
|
+
else
|
|
48
|
+
# No-block mode: return SearchResults with .total etc.
|
|
49
|
+
raw = query.query(**args)
|
|
50
|
+
SearchResults.new(raw)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
def build_search_conf(options)
|
|
57
|
+
conf = Input::SearchConf.new
|
|
58
|
+
|
|
59
|
+
if (sort_key = options[:sort])
|
|
60
|
+
direction = options.fetch(:dir, 'desc').to_sym
|
|
61
|
+
conf.sort(sort_key.to_sym, direction)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
conf.query(options[:query]) if options[:query]
|
|
65
|
+
|
|
66
|
+
Array(options[:filters]).compact.each do |filter|
|
|
67
|
+
conf.filter(translate_filter(filter))
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
conf
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Translates a v2-style filter hash to a GraphQL-compatible filter hash.
|
|
74
|
+
# SearchConf filter objects (respond to to_h and are not Hash) pass through.
|
|
75
|
+
# v2 date_filter: lbound/ubound → gte/lte
|
|
76
|
+
# Other v2 types (tag_filter etc.): passed through — same ES backend.
|
|
77
|
+
def translate_filter(filter)
|
|
78
|
+
FilterTranslator.to_graphql(filter)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Compat
|
|
5
|
+
# Wraps a GraphQL mutation payload to expose the v2-compatible response interface.
|
|
6
|
+
# Scripts check .success? and .status after update/create operations.
|
|
7
|
+
class Response
|
|
8
|
+
def initialize(payload)
|
|
9
|
+
@payload = payload
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def success?
|
|
13
|
+
@payload.success?
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def error?
|
|
17
|
+
@payload.error?
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def status
|
|
21
|
+
@payload.error? ? :error : :ok
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def body
|
|
25
|
+
@payload.error_doc
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def item
|
|
29
|
+
@payload.item
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Compat
|
|
5
|
+
# Wraps a GraphQL connection object to expose the v2-compatible search
|
|
6
|
+
# result interface. eco-helpers scripts access:
|
|
7
|
+
# search_results.total — filtered count
|
|
8
|
+
# search_results.total_before_filtering — pre-filter count (approximated)
|
|
9
|
+
# (also Enumerable for iteration)
|
|
10
|
+
class SearchResults
|
|
11
|
+
include Enumerable
|
|
12
|
+
|
|
13
|
+
attr_reader :total, :total_before_filtering
|
|
14
|
+
|
|
15
|
+
def initialize(connection)
|
|
16
|
+
@total = connection.totalCount
|
|
17
|
+
# GraphQL does not expose a pre-filter count — use the same value.
|
|
18
|
+
@total_before_filtering = connection.totalCount
|
|
19
|
+
@nodes = connection.nodes
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def each(&block)
|
|
23
|
+
@nodes.each(&block)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def empty?
|
|
27
|
+
@nodes.empty?
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Compat
|
|
5
|
+
# Wraps the stages array from a PhasedPage to expose the v2-compatible
|
|
6
|
+
# access patterns eco-helpers scripts rely on.
|
|
7
|
+
#
|
|
8
|
+
# Accepts either an array of Base::Page::Phased::Stage objects (the normal
|
|
9
|
+
# path via embeds_many) or raw stage hash docs (for direct construction in
|
|
10
|
+
# specs and legacy callers).
|
|
11
|
+
#
|
|
12
|
+
# v2 patterns supported:
|
|
13
|
+
# page.stages[id_or_name] — find stage by ID or name
|
|
14
|
+
# page.stages.get_by_name(name) — find stage by name
|
|
15
|
+
# page.stages.ordered — stages sorted by ordering
|
|
16
|
+
# page.stages.ordered.map(&:id) — map sorted stages to IDs
|
|
17
|
+
# page.stages.any? — whether the page has stages
|
|
18
|
+
# page.stages.each { |s| ... } — iterate stages
|
|
19
|
+
class StageCollection
|
|
20
|
+
include Enumerable
|
|
21
|
+
|
|
22
|
+
def initialize(stages_array)
|
|
23
|
+
@stages = Array(stages_array).map { |s| coerce_stage(s) }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Find a stage by ID or name (hash-style access matching v2 pattern).
|
|
27
|
+
def [](id_or_name)
|
|
28
|
+
return nil unless id_or_name
|
|
29
|
+
|
|
30
|
+
@stages.find { |s| s.id == id_or_name.to_s || s.name == id_or_name.to_s }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Find a stage by name (explicit v2 method).
|
|
34
|
+
def get_by_name(name)
|
|
35
|
+
return nil unless name
|
|
36
|
+
|
|
37
|
+
@stages.find { |s| s.name == name.to_s }
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Stages sorted by ordering (ascending).
|
|
41
|
+
def ordered
|
|
42
|
+
@stages.sort_by { |s| s.ordering.to_i }
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def each(&block)
|
|
46
|
+
@stages.each(&block)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def empty?
|
|
50
|
+
@stages.empty?
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def length
|
|
54
|
+
@stages.length
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
alias_method :size, :length
|
|
58
|
+
|
|
59
|
+
private
|
|
60
|
+
|
|
61
|
+
# Accept Base::Page::Phased::Stage model objects (from embeds_many) directly.
|
|
62
|
+
# Wrap raw hashes in a Stage model for backwards-compatible direct construction.
|
|
63
|
+
def coerce_stage(stage)
|
|
64
|
+
stage.is_a?(Hash) ? Base::Page::Phased::Stage.new(stage) : stage
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Compat
|
|
5
|
+
# Client-side stage-specific view over a full page.
|
|
6
|
+
# Returned by Compat::Pages#get when stage_id is provided.
|
|
7
|
+
#
|
|
8
|
+
# Mimics the v2 behaviour where pages.get(id, stage_id:) returns a page
|
|
9
|
+
# object showing only the specified stage's sections and components.
|
|
10
|
+
# All other page accessors (id, name, state, patchVer, as_update, etc.)
|
|
11
|
+
# delegate to the underlying full page.
|
|
12
|
+
#
|
|
13
|
+
# This allows eco-helpers stage iteration patterns to work unchanged:
|
|
14
|
+
# stage_view = graphql.pages.get(page_id, stage_id: stg.id)
|
|
15
|
+
# stage_view.sections.doc.each { |sec_doc| ... }
|
|
16
|
+
# stage_view.components.doc.each { |comp_doc| ... }
|
|
17
|
+
class StageView
|
|
18
|
+
def initialize(page, stage_id)
|
|
19
|
+
@page = page
|
|
20
|
+
@stage_id = stage_id
|
|
21
|
+
@stage = find_stage(page, stage_id)
|
|
22
|
+
# Record the targeted stage on the underlying page. The base OozeSamples loop
|
|
23
|
+
# enqueues and updates the FULL page (first-wins by id — the StageView is never
|
|
24
|
+
# the queued object), so a later submit!/sign_off! on that page must still know
|
|
25
|
+
# which stage was viewed. Pin the RESOLVED stage id (@stage&.id) so a name-based
|
|
26
|
+
# view ('Coding') records the id the mutation needs; fall back to the raw arg.
|
|
27
|
+
return unless @page.respond_to?(:_compat_active_stage_id=)
|
|
28
|
+
@page._compat_active_stage_id = @stage&.id || stage_id
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# The stage's sections only (not the full page's).
|
|
32
|
+
def sections
|
|
33
|
+
@stage&.sections || Base::Page::SectionCollection.from_doc([])
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# All data fields across the stage's sections (not the full page's).
|
|
37
|
+
def components
|
|
38
|
+
@stage&.components || Base::Page::DataField::Collection.from_doc([])
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# The ID of this stage view's stage.
|
|
42
|
+
def current_stage_id
|
|
43
|
+
@stage&.id
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Always true — this view is stage-specific.
|
|
47
|
+
def stages?
|
|
48
|
+
true
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Delegate all other accessors to the underlying full page.
|
|
52
|
+
def method_missing(method, *args, &block)
|
|
53
|
+
return @page.send(method, *args, &block) if @page.respond_to?(method)
|
|
54
|
+
|
|
55
|
+
super
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def respond_to_missing?(method, include_private = false)
|
|
59
|
+
@page.respond_to?(method, include_private) || super
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
private
|
|
63
|
+
|
|
64
|
+
def find_stage(page, stage_id)
|
|
65
|
+
return nil unless page.respond_to?(:stages)
|
|
66
|
+
|
|
67
|
+
stages = page.stages
|
|
68
|
+
return nil unless stages.respond_to?(:[])
|
|
69
|
+
|
|
70
|
+
stages[stage_id] || (stages.respond_to?(:get_by_name) ? stages.get_by_name(stage_id) : nil)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Compat
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
require_relative 'compat/filter_translator'
|
|
11
|
+
require_relative 'compat/stage_collection'
|
|
12
|
+
require_relative 'compat/search_results'
|
|
13
|
+
require_relative 'compat/page_reference'
|
|
14
|
+
require_relative 'compat/response'
|
|
15
|
+
require_relative 'compat/stage_view'
|
|
16
|
+
require_relative 'compat/pages'
|
|
17
|
+
require_relative 'compat/registers'
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Concerns
|
|
5
|
+
# Provides typed data field access on page models.
|
|
6
|
+
# Include in Interface::BasePage so all concrete page classes inherit it.
|
|
7
|
+
#
|
|
8
|
+
# Exposes:
|
|
9
|
+
# page.components — DataField::Collection (v2 compat alias for dataFields)
|
|
10
|
+
# page.field_collection — same, memoized
|
|
11
|
+
# page.data_fields_updates — [DataFieldInput, ...] for dirty fields
|
|
12
|
+
# page.data_fields_additions — [DataFieldInput, ...] for added fields
|
|
13
|
+
# page.data_fields_deletions — [field_id, ...] queued for deletion
|
|
14
|
+
module DataFieldAccess
|
|
15
|
+
# Returns a DataField::Collection wrapping raw dataFields from doc.
|
|
16
|
+
# Memoized — mutating a field object persists across calls.
|
|
17
|
+
def field_collection
|
|
18
|
+
@field_collection ||= Base::Page::DataField::Collection.from_doc(raw_data_fields)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# v2 compat alias — eco-helpers scripts call entry.components
|
|
22
|
+
def components
|
|
23
|
+
field_collection
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Returns a SectionCollection wrapping sections from doc.
|
|
27
|
+
# For BasicPage: doc['sections']. For PhasedPage: merged from stages (override in Phased).
|
|
28
|
+
def section_collection
|
|
29
|
+
@section_collection ||= Base::Page::SectionCollection.from_doc(raw_sections)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# v2 compat alias — eco-helpers scripts call entry.sections
|
|
33
|
+
def sections
|
|
34
|
+
section_collection
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns DataFieldInput hashes for modified existing fields (updates).
|
|
38
|
+
def data_fields_updates
|
|
39
|
+
field_collection.dirty_inputs
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns DataFieldInput hashes for newly added fields (via components.add).
|
|
43
|
+
def data_fields_additions
|
|
44
|
+
field_collection.dirty_additions
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns field IDs queued for deletion (via components.mark_for_deletion).
|
|
48
|
+
def data_fields_deletions
|
|
49
|
+
field_collection.dirty_deletions
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def data_fields_dirty?
|
|
53
|
+
field_collection.dirty?
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
private
|
|
57
|
+
|
|
58
|
+
# Override in subclasses if fields live elsewhere (e.g. nested in stages).
|
|
59
|
+
def raw_data_fields
|
|
60
|
+
doc['dataFields'] || []
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Override in subclasses for different section sources.
|
|
64
|
+
def raw_sections
|
|
65
|
+
doc['sections'] || []
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Concerns
|
|
5
|
+
module Deprecation
|
|
6
|
+
SCHEMA_VERSION = '20260605'.freeze
|
|
7
|
+
|
|
8
|
+
WARNED = Set.new
|
|
9
|
+
|
|
10
|
+
def self.warn_once(key, message)
|
|
11
|
+
return if WARNED.include?(key)
|
|
12
|
+
|
|
13
|
+
WARNED << key
|
|
14
|
+
warn "[ecoportal-api-graphql] DEPRECATED (#{key}): #{message}"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -3,7 +3,6 @@ module Ecoportal
|
|
|
3
3
|
class GraphQL
|
|
4
4
|
module Concerns
|
|
5
5
|
module FragmentDefinitions
|
|
6
|
-
|
|
7
6
|
class << self
|
|
8
7
|
private
|
|
9
8
|
|
|
@@ -24,6 +23,22 @@ module Ecoportal
|
|
|
24
23
|
def fragments
|
|
25
24
|
@fragments ||= {}
|
|
26
25
|
end
|
|
26
|
+
|
|
27
|
+
# Register a sub-namespace class whose fragments are visible via assemble.
|
|
28
|
+
def register_namespace(klass)
|
|
29
|
+
namespaces << klass
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def namespaces
|
|
33
|
+
@namespaces ||= []
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns concatenated fragment definition strings for the given symbols.
|
|
37
|
+
# Searches own fragments and all registered sub-namespaces.
|
|
38
|
+
def assemble(*syms)
|
|
39
|
+
all = namespaces.reduce(fragments.dup) { |h, ns| h.merge(ns.fragments) }
|
|
40
|
+
syms.map { |sym| all[sym] }.compact.join("\n\n")
|
|
41
|
+
end
|
|
27
42
|
end
|
|
28
43
|
|
|
29
44
|
module InstanceMethods
|
|
@@ -34,38 +49,16 @@ module Ecoportal
|
|
|
34
49
|
parse
|
|
35
50
|
end
|
|
36
51
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
without_warnings do
|
|
42
|
-
namespace.const_set(sym, fragment)
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
rescue ::GraphQL::Client::ValidationError, ::Graphlient::Errors::ClientError => err
|
|
46
|
-
raise err.class, "On fragment #{sym} -- #{err.message}", cause: nil
|
|
52
|
+
# Returns the raw fragment string for the given symbol.
|
|
53
|
+
# The namespace parameter is retained for API compatibility but has no effect.
|
|
54
|
+
def define(sym, heredoc, namespace: nil) # rubocop:disable Lint/UnusedMethodArgument
|
|
55
|
+
heredoc
|
|
47
56
|
end
|
|
48
57
|
|
|
49
58
|
private
|
|
50
59
|
|
|
51
|
-
def without_warnings
|
|
52
|
-
original_verbose = $VERBOSE
|
|
53
|
-
$VERBOSE = nil
|
|
54
|
-
|
|
55
|
-
yield if block_given?
|
|
56
|
-
ensure
|
|
57
|
-
$VERBOSE = original_verbose
|
|
58
|
-
end
|
|
59
|
-
|
|
60
60
|
def parse
|
|
61
|
-
@fragments = self.class.fragments.
|
|
62
|
-
each_with_object({}) do |(sym, heredoc), out|
|
|
63
|
-
out[sym] = define(
|
|
64
|
-
sym,
|
|
65
|
-
heredoc,
|
|
66
|
-
namespace: self.class
|
|
67
|
-
)
|
|
68
|
-
end
|
|
61
|
+
@fragments = self.class.fragments.dup
|
|
69
62
|
end
|
|
70
63
|
end
|
|
71
64
|
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Concerns
|
|
5
|
+
# v2-compatibility accessors for page model objects.
|
|
6
|
+
# Include in Interface::BasePage so all concrete page classes inherit them.
|
|
7
|
+
# These aliases allow eco-helpers scripts to work against GraphQL page models
|
|
8
|
+
# using the same method names they used with ecoportal-api-v2.
|
|
9
|
+
module PageCompat
|
|
10
|
+
# v2 called this externalId (camelCase) or external_id (snake_case)
|
|
11
|
+
def external_id
|
|
12
|
+
externalId
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# v2 called sourceTemplateId "template_id"
|
|
16
|
+
def template_id
|
|
17
|
+
sourceTemplateId
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# v2 compatibility: dataFields were called "components" in APIv2
|
|
21
|
+
def components
|
|
22
|
+
respond_to?(:dataFields) ? dataFields : []
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Whether the page has any stages (PhasedPage check)
|
|
26
|
+
def stages?
|
|
27
|
+
respond_to?(:stages) && !stages.nil? && !stages.empty?
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Clears dirty tracking — call after a successful update.
|
|
31
|
+
# Mirrors v2's ooze.consolidate! which resets the change baseline.
|
|
32
|
+
def consolidate!
|
|
33
|
+
@original_doc = doc.dup if respond_to?(:doc)
|
|
34
|
+
self
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# v2 validate stub — always returns nil (no client-side validation in GraphQL path).
|
|
38
|
+
# Server-side errors are returned in the mutation payload's errors field.
|
|
39
|
+
def validate
|
|
40
|
+
nil
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Dirty check — returns true if there are pending changes.
|
|
44
|
+
def dirty?
|
|
45
|
+
!as_update.nil?
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Concerns
|
|
5
|
+
# Provides snake_case access to camelCase methods on GraphQL model objects.
|
|
6
|
+
# eco-helpers scripts (and v2 models) use snake_case, GraphQL uses camelCase.
|
|
7
|
+
#
|
|
8
|
+
# Converts any snake_case method call to its camelCase equivalent and delegates.
|
|
9
|
+
# Works for both readers (external_id → externalId) and writers (time_zone= → timeZone=).
|
|
10
|
+
#
|
|
11
|
+
# Examples:
|
|
12
|
+
# page.external_id → page.externalId
|
|
13
|
+
# page.patch_ver → page.patchVer
|
|
14
|
+
# page.source_template_id → page.sourceTemplateId
|
|
15
|
+
# page.other_tags = ['x'] → page.otherTags = ['x']
|
|
16
|
+
module SnakeCamelAccess
|
|
17
|
+
def method_missing(method_name, *args, &block)
|
|
18
|
+
str = method_name.to_s
|
|
19
|
+
setter = str.end_with?('=')
|
|
20
|
+
base = setter ? str[0..-2] : str
|
|
21
|
+
camel = snake_to_camel(base)
|
|
22
|
+
|
|
23
|
+
# Only intercept if conversion actually changed something and target exists
|
|
24
|
+
if camel != base
|
|
25
|
+
target = setter ? :"#{camel}=" : camel.to_sym
|
|
26
|
+
return send(target, *args, &block) if respond_to?(target)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
super
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def respond_to_missing?(method_name, include_private = false)
|
|
33
|
+
str = method_name.to_s
|
|
34
|
+
setter = str.end_with?('=')
|
|
35
|
+
base = setter ? str[0..-2] : str
|
|
36
|
+
camel = snake_to_camel(base)
|
|
37
|
+
|
|
38
|
+
if camel != base
|
|
39
|
+
target = setter ? :"#{camel}=" : camel.to_sym
|
|
40
|
+
return true if respond_to?(target, include_private)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
super
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
# Convert snake_case to lowerCamelCase.
|
|
49
|
+
# external_id → externalId, source_template_id → sourceTemplateId
|
|
50
|
+
def snake_to_camel(snake_str)
|
|
51
|
+
parts = snake_str.split('_')
|
|
52
|
+
return snake_str if parts.length < 2
|
|
53
|
+
|
|
54
|
+
parts[0] + parts[1..].map(&:capitalize).join
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
module Ecoportal
|
|
2
|
-
module API
|
|
3
|
-
class GraphQL
|
|
4
|
-
module Concerns
|
|
5
|
-
end
|
|
6
|
-
end
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
require_relative 'concerns/
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Concerns
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
require_relative 'concerns/deprecation'
|
|
11
|
+
require_relative 'concerns/fragment_definitions'
|
|
12
|
+
require_relative 'concerns/snake_camel_access'
|
|
13
|
+
require_relative 'concerns/page_compat'
|
|
14
|
+
require_relative 'concerns/data_field_access'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
module Ecoportal
|
|
2
|
-
module API
|
|
3
|
-
class GraphQL
|
|
4
|
-
module Connection
|
|
5
|
-
class Action < Logic::Connection
|
|
6
|
-
class_resolver :node_class, Model::Action
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Connection
|
|
5
|
+
class Action < Logic::Connection
|
|
6
|
+
class_resolver :node_class, Model::Action
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
module Ecoportal
|
|
2
|
-
module API
|
|
3
|
-
class GraphQL
|
|
4
|
-
module Connection
|
|
5
|
-
class ActionCategory < Logic::Connection
|
|
6
|
-
class_resolver :node_class, Base::ActionCategory
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Connection
|
|
5
|
+
class ActionCategory < Logic::Connection
|
|
6
|
+
class_resolver :node_class, Base::ActionCategory
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|