ecoportal-api-graphql 1.3.17 → 2.2.1

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 (177) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +763 -11
  3. data/lib/ecoportal/api/common/graphql/http_client.rb +85 -2
  4. data/lib/ecoportal/api/common/graphql/model/diffable/leaf_diff_service.rb +97 -0
  5. data/lib/ecoportal/api/common/graphql/model/diffable.rb +1 -0
  6. data/lib/ecoportal/api/graphql/base/action.rb +1 -1
  7. data/lib/ecoportal/api/graphql/base/action_event.rb +23 -0
  8. data/lib/ecoportal/api/graphql/base/action_event_page.rb +16 -0
  9. data/lib/ecoportal/api/graphql/base/activity.rb +38 -0
  10. data/lib/ecoportal/api/graphql/base/activity_log.rb +38 -0
  11. data/lib/ecoportal/api/graphql/base/ai_summary_version.rb +12 -7
  12. data/lib/ecoportal/api/graphql/base/auth_log.rb +24 -0
  13. data/lib/ecoportal/api/graphql/base/authorization_result.rb +20 -0
  14. data/lib/ecoportal/api/graphql/base/contractor_entity/member_changes.rb +17 -5
  15. data/lib/ecoportal/api/graphql/base/file_container.rb +12 -4
  16. data/lib/ecoportal/api/graphql/base/location_classification_type.rb +2 -0
  17. data/lib/ecoportal/api/graphql/base/location_structure.rb +3 -0
  18. data/lib/ecoportal/api/graphql/base/minimal_dashboard.rb +25 -0
  19. data/lib/ecoportal/api/graphql/base/organization.rb +2 -0
  20. data/lib/ecoportal/api/graphql/base/page/data_field/contractor_entities.rb +25 -2
  21. data/lib/ecoportal/api/graphql/base/page/data_field/file_field.rb +46 -7
  22. data/lib/ecoportal/api/graphql/base/page/data_field/image_gallery.rb +5 -2
  23. data/lib/ecoportal/api/graphql/base/page/data_field/people.rb +50 -12
  24. data/lib/ecoportal/api/graphql/base/page/data_field.rb +12 -18
  25. data/lib/ecoportal/api/graphql/base/page/phased/stage.rb +51 -0
  26. data/lib/ecoportal/api/graphql/base/permissions.rb +15 -0
  27. data/lib/ecoportal/api/graphql/base/person_member_changelog.rb +23 -0
  28. data/lib/ecoportal/api/graphql/base/preset_view.rb +135 -0
  29. data/lib/ecoportal/api/graphql/base/register.rb +5 -0
  30. data/lib/ecoportal/api/graphql/base/template/change_log_entry.rb +118 -0
  31. data/lib/ecoportal/api/graphql/base/template.rb +2 -0
  32. data/lib/ecoportal/api/graphql/base.rb +9 -0
  33. data/lib/ecoportal/api/graphql/builder/contractor_entity.rb +10 -0
  34. data/lib/ecoportal/api/graphql/builder/page.rb +0 -16
  35. data/lib/ecoportal/api/graphql/builder/template.rb +46 -0
  36. data/lib/ecoportal/api/graphql/builder/template_builder.rb +21 -2
  37. data/lib/ecoportal/api/graphql/compat/pages.rb +7 -2
  38. data/lib/ecoportal/api/graphql/compat/response.rb +14 -0
  39. data/lib/ecoportal/api/graphql/concerns/threadable.rb +58 -0
  40. data/lib/ecoportal/api/graphql/concerns.rb +1 -0
  41. data/lib/ecoportal/api/graphql/connection/action.rb +1 -1
  42. data/lib/ecoportal/api/graphql/connection/action_category.rb +1 -1
  43. data/lib/ecoportal/api/graphql/connection/activity.rb +11 -0
  44. data/lib/ecoportal/api/graphql/connection/activity_log.rb +11 -0
  45. data/lib/ecoportal/api/graphql/connection/auth_log.rb +11 -0
  46. data/lib/ecoportal/api/graphql/connection/contractor_entity.rb +1 -1
  47. data/lib/ecoportal/api/graphql/connection/minimal_dashboard.rb +11 -0
  48. data/lib/ecoportal/api/graphql/connection/page.rb +1 -1
  49. data/lib/ecoportal/api/graphql/connection/pages_workflow_command.rb +1 -1
  50. data/lib/ecoportal/api/graphql/connection/person_member.rb +1 -1
  51. data/lib/ecoportal/api/graphql/connection/person_member_changelog.rb +11 -0
  52. data/lib/ecoportal/api/graphql/connection/preview_page.rb +1 -1
  53. data/lib/ecoportal/api/graphql/connection/template_change_log.rb +19 -0
  54. data/lib/ecoportal/api/graphql/connection.rb +6 -0
  55. data/lib/ecoportal/api/graphql/diff/change.rb +7 -2
  56. data/lib/ecoportal/api/graphql/diff/command_synthesizer.rb +19 -1
  57. data/lib/ecoportal/api/graphql/diff/pairing/signals.rb +21 -1
  58. data/lib/ecoportal/api/graphql/diff/version_diff.rb +13 -6
  59. data/lib/ecoportal/api/graphql/file_upload/client.rb +198 -139
  60. data/lib/ecoportal/api/graphql/fragment/activity.rb +84 -0
  61. data/lib/ecoportal/api/graphql/fragment/activity_log.rb +75 -0
  62. data/lib/ecoportal/api/graphql/fragment/auth_log.rb +29 -0
  63. data/lib/ecoportal/api/graphql/fragment/authorization_result.rb +14 -0
  64. data/lib/ecoportal/api/graphql/fragment/location_node.rb +1 -0
  65. data/lib/ecoportal/api/graphql/fragment/minimal_dashboard.rb +31 -0
  66. data/lib/ecoportal/api/graphql/fragment/page.rb +1 -0
  67. data/lib/ecoportal/api/graphql/fragment/pages/common_page_union.rb +23 -0
  68. data/lib/ecoportal/api/graphql/fragment/permissions.rb +96 -0
  69. data/lib/ecoportal/api/graphql/fragment/person_member_changelog.rb +33 -0
  70. data/lib/ecoportal/api/graphql/fragment/template_change_log.rb +102 -0
  71. data/lib/ecoportal/api/graphql/fragment.rb +8 -0
  72. data/lib/ecoportal/api/graphql/input/action/update.rb +12 -0
  73. data/lib/ecoportal/api/graphql/input/contractor_entity/manager_settings.rb +20 -0
  74. data/lib/ecoportal/api/graphql/input/contractor_entity/update.rb +6 -27
  75. data/lib/ecoportal/api/graphql/input/contractor_entity.rb +1 -0
  76. data/lib/ecoportal/api/graphql/input/date_range.rb +16 -0
  77. data/lib/ecoportal/api/graphql/input/location_structure/apply_commands.rb +2 -2
  78. data/lib/ecoportal/api/graphql/input/location_structure/draft/add_commands.rb +2 -2
  79. data/lib/ecoportal/api/graphql/input/location_structure/insert_command.rb +8 -0
  80. data/lib/ecoportal/api/graphql/input/location_structure/update_command.rb +6 -2
  81. data/lib/ecoportal/api/graphql/input/page/review_task.rb +14 -1
  82. data/lib/ecoportal/api/graphql/input/preset_view/update.rb +16 -1
  83. data/lib/ecoportal/api/graphql/input/workflow_command/add_checklist_field_item.rb +19 -0
  84. data/lib/ecoportal/api/graphql/input/workflow_command/add_field.rb +10 -9
  85. data/lib/ecoportal/api/graphql/input/workflow_command/add_select_field_option.rb +11 -5
  86. data/lib/ecoportal/api/graphql/input/workflow_command/add_smart_fill_config.rb +23 -0
  87. data/lib/ecoportal/api/graphql/input/workflow_command/add_stage.rb +3 -2
  88. data/lib/ecoportal/api/graphql/input/workflow_command/add_viewable_field.rb +45 -0
  89. data/lib/ecoportal/api/graphql/input/workflow_command/archive_public_config.rb +19 -0
  90. data/lib/ecoportal/api/graphql/input/workflow_command/create_public_config.rb +19 -0
  91. data/lib/ecoportal/api/graphql/input/workflow_command/edit_checklist_field_item.rb +19 -0
  92. data/lib/ecoportal/api/graphql/input/workflow_command/edit_field_configuration.rb +17 -2
  93. data/lib/ecoportal/api/graphql/input/workflow_command/edit_force.rb +5 -2
  94. data/lib/ecoportal/api/graphql/input/workflow_command/edit_public_config.rb +19 -0
  95. data/lib/ecoportal/api/graphql/input/workflow_command/edit_select_field_option.rb +6 -2
  96. data/lib/ecoportal/api/graphql/input/workflow_command/edit_smart_fill_config.rb +21 -0
  97. data/lib/ecoportal/api/graphql/input/workflow_command/edit_template_advanced_settings.rb +19 -0
  98. data/lib/ecoportal/api/graphql/input/workflow_command/edit_template_basic_settings.rb +32 -0
  99. data/lib/ecoportal/api/graphql/input/workflow_command/edit_template_container_uid.rb +45 -0
  100. data/lib/ecoportal/api/graphql/input/workflow_command/{edit_page_creator_permissions.rb → edit_template_creator_permissions.rb} +3 -2
  101. data/lib/ecoportal/api/graphql/input/workflow_command/edit_template_descriptions.rb +19 -0
  102. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/action_list.rb +31 -0
  103. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/contractor_entities.rb +6 -2
  104. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/cross_reference.rb +9 -1
  105. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/date.rb +15 -2
  106. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/file.rb +21 -0
  107. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/image_gallery.rb +3 -2
  108. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/people.rb +27 -3
  109. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/plain_text.rb +9 -2
  110. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/rich_text.rb +3 -2
  111. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/select.rb +3 -2
  112. data/lib/ecoportal/api/graphql/input/workflow_command/manage_copy_page_configuration.rb +47 -0
  113. data/lib/ecoportal/api/graphql/input/workflow_command/move_field.rb +3 -2
  114. data/lib/ecoportal/api/graphql/input/workflow_command/move_section_to_stage.rb +33 -0
  115. data/lib/ecoportal/api/graphql/input/workflow_command/move_viewable_field.rb +33 -0
  116. data/lib/ecoportal/api/graphql/input/workflow_command/remove_checklist_field_item.rb +19 -0
  117. data/lib/ecoportal/api/graphql/input/workflow_command/remove_smart_fill_config.rb +19 -0
  118. data/lib/ecoportal/api/graphql/input/workflow_command/remove_viewable_field.rb +21 -0
  119. data/lib/ecoportal/api/graphql/input/workflow_command/reorder_forces.rb +3 -2
  120. data/lib/ecoportal/api/graphql/input/workflow_command/reorder_section.rb +3 -2
  121. data/lib/ecoportal/api/graphql/input/workflow_command.rb +48 -5
  122. data/lib/ecoportal/api/graphql/input.rb +1 -0
  123. data/lib/ecoportal/api/graphql/interface/base_page.rb +50 -3
  124. data/lib/ecoportal/api/graphql/interface/location_structure/command.rb +2 -1
  125. data/lib/ecoportal/api/graphql/logic/base_query.rb +72 -5
  126. data/lib/ecoportal/api/graphql/logic/connection.rb +17 -0
  127. data/lib/ecoportal/api/graphql/logic/input.rb +127 -0
  128. data/lib/ecoportal/api/graphql/model/action_event.rb +14 -0
  129. data/lib/ecoportal/api/graphql/model/action_event_page.rb +10 -0
  130. data/lib/ecoportal/api/graphql/model/activity.rb +14 -0
  131. data/lib/ecoportal/api/graphql/model/activity_log.rb +31 -0
  132. data/lib/ecoportal/api/graphql/model/auth_log.rb +11 -0
  133. data/lib/ecoportal/api/graphql/model/authorization_result.rb +12 -0
  134. data/lib/ecoportal/api/graphql/model/minimal_dashboard.rb +14 -0
  135. data/lib/ecoportal/api/graphql/model/organization.rb +36 -0
  136. data/lib/ecoportal/api/graphql/model/page/phased.rb +17 -0
  137. data/lib/ecoportal/api/graphql/model/permissions.rb +185 -0
  138. data/lib/ecoportal/api/graphql/model/person_member.rb +7 -0
  139. data/lib/ecoportal/api/graphql/model/person_member_changelog.rb +15 -0
  140. data/lib/ecoportal/api/graphql/model/template/change_log_entry.rb +19 -0
  141. data/lib/ecoportal/api/graphql/model/template.rb +4 -1
  142. data/lib/ecoportal/api/graphql/model.rb +9 -0
  143. data/lib/ecoportal/api/graphql/mutation/ai_summary/generate.rb +20 -10
  144. data/lib/ecoportal/api/graphql/mutation/ai_summary/submit_feedback.rb +25 -10
  145. data/lib/ecoportal/api/graphql/mutation/contractor_entity/update_manager_settings.rb +37 -0
  146. data/lib/ecoportal/api/graphql/mutation/contractor_entity.rb +1 -0
  147. data/lib/ecoportal/api/graphql/mutation/file_container/upload.rb +78 -0
  148. data/lib/ecoportal/api/graphql/mutation/file_container.rb +15 -0
  149. data/lib/ecoportal/api/graphql/mutation/template/update_related_page.rb +79 -0
  150. data/lib/ecoportal/api/graphql/mutation/template.rb +1 -0
  151. data/lib/ecoportal/api/graphql/mutation.rb +1 -1
  152. data/lib/ecoportal/api/graphql/payload/contractor_entity/manager_settings.rb +20 -0
  153. data/lib/ecoportal/api/graphql/payload/contractor_entity.rb +1 -0
  154. data/lib/ecoportal/api/graphql/payload/kickstand/bulk_update_jobs.rb +2 -2
  155. data/lib/ecoportal/api/graphql/payload/kickstand/bulk_update_workflows.rb +2 -2
  156. data/lib/ecoportal/api/graphql/payload/template/update_related_page.rb +15 -0
  157. data/lib/ecoportal/api/graphql/payload/template.rb +1 -0
  158. data/lib/ecoportal/api/graphql/payload/upload.rb +12 -0
  159. data/lib/ecoportal/api/graphql/payload.rb +1 -0
  160. data/lib/ecoportal/api/graphql/query/activity_logs.rb +78 -0
  161. data/lib/ecoportal/api/graphql/query/auth_logs.rb +51 -0
  162. data/lib/ecoportal/api/graphql/query/dashboard_search.rb +57 -0
  163. data/lib/ecoportal/api/graphql/query/location_structure.rb +2 -0
  164. data/lib/ecoportal/api/graphql/query/location_structures.rb +2 -0
  165. data/lib/ecoportal/api/graphql/query/page.rb +6 -1
  166. data/lib/ecoportal/api/graphql/query/page_activities.rb +56 -0
  167. data/lib/ecoportal/api/graphql/query/permissions.rb +35 -0
  168. data/lib/ecoportal/api/graphql/query/person_member_changelogs.rb +53 -0
  169. data/lib/ecoportal/api/graphql/query/person_members.rb +76 -0
  170. data/lib/ecoportal/api/graphql/query/template_change_log.rb +118 -0
  171. data/lib/ecoportal/api/graphql/query.rb +8 -0
  172. data/lib/ecoportal/api/graphql_version.rb +1 -1
  173. metadata +83 -14
  174. data/lib/ecoportal/api/graphql/input/workflow_command/edit_page.rb +0 -28
  175. data/lib/ecoportal/api/graphql/mutation/smart_fill/generate.rb +0 -36
  176. data/lib/ecoportal/api/graphql/mutation/smart_fill/submit_feedback.rb +0 -40
  177. data/lib/ecoportal/api/graphql/mutation/smart_fill.rb +0 -13
@@ -0,0 +1,31 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Model
5
+ # Concrete read model for a System Access Log entry. Adds the relational
6
+ # embeds on top of the common union fields in Base::ActivityLog.
7
+ #
8
+ # `parentResource*` and `resource` are present only on the Dashboard* union
9
+ # members (DashboardAccess/Create/Delete/Update, DeniedDashboardAccess);
10
+ # they are nullable here so page/file/scim members resolve cleanly.
11
+ class ActivityLog < Base::ActivityLog
12
+ # Lightweight wrapper for the union members' `resource { isVisible }` selection.
13
+ # Defined before the embeds_one below that references it.
14
+ class Resource < Logic::BaseModel
15
+ read_only!
16
+
17
+ passthrough :__typename
18
+ embeds_one :isVisible, klass: Model::AuthorizationResult, nullable: true
19
+ end
20
+
21
+ passthrough :parentResourceId, :parentResourceName, :parentResourceType
22
+
23
+ embeds_one :user, klass: Model::User, nullable: true
24
+ # resource: only `isVisible: AuthorizationResult` is selected (the web
25
+ # feature's shape); the full Dashboard subtree is not modelled here.
26
+ embeds_one :resource, klass: Model::ActivityLog::Resource, nullable: true
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,11 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Model
5
+ class AuthLog < Base::AuthLog
6
+ embeds_one :targetUser, klass: Model::User
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Model
5
+ # Concrete model for a permission-check result. No extra wiring today; exists so
6
+ # `canXXX` fields embed `Model::AuthorizationResult` (and can grow a `reasons` model later).
7
+ class AuthorizationResult < Base::AuthorizationResult
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Model
5
+ class MinimalDashboard < Base::MinimalDashboard
6
+ # owner: MinimalUser (id/email/name) — modelled with the User model.
7
+ embeds_one :owner, klass: Model::User
8
+ # register: MinimalRegister — Model::Register's read fields are a compatible superset.
9
+ embeds_one :register, klass: Model::Register
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -7,6 +7,13 @@ module Ecoportal
7
7
  class Organization < Base::Organization
8
8
  DEFAULT_PATH = ['currentOrganization'].freeze
9
9
 
10
+ # permissions: Permissions! — the org-level canXXX ability set (~83 AuthorizationResult
11
+ # fields, e.g. dashboardCanManage, locationStructuresCanAiGenerateStructure,
12
+ # generatedPageFilterCanUseSmartQuery). Typed read when a fetched doc includes it;
13
+ # fetch natively via the `permissions` query below.
14
+ embeds_one :permissions,
15
+ klass: "Ecoportal::API::GraphQL::Model::Permissions", nullable: true
16
+
10
17
  class << self
11
18
  extend Ecoportal::API::Common::GraphQL::QueryIntegration
12
19
 
@@ -29,6 +36,35 @@ module Ecoportal
29
36
 
30
37
  query :contractorEntities,
31
38
  query_klass: 'Ecoportal::API::GraphQL::Query::ContractorEntities'
39
+ # System access logs (SCIM/security auditing) — AuthLogConnection
40
+ query :authLogs,
41
+ query_klass: 'Ecoportal::API::GraphQL::Query::AuthLogs'
42
+ # Org-level permission set (canXXX abilities) — Permissions
43
+ query :permissions,
44
+ query_klass: 'Ecoportal::API::GraphQL::Query::Permissions'
45
+ # System Access Logs feature — ActivityLogUnionConnection (rich filters:
46
+ # userIds/resourceIds/filterSuperusers/activityType/resourceType/source/dateFilter)
47
+ query :activityLogs,
48
+ query_klass: 'Ecoportal::API::GraphQL::Query::ActivityLogs'
49
+ # Page history / activity feed — ActivityInterfaceConnection.
50
+ # Resolves currentOrganization.page(id:).activities; pass `id:` (page id).
51
+ # ★ `subpath: 'page'` is REQUIRED. `QueryIntegration#query` always injects
52
+ # `base_path: path + [subpath]` into the query instance, and
53
+ # `BaseQuery#initialize` takes that keyword in preference to the class-level
54
+ # `base_path` declaration — so `Query::PageActivities`' own
55
+ # `base_path 'currentOrganization.page'` is overridden, not honoured. Without
56
+ # the subpath the response is dug at `currentOrganization.activities`, a path
57
+ # the emitted document never contains (the inline-fragment `activities` merges
58
+ # into `page`), and every call returns empty.
59
+ query :pageActivities,
60
+ subpath: 'page',
61
+ query_klass: 'Ecoportal::API::GraphQL::Query::PageActivities'
62
+ # Person member changelog history — PersonMemberChangelogConnection
63
+ query :personMemberChangelogs,
64
+ query_klass: 'Ecoportal::API::GraphQL::Query::PersonMemberChangelogs'
65
+ # Dashboard search — MinimalDashboardConnection
66
+ query :dashboardSearch,
67
+ query_klass: 'Ecoportal::API::GraphQL::Query::DashboardSearch'
32
68
  #contractorEntity,
33
69
  query :actionCategories,
34
70
  query_klass: 'Ecoportal::API::GraphQL::Query::ActionCategories'
@@ -24,6 +24,8 @@ module Ecoportal
24
24
  embedded = super
25
25
  # Share the page's canonical field objects with each stage, so mutations made
26
26
  # via stage.components reach the page's data_fields_updates (phased write-path).
27
+ # NOTE: no manual `page` back-ref injection — Stage#page resolves the owning page
28
+ # via the DoubleModel's native `root` reference (page -> stages collection -> stage).
27
29
  fc = field_collection
28
30
  Array(embedded).each do |st|
29
31
  st.page_field_collection = fc if st.respond_to?(:page_field_collection=)
@@ -31,6 +33,21 @@ module Ecoportal
31
33
  Compat::StageCollection.new(embedded)
32
34
  end
33
35
 
36
+ # Page-level compiled tag set (client-side build of the backend-only
37
+ # "compiled_tags"), per the domain formula:
38
+ #
39
+ # Page.all_tags = Unique(⋃ all stages' all_tags)
40
+ #
41
+ # De-duplicated Array of tag strings across every stage. A phased page with no
42
+ # stages falls back to the page-level components (baseTags + otherTags +
43
+ # location_ids), matching the basic-page behaviour on Interface::BasePage.
44
+ def all_tags
45
+ stgs = Array(stages)
46
+ return super if stgs.empty?
47
+
48
+ stgs.flat_map(&:all_tags).compact.uniq
49
+ end
50
+
34
51
  # v2 compatible: ID of the stage with state == 'inprogress', or nil
35
52
  def current_stage_id
36
53
  raw = doc['stagesIndex'] || doc['stages']
@@ -0,0 +1,185 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Model
5
+ # Org-level permission set (Organization.permissions). Each `canXXX` field is an
6
+ # AuthorizationResult (`{ value message }`); all are non-null in the schema but modelled
7
+ # nullable so a partial selection (fetching only some canXXX) still reads cleanly.
8
+ class Permissions < Base::Permissions
9
+ embeds_one :actionCanCreateStandalone,
10
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
11
+ embeds_one :actionCanIndex,
12
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
13
+ embeds_one :alertNotificationCanAccessBroadcastNotifications,
14
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
15
+ embeds_one :alertNotificationCanCreate,
16
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
17
+ embeds_one :alertNotificationCanIndex,
18
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
19
+ embeds_one :canAccessAdminTools,
20
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
21
+ embeds_one :canAccessPeopleManager,
22
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
23
+ embeds_one :canDeleteActionCategories,
24
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
25
+ embeds_one :canIndex,
26
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
27
+ embeds_one :canListAttachablePersonMembers,
28
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
29
+ embeds_one :canManageActionCategories,
30
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
31
+ embeds_one :canManageStandaloneActionsPermissions,
32
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
33
+ embeds_one :canResetActionsCounter,
34
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
35
+ embeds_one :canUpload,
36
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
37
+ embeds_one :contractorEntityCanAccessContractorManager,
38
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
39
+ embeds_one :contractorEntityCanAttach,
40
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
41
+ embeds_one :contractorEntityCanCreate,
42
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
43
+ embeds_one :contractorEntityCanDestroy,
44
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
45
+ embeds_one :contractorEntityCanEdit,
46
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
47
+ embeds_one :contractorEntityCanEditLinkedUsers,
48
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
49
+ embeds_one :contractorEntityCanIndex,
50
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
51
+ embeds_one :contractorEntityCanManageParentContractors,
52
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
53
+ embeds_one :contractorEntityCanManageSubcontractors,
54
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
55
+ embeds_one :crossReferenceReportsCanIndex,
56
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
57
+ embeds_one :dashboardCanManage,
58
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
59
+ embeds_one :dataSetsCanIndex,
60
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
61
+ embeds_one :dataSpaceCanShow,
62
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
63
+ embeds_one :dataViewsCanIndex,
64
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
65
+ embeds_one :emailReportCanConfigureSmartReport,
66
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
67
+ embeds_one :filesCanIndex,
68
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
69
+ embeds_one :filesCanUpload,
70
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
71
+ embeds_one :generatedPageFilterCanCreate,
72
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
73
+ embeds_one :generatedPageFilterCanUseSmartQuery,
74
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
75
+ embeds_one :hasFileAbilityToDownload,
76
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
77
+ embeds_one :locationClassificationsCanCreate,
78
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
79
+ embeds_one :locationClassificationsCanUpdate,
80
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
81
+ embeds_one :locationStructuresCanAccess,
82
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
83
+ embeds_one :locationStructuresCanAdministrate,
84
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
85
+ embeds_one :locationStructuresCanAiGenerateStructure,
86
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
87
+ embeds_one :locationStructuresCanCreate,
88
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
89
+ embeds_one :locationStructuresCanManage,
90
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
91
+ embeds_one :locationStructuresCanManageSftpIntegration,
92
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
93
+ embeds_one :locationStructuresCanPublish,
94
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
95
+ embeds_one :locationStructuresCanRead,
96
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
97
+ embeds_one :locationStructuresCanScheduleUpdate,
98
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
99
+ embeds_one :locationStructuresCanUpdate,
100
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
101
+ embeds_one :organizationCanViewSettings,
102
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
103
+ embeds_one :pageAiSummaryCanAccess,
104
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
105
+ embeds_one :pageCanListDrafts,
106
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
107
+ embeds_one :pageCanRestore,
108
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
109
+ embeds_one :pageCanUseDrafts,
110
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
111
+ # DEPRECATED (20260929): removed from the live schema by the smart-assistant
112
+ # consolidation; no longer selected by Fragment::Permissions, so always nil. Kept so
113
+ # callers get nil instead of NoMethodError.
114
+ embeds_one :pageSmartAssistantCanChat,
115
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
116
+ embeds_one :personSchemaCanAccessManager,
117
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
118
+ embeds_one :publicTemplatesCanCopyLink,
119
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
120
+ embeds_one :publicTemplatesCanIndex,
121
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
122
+ embeds_one :publicTemplatesCanListEntries,
123
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
124
+ embeds_one :publicTemplatesCanManage,
125
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
126
+ # DEPRECATED (20260929): removed from the live schema by the smart-assistant
127
+ # consolidation; no longer selected by Fragment::Permissions, so always nil. Kept so
128
+ # callers get nil instead of NoMethodError.
129
+ embeds_one :registerAssistantCanChat,
130
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
131
+ embeds_one :registerCanAccessRegisterTools,
132
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
133
+ embeds_one :registerCanCreate,
134
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
135
+ embeds_one :registerCanLimitTemplates,
136
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
137
+ embeds_one :scimIntegrationCanAddCodeHooks,
138
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
139
+ embeds_one :scimIntegrationCanCreate,
140
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
141
+ embeds_one :scimIntegrationCanDestroy,
142
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
143
+ embeds_one :scimIntegrationCanGenerateApiKey,
144
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
145
+ embeds_one :scimIntegrationCanIndex,
146
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
147
+ embeds_one :scimIntegrationCanShow,
148
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
149
+ embeds_one :scimIntegrationCanShowLogs,
150
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
151
+ embeds_one :scimIntegrationCanUpdate,
152
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
153
+ embeds_one :spatialCanUpdateLocationNodeGeojson,
154
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
155
+ embeds_one :structuresCanIndex,
156
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
157
+ embeds_one :templateCanRestore,
158
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
159
+ embeds_one :userAccessLogsCanShow,
160
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
161
+ embeds_one :userCanAccessAdminArea,
162
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
163
+ embeds_one :userCanAccessPageCreationTools,
164
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
165
+ embeds_one :visitorLogCanAdminCheckIn,
166
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
167
+ embeds_one :visitorLogCanEdit,
168
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
169
+ embeds_one :visitorLogCanManage,
170
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
171
+ embeds_one :visitorLogCanShow,
172
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
173
+ embeds_one :visitorManagementCanAccessVisitorManager,
174
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
175
+ embeds_one :visitorManagementCanIndex,
176
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
177
+ embeds_one :webhooksCanManageSubscriptions,
178
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
179
+ embeds_one :webhooksCanViewSubscriptions,
180
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
181
+ end
182
+ end
183
+ end
184
+ end
185
+ end
@@ -6,6 +6,13 @@ module Ecoportal
6
6
  embeds_one :contractorOrganization, klass: "Ecoportal::API::GraphQL::Model::ContractorEntity"
7
7
  embeds_one :account, klass: Model::Account
8
8
 
9
+ # changelogs: [PersonMemberChangelog!] — audit history for this member.
10
+ embeds_many :changelogs, klass: "Ecoportal::API::GraphQL::Model::PersonMemberChangelog"
11
+
12
+ # canManageContractorAdmins: AuthorizationResult — permission check (nullable).
13
+ embeds_one :canManageContractorAdmins,
14
+ klass: "Ecoportal::API::GraphQL::Model::AuthorizationResult", nullable: true
15
+
9
16
  # embeds_many :privateFields, enum_class: Ecoportal::API::GraphQL::Model::MemberSchemaFields
10
17
  # embeds_many :publicFields, enum_class: Ecoportal::API::GraphQL::Model::MemberSchemaFields
11
18
  end
@@ -0,0 +1,15 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Model
5
+ class PersonMemberChangelog < Base::PersonMemberChangelog
6
+ # `personMember` is a PreviewPersonMember (id/name/email) — modelled with the
7
+ # PersonMember model, whose read fields are a compatible superset.
8
+ embeds_one :personMember, klass: Model::PersonMember
9
+ # `user` is a MinimalUser (id/email/name) — modelled with the User model.
10
+ embeds_one :user, klass: Model::User
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Model
5
+ module Template
6
+ # Concrete read model for one entry of a template's change log. Adds the relational
7
+ # embed on top of the interface fields modelled in `Base::Template::ChangeLogEntry`
8
+ # (which is where the platform caveats are documented — read them before using this).
9
+ class ChangeLogEntry < Base::Template::ChangeLogEntry
10
+ # `owner` is a `UserType` (id / name / email) — WHO made the change. Resolved
11
+ # server-side from `owner_id` via RecordLoader, so it is nil for system-originated
12
+ # commands with no user. Prefer `owner&.name` over `ownerId` for reporting.
13
+ embeds_one :owner, klass: Model::User, nullable: true
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -3,11 +3,14 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Model
5
5
  # Concrete counterparts of `Base::Template::*` (see there for the page-vs-Template
6
- # type asymmetry). No extra wiring needed — both are flat, read-only models.
6
+ # type asymmetry). `Information` and `RelatedPages` need no extra wiring — both are
7
+ # flat, read-only models; `ChangeLogEntry` adds the `owner` embed.
7
8
  module Template
8
9
  class Information < Base::Template::Information; end
9
10
 
10
11
  class RelatedPages < Base::Template::RelatedPages; end
12
+
13
+ require_relative 'template/change_log_entry'
11
14
  end
12
15
  end
13
16
  end
@@ -20,11 +20,20 @@ require_relative 'model/page_union'
20
20
  require_relative 'model/preview_page'
21
21
  require_relative 'model/resource'
22
22
  require_relative 'model/action'
23
+ require_relative 'model/action_event_page'
24
+ require_relative 'model/action_event'
23
25
  require_relative 'model/contractor_entity'
26
+ require_relative 'model/authorization_result'
27
+ require_relative 'model/permissions'
28
+ require_relative 'model/activity'
29
+ require_relative 'model/activity_log'
30
+ require_relative 'model/auth_log'
31
+ require_relative 'model/person_member_changelog'
24
32
  require_relative 'model/organization'
25
33
 
26
34
  require_relative 'model/register'
27
35
  require_relative 'model/preset_view'
36
+ require_relative 'model/minimal_dashboard'
28
37
 
29
38
  require_relative 'model/ai_summary_version'
30
39
  require_relative 'model/pages_workflow'
@@ -3,27 +3,38 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Mutation
5
5
  module AiSummary
6
- # Triggers AI summary generation for a page or stage.
7
- # Returns an AiSummaryVersion with the generated text and token usage.
8
- # Generation is synchronous — the response contains the result or an error.
6
+ # Triggers AI summary generation for a page or stage. Returns an `AiSummaryVersion`.
9
7
  #
10
- # stageId is optional: omit for page-level summary, provide for stage-level.
8
+ # ★ Corrected 2026-07-30 against the live schema — the previous wiring could never run:
9
+ # the mutation is `generatePageSummary(input: GenerateInput!)`, NOT `generateAiSummary`
10
+ # with flat `pageId`/`stageId` arguments, and `AiSummaryVersion` has no token fields.
11
+ #
12
+ # `stage_id` is optional: omit for a page-level summary, pass it for stage-level.
11
13
  class Generate < Logic::Mutation
12
- field_name :generateAiSummary
14
+ field_name :generatePageSummary
13
15
 
14
16
  class_resolver :payload_class, 'Ecoportal::API::GraphQL::Payload::AiSummaryGenerate'
15
17
 
18
+ def query(page_id:, stage_id: nil, **kargs, &block)
19
+ input = { pageId: page_id }
20
+ input[:stageId] = stage_id if stage_id
21
+ super(input: input, **kargs, &block)
22
+ end
23
+
16
24
  private
17
25
 
18
26
  def basic_block(&block)
19
27
  payload_block = block || default_payload_block
20
28
  proc {
21
- mutation(pageId: :id!, stageId: :id) {
22
- generateAiSummary(pageId: :pageId, stageId: :stageId, &payload_block)
29
+ mutation(input: :GenerateInput!) {
30
+ generatePageSummary(input: :input, &payload_block)
23
31
  }
24
32
  }
25
33
  end
26
34
 
35
+ # AiSummaryVersion exposes: aiSummary, alreadyRated, createdAt, dataFieldLogs,
36
+ # generationErrors, id, pagePatchVer, status. Only the plain scalars are selected —
37
+ # `dataFieldLogs` / `generationErrors` / `createdAt` need their own selections.
27
38
  def default_payload_block
28
39
  proc {
29
40
  errors { details fullMessages }
@@ -31,9 +42,8 @@ module Ecoportal
31
42
  id
32
43
  aiSummary
33
44
  status
34
- inputTokens
35
- outputTokens
36
- totalTokens
45
+ alreadyRated
46
+ pagePatchVer
37
47
  }
38
48
  }
39
49
  end
@@ -3,25 +3,40 @@ module Ecoportal
3
3
  class GraphQL
4
4
  module Mutation
5
5
  module AiSummary
6
- # Submit a thumbs-up / thumbs-down rating on an AI summary version.
7
- # sentiment: "THUMBS_UP" | "THUMBS_DOWN"
8
- # aiSummaryVersionId: returned from generateAiSummary.item.id
6
+ # Submit a rating on an AI summary version.
7
+ #
8
+ # ★ Corrected 2026-07-30 against the live schema — the previous wiring could never run:
9
+ # the mutation is `submitPageAiSummaryFeedback(input: SubmitFeedbackInput!)`, the enum is
10
+ # `SentimentEnum` (there is no `AiSummarySentimentEnum`), and its values are
11
+ # **`positive` / `negative`** — not the "THUMBS_UP"/"THUMBS_DOWN" this used to document.
12
+ #
13
+ # `ai_summary_version_id` comes from `generatePageSummary`'s `item.id`.
9
14
  class SubmitFeedback < Logic::Mutation
10
- field_name :submitAiSummaryFeedback
15
+ SENTIMENTS = %w[positive negative].freeze
16
+
17
+ field_name :submitPageAiSummaryFeedback
11
18
 
12
19
  class_resolver :payload_class, 'Ecoportal::API::GraphQL::Payload::OkPayload'
13
20
 
21
+ def query(ai_summary_version_id:, sentiment:, **kargs, &block)
22
+ unless SENTIMENTS.include?(sentiment.to_s)
23
+ raise ArgumentError, "sentiment must be one of #{SENTIMENTS.join(' / ')}; got #{sentiment.inspect}"
24
+ end
25
+
26
+ super(
27
+ input: { aiSummaryVersionId: ai_summary_version_id, sentiment: sentiment.to_s },
28
+ **kargs,
29
+ &block
30
+ )
31
+ end
32
+
14
33
  private
15
34
 
16
35
  def basic_block(&block)
17
36
  payload_block = block || default_payload_block
18
37
  proc {
19
- mutation(aiSummaryVersionId: :id!, sentiment: :AiSummarySentimentEnum!) {
20
- submitAiSummaryFeedback(
21
- aiSummaryVersionId: :aiSummaryVersionId,
22
- sentiment: :sentiment,
23
- &payload_block
24
- )
38
+ mutation(input: :SubmitFeedbackInput!) {
39
+ submitPageAiSummaryFeedback(input: :input, &payload_block)
25
40
  }
26
41
  }
27
42
  end
@@ -0,0 +1,37 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Mutation
5
+ module ContractorEntity
6
+ # `updateContractorManagerSettings` mutation (2026-07 schema).
7
+ # Returns the updated Organization directly.
8
+ class UpdateManagerSettings < Ecoportal::API::GraphQL::Logic::Mutation
9
+ field_name :updateContractorManagerSettings
10
+
11
+ class_resolver :payload_class, Payload::ContractorEntity::ManagerSettings
12
+ class_resolver :input_class, Input::ContractorEntity::ManagerSettings
13
+
14
+ private
15
+
16
+ def basic_block(&block)
17
+ payload_block = block || default_payload_block
18
+ proc {
19
+ mutation(input: :UpdateContractorManagerSettingsInput!) {
20
+ updateContractorManagerSettings(input: :input, &payload_block)
21
+ }
22
+ }
23
+ end
24
+
25
+ def default_payload_block
26
+ proc {
27
+ id
28
+ name
29
+ allowContractorAdminsToAddAdmins
30
+ }
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -12,3 +12,4 @@ end
12
12
  require_relative 'contractor_entity/create'
13
13
  require_relative 'contractor_entity/destroy'
14
14
  require_relative 'contractor_entity/update'
15
+ require_relative 'contractor_entity/update_manager_settings'