ecoportal-api-graphql 1.3.16 → 2.0.0
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 +384 -6
- data/lib/ecoportal/api/common/graphql/model/diffable/leaf_diff_service.rb +97 -0
- data/lib/ecoportal/api/common/graphql/model/diffable.rb +1 -0
- data/lib/ecoportal/api/graphql/base/action.rb +1 -1
- data/lib/ecoportal/api/graphql/base/action_event.rb +23 -0
- data/lib/ecoportal/api/graphql/base/action_event_page.rb +16 -0
- data/lib/ecoportal/api/graphql/base/activity.rb +38 -0
- data/lib/ecoportal/api/graphql/base/activity_log.rb +38 -0
- data/lib/ecoportal/api/graphql/base/ai_summary_version.rb +12 -7
- data/lib/ecoportal/api/graphql/base/auth_log.rb +24 -0
- data/lib/ecoportal/api/graphql/base/authorization_result.rb +20 -0
- data/lib/ecoportal/api/graphql/base/contractor_entity/member_changes.rb +17 -5
- data/lib/ecoportal/api/graphql/base/file_container.rb +12 -4
- data/lib/ecoportal/api/graphql/base/location_classification_type.rb +2 -0
- data/lib/ecoportal/api/graphql/base/location_structure.rb +3 -0
- data/lib/ecoportal/api/graphql/base/minimal_dashboard.rb +25 -0
- data/lib/ecoportal/api/graphql/base/organization.rb +2 -0
- data/lib/ecoportal/api/graphql/base/page/data_field/contractor_entities.rb +26 -3
- data/lib/ecoportal/api/graphql/base/page/data_field/file_field.rb +47 -8
- data/lib/ecoportal/api/graphql/base/page/data_field/image_gallery.rb +5 -2
- data/lib/ecoportal/api/graphql/base/page/data_field/people.rb +50 -12
- data/lib/ecoportal/api/graphql/base/page/data_field.rb +12 -18
- data/lib/ecoportal/api/graphql/base/permissions.rb +15 -0
- data/lib/ecoportal/api/graphql/base/person_member_changelog.rb +23 -0
- data/lib/ecoportal/api/graphql/base/preset_view.rb +136 -1
- data/lib/ecoportal/api/graphql/base/register.rb +5 -0
- data/lib/ecoportal/api/graphql/base.rb +9 -0
- data/lib/ecoportal/api/graphql/builder/contractor_entity.rb +10 -0
- data/lib/ecoportal/api/graphql/builder/page.rb +0 -16
- data/lib/ecoportal/api/graphql/builder/template.rb +18 -0
- data/lib/ecoportal/api/graphql/compat/pages.rb +7 -2
- data/lib/ecoportal/api/graphql/compat/response.rb +14 -0
- data/lib/ecoportal/api/graphql/concerns/threadable.rb +58 -0
- data/lib/ecoportal/api/graphql/concerns.rb +1 -0
- data/lib/ecoportal/api/graphql/connection/action.rb +1 -1
- data/lib/ecoportal/api/graphql/connection/action_category.rb +1 -1
- data/lib/ecoportal/api/graphql/connection/activity.rb +11 -0
- data/lib/ecoportal/api/graphql/connection/activity_log.rb +11 -0
- data/lib/ecoportal/api/graphql/connection/auth_log.rb +11 -0
- data/lib/ecoportal/api/graphql/connection/contractor_entity.rb +1 -1
- data/lib/ecoportal/api/graphql/connection/minimal_dashboard.rb +11 -0
- data/lib/ecoportal/api/graphql/connection/page.rb +1 -1
- data/lib/ecoportal/api/graphql/connection/pages_workflow_command.rb +1 -1
- data/lib/ecoportal/api/graphql/connection/person_member.rb +1 -1
- data/lib/ecoportal/api/graphql/connection/person_member_changelog.rb +11 -0
- data/lib/ecoportal/api/graphql/connection/preview_page.rb +1 -1
- data/lib/ecoportal/api/graphql/connection.rb +5 -0
- data/lib/ecoportal/api/graphql/diff/pairing/signals.rb +21 -1
- data/lib/ecoportal/api/graphql/file_upload/client.rb +199 -140
- data/lib/ecoportal/api/graphql/fragment/activity.rb +84 -0
- data/lib/ecoportal/api/graphql/fragment/activity_log.rb +75 -0
- data/lib/ecoportal/api/graphql/fragment/auth_log.rb +29 -0
- data/lib/ecoportal/api/graphql/fragment/authorization_result.rb +14 -0
- data/lib/ecoportal/api/graphql/fragment/location_node.rb +1 -0
- data/lib/ecoportal/api/graphql/fragment/minimal_dashboard.rb +31 -0
- data/lib/ecoportal/api/graphql/fragment/pages/common_page_union.rb +21 -0
- data/lib/ecoportal/api/graphql/fragment/permissions.rb +98 -0
- data/lib/ecoportal/api/graphql/fragment/person_member_changelog.rb +33 -0
- data/lib/ecoportal/api/graphql/fragment.rb +7 -0
- data/lib/ecoportal/api/graphql/input/action/update.rb +12 -0
- data/lib/ecoportal/api/graphql/input/contractor_entity/manager_settings.rb +20 -0
- data/lib/ecoportal/api/graphql/input/contractor_entity/update.rb +6 -27
- data/lib/ecoportal/api/graphql/input/contractor_entity.rb +1 -0
- data/lib/ecoportal/api/graphql/input/date_range.rb +16 -0
- data/lib/ecoportal/api/graphql/input/location_structure/apply_commands.rb +2 -2
- data/lib/ecoportal/api/graphql/input/location_structure/draft/add_commands.rb +2 -2
- data/lib/ecoportal/api/graphql/input/location_structure/update_command.rb +6 -2
- data/lib/ecoportal/api/graphql/input/preset_view/update.rb +16 -1
- data/lib/ecoportal/api/graphql/input/workflow_command/add_checklist_field_item.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_smart_fill_config.rb +23 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/add_stage.rb +3 -2
- data/lib/ecoportal/api/graphql/input/workflow_command/add_viewable_field.rb +45 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/archive_public_config.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/create_public_config.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_checklist_field_item.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_field_configuration.rb +12 -2
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_public_config.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_smart_fill_config.rb +21 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_template_advanced_settings.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_template_basic_settings.rb +27 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_template_container_uid.rb +45 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/{edit_page_creator_permissions.rb → edit_template_creator_permissions.rb} +3 -2
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_template_descriptions.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/action_list.rb +31 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/cross_reference.rb +3 -1
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/date.rb +15 -2
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/file.rb +21 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/image_gallery.rb +3 -2
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/people.rb +27 -3
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/plain_text.rb +3 -2
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/rich_text.rb +3 -2
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/select.rb +3 -2
- data/lib/ecoportal/api/graphql/input/workflow_command/move_field.rb +3 -2
- data/lib/ecoportal/api/graphql/input/workflow_command/move_viewable_field.rb +33 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_checklist_field_item.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_smart_fill_config.rb +19 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/remove_viewable_field.rb +21 -0
- data/lib/ecoportal/api/graphql/input/workflow_command/reorder_forces.rb +3 -2
- data/lib/ecoportal/api/graphql/input/workflow_command/reorder_section.rb +3 -2
- data/lib/ecoportal/api/graphql/input/workflow_command.rb +43 -5
- data/lib/ecoportal/api/graphql/input.rb +1 -0
- data/lib/ecoportal/api/graphql/interface/base_page.rb +36 -3
- data/lib/ecoportal/api/graphql/interface/location_structure/command.rb +2 -1
- data/lib/ecoportal/api/graphql/logic/connection.rb +17 -0
- data/lib/ecoportal/api/graphql/logic/input.rb +127 -0
- data/lib/ecoportal/api/graphql/model/action_event.rb +14 -0
- data/lib/ecoportal/api/graphql/model/action_event_page.rb +10 -0
- data/lib/ecoportal/api/graphql/model/activity.rb +14 -0
- data/lib/ecoportal/api/graphql/model/activity_log.rb +31 -0
- data/lib/ecoportal/api/graphql/model/auth_log.rb +11 -0
- data/lib/ecoportal/api/graphql/model/authorization_result.rb +12 -0
- data/lib/ecoportal/api/graphql/model/minimal_dashboard.rb +14 -0
- data/lib/ecoportal/api/graphql/model/organization.rb +27 -0
- data/lib/ecoportal/api/graphql/model/permissions.rb +179 -0
- data/lib/ecoportal/api/graphql/model/person_member.rb +7 -0
- data/lib/ecoportal/api/graphql/model/person_member_changelog.rb +15 -0
- data/lib/ecoportal/api/graphql/model.rb +9 -0
- data/lib/ecoportal/api/graphql/mutation/ai_summary/generate.rb +20 -10
- data/lib/ecoportal/api/graphql/mutation/ai_summary/submit_feedback.rb +25 -10
- data/lib/ecoportal/api/graphql/mutation/contractor_entity/update_manager_settings.rb +37 -0
- data/lib/ecoportal/api/graphql/mutation/contractor_entity.rb +1 -0
- data/lib/ecoportal/api/graphql/mutation/file_container/upload.rb +78 -0
- data/lib/ecoportal/api/graphql/mutation/file_container.rb +15 -0
- data/lib/ecoportal/api/graphql/mutation/template/update_related_page.rb +79 -0
- data/lib/ecoportal/api/graphql/mutation/template.rb +1 -0
- data/lib/ecoportal/api/graphql/mutation.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/contractor_entity/manager_settings.rb +20 -0
- data/lib/ecoportal/api/graphql/payload/contractor_entity.rb +1 -0
- data/lib/ecoportal/api/graphql/payload/template/update_related_page.rb +15 -0
- data/lib/ecoportal/api/graphql/payload/template.rb +1 -0
- data/lib/ecoportal/api/graphql/payload/upload.rb +12 -0
- data/lib/ecoportal/api/graphql/payload.rb +1 -0
- data/lib/ecoportal/api/graphql/query/activity_logs.rb +78 -0
- data/lib/ecoportal/api/graphql/query/auth_logs.rb +51 -0
- data/lib/ecoportal/api/graphql/query/dashboard_search.rb +57 -0
- data/lib/ecoportal/api/graphql/query/location_structure.rb +2 -0
- data/lib/ecoportal/api/graphql/query/location_structures.rb +2 -0
- data/lib/ecoportal/api/graphql/query/page.rb +6 -1
- data/lib/ecoportal/api/graphql/query/page_activities.rb +56 -0
- data/lib/ecoportal/api/graphql/query/permissions.rb +35 -0
- data/lib/ecoportal/api/graphql/query/person_member_changelogs.rb +53 -0
- data/lib/ecoportal/api/graphql/query.rb +6 -0
- data/lib/ecoportal/api/graphql_version.rb +1 -1
- metadata +73 -12
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_page.rb +0 -28
- data/lib/ecoportal/api/graphql/mutation/smart_fill/generate.rb +0 -36
- data/lib/ecoportal/api/graphql/mutation/smart_fill/submit_feedback.rb +0 -40
- data/lib/ecoportal/api/graphql/mutation/smart_fill.rb +0 -13
|
@@ -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
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Mutation
|
|
5
|
+
module FileContainer
|
|
6
|
+
# Registers an object already uploaded to S3 as an org file container.
|
|
7
|
+
#
|
|
8
|
+
# ★ This is the REAL second half of a file upload, captured from the web client on
|
|
9
|
+
# 2026-07-30 (`tmp/file_upload_network_log.har`): the browser does
|
|
10
|
+
# `FileSignature` (GraphQL) -> S3 multipart POST -> **`uploadFile` (GraphQL)** ->
|
|
11
|
+
# `updatePage`. There is NO `POST /api/v2/<org>/s3/files` call and NO polling step —
|
|
12
|
+
# the previous implementation was a port of `ecoportal-api-v2`'s REST S3 code and
|
|
13
|
+
# targeted endpoints the platform does not use for this flow.
|
|
14
|
+
#
|
|
15
|
+
# `url` is the S3 object key returned by the upload step (NOT a URL, despite the name —
|
|
16
|
+
# verified against the capture: `uploads/<userId>/<stamp>-<token>-/<filename>`).
|
|
17
|
+
#
|
|
18
|
+
# Verified against the live schema (2026-07-30):
|
|
19
|
+
# uploadFile(input: UploadInput) -> UploadPayload { clientMutationId errors item: FileContainer }
|
|
20
|
+
# UploadInput { clientMutationId filename filetype filesize locationIds otherTags url containerId }
|
|
21
|
+
class Upload < Logic::Mutation
|
|
22
|
+
field_name :uploadFile
|
|
23
|
+
|
|
24
|
+
class_resolver :payload_class, 'Ecoportal::API::GraphQL::Payload::Upload'
|
|
25
|
+
|
|
26
|
+
# @param filename [String] the file's base name as it should appear in the manager.
|
|
27
|
+
# @param filetype [String] MIME type.
|
|
28
|
+
# @param filesize [Integer, String] bytes. The schema types this as `String`.
|
|
29
|
+
# @param url [String] the S3 object KEY produced by the S3 POST step.
|
|
30
|
+
# @param location_ids [Array<String>, nil] locations to file it under.
|
|
31
|
+
# @param other_tags [Array<String>, nil] tags — the only supported way to tag a
|
|
32
|
+
# container (there is no separate tag mutation; confirmed 2026-07-30).
|
|
33
|
+
# @param container_id [String, nil] add a new VERSION to an existing container.
|
|
34
|
+
def query(filename:, filetype:, filesize:, url:, location_ids: nil, other_tags: nil, container_id: nil, **kargs, &block)
|
|
35
|
+
input = {
|
|
36
|
+
filename: filename,
|
|
37
|
+
filetype: filetype,
|
|
38
|
+
filesize: filesize.to_s,
|
|
39
|
+
url: url
|
|
40
|
+
}
|
|
41
|
+
input[:locationIds] = Array(location_ids) if location_ids
|
|
42
|
+
input[:otherTags] = Array(other_tags) if other_tags
|
|
43
|
+
input[:containerId] = container_id if container_id
|
|
44
|
+
|
|
45
|
+
super(input: input, **kargs, &block)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
def basic_block(&block)
|
|
51
|
+
payload_block = block || default_payload_block
|
|
52
|
+
proc {
|
|
53
|
+
mutation(input: :UploadInput!) {
|
|
54
|
+
uploadFile(input: :input, &payload_block)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def default_payload_block
|
|
60
|
+
proc {
|
|
61
|
+
errors { details fullMessages }
|
|
62
|
+
item {
|
|
63
|
+
id
|
|
64
|
+
name
|
|
65
|
+
activeName
|
|
66
|
+
activeVersion
|
|
67
|
+
fileSize
|
|
68
|
+
tags
|
|
69
|
+
otherTags
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Mutation
|
|
5
|
+
# Namespaced `FileContainer` (not `File`) on purpose: a `Mutation::File` module would
|
|
6
|
+
# shadow ::File for every sibling in this namespace, and the payload item type IS a
|
|
7
|
+
# FileContainer.
|
|
8
|
+
module FileContainer
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
require_relative 'file_container/upload'
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Mutation
|
|
5
|
+
module Template
|
|
6
|
+
# `updateRelatedPage(input: UpdateRelatedPageInput!)` — edits an existing related-pages
|
|
7
|
+
# CONFIG entry on a template (title / target register / filters).
|
|
8
|
+
#
|
|
9
|
+
# ★ The worklog long carried this as an "ecoportal backend gap — the only genuine
|
|
10
|
+
# structural template omission". That note is STALE: the mutation exists in the live
|
|
11
|
+
# schema (verified 20260731), so the gap was ours. Without it, related-pages entries
|
|
12
|
+
# could be created and destroyed but never edited — every title or filter change meant
|
|
13
|
+
# destroy + recreate, which loses the entry id.
|
|
14
|
+
#
|
|
15
|
+
# Note the argument name asymmetry, which is the schema's: create/destroy are
|
|
16
|
+
# `createTemplateRelatedPage`/`destroyTemplateRelatedPage`, but update is plain
|
|
17
|
+
# `updateRelatedPage` (no `Template` infix).
|
|
18
|
+
class UpdateRelatedPage < Logic::Mutation
|
|
19
|
+
SCHEMA_VERSION = '20260731'.freeze
|
|
20
|
+
|
|
21
|
+
field_name :updateRelatedPage
|
|
22
|
+
|
|
23
|
+
class_resolver :payload_class, 'Ecoportal::API::GraphQL::Payload::Template::UpdateRelatedPage'
|
|
24
|
+
|
|
25
|
+
# @param template_id [String] the template page id.
|
|
26
|
+
# @param id [String] the RelatedPages entry id being edited.
|
|
27
|
+
# @param patch_ver [Integer] template patchVer (optimistic concurrency).
|
|
28
|
+
# @param title [String, nil] new title. Omitted when nil — the schema treats an absent
|
|
29
|
+
# key as "leave alone", so nil must NOT be sent as an explicit null.
|
|
30
|
+
# @param register_id [String, nil] retarget the entry at another register.
|
|
31
|
+
# @param filters [Array<Hash>, nil] `[SearchFilter!]`. Note `SearchFilter.params` is an
|
|
32
|
+
# untyped `Hash` in the schema, so its inner shape is not validated by GraphQL —
|
|
33
|
+
# callers must get it right themselves.
|
|
34
|
+
def query(template_id:, id:, patch_ver:, title: nil, register_id: nil, filters: nil, **kargs, &block)
|
|
35
|
+
input = self.class.build_input(
|
|
36
|
+
template_id: template_id, id: id, patch_ver: patch_ver,
|
|
37
|
+
title: title, register_id: register_id, filters: filters
|
|
38
|
+
)
|
|
39
|
+
super(input: input, **kargs, &block)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Extracted so the partial-update rule is testable without a client or a network stub.
|
|
43
|
+
# A nil optional key is OMITTED, not serialised as an explicit null — the server reads
|
|
44
|
+
# an absent key as "leave alone", so sending null would blank the stored value.
|
|
45
|
+
def self.build_input(template_id:, id:, patch_ver:, title: nil, register_id: nil, filters: nil)
|
|
46
|
+
{
|
|
47
|
+
templateId: template_id,
|
|
48
|
+
id: id,
|
|
49
|
+
patchVer: patch_ver
|
|
50
|
+
}.tap do |input|
|
|
51
|
+
input[:title] = title unless title.nil?
|
|
52
|
+
input[:registerId] = register_id unless register_id.nil?
|
|
53
|
+
input[:filters] = filters unless filters.nil?
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
private
|
|
58
|
+
|
|
59
|
+
def basic_block(&block)
|
|
60
|
+
payload_block = block || default_payload_block
|
|
61
|
+
proc {
|
|
62
|
+
mutation(input: :UpdateRelatedPageInput!) {
|
|
63
|
+
updateRelatedPage(input: :input, &payload_block)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def default_payload_block
|
|
69
|
+
proc {
|
|
70
|
+
item { spread :TemplateRelatedPages }
|
|
71
|
+
errors { details fullMessages }
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -15,4 +15,5 @@ require_relative 'template/publish'
|
|
|
15
15
|
require_relative 'template/unpublish'
|
|
16
16
|
require_relative 'template/update_information'
|
|
17
17
|
require_relative 'template/create_related_page'
|
|
18
|
+
require_relative 'template/update_related_page'
|
|
18
19
|
require_relative 'template/destroy_related_page'
|
|
@@ -15,6 +15,6 @@ require_relative 'mutation/register'
|
|
|
15
15
|
require_relative 'mutation/preset_view'
|
|
16
16
|
|
|
17
17
|
require_relative 'mutation/ai_summary'
|
|
18
|
-
require_relative 'mutation/smart_fill'
|
|
19
18
|
require_relative 'mutation/kickstand'
|
|
20
19
|
require_relative 'mutation/template'
|
|
20
|
+
require_relative 'mutation/file_container'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Payload
|
|
5
|
+
module ContractorEntity
|
|
6
|
+
# Payload for `updateContractorManagerSettings`, which returns the
|
|
7
|
+
# updated Organization directly (not a { clientMutationId, errors, item }
|
|
8
|
+
# wrapper). Read-only view of the org fields relevant to the mutation.
|
|
9
|
+
class ManagerSettings < Logic::BaseModel
|
|
10
|
+
read_only!
|
|
11
|
+
|
|
12
|
+
passkey :id
|
|
13
|
+
passthrough :name
|
|
14
|
+
passboolean :allowContractorAdminsToAddAdmins
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Payload
|
|
5
|
+
module Template
|
|
6
|
+
# `UpdateRelatedPagePayload { clientMutationId, errors, item: RelatedPages }` — same
|
|
7
|
+
# shape as CreateTemplateRelatedPagePayload.
|
|
8
|
+
class UpdateRelatedPage < Logic::Payload
|
|
9
|
+
class_resolver :item_class, 'Ecoportal::API::GraphQL::Model::Template::RelatedPages'
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -15,4 +15,5 @@ require_relative 'template/publish'
|
|
|
15
15
|
require_relative 'template/unpublish'
|
|
16
16
|
require_relative 'template/update_information'
|
|
17
17
|
require_relative 'template/create_related_page'
|
|
18
|
+
require_relative 'template/update_related_page'
|
|
18
19
|
require_relative 'template/destroy_related_page'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Payload
|
|
5
|
+
# `uploadFile` -> `UploadPayload { clientMutationId errors item: FileContainer }`.
|
|
6
|
+
class Upload < Logic::Payload
|
|
7
|
+
class_resolver :item_class, 'Ecoportal::API::GraphQL::Model::FileContainer'
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Query
|
|
5
|
+
# System Access Logs on `currentOrganization.activityLogs`, returning an
|
|
6
|
+
# ActivityLogUnionConnection. Exposes the full server filter set.
|
|
7
|
+
#
|
|
8
|
+
# Enum args are passed as GraphQL enum type names:
|
|
9
|
+
# - resourceType: ActivityLogTypesEnum
|
|
10
|
+
# (view_page|download_file|access_denied|view_dashboard|
|
|
11
|
+
# create_dashboard|update_dashboard|delete_dashboard)
|
|
12
|
+
# - source: SourceEnum (web|mobile|public|api|auto_page_creation|public_template|script)
|
|
13
|
+
# - dateFilter: DateRange ({ from:, to: })
|
|
14
|
+
class ActivityLogs < Logic::QueryConnection
|
|
15
|
+
field_name :activityLogs
|
|
16
|
+
|
|
17
|
+
accepted_params :userIds, :resourceIds, :filterSuperusers, :activityType,
|
|
18
|
+
:resourceType, :source, :dateFilter,
|
|
19
|
+
:after, :before, :first, :last
|
|
20
|
+
|
|
21
|
+
class_resolver :item_class, Model::ActivityLog
|
|
22
|
+
class_resolver :connection_class, Connection::ActivityLog
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
def basic_block(&block)
|
|
27
|
+
connection_block = block || default_connection_block
|
|
28
|
+
proc {
|
|
29
|
+
query(
|
|
30
|
+
userIds: '[ID!]',
|
|
31
|
+
resourceIds: '[ID!]',
|
|
32
|
+
filterSuperusers: :boolean,
|
|
33
|
+
activityType: :string,
|
|
34
|
+
resourceType: :ActivityLogTypesEnum,
|
|
35
|
+
source: :SourceEnum,
|
|
36
|
+
dateFilter: :DateRange,
|
|
37
|
+
after: :string,
|
|
38
|
+
before: :string,
|
|
39
|
+
first: :int,
|
|
40
|
+
last: :int
|
|
41
|
+
) {
|
|
42
|
+
currentOrganization {
|
|
43
|
+
activityLogs(
|
|
44
|
+
userIds: :userIds,
|
|
45
|
+
resourceIds: :resourceIds,
|
|
46
|
+
filterSuperusers: :filterSuperusers,
|
|
47
|
+
activityType: :activityType,
|
|
48
|
+
resourceType: :resourceType,
|
|
49
|
+
source: :source,
|
|
50
|
+
dateFilter: :dateFilter,
|
|
51
|
+
after: :after,
|
|
52
|
+
before: :before,
|
|
53
|
+
first: :first,
|
|
54
|
+
last: :last,
|
|
55
|
+
&connection_block
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def default_connection_block
|
|
63
|
+
proc {
|
|
64
|
+
totalCount
|
|
65
|
+
pageInfo {
|
|
66
|
+
endCursor
|
|
67
|
+
hasNextPage
|
|
68
|
+
}
|
|
69
|
+
nodes {
|
|
70
|
+
spread :ActivityLog
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Query
|
|
5
|
+
class AuthLogs < Logic::QueryConnection
|
|
6
|
+
field_name :authLogs
|
|
7
|
+
|
|
8
|
+
class_resolver :item_class, Model::AuthLog
|
|
9
|
+
class_resolver :connection_class, Connection::AuthLog
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
def basic_block(&block)
|
|
14
|
+
connection_block = block || default_connection_block
|
|
15
|
+
proc {
|
|
16
|
+
query(
|
|
17
|
+
after: :string,
|
|
18
|
+
before: :string,
|
|
19
|
+
first: :int,
|
|
20
|
+
last: :int
|
|
21
|
+
) {
|
|
22
|
+
currentOrganization {
|
|
23
|
+
authLogs(
|
|
24
|
+
after: :after,
|
|
25
|
+
before: :before,
|
|
26
|
+
first: :first,
|
|
27
|
+
last: :last,
|
|
28
|
+
&connection_block
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def default_connection_block
|
|
36
|
+
proc {
|
|
37
|
+
totalCount
|
|
38
|
+
pageInfo {
|
|
39
|
+
endCursor
|
|
40
|
+
hasNextPage
|
|
41
|
+
}
|
|
42
|
+
nodes {
|
|
43
|
+
spread :AuthLog
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Query
|
|
5
|
+
# Dashboard search on `Organization.dashboardSearch`, returning a
|
|
6
|
+
# MinimalDashboardConnection. The same `dashboardSearch` field exists on
|
|
7
|
+
# other resolvers (Register/Reporting/TodoActions/...) that the gem does
|
|
8
|
+
# not yet model; this covers the org-level entry point.
|
|
9
|
+
class DashboardSearch < Logic::QueryConnection
|
|
10
|
+
field_name :dashboardSearch
|
|
11
|
+
|
|
12
|
+
class_resolver :item_class, Model::MinimalDashboard
|
|
13
|
+
class_resolver :connection_class, Connection::MinimalDashboard
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
def basic_block(&block)
|
|
18
|
+
connection_block = block || default_connection_block
|
|
19
|
+
proc {
|
|
20
|
+
query(
|
|
21
|
+
searchConf: :Search,
|
|
22
|
+
after: :string,
|
|
23
|
+
before: :string,
|
|
24
|
+
first: :int,
|
|
25
|
+
last: :int
|
|
26
|
+
) {
|
|
27
|
+
currentOrganization {
|
|
28
|
+
dashboardSearch(
|
|
29
|
+
searchConf: :searchConf,
|
|
30
|
+
after: :after,
|
|
31
|
+
before: :before,
|
|
32
|
+
first: :first,
|
|
33
|
+
last: :last,
|
|
34
|
+
&connection_block
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def default_connection_block
|
|
42
|
+
proc {
|
|
43
|
+
totalCount
|
|
44
|
+
pageInfo {
|
|
45
|
+
endCursor
|
|
46
|
+
hasNextPage
|
|
47
|
+
}
|
|
48
|
+
nodes {
|
|
49
|
+
spread :MinimalDashboard
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -8,7 +8,12 @@ module Ecoportal
|
|
|
8
8
|
# directly (e.g. Compat::Pages#get) rather than via the currentOrganization proxy.
|
|
9
9
|
base_path 'currentOrganization'
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
# Besides `id`, the CommonPageUnion document variables can be overridden per call
|
|
12
|
+
# (they keep their document-level defaults when not passed). `content: false` matters
|
|
13
|
+
# for least-privilege accounts: the fragment's `attachedFiles @include(if: $content)`
|
|
14
|
+
# is preauthorized on the `files: download` ability, so an account without it cannot
|
|
15
|
+
# complete ANY page read unless content is excluded.
|
|
16
|
+
accepted_params :id, :showHiddenData, :content, :only_content, :fields
|
|
12
17
|
class_resolver :item_class, 'Ecoportal::API::GraphQL::Model::PageUnion'
|
|
13
18
|
|
|
14
19
|
private
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Query
|
|
5
|
+
# Page history / activity feed on `page.activities`, returning an
|
|
6
|
+
# ActivityInterfaceConnection. Resolves under
|
|
7
|
+
# `currentOrganization.page(id:).activities(...)`.
|
|
8
|
+
#
|
|
9
|
+
# `Organization.page(id:)` returns a PageUnion (BasicPage | PhasedPage), so the
|
|
10
|
+
# `activities` connection is selected via inline fragments on both members —
|
|
11
|
+
# provided by the :PageActivities fragment (which also carries the connection
|
|
12
|
+
# selection via :ActivityConnection). The connection selection is therefore
|
|
13
|
+
# fixed by the fragment; a custom connection block is not accepted here.
|
|
14
|
+
#
|
|
15
|
+
# The web "page history changelog" feature drives this with
|
|
16
|
+
# `searchConf: { sorters: [{ direction: 'desc', key: 'updated_at' }] }`.
|
|
17
|
+
class PageActivities < Logic::QueryConnection
|
|
18
|
+
field_name :activities
|
|
19
|
+
# The connection nests under currentOrganization.page; wrap_response digs
|
|
20
|
+
# this path (the inline-fragment `activities` merges into `page`).
|
|
21
|
+
base_path 'currentOrganization.page'
|
|
22
|
+
|
|
23
|
+
accepted_params :id, :searchConf, :after, :before, :first, :last
|
|
24
|
+
|
|
25
|
+
class_resolver :item_class, Model::Activity
|
|
26
|
+
class_resolver :connection_class, Connection::Activity
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def basic_block(&_block)
|
|
31
|
+
proc {
|
|
32
|
+
query(
|
|
33
|
+
id: :id!,
|
|
34
|
+
searchConf: :Search,
|
|
35
|
+
after: :string,
|
|
36
|
+
before: :string,
|
|
37
|
+
first: :int,
|
|
38
|
+
last: :int
|
|
39
|
+
) {
|
|
40
|
+
currentOrganization {
|
|
41
|
+
page(id: :id) {
|
|
42
|
+
spread :PageActivities
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def default_connection_block
|
|
50
|
+
proc { spread :ActivityConnection }
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Query
|
|
5
|
+
# Fetches the org-level permission set: currentOrganization.permissions.
|
|
6
|
+
# Returns a Model::Permissions whose ~83 canXXX fields are AuthorizationResult.
|
|
7
|
+
# Selects the :Permissions fragment (which spreads :AuthorizationResult per field).
|
|
8
|
+
class Permissions < Logic::Query
|
|
9
|
+
field_name :permissions
|
|
10
|
+
|
|
11
|
+
class_resolver :item_class, Model::Permissions
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def basic_block(&block)
|
|
16
|
+
final_block = block || default_query_block
|
|
17
|
+
proc {
|
|
18
|
+
query {
|
|
19
|
+
currentOrganization {
|
|
20
|
+
permissions(&final_block)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def default_query_block
|
|
27
|
+
proc {
|
|
28
|
+
spread :Permissions
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
module Ecoportal
|
|
2
|
+
module API
|
|
3
|
+
class GraphQL
|
|
4
|
+
module Query
|
|
5
|
+
class PersonMemberChangelogs < Logic::QueryConnection
|
|
6
|
+
field_name :personMemberChangelogs
|
|
7
|
+
|
|
8
|
+
class_resolver :item_class, Model::PersonMemberChangelog
|
|
9
|
+
class_resolver :connection_class, Connection::PersonMemberChangelog
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
def basic_block(&block)
|
|
14
|
+
connection_block = block || default_connection_block
|
|
15
|
+
proc {
|
|
16
|
+
query(
|
|
17
|
+
searchConf: :Search,
|
|
18
|
+
after: :string,
|
|
19
|
+
before: :string,
|
|
20
|
+
first: :int,
|
|
21
|
+
last: :int
|
|
22
|
+
) {
|
|
23
|
+
currentOrganization {
|
|
24
|
+
personMemberChangelogs(
|
|
25
|
+
searchConf: :searchConf,
|
|
26
|
+
after: :after,
|
|
27
|
+
before: :before,
|
|
28
|
+
first: :first,
|
|
29
|
+
last: :last,
|
|
30
|
+
&connection_block
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def default_connection_block
|
|
38
|
+
proc {
|
|
39
|
+
totalCount
|
|
40
|
+
pageInfo {
|
|
41
|
+
endCursor
|
|
42
|
+
hasNextPage
|
|
43
|
+
}
|
|
44
|
+
nodes {
|
|
45
|
+
spread :PersonMemberChangelog
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|